code: def a_list(
      label: typing.Optional[str] = None, kwargs=None, attributes=None
  ) -> str:
      """Return assembled DOT a_list string.
  
      >>> a_list('spam', {'spam': None, 'ham': 'ham ham', 'eggs': ''})
      'label=spam eggs="" ham="ham ham"'
      """
      result = [f"label={quote(label)}"] if label is not None else []
      if kwargs:
          items = [
              f"{quote(k)}={quote(v)}"
              for k, v in tools.mapping_items(kwargs)
              if v is not None
          ]
          result.extend(items)
      if attributes:
          if hasattr(attributes, "items"):
              attributes = tools.mapping_items(attributes)
          items = [
              f"{quote(k)}={quote(v)}"
              for k, v in attributes
              if v is not None
          ]
          result.extend(items)
      return " ".join(result)
  
file_path: catboost/contrib/python/graphviz/py3/graphviz/lang.py
imports: import functools
  import re
  import typing
  from .None import tools
label_desc: Use image node_id 3 for calling a global function with example usage: a_list(label, kwargs, attributes) and returns: str