(model)
return size_name_to_element_names
Returns a dict that maps size names to element names.

  Args:
    model: An instance of `mjbindings.mjModelWrapper`.

  Returns:
    A `dict` mapping from a size name (e.g. `'nbody'`) to a list of element
    names.
Returns a dict that maps size names to element names.
Returns a dict that maps size names to element names .
def _get_size_name_to_element_names(model):
  """Returns a dict that maps size names to element names.

  Args:
    model: An instance of `mjbindings.mjModelWrapper`.

  Returns:
    A `dict` mapping from a size name (e.g. `'nbody'`) to a list of element
    names.
  """

  names = model.names[:model.nnames]
  size_name_to_element_names = {}

  for field_name in dir(model):
    if not _is_name_pointer(field_name):
      continue

    # Get addresses of element names in `model.names` array, e.g.
    # field name: `name_nbodyadr` and name_addresses: `[86, 92, 101]`, and skip
    # when there are no elements for this type in the model.
    name_addresses = getattr(model, field_name).ravel()
    if not name_addresses.size:
      continue

    # Get the element names.
    element_names = []
    for start_index in name_addresses:
      name = names[start_index:names.find(b'\0', start_index)]
      element_names.append(util.to_native_string(name))

    # String identifier for the size of the first dimension, e.g. 'nbody'.
    size_name = _get_size_name(field_name)

    size_name_to_element_names[size_name] = element_names

  # Add custom element names for certain columns.
  for size_name, element_names in _COLUMN_NAMES.items():
    size_name_to_element_names[size_name] = element_names

  # "Ragged" axes inherit their element names from other "non-ragged" axes.
  # For example, the element names for "nv" axis come from "njnt".
  for size_name, address_field_name in _RAGGED_ADDRS.items():
    donor = 'n' + address_field_name.split('_')[0]
    if donor in size_name_to_element_names:
      size_name_to_element_names[size_name] = size_name_to_element_names[donor]

  # Mocap bodies are a special subset of bodies.
  mocap_body_names = [None] * model.nmocap
  for body_id, body_name in enumerate(size_name_to_element_names['nbody']):
    body_mocapid = model.body_mocapid[body_id]
    if body_mocapid != -1:
      mocap_body_names[body_mocapid] = body_name
  assert None not in mocap_body_names
  size_name_to_element_names['nmocap'] = mocap_body_names

  # Arrays with dimension `na` correspond to stateful actuators. MuJoCo's
  # compiler requires that these are always defined after stateless actuators,
  # so we only need the final `na` elements in the list of all actuator names.
  if model.na:
    all_actuator_names = size_name_to_element_names['nu']
    size_name_to_element_names['na'] = all_actuator_names[-model.na:]

  return size_name_to_element_names
def _get_size_name_to_element_names ( model ) : names = model . names [ : model . nnames ] size_name_to_element_names = { } for field_name in dir ( model ) : if not _is_name_pointer ( field_name ) : continue # Get addresses of element names in `model.names` array, e.g. # field name: `name_nbodyadr` and name_addresses: `[86, 92, 101]`, and skip # when there are no elements for this type in the model. name_addresses = getattr ( model , field_name ) . ravel ( ) if not name_addresses . size : continue # Get the element names. element_names = [ ] for start_index in name_addresses : name = names [ start_index : names . find ( b'\0' , start_index ) ] element_names . append ( util . to_native_string ( name ) ) # String identifier for the size of the first dimension, e.g. 'nbody'. size_name = _get_size_name ( field_name ) size_name_to_element_names [ size_name ] = element_names # Add custom element names for certain columns. for size_name , element_names in _COLUMN_NAMES . items ( ) : size_name_to_element_names [ size_name ] = element_names # "Ragged" axes inherit their element names from other "non-ragged" axes. # For example, the element names for "nv" axis come from "njnt". for size_name , address_field_name in _RAGGED_ADDRS . items ( ) : donor = 'n' + address_field_name . split ( '_' ) [ 0 ] if donor in size_name_to_element_names : size_name_to_element_names [ size_name ] = size_name_to_element_names [ donor ] # Mocap bodies are a special subset of bodies. mocap_body_names = [ None ] * model . nmocap for body_id , body_name in enumerate ( size_name_to_element_names [ 'nbody' ] ) : body_mocapid = model . body_mocapid [ body_id ] if body_mocapid != - 1 : mocap_body_names [ body_mocapid ] = body_name assert None not in mocap_body_names size_name_to_element_names [ 'nmocap' ] = mocap_body_names # Arrays with dimension `na` correspond to stateful actuators. MuJoCo's # compiler requires that these are always defined after stateless actuators, # so we only need the final `na` elements in the list of all actuator names. if model . na : all_actuator_names = size_name_to_element_names [ 'nu' ] size_name_to_element_names [ 'na' ] = all_actuator_names [ - model . na : ] return size_name_to_element_names