code: def nested_key_indices(nested_dict):
      
      outer_keys, inner_keys = collect_nested_keys(nested_dict)
      outer_key_indices = {k: i for (i, k) in enumerate(outer_keys)}
      inner_key_indices = {k: i for (i, k) in enumerate(inner_keys)}
      return outer_key_indices, inner_key_indices
docs: Give an ordering to the outer and inner keys used in a dictionary that
      maps to dictionaries.