code: def _normalise_json_ordered(
      data: dict[str, Any], separator: str
  ) -> dict[str, Any]:
      """
      Order the top level keys and then recursively go to depth
  
      Parameters
      ----------
      data : dict or list of dicts
      separator : str, default '.'
          Nested records will generate names separated by sep,
          e.g., for sep='.', { 'foo' : { 'bar' : 0 } } -> foo.bar
  
      Returns
      -------
      dict or list of dicts, matching `normalised_json_object`
      """
      top_dict_ = {
          k: v for k, v in data.items() if not isinstance(v, dict)
      }
      nested_dict_ = _normalise_json(
          data={k: v for k, v in data.items() if isinstance(v, dict)},
          key_string="",
          normalized_dict={},
          separator=separator,
      )
      return {**top_dict_, **nested_dict_}
  
file_path: pandas/pandas/io/json/_normalize.py
imports: from __future__ import annotations
  from collections import abc, defaultdict
  import copy
  from typing import TYPE_CHECKING, Any, DefaultDict
  import numpy
  from pandas._libs.writers import convert_json_to_lines
  import pandas
  from pandas import DataFrame
label_desc: Use image node_id 4 for calling a global function with example usage: _normalise_json_ordered(data, separator) and returns: dict