original_docstring: 
          Perform online diffusion for a sequence of data points.
          Args:
              X: List of data points.
              agg: If True, will aggregate queries and find their combined neighbors.
  
          Returns:
              Diffusion scores and ids
  
          
docstring: Perform online diffusion for a sequence of data points.
docstring_tokens: Perform online diffusion for a sequence of data points .
code: def online_search(self, X, agg=False):
          """
          Perform online diffusion for a sequence of data points.
          Args:
              X: List of data points.
              agg: If True, will aggregate queries and find their combined neighbors.
  
          Returns:
              Diffusion scores and ids
  
          """
  
          y, ids = self._initialize_online(X, agg=agg)
          f_opt = self._diffuse_online(y, ids)
  
          if (
              agg
              or self.truncation_size is None
              or self.truncation_size >= self.l_inv_.shape[0]
          ):
              f_opt, ranks = _sort2d(f_opt)
          else:
              f_opt, ranks = _sort2d_trunc(f_opt, self.truncation_size)
  
          return f_opt, ranks
code_tokens: def online_search ( self , X , agg = False ) : y , ids = self . _initialize_online ( X , agg = agg ) f_opt = self . _diffuse_online ( y , ids ) if ( agg or self . truncation_size is None or self . truncation_size >= self . l_inv_ . shape [ 0 ] ) : f_opt , ranks = _sort2d ( f_opt ) else : f_opt , ranks = _sort2d_trunc ( f_opt , self . truncation_size ) return f_opt , ranks
short_docstring: Perform online diffusion for a sequence of data points.
short_docstring_tokens: Perform online diffusion for a sequence of data points .
comment: """
          Perform online diffusion for a sequence of data points.
          Args:
              X: List of data points.
              agg: If True, will aggregate queries and find their combined neighbors.
  
          Returns:
              Diffusion scores and ids
  
          """