code: def compress(condition, a, axis=None, out=None):
      condition_arr = ivy.asarray(condition).astype(bool)
      if condition_arr.ndim != 1:
          raise ivy.utils.exceptions.IvyException(
              "Condition must be a 1D array"
          )
      if axis is None:
          arr = ivy.asarray(a).flatten()
          axis = 0
      else:
          arr = ivy.moveaxis(a, axis, 0)
      if condition_arr.shape[0] > arr.shape[0]:
          raise ivy.utils.exceptions.IvyException(
              "Condition contains entries that are out of bounds"
          )
      arr = arr[: condition_arr.shape[0]]
      return ivy.moveaxis(arr[condition_arr], 0, axis)
  
file_path: ivy/ivy/functional/frontends/numpy/indexing_routines/indexing_like_operations.py
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back, inputs_to_ivy_arrays, handle_numpy_out
label_desc: Use image node_id 1 for calling a global function with example usage: compress(condition, a, axis, out) and returns: ivy