code: def searchsorted(
      a: NdarrayTensor,
      v: NdarrayOrTensor,
      right=False,
      sorter=None,
      **kwargs,
  ) -> NdarrayTensor:
      """
      `np.searchsorted` with equivalent implementation for torch.
  
      Args:
          a: numpy array or tensor, containing monotonically increasing sequence on the innermost dimension.
          v: containing the search values.
          right: if False, return the first suitable location that is found, if True, return the last such index.
          sorter: if `a` is numpy array, optional array of integer indices that sort array `a` into ascending order.
          kwargs: if `a` is PyTorch Tensor, additional args for `torch.searchsorted`, more details:
              https://pytorch.org/docs/stable/generated/torch.searchsorted.html.
  
      """
      side = "right" if right else "left"
      if isinstance(a, np.ndarray):
          return np.searchsorted(a, v, side, sorter)  # type: ignore
      return torch.searchsorted(a, v, right=right, **kwargs)
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from typing import TypeVar
  import numpy
  import torch
  from monai.config.type_definitions import NdarrayOrTensor, NdarrayTensor
  from monai.utils.misc import is_module_ver_at_least
  from monai.utils.type_conversion import convert_data_type, convert_to_dst_type
label_desc: Use image node_id 19 for calling a global function with example usage: searchsorted(a, v, right, sorter) and returns: torch, np