def prune_old_authorization_codes():
    """
    Removes all unused and expired authorization codes from the database.
    """

    from .compat import now
    from .models import AuthorizationCode
    
    AuthorizationCode.objects.with_expiration_before(now()).delete()
Removes all unused and expired authorization codes from the database.