code: def flatten(d, parent_key="", sep="."):
      items = []
      for k, v in d.items():
          new_key = parent_key + sep + k if parent_key else k
          if isinstance(v, collections.abc.MutableMapping):
              items.extend(flatten(v, new_key, sep=sep).items())
          else:
              items.append((new_key, v))
      return dict(items)
  
file_path: lm-evaluation-harness/tests/test_version_stable.py
imports: import lm_eval.tasks
  import lm_eval.models
  import lm_eval.evaluator
  import random
  import pytest
  import os
  import json
  import hashlib
  import collections
label_desc: Use image node_id 3 for calling a global function with example usage: flatten(d, parent_key, sep) and returns: dict