original_docstring: Takes a 2*M array of particle positions and returns an array of shape
      `B.shape`. The result is a density field computed by cloud-in-cell method.
docstring: Takes a 2*M array of particle positions and returns an array of shape
  `B.shape`. The result is a density field computed by cloud-in-cell method.
docstring_tokens: Takes a 2 * M array of particle positions and returns an array of shape ` B . shape ` . The result is a density field computed by cloud - in - cell method .
code: def md_cic(B: Box, X: np.ndarray) -> np.ndarray:
      """Takes a 2*M array of particle positions and returns an array of shape
      `B.shape`. The result is a density field computed by cloud-in-cell method."""
      f  = X - np.floor(X)
  
      rho = np.zeros(B.shape, dtype='float64')
      rho_, x_, y_ = np.histogram2d(X[:,0]%B.N, X[:,1]%B.N, bins=B.shape,
                          range=[[0, B.N], [0, B.N]],
                          weights=(1 - f[:,0])*(1 - f[:,1]))
      rho += rho_
      rho_, x_, y_ = np.histogram2d((X[:,0]+1)%B.N, X[:,1]%B.N, bins=B.shape,
                          range=[[0, B.N], [0, B.N]],
                          weights=(f[:,0])*(1 - f[:,1]))
      rho += rho_
      rho_, x_, y_ = np.histogram2d(X[:,0]%B.N, (X[:,1]+1)%B.N, bins=B.shape,
                          range=[[0, B.N], [0, B.N]],
                          weights=(1 - f[:,0])*(f[:,1]))
      rho += rho_
      rho_, x_, y_ = np.histogram2d((X[:,0]+1)%B.N, (X[:,1]+1)%B.N, bins=B.shape,
                          range=[[0, B.N], [0, B.N]],
                          weights=(f[:,0])*(f[:,1]))
      rho += rho_
  
      return rho
code_tokens: def md_cic ( B : Box , X : np . ndarray ) -> np . ndarray : f = X - np . floor ( X ) rho = np . zeros ( B . shape , dtype = 'float64' ) rho_ , x_ , y_ = np . histogram2d ( X [ : , 0 ] % B . N , X [ : , 1 ] % B . N , bins = B . shape , range = [ [ 0 , B . N ] , [ 0 , B . N ] ] , weights = ( 1 - f [ : , 0 ] ) * ( 1 - f [ : , 1 ] ) ) rho += rho_ rho_ , x_ , y_ = np . histogram2d ( ( X [ : , 0 ] + 1 ) % B . N , X [ : , 1 ] % B . N , bins = B . shape , range = [ [ 0 , B . N ] , [ 0 , B . N ] ] , weights = ( f [ : , 0 ] ) * ( 1 - f [ : , 1 ] ) ) rho += rho_ rho_ , x_ , y_ = np . histogram2d ( X [ : , 0 ] % B . N , ( X [ : , 1 ] + 1 ) % B . N , bins = B . shape , range = [ [ 0 , B . N ] , [ 0 , B . N ] ] , weights = ( 1 - f [ : , 0 ] ) * ( f [ : , 1 ] ) ) rho += rho_ rho_ , x_ , y_ = np . histogram2d ( ( X [ : , 0 ] + 1 ) % B . N , ( X [ : , 1 ] + 1 ) % B . N , bins = B . shape , range = [ [ 0 , B . N ] , [ 0 , B . N ] ] , weights = ( f [ : , 0 ] ) * ( f [ : , 1 ] ) ) rho += rho_ return rho
short_docstring: Takes a 2*M array of particle positions and returns an array of shape
  `B.shape`.
short_docstring_tokens: Takes a 2 * M array of particle positions and returns an array of shape ` B . shape ` .
comment: """Takes a 2*M array of particle positions and returns an array of shape
      `B.shape`. The result is a density field computed by cloud-in-cell method."""