

def classes(*args, **kwargs):
    "Helper function for dynamically assembling a list of CSS class names\n    in templates.\n\n    Any positional arguments are added to the list of class names. All\n    positional arguments must be strings:\n\n    >>> classes('foo', 'bar')\n    u'foo bar'\n\n    In addition, the names of any supplied keyword arguments are added if they\n    have a truth value:\n\n    >>> classes('foo', bar=True)\n    u'foo bar'\n    >>> classes('foo', bar=False)\n    u'foo'\n\n    If none of the arguments are added to the list, this function returns\n    `None`:\n\n    >>> classes(bar=False)\n    "
    classes = (list(filter(None, args)) + [kwargs for (k, v) in kwargs.items() if v])
    if (not classes):
        return None
    return ' '.join(classes)

dataset/ETHPy150Open edgewall/trac/trac/util/presentation.py classes/VarMisuse@30/259 `k`->`kwargs`