code: def searchsorted(
      x: np.ndarray,
      v: np.ndarray,
      /,
      *,
      side: Literal["left", "right"] = "left",
      sorter: Optional[Union[np.ndarray, List[int]]] = None,
      ret_dtype: np.dtype = np.int64,
      out: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      assert ivy.is_int_dtype(ret_dtype), TypeError(
          "only Integer data types are supported for ret_dtype."
      )
      is_sorter_provided = sorter is not None
      if is_sorter_provided:
          assert ivy.is_int_dtype(sorter.dtype), TypeError(
              f"Only signed integer data type for sorter is allowed, got {sorter.dtype}."
          )
      if x.ndim != 1:
          assert x.shape[:-1] == v.shape[:-1], RuntimeError(
              "the first N-1 dimensions of x array and v array "
              f"must match, got {x.shape} and {v.shape}"
          )
          if is_sorter_provided:
              x = np.take_along_axis(x, sorter, axis=-1)
          original_shape = v.shape
          x = x.reshape(-1, x.shape[-1])
          v = v.reshape(-1, v.shape[-1])
          out_array = np.empty_like(v)
          for i in range(x.shape[0]):
              out_array[i] = np.searchsorted(x[i], v[i], side=side)
          ret = out_array.reshape(original_shape)
      else:
          ret = np.searchsorted(x, v, side=side, sorter=sorter)
      return ret.astype(ret_dtype)
  
file_path: ivy/ivy/functional/backends/numpy/sorting.py
imports: import numpy
  from typing import Optional, Literal, Union, List
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from .None import backend_version
label_desc: Use image node_id 4 for calling a global function with example usage: searchsorted() and returns: ret