code: def trim_zeros(filt, trim="fb"):
      first = 0
      trim = trim.upper()
      if "F" in trim:
          for i in filt:
              if i != 0.0:
                  break
              else:
                  first = first + 1
      last = ivy.shape(filt)[0]
      if "B" in trim:
          for i in filt[::-1]:
              if i != 0.0:
                  break
              else:
                  last = last - 1
      return filt[first:last]
  
imports: from collections import namedtuple
  import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back
label_desc: Use image node_id 2 for calling a global function with example usage: trim_zeros(filt, trim) and returns: filt