parameters: (points,surface=False)
return_statement: return pol_points
docstring: Conversion from Cartesian to polar coordinates.
  
      Parameters
      ----------
      points  : `array_like, float, shape (N,2)`
          Real valued points in Cartesian coordinates :math:`(x, y)`. `N` is 
          the number of points and :math:`x=\mathrm{points[:,0]}`, 
          :math:`y=\mathrm{points[:,1]}`. 
      surface : `bool, optional, default False`
          Inputted points lie only on a circle or not.  It is the user's 
          responsibility to guarantee the correctness of this assertion.
          If `False` (the default), the outputted points are two-dimensional 
          (`d=2`) with :math:`(r,\phi)` returned.  If `True`, only :math:`\phi` 
          is returned (`d=1`).
  
      Returns
      -------
      pol_points : `ndarray, float, shape (N,d)`
          Real valued points in polar coordinates.
docstring_summary: Conversion from Cartesian to polar coordinates.
docstring_tokens: Conversion from Cartesian to polar coordinates .
function: def cartesian_to_polar(points,surface=False):
      """
      Conversion from Cartesian to polar coordinates.
  
      Parameters
      ----------
      points  : `array_like, float, shape (N,2)`
          Real valued points in Cartesian coordinates :math:`(x, y)`. `N` is 
          the number of points and :math:`x=\mathrm{points[:,0]}`, 
          :math:`y=\mathrm{points[:,1]}`. 
      surface : `bool, optional, default False`
          Inputted points lie only on a circle or not.  It is the user's 
          responsibility to guarantee the correctness of this assertion.
          If `False` (the default), the outputted points are two-dimensional 
          (`d=2`) with :math:`(r,\phi)` returned.  If `True`, only :math:`\phi` 
          is returned (`d=1`).
  
      Returns
      -------
      pol_points : `ndarray, float, shape (N,d)`
          Real valued points in polar coordinates.
      """
      if not isinstance(points,np.ndarray):
          points = np.array(points)
      #end if
      npoints,dim = points.shape
      if dim!=2:
          error('dimension of points must be 2\ndimension of provided points: {}'.format(dim),'cartesian_to_polar')
      #end if
      x = points[:,0]
      y = points[:,1]
      r   = np.linalg.norm(points,axis=1)
      phi = np.arctan2(y,x)
      phi[np.abs(phi)<1e-12] = 0.0
      phi[phi<0] += 2*np.pi
      if surface:
          pol_points = np.array((phi,),dtype=points.dtype).T
      else:
          pol_points = np.array((r,phi),dtype=points.dtype).T
      #end if
      return pol_points
function_tokens: def cartesian_to_polar ( points , surface = False ) : if not isinstance ( points , np . ndarray ) : points = np . array ( points ) #end if npoints , dim = points . shape if dim != 2 : error ( 'dimension of points must be 2\ndimension of provided points: {}' . format ( dim ) , 'cartesian_to_polar' ) #end if x = points [ : , 0 ] y = points [ : , 1 ] r = np . linalg . norm ( points , axis = 1 ) phi = np . arctan2 ( y , x ) phi [ np . abs ( phi ) < 1e-12 ] = 0.0 phi [ phi < 0 ] += 2 * np . pi if surface : pol_points = np . array ( ( phi , ) , dtype = points . dtype ) . T else : pol_points = np . array ( ( r , phi ) , dtype = points . dtype ) . T #end if return pol_points