code: def ref_searchsorted(sorted_sequence, values, right):
      assert (
          sorted_sequence.ndim == values.ndim
      ), "ndim of sorted_sequence and values array must be same"
  
      for i in range(values.ndim - 1):
          assert (
              sorted_sequence.shape[i] == values.shape[i]
          ), f"inner dimensions of sorted sequence and values must match. {sorted_sequence.shape[i]}!={values.shape[i]}"
  
      side = "right" if right else "left"
      values_shape = values.shape
  
      sorted_sequence = sorted_sequence.reshape(
          -1, sorted_sequence.shape[-1]
      )
      values = values.reshape(-1, values.shape[-1])
  
      out_list = []
      for i in range(sorted_sequence.shape[0]):
          out_list.append(
              np.searchsorted(sorted_sequence[i], values[i], side=side)
          )
      out = np.concatenate([out_[None, :] for out_ in out_list], axis=0)
      return out.reshape(values_shape)
  
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nbla_test_utils import list_context
label_desc: Use image node_id 1 for calling a global function with example usage: ref_searchsorted(sorted_sequence, values, right) and returns: out