code: def searchsorted_ref(sorted_sequence, values, right, out_dtype):
      """Run Numpy searchsorted on 1-D or N-D sorted_sequence."""
      side = "right" if right else "left"
      if len(sorted_sequence.shape) == 1 and len(values.shape) > 1:
          sorted_sequence_2d = np.tile(
              sorted_sequence, (np.prod(values.shape[:-1]), 1)
          )
      else:
          sorted_sequence_2d = np.reshape(
              sorted_sequence, (-1, sorted_sequence.shape[-1])
          )
  
      values_2d = np.reshape(values, (-1, values.shape[-1]))
      indices = np.zeros(values_2d.shape, dtype=out_dtype)
  
      for i in range(indices.shape[0]):
          indices[i] = np.searchsorted(
              sorted_sequence_2d[i], values_2d[i], side=side
          )
  
      return np.reshape(indices, values.shape)
  
label_desc: Use image node_id 1 for calling a global function with example usage: searchsorted_ref(sorted_sequence, values, right, out_dtype) and returns: np