code: def format_attrs(attrs):
      
      if not attrs:
          return ''
      entries = ['='.join((key, value)) for key, value in iteritems(attrs)]
      return '[' + ', '.join(entries) + ']'
docs: Format key, value pairs from attrs into graphviz attrs format
  
      Examples
      --------
      >>> format_attrs({'key1': 'value1', 'key2': 'value2'})  # doctest: +SKIP
      '[key1=value1, key2=value2]'