def _has_scope_key(scope, have_scopes, *, post_filter=False, db=None):
    """Cache key for has_scope"""
    if isinstance(have_scopes, dict):
        have_scopes = FrozenDict(have_scopes)
    else:
        have_scopes = frozenset(have_scopes)
    return (scope, have_scopes, post_filter)
Cache key for has_scope
jupyterhub/scopes.py