id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14,900 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/contrib/pyopenssl.py | pipenv.patched.pip._vendor.urllib3.contrib.pyopenssl.WrappedSocket | from cryptography import x509
from socket import error as SocketError
import ssl
import OpenSSL.SSL
from .. import util
import OpenSSL.crypto
from socket import timeout
class WrappedSocket(object):
"""API-compatibility wrapper for Python OpenSSL's Connection-class.
Note: _makefile_refs, _drop() and _reuse() a... |
class WrappedSocket(object):
'''API-compatibility wrapper for Python OpenSSL's Connection-class.
Note: _makefile_refs, _drop() and _reuse() are needed for the garbage
collector of pypy.
'''
def __init__(self, connection, socket, suppress_ragged_eofs=True):
pass
def fileno(self):
... | 15 | 1 | 8 | 0 | 7 | 0 | 3 | 0.08 | 1 | 1 | 0 | 0 | 14 | 5 | 14 | 14 | 133 | 20 | 105 | 27 | 90 | 8 | 92 | 24 | 77 | 8 | 1 | 3 | 40 |
14,901 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/contrib/securetransport.py | pipenv.patched.pip._vendor.urllib3.contrib.securetransport.SecureTransportContext | from ..packages import six
from ._securetransport.bindings import CoreFoundation, Security, SecurityConst
import ssl
from .. import util
class SecureTransportContext(object):
"""
I am a wrapper class for the SecureTransport library, to translate the
interface of the standard library ``SSLContext`` object t... | null | 21 | 4 | 8 | 0 | 5 | 3 | 1 | 0.55 | 1 | 3 | 1 | 0 | 14 | 10 | 14 | 14 | 137 | 19 | 76 | 38 | 48 | 42 | 51 | 25 | 36 | 3 | 1 | 2 | 20 |
14,902 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/contrib/securetransport.py | pipenv.patched.pip._vendor.urllib3.contrib.securetransport.WrappedSocket | import struct
import os.path
from ._securetransport.bindings import CoreFoundation, Security, SecurityConst
import ssl
from ._securetransport.low_level import _assert_no_error, _build_tls_unknown_ca_alert, _cert_array_from_pem, _create_cfstring_array, _load_client_cert_chain, _temporary_keychain
import contextlib
impor... |
class WrappedSocket(object):
'''
API-compatibility wrapper for Python's OpenSSL wrapped socket object.
Note: _makefile_refs, _drop(), and _reuse() are needed for the garbage
collector of PyPy.
'''
def __init__(self, socket):
pass
@contextlib.contextmanager
def _raise_on_error(s... | 23 | 6 | 19 | 2 | 13 | 5 | 3 | 0.4 | 1 | 5 | 1 | 0 | 21 | 9 | 21 | 21 | 439 | 61 | 270 | 80 | 236 | 108 | 218 | 66 | 196 | 9 | 1 | 3 | 63 |
14,903 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/contrib/socks.py | pipenv.patched.pip._vendor.urllib3.contrib.socks.SOCKSConnection | from socket import error as SocketError
from ..exceptions import ConnectTimeoutError, NewConnectionError
from socket import timeout as SocketTimeout
from ..connection import HTTPConnection, HTTPSConnection
class SOCKSConnection(HTTPConnection):
"""
A plain-text HTTP connection that connects via a SOCKS proxy.
... |
class SOCKSConnection(HTTPConnection):
'''
A plain-text HTTP connection that connects via a SOCKS proxy.
'''
def __init__(self, *args, **kwargs):
pass
def _new_conn(self):
'''
Establish a new connection via the SOCKS proxy.
'''
pass | 3 | 2 | 30 | 3 | 25 | 3 | 5 | 0.18 | 1 | 4 | 2 | 1 | 2 | 3 | 2 | 13 | 66 | 8 | 50 | 9 | 47 | 9 | 24 | 7 | 21 | 8 | 2 | 3 | 9 |
14,904 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/exceptions.py | pipenv.patched.pip._vendor.urllib3.exceptions.ProxySchemeUnknown | class ProxySchemeUnknown(AssertionError, URLSchemeUnknown):
"""ProxyManager does not support the supplied scheme"""
def __init__(self, scheme):
if scheme == 'localhost':
scheme = None
if scheme is None:
message = 'Proxy URL had no scheme, should start with http:// or htt... | class ProxySchemeUnknown(AssertionError, URLSchemeUnknown):
'''ProxyManager does not support the supplied scheme'''
def __init__(self, scheme):
pass | 2 | 1 | 13 | 0 | 11 | 2 | 3 | 0.33 | 2 | 1 | 0 | 0 | 1 | 0 | 1 | 14 | 18 | 2 | 12 | 3 | 10 | 4 | 8 | 3 | 6 | 3 | 6 | 1 | 3 |
14,905 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/packages/backports/weakref_finalize.py | pipenv.patched.pip._vendor.urllib3.packages.backports.weakref_finalize.weakref_finalize | from weakref import ref
import itertools
import sys
class weakref_finalize(object):
"""Class for finalization of weakrefable objects
finalize(obj, func, *args, **kwargs) returns a callable finalizer
object which will be called when obj is garbage collected. The
first time the finalizer is called it eva... |
class weakref_finalize(object):
'''Class for finalization of weakrefable objects
finalize(obj, func, *args, **kwargs) returns a callable finalizer
object which will be called when obj is garbage collected. The
first time the finalizer is called it evaluates func(*arg, **kwargs)
and returns the resu... | 17 | 6 | 10 | 0 | 8 | 2 | 2 | 0.37 | 1 | 4 | 1 | 0 | 8 | 0 | 10 | 10 | 139 | 15 | 92 | 40 | 73 | 34 | 80 | 35 | 66 | 8 | 1 | 4 | 23 |
14,906 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/poolmanager.py | pipenv.patched.pip._vendor.urllib3.poolmanager.PoolManager | from .util.proxy import connection_requires_http_tunnel
from .util.retry import Retry
from .packages.six.moves.urllib.parse import urljoin
from .request import RequestMethods
from .util.url import parse_url
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, port_by_scheme
from .packages import six
fro... |
class PoolManager(RequestMethods):
'''
Allows for arbitrary requests while transparently keeping track of
necessary connection pools for you.
:param num_pools:
Number of connection pools to cache before discarding the least
recently used pool.
:param headers:
Headers to incl... | 14 | 11 | 18 | 3 | 10 | 6 | 3 | 0.77 | 1 | 9 | 7 | 2 | 13 | 4 | 13 | 18 | 282 | 54 | 129 | 41 | 115 | 99 | 118 | 41 | 104 | 11 | 2 | 4 | 39 |
14,907 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/poolmanager.py | pipenv.patched.pip._vendor.urllib3.poolmanager.ProxyManager | from .util.url import parse_url
from .util.proxy import connection_requires_http_tunnel
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, port_by_scheme
from .exceptions import LocationValueError, MaxRetryError, ProxySchemeUnknown, ProxySchemeUnsupported, URLSchemeUnknown
class ProxyManager(PoolMana... |
class ProxyManager(PoolManager):
'''
Behaves just like :class:`PoolManager`, but sends all requests through
the defined proxy, using the CONNECT method for HTTPS URLs.
:param proxy_url:
The URL of the proxy to be used.
:param proxy_headers:
A dictionary containing headers that will ... | 5 | 3 | 18 | 3 | 13 | 2 | 3 | 0.75 | 1 | 3 | 2 | 0 | 4 | 4 | 4 | 22 | 113 | 20 | 53 | 24 | 39 | 40 | 36 | 15 | 31 | 4 | 3 | 1 | 11 |
14,908 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/response.py | pipenv.patched.pip._vendor.urllib3.response.HTTPResponse | import io
from socket import timeout as SocketTimeout
import sys
import zlib
from .packages import six
from ._collections import HTTPHeaderDict
from .util.response import is_fp_closed, is_response_to_head
from contextlib import contextmanager
from socket import error as SocketError
from .exceptions import BodyNotHttpli... |
class HTTPResponse(io.IOBase):
'''
HTTP Response container.
Backwards-compatible with :class:`http.client.HTTPResponse` but the response ``body`` is
loaded and decoded on-demand when the ``data`` property is accessed. This
class is also compatible with the Python standard library's :mod:`io`
m... | 38 | 16 | 20 | 2 | 13 | 6 | 4 | 0.49 | 1 | 17 | 11 | 0 | 31 | 21 | 32 | 52 | 723 | 98 | 423 | 117 | 366 | 209 | 315 | 91 | 282 | 14 | 4 | 4 | 121 |
14,909 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/util/retry.py | pipenv.patched.pip._vendor.urllib3.util.retry.Retry | import time
from itertools import takewhile
from ..exceptions import ConnectTimeoutError, InvalidHeader, MaxRetryError, ProtocolError, ProxyError, ReadTimeoutError, ResponseError
import email
import warnings
import re
from ..packages import six
@six.add_metaclass(_RetryMeta)
class Retry(object):
"""Retry configura... | @six.add_metaclass(_RetryMeta)
class Retry(object):
'''Retry configuration.
Each retry attempt will create a new Retry object with updated values, so
they can be safely reused.
Retries can be defined as a default for a pool::
retries = Retry(connect=5, read=2, redirect=5)
http = PoolMana... | 20 | 11 | 21 | 2 | 15 | 3 | 4 | 0.56 | 1 | 22 | 7 | 0 | 16 | 14 | 17 | 17 | 527 | 104 | 272 | 86 | 228 | 152 | 167 | 60 | 149 | 16 | 1 | 3 | 60 |
14,910 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/util/retry.py | pipenv.patched.pip._vendor.urllib3.util.retry._RetryMeta | import warnings
class _RetryMeta(type):
@property
def DEFAULT_METHOD_WHITELIST(cls):
warnings.warn("Using 'Retry.DEFAULT_METHOD_WHITELIST' is deprecated and will be removed in v2.0. Use 'Retry.DEFAULT_ALLOWED_METHODS' instead", DeprecationWarning)
return cls.DEFAULT_ALLOWED_METHODS
@DEFAU... |
class _RetryMeta(type):
@property
def DEFAULT_METHOD_WHITELIST(cls):
pass
@DEFAULT_METHOD_WHITELIST.setter
def DEFAULT_METHOD_WHITELIST(cls):
pass
@property
def DEFAULT_REDIRECT_HEADERS_BLACKLIST(cls):
pass
@DEFAULT_REDIRECT_HEADERS_BLACKLIST.setter
def DEFAULT_... | 13 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 6 | 0 | 6 | 19 | 54 | 5 | 49 | 13 | 36 | 0 | 19 | 7 | 12 | 1 | 2 | 0 | 6 |
14,911 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/util/ssltransport.py | pipenv.patched.pip._vendor.urllib3.util.ssltransport.SSLTransport | from ..packages import six
import ssl
import io
from ..exceptions import ProxySchemeUnsupported
import socket
class SSLTransport:
"""
The SSLTransport wraps an existing socket and establishes an SSL connection.
Contrary to Python's implementation of SSLSocket, it allows you to chain
multiple TLS conne... |
class SSLTransport:
'''
The SSLTransport wraps an existing socket and establishes an SSL connection.
Contrary to Python's implementation of SSLSocket, it allows you to chain
multiple TLS connections together. It's particularly useful if you need to
implement TLS within TLS.
The class supports m... | 27 | 5 | 7 | 0 | 6 | 1 | 2 | 0.17 | 0 | 4 | 1 | 0 | 24 | 5 | 25 | 25 | 211 | 37 | 149 | 54 | 118 | 26 | 129 | 46 | 103 | 11 | 0 | 3 | 52 |
14,912 | pypa/pipenv | pypa_pipenv/pipenv/patched/pip/_vendor/urllib3/util/timeout.py | pipenv.patched.pip._vendor.urllib3.util.timeout.Timeout | from socket import _GLOBAL_DEFAULT_TIMEOUT, getdefaulttimeout
from ..exceptions import TimeoutStateError
class Timeout(object):
"""Timeout configuration.
Timeouts can be defined as a default for a pool:
.. code-block:: python
timeout = Timeout(connect=2.0, read=7.0)
http = PoolManager(time... |
class Timeout(object):
'''Timeout configuration.
Timeouts can be defined as a default for a pool:
.. code-block:: python
timeout = Timeout(connect=2.0, read=7.0)
http = PoolManager(timeout=timeout)
response = http.request('GET', 'http://example.com/')
Or per-request (which override... | 16 | 8 | 15 | 2 | 8 | 6 | 2 | 1.31 | 1 | 6 | 1 | 0 | 7 | 4 | 10 | 10 | 253 | 52 | 87 | 22 | 71 | 114 | 55 | 17 | 44 | 7 | 1 | 2 | 24 |
14,913 | pypa/pipenv | pypa_pipenv/pipenv/project.py | pipenv.project.Project | from pipenv.environment import Environment
from pipenv.utils.locking import atomic_open_for_write
import fnmatch
from pipenv.cmdparse import Script
import base64
import contextlib
from pipenv.utils.internet import PackageIndexHTMLParser, get_requests_session, get_url_name, is_pypi_url, is_valid_url, proper_case
from pi... |
class Project:
'''docstring for Project'''
def __init__(self, python_version=None, chdir=True):
pass
def path_to(self, p: str) -> Path:
'''Returns the absolute path to a given relative path.'''
pass
def get_pipfile_section(self, section):
'''Returns the details from t... | 140 | 23 | 13 | 1 | 11 | 1 | 3 | 0.11 | 0 | 39 | 18 | 0 | 90 | 17 | 94 | 94 | 1,328 | 170 | 1,047 | 370 | 897 | 119 | 843 | 315 | 737 | 18 | 0 | 6 | 303 |
14,914 | pypa/pipenv | pypa_pipenv/pipenv/project.py | pipenv.project.SourceNotFound | class SourceNotFound(KeyError):
pass | class SourceNotFound(KeyError):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
14,915 | pypa/pipenv | pypa_pipenv/pipenv/project.py | pipenv.project._LockFileEncoder | import json
from pathlib import Path
class _LockFileEncoder(json.JSONEncoder):
"""A specialized JSON encoder to convert loaded TOML data into a lock file.
This adds a few characteristics to the encoder:
* The JSON is always prettified with indents and spaces.
* TOMLKit's container elements are seamle... |
class _LockFileEncoder(json.JSONEncoder):
'''A specialized JSON encoder to convert loaded TOML data into a lock file.
This adds a few characteristics to the encoder:
* The JSON is always prettified with indents and spaces.
* TOMLKit's container elements are seamlessly encodable.
* The output is alw... | 4 | 1 | 4 | 0 | 4 | 0 | 2 | 0.5 | 1 | 3 | 0 | 0 | 3 | 0 | 3 | 7 | 23 | 5 | 12 | 5 | 8 | 6 | 12 | 5 | 8 | 2 | 2 | 1 | 5 |
14,916 | pypa/pipenv | pypa_pipenv/pipenv/resolver.py | pipenv.resolver.Entry | from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Set
@dataclass
class Entry:
"""Represents a resolved package entry with its dependencies and constraints."""
name: str
entry_dict: Dict[str, Any]
project: Any
resolver: Any
reverse_deps: Optional[Dict[str, An... | @dataclass
class Entry:
'''Represents a resolved package entry with its dependencies and constraints.'''
def __post_init__(self):
'''Initialize derived attributes after dataclass initialization.'''
pass
def _build_requirement(self) -> PackageRequirement:
'''Construct a PackageRequi... | 15 | 11 | 15 | 2 | 11 | 2 | 3 | 0.19 | 0 | 8 | 4 | 0 | 8 | 3 | 10 | 10 | 171 | 28 | 124 | 41 | 106 | 23 | 85 | 38 | 70 | 7 | 0 | 3 | 33 |
14,917 | pypa/pipenv | pypa_pipenv/pipenv/resolver.py | pipenv.resolver.PackageRequirement | from typing import Any, Dict, List, Optional, Set
from dataclasses import dataclass, field
@dataclass
class PackageRequirement:
"""Core package requirement information."""
name: str
version: Optional[str] = None
extras: Set[str] = field(default_factory=set)
markers: Optional[str] = None
hashes:... | @dataclass
class PackageRequirement:
'''Core package requirement information.'''
def __post_init__(self):
pass | 3 | 1 | 5 | 0 | 5 | 0 | 3 | 0.08 | 0 | 2 | 0 | 0 | 1 | 0 | 1 | 1 | 15 | 2 | 12 | 7 | 10 | 1 | 12 | 7 | 10 | 3 | 0 | 1 | 3 |
14,918 | pypa/pipenv | pypa_pipenv/pipenv/resolver.py | pipenv.resolver.PackageSource | from pathlib import Path
from typing import Any, Dict, List, Optional, Set
from dataclasses import dataclass, field
@dataclass
class PackageSource:
"""Represents the source/origin of a package."""
index: Optional[str] = None
url: Optional[str] = None
vcs: Optional[str] = None
ref: Optional[str] = N... | @dataclass
class PackageSource:
'''Represents the source/origin of a package.'''
@property
def is_vcs(self) -> bool:
pass
@property
def is_local(self) -> bool:
pass | 6 | 1 | 2 | 0 | 2 | 0 | 1 | 0.08 | 0 | 1 | 0 | 0 | 2 | 0 | 2 | 2 | 17 | 3 | 13 | 11 | 8 | 1 | 11 | 9 | 8 | 1 | 0 | 0 | 2 |
14,919 | pypa/pipenv | pypa_pipenv/pipenv/shells.py | pipenv.shells.Bash | import contextlib
from pathlib import Path
class Bash(Shell):
def _format_path(self, python):
return python.parent.as_posix()
@contextlib.contextmanager
def inject_path(self, venv):
from tempfile import NamedTemporaryFile
bashrc_path = Path.home().joinpath('.bashrc')
with ... |
class Bash(Shell):
def _format_path(self, python):
pass
@contextlib.contextmanager
def inject_path(self, venv):
pass | 4 | 0 | 9 | 1 | 8 | 0 | 2 | 0.11 | 1 | 1 | 0 | 1 | 2 | 0 | 2 | 7 | 23 | 3 | 18 | 9 | 13 | 2 | 15 | 7 | 11 | 2 | 1 | 2 | 3 |
14,920 | pypa/pipenv | pypa_pipenv/pipenv/shells.py | pipenv.shells.CmderCommandPrompt | import os
from pathlib import Path
class CmderCommandPrompt(CmderEmulatedShell):
def fork(self, venv, cwd, args):
rc_path = Path(os.path.expandvars('%CMDER_ROOT%\\vendor\\init.bat'))
if rc_path.exists():
self.args.extend(['/k', str(rc_path)])
super().fork(venv, cwd, args) |
class CmderCommandPrompt(CmderEmulatedShell):
def fork(self, venv, cwd, args):
pass | 2 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 7 | 6 | 0 | 6 | 3 | 4 | 0 | 6 | 3 | 4 | 2 | 2 | 1 | 2 |
14,921 | pypa/pipenv | pypa_pipenv/pipenv/shells.py | pipenv.shells.CmderEmulatedShell | import os
class CmderEmulatedShell(Shell):
def fork(self, venv, cwd, args):
if cwd:
os.environ['CMDER_START'] = cwd
super().fork(venv, cwd, args) |
class CmderEmulatedShell(Shell):
def fork(self, venv, cwd, args):
pass | 2 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 6 | 5 | 0 | 5 | 2 | 3 | 0 | 5 | 2 | 3 | 2 | 1 | 1 | 2 |
14,922 | pypa/pipenv | pypa_pipenv/pipenv/shells.py | pipenv.shells.CmderPowershell | import os
from pathlib import Path
class CmderPowershell(Shell):
def fork(self, venv, cwd, args):
rc_path = Path(os.path.expandvars('%CMDER_ROOT%\\vendor\\profile.ps1'))
if rc_path.exists():
self.args.extend(['-ExecutionPolicy', 'Bypass', '-NoLogo', '-NoProfile', '-NoExit', '-Command',... |
class CmderPowershell(Shell):
def fork(self, venv, cwd, args):
pass | 2 | 0 | 15 | 0 | 15 | 0 | 2 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 6 | 16 | 0 | 16 | 3 | 14 | 0 | 6 | 3 | 4 | 2 | 1 | 1 | 2 |
14,923 | pypa/pipenv | pypa_pipenv/pipenv/shells.py | pipenv.shells.MsysBash | class MsysBash(Bash):
def _format_path(self, python):
s = super()._format_path(python)
if not python.drive:
return s
return f'/{s[0].lower()}{s[2:]}' | class MsysBash(Bash):
def _format_path(self, python):
pass | 2 | 0 | 6 | 0 | 5 | 1 | 2 | 0.17 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 8 | 7 | 0 | 6 | 3 | 4 | 1 | 6 | 3 | 4 | 2 | 2 | 1 | 2 |
14,924 | pypa/pipenv | pypa_pipenv/pipenv/shells.py | pipenv.shells.Shell | import sys
from pathlib import Path
from shutil import get_terminal_size
from pipenv.utils.shell import temp_environ
import os
import signal
import contextlib
class Shell:
def __init__(self, cmd):
self.cmd = cmd
self.args = []
def __repr__(self):
return f'{type(self).__name__}(cmd={re... |
class Shell:
def __init__(self, cmd):
pass
def __repr__(self):
pass
@contextlib.contextmanager
def inject_path(self, venv):
pass
def fork(self, venv, cwd, args):
pass
def fork_compat(self, venv, cwd, args):
pass
def sigwinch_passthrough(sig, ... | 8 | 0 | 9 | 1 | 7 | 1 | 2 | 0.2 | 0 | 4 | 1 | 3 | 5 | 2 | 5 | 5 | 56 | 8 | 40 | 15 | 31 | 8 | 35 | 14 | 27 | 3 | 0 | 1 | 9 |
14,925 | pypa/pipenv | pypa_pipenv/pipenv/utils/dependencies.py | pipenv.utils.dependencies.HackedPythonVersion | import os
class HackedPythonVersion:
"""A hack, which allows us to tell resolver which version of Python we're using."""
def __init__(self, python_path):
self.python_path = python_path
def __enter__(self):
if self.python_path:
os.environ['PIP_PYTHON_PATH'] = str(self.python_pa... |
class HackedPythonVersion:
'''A hack, which allows us to tell resolver which version of Python we're using.'''
def __init__(self, python_path):
pass
def __enter__(self):
pass
def __exit__(self, *args):
pass | 4 | 1 | 2 | 0 | 2 | 0 | 1 | 0.13 | 0 | 1 | 0 | 0 | 3 | 1 | 3 | 3 | 12 | 3 | 8 | 5 | 4 | 1 | 8 | 5 | 4 | 2 | 0 | 1 | 4 |
14,926 | pypa/pipenv | pypa_pipenv/pipenv/utils/dependencies.py | pipenv.utils.dependencies.VCSURLProcessor | import re
from urllib.parse import urlparse, urlsplit, urlunparse, urlunsplit
from pipenv.exceptions import PipenvUsageError
import os
class VCSURLProcessor:
"""Handles processing and environment variable expansion in VCS URLs."""
ENV_VAR_PATTERN = re.compile('\\${([^}]+)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)')
@c... |
class VCSURLProcessor:
'''Handles processing and environment variable expansion in VCS URLs.'''
@classmethod
def expand_env_vars(cls, value: str) -> str:
'''
Expands environment variables in a string, with detailed error handling.
Supports both ${VAR} and $VAR syntax.
'''
... | 6 | 3 | 19 | 2 | 13 | 4 | 2 | 0.39 | 0 | 5 | 1 | 0 | 0 | 0 | 2 | 2 | 56 | 8 | 36 | 15 | 30 | 14 | 29 | 12 | 25 | 3 | 0 | 2 | 7 |
14,927 | pypa/pipenv | pypa_pipenv/pipenv/utils/exceptions.py | pipenv.utils.exceptions.FileCorruptException | import sys
from pathlib import Path
class FileCorruptException(OSError):
def __init__(self, path, *args, **kwargs):
backup_path = kwargs.pop('backup_path', None)
if not backup_path and args:
args = list(reversed(args))
backup_path = args.pop()
if not isinstance(... |
class FileCorruptException(OSError):
def __init__(self, path, *args, **kwargs):
pass
def get_message(self, path, backup_path=None):
pass
def show(self):
pass | 4 | 0 | 8 | 0 | 8 | 0 | 2 | 0 | 1 | 3 | 0 | 2 | 3 | 1 | 3 | 16 | 27 | 2 | 25 | 8 | 21 | 0 | 22 | 8 | 18 | 4 | 4 | 2 | 7 |
14,928 | pypa/pipenv | pypa_pipenv/pipenv/utils/exceptions.py | pipenv.utils.exceptions.LockfileCorruptException | import sys
class LockfileCorruptException(FileCorruptException):
def __init__(self, path, backup_path=None):
self.message = self.get_message(path, backup_path=backup_path)
super().__init__(self.message)
def get_message(self, path, backup_path=None):
message = f'ERROR: Failed to load l... |
class LockfileCorruptException(FileCorruptException):
def __init__(self, path, backup_path=None):
pass
def get_message(self, path, backup_path=None):
pass
def show(self, path, backup_path=None):
pass | 4 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 3 | 1 | 3 | 19 | 16 | 2 | 14 | 7 | 10 | 0 | 13 | 7 | 9 | 2 | 5 | 1 | 4 |
14,929 | pypa/pipenv | pypa_pipenv/pipenv/utils/exceptions.py | pipenv.utils.exceptions.MissingParameter | import sys
class MissingParameter(Exception):
def __init__(self, param):
self.message = self.get_message(param)
super().__init__(self.message)
@classmethod
def get_message(cls, param):
return f'Missing Parameter: {param}'
def show(self, param):
print(self.message, fil... |
class MissingParameter(Exception):
def __init__(self, param):
pass
@classmethod
def get_message(cls, param):
pass
def show(self, param):
pass | 5 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 1 | 3 | 13 | 11 | 2 | 9 | 6 | 4 | 0 | 8 | 5 | 4 | 1 | 3 | 0 | 3 |
14,930 | pypa/pipenv | pypa_pipenv/pipenv/utils/exceptions.py | pipenv.utils.exceptions.PipfileCorruptException | import sys
class PipfileCorruptException(FileCorruptException):
def __init__(self, path, backup_path=None):
self.message = self.get_message(path, backup_path=backup_path)
super().__init__(self.message)
def get_message(self, path, backup_path=None):
message = f'ERROR: Failed to load Pi... |
class PipfileCorruptException(FileCorruptException):
def __init__(self, path, backup_path=None):
pass
def get_message(self, path, backup_path=None):
pass
def show(self, path, backup_path=None):
pass | 4 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 3 | 1 | 3 | 19 | 16 | 2 | 14 | 7 | 10 | 0 | 13 | 7 | 9 | 2 | 5 | 1 | 4 |
14,931 | pypa/pipenv | pypa_pipenv/pipenv/utils/exceptions.py | pipenv.utils.exceptions.PipfileNotFound | import errno
class PipfileNotFound(FileNotFoundError):
def __init__(self, path, *args, **kwargs):
self.errno = errno.ENOENT
self.filename = path
super().__init__(self.filename) |
class PipfileNotFound(FileNotFoundError):
def __init__(self, path, *args, **kwargs):
pass | 2 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 2 | 1 | 15 | 5 | 0 | 5 | 4 | 3 | 0 | 5 | 4 | 3 | 1 | 5 | 0 | 1 |
14,932 | pypa/pipenv | pypa_pipenv/pipenv/utils/internet.py | pipenv.utils.internet.PackageIndexHTMLParser | from html.parser import HTMLParser
class PackageIndexHTMLParser(HTMLParser):
def __init__(self):
super().__init__()
self.urls = []
def handle_starttag(self, tag, attrs):
if tag == 'a':
self.urls += [attr[1] for attr in attrs if attr[0] == 'href'] |
class PackageIndexHTMLParser(HTMLParser):
def __init__(self):
pass
def handle_starttag(self, tag, attrs):
pass | 3 | 0 | 4 | 0 | 3 | 1 | 2 | 0.29 | 1 | 1 | 0 | 0 | 2 | 1 | 2 | 40 | 10 | 1 | 7 | 4 | 4 | 2 | 7 | 4 | 4 | 2 | 2 | 1 | 3 |
14,933 | pypa/pipenv | pypa_pipenv/pipenv/utils/locking.py | pipenv.utils.locking.Lockfile | from pipenv.utils.requirementslib import is_editable, is_vcs, merge_items
from dataclasses import dataclass, field
import itertools
from json import JSONDecodeError
from pipenv.vendor.plette import lockfiles
from pipenv.utils.dependencies import clean_resolved_dep, determine_vcs_revision_hash, expansive_install_req_fro... | @dataclass
class Lockfile:
def __post_init__(self):
pass
@property
def section_keys(self):
pass
@property
def extended_keys(self):
pass
def get(self, k):
pass
def __contains__(self, k):
pass
def __setitem__(self, k, v):
pass
def __... | 33 | 0 | 9 | 0 | 9 | 0 | 3 | 0 | 0 | 22 | 7 | 0 | 15 | 0 | 21 | 21 | 233 | 23 | 210 | 79 | 170 | 0 | 162 | 62 | 138 | 9 | 0 | 3 | 59 |
14,934 | pypa/pipenv | pypa_pipenv/pipenv/utils/markers.py | pipenv.utils.markers.PipenvMarkers | from dataclasses import dataclass, fields
from pipenv.patched.pip._vendor.packaging.markers import InvalidMarker, Marker
from typing import Optional
from pipenv.patched.pip._vendor.distlib import markers
@dataclass
class PipenvMarkers:
os_name: Optional[str] = None
sys_platform: Optional[str] = None
platfo... | @dataclass
class PipenvMarkers:
@classmethod
def make_marker(cls, marker_string):
pass
@classmethod
def from_pipfile(cls, name, pipfile):
pass | 6 | 0 | 14 | 0 | 14 | 0 | 4 | 0 | 0 | 5 | 3 | 0 | 0 | 0 | 2 | 2 | 44 | 2 | 42 | 23 | 37 | 0 | 38 | 21 | 35 | 6 | 0 | 1 | 8 |
14,935 | pypa/pipenv | pypa_pipenv/pipenv/utils/pipfile.py | pipenv.utils.pipfile.Pipfile | from dataclasses import dataclass, field
import itertools
from pipenv.utils.toml import tomlkit_value_to_python
from pipenv.utils.markers import RequirementError
import os
from pipenv.vendor import tomlkit
from pipenv.utils.requirementslib import is_editable, is_vcs, merge_items
from typing import Any, Dict, List, Opti... | @dataclass
class Pipfile:
def __post_init__(self):
pass
@staticmethod
def _get_path(v: Path) -> Path:
pass
@staticmethod
def _get_projectfile(v: ProjectFile, values: dict) -> ProjectFile:
pass
@staticmethod
def _get_pipfile(v: PipfileLoader, values: dict) -> PipfileL... | 28 | 3 | 7 | 0 | 6 | 1 | 2 | 0.12 | 0 | 13 | 3 | 0 | 10 | 0 | 16 | 16 | 141 | 19 | 110 | 48 | 83 | 13 | 86 | 38 | 69 | 6 | 0 | 3 | 30 |
14,936 | pypa/pipenv | pypa_pipenv/pipenv/utils/pipfile.py | pipenv.utils.pipfile.PipfileLoader | import contextlib
from pipenv.vendor.plette import pipfiles
from pipenv.vendor import tomlkit
from pipenv.utils.internet import get_url_name
class PipfileLoader(pipfiles.Pipfile):
@classmethod
def validate(cls, data):
for key, klass in pipfiles.PIPFILE_SECTIONS.items():
if key not in data ... |
class PipfileLoader(pipfiles.Pipfile):
@classmethod
def validate(cls, data):
pass
@classmethod
def ensure_package_sections(cls, data):
'''Ensure that all pipfile package sections are present in the given
toml document.
:param :class:`~tomlkit.toml_document.TOMLDocument`... | 11 | 2 | 11 | 0 | 8 | 3 | 3 | 0.36 | 1 | 6 | 0 | 0 | 2 | 0 | 6 | 32 | 78 | 6 | 53 | 22 | 42 | 19 | 48 | 18 | 41 | 5 | 2 | 2 | 19 |
14,937 | pypa/pipenv | pypa_pipenv/pipenv/utils/pipfile.py | pipenv.utils.pipfile.ProjectFile | from pathlib import Path
from typing import Any, Dict, List, Optional
import io
from dataclasses import dataclass, field
@dataclass
class ProjectFile:
location: Path
line_ending: str
model: Optional[Any] = field(default_factory=dict)
@classmethod
def read(cls, location: str, model_cls, invalid_ok:... | @dataclass
class ProjectFile:
@classmethod
def read(cls, location: str, model_cls, invalid_ok: bool=False) -> 'ProjectFile':
pass
def write(self) -> None:
pass
def dumps(self) -> str:
pass | 6 | 0 | 8 | 0 | 8 | 0 | 3 | 0 | 0 | 4 | 0 | 0 | 2 | 0 | 3 | 3 | 32 | 3 | 29 | 12 | 24 | 0 | 28 | 9 | 24 | 4 | 0 | 2 | 8 |
14,938 | pypa/pipenv | pypa_pipenv/pipenv/utils/requirementslib.py | pipenv.utils.requirementslib.PathAccessError | class PathAccessError(KeyError, IndexError, TypeError):
"""An amalgamation of KeyError, IndexError, and TypeError, representing
what can occur when looking up a path in a nested object."""
def __init__(self, exc, seg, path):
self.exc = exc
self.seg = seg
self.path = path
def __... | class PathAccessError(KeyError, IndexError, TypeError):
'''An amalgamation of KeyError, IndexError, and TypeError, representing
what can occur when looking up a path in a nested object.'''
def __init__(self, exc, seg, path):
pass
def __repr__(self):
pass
def __str__(self):
... | 4 | 1 | 3 | 0 | 3 | 0 | 1 | 0.2 | 3 | 0 | 0 | 0 | 3 | 3 | 3 | 18 | 15 | 3 | 10 | 8 | 6 | 2 | 10 | 8 | 6 | 1 | 5 | 0 | 3 |
14,939 | pypa/pipenv | pypa_pipenv/pipenv/utils/resolver.py | pipenv.utils.resolver.HashCacheMixin | class HashCacheMixin:
"""Caches hashes of PyPI artifacts so we do not need to re-download them.
Hashes are only cached when the URL appears to contain a hash in it and the
cache key includes the hash value returned from the server). This ought to
avoid issues where the location on the server changes.
... | class HashCacheMixin:
'''Caches hashes of PyPI artifacts so we do not need to re-download them.
Hashes are only cached when the URL appears to contain a hash in it and the
cache key includes the hash value returned from the server). This ought to
avoid issues where the location on the server changes.
... | 3 | 1 | 3 | 0 | 3 | 0 | 1 | 0.71 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 15 | 3 | 7 | 6 | 4 | 5 | 7 | 6 | 4 | 1 | 0 | 0 | 2 |
14,940 | pypa/pipenv | pypa_pipenv/pipenv/utils/resolver.py | pipenv.utils.resolver.Resolver | from pipenv.patched.pip._vendor.packaging.utils import canonicalize_name
from .shell import make_posix, subprocess_run, temp_environ
from pipenv.utils.requirements import normalize_name
from pathlib import Path
from pipenv.patched.pip._internal.exceptions import InstallationError
from pipenv.patched.pip._internal.req.r... |
class Resolver:
def __init__(self, constraints, req_dir, project, sources, index_lookup=None, markers_lookup=None, skipped=None, clear=False, pre=False, lockfile_category=None, original_deps=None, install_reqs=None, pipfile_entries=None):
pass
def __repr__(self):
pass
@staticmethod
de... | 47 | 5 | 18 | 1 | 16 | 1 | 4 | 0.06 | 0 | 16 | 8 | 0 | 28 | 20 | 30 | 30 | 598 | 67 | 509 | 184 | 425 | 30 | 324 | 130 | 291 | 16 | 0 | 4 | 112 |
14,941 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/_compat.py | pipenv.vendor.click._compat._AtomicFile | import os
import typing as t
class _AtomicFile:
def __init__(self, f: t.IO[t.Any], tmp_filename: str, real_filename: str) -> None:
self._f = f
self._tmp_filename = tmp_filename
self._real_filename = real_filename
self.closed = False
@property
def name(self) -> str:
... |
class _AtomicFile:
def __init__(self, f: t.IO[t.Any], tmp_filename: str, real_filename: str) -> None:
pass
@property
def name(self) -> str:
pass
def close(self, delete: bool=False) -> None:
pass
def __getattr__(self, name: str) -> t.Any:
pass
def __enter__(se... | 9 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 5 | 0 | 0 | 7 | 4 | 7 | 7 | 29 | 6 | 23 | 13 | 14 | 0 | 22 | 12 | 14 | 2 | 0 | 1 | 8 |
14,942 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/_compat.py | pipenv.vendor.click._compat._FixupStream | import typing as t
class _FixupStream:
"""The new io interface needs more from streams than streams
traditionally implement. As such, this fix-up code is necessary in
some circumstances.
The forcing of readable and writable flags are there because some tools
put badly patched objects on sys (one ... |
class _FixupStream:
'''The new io interface needs more from streams than streams
traditionally implement. As such, this fix-up code is necessary in
some circumstances.
The forcing of readable and writable flags are there because some tools
put badly patched objects on sys (one such offender are ce... | 7 | 1 | 9 | 0 | 8 | 0 | 3 | 0.16 | 0 | 7 | 0 | 0 | 6 | 3 | 6 | 6 | 67 | 9 | 51 | 19 | 39 | 8 | 46 | 14 | 39 | 5 | 0 | 2 | 16 |
14,943 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/_compat.py | pipenv.vendor.click._compat._NonClosingTextIOWrapper | import io
import typing as t
class _NonClosingTextIOWrapper(io.TextIOWrapper):
def __init__(self, stream: t.BinaryIO, encoding: t.Optional[str], errors: t.Optional[str], force_readable: bool=False, force_writable: bool=False, **extra: t.Any) -> None:
self._stream = stream = t.cast(t.BinaryIO, _FixupStream... |
class _NonClosingTextIOWrapper(io.TextIOWrapper):
def __init__(self, stream: t.BinaryIO, encoding: t.Optional[str], errors: t.Optional[str], force_readable: bool=False, force_writable: bool=False, **extra: t.Any) -> None:
pass
def __del__(self) -> None:
pass
def isatty(self) -> bool:
... | 4 | 0 | 7 | 0 | 7 | 0 | 1 | 0.05 | 0 | 7 | 1 | 0 | 3 | 1 | 3 | 3 | 24 | 2 | 21 | 13 | 9 | 1 | 11 | 5 | 7 | 2 | 0 | 1 | 4 |
14,944 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/_termui_impl.py | pipenv.vendor.click._termui_impl.Editor | from .exceptions import ClickException
from ._compat import WIN
from gettext import gettext as _
import os
import typing as t
class Editor:
def __init__(self, editor: t.Optional[str]=None, env: t.Optional[t.Mapping[str, str]]=None, require_save: bool=True, extension: str='.txt') -> None:
self.editor = edi... |
class Editor:
def __init__(self, editor: t.Optional[str]=None, env: t.Optional[t.Mapping[str, str]]=None, require_save: bool=True, extension: str='.txt') -> None:
pass
def get_editor(self) -> str:
pass
def edit_file(self, filename: str) -> None:
pass
def edit_file(self, file... | 5 | 0 | 23 | 3 | 18 | 2 | 5 | 0.1 | 0 | 8 | 1 | 0 | 4 | 4 | 4 | 4 | 95 | 16 | 73 | 29 | 60 | 7 | 59 | 22 | 52 | 7 | 0 | 2 | 19 |
14,945 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/_termui_impl.py | pipenv.vendor.click._termui_impl.ProgressBar | from .utils import echo
from types import TracebackType
import time
from ._compat import _default_text_stdout
from ._compat import isatty
import math
from ._compat import term_len
from io import StringIO
import typing as t
class ProgressBar(t.Generic[V]):
def __init__(self, iterable: t.Optional[t.Iterable[V]], le... |
class ProgressBar(t.Generic[V]):
def __init__(self, iterable: t.Optional[t.Iterable[V]], length: t.Optional[int]=None, fill_char: str='#', empty_char: str=' ', bar_template: str='%(bar)s', info_sep:
pass
def __enter__(self) -> 'ProgressBar[V]':
pass
def __exit__(self, exc_type: t.Optiona... | 23 | 2 | 16 | 2 | 12 | 2 | 3 | 0.18 | 1 | 10 | 0 | 0 | 19 | 28 | 19 | 21 | 321 | 48 | 233 | 94 | 186 | 42 | 191 | 69 | 169 | 8 | 1 | 3 | 58 |
14,946 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/_textwrap.py | pipenv.vendor.click._textwrap.TextWrapper | import textwrap
import typing as t
from contextlib import contextmanager
class TextWrapper(textwrap.TextWrapper):
def _handle_long_word(self, reversed_chunks: t.List[str], cur_line: t.List[str], cur_len: int, width: int) -> None:
space_left = max(width - cur_len, 1)
if self.break_long_words:
... |
class TextWrapper(textwrap.TextWrapper):
def _handle_long_word(self, reversed_chunks: t.List[str], cur_line: t.List[str], cur_len: int, width: int) -> None:
pass
@contextmanager
def extra_indent(self, indent: str) -> t.Iterator[None]:
pass
def indent_only(self, text: str) -> str:
... | 5 | 0 | 13 | 2 | 11 | 0 | 2 | 0 | 1 | 3 | 0 | 0 | 3 | 2 | 3 | 12 | 44 | 8 | 36 | 22 | 25 | 0 | 27 | 15 | 23 | 3 | 1 | 2 | 7 |
14,947 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/_winconsole.py | pipenv.vendor.click._winconsole.ConsoleStream | import typing as t
class ConsoleStream:
def __init__(self, text_stream: t.TextIO, byte_stream: t.BinaryIO) -> None:
self._text_stream = text_stream
self.buffer = byte_stream
@property
def name(self) -> str:
return self.buffer.name
def write(self, x: t.AnyStr) -> int:
... |
class ConsoleStream:
def __init__(self, text_stream: t.TextIO, byte_stream: t.BinaryIO) -> None:
pass
@property
def name(self) -> str:
pass
def write(self, x: t.AnyStr) -> int:
pass
def writelines(self, lines: t.Iterable[t.AnyStr]) -> None:
pass
def __getattr... | 9 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 7 | 0 | 0 | 7 | 2 | 7 | 7 | 30 | 6 | 24 | 12 | 15 | 0 | 23 | 11 | 15 | 3 | 0 | 1 | 10 |
14,948 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/_winconsole.py | pipenv.vendor.click._winconsole._WindowsConsoleRawIOBase | import io
class _WindowsConsoleRawIOBase(io.RawIOBase):
def __init__(self, handle):
self.handle = handle
def isatty(self):
super().isatty()
return True |
class _WindowsConsoleRawIOBase(io.RawIOBase):
def __init__(self, handle):
pass
def isatty(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 1 | 0 | 2 | 2 | 1 | 2 | 22 | 7 | 1 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 5 | 0 | 2 |
14,949 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/_winconsole.py | pipenv.vendor.click._winconsole._WindowsConsoleReader | from ctypes import byref
from ctypes.wintypes import HANDLE
import time
from ctypes import c_ulong
class _WindowsConsoleReader(_WindowsConsoleRawIOBase):
def readable(self):
return True
def readinto(self, b):
bytes_to_be_read = len(b)
if not bytes_to_be_read:
return 0
... |
class _WindowsConsoleReader(_WindowsConsoleRawIOBase):
def readable(self):
pass
def readinto(self, b):
pass | 3 | 0 | 16 | 2 | 14 | 1 | 4 | 0.04 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 24 | 33 | 4 | 28 | 8 | 25 | 1 | 19 | 8 | 16 | 6 | 6 | 1 | 7 |
14,950 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/_winconsole.py | pipenv.vendor.click._winconsole._WindowsConsoleWriter | from ctypes.wintypes import HANDLE
from ctypes import byref
from ctypes import c_ulong
class _WindowsConsoleWriter(_WindowsConsoleRawIOBase):
def writable(self):
return True
@staticmethod
def _get_error_message(errno):
if errno == ERROR_SUCCESS:
return 'ERROR_SUCCESS'
... |
class _WindowsConsoleWriter(_WindowsConsoleRawIOBase):
def writable(self):
pass
@staticmethod
def _get_error_message(errno):
pass
def write(self, b):
pass | 5 | 0 | 9 | 1 | 8 | 0 | 2 | 0 | 1 | 2 | 0 | 0 | 2 | 0 | 3 | 25 | 30 | 4 | 26 | 10 | 21 | 0 | 18 | 9 | 14 | 3 | 6 | 1 | 6 |
14,951 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/core.py | pipenv.vendor.click.core.Argument | import typing as t
from .parser import OptionParser
class Argument(Parameter):
"""Arguments are positional parameters to a command. They generally
provide fewer features than options but can have infinite ``nargs``
and are required by default.
All parameters are passed onwards to the constructor of :... |
class Argument(Parameter):
'''Arguments are positional parameters to a command. They generally
provide fewer features than options but can have infinite ``nargs``
and are required by default.
All parameters are passed onwards to the constructor of :class:`Parameter`.
'''
def __init__(self... | 9 | 1 | 8 | 0 | 8 | 0 | 3 | 0.12 | 1 | 7 | 2 | 0 | 7 | 2 | 7 | 28 | 74 | 12 | 57 | 20 | 41 | 7 | 44 | 11 | 36 | 6 | 1 | 2 | 20 |
14,952 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/core.py | pipenv.vendor.click.core.BaseCommand | from .exceptions import Abort
from .utils import PacifyFlushWrapper
from .exceptions import ClickException
from .utils import _detect_program_name
from gettext import gettext as _
import os
from .utils import _expand_args
import sys
from .utils import echo
from .exceptions import Exit
import typing as t
import errno
c... |
class BaseCommand:
'''The base command implements the minimal API contract of commands.
Most code will never use this as it does not implement a lot of useful
functionality but it can act as the direct subclass of alternative
parsing methods that do not depend on the Click parser.
For instance, thi... | 17 | 9 | 20 | 2 | 10 | 8 | 2 | 0.94 | 0 | 16 | 7 | 1 | 14 | 2 | 14 | 14 | 324 | 51 | 141 | 71 | 85 | 133 | 93 | 30 | 76 | 14 | 0 | 4 | 34 |
14,953 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/core.py | pipenv.vendor.click.core.Command | import inspect
from .utils import make_default_short_help
from .utils import echo
from gettext import ngettext
import typing as t
from .formatting import HelpFormatter
from gettext import gettext as _
from .parser import OptionParser
from .termui import style
class Command(BaseCommand):
"""Commands are the basic b... |
class Command(BaseCommand):
'''Commands are the basic building block of command line interfaces in
Click. A basic command handles command line parsing and might dispatch
more parsing to commands nested below it.
:param name: the name of the command to use unless a group overrides it.
:param contex... | 20 | 15 | 13 | 2 | 9 | 2 | 2 | 0.45 | 1 | 14 | 6 | 1 | 18 | 10 | 18 | 32 | 310 | 55 | 177 | 71 | 142 | 79 | 126 | 57 | 105 | 4 | 1 | 3 | 44 |
14,954 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/core.py | pipenv.vendor.click.core.CommandCollection | import typing as t
class CommandCollection(MultiCommand):
"""A command collection is a multi command that merges multiple multi
commands together into one. This is a straightforward implementation
that accepts a list of different multi commands as sources and
provides all the commands for each of them... |
class CommandCollection(MultiCommand):
'''A command collection is a multi command that merges multiple multi
commands together into one. This is a straightforward implementation
that accepts a list of different multi commands as sources and
provides all the commands for each of them.
See :class:`M... | 5 | 2 | 8 | 1 | 6 | 1 | 2 | 0.38 | 1 | 5 | 1 | 0 | 4 | 1 | 4 | 48 | 43 | 10 | 24 | 15 | 14 | 9 | 19 | 10 | 14 | 4 | 3 | 3 | 8 |
14,955 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/core.py | pipenv.vendor.click.core.Context | from contextlib import ExitStack
from .globals import push_context
from types import TracebackType
from .exceptions import Exit
from contextlib import contextmanager
from .globals import pop_context
import typing as t
from .formatting import HelpFormatter
from .exceptions import Abort
from .exceptions import UsageError... |
class Context:
'''The context is a special internal object that holds state relevant
for the script execution at every single level. It's normally invisible
to commands unless they opt-in to getting access to it.
The context is useful as it can pass internal objects around and can
control special ... | 37 | 23 | 19 | 3 | 8 | 8 | 2 | 1.21 | 0 | 15 | 6 | 0 | 29 | 26 | 29 | 29 | 672 | 120 | 252 | 120 | 171 | 305 | 170 | 68 | 140 | 17 | 0 | 3 | 65 |
14,956 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/core.py | pipenv.vendor.click.core.Group | import typing as t
from collections import abc
class Group(MultiCommand):
"""A group allows a command to have subcommands attached. This is
the most common way to implement nesting in Click.
:param name: The name of the group command.
:param commands: A dict mapping names to :class:`Command` objects.
... |
class Group(MultiCommand):
'''A group allows a command to have subcommands attached. This is
the most common way to implement nesting in Click.
:param name: The name of the group command.
:param commands: A dict mapping names to :class:`Command` objects.
Can also be a list of :class:`Command`, ... | 17 | 4 | 11 | 2 | 7 | 2 | 2 | 0.63 | 1 | 7 | 1 | 1 | 10 | 1 | 10 | 54 | 174 | 34 | 86 | 41 | 52 | 54 | 61 | 22 | 46 | 5 | 3 | 2 | 22 |
14,957 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/core.py | pipenv.vendor.click.core.MultiCommand | from .utils import echo
from .parser import split_opt
import typing as t
from .formatting import HelpFormatter
from gettext import gettext as _
from functools import update_wrapper
from .utils import make_str
class MultiCommand(Command):
"""A multi command is the basic implementation of a command that
dispatch... |
class MultiCommand(Command):
'''A multi command is the basic implementation of a command that
dispatches to subcommands. The most common version is the
:class:`Group`.
:param invoke_without_command: this controls how the multi command itself
is invoked. By default i... | 16 | 6 | 19 | 3 | 12 | 5 | 3 | 0.56 | 1 | 10 | 4 | 2 | 12 | 5 | 12 | 44 | 307 | 54 | 163 | 61 | 135 | 91 | 138 | 49 | 121 | 8 | 2 | 3 | 45 |
14,958 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/core.py | pipenv.vendor.click.core.Option | from .parser import _flag_needs_value
from . import types
import os
from .termui import prompt
import inspect
from .parser import OptionParser
from .termui import confirm
from .formatting import join_options
from .parser import split_opt
import typing as t
from gettext import gettext as _
class Option(Parameter):
... |
class Option(Parameter):
'''Options are usually optional values on the command line and
have some extra features that arguments don't have.
All other parameters are passed onwards to the parameter constructor.
:param show_default: Show the default value for this option in its
help text. Values ... | 16 | 2 | 35 | 5 | 27 | 3 | 7 | 0.25 | 1 | 15 | 7 | 0 | 12 | 20 | 12 | 33 | 518 | 86 | 346 | 98 | 300 | 87 | 222 | 65 | 207 | 25 | 1 | 4 | 94 |
14,959 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/core.py | pipenv.vendor.click.core.Parameter | from gettext import ngettext
from .exceptions import BadParameter
import typing as t
from gettext import gettext as _
from .parser import OptionParser
from . import types
import os
from .exceptions import MissingParameter
class Parameter:
"""A parameter to a command comes in two versions: they are either
:clas... |
class Parameter:
'''A parameter to a command comes in two versions: they are either
:class:`Option`\s or :class:`Argument`\s. Other subclasses are currently
not supported by design as some of the internals for parsing are
intentionally not finalized.
Some settings are supported by both options and... | 29 | 7 | 15 | 2 | 10 | 2 | 3 | 0.5 | 0 | 16 | 7 | 2 | 21 | 14 | 21 | 21 | 435 | 88 | 237 | 87 | 176 | 119 | 165 | 53 | 138 | 14 | 0 | 5 | 68 |
14,960 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/core.py | pipenv.vendor.click.core.ParameterSource | import enum
class ParameterSource(enum.Enum):
"""This is an :class:`~enum.Enum` that indicates the source of a
parameter's value.
Use :meth:`click.Context.get_parameter_source` to get the
source for a parameter by name.
.. versionchanged:: 8.0
Use :class:`~enum.Enum` and drop the ``valida... |
class ParameterSource(enum.Enum):
'''This is an :class:`~enum.Enum` that indicates the source of a
parameter's value.
Use :meth:`click.Context.get_parameter_source` to get the
source for a parameter by name.
.. versionchanged:: 8.0
Use :class:`~enum.Enum` and drop the ``validate`` method.
... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2.33 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 24 | 4 | 6 | 6 | 5 | 14 | 6 | 6 | 5 | 0 | 4 | 0 | 0 |
14,961 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/exceptions.py | pipenv.vendor.click.exceptions.Abort | class Abort(RuntimeError):
"""An internal signalling exception that signals Click to abort.""" | class Abort(RuntimeError):
'''An internal signalling exception that signals Click to abort.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 2 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 4 | 0 | 0 |
14,962 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/exceptions.py | pipenv.vendor.click.exceptions.BadArgumentUsage | class BadArgumentUsage(UsageError):
"""Raised if an argument is generally supplied but the use of the argument
was incorrect. This is for instance raised if the number of values
for an argument is not correct.
.. versionadded:: 6.0
""" | class BadArgumentUsage(UsageError):
'''Raised if an argument is generally supplied but the use of the argument
was incorrect. This is for instance raised if the number of values
for an argument is not correct.
.. versionadded:: 6.0
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 7 | 1 | 1 | 1 | 0 | 5 | 1 | 1 | 0 | 0 | 5 | 0 | 0 |
14,963 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/exceptions.py | pipenv.vendor.click.exceptions.BadOptionUsage | import typing as t
class BadOptionUsage(UsageError):
"""Raised if an option is generally supplied but the use of the option
was incorrect. This is for instance raised if the number of arguments
for an option is not correct.
.. versionadded:: 4.0
:param option_name: the name of the option being u... |
class BadOptionUsage(UsageError):
'''Raised if an option is generally supplied but the use of the option
was incorrect. This is for instance raised if the number of arguments
for an option is not correct.
.. versionadded:: 4.0
:param option_name: the name of the option being used incorrectly.
... | 2 | 1 | 5 | 0 | 5 | 0 | 1 | 1 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 17 | 15 | 3 | 6 | 5 | 2 | 6 | 4 | 3 | 2 | 1 | 5 | 0 | 1 |
14,964 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/exceptions.py | pipenv.vendor.click.exceptions.BadParameter | from gettext import gettext as _
import typing as t
class BadParameter(UsageError):
"""An exception that formats out a standardized error message for a
bad parameter. This is useful when thrown from a callback or type as
Click will attach contextual information to it (for instance, which
parameter it ... |
class BadParameter(UsageError):
'''An exception that formats out a standardized error message for a
bad parameter. This is useful when thrown from a callback or type as
Click will attach contextual information to it (for instance, which
parameter it is).
.. versionadded:: 2.0
:param param: the... | 3 | 1 | 11 | 1 | 10 | 1 | 2 | 0.71 | 1 | 2 | 0 | 1 | 2 | 2 | 2 | 18 | 40 | 5 | 21 | 12 | 12 | 15 | 11 | 6 | 8 | 3 | 5 | 1 | 4 |
14,965 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/exceptions.py | pipenv.vendor.click.exceptions.ClickException | from ._compat import get_text_stderr
import typing as t
from .utils import echo
from gettext import gettext as _
class ClickException(Exception):
"""An exception that Click can handle and show to the user."""
exit_code = 1
def __init__(self, message: str) -> None:
super().__init__(message)
... |
class ClickException(Exception):
'''An exception that Click can handle and show to the user.'''
def __init__(self, message: str) -> None:
pass
def format_message(self) -> str:
pass
def __str__(self) -> str:
pass
def show(self, file: t.Optional[t.IO[t.Any]]=None) -> None:... | 5 | 1 | 3 | 0 | 3 | 0 | 1 | 0.15 | 1 | 4 | 0 | 3 | 4 | 1 | 4 | 14 | 21 | 6 | 13 | 7 | 8 | 2 | 13 | 7 | 8 | 2 | 3 | 1 | 5 |
14,966 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/exceptions.py | pipenv.vendor.click.exceptions.Exit | class Exit(RuntimeError):
"""An exception that indicates that the application should exit with some
status code.
:param code: the status code to exit with.
"""
__slots__ = ('exit_code',)
def __init__(self, code: int=0) -> None:
self.exit_code: int = code | class Exit(RuntimeError):
'''An exception that indicates that the application should exit with some
status code.
:param code: the status code to exit with.
'''
def __init__(self, code: int=0) -> None:
pass | 2 | 1 | 2 | 0 | 2 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 12 | 11 | 3 | 4 | 4 | 2 | 4 | 4 | 4 | 2 | 1 | 4 | 0 | 1 |
14,967 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/exceptions.py | pipenv.vendor.click.exceptions.FileError | from gettext import gettext as _
from .utils import format_filename
import typing as t
class FileError(ClickException):
"""Raised if a file cannot be opened."""
def __init__(self, filename: str, hint: t.Optional[str]=None) -> None:
if hint is None:
hint = _('unknown error')
super()... |
class FileError(ClickException):
'''Raised if a file cannot be opened.'''
def __init__(self, filename: str, hint: t.Optional[str]=None) -> None:
pass
def format_message(self) -> str:
pass | 3 | 1 | 6 | 1 | 5 | 0 | 2 | 0.09 | 1 | 2 | 0 | 1 | 2 | 2 | 2 | 16 | 15 | 3 | 11 | 5 | 8 | 1 | 9 | 5 | 6 | 2 | 4 | 1 | 3 |
14,968 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/exceptions.py | pipenv.vendor.click.exceptions.MissingParameter | import typing as t
from gettext import gettext as _
class MissingParameter(BadParameter):
"""Raised if click required an option or argument but it was not
provided when invoking the script.
.. versionadded:: 4.0
:param param_type: a string that indicates the type of the parameter.
... |
class MissingParameter(BadParameter):
'''Raised if click required an option or argument but it was not
provided when invoking the script.
.. versionadded:: 4.0
:param param_type: a string that indicates the type of the parameter.
The default is to inherit the parameter type from
... | 4 | 1 | 18 | 2 | 15 | 1 | 5 | 0.21 | 1 | 2 | 0 | 0 | 3 | 1 | 3 | 21 | 67 | 11 | 47 | 18 | 36 | 10 | 33 | 11 | 29 | 12 | 6 | 3 | 16 |
14,969 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/exceptions.py | pipenv.vendor.click.exceptions.NoSuchOption | from gettext import gettext as _
from gettext import ngettext
import typing as t
class NoSuchOption(UsageError):
"""Raised if click attempted to handle an option that does not
exist.
.. versionadded:: 4.0
"""
def __init__(self, option_name: str, message: t.Optional[str]=None, possibilities: t.Opt... |
class NoSuchOption(UsageError):
'''Raised if click attempted to handle an option that does not
exist.
.. versionadded:: 4.0
'''
def __init__(self, option_name: str, message: t.Optional[str]=None, possibilities: t.Optional[t.Sequence[str]]=None, ctx: t.Optional['Context']=None) -> None:
pas... | 3 | 1 | 12 | 1 | 11 | 0 | 2 | 0.17 | 1 | 2 | 0 | 0 | 2 | 2 | 2 | 18 | 32 | 5 | 23 | 13 | 14 | 4 | 13 | 7 | 10 | 2 | 5 | 1 | 4 |
14,970 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/exceptions.py | pipenv.vendor.click.exceptions.UsageError | from .utils import echo
from ._compat import get_text_stderr
import typing as t
from gettext import gettext as _
class UsageError(ClickException):
"""An internal exception that signals a usage error. This typically
aborts any further handling.
:param message: the error message to display.
:param ctx:... |
class UsageError(ClickException):
'''An internal exception that signals a usage error. This typically
aborts any further handling.
:param message: the error message to display.
:param ctx: optionally the context that caused this error. Click will
fill in the context automatically in s... | 3 | 1 | 13 | 0 | 13 | 0 | 3 | 0.22 | 1 | 4 | 0 | 5 | 2 | 2 | 2 | 16 | 37 | 4 | 27 | 8 | 24 | 6 | 18 | 8 | 15 | 4 | 4 | 1 | 6 |
14,971 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/formatting.py | pipenv.vendor.click.formatting.HelpFormatter | from gettext import gettext as _
from contextlib import contextmanager
from ._compat import term_len
import typing as t
class HelpFormatter:
"""This class helps with formatting text-based help pages. It's
usually just needed for very special internal cases, but it's also
exposed so that developers can wri... |
class HelpFormatter:
'''This class helps with formatting text-based help pages. It's
usually just needed for very special internal cases, but it's also
exposed so that developers can write their own fancy outputs.
At present, it always writes into memory.
:param indent_increment: the additional in... | 15 | 12 | 13 | 1 | 9 | 2 | 2 | 0.32 | 0 | 4 | 0 | 0 | 12 | 4 | 12 | 12 | 179 | 26 | 116 | 43 | 88 | 37 | 78 | 29 | 64 | 7 | 0 | 3 | 24 |
14,972 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/parser.py | pipenv.vendor.click.parser.Argument | from .exceptions import BadArgumentUsage
import typing as t
from gettext import gettext as _
class Argument:
def __init__(self, obj: 'CoreArgument', dest: t.Optional[str], nargs: int=1):
self.dest = dest
self.nargs = nargs
self.obj = obj
def process(self, value: t.Union[t.Optional[str... |
class Argument:
def __init__(self, obj: 'CoreArgument', dest: t.Optional[str], nargs: int=1):
pass
def process(self, value: t.Union[t.Optional[str], t.Sequence[t.Optional[str]]], state: 'ParsingState') -> None:
pass | 3 | 0 | 14 | 1 | 12 | 2 | 3 | 0.12 | 0 | 3 | 1 | 0 | 2 | 3 | 2 | 2 | 30 | 3 | 25 | 11 | 18 | 3 | 16 | 7 | 13 | 5 | 0 | 2 | 6 |
14,973 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/parser.py | pipenv.vendor.click.parser.Option | import typing as t
class Option:
def __init__(self, obj: 'CoreOption', opts: t.Sequence[str], dest: t.Optional[str], action: t.Optional[str]=None, nargs: int=1, const: t.Optional[t.Any]=None):
self._short_opts = []
self._long_opts = []
self.prefixes: t.Set[str] = set()
for opt in o... |
class Option:
def __init__(self, obj: 'CoreOption', opts: t.Sequence[str], dest: t.Optional[str], action: t.Optional[str]=None, nargs: int=1, const: t.Optional[t.Any]=None):
pass
@property
def takes_value(self) -> bool:
pass
def process(self, value: t.Any, state: 'ParsingState') -> No... | 5 | 0 | 16 | 1 | 15 | 2 | 4 | 0.11 | 0 | 6 | 0 | 0 | 3 | 8 | 3 | 3 | 52 | 5 | 47 | 23 | 34 | 5 | 32 | 14 | 28 | 6 | 0 | 2 | 12 |
14,974 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/parser.py | pipenv.vendor.click.parser.OptionParser | import typing as t
from .exceptions import UsageError
from gettext import ngettext
from .exceptions import NoSuchOption
from .exceptions import BadOptionUsage
from gettext import gettext as _
class OptionParser:
"""The option parser is an internal class that is ultimately used to
parse options and arguments. ... |
class OptionParser:
'''The option parser is an internal class that is ultimately used to
parse options and arguments. It's modelled after optparse and brings
a similar but vastly simplified API. It should generally not be used
directly as the high level Click classes wrap it for you.
It's not nea... | 11 | 4 | 23 | 3 | 16 | 5 | 4 | 0.53 | 0 | 12 | 6 | 0 | 10 | 7 | 10 | 10 | 277 | 38 | 156 | 58 | 128 | 83 | 113 | 42 | 101 | 8 | 0 | 3 | 39 |
14,975 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/parser.py | pipenv.vendor.click.parser.ParsingState | import typing as t
class ParsingState:
def __init__(self, rargs: t.List[str]) -> None:
self.opts: t.Dict[str, t.Any] = {}
self.largs: t.List[str] = []
self.rargs = rargs
self.order: t.List['CoreParameter'] = [] |
class ParsingState:
def __init__(self, rargs: t.List[str]) -> None:
pass | 2 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 1 | 4 | 1 | 1 | 6 | 0 | 6 | 6 | 4 | 0 | 6 | 6 | 4 | 1 | 0 | 0 | 1 |
14,976 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/shell_completion.py | pipenv.vendor.click.shell_completion.BashComplete | from .utils import echo
import os
from gettext import gettext as _
from .parser import split_arg_string
import re
import typing as t
class BashComplete(ShellComplete):
"""Shell completion for Bash."""
name = 'bash'
source_template = _SOURCE_BASH
@staticmethod
def _check_version() -> None:
... |
class BashComplete(ShellComplete):
'''Shell completion for Bash.'''
@staticmethod
def _check_version() -> None:
pass
def source(self) -> str:
pass
def get_completion_args(self) -> t.Tuple[t.List[str], str]:
pass
def format_completion(self, item: CompletionItem) -> str... | 6 | 1 | 10 | 1 | 9 | 0 | 2 | 0.03 | 1 | 5 | 1 | 0 | 3 | 0 | 4 | 12 | 50 | 10 | 39 | 16 | 32 | 1 | 26 | 15 | 20 | 3 | 1 | 2 | 7 |
14,977 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/shell_completion.py | pipenv.vendor.click.shell_completion.CompletionItem | import typing as t
class CompletionItem:
"""Represents a completion value and metadata about the value. The
default metadata is ``type`` to indicate special shell handling,
and ``help`` if a shell supports showing a help string next to the
value.
Arbitrary parameters can be passed when creating th... | null | 3 | 1 | 7 | 0 | 7 | 0 | 1 | 1 | 0 | 2 | 0 | 0 | 2 | 4 | 2 | 2 | 35 | 5 | 15 | 14 | 6 | 15 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
14,978 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/shell_completion.py | pipenv.vendor.click.shell_completion.FishComplete | from .parser import split_arg_string
import os
import typing as t
class FishComplete(ShellComplete):
"""Shell completion for Fish."""
name = 'fish'
source_template = _SOURCE_FISH
def get_completion_args(self) -> t.Tuple[t.List[str], str]:
cwords = split_arg_string(os.environ['COMP_WORDS'])
... |
class FishComplete(ShellComplete):
'''Shell completion for Fish.'''
def get_completion_args(self) -> t.Tuple[t.List[str], str]:
pass
def format_completion(self, item: CompletionItem) -> str:
pass | 3 | 1 | 8 | 2 | 6 | 1 | 2 | 0.21 | 1 | 2 | 1 | 0 | 2 | 0 | 2 | 10 | 23 | 6 | 14 | 8 | 11 | 3 | 14 | 8 | 11 | 2 | 1 | 1 | 4 |
14,979 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/shell_completion.py | pipenv.vendor.click.shell_completion.ShellComplete | import typing as t
import re
from .core import BaseCommand
class ShellComplete:
"""Base class for providing shell completion support. A subclass for
a given shell will override attributes and methods to implement the
completion instructions (``source`` and ``complete``).
:param cli: Command being call... |
class ShellComplete:
'''Base class for providing shell completion support. A subclass for
a given shell will override attributes and methods to implement the
completion instructions (``source`` and ``complete``).
:param cli: Command being called.
:param prog_name: Name of the executable in the shel... | 10 | 8 | 9 | 1 | 5 | 4 | 1 | 1.15 | 0 | 4 | 1 | 3 | 8 | 4 | 8 | 8 | 104 | 16 | 41 | 28 | 23 | 47 | 28 | 19 | 19 | 1 | 0 | 0 | 8 |
14,980 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/shell_completion.py | pipenv.vendor.click.shell_completion.ZshComplete | import os
from .parser import split_arg_string
import typing as t
class ZshComplete(ShellComplete):
"""Shell completion for Zsh."""
name = 'zsh'
source_template = _SOURCE_ZSH
def get_completion_args(self) -> t.Tuple[t.List[str], str]:
cwords = split_arg_string(os.environ['COMP_WORDS'])
... |
class ZshComplete(ShellComplete):
'''Shell completion for Zsh.'''
def get_completion_args(self) -> t.Tuple[t.List[str], str]:
pass
def format_completion(self, item: CompletionItem) -> str:
pass | 3 | 1 | 7 | 1 | 6 | 0 | 2 | 0.07 | 1 | 4 | 1 | 0 | 2 | 0 | 2 | 10 | 20 | 5 | 14 | 9 | 11 | 1 | 14 | 9 | 11 | 2 | 1 | 1 | 4 |
14,981 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.BoolParamType | import typing as t
from gettext import gettext as _
class BoolParamType(ParamType):
name = 'boolean'
def convert(self, value: t.Any, param: t.Optional['Parameter'], ctx: t.Optional['Context']) -> t.Any:
if value in {False, True}:
return bool(value)
norm = value.strip().lower()
... |
class BoolParamType(ParamType):
def convert(self, value: t.Any, param: t.Optional['Parameter'], ctx: t.Optional['Context']) -> t.Any:
pass
def __repr__(self) -> str:
pass | 3 | 0 | 10 | 2 | 8 | 0 | 3 | 0 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 10 | 23 | 6 | 17 | 7 | 12 | 0 | 13 | 5 | 10 | 4 | 1 | 1 | 5 |
14,982 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.Choice | from gettext import ngettext
import typing as t
from gettext import gettext as _
class Choice(ParamType):
"""The choice type allows a value to be checked against a fixed set
of supported values. All of these values have to be strings.
You should only pass a list or tuple of choices. Other iterables
(l... |
class Choice(ParamType):
'''The choice type allows a value to be checked against a fixed set
of supported values. All of these values have to be strings.
You should only pass a list or tuple of choices. Other iterables
(like generators) may lead to surprising results.
The resulting value will alway... | 8 | 2 | 11 | 2 | 8 | 2 | 2 | 0.39 | 1 | 7 | 1 | 0 | 7 | 2 | 7 | 15 | 105 | 23 | 59 | 23 | 46 | 23 | 40 | 19 | 31 | 4 | 1 | 1 | 12 |
14,983 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.CompositeParamType | class CompositeParamType(ParamType):
is_composite = True
@property
def arity(self) -> int:
raise NotImplementedError() | class CompositeParamType(ParamType):
@property
def arity(self) -> int:
pass | 3 | 0 | 2 | 0 | 2 | 1 | 1 | 0.2 | 1 | 2 | 0 | 1 | 1 | 0 | 1 | 9 | 6 | 1 | 5 | 4 | 2 | 1 | 4 | 3 | 2 | 1 | 1 | 0 | 1 |
14,984 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.DateTime | from gettext import ngettext
import typing as t
from datetime import datetime
class DateTime(ParamType):
"""The DateTime type converts date strings into `datetime` objects.
The format strings which are checked are configurable, but default to some
common (non-timezone aware) ISO 8601 formats.
When sp... |
class DateTime(ParamType):
'''The DateTime type converts date strings into `datetime` objects.
The format strings which are checked are configurable, but default to some
common (non-timezone aware) ISO 8601 formats.
When specifying *DateTime* formats, you should only pass a list or a tuple.
Other i... | 7 | 1 | 7 | 1 | 6 | 0 | 2 | 0.35 | 1 | 6 | 0 | 0 | 6 | 1 | 6 | 14 | 69 | 15 | 40 | 15 | 31 | 14 | 26 | 13 | 19 | 4 | 1 | 2 | 10 |
14,985 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.File | from .utils import safecall
import typing as t
from .utils import format_filename
from .utils import LazyFile
from ._compat import open_stream
import os
class File(ParamType):
"""Declares a parameter to be a file for reading or writing. The file
is automatically closed once the context tears down (after the c... |
class File(ParamType):
'''Declares a parameter to be a file for reading or writing. The file
is automatically closed once the context tears down (after the command
finished working).
Files can be opened for reading or writing. The special value ``-``
indicates stdin or stdout depending on the mod... | 6 | 2 | 16 | 2 | 12 | 3 | 3 | 0.53 | 1 | 8 | 2 | 0 | 5 | 5 | 5 | 13 | 116 | 22 | 62 | 33 | 41 | 33 | 42 | 18 | 35 | 7 | 1 | 3 | 14 |
14,986 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.FloatParamType | class FloatParamType(_NumberParamTypeBase):
name = 'float'
_number_class = float
def __repr__(self) -> str:
return 'FLOAT' | class FloatParamType(_NumberParamTypeBase):
def __repr__(self) -> str:
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 10 | 6 | 1 | 5 | 4 | 3 | 0 | 5 | 4 | 3 | 1 | 2 | 0 | 1 |
14,987 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.FloatRange | import typing as t
class FloatRange(_NumberRangeBase, FloatParamType):
"""Restrict a :data:`click.FLOAT` value to a range of accepted
values. See :ref:`ranges`.
If ``min`` or ``max`` are not passed, any value is accepted in that
direction. If ``min_open`` or ``max_open`` are enabled, the
correspon... |
class FloatRange(_NumberRangeBase, FloatParamType):
'''Restrict a :data:`click.FLOAT` value to a range of accepted
values. See :ref:`ranges`.
If ``min`` or ``max`` are not passed, any value is accepted in that
direction. If ``min_open`` or ``max_open`` are enabled, the
corresponding boundary is not... | 3 | 1 | 11 | 1 | 9 | 2 | 2 | 0.74 | 2 | 5 | 0 | 0 | 2 | 0 | 2 | 18 | 41 | 8 | 19 | 11 | 9 | 14 | 10 | 4 | 7 | 2 | 3 | 1 | 4 |
14,988 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.FuncParamType | import typing as t
class FuncParamType(ParamType):
def __init__(self, func: t.Callable[[t.Any], t.Any]) -> None:
self.name: str = func.__name__
self.func = func
def to_info_dict(self) -> t.Dict[str, t.Any]:
info_dict = super().to_info_dict()
info_dict['func'] = self.func
... |
class FuncParamType(ParamType):
def __init__(self, func: t.Callable[[t.Any], t.Any]) -> None:
pass
def to_info_dict(self) -> t.Dict[str, t.Any]:
pass
def convert(self, value: t.Any, param: t.Optional['Parameter'], ctx: t.Optional['Context']) -> t.Any:
pass | 4 | 0 | 6 | 0 | 6 | 0 | 2 | 0 | 1 | 5 | 0 | 0 | 3 | 2 | 3 | 11 | 22 | 3 | 19 | 9 | 13 | 0 | 17 | 7 | 13 | 3 | 1 | 2 | 5 |
14,989 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.IntParamType | class IntParamType(_NumberParamTypeBase):
name = 'integer'
_number_class = int
def __repr__(self) -> str:
return 'INT' | class IntParamType(_NumberParamTypeBase):
def __repr__(self) -> str:
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 10 | 6 | 1 | 5 | 4 | 3 | 0 | 5 | 4 | 3 | 1 | 2 | 0 | 1 |
14,990 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.IntRange | class IntRange(_NumberRangeBase, IntParamType):
"""Restrict an :data:`click.INT` value to a range of accepted
values. See :ref:`ranges`.
If ``min`` or ``max`` are not passed, any value is accepted in that
direction. If ``min_open`` or ``max_open`` are enabled, the
corresponding boundary is not incl... | class IntRange(_NumberRangeBase, IntParamType):
'''Restrict an :data:`click.INT` value to a range of accepted
values. See :ref:`ranges`.
If ``min`` or ``max`` are not passed, any value is accepted in that
direction. If ``min_open`` or ``max_open`` are enabled, the
corresponding boundary is not inclu... | 2 | 1 | 7 | 1 | 6 | 1 | 2 | 1.38 | 2 | 2 | 0 | 0 | 1 | 0 | 1 | 17 | 24 | 6 | 8 | 5 | 4 | 11 | 6 | 3 | 4 | 2 | 3 | 1 | 2 |
14,991 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.ParamType | from .exceptions import BadParameter
import typing as t
class ParamType:
"""Represents the type of a parameter. Validates and converts values
from the command line or Python into the correct type.
To implement a custom type, subclass and implement at least the
following:
- The :attr:`name` clas... |
class ParamType:
'''Represents the type of a parameter. Validates and converts values
from the command line or Python into the correct type.
To implement a custom type, subclass and implement at least the
following:
- The :attr:`name` class attribute must be set.
- Calling an instance of th... | 9 | 8 | 12 | 2 | 4 | 6 | 1 | 1.65 | 0 | 4 | 1 | 11 | 8 | 0 | 8 | 8 | 131 | 25 | 40 | 28 | 17 | 66 | 25 | 14 | 16 | 2 | 0 | 1 | 10 |
14,992 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.Path | import typing as t
import stat
from gettext import gettext as _
from .utils import format_filename
import os
class Path(ParamType):
"""The ``Path`` type is similar to the :class:`File` type, but
returns the filename instead of an open file. Various checks can be
enabled to validate the type of file and per... |
class Path(ParamType):
'''The ``Path`` type is similar to the :class:`File` type, but
returns the filename instead of an open file. Various checks can be
enabled to validate the type of file and permissions.
:param exists: The file or directory needs to exist for the value to
be valid. If this ... | 6 | 2 | 29 | 3 | 24 | 2 | 4 | 0.3 | 1 | 8 | 1 | 0 | 5 | 10 | 5 | 13 | 183 | 24 | 122 | 44 | 94 | 37 | 55 | 24 | 47 | 10 | 1 | 3 | 20 |
14,993 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.StringParamType | import typing as t
from ._compat import _get_argv_encoding
import sys
class StringParamType(ParamType):
name = 'text'
def convert(self, value: t.Any, param: t.Optional['Parameter'], ctx: t.Optional['Context']) -> t.Any:
if isinstance(value, bytes):
enc = _get_argv_encoding()
tr... |
class StringParamType(ParamType):
def convert(self, value: t.Any, param: t.Optional['Parameter'], ctx: t.Optional['Context']) -> t.Any:
pass
def __repr__(self) -> str:
pass | 3 | 0 | 10 | 0 | 10 | 0 | 3 | 0 | 1 | 4 | 0 | 0 | 2 | 0 | 2 | 10 | 24 | 2 | 22 | 8 | 17 | 0 | 19 | 6 | 16 | 5 | 1 | 4 | 6 |
14,994 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.Tuple | from gettext import ngettext
import typing as t
class Tuple(CompositeParamType):
"""The default behavior of Click is to apply a type on a value directly.
This works well in most cases, except for when `nargs` is set to a fixed
count and different types should be used for different items. In this
case ... |
class Tuple(CompositeParamType):
'''The default behavior of Click is to apply a type on a value directly.
This works well in most cases, except for when `nargs` is set to a fixed
count and different types should be used for different items. In this
case the :class:`Tuple` type can be used. This type ... | 8 | 1 | 6 | 0 | 5 | 0 | 1 | 0.38 | 1 | 6 | 0 | 0 | 5 | 1 | 5 | 14 | 48 | 10 | 29 | 15 | 19 | 11 | 17 | 10 | 11 | 2 | 2 | 1 | 6 |
14,995 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.UUIDParameterType | import typing as t
from gettext import gettext as _
class UUIDParameterType(ParamType):
name = 'uuid'
def convert(self, value: t.Any, param: t.Optional['Parameter'], ctx: t.Optional['Context']) -> t.Any:
import uuid
if isinstance(value, uuid.UUID):
return value
value = valu... |
class UUIDParameterType(ParamType):
def convert(self, value: t.Any, param: t.Optional['Parameter'], ctx: t.Optional['Context']) -> t.Any:
pass
def __repr__(self) -> str:
pass | 3 | 0 | 9 | 2 | 8 | 0 | 2 | 0 | 1 | 4 | 0 | 0 | 2 | 0 | 2 | 10 | 22 | 5 | 17 | 7 | 11 | 0 | 13 | 5 | 9 | 3 | 1 | 1 | 4 |
14,996 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types.UnprocessedParamType | import typing as t
class UnprocessedParamType(ParamType):
name = 'text'
def convert(self, value: t.Any, param: t.Optional['Parameter'], ctx: t.Optional['Context']) -> t.Any:
return value
def __repr__(self) -> str:
return 'UNPROCESSED' |
class UnprocessedParamType(ParamType):
def convert(self, value: t.Any, param: t.Optional['Parameter'], ctx: t.Optional['Context']) -> t.Any:
pass
def __repr__(self) -> str:
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 2 | 0 | 2 | 10 | 10 | 2 | 8 | 6 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
14,997 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types._NumberParamTypeBase | import typing as t
from gettext import gettext as _
class _NumberParamTypeBase(ParamType):
_number_class: t.ClassVar[t.Type[t.Any]]
def convert(self, value: t.Any, param: t.Optional['Parameter'], ctx: t.Optional['Context']) -> t.Any:
try:
return self._number_class(value)
except Val... |
class _NumberParamTypeBase(ParamType):
def convert(self, value: t.Any, param: t.Optional['Parameter'], ctx: t.Optional['Context']) -> t.Any:
pass | 2 | 0 | 13 | 0 | 13 | 0 | 2 | 0 | 1 | 2 | 0 | 3 | 1 | 0 | 1 | 9 | 16 | 1 | 15 | 4 | 11 | 0 | 7 | 2 | 5 | 2 | 1 | 1 | 2 |
14,998 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/types.py | pipenv.vendor.click.types._NumberRangeBase | from gettext import gettext as _
import typing as t
class _NumberRangeBase(_NumberParamTypeBase):
def __init__(self, min: t.Optional[float]=None, max: t.Optional[float]=None, min_open: bool=False, max_open: bool=False, clamp: bool=False) -> None:
self.min = min
self.max = max
self.min_open... |
class _NumberRangeBase(_NumberParamTypeBase):
def __init__(self, min: t.Optional[float]=None, max: t.Optional[float]=None, min_open: bool=False, max_open: bool=False, clamp: bool=False) -> None:
pass
def to_info_dict(self) -> t.Dict[str, t.Any]:
pass
def convert(self, value: t.Any, param... | 7 | 2 | 13 | 1 | 11 | 2 | 3 | 0.14 | 1 | 7 | 0 | 2 | 6 | 5 | 6 | 15 | 84 | 13 | 64 | 30 | 47 | 9 | 39 | 21 | 31 | 7 | 2 | 2 | 19 |
14,999 | pypa/pipenv | pypa_pipenv/pipenv/vendor/click/utils.py | pipenv.vendor.click.utils.KeepOpenFile | from types import TracebackType
import typing as t
class KeepOpenFile:
def __init__(self, file: t.IO[t.Any]) -> None:
self._file: t.IO[t.Any] = file
def __getattr__(self, name: str) -> t.Any:
return getattr(self._file, name)
def __enter__(self) -> 'KeepOpenFile':
return self
... |
class KeepOpenFile:
def __init__(self, file: t.IO[t.Any]) -> None:
pass
def __getattr__(self, name: str) -> t.Any:
pass
def __enter__(self) -> 'KeepOpenFile':
pass
def __exit__(self, exc_type: t.Optional[t.Type[BaseException]], exc_value: t.Optional[BaseException], tb: t.Opt... | 7 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 4 | 0 | 0 | 6 | 1 | 6 | 6 | 23 | 5 | 18 | 13 | 6 | 0 | 13 | 8 | 6 | 1 | 0 | 0 | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.