code: def expand_dims(
      x: Union[tf.Tensor, tf.Variable],
      /,
      *,
      copy: Optional[bool] = None,
      axis: Union[int, Sequence[int]] = 0,
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> Union[tf.Tensor, tf.Variable]:
      try:
          out_shape = _calculate_out_shape(axis, x.shape)
          ret = tf.reshape(x, shape=out_shape)
          return ret
      except (tf.errors.InvalidArgumentError, np.AxisError) as error:
          raise ivy.utils.exceptions.IvyIndexError(error) from error
  
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 3 for calling a global function with example usage: expand_dims() and returns: ret