parameters: (
          self, values, side="left", ascending=True, na_position="last"
      )
docstring: Find indices where elements should be inserted to maintain order
  
          Parameters
          ----------
          value : Frame (Shape must be consistent with self)
              Values to be hypothetically inserted into Self
          side : str {‘left’, ‘right’} optional, default ‘left‘
              If ‘left’, the index of the first suitable location found is given
              If ‘right’, return the last such index
          ascending : bool optional, default True
              Sorted Frame is in ascending order (otherwise descending)
          na_position : str {‘last’, ‘first’} optional, default ‘last‘
              Position of null values in sorted order
  
          Returns
          -------
          1-D cupy array of insertion points
  
          Examples
          --------
          >>> s = cudf.Series([1, 2, 3])
          >>> s.searchsorted(4)
          3
          >>> s.searchsorted([0, 4])
          array([0, 3], dtype=int32)
          >>> s.searchsorted([1, 3], side='left')
          array([0, 2], dtype=int32)
          >>> s.searchsorted([1, 3], side='right')
          array([1, 3], dtype=int32)
  
          If the values are not monotonically sorted, wrong
          locations may be returned:
  
          >>> s = cudf.Series([2, 1, 3])
          >>> s.searchsorted(1)
          0   # wrong result, correct would be 1
  
          >>> df = cudf.DataFrame({'a': [1, 3, 5, 7], 'b': [10, 12, 14, 16]})
          >>> df
             a   b
          0  1  10
          1  3  12
          2  5  14
          3  7  16
          >>> values_df = cudf.DataFrame({'a': [0, 2, 5, 6],
          ... 'b': [10, 11, 13, 15]})
          >>> values_df
             a   b
          0  0  10
          1  2  17
          2  5  13
          3  6  15
          >>> df.searchsorted(values_df, ascending=False)
          array([4, 4, 4, 0], dtype=int32)
docstring_summary: Find indices where elements should be inserted to maintain order
docstring_tokens: Find indices where elements should be inserted to maintain order
function: def searchsorted(
          self, values, side="left", ascending=True, na_position="last"
      ):
          """Find indices where elements should be inserted to maintain order
  
          Parameters
          ----------
          value : Frame (Shape must be consistent with self)
              Values to be hypothetically inserted into Self
          side : str {‘left’, ‘right’} optional, default ‘left‘
              If ‘left’, the index of the first suitable location found is given
              If ‘right’, return the last such index
          ascending : bool optional, default True
              Sorted Frame is in ascending order (otherwise descending)
          na_position : str {‘last’, ‘first’} optional, default ‘last‘
              Position of null values in sorted order
  
          Returns
          -------
          1-D cupy array of insertion points
  
          Examples
          --------
          >>> s = cudf.Series([1, 2, 3])
          >>> s.searchsorted(4)
          3
          >>> s.searchsorted([0, 4])
          array([0, 3], dtype=int32)
          >>> s.searchsorted([1, 3], side='left')
          array([0, 2], dtype=int32)
          >>> s.searchsorted([1, 3], side='right')
          array([1, 3], dtype=int32)
  
          If the values are not monotonically sorted, wrong
          locations may be returned:
  
          >>> s = cudf.Series([2, 1, 3])
          >>> s.searchsorted(1)
          0   # wrong result, correct would be 1
  
          >>> df = cudf.DataFrame({'a': [1, 3, 5, 7], 'b': [10, 12, 14, 16]})
          >>> df
             a   b
          0  1  10
          1  3  12
          2  5  14
          3  7  16
          >>> values_df = cudf.DataFrame({'a': [0, 2, 5, 6],
          ... 'b': [10, 11, 13, 15]})
          >>> values_df
             a   b
          0  0  10
          1  2  17
          2  5  13
          3  6  15
          >>> df.searchsorted(values_df, ascending=False)
          array([4, 4, 4, 0], dtype=int32)
          """
          # Call libcudf++ search_sorted primitive
  
          if na_position not in {"first", "last"}:
              raise ValueError(f"invalid na_position: {na_position}")
  
          scalar_flag = None
          if is_scalar(values):
              scalar_flag = True
  
          if not isinstance(values, Frame):
              values = as_column(values)
              if values.dtype != self.dtype:
                  self = self.astype(values.dtype)
              values = values.as_frame()
          outcol = libcudf.search.search_sorted(
              self, values, side, ascending=ascending, na_position=na_position
          )
  
          # Retrun result as cupy array if the values is non-scalar
          # If values is scalar, result is expected to be scalar.
          result = cupy.asarray(outcol.data_array_view)
          if scalar_flag:
              return result[0].item()
          else:
              return result
function_tokens: def searchsorted ( self , values , side = "left" , ascending = True , na_position = "last" ) : # Call libcudf++ search_sorted primitive if na_position not in { "first" , "last" } : raise ValueError ( f"invalid na_position: {na_position}" ) scalar_flag = None if is_scalar ( values ) : scalar_flag = True if not isinstance ( values , Frame ) : values = as_column ( values ) if values . dtype != self . dtype : self = self . astype ( values . dtype ) values = values . as_frame ( ) outcol = libcudf . search . search_sorted ( self , values , side , ascending = ascending , na_position = na_position ) # Retrun result as cupy array if the values is non-scalar # If values is scalar, result is expected to be scalar. result = cupy . asarray ( outcol . data_array_view ) if scalar_flag : return result [ 0 ] . item ( ) else : return result