code: def _default_dim_to_name(inputs_shape, event_inputs=None):
      DIM_TO_NAME = tuple(map("_pyro_dim_{}".format, range(-100, 0)))
      dim_to_name_list = (
          DIM_TO_NAME + event_inputs if event_inputs else DIM_TO_NAME
      )
      dim_to_name = OrderedDict(
          zip(
              range(-len(inputs_shape), 0),
              dim_to_name_list[
                  len(dim_to_name_list) - len(inputs_shape) :
              ],
          )
      )
      name_to_dim = OrderedDict(
          (name, dim) for dim, name in dim_to_name.items()
      )
      return dim_to_name, name_to_dim
  
imports: import re
  from collections import OrderedDict, namedtuple
  from importlib import import_module
  import numpy
  import pytest
  import funsor
  import funsor.ops
  from funsor.distribution import BACKEND_TO_DISTRIBUTIONS_BACKEND
  from funsor.interpretations import CallableInterpretation, eager, lazy, normalize, reflect
  from funsor.terms import to_data, to_funsor
  from funsor.testing import assert_close, check_funsor, excludes_backend, rand, randint, randn, random_scale_tril, xfail_if_not_found, xfail_if_not_implemented, xfail_param
  from funsor.util import get_backend
label_desc: Use image node_id 2 for calling a global function with example usage: _default_dim_to_name(inputs_shape, event_inputs) and returns: dim_to_name,  name_to_dim