code: def make_dot_dimension_numbers(
      dimension_numbers: Union[
          DotDimensionNumbers,
          Tuple[
              Tuple[List[int], List[int]], Tuple[List[int], List[int]]
          ],
      ]
  ) -> DotDimensionNumbers:
      """Builds a DotDimensionNumbers object from a specification.
  
      Args:
        dimension_numbers: either a `DotDimensionNumbers` or a nested tuple
          `((lhs_contract, rhs_contract), (lhs_batch, rhs_batch))` of lists of
          integers representing the dimensions to treat as contracting dimensions
          and batch dimensions on each input operand.
  
      Returns:
        A `DotDimensionNumbers` object.
      """
      if isinstance(dimension_numbers, (list, tuple)):
          (lhs_contract, rhs_contract), (
              lhs_batch,
              rhs_batch,
          ) = dimension_numbers
          dot_dims_proto = DotDimensionNumbers()
          dot_dims_proto.lhs_contracting_dimensions.extend(lhs_contract)
          dot_dims_proto.rhs_contracting_dimensions.extend(rhs_contract)
          dot_dims_proto.lhs_batch_dimensions.extend(lhs_batch)
          dot_dims_proto.rhs_batch_dimensions.extend(rhs_batch)
          return dot_dims_proto
      else:
          return dimension_numbers
  
imports: from __future__ import annotations
  import atexit
  import contextlib
  import enum
  import gzip
  import inspect
  import logging
  import os
  import threading
  from typing import Any, List, Mapping, Optional, Sequence, Tuple, Union
  import ml_dtypes
  import numpy
  from .None import xla_extension
label_desc: Use image node_id 23 for calling a global function with example usage: make_dot_dimension_numbers(dimension_numbers) and returns: dot_dims_proto, dimension_numbers