code: def expand_dims(
      input, axis=None, name=None, dim=None
  ):  # pylint: disable=redefined-builtin
      """Creates a StructuredTensor with a length 1 axis inserted at index `axis`.
  
      This is an implementation of tf.expand_dims for StructuredTensor. Note
      that the `axis` must be less than or equal to rank.
  
      >>> st = StructuredTensor.from_pyval([[{"x": 1}, {"x": 2}], [{"x": 3}]])
      >>> tf.expand_dims(st, 0).to_pyval()
      [[[{'x': 1}, {'x': 2}], [{'x': 3}]]]
      >>> tf.expand_dims(st, 1).to_pyval()
      [[[{'x': 1}, {'x': 2}]], [[{'x': 3}]]]
      >>> tf.expand_dims(st, 2).to_pyval()
      [[[{'x': 1}], [{'x': 2}]], [[{'x': 3}]]]
      >>> tf.expand_dims(st, -1).to_pyval()  # -1 is the same as 2
      [[[{'x': 1}], [{'x': 2}]], [[{'x': 3}]]]
  
      Args:
        input: the original StructuredTensor.
        axis: the axis to insert the dimension: `-(rank + 1) <= axis <= rank`
        name: the name of the op.
        dim: deprecated: use axis.
  
      Returns:
        a new structured tensor with larger rank.
  
      Raises:
        an error if `axis < -(rank + 1)` or `rank < axis`.
      """
      axis = deprecation.deprecated_argument_lookup(
          "axis", axis, "dim", dim
      )
      return _expand_dims_impl(input, axis, name=name)
  
imports: from typing import Sequence
  from tensorflow.core.config import flags
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops.ragged import dynamic_ragged_shape
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.ops.ragged.row_partition import RowPartition
  from tensorflow.python.ops.structured.structured_tensor import StructuredTensor
  from tensorflow.python.util import deprecation
  from tensorflow.python.util import dispatch
label_desc: Use image node_id 3 for calling a global function with example usage: expand_dims(input, axis, name, dim) and returns: _expand_dims_impl