code: def dict_to_key_value_args(some_dict: dict, quote_str: bool = True):
      items = []
      for key, value in some_dict.items():
          encoded = (
              f"'{value}'"
              if quote_str and isinstance(value, str)
              else value
          )
          items.append(f"{key}={encoded}")
      return items
  
imports: import contextlib
  import itertools
  import math
  import operator
  import platform
  import hashlib
  import inspect
  import sys
  import uuid
  import os
  import asyncio
  import collections
  from pathlib import Path
  from snakemake._version import get_versions
  from snakemake_interface_common.exceptions import WorkflowError
label_desc: Use image node_id 4 for calling a global function with example usage: dict_to_key_value_args(some_dict, quote_str) and returns: items