code: def parse_dynamic_args(dyn_args):
      k = None
      output = dict()
      for arg in dyn_args:
          if "=" in arg:
              k, v = arg.split("=")
              k = arg.replace("--", "")
              output[k] = v
              k = None
          else:
              if arg.startswith("--"):
                  k = arg.replace("--", "")
              elif k is not None:
                  v = arg
                  output[k] = v
                  k = None
              else:
                  raise Exception(
                      "Invalid command line arguments structure. "
                      "Each argument name and its value should be "
                      "separated by either '=' or space=' '. "
                      "For example, '--lr=1e-4' or 'lr 1e-4'. "
                      f"Invalid arg: {arg}"
                  )
  
      return output
  
file_path: Merlin/examples/quick_start/scripts/ranking/args_parsing.py
imports: import argparse
  from enum import Enum
label_desc: Use image node_id 2 for calling a global function with example usage: parse_dynamic_args(dyn_args) and returns: output