code: def _simple_json_normalize(
      ds: dict | list[dict],
      sep: str = ".",
  ) -> dict | list[dict] | Any:
      """
      A optimized basic json_normalize
  
      Converts a nested dict into a flat dict ("record"), unlike
      json_normalize and nested_to_record it doesn't do anything clever.
      But for the most basic use cases it enhances performance.
      E.g. pd.json_normalize(data)
  
      Parameters
      ----------
      ds : dict or list of dicts
      sep : str, default '.'
          Nested records will generate names separated by sep,
          e.g., for sep='.', { 'foo' : { 'bar' : 0 } } -> foo.bar
  
      Returns
      -------
      frame : DataFrame
      d - dict or list of dicts, matching `normalised_json_object`
  
      Examples
      --------
      >>> _simple_json_normalize(
      ...     {
      ...         "flat1": 1,
      ...         "dict1": {"c": 1, "d": 2},
      ...         "nested": {"e": {"c": 1, "d": 2}, "d": 2},
      ...     }
      ... )
      {\
  'flat1': 1, \
  'dict1.c': 1, \
  'dict1.d': 2, \
  'nested.e.c': 1, \
  'nested.e.d': 2, \
  'nested.d': 2\
  }
  
      """
      normalised_json_object = {}
      # expect a dictionary, as most jsons are. However, lists are perfectly valid
      if isinstance(ds, dict):
          normalised_json_object = _normalise_json_ordered(
              data=ds, separator=sep
          )
      elif isinstance(ds, list):
          normalised_json_list = [
              _simple_json_normalize(row, sep=sep) for row in ds
          ]
          return normalised_json_list
      return normalised_json_object
  
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 5 for calling a global function with example usage: _simple_json_normalize(ds, sep) and returns: normalised_json_object, normalised_json_list