'Can be used as a function or a decorator. Register given function
`f` labeled with given `tags`. The function should receive **kwargs
and return list of Errors and Warnings.
Example::
registry = CheckRegistry()
@registry.register(\'mytag\', \'anothertag\')
def my_check(apps, **kwargs):
# ... perform checks and collect `errors` ...
return errors
# or
registry.register(my_check, \'mytag\', \'anothertag\')'

def register(self, check=None, *tags, **kwargs):

    kwargs.setdefault('deploy', False)
    def inner(check):
        check.tags = tags
        if kwargs['deploy']:
            if (check not in self.deployment_checks):
                self.deployment_checks.append(check)
        elif (check not in self.registered_checks):
            self.registered_checks.append(check)
        return check
    if callable(check):
        return inner(check)
    else:
        if check:
            tags += (check,)
        return inner
