id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,800 | utils.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/utils.py | """
oauthlib.utils
~~~~~~~~~~~~~~
This module contains utility methods used by various parts of the OAuth 2 spec.
"""
import datetime
import os
from urllib.parse import quote, urlparse
from oauthlib.common import urldecode
def list_to_scope(scope):
"""Convert a list of scopes to a space separated string."""
... | 2,207 | Python | .py | 62 | 30.33871 | 92 | 0.647363 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,801 | __init__.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/__init__.py | """
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
import functools
import logging
from .endpoints.base import BaseEndpoint, catch_errors_and_unavailability
from .errors import (
FatalClientError, OAuth2Er... | 404 | Python | .py | 13 | 29.538462 | 76 | 0.778351 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,802 | backend_application.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/clients/backend_application.py | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from ..parameters import prepare_token_request
from .base import Client
class BackendApplicationClient(Client):
"""A public clie... | 3,223 | Python | .py | 57 | 46.140351 | 83 | 0.656716 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,803 | web_application.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/clients/web_application.py | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
import warnings
from ..parameters import (
parse_authorization_code_response, prepare_grant_uri,
prepare_token_request,
)
from... | 10,615 | Python | .py | 167 | 51.131737 | 112 | 0.645493 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,804 | service_application.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/clients/service_application.py | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
import time
from oauthlib.common import to_unicode
from ..parameters import prepare_token_request
from .base import Client
class Se... | 7,810 | Python | .py | 145 | 39.117241 | 83 | 0.578139 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,805 | __init__.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/clients/__init__.py | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming OAuth 2.0 RFC6749.
"""
from .backend_application import BackendApplicationClient
from .base import AUTH_HEADER, BODY, URI_QUERY, Client
from .legacy_application import Lega... | 504 | Python | .py | 13 | 37.692308 | 57 | 0.806122 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,806 | mobile_application.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/clients/mobile_application.py | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from ..parameters import parse_implicit_response, prepare_grant_uri
from .base import Client
class MobileApplicationClient(Client):
... | 8,877 | Python | .py | 142 | 51.549296 | 137 | 0.66111 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,807 | base.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/clients/base.py | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming OAuth 2.0 RFC6749.
"""
import time
import warnings
from oauthlib.common import generate_token
from oauthlib.oauth2.rfc6749 import tokens
from oauthlib.oauth2.rfc6749.error... | 22,046 | Python | .py | 396 | 44.744949 | 110 | 0.656384 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,808 | legacy_application.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/clients/legacy_application.py | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from ..parameters import prepare_token_request
from .base import Client
class LegacyApplicationClient(Client):
"""A public clien... | 4,031 | Python | .py | 68 | 49.470588 | 101 | 0.671903 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,809 | revocation.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/endpoints/revocation.py | """
oauthlib.oauth2.rfc6749.endpoint.revocation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An implementation of the OAuth 2 `Token Revocation`_ spec (draft 11).
.. _`Token Revocation`: https://tools.ietf.org/html/draft-ietf-oauth-revocation-11
"""
import logging
from oauthlib.common import Request
from ..errors im... | 5,212 | Python | .py | 98 | 43.336735 | 101 | 0.654542 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,810 | pre_configured.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py | """
oauthlib.oauth2.rfc6749.endpoints.pre_configured
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various endpoints needed
for providing OAuth 2.0 RFC6749 servers.
"""
from ..grant_types import (
AuthorizationCodeGrant, ClientCredentialsGrant, ImplicitGrant,
RefreshToken... | 11,954 | Python | .py | 187 | 45.315508 | 103 | 0.585875 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,811 | token.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/endpoints/token.py | """
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
import logging
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749 import utils
from .base import BaseEndpoint, catch_errors_and_unavailability
... | 4,595 | Python | .py | 90 | 43.2 | 107 | 0.695264 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,812 | authorization.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/endpoints/authorization.py | """
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
import logging
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749 import utils
from .base import BaseEndpoint, catch_errors_and_unavailability
... | 4,584 | Python | .py | 88 | 44.477273 | 83 | 0.706264 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,813 | metadata.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/endpoints/metadata.py | """
oauthlib.oauth2.rfc6749.endpoint.metadata
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An implementation of the `OAuth 2.0 Authorization Server Metadata`.
.. _`OAuth 2.0 Authorization Server Metadata`: https://tools.ietf.org/html/rfc8414
"""
import copy
import json
import logging
from .. import grant_types
from .... | 10,467 | Python | .py | 185 | 47.010811 | 119 | 0.676931 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,814 | __init__.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/endpoints/__init__.py | """
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from .authorization import AuthorizationEndpoint
from .introspect import IntrospectEndpoint
from .metadata import MetadataEndpoint
from .pre_configured import ... | 553 | Python | .py | 16 | 33 | 79 | 0.824627 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,815 | base.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/endpoints/base.py | """
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
import functools
import logging
from ..errors import (
FatalClientError, InvalidClientError, InvalidRequestError, OAuth2Error,
ServerError, Temporaril... | 4,130 | Python | .py | 94 | 33.957447 | 114 | 0.636681 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,816 | resource.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/endpoints/resource.py | """
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
import logging
from oauthlib.common import Request
from .base import BaseEndpoint, catch_errors_and_unavailability
log = logging.getLogger(__name__)
class... | 3,248 | Python | .py | 66 | 41.606061 | 77 | 0.696271 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,817 | introspect.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/endpoints/introspect.py | """
oauthlib.oauth2.rfc6749.endpoint.introspect
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An implementation of the OAuth 2.0 `Token Introspection`.
.. _`Token Introspection`: https://tools.ietf.org/html/rfc7662
"""
import json
import logging
from oauthlib.common import Request
from ..errors import OAuth2Error
fro... | 4,983 | Python | .py | 100 | 41.46 | 78 | 0.678667 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,818 | implicit.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/grant_types/implicit.py | """
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import logging
from oauthlib import common
from .. import errors
from .base import GrantTypeBase
log = logging.getLogger(__name__)
class ImplicitGrant(GrantTypeBase):
"""`Implicit Grant`_
The implicit grant type is used to o... | 16,852 | Python | .py | 302 | 44.94702 | 119 | 0.624909 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,819 | client_credentials.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py | """
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import json
import logging
from .. import errors
from .base import GrantTypeBase
log = logging.getLogger(__name__)
class ClientCredentialsGrant(GrantTypeBase):
"""`Client Credentials Grant`_
The client can request an access t... | 5,079 | Python | .py | 95 | 43.010526 | 95 | 0.598467 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,820 | refresh_token.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py | """
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import json
import logging
from .. import errors, utils
from .base import GrantTypeBase
log = logging.getLogger(__name__)
class RefreshTokenGrant(GrantTypeBase):
"""`Refresh token grant`_
.. _`Refresh token grant`: https://to... | 5,808 | Python | .py | 110 | 41.763636 | 91 | 0.644985 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,821 | resource_owner_password_credentials.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py | """
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import json
import logging
from .. import errors
from .base import GrantTypeBase
log = logging.getLogger(__name__)
class ResourceOwnerPasswordCredentialsGrant(GrantTypeBase):
"""`Resource Owner Password Credentials Grant`_
Th... | 8,516 | Python | .py | 157 | 43.216561 | 112 | 0.622941 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,822 | __init__.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/grant_types/__init__.py | """
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from .authorization_code import AuthorizationCodeGrant
from .client_credentials import ClientCredentialsGrant
from .implicit import ImplicitGrant
from .refresh_token import RefreshTokenGrant
from .resource_owner_password_credentials import... | 368 | Python | .py | 11 | 32.090909 | 54 | 0.778711 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,823 | authorization_code.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py | """
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import base64
import hashlib
import json
import logging
from oauthlib import common
from .. import errors
from .base import GrantTypeBase
log = logging.getLogger(__name__)
def code_challenge_method_s256(verifier, challenge):
"""
... | 25,945 | Python | .py | 448 | 46.544643 | 125 | 0.628425 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,824 | base.py | rembo10_headphones/lib/oauthlib/oauth2/rfc6749/grant_types/base.py | """
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import logging
from itertools import chain
from oauthlib.common import add_params_to_uri
from oauthlib.oauth2.rfc6749 import errors, utils
from oauthlib.uri_validate import is_absolute_uri
from ..request_validator import RequestValidator... | 10,213 | Python | .py | 206 | 39.368932 | 105 | 0.643381 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,825 | oauth1_auth.py | rembo10_headphones/lib/requests_oauthlib/oauth1_auth.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from oauthlib.common import extract_params
from oauthlib.oauth1 import Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER
from oauthlib.oauth1 import SIGNATURE_TYPE_BODY
from requests.compat import is_py3
from requests.utils import to_nati... | 3,737 | Python | .py | 98 | 29.142857 | 78 | 0.616575 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,826 | oauth2_auth.py | rembo10_headphones/lib/requests_oauthlib/oauth2_auth.py | from __future__ import unicode_literals
from oauthlib.oauth2 import WebApplicationClient, InsecureTransportError
from oauthlib.oauth2 import is_secure_transport
from requests.auth import AuthBase
class OAuth2(AuthBase):
"""Adds proof of authorization (OAuth2 token) to the request."""
def __init__(self, clien... | 1,548 | Python | .py | 31 | 40.354839 | 77 | 0.655195 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,827 | __init__.py | rembo10_headphones/lib/requests_oauthlib/__init__.py | import logging
from .oauth1_auth import OAuth1
from .oauth1_session import OAuth1Session
from .oauth2_auth import OAuth2
from .oauth2_session import OAuth2Session, TokenUpdated
__version__ = "1.3.0"
import requests
if requests.__version__ < "2.0.0":
msg = (
"You are using requests version %s, which is o... | 529 | Python | .py | 14 | 34.428571 | 72 | 0.739216 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,828 | oauth1_session.py | rembo10_headphones/lib/requests_oauthlib/oauth1_session.py | from __future__ import unicode_literals
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import logging
from oauthlib.common import add_params_to_uri
from oauthlib.common import urldecode as _urldecode
from oauthlib.oauth1 import SIGNATURE_HMAC, SIGNATURE_RSA, SIGNATUR... | 17,051 | Python | .py | 346 | 39.020231 | 145 | 0.641103 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,829 | oauth2_session.py | rembo10_headphones/lib/requests_oauthlib/oauth2_session.py | from __future__ import unicode_literals
import logging
from oauthlib.common import generate_token, urldecode
from oauthlib.oauth2 import WebApplicationClient, InsecureTransportError
from oauthlib.oauth2 import LegacyApplicationClient
from oauthlib.oauth2 import TokenExpiredError, is_secure_transport
import requests
... | 21,638 | Python | .py | 474 | 33.417722 | 100 | 0.592163 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,830 | slack.py | rembo10_headphones/lib/requests_oauthlib/compliance_fixes/slack.py | try:
from urlparse import urlparse, parse_qs
except ImportError:
from urllib.parse import urlparse, parse_qs
from oauthlib.common import add_params_to_uri
def slack_compliance_fix(session):
def _non_compliant_param_name(url, headers, data):
# If the user has already specified the token, either in... | 1,453 | Python | .py | 31 | 38.064516 | 84 | 0.642655 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,831 | weibo.py | rembo10_headphones/lib/requests_oauthlib/compliance_fixes/weibo.py | from json import loads, dumps
from oauthlib.common import to_unicode
def weibo_compliance_fix(session):
def _missing_token_type(r):
token = loads(r.text)
token["token_type"] = "Bearer"
r._content = to_unicode(dumps(token)).encode("UTF-8")
return r
session._client.default_toke... | 444 | Python | .py | 11 | 34.636364 | 82 | 0.699301 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,832 | instagram.py | rembo10_headphones/lib/requests_oauthlib/compliance_fixes/instagram.py | try:
from urlparse import urlparse, parse_qs
except ImportError:
from urllib.parse import urlparse, parse_qs
from oauthlib.common import add_params_to_uri
def instagram_compliance_fix(session):
def _non_compliant_param_name(url, headers, data):
# If the user has already specified the token in the... | 948 | Python | .py | 21 | 38 | 84 | 0.681128 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,833 | plentymarkets.py | rembo10_headphones/lib/requests_oauthlib/compliance_fixes/plentymarkets.py | from json import dumps, loads
import re
from oauthlib.common import to_unicode
def plentymarkets_compliance_fix(session):
def _to_snake_case(n):
return re.sub("(.)([A-Z][a-z]+)", r"\1_\2", n).lower()
def _compliance_fix(r):
# Plenty returns the Token in CamelCase instead of _
if (
... | 796 | Python | .py | 22 | 28.136364 | 78 | 0.59322 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,834 | facebook.py | rembo10_headphones/lib/requests_oauthlib/compliance_fixes/facebook.py | from json import dumps
try:
from urlparse import parse_qsl
except ImportError:
from urllib.parse import parse_qsl
from oauthlib.common import to_unicode
def facebook_compliance_fix(session):
def _compliance_fix(r):
# if Facebook claims to be sending us json, let's trust them.
if "applica... | 1,119 | Python | .py | 26 | 35.461538 | 86 | 0.654696 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,835 | fitbit.py | rembo10_headphones/lib/requests_oauthlib/compliance_fixes/fitbit.py | """
The Fitbit API breaks from the OAuth2 RFC standard by returning an "errors"
object list, rather than a single "error" string. This puts hooks in place so
that oauthlib can process an error in the results from access token and refresh
token responses. This is necessary to prevent getting the generic red herring
Miss... | 905 | Python | .py | 20 | 40.4 | 79 | 0.727273 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,836 | __init__.py | rembo10_headphones/lib/requests_oauthlib/compliance_fixes/__init__.py | from __future__ import absolute_import
from .facebook import facebook_compliance_fix
from .fitbit import fitbit_compliance_fix
from .linkedin import linkedin_compliance_fix
from .slack import slack_compliance_fix
from .instagram import instagram_compliance_fix
from .mailchimp import mailchimp_compliance_fix
from .weib... | 406 | Python | .py | 9 | 44 | 55 | 0.858586 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,837 | linkedin.py | rembo10_headphones/lib/requests_oauthlib/compliance_fixes/linkedin.py | from json import loads, dumps
from oauthlib.common import add_params_to_uri, to_unicode
def linkedin_compliance_fix(session):
def _missing_token_type(r):
token = loads(r.text)
token["token_type"] = "Bearer"
r._content = to_unicode(dumps(token)).encode("UTF-8")
return r
def _n... | 749 | Python | .py | 16 | 40.5 | 84 | 0.695055 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,838 | mailchimp.py | rembo10_headphones/lib/requests_oauthlib/compliance_fixes/mailchimp.py | import json
from oauthlib.common import to_unicode
def mailchimp_compliance_fix(session):
def _null_scope(r):
token = json.loads(r.text)
if "scope" in token and token["scope"] is None:
token.pop("scope")
r._content = to_unicode(json.dumps(token)).encode("utf-8")
return... | 757 | Python | .py | 18 | 34.777778 | 83 | 0.651226 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,839 | douban.py | rembo10_headphones/lib/requests_oauthlib/compliance_fixes/douban.py | import json
from oauthlib.common import to_unicode
def douban_compliance_fix(session):
def fix_token_type(r):
token = json.loads(r.text)
token.setdefault("token_type", "Bearer")
fixed_token = json.dumps(token)
r._content = to_unicode(fixed_token).encode("utf-8")
return r
... | 472 | Python | .py | 12 | 33.25 | 77 | 0.696703 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,840 | user.py | rembo10_headphones/lib/pygazelle/user.py |
class InvalidUserException(Exception):
pass
class User(object):
"""
This class represents a User, whether your own or someone else's. It is created knowing only its ID. To reduce
API accesses, load information using User.update_index_data() or User.update_user_data only as needed.
"""
def __i... | 4,755 | Python | .py | 89 | 43.786517 | 129 | 0.641274 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,841 | category.py | rembo10_headphones/lib/pygazelle/category.py | class InvalidCategoryException(Exception):
pass
class Category(object):
def __init__(self, id, parent_api):
self.id = id
self.parent_api = parent_api
self.name = None
self.parent_api.cached_categories[self.id] = self # add self to cache of known Category objects
def __repr... | 391 | Python | .py | 10 | 32.7 | 103 | 0.641161 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,842 | api.py | rembo10_headphones/lib/pygazelle/api.py | #!/usr/bin/env python
#
# PyGazelle - https://github.com/cohena/pygazelle
# A Python implementation of the What.cd Gazelle JSON API
#
# Loosely based on the API implementation from 'whatbetter', by Zachary Denton
# See https://github.com/zacharydenton/whatbetter
import html
import sys
import json
import time
import re... | 16,389 | Python | .py | 367 | 34.228883 | 124 | 0.606137 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,843 | format.py | rembo10_headphones/lib/pygazelle/format.py | MP3 = "MP3"
FLAC = "FLAC"
AAC = "AAC"
AC3 = "AC3"
DTS = "DTS"
OGG_VORBIS = "Ogg Vorbis"
ALL_FORMATS = [MP3, FLAC, AAC, AC3, DTS, OGG_VORBIS] | 141 | Python | .py | 7 | 19.142857 | 52 | 0.634328 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,844 | request.py | rembo10_headphones/lib/pygazelle/request.py | class InvalidRequestException(Exception):
pass
class Request(object):
def __init__(self, id, parent_api):
self.id = id
self.parent_api = parent_api
self.category = None
self.title = None
self.year = None
self.time_added = None
self.votes = None
se... | 1,246 | Python | .py | 25 | 40.52 | 131 | 0.625616 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,845 | encoding.py | rembo10_headphones/lib/pygazelle/encoding.py | C192 = "192"
APS = "APS (VBR)"
V2 = "V2 (VBR)"
V1 = "V1 (VBR)"
C256 = "256"
APX = "APX (VBR)"
V0 = "V0 (VBR)"
C320 = "320"
LOSSLESS = "Lossless"
LOSSLESS_24 = "24bit Lossless"
V8 = "V8 (VBR)"
ALL_ENCODINGS = [C192, APS, V2, V1, C256, APX, V0, C320, LOSSLESS, LOSSLESS_24, V8] | 276 | Python | .py | 12 | 22 | 83 | 0.613636 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,846 | release_type.py | rembo10_headphones/lib/pygazelle/release_type.py | ALBUM = "Album"
SOUNDTRACK = "Soundtrack"
EP = "EP"
ANTHOLOGY = "Anthology"
COMPILATION = "Compilation"
DJ_MIX = "DJ Mix"
SINGLE = "Single"
LIVE_ALBUM = "Live album"
REMIX = "Remix"
BOOTLEG = "Bootleg"
INTERVIEW = "Interview"
MIXTAPE = "Mixtape"
UNKNOWN = "Unknown"
ALL_RELEASE_TYPES = [ALBUM, SOUNDTRACK, EP, ANTHOLOGY... | 513 | Python | .py | 17 | 27.647059 | 111 | 0.711111 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,847 | artist.py | rembo10_headphones/lib/pygazelle/artist.py | import html
class InvalidArtistException(Exception):
pass
class Artist(object):
"""
This class represents an Artist. It is created knowing only its ID. To reduce API accesses, load information using
Artist.update_data() only as needed.
"""
def __init__(self, id, parent_api):
self.id = ... | 3,612 | Python | .py | 72 | 40.055556 | 132 | 0.62943 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,848 | torrent_group.py | rembo10_headphones/lib/pygazelle/torrent_group.py | from .torrent import Torrent
class InvalidTorrentGroupException(Exception):
pass
class TorrentGroup(object):
"""
Represents a Torrent Group (usually an album). Note that TorrentGroup.torrents may not be comprehensive if you
haven't called TorrentGroup.update_group_data()...it may have only been popula... | 7,282 | Python | .py | 120 | 49.425 | 149 | 0.640767 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,849 | tag.py | rembo10_headphones/lib/pygazelle/tag.py | class Tag(object):
def __init__(self, name, parent_api):
self.name = name
self.artist_counts = {}
self.parent_api = parent_api
self.parent_api.cached_tags[self.name] = self # add self to cache of known Tag objects
def set_artist_count(self, artist, count):
"""
A... | 612 | Python | .py | 14 | 36 | 116 | 0.627517 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,850 | torrent.py | rembo10_headphones/lib/pygazelle/torrent.py | from html.parser import HTMLParser
import re
class InvalidTorrentException(Exception):
pass
class Torrent(object):
def __init__(self, id, parent_api):
self.id = id
self.parent_api = parent_api
self.group = None
self.media = None
self.format = None
self.encoding ... | 10,728 | Python | .py | 168 | 53.797619 | 138 | 0.661324 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,851 | media.py | rembo10_headphones/lib/pygazelle/media.py | CD = "CD"
DVD = "DVD"
VINYL = "Vinyl"
SOUNDBOARD = "Soundboard"
SACD = "SACD"
DAT = "DAT"
CASETTE = "Casette"
WEB = "WEB"
BLU_RAY = "Blu-ray"
ALL_MEDIAS = [CD, DVD, VINYL, SOUNDBOARD, SACD, DAT, CASETTE, WEB, BLU_RAY] | 218 | Python | .py | 10 | 20.8 | 75 | 0.663462 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,852 | inbox.py | rembo10_headphones/lib/pygazelle/inbox.py | class MailboxMessage(object):
def __init__(self, api, message):
self.id = message['convId']
self.conv = Conversation(api, self.id)
self.subject = message['subject']
self.unread = message['unread']
self.sticky = message['sticky']
self.fwd_id = message['forwardedId']
... | 3,948 | Python | .py | 91 | 33.934066 | 105 | 0.594376 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,853 | models.py | rembo10_headphones/lib/charset_normalizer/models.py | import warnings
from collections import Counter
from encodings.aliases import aliases
from hashlib import sha256
from json import dumps
from re import sub
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
from .constant import NOT_PRINTABLE_PATTERN, TOO_BIG_SEQUENCE
from .md import mess_ratio
from .... | 13,303 | Python | .py | 329 | 31.231003 | 120 | 0.604911 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,854 | cd.py | rembo10_headphones/lib/charset_normalizer/cd.py | import importlib
from codecs import IncrementalDecoder
from collections import Counter, OrderedDict
from functools import lru_cache
from typing import Dict, List, Optional, Tuple
from .assets import FREQUENCIES
from .constant import KO_NAMES, LANGUAGE_SUPPORTED_COUNT, TOO_SMALL_SEQUENCE, ZH_NAMES
from .md import is_su... | 11,076 | Python | .py | 261 | 34.038314 | 118 | 0.645864 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,855 | md.py | rembo10_headphones/lib/charset_normalizer/md.py | from functools import lru_cache
from typing import List, Optional
from .constant import COMMON_SAFE_ASCII_CHARACTERS, UNICODE_SECONDARY_RANGE_KEYWORD
from .utils import (
is_accentuated,
is_ascii,
is_case_variable,
is_cjk,
is_emoticon,
is_hangul,
is_hiragana,
is_katakana,
is_latin,
... | 18,176 | Python | .py | 444 | 31.425676 | 113 | 0.597308 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,856 | api.py | rembo10_headphones/lib/charset_normalizer/api.py | import logging
from os.path import basename, splitext
from typing import BinaryIO, List, Optional, Set
try:
from os import PathLike
except ImportError: # pragma: no cover
PathLike = str # type: ignore
from .cd import (
coherence_ratio,
encoding_languages,
mb_encoding_languages,
merge_coheren... | 19,377 | Python | .py | 486 | 28.8107 | 120 | 0.575152 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,857 | legacy.py | rembo10_headphones/lib/charset_normalizer/legacy.py | import warnings
from typing import Dict, Optional, Union
from .api import from_bytes, from_fp, from_path, normalize
from .constant import CHARDET_CORRESPONDENCE
from .models import CharsetMatch, CharsetMatches
def detect(byte_str: bytes) -> Dict[str, Optional[Union[str, float]]]:
"""
chardet legacy method
... | 3,384 | Python | .py | 75 | 37.773333 | 120 | 0.672849 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,858 | utils.py | rembo10_headphones/lib/charset_normalizer/utils.py | try:
import unicodedata2 as unicodedata
except ImportError:
import unicodedata # type: ignore[no-redef]
import importlib
import logging
from codecs import IncrementalDecoder
from encodings.aliases import aliases
from functools import lru_cache
from re import findall
from typing import List, Optional, Set, Tup... | 9,308 | Python | .py | 240 | 32.858333 | 110 | 0.686148 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,859 | __init__.py | rembo10_headphones/lib/charset_normalizer/__init__.py | # -*- coding: utf_8 -*-
"""
Charset-Normalizer
~~~~~~~~~~~~~~
The Real First Universal Charset Detector.
A library that helps you read text from an unknown charset encoding.
Motivated by chardet, This package is trying to resolve the issue by taking a new approach.
All IANA character set names for which the Python core... | 1,790 | Python | .py | 50 | 31.18 | 99 | 0.740606 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,860 | constant.py | rembo10_headphones/lib/charset_normalizer/constant.py | from codecs import BOM_UTF8, BOM_UTF16_BE, BOM_UTF16_LE, BOM_UTF32_BE, BOM_UTF32_LE
from collections import OrderedDict
from encodings.aliases import aliases
from re import IGNORECASE, compile as re_compile
from typing import Dict, List, Set, Union
from .assets import FREQUENCIES
# Contain for each eligible encoding ... | 19,396 | Python | .py | 481 | 34.968815 | 102 | 0.602456 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,861 | version.py | rembo10_headphones/lib/charset_normalizer/version.py | """
Expose version
"""
__version__ = "2.0.10"
VERSION = __version__.split(".")
| 80 | Python | .py | 5 | 14.8 | 32 | 0.581081 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,862 | __init__.py | rembo10_headphones/lib/charset_normalizer/assets/__init__.py | # -*- coding: utf_8 -*-
from collections import OrderedDict
FREQUENCIES = OrderedDict(
[
(
"English",
[
"e",
"a",
"t",
"i",
"o",
"n",
"s",
"r",
... | 25,485 | Python | .py | 1,243 | 3.93564 | 35 | 0.059223 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,863 | normalizer.py | rembo10_headphones/lib/charset_normalizer/cli/normalizer.py | import argparse
import sys
from json import dumps
from os.path import abspath
from platform import python_version
from typing import List
from charset_normalizer import from_fp
from charset_normalizer.models import CliDetectionResult
from charset_normalizer.version import __version__
def query_yes_no(question: str, ... | 9,364 | Python | .py | 259 | 22.15444 | 111 | 0.470134 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,864 | functools.py | rembo10_headphones/lib/jaraco/functools.py | import functools
import time
import inspect
import collections
import types
import itertools
import more_itertools
from typing import Callable, TypeVar
CallableT = TypeVar("CallableT", bound=Callable[..., object])
def compose(*funcs):
"""
Compose any number of unary functions into a single unary function.... | 13,494 | Python | .py | 403 | 27.456576 | 88 | 0.621559 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,865 | collections.py | rembo10_headphones/lib/jaraco/collections.py | import re
import operator
import collections.abc
import itertools
import copy
import functools
import random
from jaraco.classes.properties import NonDataProperty
import jaraco.text
class Projection(collections.abc.Mapping):
"""
Project a set of keys over a mapping
>>> sample = {'a': 1, 'b': 2, 'c': 3}
... | 25,589 | Python | .py | 814 | 25.136364 | 84 | 0.580239 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,866 | meta.py | rembo10_headphones/lib/jaraco/classes/meta.py | """
meta.py
Some useful metaclasses.
"""
class LeafClassesMeta(type):
"""
A metaclass for classes that keeps track of all of them that
aren't base classes.
>>> Parent = LeafClassesMeta('MyParentClass', (), {})
>>> Parent in Parent._leaf_classes
True
>>> Child = LeafClassesMeta('MyChildCl... | 1,853 | Python | .py | 54 | 28.351852 | 77 | 0.616676 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,867 | properties.py | rembo10_headphones/lib/jaraco/classes/properties.py | class NonDataProperty:
"""Much like the property builtin, but only implements __get__,
making it a non-data property, and can be subsequently reset.
See http://users.rcn.com/python/download/Descriptor.htm for more
information.
>>> class X(object):
... @NonDataProperty
... def foo(self)... | 3,980 | Python | .py | 145 | 21.303448 | 73 | 0.550801 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,868 | ancestry.py | rembo10_headphones/lib/jaraco/classes/ancestry.py | """
Routines for obtaining the class names
of an object and its parent classes.
"""
from more_itertools import unique_everseen
def all_bases(c):
"""
return a tuple of all base classes the class c has as a parent.
>>> object in all_bases(list)
True
"""
return c.mro()[1:]
def all_classes(c):
... | 1,464 | Python | .py | 56 | 21.428571 | 82 | 0.61533 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,869 | __init__.py | rembo10_headphones/lib/jaraco/text/__init__.py | import re
import itertools
import textwrap
import functools
try:
from importlib.resources import files # type: ignore
except ImportError: # pragma: nocover
from importlib_resources import files # type: ignore
from jaraco.functools import compose, method_cache
def substitution(old, new):
"""
Retur... | 13,972 | Python | .py | 396 | 29.411616 | 77 | 0.627613 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,870 | util.py | rembo10_headphones/lib/musicbrainzngs/util.py | # This file is part of the musicbrainzngs library
# Copyright (C) Alastair Porter, Adrian Sampson, and others
# This file is distributed under a BSD-2-Clause type license.
# See the COPYING file for more information.
import sys
import locale
import xml.etree.ElementTree as ET
from . import compat
def _unicode(string... | 1,428 | Python | .py | 38 | 33.289474 | 79 | 0.71604 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,871 | mbxml.py | rembo10_headphones/lib/musicbrainzngs/mbxml.py | # This file is part of the musicbrainzngs library
# Copyright (C) Alastair Porter, Adrian Sampson, and others
# This file is distributed under a BSD-2-Clause type license.
# See the COPYING file for more information.
import re
import xml.etree.ElementTree as ET
import logging
from . import util
def fixtag(tag, name... | 28,151 | Python | .py | 680 | 32.386765 | 113 | 0.593217 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,872 | caa.py | rembo10_headphones/lib/musicbrainzngs/caa.py | # This file is part of the musicbrainzngs library
# Copyright (C) Alastair Porter, Wieland Hoffmann, and others
# This file is distributed under a BSD-2-Clause type license.
# See the COPYING file for more information.
__all__ = [
'set_caa_hostname', 'get_image_list', 'get_release_group_image_list',
'get_relea... | 6,779 | Python | .py | 149 | 39.442953 | 96 | 0.685081 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,873 | compat.py | rembo10_headphones/lib/musicbrainzngs/compat.py | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Kenneth Reitz.
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE... | 1,719 | Python | .py | 48 | 33.916667 | 77 | 0.767189 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,874 | musicbrainz.py | rembo10_headphones/lib/musicbrainzngs/musicbrainz.py | # This file is part of the musicbrainzngs library
# Copyright (C) Alastair Porter, Adrian Sampson, and others
# This file is distributed under a BSD-2-Clause type license.
# See the COPYING file for more information.
import base64
import re
import threading
import time
import logging
import socket
import hashlib
impor... | 48,910 | Python | .py | 1,112 | 38.153777 | 153 | 0.660808 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,875 | __init__.py | rembo10_headphones/lib/pkg_resources/__init__.py | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... | 109,343 | Python | .py | 2,699 | 31.761764 | 88 | 0.620729 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,876 | __init__.py | rembo10_headphones/lib/pkg_resources/extern/__init__.py | import importlib.util
import sys
class VendorImporter:
"""
A PEP 302 meta path importer for finding optionally-vendored
or otherwise naturally-installed packages from root_name.
"""
def __init__(self, root_name, vendored_names=(), vendor_pkg=None):
self.root_name = root_name
self.... | 2,442 | Python | .py | 68 | 26.852941 | 78 | 0.593141 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,877 | zipp.py | rembo10_headphones/lib/pkg_resources/_vendor/zipp.py | import io
import posixpath
import zipfile
import itertools
import contextlib
import sys
import pathlib
if sys.version_info < (3, 7):
from collections import OrderedDict
else:
OrderedDict = dict
__all__ = ['Path']
def _parents(path):
"""
Given a path with elements separated by
posixpath.sep, gen... | 8,425 | Python | .py | 256 | 25.945313 | 78 | 0.603521 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,878 | typing_extensions.py | rembo10_headphones/lib/pkg_resources/_vendor/typing_extensions.py | import abc
import collections
import collections.abc
import functools
import operator
import sys
import types as _types
import typing
__all__ = [
# Super-special typing primitives.
'Any',
'ClassVar',
'Concatenate',
'Final',
'LiteralString',
'ParamSpec',
'ParamSpecArgs',
'ParamSpecK... | 80,078 | Python | .py | 1,774 | 34.07779 | 90 | 0.578574 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,879 | more.pyi | rembo10_headphones/lib/pkg_resources/_vendor/more_itertools/more.pyi | """Stubs for more_itertools.more"""
from __future__ import annotations
from types import TracebackType
from typing import (
Any,
Callable,
Container,
ContextManager,
Generic,
Hashable,
Iterable,
Iterator,
overload,
Reversible,
Sequence,
Sized,
Type,
TypeVar,
... | 20,105 | Python | .py | 636 | 28.268868 | 79 | 0.582386 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,880 | more.py | rembo10_headphones/lib/pkg_resources/_vendor/more_itertools/more.py | import warnings
from collections import Counter, defaultdict, deque, abc
from collections.abc import Sequence
from functools import partial, reduce, wraps
from heapq import heapify, heapreplace, heappop
from itertools import (
chain,
compress,
count,
cycle,
dropwhile,
groupby,
islice,
r... | 134,976 | Python | .py | 3,435 | 31.162154 | 92 | 0.572922 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,881 | recipes.pyi | rembo10_headphones/lib/pkg_resources/_vendor/more_itertools/recipes.pyi | """Stubs for more_itertools.recipes"""
from __future__ import annotations
from typing import (
Any,
Callable,
Iterable,
Iterator,
overload,
Sequence,
Type,
TypeVar,
)
# Type and type variable definitions
_T = TypeVar('_T')
_U = TypeVar('_U')
def take(n: int, iterable: Iterable[_T]) ->... | 4,056 | Python | .py | 116 | 32.560345 | 77 | 0.601219 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,882 | __init__.py | rembo10_headphones/lib/pkg_resources/_vendor/more_itertools/__init__.py | """More routines for operating on iterables, beyond itertools"""
from .more import * # noqa
from .recipes import * # noqa
__version__ = '9.1.0'
| 148 | Python | .py | 4 | 35.5 | 64 | 0.697183 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,883 | recipes.py | rembo10_headphones/lib/pkg_resources/_vendor/more_itertools/recipes.py | """Imported from the recipes section of the itertools documentation.
All functions taken from the recipes section of the itertools library docs
[1]_.
Some backward-compatible usability improvements have been made.
.. [1] http://docs.python.org/library/itertools.html#recipes
"""
import math
import operator
import war... | 25,416 | Python | .py | 701 | 29.569187 | 79 | 0.594299 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,884 | __main__.py | rembo10_headphones/lib/pkg_resources/_vendor/platformdirs/__main__.py | from __future__ import annotations
from platformdirs import PlatformDirs, __version__
PROPS = (
"user_data_dir",
"user_config_dir",
"user_cache_dir",
"user_state_dir",
"user_log_dir",
"user_documents_dir",
"user_runtime_dir",
"site_data_dir",
"site_config_dir",
)
def main() -> No... | 1,164 | Python | .py | 35 | 28.171429 | 60 | 0.618068 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,885 | windows.py | rembo10_headphones/lib/pkg_resources/_vendor/platformdirs/windows.py | from __future__ import annotations
import ctypes
import os
import sys
from functools import lru_cache
from typing import Callable
from .api import PlatformDirsABC
class Windows(PlatformDirsABC):
"""`MSDN on where to store app data files
<http://support.microsoft.com/default.aspx?scid=kb;en-us;310294#XSLTH31... | 6,596 | Python | .py | 153 | 35.947712 | 119 | 0.649875 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,886 | macos.py | rembo10_headphones/lib/pkg_resources/_vendor/platformdirs/macos.py | from __future__ import annotations
import os
from .api import PlatformDirsABC
class MacOS(PlatformDirsABC):
"""
Platform directories for the macOS operating system. Follows the guidance from `Apple documentation
<https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSys... | 2,655 | Python | .py | 49 | 47.897959 | 160 | 0.683134 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,887 | android.py | rembo10_headphones/lib/pkg_resources/_vendor/platformdirs/android.py | from __future__ import annotations
import os
import re
import sys
from functools import lru_cache
from typing import cast
from .api import PlatformDirsABC
class Android(PlatformDirsABC):
"""
Follows the guidance `from here <https://android.stackexchange.com/a/216132>`_. Makes use of the
`appname <platfo... | 4,068 | Python | .py | 98 | 34.408163 | 120 | 0.636525 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,888 | api.py | rembo10_headphones/lib/pkg_resources/_vendor/platformdirs/api.py | from __future__ import annotations
import os
import sys
from abc import ABC, abstractmethod
from pathlib import Path
if sys.version_info >= (3, 8): # pragma: no branch
from typing import Literal # pragma: no cover
class PlatformDirsABC(ABC):
"""
Abstract base class for platform directories.
"""
... | 4,910 | Python | .py | 131 | 30.183206 | 120 | 0.625578 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,889 | unix.py | rembo10_headphones/lib/pkg_resources/_vendor/platformdirs/unix.py | from __future__ import annotations
import os
import sys
from configparser import ConfigParser
from pathlib import Path
from .api import PlatformDirsABC
if sys.platform.startswith("linux"): # pragma: no branch # no op check, only to please the type checker
from os import getuid
else:
def getuid() -> int:
... | 6,911 | Python | .py | 153 | 37.156863 | 120 | 0.623477 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,890 | __init__.py | rembo10_headphones/lib/pkg_resources/_vendor/platformdirs/__init__.py | """
Utilities for determining application-specific dirs. See <https://github.com/platformdirs/platformdirs> for details and
usage.
"""
from __future__ import annotations
import os
import sys
from pathlib import Path
if sys.version_info >= (3, 8): # pragma: no cover (py38+)
from typing import Literal
else: # pra... | 12,806 | Python | .py | 291 | 39.381443 | 119 | 0.71181 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,891 | version.py | rembo10_headphones/lib/pkg_resources/_vendor/platformdirs/version.py | # file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = '2.6.2'
__version_tuple__ = version_tuple = (2, 6, 2)
| 160 | Python | .py | 4 | 39 | 46 | 0.685897 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,892 | _itertools.py | rembo10_headphones/lib/pkg_resources/_vendor/importlib_resources/_itertools.py | from itertools import filterfalse
from typing import (
Callable,
Iterable,
Iterator,
Optional,
Set,
TypeVar,
Union,
)
# Type and type variable definitions
_T = TypeVar('_T')
_U = TypeVar('_U')
def unique_everseen(
iterable: Iterable[_T], key: Optional[Callable[[_T], _U]] = None
) -> ... | 884 | Python | .py | 31 | 22.354839 | 78 | 0.60424 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,893 | _compat.py | rembo10_headphones/lib/pkg_resources/_vendor/importlib_resources/_compat.py | # flake8: noqa
import abc
import os
import sys
import pathlib
from contextlib import suppress
from typing import Union
if sys.version_info >= (3, 10):
from zipfile import Path as ZipPath # type: ignore
else:
from ..zipp import Path as ZipPath # type: ignore
try:
from typing import runtime_checkable ... | 2,925 | Python | .py | 82 | 27.719512 | 84 | 0.651047 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,894 | _legacy.py | rembo10_headphones/lib/pkg_resources/_vendor/importlib_resources/_legacy.py | import functools
import os
import pathlib
import types
import warnings
from typing import Union, Iterable, ContextManager, BinaryIO, TextIO, Any
from . import _common
Package = Union[types.ModuleType, str]
Resource = str
def deprecated(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
war... | 3,481 | Python | .py | 93 | 32.569892 | 80 | 0.697709 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,895 | abc.py | rembo10_headphones/lib/pkg_resources/_vendor/importlib_resources/abc.py | import abc
import io
import itertools
import pathlib
from typing import Any, BinaryIO, Iterable, Iterator, NoReturn, Text, Optional
from ._compat import runtime_checkable, Protocol, StrPath
__all__ = ["ResourceReader", "Traversable", "TraversableResources"]
class ResourceReader(metaclass=abc.ABCMeta):
"""Abstr... | 5,140 | Python | .py | 135 | 30.444444 | 87 | 0.649899 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,896 | simple.py | rembo10_headphones/lib/pkg_resources/_vendor/importlib_resources/simple.py | """
Interface adapters for low-level readers.
"""
import abc
import io
import itertools
from typing import BinaryIO, List
from .abc import Traversable, TraversableResources
class SimpleReader(abc.ABC):
"""
The minimum, low-level interface required from a resource
provider.
"""
@property
@ab... | 2,576 | Python | .py | 80 | 25.875 | 78 | 0.660729 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,897 | __init__.py | rembo10_headphones/lib/pkg_resources/_vendor/importlib_resources/__init__.py | """Read resources contained within a package."""
from ._common import (
as_file,
files,
Package,
)
from ._legacy import (
contents,
open_binary,
read_binary,
open_text,
read_text,
is_resource,
path,
Resource,
)
from .abc import ResourceReader
__all__ = [
'Package',
... | 506 | Python | .py | 31 | 12.193548 | 48 | 0.595745 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,898 | _common.py | rembo10_headphones/lib/pkg_resources/_vendor/importlib_resources/_common.py | import os
import pathlib
import tempfile
import functools
import contextlib
import types
import importlib
import inspect
import warnings
import itertools
from typing import Union, Optional, cast
from .abc import ResourceReader, Traversable
from ._compat import wrap_spec
Package = Union[types.ModuleType, str]
Anchor ... | 5,457 | Python | .py | 164 | 27.817073 | 79 | 0.684571 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |
8,899 | readers.py | rembo10_headphones/lib/pkg_resources/_vendor/importlib_resources/readers.py | import collections
import pathlib
import operator
from . import abc
from ._itertools import unique_everseen
from ._compat import ZipPath
def remove_duplicates(items):
return iter(collections.OrderedDict.fromkeys(items))
class FileReader(abc.TraversableResources):
def __init__(self, loader):
self.p... | 3,581 | Python | .py | 91 | 31.791209 | 81 | 0.652413 | rembo10/headphones | 3,370 | 601 | 527 | GPL-3.0 | 9/5/2024, 5:10:38 PM (Europe/Amsterdam) |