code: def _(obj: dict, config=None):  # noqa: C901
      config = config or {}
  
      result = ""
      for k, v in flatten(obj).items():
          if isinstance(v, bool):
              if v:
                  result += f"--{k} "
              elif (
                  config.get("bool", "store_true") == "boolean_optional"
              ):
                  result += f"--no-{k} "
  
          elif isinstance(v, str):
              result += f"--{k} {escape_str(v)} "
  
          elif isinstance(v, Iterable):
              for n, i in enumerate(v):
                  if isinstance(i, str):
                      i = escape_str(i)
                  elif isinstance(i, Iterable):
                      raise ParseError(
                          f"Cannot interpolate nested iterable in '{k}'"
                      )
  
                  if config.get("list", "nargs") == "append":
                      result += f"--{k} {i} "
                  else:
                      result += f"{i} " if n > 0 else f"--{k} {i} "
  
          else:
              result += f"--{k} {v} "
  
      return result.rstrip()
  
imports: import os
  import re
  import typing
  from collections.abc import Iterable, Mapping
  from functools import singledispatch
  from funcy import memoize, rpartial
  from dvc.exceptions import DvcException
  from dvc.utils.flatten import flatten
label_desc: Use image node_id 10 for calling a global function with example usage: _(obj, config) and returns: result