code: def unfold_dict_or_list(obj: Union[Dict, List, OrderedDict]):
      """
      Recursively unfolds all the parameters in dictionaries and lists
      :param obj: a dictionary or list to unfold
      :return: the unfolded parameters dictionary
      """
      parameters = OrderedDict()
      items = iterable_to_items(obj)
      for k, v in items:
          if (
              isinstance(v, dict)
              or isinstance(v, list)
              or isinstance(v, OrderedDict)
          ):
              if "tensorflow." not in str(v.__class__):
                  parameters[k] = unfold_dict_or_list(v)
          elif "tensorflow." in str(v.__class__):
              parameters[k] = v
          elif hasattr(v, "__dict__"):
              sub_params = v.__dict__
              if "__objclass__" not in sub_params.keys():
                  try:
                      parameters[k] = unfold_dict_or_list(sub_params)
                  except RecursionError:
                      parameters[k] = sub_params
                  parameters[k]["__class__"] = v.__class__.__name__
              else:
                  # unfolding this type of object will result in infinite recursion
                  parameters[k] = sub_params
          else:
              parameters[k] = v
      if not isinstance(obj, OrderedDict) and not isinstance(obj, list):
          parameters = OrderedDict(sorted(parameters.items()))
      return parameters
  
imports: import inspect
  import json
  import os
  import sys
  import types
  from collections import OrderedDict
  from enum import Enum
  from typing import Dict, List, Union
  from rl_coach.core_types import TrainingSteps, EnvironmentSteps, GradientClippingMethod, RunPhase, SelectedPhaseOnlyDumpFilter, MaxDumpFilter
  from rl_coach.filters.filter import NoInputFilter
  from rl_coach.logger import screen
label_desc: Use image node_id 2 for calling a global function with example usage: unfold_dict_or_list(obj) and returns: parameters