def automoderate(instance, user):
    '''
    Auto moderates given model instance on user. Returns moderation status:
    0 - Rejected
    1 - Approved
    '''
    try:
        status = instance.moderated_object.automoderate(user)
    except __HOLE__:
        msg = "%s has been registered with Moderation." % instance.__class__
        raise RegistrationError(msg)

    return status
dataset/ETHPy150Open dominno/django-moderation/moderation/helpers.py/automoderate