human
Complete this python program:
def attr(**kwargs):
assistant
#Here is the Python program you requested.

    """A decorator which applies the testtools attr decorator
    This decorator applies the testtools.testcase.attr if it is in the list of
    attributes to testtools we want to apply.
    """
    def decorator(f):
        if (('type' in kwargs) and isinstance(kwargs['type'], str)):
            f = testtools.testcase.attr(kwargs['type'])(f)
        elif (('type' in kwargs) and isinstance(kwargs['type'], list)):
            for attr in kwargs['type']:
                f = testtools.testcase.attr(attr)(f)
        return f
    return decorator