def capitalize_argument(func):
    """
    Wraps a function that returns a string, adding the 'capitalize' argument.

    >>> capsified_fn = capitalize_argument(lambda *args, **kwargs: "what in the beeswax is this?")
    >>> capsified_fn()
    'what in the beeswax is this?'
    >>> capsified_fn(capitalize=True)
    'What In The Beeswax Is This?'

    """
    @six.wraps(func)
    def wrapped(*args, **kwargs):
        if "capitalize" in kwargs and kwargs['capitalize']:
            return func(*args, **kwargs).title()
        else:
            return func(*args, **kwargs)
    return wrapped
def capitalize_argument ( func ) : @ six . wraps ( func ) def wrapped ( * args , ** kwargs ) : if "capitalize" in kwargs and kwargs [ 'capitalize' ] : return func ( * args , ** kwargs ) . title ( ) else : return func ( * args , ** kwargs ) return wrapped
Wraps a function that returns a string, adding the 'capitalize' argument.

    >>> capsified_fn = capitalize_argument(lambda *args, **kwargs: "what in the beeswax is this?")
    >>> capsified_fn()
    'what in the beeswax is this?'
    >>> capsified_fn(capitalize=True)
    'What In The Beeswax Is This?'