code: def recursive_update(d, u, must_match=False):
      """Similar function to `dict.update`, but for a nested `dict`.
  
      From: https://stackoverflow.com/a/3233356
  
      If you have to a nested mapping structure, for example:
  
          {"a": 1, "b": {"c": 2}}
  
      Say you want to update the above structure with:
  
          {"b": {"d": 3}}
  
      This function will produce:
  
          {"a": 1, "b": {"c": 2, "d": 3}}
  
      Instead of:
  
          {"a": 1, "b": {"d": 3}}
  
      Arguments
      ---------
      d : dict
          Mapping to be updated.
      u : dict
          Mapping to update with.
      must_match : bool
          Whether to throw an error if the key in `u` does not exist in `d`.
  
      Example
      -------
      >>> d = {'a': 1, 'b': {'c': 2}}
      >>> recursive_update(d, {'b': {'d': 3}})
      >>> d
      {'a': 1, 'b': {'c': 2, 'd': 3}}
      """
      # TODO: Consider cases where u has branch off k, but d does not.
      # e.g. d = {"a":1}, u = {"a": {"b": 2 }}
      for k, v in u.items():
          if isinstance(v, collections.abc.Mapping) and k in d:
              recursive_update(d.get(k, {}), v)
          elif must_match and k not in d:
              raise KeyError(
                  f"Override '{k}' not found in: {[key for key in d.keys()]}"
              )
          else:
              d[k] = v
  
imports: import math
  import os
  import re
  import csv
  import shutil
  import urllib.request
  import collections.abc
  import torch
  import tqdm
  import pathlib
  import speechbrain
  from numbers import Number
label_desc: Use image node_id 6 for calling a global function with example usage: recursive_update(d, u, must_match) without return types