nodes: 0, module; 1, function_definition; 2, function_name:PCA_components; 3, parameters; 4, block; 5, identifier:x; 6, expression_statement; 7, comment:# validate inputs; 8, try_statement; 9, comment:# eigen values and eigen vectors of data covariance matrix; 10, expression_statement; 11, comment:# sort eigen vectors according biggest eigen value; 12, expression_statement; 13, comment:# form output - order the eigenvalues; 14, return_statement; 15, comment:"""
      Principal Component Analysis helper to check out eigenvalues of components.
  
      **Args:**
  
      * `x` : input matrix (2d array), every row represents new sample
  
      **Returns:**
      
      * `components`: sorted array of principal components eigenvalues 
          
      """; 16, block; 17, except_clause; 18, assignment; 19, assignment; 20, subscript; 21, expression_statement; 22, block; 23, pattern_list; 24, call; 25, identifier:eigen_order; 26, subscript; 27, identifier:eigen_values; 28, call; 29, assignment; 30, raise_statement; 31, identifier:eigen_values; 32, identifier:eigen_vectors; 33, attribute; 34, argument_list; 35, attribute; 36, call; 37, attribute; 38, argument_list; 39, identifier:x; 40, call; 41, call; 42, attribute; 43, identifier:eig; 44, call; 45, identifier:eigen_vectors; 46, identifier:T; 47, attribute; 48, argument_list; 49, parenthesized_expression; 50, identifier:argsort; 51, attribute; 52, argument_list; 53, identifier:ValueError; 54, argument_list; 55, identifier:np; 56, identifier:linalg; 57, attribute; 58, argument_list; 59, parenthesized_expression; 60, identifier:argsort; 61, unary_operator; 62, identifier:np; 63, identifier:array; 64, identifier:x; 65, string; 66, identifier:np; 67, identifier:cov; 68, attribute; 69, unary_operator; 70, identifier:eigen_values; 71, string_content:Impossible to convert x to a numpy array.; 72, identifier:x; 73, identifier:T; 74, identifier:eigen_values
code: def PCA_components(x):
      """
      Principal Component Analysis helper to check out eigenvalues of components.
  
      **Args:**
  
      * `x` : input matrix (2d array), every row represents new sample
  
      **Returns:**
      
      * `components`: sorted array of principal components eigenvalues 
          
      """ 
      # validate inputs
      try:    
          x = np.array(x)
      except:
          raise ValueError('Impossible to convert x to a numpy array.')
      # eigen values and eigen vectors of data covariance matrix
      eigen_values, eigen_vectors = np.linalg.eig(np.cov(x.T))
      # sort eigen vectors according biggest eigen value
      eigen_order = eigen_vectors.T[(-eigen_values).argsort()]
      # form output - order the eigenvalues
      return eigen_values[(-eigen_values).argsort()]