def format_parameter(*args, **kwargs):
    """Format a parameter string

    >>> format_parameter(ex=['example', 'one'])
    '"ex=example:one"'
    >>> format_parameter('one', 'two', 'three')
    'one:two:three'

    You can mix the arguments und keyword arguments.
    """
    parameter_list = []
    for value in args:
        if value is not None:
            parameter_list.append(str(value))
    for key, value in kwargs.items():
        try:
            if not value:
                parameter_list.append(key)
            else:
                parameter_list.append("=".join([key, value]))
        except TypeError:
            values = ':'.join(kwargs[key])
            parameter_list.append("=".join([key, values]))
    result = ':'.join(parameter_list)
    if kwargs:
        return '"%s"' % result
    return result