parameters: (value, new_type)
docstring: Recursively replace mappings with `new_type`.
docstring_summary: Recursively replace mappings with `new_type`.
docstring_tokens: Recursively replace mappings with new_type .
function: def _change_nested_mappings_to(value, new_type):
    """Recursively replace mappings with `new_type`."""
    if isinstance(value, (dict, immutable_dict.ImmutableDict)):
      return new_type([(k, _change_nested_mappings_to(v, new_type))
                       for (k, v) in value.items()])
    elif isinstance(value, tuple):
      return tuple(_change_nested_mappings_to(elt, new_type) for elt in value)
    else:
      return value
function_tokens: def _change_nested_mappings_to ( value , new_type ) : if isinstance ( value , ( dict , immutable_dict . ImmutableDict ) ) : return new_type ( [ ( k , _change_nested_mappings_to ( v , new_type ) ) for ( k , v ) in value . items ( ) ] ) elif isinstance ( value , tuple ) : return tuple ( _change_nested_mappings_to ( elt , new_type ) for elt in value ) else : return value