code: def trim_zeros(flit, trim="fb"):
      start_index = 0
      end_index = ivy.shape(flit)[0]
      trim = trim.lower()
      if "f" in trim:
          for item in flit:
              if item == 0:
                  start_index += 1
              else:
                  break
      if "b" in trim:
          for item in flit[::-1]:
              if item == 0:
                  end_index -= 1
              else:
                  break
      return flit[start_index:end_index]
  
imports: import ivy
  from ivy.functional.frontends.jax.func_wrapper import to_ivy_arrays_and_back, handle_jax_dtype
  from ivy.functional.frontends.jax.numpy import promote_types_of_jax_inputs
label_desc: Use image node_id 44 for calling a global function with example usage: trim_zeros(flit, trim) and returns: flit