(policy, warning_only=False)
Expect a string for the path to the policy class,
    otherwise try to interpret the string as a standard value
    from https://www.w3.org/TR/referrer-policy/#referrer-policies
Expect a string for the path to the policy class,
    otherwise try to interpret the string as a standard value
    from https://www.w3.org/TR/referrer-policy/#referrer-policies
Expect a string for the path to the policy class otherwise try to interpret the string as a standard value from https : // www . w3 . org / TR / referrer - policy / #referrer - policies
def _load_policy_class(policy, warning_only=False):
    """
    Expect a string for the path to the policy class,
    otherwise try to interpret the string as a standard value
    from https://www.w3.org/TR/referrer-policy/#referrer-policies
    """
    try:
        return load_object(policy)
    except ValueError:
        try:
            return _policy_classes[policy.lower()]
        except KeyError:
            msg = f"Could not load referrer policy {policy!r}"
            if not warning_only:
                raise RuntimeError(msg)
            else:
                warnings.warn(msg, RuntimeWarning)
                return None
def _load_policy_class ( policy , warning_only = False ) : try : return load_object ( policy ) except ValueError : try : return _policy_classes [ policy . lower ( ) ] except KeyError : msg = f"Could not load referrer policy {policy!r}" if not warning_only : raise RuntimeError ( msg ) else : warnings . warn ( msg , RuntimeWarning ) return None