<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def perm_to_permission(perm):
 """ Convert a permission-string to a permission instance. Examples -------- 'auth' 'add_user' """

    from django.contrib.auth.models import Permission
    try:
        app_label, codename = perm.split('.', 1)
    except (ValueError, IndexError):
        raise AttributeError(
            'The format of identifier string permission (perm) is wrong. '
            "It should be in 'app_label.codename'."
        )
    else:
        permission = Permission.objects.get(
            content_type__app_label=app_label,
            codename=codename
        )
        return permission