code: def squeeze(
      x: Union[tf.Tensor, tf.Variable],
      /,
      *,
      axis: Optional[Union[int, Sequence[int]]] = None,
      copy: Optional[bool] = None,
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> Union[tf.Tensor, tf.Variable]:
      if isinstance(axis, int):
          if ivy.any(x.shape[axis] > 1):
              raise ValueError(
                  f"{x.shape[axis]} must be lesser than or equal to 1"
              )
          ret = tf.squeeze(x, axis)
      elif axis is None:
          ret = tf.squeeze(x)
      else:
          if isinstance(axis, tuple):
              axis = list(axis)
          normalise_axis = [
              (len(x.shape) - abs(element)) if element < 0 else element
              for element in axis
          ]
          normalise_axis.sort()
          axis_updated_after_squeeze = [
              dim - key for (key, dim) in enumerate(normalise_axis)
          ]
          for i in axis_updated_after_squeeze:
              if x.shape[i] > 1:
                  raise ValueError(
                      "Expected dimension of size 1, but found dimension size"
                      f" {x.shape[i]}"
                  )
              else:
                  x = tf.squeeze(x, i)
          ret = x
      return ret
  
imports: import math
  from numbers import Number
  from typing import Union, Tuple, Optional, List, Sequence
  import numpy
  import tensorflow
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.ivy.manipulation import _calculate_out_shape
  from .None import backend_version
label_desc: Use image node_id 8 for calling a global function with example usage: squeeze() and returns: ret