code: def update_dictionaries(
      default_dict, overwrite_dicts=None, allow_unknown_keys=True
  ):
      """Adds default key-value pairs to items in ``overwrite_dicts``.
  
      Merges the items in ``default_dict`` and ``overwrite_dicts``,
      preferring ``overwrite_dict`` if there are conflicts.
  
      If ``overwrite_dicts`` is a list of dictionaries, the merge is
      applied to each dictionary in the list.
  
      Parameters
      ----------
      default_dict: `dict`
          Dictionary of default values.
      overwrite_dicts: `dict` or None or `list` [`dict` or None], optional, default None
          User-provided dictionary that overrides the defaults,
          or a list of such dictionaries.
      allow_unknown_keys: `bool`, optional, default True
          If false, raises an error if ``overwrite_dicts`` contains a key that is
          not in ``default_dict``.
  
      Returns
      -------
      updated_dict : `dict` or `list` [`dict`]
          Updated dictionary of list of dictionaries.
          Returns ``overwrite_dicts``, with default values added
          to each dictionary based on ``default_dict``.
      """
      if isinstance(overwrite_dicts, (list, tuple)):
          updated_dict = [
              update_dictionary(
                  default_dict,
                  overwrite_dict=item,
                  allow_unknown_keys=allow_unknown_keys,
              )
              for item in overwrite_dicts
          ]
      else:
          updated_dict = update_dictionary(
              default_dict,
              overwrite_dict=overwrite_dicts,
              allow_unknown_keys=allow_unknown_keys,
          )
      return updated_dict
  
imports: import copy
  import dataclasses
  import functools
  import math
  import re
  import warnings
  from dataclasses import field
  from typing import List
  import numpy
  import pandas
  from pandas.testing import assert_frame_equal
  from pandas.testing import assert_index_equal
  from pandas.testing import assert_series_equal
label_desc: Use image node_id 2 for calling a global function with example usage: update_dictionaries(default_dict, overwrite_dicts, allow_unknown_keys) and returns: updated_dict