code: def trim_zeros(
      a: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      trim: Optional[str] = "fb",
  ) -> ivy.Array:
      """ivy.Container instance method variant of ivy.trim_zeros. This method
      simply wraps the function, and so the docstring for ivy.trim_zeros also
      applies to this method with minimal changes.
  
      Parameters
      ----------
      a : 1-D array
          Input array.
      trim : str, optional
          A string with 'f' representing trim from front and 'b' to trim from
          back. Default is 'fb', trim zeros from both front and back of the
          array.
  
      Returns
      -------
          1-D array
          The result of trimming the input. The input data type is preserved.
  
      Examples
      --------
      >>> a = ivy.array([0, 0, 0, 0, 8, 3, 0, 0, 7, 1, 0])
      >>> ivy.trim_zeros(a)
      array([8, 3, 0, 0, 7, 1])
      >>> ivy.trim_zeros(a, 'b')
      array([0, 0, 0, 0, 8, 3, 0, 0, 7, 1])
      >>> ivy.trim_zeros([0, 8, 3, 0, 0])
      [8, 3]
      """
      return ivy.current_backend(a).trim_zeros(a, trim=trim)
  
imports: from typing import Optional, Union, Tuple, Iterable, Sequence, Callable, Any, Literal, List
  from numbers import Number
  from functools import partial
  import math
  import ivy
  from ivy.func_wrapper import handle_out_argument, handle_partial_mixed_function, to_native_arrays_and_back, inputs_to_native_shapes, handle_nestable, handle_array_like_without_promotion, handle_view, inputs_to_ivy_arrays, handle_array_function, handle_device, handle_backend_invalid
  from ivy.functional.ivy.general import _numel
  from ivy.utils.backend import current_backend
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 59 for calling a global function with example usage: trim_zeros() and returns: ivy