def register(model, permissions):
    if model in registry:
        #raise AlreadyRegistered('The model %s has already been registered.' % model.__name__)
        return
    registry.append(model)
    
    opts = model._meta
    try:
        opts.get_field('user_perms_set')
    except FieldDoesNotExist:
        UserPermissionRelation().contribute_to_class(model, 'user_perms_set')
    
    try:
        opts.get_field('group_perms_set')
    except FieldDoesNotExist:
        GroupPermissionRelation().contribute_to_class(model, 'group_perms_set')
    
    setattr(model, 'perms', ModelPermissions(permissions))


# The following functions are added to the User/Group objects
Register a model and permission set. It adds several functions to the model:
dataset/ETHPy150Open callowayproject/django-objectpermissions/objectpermissions/registration.py/register