def searchsorted(arr, value, side="<STR_LIT:left>", sorter=None):
if sorter is not None:<EOL><INDENT>sorter = ensure_platform_int(sorter)<EOL><DEDENT>if isinstance(arr, np.ndarray) and is_integer_dtype(arr) and (<EOL>is_integer(value) or is_integer_dtype(value)):<EOL><INDENT>from .arrays.array_ import array<EOL>iinfo = np.iinfo(arr.dtype.type)<EOL>value_arr = np.array([value]) if is_scalar(value) else np.array(value)<EOL>if (value_arr >= iinfo.min).all() and (value_arr <= iinfo.max).all():<EOL><INDENT>dtype = arr.dtype<EOL><DEDENT>else:<EOL><INDENT>dtype = value_arr.dtype<EOL><DEDENT>if is_scalar(value):<EOL><INDENT>value = dtype.type(value)<EOL><DEDENT>else:<EOL><INDENT>value = array(value, dtype=dtype)<EOL><DEDENT><DEDENT>elif not (is_object_dtype(arr) or is_numeric_dtype(arr) or<EOL>is_categorical_dtype(arr)):<EOL><INDENT>from pandas.core.series import Series<EOL>value_ser = Series(value)._values<EOL>value = value_ser[<NUM_LIT:0>] if is_scalar(value) else value_ser<EOL><DEDENT>result = arr.searchsorted(value, side=side, sorter=sorter)<EOL>return result<EOL>
Find indices where elements should be inserted to maintain order.

.. versionadded:: 0.25.0

Find the indices into a sorted array `arr` (a) such that, if the
corresponding elements in `value` were inserted before the indices,
the order of `arr` would be preserved.

Assuming that `arr` is sorted:

======  ================================
`side`  returned index `i` satisfies
======  ================================
left    ``arr[i-1] < value <= self[i]``
right   ``arr[i-1] <= value < self[i]``
======  ================================

Parameters
----------
arr: array-like
    Input array. If `sorter` is None, then it must be sorted in
    ascending order, otherwise `sorter` must be an array of indices
    that sort it.
value : array_like
    Values to insert into `arr`.
side : {'left', 'right'}, optional
    If 'left', the index of the first suitable location found is given.
    If 'right', return the last such index.  If there is no suitable
    index, return either 0 or N (where N is the length of `self`).
sorter : 1-D array_like, optional
    Optional array of integer indices that sort array a into ascending
    order. They are typically the result of argsort.

Returns
-------
array of ints
    Array of insertion points with the same shape as `value`.

See Also
--------
numpy.searchsorted : Similar method from NumPy.