id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
25,300
pypa/pipenv
pipenv/patched/notpip/_internal/index.py
PackageFinder._get_index_urls_locations
def _get_index_urls_locations(self, project_name): # type: (str) -> List[str] """Returns the locations found via self.index_urls Checks the url_name on the main (first in the list) index and use this url_name to produce all locations """ def mkurl_pypi_url(url): ...
python
def _get_index_urls_locations(self, project_name): # type: (str) -> List[str] """Returns the locations found via self.index_urls Checks the url_name on the main (first in the list) index and use this url_name to produce all locations """ def mkurl_pypi_url(url): ...
[ "def", "_get_index_urls_locations", "(", "self", ",", "project_name", ")", ":", "# type: (str) -> List[str]", "def", "mkurl_pypi_url", "(", "url", ")", ":", "loc", "=", "posixpath", ".", "join", "(", "url", ",", "urllib_parse", ".", "quote", "(", "canonicalize_n...
Returns the locations found via self.index_urls Checks the url_name on the main (first in the list) index and use this url_name to produce all locations
[ "Returns", "the", "locations", "found", "via", "self", ".", "index_urls" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/index.py#L565-L586
25,301
pypa/pipenv
pipenv/patched/notpip/_internal/index.py
PackageFinder.find_all_candidates
def find_all_candidates(self, project_name): # type: (str) -> List[Optional[InstallationCandidate]] """Find all available InstallationCandidate for project_name This checks index_urls and find_links. All versions found are returned as an InstallationCandidate list. See _link_pa...
python
def find_all_candidates(self, project_name): # type: (str) -> List[Optional[InstallationCandidate]] """Find all available InstallationCandidate for project_name This checks index_urls and find_links. All versions found are returned as an InstallationCandidate list. See _link_pa...
[ "def", "find_all_candidates", "(", "self", ",", "project_name", ")", ":", "# type: (str) -> List[Optional[InstallationCandidate]]", "index_locations", "=", "self", ".", "_get_index_urls_locations", "(", "project_name", ")", "index_file_loc", ",", "index_url_loc", "=", "self...
Find all available InstallationCandidate for project_name This checks index_urls and find_links. All versions found are returned as an InstallationCandidate list. See _link_package_versions for details on which files are accepted
[ "Find", "all", "available", "InstallationCandidate", "for", "project_name" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/index.py#L588-L656
25,302
pypa/pipenv
pipenv/patched/notpip/_internal/index.py
PackageFinder.find_requirement
def find_requirement(self, req, upgrade, ignore_compatibility=False): # type: (InstallRequirement, bool, bool) -> Optional[Link] """Try to find a Link matching req Expects req, an InstallRequirement and upgrade, a boolean Returns a Link if found, Raises DistributionNotFound or B...
python
def find_requirement(self, req, upgrade, ignore_compatibility=False): # type: (InstallRequirement, bool, bool) -> Optional[Link] """Try to find a Link matching req Expects req, an InstallRequirement and upgrade, a boolean Returns a Link if found, Raises DistributionNotFound or B...
[ "def", "find_requirement", "(", "self", ",", "req", ",", "upgrade", ",", "ignore_compatibility", "=", "False", ")", ":", "# type: (InstallRequirement, bool, bool) -> Optional[Link]", "all_candidates", "=", "self", ".", "find_all_candidates", "(", "req", ".", "name", "...
Try to find a Link matching req Expects req, an InstallRequirement and upgrade, a boolean Returns a Link if found, Raises DistributionNotFound or BestVersionAlreadyInstalled otherwise
[ "Try", "to", "find", "a", "Link", "matching", "req" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/index.py#L658-L756
25,303
pypa/pipenv
pipenv/patched/notpip/_internal/index.py
PackageFinder._link_package_versions
def _link_package_versions(self, link, search, ignore_compatibility=True): # type: (Link, Search, bool) -> Optional[InstallationCandidate] """Return an InstallationCandidate or None""" version = None if link.egg_fragment: egg_info = link.egg_fragment ext = link.ex...
python
def _link_package_versions(self, link, search, ignore_compatibility=True): # type: (Link, Search, bool) -> Optional[InstallationCandidate] """Return an InstallationCandidate or None""" version = None if link.egg_fragment: egg_info = link.egg_fragment ext = link.ex...
[ "def", "_link_package_versions", "(", "self", ",", "link", ",", "search", ",", "ignore_compatibility", "=", "True", ")", ":", "# type: (Link, Search, bool) -> Optional[InstallationCandidate]", "version", "=", "None", "if", "link", ".", "egg_fragment", ":", "egg_info", ...
Return an InstallationCandidate or None
[ "Return", "an", "InstallationCandidate", "or", "None" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/index.py#L814-L893
25,304
pypa/pipenv
pipenv/vendor/pexpect/run.py
run
def run(command, timeout=30, withexitstatus=False, events=None, extra_args=None, logfile=None, cwd=None, env=None, **kwargs): ''' This function runs the given command; waits for it to finish; then returns all output as a string. STDERR is included in output. If the full path to the command is n...
python
def run(command, timeout=30, withexitstatus=False, events=None, extra_args=None, logfile=None, cwd=None, env=None, **kwargs): ''' This function runs the given command; waits for it to finish; then returns all output as a string. STDERR is included in output. If the full path to the command is n...
[ "def", "run", "(", "command", ",", "timeout", "=", "30", ",", "withexitstatus", "=", "False", ",", "events", "=", "None", ",", "extra_args", "=", "None", ",", "logfile", "=", "None", ",", "cwd", "=", "None", ",", "env", "=", "None", ",", "*", "*", ...
This function runs the given command; waits for it to finish; then returns all output as a string. STDERR is included in output. If the full path to the command is not given then the path is searched. Note that lines are terminated by CR/LF (\\r\\n) combination even on UNIX-like systems because this is...
[ "This", "function", "runs", "the", "given", "command", ";", "waits", "for", "it", "to", "finish", ";", "then", "returns", "all", "output", "as", "a", "string", ".", "STDERR", "is", "included", "in", "output", ".", "If", "the", "full", "path", "to", "th...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/run.py#L7-L148
25,305
pypa/pipenv
pipenv/vendor/requests/models.py
RequestHooksMixin.register_hook
def register_hook(self, event, hook): """Properly register a hook.""" if event not in self.hooks: raise ValueError('Unsupported event specified, with event name "%s"' % (event)) if isinstance(hook, Callable): self.hooks[event].append(hook) elif hasattr(hook, '__...
python
def register_hook(self, event, hook): """Properly register a hook.""" if event not in self.hooks: raise ValueError('Unsupported event specified, with event name "%s"' % (event)) if isinstance(hook, Callable): self.hooks[event].append(hook) elif hasattr(hook, '__...
[ "def", "register_hook", "(", "self", ",", "event", ",", "hook", ")", ":", "if", "event", "not", "in", "self", ".", "hooks", ":", "raise", "ValueError", "(", "'Unsupported event specified, with event name \"%s\"'", "%", "(", "event", ")", ")", "if", "isinstance...
Properly register a hook.
[ "Properly", "register", "a", "hook", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/models.py#L175-L184
25,306
pypa/pipenv
pipenv/vendor/requests/models.py
RequestHooksMixin.deregister_hook
def deregister_hook(self, event, hook): """Deregister a previously registered hook. Returns True if the hook existed, False if not. """ try: self.hooks[event].remove(hook) return True except ValueError: return False
python
def deregister_hook(self, event, hook): """Deregister a previously registered hook. Returns True if the hook existed, False if not. """ try: self.hooks[event].remove(hook) return True except ValueError: return False
[ "def", "deregister_hook", "(", "self", ",", "event", ",", "hook", ")", ":", "try", ":", "self", ".", "hooks", "[", "event", "]", ".", "remove", "(", "hook", ")", "return", "True", "except", "ValueError", ":", "return", "False" ]
Deregister a previously registered hook. Returns True if the hook existed, False if not.
[ "Deregister", "a", "previously", "registered", "hook", ".", "Returns", "True", "if", "the", "hook", "existed", "False", "if", "not", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/models.py#L186-L195
25,307
pypa/pipenv
pipenv/vendor/requests/models.py
PreparedRequest.prepare
def prepare(self, method=None, url=None, headers=None, files=None, data=None, params=None, auth=None, cookies=None, hooks=None, json=None): """Prepares the entire request with the given parameters.""" self.prepare_method(method) self.prepare_url(url, params) self...
python
def prepare(self, method=None, url=None, headers=None, files=None, data=None, params=None, auth=None, cookies=None, hooks=None, json=None): """Prepares the entire request with the given parameters.""" self.prepare_method(method) self.prepare_url(url, params) self...
[ "def", "prepare", "(", "self", ",", "method", "=", "None", ",", "url", "=", "None", ",", "headers", "=", "None", ",", "files", "=", "None", ",", "data", "=", "None", ",", "params", "=", "None", ",", "auth", "=", "None", ",", "cookies", "=", "None...
Prepares the entire request with the given parameters.
[ "Prepares", "the", "entire", "request", "with", "the", "given", "parameters", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/models.py#L307-L323
25,308
pypa/pipenv
pipenv/vendor/requests/models.py
PreparedRequest.prepare_content_length
def prepare_content_length(self, body): """Prepare Content-Length header based on request method and body""" if body is not None: length = super_len(body) if length: # If length exists, set it. Otherwise, we fallback # to Transfer-Encoding: chunked...
python
def prepare_content_length(self, body): """Prepare Content-Length header based on request method and body""" if body is not None: length = super_len(body) if length: # If length exists, set it. Otherwise, we fallback # to Transfer-Encoding: chunked...
[ "def", "prepare_content_length", "(", "self", ",", "body", ")", ":", "if", "body", "is", "not", "None", ":", "length", "=", "super_len", "(", "body", ")", "if", "length", ":", "# If length exists, set it. Otherwise, we fallback", "# to Transfer-Encoding: chunked.", ...
Prepare Content-Length header based on request method and body
[ "Prepare", "Content", "-", "Length", "header", "based", "on", "request", "method", "and", "body" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/models.py#L521-L532
25,309
pypa/pipenv
pipenv/vendor/requests/models.py
PreparedRequest.prepare_auth
def prepare_auth(self, auth, url=''): """Prepares the given HTTP auth data.""" # If no Auth is explicitly provided, extract it from the URL first. if auth is None: url_auth = get_auth_from_url(self.url) auth = url_auth if any(url_auth) else None if auth: ...
python
def prepare_auth(self, auth, url=''): """Prepares the given HTTP auth data.""" # If no Auth is explicitly provided, extract it from the URL first. if auth is None: url_auth = get_auth_from_url(self.url) auth = url_auth if any(url_auth) else None if auth: ...
[ "def", "prepare_auth", "(", "self", ",", "auth", ",", "url", "=", "''", ")", ":", "# If no Auth is explicitly provided, extract it from the URL first.", "if", "auth", "is", "None", ":", "url_auth", "=", "get_auth_from_url", "(", "self", ".", "url", ")", "auth", ...
Prepares the given HTTP auth data.
[ "Prepares", "the", "given", "HTTP", "auth", "data", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/models.py#L534-L554
25,310
pypa/pipenv
pipenv/vendor/requests/models.py
PreparedRequest.prepare_cookies
def prepare_cookies(self, cookies): """Prepares the given HTTP cookie data. This function eventually generates a ``Cookie`` header from the given cookies using cookielib. Due to cookielib's design, the header will not be regenerated if it already exists, meaning this function ca...
python
def prepare_cookies(self, cookies): """Prepares the given HTTP cookie data. This function eventually generates a ``Cookie`` header from the given cookies using cookielib. Due to cookielib's design, the header will not be regenerated if it already exists, meaning this function ca...
[ "def", "prepare_cookies", "(", "self", ",", "cookies", ")", ":", "if", "isinstance", "(", "cookies", ",", "cookielib", ".", "CookieJar", ")", ":", "self", ".", "_cookies", "=", "cookies", "else", ":", "self", ".", "_cookies", "=", "cookiejar_from_dict", "(...
Prepares the given HTTP cookie data. This function eventually generates a ``Cookie`` header from the given cookies using cookielib. Due to cookielib's design, the header will not be regenerated if it already exists, meaning this function can only be called once for the life of the ...
[ "Prepares", "the", "given", "HTTP", "cookie", "data", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/models.py#L556-L574
25,311
pypa/pipenv
pipenv/vendor/requests/models.py
PreparedRequest.prepare_hooks
def prepare_hooks(self, hooks): """Prepares the given hooks.""" # hooks can be passed as None to the prepare method and to this # method. To prevent iterating over None, simply use an empty list # if hooks is False-y hooks = hooks or [] for event in hooks: sel...
python
def prepare_hooks(self, hooks): """Prepares the given hooks.""" # hooks can be passed as None to the prepare method and to this # method. To prevent iterating over None, simply use an empty list # if hooks is False-y hooks = hooks or [] for event in hooks: sel...
[ "def", "prepare_hooks", "(", "self", ",", "hooks", ")", ":", "# hooks can be passed as None to the prepare method and to this", "# method. To prevent iterating over None, simply use an empty list", "# if hooks is False-y", "hooks", "=", "hooks", "or", "[", "]", "for", "event", ...
Prepares the given hooks.
[ "Prepares", "the", "given", "hooks", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/models.py#L576-L583
25,312
pypa/pipenv
pipenv/vendor/requests/models.py
Response.is_permanent_redirect
def is_permanent_redirect(self): """True if this Response one of the permanent versions of redirect.""" return ('location' in self.headers and self.status_code in (codes.moved_permanently, codes.permanent_redirect))
python
def is_permanent_redirect(self): """True if this Response one of the permanent versions of redirect.""" return ('location' in self.headers and self.status_code in (codes.moved_permanently, codes.permanent_redirect))
[ "def", "is_permanent_redirect", "(", "self", ")", ":", "return", "(", "'location'", "in", "self", ".", "headers", "and", "self", ".", "status_code", "in", "(", "codes", ".", "moved_permanently", ",", "codes", ".", "permanent_redirect", ")", ")" ]
True if this Response one of the permanent versions of redirect.
[ "True", "if", "this", "Response", "one", "of", "the", "permanent", "versions", "of", "redirect", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/models.py#L715-L717
25,313
pypa/pipenv
pipenv/vendor/requests/models.py
Response.close
def close(self): """Releases the connection back to the pool. Once this method has been called the underlying ``raw`` object must not be accessed again. *Note: Should not normally need to be called explicitly.* """ if not self._content_consumed: self.raw.close() ...
python
def close(self): """Releases the connection back to the pool. Once this method has been called the underlying ``raw`` object must not be accessed again. *Note: Should not normally need to be called explicitly.* """ if not self._content_consumed: self.raw.close() ...
[ "def", "close", "(", "self", ")", ":", "if", "not", "self", ".", "_content_consumed", ":", "self", ".", "raw", ".", "close", "(", ")", "release_conn", "=", "getattr", "(", "self", ".", "raw", ",", "'release_conn'", ",", "None", ")", "if", "release_conn...
Releases the connection back to the pool. Once this method has been called the underlying ``raw`` object must not be accessed again. *Note: Should not normally need to be called explicitly.*
[ "Releases", "the", "connection", "back", "to", "the", "pool", ".", "Once", "this", "method", "has", "been", "called", "the", "underlying", "raw", "object", "must", "not", "be", "accessed", "again", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/models.py#L942-L953
25,314
pypa/pipenv
pipenv/patched/notpip/_internal/commands/install.py
create_env_error_message
def create_env_error_message(error, show_traceback, using_user_site): """Format an error message for an EnvironmentError It may occur anytime during the execution of the install command. """ parts = [] # Mention the error if we are not going to show a traceback parts.append("Could not install ...
python
def create_env_error_message(error, show_traceback, using_user_site): """Format an error message for an EnvironmentError It may occur anytime during the execution of the install command. """ parts = [] # Mention the error if we are not going to show a traceback parts.append("Could not install ...
[ "def", "create_env_error_message", "(", "error", ",", "show_traceback", ",", "using_user_site", ")", ":", "parts", "=", "[", "]", "# Mention the error if we are not going to show a traceback", "parts", ".", "append", "(", "\"Could not install packages due to an EnvironmentError...
Format an error message for an EnvironmentError It may occur anytime during the execution of the install command.
[ "Format", "an", "error", "message", "for", "an", "EnvironmentError" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/commands/install.py#L533-L566
25,315
pypa/pipenv
pipenv/vendor/urllib3/connectionpool.py
HTTPConnectionPool._raise_timeout
def _raise_timeout(self, err, url, timeout_value): """Is the error actually a timeout? Will raise a ReadTimeout or pass""" if isinstance(err, SocketTimeout): raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value) # See the above comment about EAGAIN ...
python
def _raise_timeout(self, err, url, timeout_value): """Is the error actually a timeout? Will raise a ReadTimeout or pass""" if isinstance(err, SocketTimeout): raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value) # See the above comment about EAGAIN ...
[ "def", "_raise_timeout", "(", "self", ",", "err", ",", "url", ",", "timeout_value", ")", ":", "if", "isinstance", "(", "err", ",", "SocketTimeout", ")", ":", "raise", "ReadTimeoutError", "(", "self", ",", "url", ",", "\"Read timed out. (read timeout=%s)\"", "%...
Is the error actually a timeout? Will raise a ReadTimeout or pass
[ "Is", "the", "error", "actually", "a", "timeout?", "Will", "raise", "a", "ReadTimeout", "or", "pass" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/connectionpool.py#L302-L317
25,316
pypa/pipenv
pipenv/vendor/pythonfinder/pythonfinder.py
Finder.reload_system_path
def reload_system_path(self): # type: () -> None """ Rebuilds the base system path and all of the contained finders within it. This will re-apply any changes to the environment or any version changes on the system. """ if self._system_path is not None: self....
python
def reload_system_path(self): # type: () -> None """ Rebuilds the base system path and all of the contained finders within it. This will re-apply any changes to the environment or any version changes on the system. """ if self._system_path is not None: self....
[ "def", "reload_system_path", "(", "self", ")", ":", "# type: () -> None", "if", "self", ".", "_system_path", "is", "not", "None", ":", "self", ".", "_system_path", ".", "clear_caches", "(", ")", "self", ".", "_system_path", "=", "None", "six", ".", "moves", ...
Rebuilds the base system path and all of the contained finders within it. This will re-apply any changes to the environment or any version changes on the system.
[ "Rebuilds", "the", "base", "system", "path", "and", "all", "of", "the", "contained", "finders", "within", "it", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pythonfinder/pythonfinder.py#L78-L90
25,317
pypa/pipenv
pipenv/vendor/backports/enum/__init__.py
_convert
def _convert(cls, name, module, filter, source=None): """ Create a new Enum subclass that replaces a collection of global constants """ # convert all constants from source (or module) that pass filter() to # a new Enum called name, and export the enum and its members back to # module; # also...
python
def _convert(cls, name, module, filter, source=None): """ Create a new Enum subclass that replaces a collection of global constants """ # convert all constants from source (or module) that pass filter() to # a new Enum called name, and export the enum and its members back to # module; # also...
[ "def", "_convert", "(", "cls", ",", "name", ",", "module", ",", "filter", ",", "source", "=", "None", ")", ":", "# convert all constants from source (or module) that pass filter() to", "# a new Enum called name, and export the enum and its members back to", "# module;", "# also...
Create a new Enum subclass that replaces a collection of global constants
[ "Create", "a", "new", "Enum", "subclass", "that", "replaces", "a", "collection", "of", "global", "constants" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/backports/enum/__init__.py#L789-L808
25,318
pypa/pipenv
pipenv/vendor/backports/enum/__init__.py
unique
def unique(enumeration): """Class decorator that ensures only unique members exist in an enumeration.""" duplicates = [] for name, member in enumeration.__members__.items(): if name != member.name: duplicates.append((name, member.name)) if duplicates: duplicate_names = ', '.j...
python
def unique(enumeration): """Class decorator that ensures only unique members exist in an enumeration.""" duplicates = [] for name, member in enumeration.__members__.items(): if name != member.name: duplicates.append((name, member.name)) if duplicates: duplicate_names = ', '.j...
[ "def", "unique", "(", "enumeration", ")", ":", "duplicates", "=", "[", "]", "for", "name", ",", "member", "in", "enumeration", ".", "__members__", ".", "items", "(", ")", ":", "if", "name", "!=", "member", ".", "name", ":", "duplicates", ".", "append",...
Class decorator that ensures only unique members exist in an enumeration.
[ "Class", "decorator", "that", "ensures", "only", "unique", "members", "exist", "in", "an", "enumeration", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/backports/enum/__init__.py#L824-L837
25,319
pypa/pipenv
pipenv/vendor/backports/enum/__init__.py
EnumMeta._create_
def _create_(cls, class_name, names=None, module=None, type=None, start=1): """Convenience method to create a new Enum class. `names` can be: * A string containing member names, separated either with spaces or commas. Values are auto-numbered from 1. * An iterable of member ...
python
def _create_(cls, class_name, names=None, module=None, type=None, start=1): """Convenience method to create a new Enum class. `names` can be: * A string containing member names, separated either with spaces or commas. Values are auto-numbered from 1. * An iterable of member ...
[ "def", "_create_", "(", "cls", ",", "class_name", ",", "names", "=", "None", ",", "module", "=", "None", ",", "type", "=", "None", ",", "start", "=", "1", ")", ":", "if", "pyver", "<", "3.0", ":", "# if class_name is unicode, attempt a conversion to ASCII", ...
Convenience method to create a new Enum class. `names` can be: * A string containing member names, separated either with spaces or commas. Values are auto-numbered from 1. * An iterable of member names. Values are auto-numbered from 1. * An iterable of (member name, value) ...
[ "Convenience", "method", "to", "create", "a", "new", "Enum", "class", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/backports/enum/__init__.py#L422-L481
25,320
pypa/pipenv
pipenv/vendor/backports/enum/__init__.py
EnumMeta._get_mixins_
def _get_mixins_(bases): """Returns the type for creating enum members, and the first inherited enum class. bases: the tuple of bases that was given to __new__ """ if not bases or Enum is None: return object, Enum # double check that we are not subclassing...
python
def _get_mixins_(bases): """Returns the type for creating enum members, and the first inherited enum class. bases: the tuple of bases that was given to __new__ """ if not bases or Enum is None: return object, Enum # double check that we are not subclassing...
[ "def", "_get_mixins_", "(", "bases", ")", ":", "if", "not", "bases", "or", "Enum", "is", "None", ":", "return", "object", ",", "Enum", "# double check that we are not subclassing a class with existing", "# enumeration members; while we're at it, see if any other data", "# typ...
Returns the type for creating enum members, and the first inherited enum class. bases: the tuple of bases that was given to __new__
[ "Returns", "the", "type", "for", "creating", "enum", "members", "and", "the", "first", "inherited", "enum", "class", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/backports/enum/__init__.py#L484-L527
25,321
pypa/pipenv
pipenv/patched/notpip/_internal/commands/list.py
format_for_columns
def format_for_columns(pkgs, options): """ Convert the package data into something usable by output_package_listing_columns. """ running_outdated = options.outdated # Adjust the header for the `pip list --outdated` case. if running_outdated: header = ["Package", "Version", "Latest", ...
python
def format_for_columns(pkgs, options): """ Convert the package data into something usable by output_package_listing_columns. """ running_outdated = options.outdated # Adjust the header for the `pip list --outdated` case. if running_outdated: header = ["Package", "Version", "Latest", ...
[ "def", "format_for_columns", "(", "pkgs", ",", "options", ")", ":", "running_outdated", "=", "options", ".", "outdated", "# Adjust the header for the `pip list --outdated` case.", "if", "running_outdated", ":", "header", "=", "[", "\"Package\"", ",", "\"Version\"", ",",...
Convert the package data into something usable by output_package_listing_columns.
[ "Convert", "the", "package", "data", "into", "something", "usable", "by", "output_package_listing_columns", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/commands/list.py#L250-L284
25,322
pypa/pipenv
pipenv/vendor/distlib/scripts.py
ScriptMaker.make
def make(self, specification, options=None): """ Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by ...
python
def make(self, specification, options=None): """ Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by ...
[ "def", "make", "(", "self", ",", "specification", ",", "options", "=", "None", ")", ":", "filenames", "=", "[", "]", "entry", "=", "get_export_entry", "(", "specification", ")", "if", "entry", "is", "None", ":", "self", ".", "_copy_script", "(", "specifi...
Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :pa...
[ "Make", "a", "script", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/scripts.py#L389-L406
25,323
pypa/pipenv
pipenv/patched/pipfile/api.py
load
def load(pipfile_path=None, inject_env=True): """Loads a pipfile from a given path. If none is provided, one will try to be found. """ if pipfile_path is None: pipfile_path = Pipfile.find() return Pipfile.load(filename=pipfile_path, inject_env=inject_env)
python
def load(pipfile_path=None, inject_env=True): """Loads a pipfile from a given path. If none is provided, one will try to be found. """ if pipfile_path is None: pipfile_path = Pipfile.find() return Pipfile.load(filename=pipfile_path, inject_env=inject_env)
[ "def", "load", "(", "pipfile_path", "=", "None", ",", "inject_env", "=", "True", ")", ":", "if", "pipfile_path", "is", "None", ":", "pipfile_path", "=", "Pipfile", ".", "find", "(", ")", "return", "Pipfile", ".", "load", "(", "filename", "=", "pipfile_pa...
Loads a pipfile from a given path. If none is provided, one will try to be found.
[ "Loads", "a", "pipfile", "from", "a", "given", "path", ".", "If", "none", "is", "provided", "one", "will", "try", "to", "be", "found", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/pipfile/api.py#L222-L230
25,324
pypa/pipenv
pipenv/patched/pipfile/api.py
PipfileParser.inject_environment_variables
def inject_environment_variables(self, d): """ Recursively injects environment variables into TOML values """ if not d: return d if isinstance(d, six.string_types): return os.path.expandvars(d) for k, v in d.items(): if isinstance(v, s...
python
def inject_environment_variables(self, d): """ Recursively injects environment variables into TOML values """ if not d: return d if isinstance(d, six.string_types): return os.path.expandvars(d) for k, v in d.items(): if isinstance(v, s...
[ "def", "inject_environment_variables", "(", "self", ",", "d", ")", ":", "if", "not", "d", ":", "return", "d", "if", "isinstance", "(", "d", ",", "six", ".", "string_types", ")", ":", "return", "os", ".", "path", ".", "expandvars", "(", "d", ")", "for...
Recursively injects environment variables into TOML values
[ "Recursively", "injects", "environment", "variables", "into", "TOML", "values" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/pipfile/api.py#L73-L90
25,325
pypa/pipenv
pipenv/patched/pipfile/api.py
Pipfile.load
def load(klass, filename, inject_env=True): """Load a Pipfile from a given filename.""" p = PipfileParser(filename=filename) pipfile = klass(filename=filename) pipfile.data = p.parse(inject_env=inject_env) return pipfile
python
def load(klass, filename, inject_env=True): """Load a Pipfile from a given filename.""" p = PipfileParser(filename=filename) pipfile = klass(filename=filename) pipfile.data = p.parse(inject_env=inject_env) return pipfile
[ "def", "load", "(", "klass", ",", "filename", ",", "inject_env", "=", "True", ")", ":", "p", "=", "PipfileParser", "(", "filename", "=", "filename", ")", "pipfile", "=", "klass", "(", "filename", "=", "filename", ")", "pipfile", ".", "data", "=", "p", ...
Load a Pipfile from a given filename.
[ "Load", "a", "Pipfile", "from", "a", "given", "filename", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/pipfile/api.py#L157-L162
25,326
pypa/pipenv
pipenv/patched/pipfile/api.py
Pipfile.hash
def hash(self): """Returns the SHA256 of the pipfile's data.""" content = json.dumps(self.data, sort_keys=True, separators=(",", ":")) return hashlib.sha256(content.encode("utf8")).hexdigest()
python
def hash(self): """Returns the SHA256 of the pipfile's data.""" content = json.dumps(self.data, sort_keys=True, separators=(",", ":")) return hashlib.sha256(content.encode("utf8")).hexdigest()
[ "def", "hash", "(", "self", ")", ":", "content", "=", "json", ".", "dumps", "(", "self", ".", "data", ",", "sort_keys", "=", "True", ",", "separators", "=", "(", "\",\"", ",", "\":\"", ")", ")", "return", "hashlib", ".", "sha256", "(", "content", "...
Returns the SHA256 of the pipfile's data.
[ "Returns", "the", "SHA256", "of", "the", "pipfile", "s", "data", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/pipfile/api.py#L165-L168
25,327
pypa/pipenv
pipenv/patched/pipfile/api.py
Pipfile.lock
def lock(self): """Returns a JSON representation of the Pipfile.""" data = self.data data['_meta']['hash'] = {"sha256": self.hash} data['_meta']['pipfile-spec'] = 6 return json.dumps(data, indent=4, separators=(',', ': '))
python
def lock(self): """Returns a JSON representation of the Pipfile.""" data = self.data data['_meta']['hash'] = {"sha256": self.hash} data['_meta']['pipfile-spec'] = 6 return json.dumps(data, indent=4, separators=(',', ': '))
[ "def", "lock", "(", "self", ")", ":", "data", "=", "self", ".", "data", "data", "[", "'_meta'", "]", "[", "'hash'", "]", "=", "{", "\"sha256\"", ":", "self", ".", "hash", "}", "data", "[", "'_meta'", "]", "[", "'pipfile-spec'", "]", "=", "6", "re...
Returns a JSON representation of the Pipfile.
[ "Returns", "a", "JSON", "representation", "of", "the", "Pipfile", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/pipfile/api.py#L176-L181
25,328
pypa/pipenv
pipenv/patched/pipfile/api.py
Pipfile.assert_requirements
def assert_requirements(self): """"Asserts PEP 508 specifiers.""" # Support for 508's implementation_version. if hasattr(sys, 'implementation'): implementation_version = format_full_version(sys.implementation.version) else: implementation_version = "0" #...
python
def assert_requirements(self): """"Asserts PEP 508 specifiers.""" # Support for 508's implementation_version. if hasattr(sys, 'implementation'): implementation_version = format_full_version(sys.implementation.version) else: implementation_version = "0" #...
[ "def", "assert_requirements", "(", "self", ")", ":", "# Support for 508's implementation_version.", "if", "hasattr", "(", "sys", ",", "'implementation'", ")", ":", "implementation_version", "=", "format_full_version", "(", "sys", ".", "implementation", ".", "version", ...
Asserts PEP 508 specifiers.
[ "Asserts", "PEP", "508", "specifiers", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/pipfile/api.py#L183-L219
25,329
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
copyfileobj
def copyfileobj(fsrc, fdst, length=16*1024): """copy data from file-like object fsrc to file-like object fdst""" while 1: buf = fsrc.read(length) if not buf: break fdst.write(buf)
python
def copyfileobj(fsrc, fdst, length=16*1024): """copy data from file-like object fsrc to file-like object fdst""" while 1: buf = fsrc.read(length) if not buf: break fdst.write(buf)
[ "def", "copyfileobj", "(", "fsrc", ",", "fdst", ",", "length", "=", "16", "*", "1024", ")", ":", "while", "1", ":", "buf", "=", "fsrc", ".", "read", "(", "length", ")", "if", "not", "buf", ":", "break", "fdst", ".", "write", "(", "buf", ")" ]
copy data from file-like object fsrc to file-like object fdst
[ "copy", "data", "from", "file", "-", "like", "object", "fsrc", "to", "file", "-", "like", "object", "fdst" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L67-L73
25,330
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
copyfile
def copyfile(src, dst): """Copy data from src to dst""" if _samefile(src, dst): raise Error("`%s` and `%s` are the same file" % (src, dst)) for fn in [src, dst]: try: st = os.stat(fn) except OSError: # File most likely does not exist pass ...
python
def copyfile(src, dst): """Copy data from src to dst""" if _samefile(src, dst): raise Error("`%s` and `%s` are the same file" % (src, dst)) for fn in [src, dst]: try: st = os.stat(fn) except OSError: # File most likely does not exist pass ...
[ "def", "copyfile", "(", "src", ",", "dst", ")", ":", "if", "_samefile", "(", "src", ",", "dst", ")", ":", "raise", "Error", "(", "\"`%s` and `%s` are the same file\"", "%", "(", "src", ",", "dst", ")", ")", "for", "fn", "in", "[", "src", ",", "dst", ...
Copy data from src to dst
[ "Copy", "data", "from", "src", "to", "dst" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L87-L105
25,331
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
copymode
def copymode(src, dst): """Copy mode bits from src to dst""" if hasattr(os, 'chmod'): st = os.stat(src) mode = stat.S_IMODE(st.st_mode) os.chmod(dst, mode)
python
def copymode(src, dst): """Copy mode bits from src to dst""" if hasattr(os, 'chmod'): st = os.stat(src) mode = stat.S_IMODE(st.st_mode) os.chmod(dst, mode)
[ "def", "copymode", "(", "src", ",", "dst", ")", ":", "if", "hasattr", "(", "os", ",", "'chmod'", ")", ":", "st", "=", "os", ".", "stat", "(", "src", ")", "mode", "=", "stat", ".", "S_IMODE", "(", "st", ".", "st_mode", ")", "os", ".", "chmod", ...
Copy mode bits from src to dst
[ "Copy", "mode", "bits", "from", "src", "to", "dst" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L107-L112
25,332
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
move
def move(src, dst): """Recursively move a file or directory to another location. This is similar to the Unix "mv" command. If the destination is a directory or a symlink to a directory, the source is moved inside the directory. The destination path must not already exist. If the destination al...
python
def move(src, dst): """Recursively move a file or directory to another location. This is similar to the Unix "mv" command. If the destination is a directory or a symlink to a directory, the source is moved inside the directory. The destination path must not already exist. If the destination al...
[ "def", "move", "(", "src", ",", "dst", ")", ":", "real_dst", "=", "dst", "if", "os", ".", "path", ".", "isdir", "(", "dst", ")", ":", "if", "_samefile", "(", "src", ",", "dst", ")", ":", "# We might be on a case insensitive filesystem,", "# perform the ren...
Recursively move a file or directory to another location. This is similar to the Unix "mv" command. If the destination is a directory or a symlink to a directory, the source is moved inside the directory. The destination path must not already exist. If the destination already exists but is not a d...
[ "Recursively", "move", "a", "file", "or", "directory", "to", "another", "location", ".", "This", "is", "similar", "to", "the", "Unix", "mv", "command", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L300-L338
25,333
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
_get_gid
def _get_gid(name): """Returns a gid, given a group name.""" if getgrnam is None or name is None: return None try: result = getgrnam(name) except KeyError: result = None if result is not None: return result[2] return None
python
def _get_gid(name): """Returns a gid, given a group name.""" if getgrnam is None or name is None: return None try: result = getgrnam(name) except KeyError: result = None if result is not None: return result[2] return None
[ "def", "_get_gid", "(", "name", ")", ":", "if", "getgrnam", "is", "None", "or", "name", "is", "None", ":", "return", "None", "try", ":", "result", "=", "getgrnam", "(", "name", ")", "except", "KeyError", ":", "result", "=", "None", "if", "result", "i...
Returns a gid, given a group name.
[ "Returns", "a", "gid", "given", "a", "group", "name", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L349-L359
25,334
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
_get_uid
def _get_uid(name): """Returns an uid, given a user name.""" if getpwnam is None or name is None: return None try: result = getpwnam(name) except KeyError: result = None if result is not None: return result[2] return None
python
def _get_uid(name): """Returns an uid, given a user name.""" if getpwnam is None or name is None: return None try: result = getpwnam(name) except KeyError: result = None if result is not None: return result[2] return None
[ "def", "_get_uid", "(", "name", ")", ":", "if", "getpwnam", "is", "None", "or", "name", "is", "None", ":", "return", "None", "try", ":", "result", "=", "getpwnam", "(", "name", ")", "except", "KeyError", ":", "result", "=", "None", "if", "result", "i...
Returns an uid, given a user name.
[ "Returns", "an", "uid", "given", "a", "user", "name", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L361-L371
25,335
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
_make_zipfile
def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_name' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on th...
python
def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_name' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on th...
[ "def", "_make_zipfile", "(", "base_name", ",", "base_dir", ",", "verbose", "=", "0", ",", "dry_run", "=", "0", ",", "logger", "=", "None", ")", ":", "zip_filename", "=", "base_name", "+", "\".zip\"", "archive_dir", "=", "os", ".", "path", ".", "dirname",...
Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_name' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises ExecError. Retu...
[ "Create", "a", "zip", "file", "from", "all", "the", "files", "under", "base_dir", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L452-L497
25,336
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
get_archive_formats
def get_archive_formats(): """Returns a list of supported formats for archiving and unarchiving. Each element of the returned sequence is a tuple (name, description) """ formats = [(name, registry[2]) for name, registry in _ARCHIVE_FORMATS.items()] formats.sort() return formats
python
def get_archive_formats(): """Returns a list of supported formats for archiving and unarchiving. Each element of the returned sequence is a tuple (name, description) """ formats = [(name, registry[2]) for name, registry in _ARCHIVE_FORMATS.items()] formats.sort() return formats
[ "def", "get_archive_formats", "(", ")", ":", "formats", "=", "[", "(", "name", ",", "registry", "[", "2", "]", ")", "for", "name", ",", "registry", "in", "_ARCHIVE_FORMATS", ".", "items", "(", ")", "]", "formats", ".", "sort", "(", ")", "return", "fo...
Returns a list of supported formats for archiving and unarchiving. Each element of the returned sequence is a tuple (name, description)
[ "Returns", "a", "list", "of", "supported", "formats", "for", "archiving", "and", "unarchiving", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L510-L518
25,337
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
register_archive_format
def register_archive_format(name, function, extra_args=None, description=''): """Registers an archive format. name is the name of the format. function is the callable that will be used to create archives. If provided, extra_args is a sequence of (name, value) tuples that will be passed as arguments to ...
python
def register_archive_format(name, function, extra_args=None, description=''): """Registers an archive format. name is the name of the format. function is the callable that will be used to create archives. If provided, extra_args is a sequence of (name, value) tuples that will be passed as arguments to ...
[ "def", "register_archive_format", "(", "name", ",", "function", ",", "extra_args", "=", "None", ",", "description", "=", "''", ")", ":", "if", "extra_args", "is", "None", ":", "extra_args", "=", "[", "]", "if", "not", "isinstance", "(", "function", ",", ...
Registers an archive format. name is the name of the format. function is the callable that will be used to create archives. If provided, extra_args is a sequence of (name, value) tuples that will be passed as arguments to the callable. description can be provided to describe the format, and will be ret...
[ "Registers", "an", "archive", "format", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L520-L539
25,338
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
get_unpack_formats
def get_unpack_formats(): """Returns a list of supported formats for unpacking. Each element of the returned sequence is a tuple (name, extensions, description) """ formats = [(name, info[0], info[3]) for name, info in _UNPACK_FORMATS.items()] formats.sort() return formats
python
def get_unpack_formats(): """Returns a list of supported formats for unpacking. Each element of the returned sequence is a tuple (name, extensions, description) """ formats = [(name, info[0], info[3]) for name, info in _UNPACK_FORMATS.items()] formats.sort() return formats
[ "def", "get_unpack_formats", "(", ")", ":", "formats", "=", "[", "(", "name", ",", "info", "[", "0", "]", ",", "info", "[", "3", "]", ")", "for", "name", ",", "info", "in", "_UNPACK_FORMATS", ".", "items", "(", ")", "]", "formats", ".", "sort", "...
Returns a list of supported formats for unpacking. Each element of the returned sequence is a tuple (name, extensions, description)
[ "Returns", "a", "list", "of", "supported", "formats", "for", "unpacking", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L599-L608
25,339
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
_check_unpack_options
def _check_unpack_options(extensions, function, extra_args): """Checks what gets registered as an unpacker.""" # first make sure no other unpacker is registered for this extension existing_extensions = {} for name, info in _UNPACK_FORMATS.items(): for ext in info[0]: existing_extensi...
python
def _check_unpack_options(extensions, function, extra_args): """Checks what gets registered as an unpacker.""" # first make sure no other unpacker is registered for this extension existing_extensions = {} for name, info in _UNPACK_FORMATS.items(): for ext in info[0]: existing_extensi...
[ "def", "_check_unpack_options", "(", "extensions", ",", "function", ",", "extra_args", ")", ":", "# first make sure no other unpacker is registered for this extension", "existing_extensions", "=", "{", "}", "for", "name", ",", "info", "in", "_UNPACK_FORMATS", ".", "items"...
Checks what gets registered as an unpacker.
[ "Checks", "what", "gets", "registered", "as", "an", "unpacker", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L610-L625
25,340
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
register_unpack_format
def register_unpack_format(name, extensions, function, extra_args=None, description=''): """Registers an unpack format. `name` is the name of the format. `extensions` is a list of extensions corresponding to the format. `function` is the callable that will be used to unp...
python
def register_unpack_format(name, extensions, function, extra_args=None, description=''): """Registers an unpack format. `name` is the name of the format. `extensions` is a list of extensions corresponding to the format. `function` is the callable that will be used to unp...
[ "def", "register_unpack_format", "(", "name", ",", "extensions", ",", "function", ",", "extra_args", "=", "None", ",", "description", "=", "''", ")", ":", "if", "extra_args", "is", "None", ":", "extra_args", "=", "[", "]", "_check_unpack_options", "(", "exte...
Registers an unpack format. `name` is the name of the format. `extensions` is a list of extensions corresponding to the format. `function` is the callable that will be used to unpack archives. The callable will receive archives to unpack. If it's unable to handle an archive, it needs to raise a Re...
[ "Registers", "an", "unpack", "format", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L628-L648
25,341
pypa/pipenv
pipenv/vendor/distlib/_backport/shutil.py
unpack_archive
def unpack_archive(filename, extract_dir=None, format=None): """Unpack an archive. `filename` is the name of the archive. `extract_dir` is the name of the target directory, where the archive is unpacked. If not provided, the current working directory is used. `format` is the archive format: one o...
python
def unpack_archive(filename, extract_dir=None, format=None): """Unpack an archive. `filename` is the name of the archive. `extract_dir` is the name of the target directory, where the archive is unpacked. If not provided, the current working directory is used. `format` is the archive format: one o...
[ "def", "unpack_archive", "(", "filename", ",", "extract_dir", "=", "None", ",", "format", "=", "None", ")", ":", "if", "extract_dir", "is", "None", ":", "extract_dir", "=", "os", ".", "getcwd", "(", ")", "if", "format", "is", "not", "None", ":", "try",...
Unpack an archive. `filename` is the name of the archive. `extract_dir` is the name of the target directory, where the archive is unpacked. If not provided, the current working directory is used. `format` is the archive format: one of "zip", "tar", or "gztar". Or any other registered format. If n...
[ "Unpack", "an", "archive", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/_backport/shutil.py#L727-L761
25,342
pypa/pipenv
pipenv/patched/notpip/_vendor/html5lib/html5parser.py
parseFragment
def parseFragment(doc, container="div", treebuilder="etree", namespaceHTMLElements=True, **kwargs): """Parse an HTML fragment as a string or file-like object into a tree :arg doc: the fragment to parse as a string or file-like object :arg container: the container context to parse the fragment in :arg...
python
def parseFragment(doc, container="div", treebuilder="etree", namespaceHTMLElements=True, **kwargs): """Parse an HTML fragment as a string or file-like object into a tree :arg doc: the fragment to parse as a string or file-like object :arg container: the container context to parse the fragment in :arg...
[ "def", "parseFragment", "(", "doc", ",", "container", "=", "\"div\"", ",", "treebuilder", "=", "\"etree\"", ",", "namespaceHTMLElements", "=", "True", ",", "*", "*", "kwargs", ")", ":", "tb", "=", "treebuilders", ".", "getTreeBuilder", "(", "treebuilder", ")...
Parse an HTML fragment as a string or file-like object into a tree :arg doc: the fragment to parse as a string or file-like object :arg container: the container context to parse the fragment in :arg treebuilder: the treebuilder to use when parsing :arg namespaceHTMLElements: whether or not to namesp...
[ "Parse", "an", "HTML", "fragment", "as", "a", "string", "or", "file", "-", "like", "object", "into", "a", "tree" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_vendor/html5lib/html5parser.py#L50-L72
25,343
pypa/pipenv
pipenv/patched/notpip/_vendor/html5lib/html5parser.py
HTMLParser.parse
def parse(self, stream, *args, **kwargs): """Parse a HTML document into a well-formed tree :arg stream: a file-like object or string containing the HTML to be parsed The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will ...
python
def parse(self, stream, *args, **kwargs): """Parse a HTML document into a well-formed tree :arg stream: a file-like object or string containing the HTML to be parsed The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will ...
[ "def", "parse", "(", "self", ",", "stream", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_parse", "(", "stream", ",", "False", ",", "None", ",", "*", "args", ",", "*", "*", "kwargs", ")", "return", "self", ".", "tree", "."...
Parse a HTML document into a well-formed tree :arg stream: a file-like object or string containing the HTML to be parsed The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later d...
[ "Parse", "a", "HTML", "document", "into", "a", "well", "-", "formed", "tree" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_vendor/html5lib/html5parser.py#L267-L290
25,344
pypa/pipenv
pipenv/patched/notpip/_vendor/html5lib/html5parser.py
HTMLParser.parseFragment
def parseFragment(self, stream, *args, **kwargs): """Parse a HTML fragment into a well-formed tree fragment :arg container: name of the element we're setting the innerHTML property if set to None, default to 'div' :arg stream: a file-like object or string containing the HTML to be ...
python
def parseFragment(self, stream, *args, **kwargs): """Parse a HTML fragment into a well-formed tree fragment :arg container: name of the element we're setting the innerHTML property if set to None, default to 'div' :arg stream: a file-like object or string containing the HTML to be ...
[ "def", "parseFragment", "(", "self", ",", "stream", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_parse", "(", "stream", ",", "True", ",", "*", "args", ",", "*", "*", "kwargs", ")", "return", "self", ".", "tree", ".", "getFr...
Parse a HTML fragment into a well-formed tree fragment :arg container: name of the element we're setting the innerHTML property if set to None, default to 'div' :arg stream: a file-like object or string containing the HTML to be parsed The optional encoding parameter must be a...
[ "Parse", "a", "HTML", "fragment", "into", "a", "well", "-", "formed", "tree", "fragment" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_vendor/html5lib/html5parser.py#L292-L318
25,345
pypa/pipenv
pipenv/vendor/pipdeptree.py
construct_tree
def construct_tree(index): """Construct tree representation of the pkgs from the index. The keys of the dict representing the tree will be objects of type DistPackage and the values will be list of ReqPackage objects. :param dict index: dist index ie. index of pkgs by their keys :returns: tree of ...
python
def construct_tree(index): """Construct tree representation of the pkgs from the index. The keys of the dict representing the tree will be objects of type DistPackage and the values will be list of ReqPackage objects. :param dict index: dist index ie. index of pkgs by their keys :returns: tree of ...
[ "def", "construct_tree", "(", "index", ")", ":", "return", "dict", "(", "(", "p", ",", "[", "ReqPackage", "(", "r", ",", "index", ".", "get", "(", "r", ".", "key", ")", ")", "for", "r", "in", "p", ".", "requires", "(", ")", "]", ")", "for", "...
Construct tree representation of the pkgs from the index. The keys of the dict representing the tree will be objects of type DistPackage and the values will be list of ReqPackage objects. :param dict index: dist index ie. index of pkgs by their keys :returns: tree of pkgs and their dependencies :r...
[ "Construct", "tree", "representation", "of", "the", "pkgs", "from", "the", "index", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L42-L55
25,346
pypa/pipenv
pipenv/vendor/pipdeptree.py
sorted_tree
def sorted_tree(tree): """Sorts the dict representation of the tree The root packages as well as the intermediate packages are sorted in the alphabetical order of the package names. :param dict tree: the pkg dependency tree obtained by calling `construct_tree` function :return...
python
def sorted_tree(tree): """Sorts the dict representation of the tree The root packages as well as the intermediate packages are sorted in the alphabetical order of the package names. :param dict tree: the pkg dependency tree obtained by calling `construct_tree` function :return...
[ "def", "sorted_tree", "(", "tree", ")", ":", "return", "OrderedDict", "(", "sorted", "(", "[", "(", "k", ",", "sorted", "(", "v", ",", "key", "=", "attrgetter", "(", "'key'", ")", ")", ")", "for", "k", ",", "v", "in", "tree", ".", "items", "(", ...
Sorts the dict representation of the tree The root packages as well as the intermediate packages are sorted in the alphabetical order of the package names. :param dict tree: the pkg dependency tree obtained by calling `construct_tree` function :returns: sorted tree :rtype: col...
[ "Sorts", "the", "dict", "representation", "of", "the", "tree" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L58-L72
25,347
pypa/pipenv
pipenv/vendor/pipdeptree.py
find_tree_root
def find_tree_root(tree, key): """Find a root in a tree by it's key :param dict tree: the pkg dependency tree obtained by calling `construct_tree` function :param str key: key of the root node to find :returns: a root node if found else None :rtype: mixed """ result = ...
python
def find_tree_root(tree, key): """Find a root in a tree by it's key :param dict tree: the pkg dependency tree obtained by calling `construct_tree` function :param str key: key of the root node to find :returns: a root node if found else None :rtype: mixed """ result = ...
[ "def", "find_tree_root", "(", "tree", ",", "key", ")", ":", "result", "=", "[", "p", "for", "p", "in", "tree", ".", "keys", "(", ")", "if", "p", ".", "key", "==", "key", "]", "assert", "len", "(", "result", ")", "in", "[", "0", ",", "1", "]",...
Find a root in a tree by it's key :param dict tree: the pkg dependency tree obtained by calling `construct_tree` function :param str key: key of the root node to find :returns: a root node if found else None :rtype: mixed
[ "Find", "a", "root", "in", "a", "tree", "by", "it", "s", "key" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L75-L87
25,348
pypa/pipenv
pipenv/vendor/pipdeptree.py
reverse_tree
def reverse_tree(tree): """Reverse the dependency tree. ie. the keys of the resulting dict are objects of type ReqPackage and the values are lists of DistPackage objects. :param dict tree: the pkg dependency tree obtained by calling `construct_tree` function :returns: reverse...
python
def reverse_tree(tree): """Reverse the dependency tree. ie. the keys of the resulting dict are objects of type ReqPackage and the values are lists of DistPackage objects. :param dict tree: the pkg dependency tree obtained by calling `construct_tree` function :returns: reverse...
[ "def", "reverse_tree", "(", "tree", ")", ":", "rtree", "=", "defaultdict", "(", "list", ")", "child_keys", "=", "set", "(", "c", ".", "key", "for", "c", "in", "flatten", "(", "tree", ".", "values", "(", ")", ")", ")", "for", "k", ",", "vs", "in",...
Reverse the dependency tree. ie. the keys of the resulting dict are objects of type ReqPackage and the values are lists of DistPackage objects. :param dict tree: the pkg dependency tree obtained by calling `construct_tree` function :returns: reversed tree :rtype: dict
[ "Reverse", "the", "dependency", "tree", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L90-L110
25,349
pypa/pipenv
pipenv/vendor/pipdeptree.py
guess_version
def guess_version(pkg_key, default='?'): """Guess the version of a pkg when pip doesn't provide it :param str pkg_key: key of the package :param str default: default version to return if unable to find :returns: version :rtype: string """ try: m = import_module(pkg_key) except ...
python
def guess_version(pkg_key, default='?'): """Guess the version of a pkg when pip doesn't provide it :param str pkg_key: key of the package :param str default: default version to return if unable to find :returns: version :rtype: string """ try: m = import_module(pkg_key) except ...
[ "def", "guess_version", "(", "pkg_key", ",", "default", "=", "'?'", ")", ":", "try", ":", "m", "=", "import_module", "(", "pkg_key", ")", "except", "ImportError", ":", "return", "default", "else", ":", "return", "getattr", "(", "m", ",", "'__version__'", ...
Guess the version of a pkg when pip doesn't provide it :param str pkg_key: key of the package :param str default: default version to return if unable to find :returns: version :rtype: string
[ "Guess", "the", "version", "of", "a", "pkg", "when", "pip", "doesn", "t", "provide", "it" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L113-L127
25,350
pypa/pipenv
pipenv/vendor/pipdeptree.py
render_tree
def render_tree(tree, list_all=True, show_only=None, frozen=False, exclude=None): """Convert tree to string representation :param dict tree: the package tree :param bool list_all: whether to list all the pgks at the root level or only those that are the s...
python
def render_tree(tree, list_all=True, show_only=None, frozen=False, exclude=None): """Convert tree to string representation :param dict tree: the package tree :param bool list_all: whether to list all the pgks at the root level or only those that are the s...
[ "def", "render_tree", "(", "tree", ",", "list_all", "=", "True", ",", "show_only", "=", "None", ",", "frozen", "=", "False", ",", "exclude", "=", "None", ")", ":", "tree", "=", "sorted_tree", "(", "tree", ")", "branch_keys", "=", "set", "(", "r", "."...
Convert tree to string representation :param dict tree: the package tree :param bool list_all: whether to list all the pgks at the root level or only those that are the sub-dependencies :param set show_only: set of select packages to be shown in the ...
[ "Convert", "tree", "to", "string", "representation" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L288-L337
25,351
pypa/pipenv
pipenv/vendor/pipdeptree.py
render_json
def render_json(tree, indent): """Converts the tree into a flat json representation. The json repr will be a list of hashes, each hash having 2 fields: - package - dependencies: list of dependencies :param dict tree: dependency tree :param int indent: no. of spaces to indent json :retu...
python
def render_json(tree, indent): """Converts the tree into a flat json representation. The json repr will be a list of hashes, each hash having 2 fields: - package - dependencies: list of dependencies :param dict tree: dependency tree :param int indent: no. of spaces to indent json :retu...
[ "def", "render_json", "(", "tree", ",", "indent", ")", ":", "return", "json", ".", "dumps", "(", "[", "{", "'package'", ":", "k", ".", "as_dict", "(", ")", ",", "'dependencies'", ":", "[", "v", ".", "as_dict", "(", ")", "for", "v", "in", "vs", "]...
Converts the tree into a flat json representation. The json repr will be a list of hashes, each hash having 2 fields: - package - dependencies: list of dependencies :param dict tree: dependency tree :param int indent: no. of spaces to indent json :returns: json representation of the tree ...
[ "Converts", "the", "tree", "into", "a", "flat", "json", "representation", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L340-L356
25,352
pypa/pipenv
pipenv/vendor/pipdeptree.py
render_json_tree
def render_json_tree(tree, indent): """Converts the tree into a nested json representation. The json repr will be a list of hashes, each hash having the following fields: - package_name - key - required_version - installed_version - dependencies: list of dependencies :param d...
python
def render_json_tree(tree, indent): """Converts the tree into a nested json representation. The json repr will be a list of hashes, each hash having the following fields: - package_name - key - required_version - installed_version - dependencies: list of dependencies :param d...
[ "def", "render_json_tree", "(", "tree", ",", "indent", ")", ":", "tree", "=", "sorted_tree", "(", "tree", ")", "branch_keys", "=", "set", "(", "r", ".", "key", "for", "r", "in", "flatten", "(", "tree", ".", "values", "(", ")", ")", ")", "nodes", "=...
Converts the tree into a nested json representation. The json repr will be a list of hashes, each hash having the following fields: - package_name - key - required_version - installed_version - dependencies: list of dependencies :param dict tree: dependency tree :param int in...
[ "Converts", "the", "tree", "into", "a", "nested", "json", "representation", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L359-L399
25,353
pypa/pipenv
pipenv/vendor/pipdeptree.py
dump_graphviz
def dump_graphviz(tree, output_format='dot'): """Output dependency graph as one of the supported GraphViz output formats. :param dict tree: dependency graph :param string output_format: output format :returns: representation of tree in the specified output format :rtype: str or binary representatio...
python
def dump_graphviz(tree, output_format='dot'): """Output dependency graph as one of the supported GraphViz output formats. :param dict tree: dependency graph :param string output_format: output format :returns: representation of tree in the specified output format :rtype: str or binary representatio...
[ "def", "dump_graphviz", "(", "tree", ",", "output_format", "=", "'dot'", ")", ":", "try", ":", "from", "graphviz", "import", "backend", ",", "Digraph", "except", "ImportError", ":", "print", "(", "'graphviz is not available, but necessary for the output '", "'option. ...
Output dependency graph as one of the supported GraphViz output formats. :param dict tree: dependency graph :param string output_format: output format :returns: representation of tree in the specified output format :rtype: str or binary representation depending on the output format
[ "Output", "dependency", "graph", "as", "one", "of", "the", "supported", "GraphViz", "output", "formats", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L402-L445
25,354
pypa/pipenv
pipenv/vendor/pipdeptree.py
print_graphviz
def print_graphviz(dump_output): """Dump the data generated by GraphViz to stdout. :param dump_output: The output from dump_graphviz """ if hasattr(dump_output, 'encode'): print(dump_output) else: with os.fdopen(sys.stdout.fileno(), 'wb') as bytestream: bytestream.write(...
python
def print_graphviz(dump_output): """Dump the data generated by GraphViz to stdout. :param dump_output: The output from dump_graphviz """ if hasattr(dump_output, 'encode'): print(dump_output) else: with os.fdopen(sys.stdout.fileno(), 'wb') as bytestream: bytestream.write(...
[ "def", "print_graphviz", "(", "dump_output", ")", ":", "if", "hasattr", "(", "dump_output", ",", "'encode'", ")", ":", "print", "(", "dump_output", ")", "else", ":", "with", "os", ".", "fdopen", "(", "sys", ".", "stdout", ".", "fileno", "(", ")", ",", ...
Dump the data generated by GraphViz to stdout. :param dump_output: The output from dump_graphviz
[ "Dump", "the", "data", "generated", "by", "GraphViz", "to", "stdout", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L448-L457
25,355
pypa/pipenv
pipenv/vendor/pipdeptree.py
conflicting_deps
def conflicting_deps(tree): """Returns dependencies which are not present or conflict with the requirements of other packages. e.g. will warn if pkg1 requires pkg2==2.0 and pkg2==1.0 is installed :param tree: the requirements tree (dict) :returns: dict of DistPackage -> list of unsatisfied/unknown...
python
def conflicting_deps(tree): """Returns dependencies which are not present or conflict with the requirements of other packages. e.g. will warn if pkg1 requires pkg2==2.0 and pkg2==1.0 is installed :param tree: the requirements tree (dict) :returns: dict of DistPackage -> list of unsatisfied/unknown...
[ "def", "conflicting_deps", "(", "tree", ")", ":", "conflicting", "=", "defaultdict", "(", "list", ")", "for", "p", ",", "rs", "in", "tree", ".", "items", "(", ")", ":", "for", "req", "in", "rs", ":", "if", "req", ".", "is_conflicting", "(", ")", ":...
Returns dependencies which are not present or conflict with the requirements of other packages. e.g. will warn if pkg1 requires pkg2==2.0 and pkg2==1.0 is installed :param tree: the requirements tree (dict) :returns: dict of DistPackage -> list of unsatisfied/unknown ReqPackage :rtype: dict
[ "Returns", "dependencies", "which", "are", "not", "present", "or", "conflict", "with", "the", "requirements", "of", "other", "packages", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L460-L476
25,356
pypa/pipenv
pipenv/vendor/pipdeptree.py
cyclic_deps
def cyclic_deps(tree): """Return cyclic dependencies as list of tuples :param list pkgs: pkg_resources.Distribution instances :param dict pkg_index: mapping of pkgs with their respective keys :returns: list of tuples representing cyclic dependencies :rtype: generator """ key_tree = dict((k...
python
def cyclic_deps(tree): """Return cyclic dependencies as list of tuples :param list pkgs: pkg_resources.Distribution instances :param dict pkg_index: mapping of pkgs with their respective keys :returns: list of tuples representing cyclic dependencies :rtype: generator """ key_tree = dict((k...
[ "def", "cyclic_deps", "(", "tree", ")", ":", "key_tree", "=", "dict", "(", "(", "k", ".", "key", ",", "v", ")", "for", "k", ",", "v", "in", "tree", ".", "items", "(", ")", ")", "get_children", "=", "lambda", "n", ":", "key_tree", ".", "get", "(...
Return cyclic dependencies as list of tuples :param list pkgs: pkg_resources.Distribution instances :param dict pkg_index: mapping of pkgs with their respective keys :returns: list of tuples representing cyclic dependencies :rtype: generator
[ "Return", "cyclic", "dependencies", "as", "list", "of", "tuples" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L479-L495
25,357
pypa/pipenv
pipenv/vendor/pipdeptree.py
ReqPackage.is_conflicting
def is_conflicting(self): """If installed version conflicts with required version""" # unknown installed version is also considered conflicting if self.installed_version == self.UNKNOWN_VERSION: return True ver_spec = (self.version_spec if self.version_spec else '') r...
python
def is_conflicting(self): """If installed version conflicts with required version""" # unknown installed version is also considered conflicting if self.installed_version == self.UNKNOWN_VERSION: return True ver_spec = (self.version_spec if self.version_spec else '') r...
[ "def", "is_conflicting", "(", "self", ")", ":", "# unknown installed version is also considered conflicting", "if", "self", ".", "installed_version", "==", "self", ".", "UNKNOWN_VERSION", ":", "return", "True", "ver_spec", "=", "(", "self", ".", "version_spec", "if", ...
If installed version conflicts with required version
[ "If", "installed", "version", "conflicts", "with", "required", "version" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pipdeptree.py#L254-L262
25,358
pypa/pipenv
pipenv/patched/notpip/_internal/utils/hashes.py
Hashes.check_against_chunks
def check_against_chunks(self, chunks): # type: (Iterator[bytes]) -> None """Check good hashes against ones built from iterable of chunks of data. Raise HashMismatch if none match. """ gots = {} for hash_name in iterkeys(self._allowed): try: ...
python
def check_against_chunks(self, chunks): # type: (Iterator[bytes]) -> None """Check good hashes against ones built from iterable of chunks of data. Raise HashMismatch if none match. """ gots = {} for hash_name in iterkeys(self._allowed): try: ...
[ "def", "check_against_chunks", "(", "self", ",", "chunks", ")", ":", "# type: (Iterator[bytes]) -> None", "gots", "=", "{", "}", "for", "hash_name", "in", "iterkeys", "(", "self", ".", "_allowed", ")", ":", "try", ":", "gots", "[", "hash_name", "]", "=", "...
Check good hashes against ones built from iterable of chunks of data. Raise HashMismatch if none match.
[ "Check", "good", "hashes", "against", "ones", "built", "from", "iterable", "of", "chunks", "of", "data", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/utils/hashes.py#L47-L69
25,359
pypa/pipenv
pipenv/vendor/cerberus/validator.py
BareValidator._drop_nodes_from_errorpaths
def _drop_nodes_from_errorpaths(self, _errors, dp_items, sp_items): """ Removes nodes by index from an errorpath, relatively to the basepaths of self. :param errors: A list of :class:`errors.ValidationError` instances. :param dp_items: A list of integers, pointing at the nodes to dr...
python
def _drop_nodes_from_errorpaths(self, _errors, dp_items, sp_items): """ Removes nodes by index from an errorpath, relatively to the basepaths of self. :param errors: A list of :class:`errors.ValidationError` instances. :param dp_items: A list of integers, pointing at the nodes to dr...
[ "def", "_drop_nodes_from_errorpaths", "(", "self", ",", "_errors", ",", "dp_items", ",", "sp_items", ")", ":", "dp_basedepth", "=", "len", "(", "self", ".", "document_path", ")", "sp_basedepth", "=", "len", "(", "self", ".", "schema_path", ")", "for", "error...
Removes nodes by index from an errorpath, relatively to the basepaths of self. :param errors: A list of :class:`errors.ValidationError` instances. :param dp_items: A list of integers, pointing at the nodes to drop from the :attr:`document_path`. :param sp_it...
[ "Removes", "nodes", "by", "index", "from", "an", "errorpath", "relatively", "to", "the", "basepaths", "of", "self", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/cerberus/validator.py#L341-L361
25,360
pypa/pipenv
pipenv/vendor/cerberus/validator.py
BareValidator._lookup_field
def _lookup_field(self, path): """ Searches for a field as defined by path. This method is used by the ``dependency`` evaluation logic. :param path: Path elements are separated by a ``.``. A leading ``^`` indicates that the path relates to the document root, ...
python
def _lookup_field(self, path): """ Searches for a field as defined by path. This method is used by the ``dependency`` evaluation logic. :param path: Path elements are separated by a ``.``. A leading ``^`` indicates that the path relates to the document root, ...
[ "def", "_lookup_field", "(", "self", ",", "path", ")", ":", "if", "path", ".", "startswith", "(", "'^'", ")", ":", "path", "=", "path", "[", "1", ":", "]", "context", "=", "self", ".", "document", "if", "path", ".", "startswith", "(", "'^'", ")", ...
Searches for a field as defined by path. This method is used by the ``dependency`` evaluation logic. :param path: Path elements are separated by a ``.``. A leading ``^`` indicates that the path relates to the document root, otherwise it relates to the curre...
[ "Searches", "for", "a", "field", "as", "defined", "by", "path", ".", "This", "method", "is", "used", "by", "the", "dependency", "evaluation", "logic", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/cerberus/validator.py#L363-L391
25,361
pypa/pipenv
pipenv/vendor/cerberus/validator.py
BareValidator._drop_remaining_rules
def _drop_remaining_rules(self, *rules): """ Drops rules from the queue of the rules that still need to be evaluated for the currently processed field. If no arguments are given, the whole queue is emptied. """ if rules: for rule in rules: try:...
python
def _drop_remaining_rules(self, *rules): """ Drops rules from the queue of the rules that still need to be evaluated for the currently processed field. If no arguments are given, the whole queue is emptied. """ if rules: for rule in rules: try:...
[ "def", "_drop_remaining_rules", "(", "self", ",", "*", "rules", ")", ":", "if", "rules", ":", "for", "rule", "in", "rules", ":", "try", ":", "self", ".", "_remaining_rules", ".", "remove", "(", "rule", ")", "except", "ValueError", ":", "pass", "else", ...
Drops rules from the queue of the rules that still need to be evaluated for the currently processed field. If no arguments are given, the whole queue is emptied.
[ "Drops", "rules", "from", "the", "queue", "of", "the", "rules", "that", "still", "need", "to", "be", "evaluated", "for", "the", "currently", "processed", "field", ".", "If", "no", "arguments", "are", "given", "the", "whole", "queue", "is", "emptied", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/cerberus/validator.py#L561-L573
25,362
pypa/pipenv
pipenv/vendor/cerberus/validator.py
BareValidator.normalized
def normalized(self, document, schema=None, always_return_document=False): """ Returns the document normalized according to the specified rules of a schema. :param document: The document to normalize. :type document: any :term:`mapping` :param schema: The validation schema. Defa...
python
def normalized(self, document, schema=None, always_return_document=False): """ Returns the document normalized according to the specified rules of a schema. :param document: The document to normalize. :type document: any :term:`mapping` :param schema: The validation schema. Defa...
[ "def", "normalized", "(", "self", ",", "document", ",", "schema", "=", "None", ",", "always_return_document", "=", "False", ")", ":", "self", ".", "__init_processing", "(", "document", ",", "schema", ")", "self", ".", "__normalize_mapping", "(", "self", ".",...
Returns the document normalized according to the specified rules of a schema. :param document: The document to normalize. :type document: any :term:`mapping` :param schema: The validation schema. Defaults to :obj:`None`. If not provided here, the schema must have ...
[ "Returns", "the", "document", "normalized", "according", "to", "the", "specified", "rules", "of", "a", "schema", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/cerberus/validator.py#L577-L599
25,363
pypa/pipenv
pipenv/vendor/cerberus/validator.py
BareValidator.validate
def validate(self, document, schema=None, update=False, normalize=True): """ Normalizes and validates a mapping against a validation-schema of defined rules. :param document: The document to normalize. :type document: any :term:`mapping` :param schema: The validation schema. Def...
python
def validate(self, document, schema=None, update=False, normalize=True): """ Normalizes and validates a mapping against a validation-schema of defined rules. :param document: The document to normalize. :type document: any :term:`mapping` :param schema: The validation schema. Def...
[ "def", "validate", "(", "self", ",", "document", ",", "schema", "=", "None", ",", "update", "=", "False", ",", "normalize", "=", "True", ")", ":", "self", ".", "update", "=", "update", "self", ".", "_unrequired_by_excludes", "=", "set", "(", ")", "self...
Normalizes and validates a mapping against a validation-schema of defined rules. :param document: The document to normalize. :type document: any :term:`mapping` :param schema: The validation schema. Defaults to :obj:`None`. If not provided here, the schema must ha...
[ "Normalizes", "and", "validates", "a", "mapping", "against", "a", "validation", "-", "schema", "of", "defined", "rules", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/cerberus/validator.py#L846-L886
25,364
pypa/pipenv
pipenv/vendor/cerberus/validator.py
BareValidator.__validate_logical
def __validate_logical(self, operator, definitions, field, value): """ Validates value against all definitions and logs errors according to the operator. """ valid_counter = 0 _errors = errors.ErrorList() for i, definition in enumerate(definitions): schema = {fie...
python
def __validate_logical(self, operator, definitions, field, value): """ Validates value against all definitions and logs errors according to the operator. """ valid_counter = 0 _errors = errors.ErrorList() for i, definition in enumerate(definitions): schema = {fie...
[ "def", "__validate_logical", "(", "self", ",", "operator", ",", "definitions", ",", "field", ",", "value", ")", ":", "valid_counter", "=", "0", "_errors", "=", "errors", ".", "ErrorList", "(", ")", "for", "i", ",", "definition", "in", "enumerate", "(", "...
Validates value against all definitions and logs errors according to the operator.
[ "Validates", "value", "against", "all", "definitions", "and", "logs", "errors", "according", "to", "the", "operator", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/cerberus/validator.py#L1062-L1085
25,365
pypa/pipenv
pipenv/vendor/cerberus/validator.py
BareValidator.__validate_required_fields
def __validate_required_fields(self, document): """ Validates that required fields are not missing. :param document: The document being validated. """ try: required = set(field for field, definition in self.schema.items() if self._resolve_rules_set...
python
def __validate_required_fields(self, document): """ Validates that required fields are not missing. :param document: The document being validated. """ try: required = set(field for field, definition in self.schema.items() if self._resolve_rules_set...
[ "def", "__validate_required_fields", "(", "self", ",", "document", ")", ":", "try", ":", "required", "=", "set", "(", "field", "for", "field", ",", "definition", "in", "self", ".", "schema", ".", "items", "(", ")", "if", "self", ".", "_resolve_rules_set", ...
Validates that required fields are not missing. :param document: The document being validated.
[ "Validates", "that", "required", "fields", "are", "not", "missing", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/cerberus/validator.py#L1195-L1224
25,366
pypa/pipenv
pipenv/vendor/jinja2/filters.py
make_attrgetter
def make_attrgetter(environment, attribute, postprocess=None): """Returns a callable that looks up the given attribute from a passed object with the rules of the environment. Dots are allowed to access attributes of attributes. Integer parts in paths are looked up as integers. """ if attribute...
python
def make_attrgetter(environment, attribute, postprocess=None): """Returns a callable that looks up the given attribute from a passed object with the rules of the environment. Dots are allowed to access attributes of attributes. Integer parts in paths are looked up as integers. """ if attribute...
[ "def", "make_attrgetter", "(", "environment", ",", "attribute", ",", "postprocess", "=", "None", ")", ":", "if", "attribute", "is", "None", ":", "attribute", "=", "[", "]", "elif", "isinstance", "(", "attribute", ",", "string_types", ")", ":", "attribute", ...
Returns a callable that looks up the given attribute from a passed object with the rules of the environment. Dots are allowed to access attributes of attributes. Integer parts in paths are looked up as integers.
[ "Returns", "a", "callable", "that", "looks", "up", "the", "given", "attribute", "from", "a", "passed", "object", "with", "the", "rules", "of", "the", "environment", ".", "Dots", "are", "allowed", "to", "access", "attributes", "of", "attributes", ".", "Intege...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L62-L84
25,367
pypa/pipenv
pipenv/vendor/jinja2/filters.py
do_title
def do_title(s): """Return a titlecased version of the value. I.e. words will start with uppercase letters, all remaining characters are lowercase. """ return ''.join( [item[0].upper() + item[1:].lower() for item in _word_beginning_split_re.split(soft_unicode(s)) if item])
python
def do_title(s): """Return a titlecased version of the value. I.e. words will start with uppercase letters, all remaining characters are lowercase. """ return ''.join( [item[0].upper() + item[1:].lower() for item in _word_beginning_split_re.split(soft_unicode(s)) if item])
[ "def", "do_title", "(", "s", ")", ":", "return", "''", ".", "join", "(", "[", "item", "[", "0", "]", ".", "upper", "(", ")", "+", "item", "[", "1", ":", "]", ".", "lower", "(", ")", "for", "item", "in", "_word_beginning_split_re", ".", "split", ...
Return a titlecased version of the value. I.e. words will start with uppercase letters, all remaining characters are lowercase.
[ "Return", "a", "titlecased", "version", "of", "the", "value", ".", "I", ".", "e", ".", "words", "will", "start", "with", "uppercase", "letters", "all", "remaining", "characters", "are", "lowercase", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L196-L203
25,368
pypa/pipenv
pipenv/vendor/jinja2/filters.py
do_sort
def do_sort( environment, value, reverse=False, case_sensitive=False, attribute=None ): """Sort an iterable. Per default it sorts ascending, if you pass it true as first argument it will reverse the sorting. If the iterable is made of strings the third parameter can be used to control the case sen...
python
def do_sort( environment, value, reverse=False, case_sensitive=False, attribute=None ): """Sort an iterable. Per default it sorts ascending, if you pass it true as first argument it will reverse the sorting. If the iterable is made of strings the third parameter can be used to control the case sen...
[ "def", "do_sort", "(", "environment", ",", "value", ",", "reverse", "=", "False", ",", "case_sensitive", "=", "False", ",", "attribute", "=", "None", ")", ":", "key_func", "=", "make_attrgetter", "(", "environment", ",", "attribute", ",", "postprocess", "=",...
Sort an iterable. Per default it sorts ascending, if you pass it true as first argument it will reverse the sorting. If the iterable is made of strings the third parameter can be used to control the case sensitiveness of the comparison which is disabled by default. .. sourcecode:: jinja ...
[ "Sort", "an", "iterable", ".", "Per", "default", "it", "sorts", "ascending", "if", "you", "pass", "it", "true", "as", "first", "argument", "it", "will", "reverse", "the", "sorting", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L246-L278
25,369
pypa/pipenv
pipenv/vendor/jinja2/filters.py
do_unique
def do_unique(environment, value, case_sensitive=False, attribute=None): """Returns a list of unique items from the the given iterable. .. sourcecode:: jinja {{ ['foo', 'bar', 'foobar', 'FooBar']|unique }} -> ['foo', 'bar', 'foobar'] The unique items are yielded in the same order as t...
python
def do_unique(environment, value, case_sensitive=False, attribute=None): """Returns a list of unique items from the the given iterable. .. sourcecode:: jinja {{ ['foo', 'bar', 'foobar', 'FooBar']|unique }} -> ['foo', 'bar', 'foobar'] The unique items are yielded in the same order as t...
[ "def", "do_unique", "(", "environment", ",", "value", ",", "case_sensitive", "=", "False", ",", "attribute", "=", "None", ")", ":", "getter", "=", "make_attrgetter", "(", "environment", ",", "attribute", ",", "postprocess", "=", "ignore_case", "if", "not", "...
Returns a list of unique items from the the given iterable. .. sourcecode:: jinja {{ ['foo', 'bar', 'foobar', 'FooBar']|unique }} -> ['foo', 'bar', 'foobar'] The unique items are yielded in the same order as their first occurrence in the iterable passed to the filter. :param case...
[ "Returns", "a", "list", "of", "unique", "items", "from", "the", "the", "given", "iterable", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L282-L307
25,370
pypa/pipenv
pipenv/vendor/jinja2/filters.py
do_min
def do_min(environment, value, case_sensitive=False, attribute=None): """Return the smallest item from the sequence. .. sourcecode:: jinja {{ [1, 2, 3]|min }} -> 1 :param case_sensitive: Treat upper and lower case strings as distinct. :param attribute: Get the object with the max ...
python
def do_min(environment, value, case_sensitive=False, attribute=None): """Return the smallest item from the sequence. .. sourcecode:: jinja {{ [1, 2, 3]|min }} -> 1 :param case_sensitive: Treat upper and lower case strings as distinct. :param attribute: Get the object with the max ...
[ "def", "do_min", "(", "environment", ",", "value", ",", "case_sensitive", "=", "False", ",", "attribute", "=", "None", ")", ":", "return", "_min_or_max", "(", "environment", ",", "value", ",", "min", ",", "case_sensitive", ",", "attribute", ")" ]
Return the smallest item from the sequence. .. sourcecode:: jinja {{ [1, 2, 3]|min }} -> 1 :param case_sensitive: Treat upper and lower case strings as distinct. :param attribute: Get the object with the max value of this attribute.
[ "Return", "the", "smallest", "item", "from", "the", "sequence", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L326-L337
25,371
pypa/pipenv
pipenv/vendor/jinja2/filters.py
do_max
def do_max(environment, value, case_sensitive=False, attribute=None): """Return the largest item from the sequence. .. sourcecode:: jinja {{ [1, 2, 3]|max }} -> 3 :param case_sensitive: Treat upper and lower case strings as distinct. :param attribute: Get the object with the max v...
python
def do_max(environment, value, case_sensitive=False, attribute=None): """Return the largest item from the sequence. .. sourcecode:: jinja {{ [1, 2, 3]|max }} -> 3 :param case_sensitive: Treat upper and lower case strings as distinct. :param attribute: Get the object with the max v...
[ "def", "do_max", "(", "environment", ",", "value", ",", "case_sensitive", "=", "False", ",", "attribute", "=", "None", ")", ":", "return", "_min_or_max", "(", "environment", ",", "value", ",", "max", ",", "case_sensitive", ",", "attribute", ")" ]
Return the largest item from the sequence. .. sourcecode:: jinja {{ [1, 2, 3]|max }} -> 3 :param case_sensitive: Treat upper and lower case strings as distinct. :param attribute: Get the object with the max value of this attribute.
[ "Return", "the", "largest", "item", "from", "the", "sequence", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L341-L352
25,372
pypa/pipenv
pipenv/vendor/jinja2/filters.py
do_last
def do_last(environment, seq): """Return the last item of a sequence.""" try: return next(iter(reversed(seq))) except StopIteration: return environment.undefined('No last item, sequence was empty.')
python
def do_last(environment, seq): """Return the last item of a sequence.""" try: return next(iter(reversed(seq))) except StopIteration: return environment.undefined('No last item, sequence was empty.')
[ "def", "do_last", "(", "environment", ",", "seq", ")", ":", "try", ":", "return", "next", "(", "iter", "(", "reversed", "(", "seq", ")", ")", ")", "except", "StopIteration", ":", "return", "environment", ".", "undefined", "(", "'No last item, sequence was em...
Return the last item of a sequence.
[ "Return", "the", "last", "item", "of", "a", "sequence", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L442-L447
25,373
pypa/pipenv
pipenv/vendor/jinja2/filters.py
do_random
def do_random(context, seq): """Return a random item from the sequence.""" try: return random.choice(seq) except IndexError: return context.environment.undefined('No random item, sequence was empty.')
python
def do_random(context, seq): """Return a random item from the sequence.""" try: return random.choice(seq) except IndexError: return context.environment.undefined('No random item, sequence was empty.')
[ "def", "do_random", "(", "context", ",", "seq", ")", ":", "try", ":", "return", "random", ".", "choice", "(", "seq", ")", "except", "IndexError", ":", "return", "context", ".", "environment", ".", "undefined", "(", "'No random item, sequence was empty.'", ")" ...
Return a random item from the sequence.
[ "Return", "a", "random", "item", "from", "the", "sequence", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L451-L456
25,374
pypa/pipenv
pipenv/vendor/jinja2/filters.py
do_indent
def do_indent( s, width=4, first=False, blank=False, indentfirst=None ): """Return a copy of the string with each line indented by 4 spaces. The first line and blank lines are not indented by default. :param width: Number of spaces to indent by. :param first: Don't skip indenting the first line. ...
python
def do_indent( s, width=4, first=False, blank=False, indentfirst=None ): """Return a copy of the string with each line indented by 4 spaces. The first line and blank lines are not indented by default. :param width: Number of spaces to indent by. :param first: Don't skip indenting the first line. ...
[ "def", "do_indent", "(", "s", ",", "width", "=", "4", ",", "first", "=", "False", ",", "blank", "=", "False", ",", "indentfirst", "=", "None", ")", ":", "if", "indentfirst", "is", "not", "None", ":", "warnings", ".", "warn", "(", "DeprecationWarning", ...
Return a copy of the string with each line indented by 4 spaces. The first line and blank lines are not indented by default. :param width: Number of spaces to indent by. :param first: Don't skip indenting the first line. :param blank: Don't skip indenting empty lines. .. versionchanged:: 2.10 ...
[ "Return", "a", "copy", "of", "the", "string", "with", "each", "line", "indented", "by", "4", "spaces", ".", "The", "first", "line", "and", "blank", "lines", "are", "not", "indented", "by", "default", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L536-L574
25,375
pypa/pipenv
pipenv/vendor/jinja2/filters.py
do_wordwrap
def do_wordwrap(environment, s, width=79, break_long_words=True, wrapstring=None): """ Return a copy of the string passed to the filter wrapped after ``79`` characters. You can override this default using the first parameter. If you set the second parameter to `false` Jinja will not ...
python
def do_wordwrap(environment, s, width=79, break_long_words=True, wrapstring=None): """ Return a copy of the string passed to the filter wrapped after ``79`` characters. You can override this default using the first parameter. If you set the second parameter to `false` Jinja will not ...
[ "def", "do_wordwrap", "(", "environment", ",", "s", ",", "width", "=", "79", ",", "break_long_words", "=", "True", ",", "wrapstring", "=", "None", ")", ":", "if", "not", "wrapstring", ":", "wrapstring", "=", "environment", ".", "newline_sequence", "import", ...
Return a copy of the string passed to the filter wrapped after ``79`` characters. You can override this default using the first parameter. If you set the second parameter to `false` Jinja will not split words apart if they are longer than `width`. By default, the newlines will be the default newlines ...
[ "Return", "a", "copy", "of", "the", "string", "passed", "to", "the", "filter", "wrapped", "after", "79", "characters", ".", "You", "can", "override", "this", "default", "using", "the", "first", "parameter", ".", "If", "you", "set", "the", "second", "parame...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L615-L633
25,376
pypa/pipenv
pipenv/vendor/jinja2/filters.py
do_reverse
def do_reverse(value): """Reverse the object or return an iterator that iterates over it the other way round. """ if isinstance(value, string_types): return value[::-1] try: return reversed(value) except TypeError: try: rv = list(value) rv.reverse(...
python
def do_reverse(value): """Reverse the object or return an iterator that iterates over it the other way round. """ if isinstance(value, string_types): return value[::-1] try: return reversed(value) except TypeError: try: rv = list(value) rv.reverse(...
[ "def", "do_reverse", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "string_types", ")", ":", "return", "value", "[", ":", ":", "-", "1", "]", "try", ":", "return", "reversed", "(", "value", ")", "except", "TypeError", ":", "try", ":"...
Reverse the object or return an iterator that iterates over it the other way round.
[ "Reverse", "the", "object", "or", "return", "an", "iterator", "that", "iterates", "over", "it", "the", "other", "way", "round", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L895-L909
25,377
pypa/pipenv
pipenv/vendor/jinja2/filters.py
do_map
def do_map(*args, **kwargs): """Applies a filter on a sequence of objects or looks up an attribute. This is useful when dealing with lists of objects but you are really only interested in a certain value of it. The basic usage is mapping on an attribute. Imagine you have a list of users but you ar...
python
def do_map(*args, **kwargs): """Applies a filter on a sequence of objects or looks up an attribute. This is useful when dealing with lists of objects but you are really only interested in a certain value of it. The basic usage is mapping on an attribute. Imagine you have a list of users but you ar...
[ "def", "do_map", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "seq", ",", "func", "=", "prepare_map", "(", "args", ",", "kwargs", ")", "if", "seq", ":", "for", "item", "in", "seq", ":", "yield", "func", "(", "item", ")" ]
Applies a filter on a sequence of objects or looks up an attribute. This is useful when dealing with lists of objects but you are really only interested in a certain value of it. The basic usage is mapping on an attribute. Imagine you have a list of users but you are only interested in a list of usern...
[ "Applies", "a", "filter", "on", "a", "sequence", "of", "objects", "or", "looks", "up", "an", "attribute", ".", "This", "is", "useful", "when", "dealing", "with", "lists", "of", "objects", "but", "you", "are", "really", "only", "interested", "in", "a", "c...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L938-L963
25,378
pypa/pipenv
pipenv/patched/notpip/_internal/cli/autocompletion.py
auto_complete_paths
def auto_complete_paths(current, completion_type): """If ``completion_type`` is ``file`` or ``path``, list all regular files and directories starting with ``current``; otherwise only list directories starting with ``current``. :param current: The word to be completed :param completion_type: path co...
python
def auto_complete_paths(current, completion_type): """If ``completion_type`` is ``file`` or ``path``, list all regular files and directories starting with ``current``; otherwise only list directories starting with ``current``. :param current: The word to be completed :param completion_type: path co...
[ "def", "auto_complete_paths", "(", "current", ",", "completion_type", ")", ":", "directory", ",", "filename", "=", "os", ".", "path", ".", "split", "(", "current", ")", "current_path", "=", "os", ".", "path", ".", "abspath", "(", "directory", ")", "# Don't...
If ``completion_type`` is ``file`` or ``path``, list all regular files and directories starting with ``current``; otherwise only list directories starting with ``current``. :param current: The word to be completed :param completion_type: path completion type(`file`, `path` or `dir`)i :return: A gen...
[ "If", "completion_type", "is", "file", "or", "path", "list", "all", "regular", "files", "and", "directories", "starting", "with", "current", ";", "otherwise", "only", "list", "directories", "starting", "with", "current", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/cli/autocompletion.py#L125-L152
25,379
pypa/pipenv
pipenv/vendor/passa/internals/_pip_shims.py
_build_wheel_modern
def _build_wheel_modern(ireq, output_dir, finder, wheel_cache, kwargs): """Build a wheel. * ireq: The InstallRequirement object to build * output_dir: The directory to build the wheel in. * finder: pip's internal Finder object to find the source out of ireq. * kwargs: Various keyword arguments from...
python
def _build_wheel_modern(ireq, output_dir, finder, wheel_cache, kwargs): """Build a wheel. * ireq: The InstallRequirement object to build * output_dir: The directory to build the wheel in. * finder: pip's internal Finder object to find the source out of ireq. * kwargs: Various keyword arguments from...
[ "def", "_build_wheel_modern", "(", "ireq", ",", "output_dir", ",", "finder", ",", "wheel_cache", ",", "kwargs", ")", ":", "kwargs", ".", "update", "(", "{", "\"progress_bar\"", ":", "\"off\"", ",", "\"build_isolation\"", ":", "False", "}", ")", "with", "pip_...
Build a wheel. * ireq: The InstallRequirement object to build * output_dir: The directory to build the wheel in. * finder: pip's internal Finder object to find the source out of ireq. * kwargs: Various keyword arguments from `_prepare_wheel_building_kwargs`.
[ "Build", "a", "wheel", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/passa/internals/_pip_shims.py#L24-L38
25,380
pypa/pipenv
pipenv/vendor/pythonfinder/utils.py
get_python_version
def get_python_version(path): # type: (str) -> str """Get python version string using subprocess from a given path.""" version_cmd = [path, "-c", "import sys; print(sys.version.split()[0])"] try: c = vistir.misc.run( version_cmd, block=True, nospin=True, ...
python
def get_python_version(path): # type: (str) -> str """Get python version string using subprocess from a given path.""" version_cmd = [path, "-c", "import sys; print(sys.version.split()[0])"] try: c = vistir.misc.run( version_cmd, block=True, nospin=True, ...
[ "def", "get_python_version", "(", "path", ")", ":", "# type: (str) -> str", "version_cmd", "=", "[", "path", ",", "\"-c\"", ",", "\"import sys; print(sys.version.split()[0])\"", "]", "try", ":", "c", "=", "vistir", ".", "misc", ".", "run", "(", "version_cmd", ",...
Get python version string using subprocess from a given path.
[ "Get", "python", "version", "string", "using", "subprocess", "from", "a", "given", "path", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pythonfinder/utils.py#L87-L104
25,381
pypa/pipenv
pipenv/vendor/pythonfinder/utils.py
path_is_known_executable
def path_is_known_executable(path): # type: (vistir.compat.Path) -> bool """ Returns whether a given path is a known executable from known executable extensions or has the executable bit toggled. :param path: The path to the target executable. :type path: :class:`~vistir.compat.Path` :retur...
python
def path_is_known_executable(path): # type: (vistir.compat.Path) -> bool """ Returns whether a given path is a known executable from known executable extensions or has the executable bit toggled. :param path: The path to the target executable. :type path: :class:`~vistir.compat.Path` :retur...
[ "def", "path_is_known_executable", "(", "path", ")", ":", "# type: (vistir.compat.Path) -> bool", "return", "(", "path_is_executable", "(", "path", ")", "or", "os", ".", "access", "(", "str", "(", "path", ")", ",", "os", ".", "R_OK", ")", "and", "path", ".",...
Returns whether a given path is a known executable from known executable extensions or has the executable bit toggled. :param path: The path to the target executable. :type path: :class:`~vistir.compat.Path` :return: True if the path has chmod +x, or is a readable, known executable extension. :rtyp...
[ "Returns", "whether", "a", "given", "path", "is", "a", "known", "executable", "from", "known", "executable", "extensions", "or", "has", "the", "executable", "bit", "toggled", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pythonfinder/utils.py#L181-L197
25,382
pypa/pipenv
pipenv/vendor/pythonfinder/utils.py
looks_like_python
def looks_like_python(name): # type: (str) -> bool """ Determine whether the supplied filename looks like a possible name of python. :param str name: The name of the provided file. :return: Whether the provided name looks like python. :rtype: bool """ if not any(name.lower().startswith...
python
def looks_like_python(name): # type: (str) -> bool """ Determine whether the supplied filename looks like a possible name of python. :param str name: The name of the provided file. :return: Whether the provided name looks like python. :rtype: bool """ if not any(name.lower().startswith...
[ "def", "looks_like_python", "(", "name", ")", ":", "# type: (str) -> bool", "if", "not", "any", "(", "name", ".", "lower", "(", ")", ".", "startswith", "(", "py_name", ")", "for", "py_name", "in", "PYTHON_IMPLEMENTATIONS", ")", ":", "return", "False", "match...
Determine whether the supplied filename looks like a possible name of python. :param str name: The name of the provided file. :return: Whether the provided name looks like python. :rtype: bool
[ "Determine", "whether", "the", "supplied", "filename", "looks", "like", "a", "possible", "name", "of", "python", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pythonfinder/utils.py#L201-L216
25,383
pypa/pipenv
pipenv/vendor/pythonfinder/utils.py
filter_pythons
def filter_pythons(path): # type: (Union[str, vistir.compat.Path]) -> Iterable """Return all valid pythons in a given path""" if not isinstance(path, vistir.compat.Path): path = vistir.compat.Path(str(path)) if not path.is_dir(): return path if path_is_python(path) else None return f...
python
def filter_pythons(path): # type: (Union[str, vistir.compat.Path]) -> Iterable """Return all valid pythons in a given path""" if not isinstance(path, vistir.compat.Path): path = vistir.compat.Path(str(path)) if not path.is_dir(): return path if path_is_python(path) else None return f...
[ "def", "filter_pythons", "(", "path", ")", ":", "# type: (Union[str, vistir.compat.Path]) -> Iterable", "if", "not", "isinstance", "(", "path", ",", "vistir", ".", "compat", ".", "Path", ")", ":", "path", "=", "vistir", ".", "compat", ".", "Path", "(", "str", ...
Return all valid pythons in a given path
[ "Return", "all", "valid", "pythons", "in", "a", "given", "path" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pythonfinder/utils.py#L270-L277
25,384
pypa/pipenv
pipenv/patched/notpip/_internal/cache.py
Cache._get_cache_path_parts
def _get_cache_path_parts(self, link): # type: (Link) -> List[str] """Get parts of part that must be os.path.joined with cache_dir """ # We want to generate an url to use as our cache key, we don't want to # just re-use the URL because it might have other items in the fragment ...
python
def _get_cache_path_parts(self, link): # type: (Link) -> List[str] """Get parts of part that must be os.path.joined with cache_dir """ # We want to generate an url to use as our cache key, we don't want to # just re-use the URL because it might have other items in the fragment ...
[ "def", "_get_cache_path_parts", "(", "self", ",", "link", ")", ":", "# type: (Link) -> List[str]", "# We want to generate an url to use as our cache key, we don't want to", "# just re-use the URL because it might have other items in the fragment", "# and we don't care about those.", "key_par...
Get parts of part that must be os.path.joined with cache_dir
[ "Get", "parts", "of", "part", "that", "must", "be", "os", ".", "path", ".", "joined", "with", "cache_dir" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/cache.py#L46-L70
25,385
pypa/pipenv
pipenv/patched/notpip/_internal/cache.py
SimpleWheelCache.get_path_for_link
def get_path_for_link(self, link): # type: (Link) -> str """Return a directory to store cached wheels for link Because there are M wheels for any one sdist, we provide a directory to cache them in, and then consult that directory when looking up cache hits. We only inse...
python
def get_path_for_link(self, link): # type: (Link) -> str """Return a directory to store cached wheels for link Because there are M wheels for any one sdist, we provide a directory to cache them in, and then consult that directory when looking up cache hits. We only inse...
[ "def", "get_path_for_link", "(", "self", ",", "link", ")", ":", "# type: (Link) -> str", "parts", "=", "self", ".", "_get_cache_path_parts", "(", "link", ")", "# Store wheels within the root cache_dir", "return", "os", ".", "path", ".", "join", "(", "self", ".", ...
Return a directory to store cached wheels for link Because there are M wheels for any one sdist, we provide a directory to cache them in, and then consult that directory when looking up cache hits. We only insert things into the cache if they have plausible version numbers, so ...
[ "Return", "a", "directory", "to", "store", "cached", "wheels", "for", "link" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/cache.py#L132-L151
25,386
pypa/pipenv
pipenv/vendor/passa/internals/dependencies.py
_get_dependencies_from_cache
def _get_dependencies_from_cache(ireq): """Retrieves dependencies for the requirement from the dependency cache. """ if os.environ.get("PASSA_IGNORE_LOCAL_CACHE"): return if ireq.editable: return try: deps = DEPENDENCY_CACHE[ireq] pyrq = REQUIRES_PYTHON_CACHE[ireq] ...
python
def _get_dependencies_from_cache(ireq): """Retrieves dependencies for the requirement from the dependency cache. """ if os.environ.get("PASSA_IGNORE_LOCAL_CACHE"): return if ireq.editable: return try: deps = DEPENDENCY_CACHE[ireq] pyrq = REQUIRES_PYTHON_CACHE[ireq] ...
[ "def", "_get_dependencies_from_cache", "(", "ireq", ")", ":", "if", "os", ".", "environ", ".", "get", "(", "\"PASSA_IGNORE_LOCAL_CACHE\"", ")", ":", "return", "if", "ireq", ".", "editable", ":", "return", "try", ":", "deps", "=", "DEPENDENCY_CACHE", "[", "ir...
Retrieves dependencies for the requirement from the dependency cache.
[ "Retrieves", "dependencies", "for", "the", "requirement", "from", "the", "dependency", "cache", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/passa/internals/dependencies.py#L49-L80
25,387
pypa/pipenv
pipenv/vendor/passa/internals/dependencies.py
_get_dependencies_from_json
def _get_dependencies_from_json(ireq, sources): """Retrieves dependencies for the install requirement from the JSON API. :param ireq: A single InstallRequirement :type ireq: :class:`~pip._internal.req.req_install.InstallRequirement` :return: A set of dependency lines for generating new InstallRequireme...
python
def _get_dependencies_from_json(ireq, sources): """Retrieves dependencies for the install requirement from the JSON API. :param ireq: A single InstallRequirement :type ireq: :class:`~pip._internal.req.req_install.InstallRequirement` :return: A set of dependency lines for generating new InstallRequireme...
[ "def", "_get_dependencies_from_json", "(", "ireq", ",", "sources", ")", ":", "if", "os", ".", "environ", ".", "get", "(", "\"PASSA_IGNORE_JSON_API\"", ")", ":", "return", "# It is technically possible to parse extras out of the JSON API's", "# requirement format, but it is su...
Retrieves dependencies for the install requirement from the JSON API. :param ireq: A single InstallRequirement :type ireq: :class:`~pip._internal.req.req_install.InstallRequirement` :return: A set of dependency lines for generating new InstallRequirements. :rtype: set(str) or None
[ "Retrieves", "dependencies", "for", "the", "install", "requirement", "from", "the", "JSON", "API", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/passa/internals/dependencies.py#L113-L158
25,388
pypa/pipenv
pipenv/vendor/passa/internals/dependencies.py
_read_requirements
def _read_requirements(metadata, extras): """Read wheel metadata to know what it depends on. The `run_requires` attribute contains a list of dict or str specifying requirements. For dicts, it may contain an "extra" key to specify these requirements are for a specific extra. Unfortunately, not all field...
python
def _read_requirements(metadata, extras): """Read wheel metadata to know what it depends on. The `run_requires` attribute contains a list of dict or str specifying requirements. For dicts, it may contain an "extra" key to specify these requirements are for a specific extra. Unfortunately, not all field...
[ "def", "_read_requirements", "(", "metadata", ",", "extras", ")", ":", "extras", "=", "extras", "or", "(", ")", "requirements", "=", "[", "]", "for", "entry", "in", "metadata", ".", "run_requires", ":", "if", "isinstance", "(", "entry", ",", "six", ".", ...
Read wheel metadata to know what it depends on. The `run_requires` attribute contains a list of dict or str specifying requirements. For dicts, it may contain an "extra" key to specify these requirements are for a specific extra. Unfortunately, not all fields are specificed like this (I don't know why)...
[ "Read", "wheel", "metadata", "to", "know", "what", "it", "depends", "on", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/passa/internals/dependencies.py#L161-L194
25,389
pypa/pipenv
pipenv/vendor/passa/internals/dependencies.py
_read_requires_python
def _read_requires_python(metadata): """Read wheel metadata to know the value of Requires-Python. This is surprisingly poorly supported in Distlib. This function tries several ways to get this information: * Metadata 2.0: metadata.dictionary.get("requires_python") is not None * Metadata 2.1: metad...
python
def _read_requires_python(metadata): """Read wheel metadata to know the value of Requires-Python. This is surprisingly poorly supported in Distlib. This function tries several ways to get this information: * Metadata 2.0: metadata.dictionary.get("requires_python") is not None * Metadata 2.1: metad...
[ "def", "_read_requires_python", "(", "metadata", ")", ":", "# TODO: Support more metadata formats.", "value", "=", "metadata", ".", "dictionary", ".", "get", "(", "\"requires_python\"", ")", "if", "value", "is", "not", "None", ":", "return", "value", "if", "metada...
Read wheel metadata to know the value of Requires-Python. This is surprisingly poorly supported in Distlib. This function tries several ways to get this information: * Metadata 2.0: metadata.dictionary.get("requires_python") is not None * Metadata 2.1: metadata._legacy.get("Requires-Python") is not No...
[ "Read", "wheel", "metadata", "to", "know", "the", "value", "of", "Requires", "-", "Python", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/passa/internals/dependencies.py#L197-L215
25,390
pypa/pipenv
pipenv/vendor/passa/internals/dependencies.py
_get_dependencies_from_pip
def _get_dependencies_from_pip(ireq, sources): """Retrieves dependencies for the requirement from pipenv.patched.notpip internals. The current strategy is to try the followings in order, returning the first successful result. 1. Try to build a wheel out of the ireq, and read metadata out of it. 2....
python
def _get_dependencies_from_pip(ireq, sources): """Retrieves dependencies for the requirement from pipenv.patched.notpip internals. The current strategy is to try the followings in order, returning the first successful result. 1. Try to build a wheel out of the ireq, and read metadata out of it. 2....
[ "def", "_get_dependencies_from_pip", "(", "ireq", ",", "sources", ")", ":", "extras", "=", "ireq", ".", "extras", "or", "(", ")", "try", ":", "wheel", "=", "build_wheel", "(", "ireq", ",", "sources", ")", "except", "WheelBuildError", ":", "# XXX: This depend...
Retrieves dependencies for the requirement from pipenv.patched.notpip internals. The current strategy is to try the followings in order, returning the first successful result. 1. Try to build a wheel out of the ireq, and read metadata out of it. 2. Read metadata out of the egg-info directory if it is ...
[ "Retrieves", "dependencies", "for", "the", "requirement", "from", "pipenv", ".", "patched", ".", "notpip", "internals", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/passa/internals/dependencies.py#L218-L242
25,391
pypa/pipenv
pipenv/vendor/urllib3/fields.py
format_header_param
def format_header_param(name, value): """ Helper function to format and quote a single header parameter. Particularly useful for header parameters which might contain non-ASCII values, like file names. This follows RFC 2231, as suggested by RFC 2388 Section 4.4. :param name: The name o...
python
def format_header_param(name, value): """ Helper function to format and quote a single header parameter. Particularly useful for header parameters which might contain non-ASCII values, like file names. This follows RFC 2231, as suggested by RFC 2388 Section 4.4. :param name: The name o...
[ "def", "format_header_param", "(", "name", ",", "value", ")", ":", "if", "not", "any", "(", "ch", "in", "value", "for", "ch", "in", "'\"\\\\\\r\\n'", ")", ":", "result", "=", "'%s=\"%s\"'", "%", "(", "name", ",", "value", ")", "try", ":", "result", "...
Helper function to format and quote a single header parameter. Particularly useful for header parameters which might contain non-ASCII values, like file names. This follows RFC 2231, as suggested by RFC 2388 Section 4.4. :param name: The name of the parameter, a string expected to be ASCII onl...
[ "Helper", "function", "to", "format", "and", "quote", "a", "single", "header", "parameter", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/fields.py#L22-L47
25,392
pypa/pipenv
pipenv/vendor/urllib3/fields.py
RequestField._render_parts
def _render_parts(self, header_parts): """ Helper function to format and quote a single header. Useful for single headers that are composed of multiple items. E.g., 'Content-Disposition' fields. :param header_parts: A sequence of (k, v) tuples or a :class:`dict` of ...
python
def _render_parts(self, header_parts): """ Helper function to format and quote a single header. Useful for single headers that are composed of multiple items. E.g., 'Content-Disposition' fields. :param header_parts: A sequence of (k, v) tuples or a :class:`dict` of ...
[ "def", "_render_parts", "(", "self", ",", "header_parts", ")", ":", "parts", "=", "[", "]", "iterable", "=", "header_parts", "if", "isinstance", "(", "header_parts", ",", "dict", ")", ":", "iterable", "=", "header_parts", ".", "items", "(", ")", "for", "...
Helper function to format and quote a single header. Useful for single headers that are composed of multiple items. E.g., 'Content-Disposition' fields. :param header_parts: A sequence of (k, v) tuples or a :class:`dict` of (k, v) to format as `k1="v1"; k2="v2"; ...`.
[ "Helper", "function", "to", "format", "and", "quote", "a", "single", "header", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/fields.py#L116-L136
25,393
pypa/pipenv
pipenv/vendor/urllib3/fields.py
RequestField.render_headers
def render_headers(self): """ Renders the headers for this request field. """ lines = [] sort_keys = ['Content-Disposition', 'Content-Type', 'Content-Location'] for sort_key in sort_keys: if self.headers.get(sort_key, False): lines.append('%s:...
python
def render_headers(self): """ Renders the headers for this request field. """ lines = [] sort_keys = ['Content-Disposition', 'Content-Type', 'Content-Location'] for sort_key in sort_keys: if self.headers.get(sort_key, False): lines.append('%s:...
[ "def", "render_headers", "(", "self", ")", ":", "lines", "=", "[", "]", "sort_keys", "=", "[", "'Content-Disposition'", ",", "'Content-Type'", ",", "'Content-Location'", "]", "for", "sort_key", "in", "sort_keys", ":", "if", "self", ".", "headers", ".", "get"...
Renders the headers for this request field.
[ "Renders", "the", "headers", "for", "this", "request", "field", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/fields.py#L138-L155
25,394
pypa/pipenv
pipenv/vendor/urllib3/fields.py
RequestField.make_multipart
def make_multipart(self, content_disposition=None, content_type=None, content_location=None): """ Makes this request field into a multipart request field. This method overrides "Content-Disposition", "Content-Type" and "Content-Location" headers to the request par...
python
def make_multipart(self, content_disposition=None, content_type=None, content_location=None): """ Makes this request field into a multipart request field. This method overrides "Content-Disposition", "Content-Type" and "Content-Location" headers to the request par...
[ "def", "make_multipart", "(", "self", ",", "content_disposition", "=", "None", ",", "content_type", "=", "None", ",", "content_location", "=", "None", ")", ":", "self", ".", "headers", "[", "'Content-Disposition'", "]", "=", "content_disposition", "or", "'form-d...
Makes this request field into a multipart request field. This method overrides "Content-Disposition", "Content-Type" and "Content-Location" headers to the request parameter. :param content_type: The 'Content-Type' of the request body. :param content_location: Th...
[ "Makes", "this", "request", "field", "into", "a", "multipart", "request", "field", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/fields.py#L157-L178
25,395
pypa/pipenv
pipenv/patched/notpip/_vendor/html5lib/treewalkers/base.py
TreeWalker.emptyTag
def emptyTag(self, namespace, name, attrs, hasChildren=False): """Generates an EmptyTag token :arg namespace: the namespace of the token--can be ``None`` :arg name: the name of the element :arg attrs: the attributes of the element as a dict :arg hasChildren: whether or not to...
python
def emptyTag(self, namespace, name, attrs, hasChildren=False): """Generates an EmptyTag token :arg namespace: the namespace of the token--can be ``None`` :arg name: the name of the element :arg attrs: the attributes of the element as a dict :arg hasChildren: whether or not to...
[ "def", "emptyTag", "(", "self", ",", "namespace", ",", "name", ",", "attrs", ",", "hasChildren", "=", "False", ")", ":", "yield", "{", "\"type\"", ":", "\"EmptyTag\"", ",", "\"name\"", ":", "name", ",", "\"namespace\"", ":", "namespace", ",", "\"data\"", ...
Generates an EmptyTag token :arg namespace: the namespace of the token--can be ``None`` :arg name: the name of the element :arg attrs: the attributes of the element as a dict :arg hasChildren: whether or not to yield a SerializationError because this tag shouldn't have ch...
[ "Generates", "an", "EmptyTag", "token" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_vendor/html5lib/treewalkers/base.py#L48-L67
25,396
pypa/pipenv
pipenv/patched/notpip/_vendor/html5lib/treewalkers/base.py
TreeWalker.text
def text(self, data): """Generates SpaceCharacters and Characters tokens Depending on what's in the data, this generates one or more ``SpaceCharacters`` and ``Characters`` tokens. For example: >>> from html5lib.treewalkers.base import TreeWalker >>> # Give it a...
python
def text(self, data): """Generates SpaceCharacters and Characters tokens Depending on what's in the data, this generates one or more ``SpaceCharacters`` and ``Characters`` tokens. For example: >>> from html5lib.treewalkers.base import TreeWalker >>> # Give it a...
[ "def", "text", "(", "self", ",", "data", ")", ":", "data", "=", "data", "middle", "=", "data", ".", "lstrip", "(", "spaceCharacters", ")", "left", "=", "data", "[", ":", "len", "(", "data", ")", "-", "len", "(", "middle", ")", "]", "if", "left", ...
Generates SpaceCharacters and Characters tokens Depending on what's in the data, this generates one or more ``SpaceCharacters`` and ``Characters`` tokens. For example: >>> from html5lib.treewalkers.base import TreeWalker >>> # Give it an empty tree just so it instantia...
[ "Generates", "SpaceCharacters", "and", "Characters", "tokens" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_vendor/html5lib/treewalkers/base.py#L100-L136
25,397
pypa/pipenv
pipenv/shells.py
_get_activate_script
def _get_activate_script(cmd, venv): """Returns the string to activate a virtualenv. This is POSIX-only at the moment since the compat (pexpect-based) shell does not work elsewhere anyway. """ # Suffix and source command for other shells. # Support for fish shell. if "fish" in cmd: ...
python
def _get_activate_script(cmd, venv): """Returns the string to activate a virtualenv. This is POSIX-only at the moment since the compat (pexpect-based) shell does not work elsewhere anyway. """ # Suffix and source command for other shells. # Support for fish shell. if "fish" in cmd: ...
[ "def", "_get_activate_script", "(", "cmd", ",", "venv", ")", ":", "# Suffix and source command for other shells.", "# Support for fish shell.", "if", "\"fish\"", "in", "cmd", ":", "suffix", "=", "\".fish\"", "command", "=", "\"source\"", "# Support for csh shell.", "elif"...
Returns the string to activate a virtualenv. This is POSIX-only at the moment since the compat (pexpect-based) shell does not work elsewhere anyway.
[ "Returns", "the", "string", "to", "activate", "a", "virtualenv", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/shells.py#L32-L54
25,398
pypa/pipenv
pipenv/vendor/distlib/wheel.py
Wheel.filename
def filename(self): """ Build and return a filename from the various components. """ if self.buildver: buildver = '-' + self.buildver else: buildver = '' pyver = '.'.join(self.pyver) abi = '.'.join(self.abi) arch = '.'.join(self.arc...
python
def filename(self): """ Build and return a filename from the various components. """ if self.buildver: buildver = '-' + self.buildver else: buildver = '' pyver = '.'.join(self.pyver) abi = '.'.join(self.abi) arch = '.'.join(self.arc...
[ "def", "filename", "(", "self", ")", ":", "if", "self", ".", "buildver", ":", "buildver", "=", "'-'", "+", "self", ".", "buildver", "else", ":", "buildver", "=", "''", "pyver", "=", "'.'", ".", "join", "(", "self", ".", "pyver", ")", "abi", "=", ...
Build and return a filename from the various components.
[ "Build", "and", "return", "a", "filename", "from", "the", "various", "components", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/wheel.py#L186-L200
25,399
pypa/pipenv
pipenv/core.py
add_to_path
def add_to_path(p): """Adds a given path to the PATH.""" if p not in os.environ["PATH"]: os.environ["PATH"] = "{0}{1}{2}".format(p, os.pathsep, os.environ["PATH"])
python
def add_to_path(p): """Adds a given path to the PATH.""" if p not in os.environ["PATH"]: os.environ["PATH"] = "{0}{1}{2}".format(p, os.pathsep, os.environ["PATH"])
[ "def", "add_to_path", "(", "p", ")", ":", "if", "p", "not", "in", "os", ".", "environ", "[", "\"PATH\"", "]", ":", "os", ".", "environ", "[", "\"PATH\"", "]", "=", "\"{0}{1}{2}\"", ".", "format", "(", "p", ",", "os", ".", "pathsep", ",", "os", "....
Adds a given path to the PATH.
[ "Adds", "a", "given", "path", "to", "the", "PATH", "." ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/core.py#L159-L162