code: def issorted(arr, reverse=False):
      """
      Checks if a numpy array is sorted.
      """
  
      if reverse:
          return np.all(arr[::-1][:-1] <= arr[::-1][1:])
  
      return np.all(arr[:-1] <= arr[1:])
  
file_path: alibi/alibi/tests/utils.py
imports: from contextlib import contextmanager
  from typing import Optional
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: issorted(arr, reverse) and returns: np, np