code: def extract(condition, arr):
      if condition.dtype is not bool:
          condition = condition != 0
      return arr[condition]
  
imports: import logging
  import ivy
  from ivy.functional.frontends.jax.func_wrapper import to_ivy_arrays_and_back
  from ivy.functional.frontends.numpy.func_wrapper import from_zero_dim_arrays_to_scalar
  from ivy.func_wrapper import with_supported_device_and_dtypes, with_unsupported_dtypes
label_desc: Use image node_id 6 for calling a global function with example usage: extract(condition, arr) and returns: arr