Formats any given list of Key-Value pairs or dictionaries in ``*args``
    and any given keyword argument in ``**kwargs``.

    Any item within a given list or dictionary will also be visited and
    added to the output.  Strings will be escaped to prevent leaking binary
    data, ambiguous characters or other control sequences.  Strings with
    escaped characters or spaces  will be encapsulated in quotes.
    Other objects will be converted into a string and will be treated
    as a string afterwards.

    :param \*args:
        Values to format.
    :type \*args:
        any Iterable or Mapping
    :param \*\*kwargs:
        Keyword Values to format
    :return:
        Formatted content of ``*args`` and ``**kwargs``.
    :rtype:
        :data:`six.text_type <six:six.text_type>`

def kv_format(*args, **kwargs):
    """Formats any given list of Key-Value pairs or dictionaries in ``*args``
    and any given keyword argument in ``**kwargs``.

    Any item within a given list or dictionary will also be visited and
    added to the output.  Strings will be escaped to prevent leaking binary
    data, ambiguous characters or other control sequences.  Strings with
    escaped characters or spaces  will be encapsulated in quotes.
    Other objects will be converted into a string and will be treated
    as a string afterwards.

    :param \*args:
        Values to format.
    :type \*args:
        any Iterable or Mapping
    :param \*\*kwargs:
        Keyword Values to format
    :return:
        Formatted content of ``*args`` and ``**kwargs``.
    :rtype:
        :data:`six.text_type <six:six.text_type>`
    """
    pairs = ((dump_dict(arg) if isinstance(arg, Mapping)
              else (dump_key_values(arg) if isinstance(arg, Iterable)
                    else None))
             for arg in args + (kwargs, ))
    return _format_pairs(chain.from_iterable(p for p in pairs if p))