partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
Expecter.expect_loop
Blocking expect
pipenv/vendor/pexpect/expect.py
def expect_loop(self, timeout=-1): """Blocking expect""" spawn = self.spawn if timeout is not None: end_time = time.time() + timeout try: incoming = spawn.buffer spawn._buffer = spawn.buffer_type() spawn._before = spawn.buffer_type() ...
def expect_loop(self, timeout=-1): """Blocking expect""" spawn = self.spawn if timeout is not None: end_time = time.time() + timeout try: incoming = spawn.buffer spawn._buffer = spawn.buffer_type() spawn._before = spawn.buffer_type() ...
[ "Blocking", "expect" ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/expect.py#L91-L122
[ "def", "expect_loop", "(", "self", ",", "timeout", "=", "-", "1", ")", ":", "spawn", "=", "self", ".", "spawn", "if", "timeout", "is", "not", "None", ":", "end_time", "=", "time", ".", "time", "(", ")", "+", "timeout", "try", ":", "incoming", "=", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
HTTPHeaderDict.add
Adds a (name, value) pair, doesn't overwrite the value if it already exists. >>> headers = HTTPHeaderDict(foo='bar') >>> headers.add('Foo', 'baz') >>> headers['foo'] 'bar, baz'
pipenv/vendor/urllib3/_collections.py
def add(self, key, val): """Adds a (name, value) pair, doesn't overwrite the value if it already exists. >>> headers = HTTPHeaderDict(foo='bar') >>> headers.add('Foo', 'baz') >>> headers['foo'] 'bar, baz' """ key_lower = key.lower() new_vals = [ke...
def add(self, key, val): """Adds a (name, value) pair, doesn't overwrite the value if it already exists. >>> headers = HTTPHeaderDict(foo='bar') >>> headers.add('Foo', 'baz') >>> headers['foo'] 'bar, baz' """ key_lower = key.lower() new_vals = [ke...
[ "Adds", "a", "(", "name", "value", ")", "pair", "doesn", "t", "overwrite", "the", "value", "if", "it", "already", "exists", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/_collections.py#L209-L223
[ "def", "add", "(", "self", ",", "key", ",", "val", ")", ":", "key_lower", "=", "key", ".", "lower", "(", ")", "new_vals", "=", "[", "key", ",", "val", "]", "# Keep the common case aka no item present as fast as possible", "vals", "=", "self", ".", "_containe...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
HTTPHeaderDict.extend
Generic import function for any type of header-like object. Adapted version of MutableMapping.update in order to insert items with self.add instead of self.__setitem__
pipenv/vendor/urllib3/_collections.py
def extend(self, *args, **kwargs): """Generic import function for any type of header-like object. Adapted version of MutableMapping.update in order to insert items with self.add instead of self.__setitem__ """ if len(args) > 1: raise TypeError("extend() takes at most ...
def extend(self, *args, **kwargs): """Generic import function for any type of header-like object. Adapted version of MutableMapping.update in order to insert items with self.add instead of self.__setitem__ """ if len(args) > 1: raise TypeError("extend() takes at most ...
[ "Generic", "import", "function", "for", "any", "type", "of", "header", "-", "like", "object", ".", "Adapted", "version", "of", "MutableMapping", ".", "update", "in", "order", "to", "insert", "items", "with", "self", ".", "add", "instead", "of", "self", "."...
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/_collections.py#L225-L249
[ "def", "extend", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "len", "(", "args", ")", ">", "1", ":", "raise", "TypeError", "(", "\"extend() takes at most 1 positional \"", "\"arguments ({0} given)\"", ".", "format", "(", "len", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
HTTPHeaderDict.getlist
Returns a list of all the values for the named field. Returns an empty list if the key doesn't exist.
pipenv/vendor/urllib3/_collections.py
def getlist(self, key, default=__marker): """Returns a list of all the values for the named field. Returns an empty list if the key doesn't exist.""" try: vals = self._container[key.lower()] except KeyError: if default is self.__marker: return [] ...
def getlist(self, key, default=__marker): """Returns a list of all the values for the named field. Returns an empty list if the key doesn't exist.""" try: vals = self._container[key.lower()] except KeyError: if default is self.__marker: return [] ...
[ "Returns", "a", "list", "of", "all", "the", "values", "for", "the", "named", "field", ".", "Returns", "an", "empty", "list", "if", "the", "key", "doesn", "t", "exist", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/_collections.py#L251-L261
[ "def", "getlist", "(", "self", ",", "key", ",", "default", "=", "__marker", ")", ":", "try", ":", "vals", "=", "self", ".", "_container", "[", "key", ".", "lower", "(", ")", "]", "except", "KeyError", ":", "if", "default", "is", "self", ".", "__mar...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
HTTPHeaderDict.iteritems
Iterate over all header lines, including duplicate ones.
pipenv/vendor/urllib3/_collections.py
def iteritems(self): """Iterate over all header lines, including duplicate ones.""" for key in self: vals = self._container[key.lower()] for val in vals[1:]: yield vals[0], val
def iteritems(self): """Iterate over all header lines, including duplicate ones.""" for key in self: vals = self._container[key.lower()] for val in vals[1:]: yield vals[0], val
[ "Iterate", "over", "all", "header", "lines", "including", "duplicate", "ones", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/_collections.py#L287-L292
[ "def", "iteritems", "(", "self", ")", ":", "for", "key", "in", "self", ":", "vals", "=", "self", ".", "_container", "[", "key", ".", "lower", "(", ")", "]", "for", "val", "in", "vals", "[", "1", ":", "]", ":", "yield", "vals", "[", "0", "]", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
HTTPHeaderDict.itermerged
Iterate over all headers, merging duplicate ones together.
pipenv/vendor/urllib3/_collections.py
def itermerged(self): """Iterate over all headers, merging duplicate ones together.""" for key in self: val = self._container[key.lower()] yield val[0], ', '.join(val[1:])
def itermerged(self): """Iterate over all headers, merging duplicate ones together.""" for key in self: val = self._container[key.lower()] yield val[0], ', '.join(val[1:])
[ "Iterate", "over", "all", "headers", "merging", "duplicate", "ones", "together", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/_collections.py#L294-L298
[ "def", "itermerged", "(", "self", ")", ":", "for", "key", "in", "self", ":", "val", "=", "self", ".", "_container", "[", "key", ".", "lower", "(", ")", "]", "yield", "val", "[", "0", "]", ",", "', '", ".", "join", "(", "val", "[", "1", ":", "...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
HTTPHeaderDict.from_httplib
Read headers from a Python 2 httplib message object.
pipenv/vendor/urllib3/_collections.py
def from_httplib(cls, message): # Python 2 """Read headers from a Python 2 httplib message object.""" # python2.7 does not expose a proper API for exporting multiheaders # efficiently. This function re-reads raw lines from the message # object and extracts the multiheaders properly. ...
def from_httplib(cls, message): # Python 2 """Read headers from a Python 2 httplib message object.""" # python2.7 does not expose a proper API for exporting multiheaders # efficiently. This function re-reads raw lines from the message # object and extracts the multiheaders properly. ...
[ "Read", "headers", "from", "a", "Python", "2", "httplib", "message", "object", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/_collections.py#L304-L329
[ "def", "from_httplib", "(", "cls", ",", "message", ")", ":", "# Python 2", "# python2.7 does not expose a proper API for exporting multiheaders", "# efficiently. This function re-reads raw lines from the message", "# object and extracts the multiheaders properly.", "obs_fold_continued_leader...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
extract_cookies_to_jar
Extract the cookies from the response into a CookieJar. :param jar: cookielib.CookieJar (not necessarily a RequestsCookieJar) :param request: our own requests.Request object :param response: urllib3.HTTPResponse object
pipenv/vendor/requests/cookies.py
def extract_cookies_to_jar(jar, request, response): """Extract the cookies from the response into a CookieJar. :param jar: cookielib.CookieJar (not necessarily a RequestsCookieJar) :param request: our own requests.Request object :param response: urllib3.HTTPResponse object """ if not (hasattr(r...
def extract_cookies_to_jar(jar, request, response): """Extract the cookies from the response into a CookieJar. :param jar: cookielib.CookieJar (not necessarily a RequestsCookieJar) :param request: our own requests.Request object :param response: urllib3.HTTPResponse object """ if not (hasattr(r...
[ "Extract", "the", "cookies", "from", "the", "response", "into", "a", "CookieJar", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L118-L132
[ "def", "extract_cookies_to_jar", "(", "jar", ",", "request", ",", "response", ")", ":", "if", "not", "(", "hasattr", "(", "response", ",", "'_original_response'", ")", "and", "response", ".", "_original_response", ")", ":", "return", "# the _original_response fiel...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
get_cookie_header
Produce an appropriate Cookie header string to be sent with `request`, or None. :rtype: str
pipenv/vendor/requests/cookies.py
def get_cookie_header(jar, request): """ Produce an appropriate Cookie header string to be sent with `request`, or None. :rtype: str """ r = MockRequest(request) jar.add_cookie_header(r) return r.get_new_headers().get('Cookie')
def get_cookie_header(jar, request): """ Produce an appropriate Cookie header string to be sent with `request`, or None. :rtype: str """ r = MockRequest(request) jar.add_cookie_header(r) return r.get_new_headers().get('Cookie')
[ "Produce", "an", "appropriate", "Cookie", "header", "string", "to", "be", "sent", "with", "request", "or", "None", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L135-L143
[ "def", "get_cookie_header", "(", "jar", ",", "request", ")", ":", "r", "=", "MockRequest", "(", "request", ")", "jar", ".", "add_cookie_header", "(", "r", ")", "return", "r", ".", "get_new_headers", "(", ")", ".", "get", "(", "'Cookie'", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
remove_cookie_by_name
Unsets a cookie by name, by default over all domains and paths. Wraps CookieJar.clear(), is O(n).
pipenv/vendor/requests/cookies.py
def remove_cookie_by_name(cookiejar, name, domain=None, path=None): """Unsets a cookie by name, by default over all domains and paths. Wraps CookieJar.clear(), is O(n). """ clearables = [] for cookie in cookiejar: if cookie.name != name: continue if domain is not None an...
def remove_cookie_by_name(cookiejar, name, domain=None, path=None): """Unsets a cookie by name, by default over all domains and paths. Wraps CookieJar.clear(), is O(n). """ clearables = [] for cookie in cookiejar: if cookie.name != name: continue if domain is not None an...
[ "Unsets", "a", "cookie", "by", "name", "by", "default", "over", "all", "domains", "and", "paths", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L146-L162
[ "def", "remove_cookie_by_name", "(", "cookiejar", ",", "name", ",", "domain", "=", "None", ",", "path", "=", "None", ")", ":", "clearables", "=", "[", "]", "for", "cookie", "in", "cookiejar", ":", "if", "cookie", ".", "name", "!=", "name", ":", "contin...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
create_cookie
Make a cookie from underspecified parameters. By default, the pair of `name` and `value` will be set for the domain '' and sent on every request (this is sometimes called a "supercookie").
pipenv/vendor/requests/cookies.py
def create_cookie(name, value, **kwargs): """Make a cookie from underspecified parameters. By default, the pair of `name` and `value` will be set for the domain '' and sent on every request (this is sometimes called a "supercookie"). """ result = { 'version': 0, 'name': name, ...
def create_cookie(name, value, **kwargs): """Make a cookie from underspecified parameters. By default, the pair of `name` and `value` will be set for the domain '' and sent on every request (this is sometimes called a "supercookie"). """ result = { 'version': 0, 'name': name, ...
[ "Make", "a", "cookie", "from", "underspecified", "parameters", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L441-L474
[ "def", "create_cookie", "(", "name", ",", "value", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "'version'", ":", "0", ",", "'name'", ":", "name", ",", "'value'", ":", "value", ",", "'port'", ":", "None", ",", "'domain'", ":", "''", ",", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
morsel_to_cookie
Convert a Morsel object into a Cookie containing the one k/v pair.
pipenv/vendor/requests/cookies.py
def morsel_to_cookie(morsel): """Convert a Morsel object into a Cookie containing the one k/v pair.""" expires = None if morsel['max-age']: try: expires = int(time.time() + int(morsel['max-age'])) except ValueError: raise TypeError('max-age: %s must be integer' % mor...
def morsel_to_cookie(morsel): """Convert a Morsel object into a Cookie containing the one k/v pair.""" expires = None if morsel['max-age']: try: expires = int(time.time() + int(morsel['max-age'])) except ValueError: raise TypeError('max-age: %s must be integer' % mor...
[ "Convert", "a", "Morsel", "object", "into", "a", "Cookie", "containing", "the", "one", "k", "/", "v", "pair", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L477-L505
[ "def", "morsel_to_cookie", "(", "morsel", ")", ":", "expires", "=", "None", "if", "morsel", "[", "'max-age'", "]", ":", "try", ":", "expires", "=", "int", "(", "time", ".", "time", "(", ")", "+", "int", "(", "morsel", "[", "'max-age'", "]", ")", ")...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
cookiejar_from_dict
Returns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not replace cookies already in the jar with new ones. :rtype: CookieJar
pipenv/vendor/requests/cookies.py
def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True): """Returns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not repl...
def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True): """Returns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not repl...
[ "Returns", "a", "CookieJar", "from", "a", "key", "/", "value", "dictionary", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L508-L526
[ "def", "cookiejar_from_dict", "(", "cookie_dict", ",", "cookiejar", "=", "None", ",", "overwrite", "=", "True", ")", ":", "if", "cookiejar", "is", "None", ":", "cookiejar", "=", "RequestsCookieJar", "(", ")", "if", "cookie_dict", "is", "not", "None", ":", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
merge_cookies
Add cookies to cookiejar and returns a merged CookieJar. :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. :rtype: CookieJar
pipenv/vendor/requests/cookies.py
def merge_cookies(cookiejar, cookies): """Add cookies to cookiejar and returns a merged CookieJar. :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. :rtype: CookieJar """ if not isinstance(cookiejar, cookielib.CookieJar): ...
def merge_cookies(cookiejar, cookies): """Add cookies to cookiejar and returns a merged CookieJar. :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. :rtype: CookieJar """ if not isinstance(cookiejar, cookielib.CookieJar): ...
[ "Add", "cookies", "to", "cookiejar", "and", "returns", "a", "merged", "CookieJar", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L529-L549
[ "def", "merge_cookies", "(", "cookiejar", ",", "cookies", ")", ":", "if", "not", "isinstance", "(", "cookiejar", ",", "cookielib", ".", "CookieJar", ")", ":", "raise", "ValueError", "(", "'You can only merge into CookieJar'", ")", "if", "isinstance", "(", "cooki...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
RequestsCookieJar.get
Dict-like get() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. .. warning:: operation is O(n), not O(1).
pipenv/vendor/requests/cookies.py
def get(self, name, default=None, domain=None, path=None): """Dict-like get() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. .. warning:: operation is O(n), not O(1). """ try: ...
def get(self, name, default=None, domain=None, path=None): """Dict-like get() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. .. warning:: operation is O(n), not O(1). """ try: ...
[ "Dict", "-", "like", "get", "()", "that", "also", "supports", "optional", "domain", "and", "path", "args", "in", "order", "to", "resolve", "naming", "collisions", "from", "using", "one", "cookie", "jar", "over", "multiple", "domains", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L189-L199
[ "def", "get", "(", "self", ",", "name", ",", "default", "=", "None", ",", "domain", "=", "None", ",", "path", "=", "None", ")", ":", "try", ":", "return", "self", ".", "_find_no_duplicates", "(", "name", ",", "domain", ",", "path", ")", "except", "...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
RequestsCookieJar.set
Dict-like set() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains.
pipenv/vendor/requests/cookies.py
def set(self, name, value, **kwargs): """Dict-like set() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. """ # support client code that unsets cookies by assignment of a None value: if...
def set(self, name, value, **kwargs): """Dict-like set() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. """ # support client code that unsets cookies by assignment of a None value: if...
[ "Dict", "-", "like", "set", "()", "that", "also", "supports", "optional", "domain", "and", "path", "args", "in", "order", "to", "resolve", "naming", "collisions", "from", "using", "one", "cookie", "jar", "over", "multiple", "domains", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L201-L216
[ "def", "set", "(", "self", ",", "name", ",", "value", ",", "*", "*", "kwargs", ")", ":", "# support client code that unsets cookies by assignment of a None value:", "if", "value", "is", "None", ":", "remove_cookie_by_name", "(", "self", ",", "name", ",", "domain",...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
RequestsCookieJar.list_domains
Utility method to list all the domains in the jar.
pipenv/vendor/requests/cookies.py
def list_domains(self): """Utility method to list all the domains in the jar.""" domains = [] for cookie in iter(self): if cookie.domain not in domains: domains.append(cookie.domain) return domains
def list_domains(self): """Utility method to list all the domains in the jar.""" domains = [] for cookie in iter(self): if cookie.domain not in domains: domains.append(cookie.domain) return domains
[ "Utility", "method", "to", "list", "all", "the", "domains", "in", "the", "jar", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L270-L276
[ "def", "list_domains", "(", "self", ")", ":", "domains", "=", "[", "]", "for", "cookie", "in", "iter", "(", "self", ")", ":", "if", "cookie", ".", "domain", "not", "in", "domains", ":", "domains", ".", "append", "(", "cookie", ".", "domain", ")", "...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
RequestsCookieJar.list_paths
Utility method to list all the paths in the jar.
pipenv/vendor/requests/cookies.py
def list_paths(self): """Utility method to list all the paths in the jar.""" paths = [] for cookie in iter(self): if cookie.path not in paths: paths.append(cookie.path) return paths
def list_paths(self): """Utility method to list all the paths in the jar.""" paths = [] for cookie in iter(self): if cookie.path not in paths: paths.append(cookie.path) return paths
[ "Utility", "method", "to", "list", "all", "the", "paths", "in", "the", "jar", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L278-L284
[ "def", "list_paths", "(", "self", ")", ":", "paths", "=", "[", "]", "for", "cookie", "in", "iter", "(", "self", ")", ":", "if", "cookie", ".", "path", "not", "in", "paths", ":", "paths", ".", "append", "(", "cookie", ".", "path", ")", "return", "...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
RequestsCookieJar.multiple_domains
Returns True if there are multiple domains in the jar. Returns False otherwise. :rtype: bool
pipenv/vendor/requests/cookies.py
def multiple_domains(self): """Returns True if there are multiple domains in the jar. Returns False otherwise. :rtype: bool """ domains = [] for cookie in iter(self): if cookie.domain is not None and cookie.domain in domains: return True ...
def multiple_domains(self): """Returns True if there are multiple domains in the jar. Returns False otherwise. :rtype: bool """ domains = [] for cookie in iter(self): if cookie.domain is not None and cookie.domain in domains: return True ...
[ "Returns", "True", "if", "there", "are", "multiple", "domains", "in", "the", "jar", ".", "Returns", "False", "otherwise", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L286-L297
[ "def", "multiple_domains", "(", "self", ")", ":", "domains", "=", "[", "]", "for", "cookie", "in", "iter", "(", "self", ")", ":", "if", "cookie", ".", "domain", "is", "not", "None", "and", "cookie", ".", "domain", "in", "domains", ":", "return", "Tru...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
RequestsCookieJar.update
Updates this jar with cookies from another CookieJar or dict-like
pipenv/vendor/requests/cookies.py
def update(self, other): """Updates this jar with cookies from another CookieJar or dict-like""" if isinstance(other, cookielib.CookieJar): for cookie in other: self.set_cookie(copy.copy(cookie)) else: super(RequestsCookieJar, self).update(other)
def update(self, other): """Updates this jar with cookies from another CookieJar or dict-like""" if isinstance(other, cookielib.CookieJar): for cookie in other: self.set_cookie(copy.copy(cookie)) else: super(RequestsCookieJar, self).update(other)
[ "Updates", "this", "jar", "with", "cookies", "from", "another", "CookieJar", "or", "dict", "-", "like" ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L348-L354
[ "def", "update", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "cookielib", ".", "CookieJar", ")", ":", "for", "cookie", "in", "other", ":", "self", ".", "set_cookie", "(", "copy", ".", "copy", "(", "cookie", ")", ")", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
RequestsCookieJar._find
Requests uses this method internally to get cookie values. If there are conflicting cookies, _find arbitrarily chooses one. See _find_no_duplicates if you want an exception thrown if there are conflicting cookies. :param name: a string containing name of cookie :param domain: (...
pipenv/vendor/requests/cookies.py
def _find(self, name, domain=None, path=None): """Requests uses this method internally to get cookie values. If there are conflicting cookies, _find arbitrarily chooses one. See _find_no_duplicates if you want an exception thrown if there are conflicting cookies. :param name: a...
def _find(self, name, domain=None, path=None): """Requests uses this method internally to get cookie values. If there are conflicting cookies, _find arbitrarily chooses one. See _find_no_duplicates if you want an exception thrown if there are conflicting cookies. :param name: a...
[ "Requests", "uses", "this", "method", "internally", "to", "get", "cookie", "values", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L356-L374
[ "def", "_find", "(", "self", ",", "name", ",", "domain", "=", "None", ",", "path", "=", "None", ")", ":", "for", "cookie", "in", "iter", "(", "self", ")", ":", "if", "cookie", ".", "name", "==", "name", ":", "if", "domain", "is", "None", "or", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
RequestsCookieJar._find_no_duplicates
Both ``__get_item__`` and ``get`` call this function: it's never used elsewhere in Requests. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: (optional) string containing path of cookie :raises KeyError: if...
pipenv/vendor/requests/cookies.py
def _find_no_duplicates(self, name, domain=None, path=None): """Both ``__get_item__`` and ``get`` call this function: it's never used elsewhere in Requests. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: ...
def _find_no_duplicates(self, name, domain=None, path=None): """Both ``__get_item__`` and ``get`` call this function: it's never used elsewhere in Requests. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: ...
[ "Both", "__get_item__", "and", "get", "call", "this", "function", ":", "it", "s", "never", "used", "elsewhere", "in", "Requests", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L376-L399
[ "def", "_find_no_duplicates", "(", "self", ",", "name", ",", "domain", "=", "None", ",", "path", "=", "None", ")", ":", "toReturn", "=", "None", "for", "cookie", "in", "iter", "(", "self", ")", ":", "if", "cookie", ".", "name", "==", "name", ":", "...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
RequestsCookieJar.copy
Return a copy of this RequestsCookieJar.
pipenv/vendor/requests/cookies.py
def copy(self): """Return a copy of this RequestsCookieJar.""" new_cj = RequestsCookieJar() new_cj.set_policy(self.get_policy()) new_cj.update(self) return new_cj
def copy(self): """Return a copy of this RequestsCookieJar.""" new_cj = RequestsCookieJar() new_cj.set_policy(self.get_policy()) new_cj.update(self) return new_cj
[ "Return", "a", "copy", "of", "this", "RequestsCookieJar", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/cookies.py#L414-L419
[ "def", "copy", "(", "self", ")", ":", "new_cj", "=", "RequestsCookieJar", "(", ")", "new_cj", ".", "set_policy", "(", "self", ".", "get_policy", "(", ")", ")", "new_cj", ".", "update", "(", "self", ")", "return", "new_cj" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
constrain
This returns a number, n constrained to the min and max bounds.
pipenv/vendor/pexpect/screen.py
def constrain (n, min, max): '''This returns a number, n constrained to the min and max bounds. ''' if n < min: return min if n > max: return max return n
def constrain (n, min, max): '''This returns a number, n constrained to the min and max bounds. ''' if n < min: return min if n > max: return max return n
[ "This", "returns", "a", "number", "n", "constrained", "to", "the", "min", "and", "max", "bounds", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L60-L68
[ "def", "constrain", "(", "n", ",", "min", ",", "max", ")", ":", "if", "n", "<", "min", ":", "return", "min", "if", "n", ">", "max", ":", "return", "max", "return", "n" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen._decode
This converts from the external coding system (as passed to the constructor) to the internal one (unicode).
pipenv/vendor/pexpect/screen.py
def _decode(self, s): '''This converts from the external coding system (as passed to the constructor) to the internal one (unicode). ''' if self.decoder is not None: return self.decoder.decode(s) else: raise TypeError("This screen was constructed with encoding=Non...
def _decode(self, s): '''This converts from the external coding system (as passed to the constructor) to the internal one (unicode). ''' if self.decoder is not None: return self.decoder.decode(s) else: raise TypeError("This screen was constructed with encoding=Non...
[ "This", "converts", "from", "the", "external", "coding", "system", "(", "as", "passed", "to", "the", "constructor", ")", "to", "the", "internal", "one", "(", "unicode", ")", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L104-L111
[ "def", "_decode", "(", "self", ",", "s", ")", ":", "if", "self", ".", "decoder", "is", "not", "None", ":", "return", "self", ".", "decoder", ".", "decode", "(", "s", ")", "else", ":", "raise", "TypeError", "(", "\"This screen was constructed with encoding=...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen._unicode
This returns a printable representation of the screen as a unicode string (which, under Python 3.x, is the same as 'str'). The end of each screen line is terminated by a newline.
pipenv/vendor/pexpect/screen.py
def _unicode(self): '''This returns a printable representation of the screen as a unicode string (which, under Python 3.x, is the same as 'str'). The end of each screen line is terminated by a newline.''' return u'\n'.join ([ u''.join(c) for c in self.w ])
def _unicode(self): '''This returns a printable representation of the screen as a unicode string (which, under Python 3.x, is the same as 'str'). The end of each screen line is terminated by a newline.''' return u'\n'.join ([ u''.join(c) for c in self.w ])
[ "This", "returns", "a", "printable", "representation", "of", "the", "screen", "as", "a", "unicode", "string", "(", "which", "under", "Python", "3", ".", "x", "is", "the", "same", "as", "str", ")", ".", "The", "end", "of", "each", "screen", "line", "is"...
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L113-L118
[ "def", "_unicode", "(", "self", ")", ":", "return", "u'\\n'", ".", "join", "(", "[", "u''", ".", "join", "(", "c", ")", "for", "c", "in", "self", ".", "w", "]", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.dump
This returns a copy of the screen as a unicode string. This is similar to __str__/__unicode__ except that lines are not terminated with line feeds.
pipenv/vendor/pexpect/screen.py
def dump (self): '''This returns a copy of the screen as a unicode string. This is similar to __str__/__unicode__ except that lines are not terminated with line feeds.''' return u''.join ([ u''.join(c) for c in self.w ])
def dump (self): '''This returns a copy of the screen as a unicode string. This is similar to __str__/__unicode__ except that lines are not terminated with line feeds.''' return u''.join ([ u''.join(c) for c in self.w ])
[ "This", "returns", "a", "copy", "of", "the", "screen", "as", "a", "unicode", "string", ".", "This", "is", "similar", "to", "__str__", "/", "__unicode__", "except", "that", "lines", "are", "not", "terminated", "with", "line", "feeds", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L131-L136
[ "def", "dump", "(", "self", ")", ":", "return", "u''", ".", "join", "(", "[", "u''", ".", "join", "(", "c", ")", "for", "c", "in", "self", ".", "w", "]", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.pretty
This returns a copy of the screen as a unicode string with an ASCII text box around the screen border. This is similar to __str__/__unicode__ except that it adds a box.
pipenv/vendor/pexpect/screen.py
def pretty (self): '''This returns a copy of the screen as a unicode string with an ASCII text box around the screen border. This is similar to __str__/__unicode__ except that it adds a box.''' top_bot = u'+' + u'-'*self.cols + u'+\n' return top_bot + u'\n'.join([u'|'+line+u'|' ...
def pretty (self): '''This returns a copy of the screen as a unicode string with an ASCII text box around the screen border. This is similar to __str__/__unicode__ except that it adds a box.''' top_bot = u'+' + u'-'*self.cols + u'+\n' return top_bot + u'\n'.join([u'|'+line+u'|' ...
[ "This", "returns", "a", "copy", "of", "the", "screen", "as", "a", "unicode", "string", "with", "an", "ASCII", "text", "box", "around", "the", "screen", "border", ".", "This", "is", "similar", "to", "__str__", "/", "__unicode__", "except", "that", "it", "...
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L138-L144
[ "def", "pretty", "(", "self", ")", ":", "top_bot", "=", "u'+'", "+", "u'-'", "*", "self", ".", "cols", "+", "u'+\\n'", "return", "top_bot", "+", "u'\\n'", ".", "join", "(", "[", "u'|'", "+", "line", "+", "u'|'", "for", "line", "in", "unicode", "(",...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.lf
This moves the cursor down with scrolling.
pipenv/vendor/pexpect/screen.py
def lf (self): '''This moves the cursor down with scrolling. ''' old_r = self.cur_r self.cursor_down() if old_r == self.cur_r: self.scroll_up () self.erase_line()
def lf (self): '''This moves the cursor down with scrolling. ''' old_r = self.cur_r self.cursor_down() if old_r == self.cur_r: self.scroll_up () self.erase_line()
[ "This", "moves", "the", "cursor", "down", "with", "scrolling", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L176-L184
[ "def", "lf", "(", "self", ")", ":", "old_r", "=", "self", ".", "cur_r", "self", ".", "cursor_down", "(", ")", "if", "old_r", "==", "self", ".", "cur_r", ":", "self", ".", "scroll_up", "(", ")", "self", ".", "erase_line", "(", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.put_abs
Screen array starts at 1 index.
pipenv/vendor/pexpect/screen.py
def put_abs (self, r, c, ch): '''Screen array starts at 1 index.''' r = constrain (r, 1, self.rows) c = constrain (c, 1, self.cols) if isinstance(ch, bytes): ch = self._decode(ch)[0] else: ch = ch[0] self.w[r-1][c-1] = ch
def put_abs (self, r, c, ch): '''Screen array starts at 1 index.''' r = constrain (r, 1, self.rows) c = constrain (c, 1, self.cols) if isinstance(ch, bytes): ch = self._decode(ch)[0] else: ch = ch[0] self.w[r-1][c-1] = ch
[ "Screen", "array", "starts", "at", "1", "index", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L200-L209
[ "def", "put_abs", "(", "self", ",", "r", ",", "c", ",", "ch", ")", ":", "r", "=", "constrain", "(", "r", ",", "1", ",", "self", ".", "rows", ")", "c", "=", "constrain", "(", "c", ",", "1", ",", "self", ".", "cols", ")", "if", "isinstance", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.put
This puts a characters at the current cursor position.
pipenv/vendor/pexpect/screen.py
def put (self, ch): '''This puts a characters at the current cursor position. ''' if isinstance(ch, bytes): ch = self._decode(ch) self.put_abs (self.cur_r, self.cur_c, ch)
def put (self, ch): '''This puts a characters at the current cursor position. ''' if isinstance(ch, bytes): ch = self._decode(ch) self.put_abs (self.cur_r, self.cur_c, ch)
[ "This", "puts", "a", "characters", "at", "the", "current", "cursor", "position", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L211-L218
[ "def", "put", "(", "self", ",", "ch", ")", ":", "if", "isinstance", "(", "ch", ",", "bytes", ")", ":", "ch", "=", "self", ".", "_decode", "(", "ch", ")", "self", ".", "put_abs", "(", "self", ".", "cur_r", ",", "self", ".", "cur_c", ",", "ch", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.insert_abs
This inserts a character at (r,c). Everything under and to the right is shifted right one character. The last character of the line is lost.
pipenv/vendor/pexpect/screen.py
def insert_abs (self, r, c, ch): '''This inserts a character at (r,c). Everything under and to the right is shifted right one character. The last character of the line is lost. ''' if isinstance(ch, bytes): ch = self._decode(ch) r = constrain (r, 1, self.row...
def insert_abs (self, r, c, ch): '''This inserts a character at (r,c). Everything under and to the right is shifted right one character. The last character of the line is lost. ''' if isinstance(ch, bytes): ch = self._decode(ch) r = constrain (r, 1, self.row...
[ "This", "inserts", "a", "character", "at", "(", "r", "c", ")", ".", "Everything", "under", "and", "to", "the", "right", "is", "shifted", "right", "one", "character", ".", "The", "last", "character", "of", "the", "line", "is", "lost", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L220-L233
[ "def", "insert_abs", "(", "self", ",", "r", ",", "c", ",", "ch", ")", ":", "if", "isinstance", "(", "ch", ",", "bytes", ")", ":", "ch", "=", "self", ".", "_decode", "(", "ch", ")", "r", "=", "constrain", "(", "r", ",", "1", ",", "self", ".", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.get_region
This returns a list of lines representing the region.
pipenv/vendor/pexpect/screen.py
def get_region (self, rs,cs, re,ce): '''This returns a list of lines representing the region. ''' rs = constrain (rs, 1, self.rows) re = constrain (re, 1, self.rows) cs = constrain (cs, 1, self.cols) ce = constrain (ce, 1, self.cols) if rs > re: rs, r...
def get_region (self, rs,cs, re,ce): '''This returns a list of lines representing the region. ''' rs = constrain (rs, 1, self.rows) re = constrain (re, 1, self.rows) cs = constrain (cs, 1, self.cols) ce = constrain (ce, 1, self.cols) if rs > re: rs, r...
[ "This", "returns", "a", "list", "of", "lines", "representing", "the", "region", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L252-L271
[ "def", "get_region", "(", "self", ",", "rs", ",", "cs", ",", "re", ",", "ce", ")", ":", "rs", "=", "constrain", "(", "rs", ",", "1", ",", "self", ".", "rows", ")", "re", "=", "constrain", "(", "re", ",", "1", ",", "self", ".", "rows", ")", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.cursor_constrain
This keeps the cursor within the screen area.
pipenv/vendor/pexpect/screen.py
def cursor_constrain (self): '''This keeps the cursor within the screen area. ''' self.cur_r = constrain (self.cur_r, 1, self.rows) self.cur_c = constrain (self.cur_c, 1, self.cols)
def cursor_constrain (self): '''This keeps the cursor within the screen area. ''' self.cur_r = constrain (self.cur_r, 1, self.rows) self.cur_c = constrain (self.cur_c, 1, self.cols)
[ "This", "keeps", "the", "cursor", "within", "the", "screen", "area", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L273-L278
[ "def", "cursor_constrain", "(", "self", ")", ":", "self", ".", "cur_r", "=", "constrain", "(", "self", ".", "cur_r", ",", "1", ",", "self", ".", "rows", ")", "self", ".", "cur_c", "=", "constrain", "(", "self", ".", "cur_c", ",", "1", ",", "self", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.cursor_save_attrs
Save current cursor position.
pipenv/vendor/pexpect/screen.py
def cursor_save_attrs (self): # <ESC>7 '''Save current cursor position.''' self.cur_saved_r = self.cur_r self.cur_saved_c = self.cur_c
def cursor_save_attrs (self): # <ESC>7 '''Save current cursor position.''' self.cur_saved_r = self.cur_r self.cur_saved_c = self.cur_c
[ "Save", "current", "cursor", "position", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L328-L332
[ "def", "cursor_save_attrs", "(", "self", ")", ":", "# <ESC>7", "self", ".", "cur_saved_r", "=", "self", ".", "cur_r", "self", ".", "cur_saved_c", "=", "self", ".", "cur_c" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.scroll_constrain
This keeps the scroll region within the screen region.
pipenv/vendor/pexpect/screen.py
def scroll_constrain (self): '''This keeps the scroll region within the screen region.''' if self.scroll_row_start <= 0: self.scroll_row_start = 1 if self.scroll_row_end > self.rows: self.scroll_row_end = self.rows
def scroll_constrain (self): '''This keeps the scroll region within the screen region.''' if self.scroll_row_start <= 0: self.scroll_row_start = 1 if self.scroll_row_end > self.rows: self.scroll_row_end = self.rows
[ "This", "keeps", "the", "scroll", "region", "within", "the", "screen", "region", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L339-L345
[ "def", "scroll_constrain", "(", "self", ")", ":", "if", "self", ".", "scroll_row_start", "<=", "0", ":", "self", ".", "scroll_row_start", "=", "1", "if", "self", ".", "scroll_row_end", ">", "self", ".", "rows", ":", "self", ".", "scroll_row_end", "=", "s...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.scroll_screen_rows
Enable scrolling from row {start} to row {end}.
pipenv/vendor/pexpect/screen.py
def scroll_screen_rows (self, rs, re): # <ESC>[{start};{end}r '''Enable scrolling from row {start} to row {end}.''' self.scroll_row_start = rs self.scroll_row_end = re self.scroll_constrain()
def scroll_screen_rows (self, rs, re): # <ESC>[{start};{end}r '''Enable scrolling from row {start} to row {end}.''' self.scroll_row_start = rs self.scroll_row_end = re self.scroll_constrain()
[ "Enable", "scrolling", "from", "row", "{", "start", "}", "to", "row", "{", "end", "}", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L353-L358
[ "def", "scroll_screen_rows", "(", "self", ",", "rs", ",", "re", ")", ":", "# <ESC>[{start};{end}r", "self", ".", "scroll_row_start", "=", "rs", "self", ".", "scroll_row_end", "=", "re", "self", ".", "scroll_constrain", "(", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.scroll_down
Scroll display down one line.
pipenv/vendor/pexpect/screen.py
def scroll_down (self): # <ESC>D '''Scroll display down one line.''' # Screen is indexed from 1, but arrays are indexed from 0. s = self.scroll_row_start - 1 e = self.scroll_row_end - 1 self.w[s+1:e+1] = copy.deepcopy(self.w[s:e])
def scroll_down (self): # <ESC>D '''Scroll display down one line.''' # Screen is indexed from 1, but arrays are indexed from 0. s = self.scroll_row_start - 1 e = self.scroll_row_end - 1 self.w[s+1:e+1] = copy.deepcopy(self.w[s:e])
[ "Scroll", "display", "down", "one", "line", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L360-L366
[ "def", "scroll_down", "(", "self", ")", ":", "# <ESC>D", "# Screen is indexed from 1, but arrays are indexed from 0.", "s", "=", "self", ".", "scroll_row_start", "-", "1", "e", "=", "self", ".", "scroll_row_end", "-", "1", "self", ".", "w", "[", "s", "+", "1",...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.erase_end_of_line
Erases from the current cursor position to the end of the current line.
pipenv/vendor/pexpect/screen.py
def erase_end_of_line (self): # <ESC>[0K -or- <ESC>[K '''Erases from the current cursor position to the end of the current line.''' self.fill_region (self.cur_r, self.cur_c, self.cur_r, self.cols)
def erase_end_of_line (self): # <ESC>[0K -or- <ESC>[K '''Erases from the current cursor position to the end of the current line.''' self.fill_region (self.cur_r, self.cur_c, self.cur_r, self.cols)
[ "Erases", "from", "the", "current", "cursor", "position", "to", "the", "end", "of", "the", "current", "line", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L376-L380
[ "def", "erase_end_of_line", "(", "self", ")", ":", "# <ESC>[0K -or- <ESC>[K", "self", ".", "fill_region", "(", "self", ".", "cur_r", ",", "self", ".", "cur_c", ",", "self", ".", "cur_r", ",", "self", ".", "cols", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.erase_start_of_line
Erases from the current cursor position to the start of the current line.
pipenv/vendor/pexpect/screen.py
def erase_start_of_line (self): # <ESC>[1K '''Erases from the current cursor position to the start of the current line.''' self.fill_region (self.cur_r, 1, self.cur_r, self.cur_c)
def erase_start_of_line (self): # <ESC>[1K '''Erases from the current cursor position to the start of the current line.''' self.fill_region (self.cur_r, 1, self.cur_r, self.cur_c)
[ "Erases", "from", "the", "current", "cursor", "position", "to", "the", "start", "of", "the", "current", "line", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L382-L386
[ "def", "erase_start_of_line", "(", "self", ")", ":", "# <ESC>[1K", "self", ".", "fill_region", "(", "self", ".", "cur_r", ",", "1", ",", "self", ".", "cur_r", ",", "self", ".", "cur_c", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.erase_line
Erases the entire current line.
pipenv/vendor/pexpect/screen.py
def erase_line (self): # <ESC>[2K '''Erases the entire current line.''' self.fill_region (self.cur_r, 1, self.cur_r, self.cols)
def erase_line (self): # <ESC>[2K '''Erases the entire current line.''' self.fill_region (self.cur_r, 1, self.cur_r, self.cols)
[ "Erases", "the", "entire", "current", "line", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L388-L391
[ "def", "erase_line", "(", "self", ")", ":", "# <ESC>[2K", "self", ".", "fill_region", "(", "self", ".", "cur_r", ",", "1", ",", "self", ".", "cur_r", ",", "self", ".", "cols", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.erase_down
Erases the screen from the current line down to the bottom of the screen.
pipenv/vendor/pexpect/screen.py
def erase_down (self): # <ESC>[0J -or- <ESC>[J '''Erases the screen from the current line down to the bottom of the screen.''' self.erase_end_of_line () self.fill_region (self.cur_r + 1, 1, self.rows, self.cols)
def erase_down (self): # <ESC>[0J -or- <ESC>[J '''Erases the screen from the current line down to the bottom of the screen.''' self.erase_end_of_line () self.fill_region (self.cur_r + 1, 1, self.rows, self.cols)
[ "Erases", "the", "screen", "from", "the", "current", "line", "down", "to", "the", "bottom", "of", "the", "screen", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L393-L398
[ "def", "erase_down", "(", "self", ")", ":", "# <ESC>[0J -or- <ESC>[J", "self", ".", "erase_end_of_line", "(", ")", "self", ".", "fill_region", "(", "self", ".", "cur_r", "+", "1", ",", "1", ",", "self", ".", "rows", ",", "self", ".", "cols", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
screen.erase_up
Erases the screen from the current line up to the top of the screen.
pipenv/vendor/pexpect/screen.py
def erase_up (self): # <ESC>[1J '''Erases the screen from the current line up to the top of the screen.''' self.erase_start_of_line () self.fill_region (self.cur_r-1, 1, 1, self.cols)
def erase_up (self): # <ESC>[1J '''Erases the screen from the current line up to the top of the screen.''' self.erase_start_of_line () self.fill_region (self.cur_r-1, 1, 1, self.cols)
[ "Erases", "the", "screen", "from", "the", "current", "line", "up", "to", "the", "top", "of", "the", "screen", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L400-L405
[ "def", "erase_up", "(", "self", ")", ":", "# <ESC>[1J", "self", ".", "erase_start_of_line", "(", ")", "self", ".", "fill_region", "(", "self", ".", "cur_r", "-", "1", ",", "1", ",", "1", ",", "self", ".", "cols", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
to_int
Pull a value from the dict and convert to int :param default_to_zero: If the value is None or empty, treat it as zero :param default: If the value is missing in the dict use this default
pipenv/vendor/iso8601/iso8601.py
def to_int(d, key, default_to_zero=False, default=None, required=True): """Pull a value from the dict and convert to int :param default_to_zero: If the value is None or empty, treat it as zero :param default: If the value is missing in the dict use this default """ value = d.get(key) or default ...
def to_int(d, key, default_to_zero=False, default=None, required=True): """Pull a value from the dict and convert to int :param default_to_zero: If the value is None or empty, treat it as zero :param default: If the value is missing in the dict use this default """ value = d.get(key) or default ...
[ "Pull", "a", "value", "from", "the", "dict", "and", "convert", "to", "int" ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/iso8601/iso8601.py#L137-L151
[ "def", "to_int", "(", "d", ",", "key", ",", "default_to_zero", "=", "False", ",", "default", "=", "None", ",", "required", "=", "True", ")", ":", "value", "=", "d", ".", "get", "(", "key", ")", "or", "default", "if", "(", "value", "in", "[", "\"\...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
parse_timezone
Parses ISO 8601 time zone specs into tzinfo offsets
pipenv/vendor/iso8601/iso8601.py
def parse_timezone(matches, default_timezone=UTC): """Parses ISO 8601 time zone specs into tzinfo offsets """ if matches["timezone"] == "Z": return UTC # This isn't strictly correct, but it's common to encounter dates without # timezones so I'll assume the default (which defaults to UTC). ...
def parse_timezone(matches, default_timezone=UTC): """Parses ISO 8601 time zone specs into tzinfo offsets """ if matches["timezone"] == "Z": return UTC # This isn't strictly correct, but it's common to encounter dates without # timezones so I'll assume the default (which defaults to UTC). ...
[ "Parses", "ISO", "8601", "time", "zone", "specs", "into", "tzinfo", "offsets" ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/iso8601/iso8601.py#L153-L172
[ "def", "parse_timezone", "(", "matches", ",", "default_timezone", "=", "UTC", ")", ":", "if", "matches", "[", "\"timezone\"", "]", "==", "\"Z\"", ":", "return", "UTC", "# This isn't strictly correct, but it's common to encounter dates without", "# timezones so I'll assume t...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
parse_date
Parses ISO 8601 dates into datetime objects The timezone is parsed from the date string. However it is quite common to have dates without a timezone (not strictly correct). In this case the default timezone specified in default_timezone is used. This is UTC by default. :param datestring: The date ...
pipenv/vendor/iso8601/iso8601.py
def parse_date(datestring, default_timezone=UTC): """Parses ISO 8601 dates into datetime objects The timezone is parsed from the date string. However it is quite common to have dates without a timezone (not strictly correct). In this case the default timezone specified in default_timezone is used. This...
def parse_date(datestring, default_timezone=UTC): """Parses ISO 8601 dates into datetime objects The timezone is parsed from the date string. However it is quite common to have dates without a timezone (not strictly correct). In this case the default timezone specified in default_timezone is used. This...
[ "Parses", "ISO", "8601", "dates", "into", "datetime", "objects" ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/iso8601/iso8601.py#L174-L214
[ "def", "parse_date", "(", "datestring", ",", "default_timezone", "=", "UTC", ")", ":", "if", "not", "isinstance", "(", "datestring", ",", "_basestring", ")", ":", "raise", "ParseError", "(", "\"Expecting a string %r\"", "%", "datestring", ")", "m", "=", "ISO86...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
default_handler
Signal handler, used to gracefully shut down the ``spinner`` instance when specified signal is received by the process running the ``spinner``. ``signum`` and ``frame`` are mandatory arguments. Check ``signal.signal`` function for more details.
pipenv/vendor/yaspin/signal_handlers.py
def default_handler(signum, frame, spinner): """Signal handler, used to gracefully shut down the ``spinner`` instance when specified signal is received by the process running the ``spinner``. ``signum`` and ``frame`` are mandatory arguments. Check ``signal.signal`` function for more details. """ ...
def default_handler(signum, frame, spinner): """Signal handler, used to gracefully shut down the ``spinner`` instance when specified signal is received by the process running the ``spinner``. ``signum`` and ``frame`` are mandatory arguments. Check ``signal.signal`` function for more details. """ ...
[ "Signal", "handler", "used", "to", "gracefully", "shut", "down", "the", "spinner", "instance", "when", "specified", "signal", "is", "received", "by", "the", "process", "running", "the", "spinner", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/yaspin/signal_handlers.py#L14-L23
[ "def", "default_handler", "(", "signum", ",", "frame", ",", "spinner", ")", ":", "spinner", ".", "fail", "(", ")", "spinner", ".", "stop", "(", ")", "sys", ".", "exit", "(", "0", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
fancy_handler
Signal handler, used to gracefully shut down the ``spinner`` instance when specified signal is received by the process running the ``spinner``. ``signum`` and ``frame`` are mandatory arguments. Check ``signal.signal`` function for more details.
pipenv/vendor/yaspin/signal_handlers.py
def fancy_handler(signum, frame, spinner): """Signal handler, used to gracefully shut down the ``spinner`` instance when specified signal is received by the process running the ``spinner``. ``signum`` and ``frame`` are mandatory arguments. Check ``signal.signal`` function for more details. """ ...
def fancy_handler(signum, frame, spinner): """Signal handler, used to gracefully shut down the ``spinner`` instance when specified signal is received by the process running the ``spinner``. ``signum`` and ``frame`` are mandatory arguments. Check ``signal.signal`` function for more details. """ ...
[ "Signal", "handler", "used", "to", "gracefully", "shut", "down", "the", "spinner", "instance", "when", "specified", "signal", "is", "received", "by", "the", "process", "running", "the", "spinner", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/yaspin/signal_handlers.py#L26-L35
[ "def", "fancy_handler", "(", "signum", ",", "frame", ",", "spinner", ")", ":", "spinner", ".", "red", ".", "fail", "(", "\"✘\")", "", "spinner", ".", "stop", "(", ")", "sys", ".", "exit", "(", "0", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
uts46_remap
Re-map the characters in the string according to UTS46 processing.
pipenv/vendor/idna/core.py
def uts46_remap(domain, std3_rules=True, transitional=False): """Re-map the characters in the string according to UTS46 processing.""" from .uts46data import uts46data output = u"" try: for pos, char in enumerate(domain): code_point = ord(char) uts46row = uts46data[code_p...
def uts46_remap(domain, std3_rules=True, transitional=False): """Re-map the characters in the string according to UTS46 processing.""" from .uts46data import uts46data output = u"" try: for pos, char in enumerate(domain): code_point = ord(char) uts46row = uts46data[code_p...
[ "Re", "-", "map", "the", "characters", "in", "the", "string", "according", "to", "UTS46", "processing", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/idna/core.py#L312-L337
[ "def", "uts46_remap", "(", "domain", ",", "std3_rules", "=", "True", ",", "transitional", "=", "False", ")", ":", "from", ".", "uts46data", "import", "uts46data", "output", "=", "u\"\"", "try", ":", "for", "pos", ",", "char", "in", "enumerate", "(", "dom...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
_implementation
Return a dict with the Python implementation and version. Provide both the name and the version of the Python implementation currently running. For example, on CPython 2.7.5 it will return {'name': 'CPython', 'version': '2.7.5'}. This function works best on CPython and PyPy: in particular, it probably...
pipenv/vendor/requests/help.py
def _implementation(): """Return a dict with the Python implementation and version. Provide both the name and the version of the Python implementation currently running. For example, on CPython 2.7.5 it will return {'name': 'CPython', 'version': '2.7.5'}. This function works best on CPython and Py...
def _implementation(): """Return a dict with the Python implementation and version. Provide both the name and the version of the Python implementation currently running. For example, on CPython 2.7.5 it will return {'name': 'CPython', 'version': '2.7.5'}. This function works best on CPython and Py...
[ "Return", "a", "dict", "with", "the", "Python", "implementation", "and", "version", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/help.py#L26-L56
[ "def", "_implementation", "(", ")", ":", "implementation", "=", "platform", ".", "python_implementation", "(", ")", "if", "implementation", "==", "'CPython'", ":", "implementation_version", "=", "platform", ".", "python_version", "(", ")", "elif", "implementation", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
info
Generate information for a bug report.
pipenv/vendor/requests/help.py
def info(): """Generate information for a bug report.""" try: platform_info = { 'system': platform.system(), 'release': platform.release(), } except IOError: platform_info = { 'system': 'Unknown', 'release': 'Unknown', } im...
def info(): """Generate information for a bug report.""" try: platform_info = { 'system': platform.system(), 'release': platform.release(), } except IOError: platform_info = { 'system': 'Unknown', 'release': 'Unknown', } im...
[ "Generate", "information", "for", "a", "bug", "report", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/help.py#L59-L110
[ "def", "info", "(", ")", ":", "try", ":", "platform_info", "=", "{", "'system'", ":", "platform", ".", "system", "(", ")", ",", "'release'", ":", "platform", ".", "release", "(", ")", ",", "}", "except", "IOError", ":", "platform_info", "=", "{", "'s...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Release.package_type
>>> package = yarg.get('yarg') >>> v = "0.1.0" >>> r = package.release(v) >>> r.package_type u'wheel'
pipenv/vendor/yarg/release.py
def package_type(self): """ >>> package = yarg.get('yarg') >>> v = "0.1.0" >>> r = package.release(v) >>> r.package_type u'wheel' """ mapping = {'bdist_egg': u'egg', 'bdist_wheel': u'wheel', 'sdist': u'source'} ...
def package_type(self): """ >>> package = yarg.get('yarg') >>> v = "0.1.0" >>> r = package.release(v) >>> r.package_type u'wheel' """ mapping = {'bdist_egg': u'egg', 'bdist_wheel': u'wheel', 'sdist': u'source'} ...
[ ">>>", "package", "=", "yarg", ".", "get", "(", "yarg", ")", ">>>", "v", "=", "0", ".", "1", ".", "0", ">>>", "r", "=", "package", ".", "release", "(", "v", ")", ">>>", "r", ".", "package_type", "u", "wheel" ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/yarg/release.py#L123-L136
[ "def", "package_type", "(", "self", ")", ":", "mapping", "=", "{", "'bdist_egg'", ":", "u'egg'", ",", "'bdist_wheel'", ":", "u'wheel'", ",", "'sdist'", ":", "u'source'", "}", "ptype", "=", "self", ".", "_release", "[", "'packagetype'", "]", "if", "ptype", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
ANSI.process
Process a single character. Called by :meth:`write`.
pipenv/vendor/pexpect/ANSI.py
def process (self, c): """Process a single character. Called by :meth:`write`.""" if isinstance(c, bytes): c = self._decode(c) self.state.process(c)
def process (self, c): """Process a single character. Called by :meth:`write`.""" if isinstance(c, bytes): c = self._decode(c) self.state.process(c)
[ "Process", "a", "single", "character", ".", "Called", "by", ":", "meth", ":", "write", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/ANSI.py#L281-L285
[ "def", "process", "(", "self", ",", "c", ")", ":", "if", "isinstance", "(", "c", ",", "bytes", ")", ":", "c", "=", "self", ".", "_decode", "(", "c", ")", "self", ".", "state", ".", "process", "(", "c", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
ANSI.write
Process text, writing it to the virtual screen while handling ANSI escape codes.
pipenv/vendor/pexpect/ANSI.py
def write (self, s): """Process text, writing it to the virtual screen while handling ANSI escape codes. """ if isinstance(s, bytes): s = self._decode(s) for c in s: self.process(c)
def write (self, s): """Process text, writing it to the virtual screen while handling ANSI escape codes. """ if isinstance(s, bytes): s = self._decode(s) for c in s: self.process(c)
[ "Process", "text", "writing", "it", "to", "the", "virtual", "screen", "while", "handling", "ANSI", "escape", "codes", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/ANSI.py#L291-L298
[ "def", "write", "(", "self", ",", "s", ")", ":", "if", "isinstance", "(", "s", ",", "bytes", ")", ":", "s", "=", "self", ".", "_decode", "(", "s", ")", "for", "c", "in", "s", ":", "self", ".", "process", "(", "c", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
ANSI.write_ch
This puts a character at the current cursor position. The cursor position is moved forward with wrap-around, but no scrolling is done if the cursor hits the lower-right corner of the screen.
pipenv/vendor/pexpect/ANSI.py
def write_ch (self, ch): '''This puts a character at the current cursor position. The cursor position is moved forward with wrap-around, but no scrolling is done if the cursor hits the lower-right corner of the screen. ''' if isinstance(ch, bytes): ch = self._decode(ch) ...
def write_ch (self, ch): '''This puts a character at the current cursor position. The cursor position is moved forward with wrap-around, but no scrolling is done if the cursor hits the lower-right corner of the screen. ''' if isinstance(ch, bytes): ch = self._decode(ch) ...
[ "This", "puts", "a", "character", "at", "the", "current", "cursor", "position", ".", "The", "cursor", "position", "is", "moved", "forward", "with", "wrap", "-", "around", "but", "no", "scrolling", "is", "done", "if", "the", "cursor", "hits", "the", "lower"...
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/ANSI.py#L303-L334
[ "def", "write_ch", "(", "self", ",", "ch", ")", ":", "if", "isinstance", "(", "ch", ",", "bytes", ")", ":", "ch", "=", "self", ".", "_decode", "(", "ch", ")", "#\\r and \\n both produce a call to cr() and lf(), respectively.", "ch", "=", "ch", "[", "0", "]...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
get_best_encoding
Returns the default stream encoding if not found.
pipenv/vendor/click/_compat.py
def get_best_encoding(stream): """Returns the default stream encoding if not found.""" rv = getattr(stream, 'encoding', None) or sys.getdefaultencoding() if is_ascii_encoding(rv): return 'utf-8' return rv
def get_best_encoding(stream): """Returns the default stream encoding if not found.""" rv = getattr(stream, 'encoding', None) or sys.getdefaultencoding() if is_ascii_encoding(rv): return 'utf-8' return rv
[ "Returns", "the", "default", "stream", "encoding", "if", "not", "found", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/click/_compat.py#L45-L50
[ "def", "get_best_encoding", "(", "stream", ")", ":", "rv", "=", "getattr", "(", "stream", ",", "'encoding'", ",", "None", ")", "or", "sys", ".", "getdefaultencoding", "(", ")", "if", "is_ascii_encoding", "(", "rv", ")", ":", "return", "'utf-8'", "return", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
get_terminal_size
Get the size of the terminal window. For each of the two dimensions, the environment variable, COLUMNS and LINES respectively, is checked. If the variable is defined and the value is a positive integer, it is used. When COLUMNS or LINES is not defined, which is the common case, the terminal connec...
pipenv/vendor/backports/shutil_get_terminal_size/get_terminal_size.py
def get_terminal_size(fallback=(80, 24)): """Get the size of the terminal window. For each of the two dimensions, the environment variable, COLUMNS and LINES respectively, is checked. If the variable is defined and the value is a positive integer, it is used. When COLUMNS or LINES is not defined, ...
def get_terminal_size(fallback=(80, 24)): """Get the size of the terminal window. For each of the two dimensions, the environment variable, COLUMNS and LINES respectively, is checked. If the variable is defined and the value is a positive integer, it is used. When COLUMNS or LINES is not defined, ...
[ "Get", "the", "size", "of", "the", "terminal", "window", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/backports/shutil_get_terminal_size/get_terminal_size.py#L58-L100
[ "def", "get_terminal_size", "(", "fallback", "=", "(", "80", ",", "24", ")", ")", ":", "# Try the environment first", "try", ":", "columns", "=", "int", "(", "os", ".", "environ", "[", "\"COLUMNS\"", "]", ")", "except", "(", "KeyError", ",", "ValueError", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
make_headers
Shortcuts for generating request headers. :param keep_alive: If ``True``, adds 'connection: keep-alive' header. :param accept_encoding: Can be a boolean, list, or string. ``True`` translates to 'gzip,deflate'. List will get joined by comma. String will be used as provid...
pipenv/vendor/urllib3/util/request.py
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, basic_auth=None, proxy_basic_auth=None, disable_cache=None): """ Shortcuts for generating request headers. :param keep_alive: If ``True``, adds 'connection: keep-alive' header. :param accept_encoding: ...
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, basic_auth=None, proxy_basic_auth=None, disable_cache=None): """ Shortcuts for generating request headers. :param keep_alive: If ``True``, adds 'connection: keep-alive' header. :param accept_encoding: ...
[ "Shortcuts", "for", "generating", "request", "headers", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/util/request.py#L11-L74
[ "def", "make_headers", "(", "keep_alive", "=", "None", ",", "accept_encoding", "=", "None", ",", "user_agent", "=", "None", ",", "basic_auth", "=", "None", ",", "proxy_basic_auth", "=", "None", ",", "disable_cache", "=", "None", ")", ":", "headers", "=", "...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
set_file_position
If a position is provided, move file to that point. Otherwise, we'll attempt to record a position for future use.
pipenv/vendor/urllib3/util/request.py
def set_file_position(body, pos): """ If a position is provided, move file to that point. Otherwise, we'll attempt to record a position for future use. """ if pos is not None: rewind_body(body, pos) elif getattr(body, 'tell', None) is not None: try: pos = body.tell() ...
def set_file_position(body, pos): """ If a position is provided, move file to that point. Otherwise, we'll attempt to record a position for future use. """ if pos is not None: rewind_body(body, pos) elif getattr(body, 'tell', None) is not None: try: pos = body.tell() ...
[ "If", "a", "position", "is", "provided", "move", "file", "to", "that", "point", ".", "Otherwise", "we", "ll", "attempt", "to", "record", "a", "position", "for", "future", "use", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/util/request.py#L77-L92
[ "def", "set_file_position", "(", "body", ",", "pos", ")", ":", "if", "pos", "is", "not", "None", ":", "rewind_body", "(", "body", ",", "pos", ")", "elif", "getattr", "(", "body", ",", "'tell'", ",", "None", ")", "is", "not", "None", ":", "try", ":"...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
rewind_body
Attempt to rewind body to a certain position. Primarily used for request redirects and retries. :param body: File-like object that supports seek. :param int pos: Position to seek to in file.
pipenv/vendor/urllib3/util/request.py
def rewind_body(body, body_pos): """ Attempt to rewind body to a certain position. Primarily used for request redirects and retries. :param body: File-like object that supports seek. :param int pos: Position to seek to in file. """ body_seek = getattr(body, 'seek', None) ...
def rewind_body(body, body_pos): """ Attempt to rewind body to a certain position. Primarily used for request redirects and retries. :param body: File-like object that supports seek. :param int pos: Position to seek to in file. """ body_seek = getattr(body, 'seek', None) ...
[ "Attempt", "to", "rewind", "body", "to", "a", "certain", "position", ".", "Primarily", "used", "for", "request", "redirects", "and", "retries", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/util/request.py#L95-L118
[ "def", "rewind_body", "(", "body", ",", "body_pos", ")", ":", "body_seek", "=", "getattr", "(", "body", ",", "'seek'", ",", "None", ")", "if", "body_seek", "is", "not", "None", "and", "isinstance", "(", "body_pos", ",", "integer_types", ")", ":", "try", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
_copy_jsonsafe
Deep-copy a value into JSON-safe types.
pipenv/vendor/plette/lockfiles.py
def _copy_jsonsafe(value): """Deep-copy a value into JSON-safe types. """ if isinstance(value, six.string_types + (numbers.Number,)): return value if isinstance(value, collections_abc.Mapping): return {six.text_type(k): _copy_jsonsafe(v) for k, v in value.items()} if isinstance(value...
def _copy_jsonsafe(value): """Deep-copy a value into JSON-safe types. """ if isinstance(value, six.string_types + (numbers.Number,)): return value if isinstance(value, collections_abc.Mapping): return {six.text_type(k): _copy_jsonsafe(v) for k, v in value.items()} if isinstance(value...
[ "Deep", "-", "copy", "a", "value", "into", "JSON", "-", "safe", "types", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/plette/lockfiles.py#L53-L64
[ "def", "_copy_jsonsafe", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "six", ".", "string_types", "+", "(", "numbers", ".", "Number", ",", ")", ")", ":", "return", "value", "if", "isinstance", "(", "value", ",", "collections_abc", ".", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
RedisCache.clear
Helper for clearing all the keys in a database. Use with caution!
pipenv/patched/notpip/_vendor/cachecontrol/caches/redis_cache.py
def clear(self): """Helper for clearing all the keys in a database. Use with caution!""" for key in self.conn.keys(): self.conn.delete(key)
def clear(self): """Helper for clearing all the keys in a database. Use with caution!""" for key in self.conn.keys(): self.conn.delete(key)
[ "Helper", "for", "clearing", "all", "the", "keys", "in", "a", "database", ".", "Use", "with", "caution!" ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_vendor/cachecontrol/caches/redis_cache.py#L25-L29
[ "def", "clear", "(", "self", ")", ":", "for", "key", "in", "self", ".", "conn", ".", "keys", "(", ")", ":", "self", ".", "conn", ".", "delete", "(", "key", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
mapping_to_frozenset
Be aware that this treats any sequence type with the equal members as equal. As it is used to identify equality of schemas, this can be considered okay as definitions are semantically equal regardless the container type.
pipenv/vendor/cerberus/utils.py
def mapping_to_frozenset(mapping): """ Be aware that this treats any sequence type with the equal members as equal. As it is used to identify equality of schemas, this can be considered okay as definitions are semantically equal regardless the container type. """ mapping = mapping.copy()...
def mapping_to_frozenset(mapping): """ Be aware that this treats any sequence type with the equal members as equal. As it is used to identify equality of schemas, this can be considered okay as definitions are semantically equal regardless the container type. """ mapping = mapping.copy()...
[ "Be", "aware", "that", "this", "treats", "any", "sequence", "type", "with", "the", "equal", "members", "as", "equal", ".", "As", "it", "is", "used", "to", "identify", "equality", "of", "schemas", "this", "can", "be", "considered", "okay", "as", "definition...
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/cerberus/utils.py#L48-L63
[ "def", "mapping_to_frozenset", "(", "mapping", ")", ":", "mapping", "=", "mapping", ".", "copy", "(", ")", "for", "key", ",", "value", "in", "mapping", ".", "items", "(", ")", ":", "if", "isinstance", "(", "value", ",", "Mapping", ")", ":", "mapping", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
validator_factory
Dynamically create a :class:`~cerberus.Validator` subclass. Docstrings of mixin-classes will be added to the resulting class' one if ``__doc__`` is not in :obj:`namespace`. :param name: The name of the new class. :type name: :class:`str` :param bases: Class(es) with additional and overridin...
pipenv/vendor/cerberus/utils.py
def validator_factory(name, bases=None, namespace={}): """ Dynamically create a :class:`~cerberus.Validator` subclass. Docstrings of mixin-classes will be added to the resulting class' one if ``__doc__`` is not in :obj:`namespace`. :param name: The name of the new class. :type name: :class:...
def validator_factory(name, bases=None, namespace={}): """ Dynamically create a :class:`~cerberus.Validator` subclass. Docstrings of mixin-classes will be added to the resulting class' one if ``__doc__`` is not in :obj:`namespace`. :param name: The name of the new class. :type name: :class:...
[ "Dynamically", "create", "a", ":", "class", ":", "~cerberus", ".", "Validator", "subclass", ".", "Docstrings", "of", "mixin", "-", "classes", "will", "be", "added", "to", "the", "resulting", "class", "one", "if", "__doc__", "is", "not", "in", ":", "obj", ...
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/cerberus/utils.py#L93-L119
[ "def", "validator_factory", "(", "name", ",", "bases", "=", "None", ",", "namespace", "=", "{", "}", ")", ":", "Validator", "=", "get_Validator_class", "(", ")", "if", "bases", "is", "None", ":", "bases", "=", "(", "Validator", ",", ")", "elif", "isins...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Script.cmdify
Encode into a cmd-executable string. This re-implements CreateProcess's quoting logic to turn a list of arguments into one single string for the shell to interpret. * All double quotes are escaped with a backslash. * Existing backslashes before a quote are doubled, so they are all ...
pipenv/vendor/vistir/cmdparse.py
def cmdify(self): """Encode into a cmd-executable string. This re-implements CreateProcess's quoting logic to turn a list of arguments into one single string for the shell to interpret. * All double quotes are escaped with a backslash. * Existing backslashes before a quote are ...
def cmdify(self): """Encode into a cmd-executable string. This re-implements CreateProcess's quoting logic to turn a list of arguments into one single string for the shell to interpret. * All double quotes are escaped with a backslash. * Existing backslashes before a quote are ...
[ "Encode", "into", "a", "cmd", "-", "executable", "string", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/vistir/cmdparse.py#L56-L85
[ "def", "cmdify", "(", "self", ")", ":", "return", "\" \"", ".", "join", "(", "itertools", ".", "chain", "(", "[", "_quote_if_contains", "(", "self", ".", "command", ",", "r\"[\\s^()]\"", ")", "]", ",", "(", "_quote_if_contains", "(", "arg", ",", "r\"[\\s...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
_split_what
Returns a tuple of `frozenset`s of classes and attributes.
pipenv/vendor/attr/filters.py
def _split_what(what): """ Returns a tuple of `frozenset`s of classes and attributes. """ return ( frozenset(cls for cls in what if isclass(cls)), frozenset(cls for cls in what if isinstance(cls, Attribute)), )
def _split_what(what): """ Returns a tuple of `frozenset`s of classes and attributes. """ return ( frozenset(cls for cls in what if isclass(cls)), frozenset(cls for cls in what if isinstance(cls, Attribute)), )
[ "Returns", "a", "tuple", "of", "frozenset", "s", "of", "classes", "and", "attributes", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/attr/filters.py#L11-L18
[ "def", "_split_what", "(", "what", ")", ":", "return", "(", "frozenset", "(", "cls", "for", "cls", "in", "what", "if", "isclass", "(", "cls", ")", ")", ",", "frozenset", "(", "cls", "for", "cls", "in", "what", "if", "isinstance", "(", "cls", ",", "...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
include
Whitelist *what*. :param what: What to whitelist. :type what: :class:`list` of :class:`type` or :class:`attr.Attribute`\\ s :rtype: :class:`callable`
pipenv/vendor/attr/filters.py
def include(*what): """ Whitelist *what*. :param what: What to whitelist. :type what: :class:`list` of :class:`type` or :class:`attr.Attribute`\\ s :rtype: :class:`callable` """ cls, attrs = _split_what(what) def include_(attribute, value): return value.__class__ in cls or att...
def include(*what): """ Whitelist *what*. :param what: What to whitelist. :type what: :class:`list` of :class:`type` or :class:`attr.Attribute`\\ s :rtype: :class:`callable` """ cls, attrs = _split_what(what) def include_(attribute, value): return value.__class__ in cls or att...
[ "Whitelist", "*", "what", "*", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/attr/filters.py#L21-L35
[ "def", "include", "(", "*", "what", ")", ":", "cls", ",", "attrs", "=", "_split_what", "(", "what", ")", "def", "include_", "(", "attribute", ",", "value", ")", ":", "return", "value", ".", "__class__", "in", "cls", "or", "attribute", "in", "attrs", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
exclude
Blacklist *what*. :param what: What to blacklist. :type what: :class:`list` of classes or :class:`attr.Attribute`\\ s. :rtype: :class:`callable`
pipenv/vendor/attr/filters.py
def exclude(*what): """ Blacklist *what*. :param what: What to blacklist. :type what: :class:`list` of classes or :class:`attr.Attribute`\\ s. :rtype: :class:`callable` """ cls, attrs = _split_what(what) def exclude_(attribute, value): return value.__class__ not in cls and att...
def exclude(*what): """ Blacklist *what*. :param what: What to blacklist. :type what: :class:`list` of classes or :class:`attr.Attribute`\\ s. :rtype: :class:`callable` """ cls, attrs = _split_what(what) def exclude_(attribute, value): return value.__class__ not in cls and att...
[ "Blacklist", "*", "what", "*", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/attr/filters.py#L38-L52
[ "def", "exclude", "(", "*", "what", ")", ":", "cls", ",", "attrs", "=", "_split_what", "(", "what", ")", "def", "exclude_", "(", "attribute", ",", "value", ")", ":", "return", "value", ".", "__class__", "not", "in", "cls", "and", "attribute", "not", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
asdict
Return the ``attrs`` attribute values of *inst* as a dict. Optionally recurse into other ``attrs``-decorated classes. :param inst: Instance of an ``attrs``-decorated class. :param bool recurse: Recurse into classes that are also ``attrs``-decorated. :param callable filter: A callable whose ret...
pipenv/vendor/attr/_funcs.py
def asdict( inst, recurse=True, filter=None, dict_factory=dict, retain_collection_types=False, ): """ Return the ``attrs`` attribute values of *inst* as a dict. Optionally recurse into other ``attrs``-decorated classes. :param inst: Instance of an ``attrs``-decorated class. :pa...
def asdict( inst, recurse=True, filter=None, dict_factory=dict, retain_collection_types=False, ): """ Return the ``attrs`` attribute values of *inst* as a dict. Optionally recurse into other ``attrs``-decorated classes. :param inst: Instance of an ``attrs``-decorated class. :pa...
[ "Return", "the", "attrs", "attribute", "values", "of", "*", "inst", "*", "as", "a", "dict", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/attr/_funcs.py#L10-L82
[ "def", "asdict", "(", "inst", ",", "recurse", "=", "True", ",", "filter", "=", "None", ",", "dict_factory", "=", "dict", ",", "retain_collection_types", "=", "False", ",", ")", ":", "attrs", "=", "fields", "(", "inst", ".", "__class__", ")", "rv", "=",...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
_asdict_anything
``asdict`` only works on attrs instances, this works on anything.
pipenv/vendor/attr/_funcs.py
def _asdict_anything(val, filter, dict_factory, retain_collection_types): """ ``asdict`` only works on attrs instances, this works on anything. """ if getattr(val.__class__, "__attrs_attrs__", None) is not None: # Attrs class. rv = asdict(val, True, filter, dict_factory, retain_collectio...
def _asdict_anything(val, filter, dict_factory, retain_collection_types): """ ``asdict`` only works on attrs instances, this works on anything. """ if getattr(val.__class__, "__attrs_attrs__", None) is not None: # Attrs class. rv = asdict(val, True, filter, dict_factory, retain_collectio...
[ "asdict", "only", "works", "on", "attrs", "instances", "this", "works", "on", "anything", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/attr/_funcs.py#L85-L113
[ "def", "_asdict_anything", "(", "val", ",", "filter", ",", "dict_factory", ",", "retain_collection_types", ")", ":", "if", "getattr", "(", "val", ".", "__class__", ",", "\"__attrs_attrs__\"", ",", "None", ")", "is", "not", "None", ":", "# Attrs class.", "rv", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
astuple
Return the ``attrs`` attribute values of *inst* as a tuple. Optionally recurse into other ``attrs``-decorated classes. :param inst: Instance of an ``attrs``-decorated class. :param bool recurse: Recurse into classes that are also ``attrs``-decorated. :param callable filter: A callable whose re...
pipenv/vendor/attr/_funcs.py
def astuple( inst, recurse=True, filter=None, tuple_factory=tuple, retain_collection_types=False, ): """ Return the ``attrs`` attribute values of *inst* as a tuple. Optionally recurse into other ``attrs``-decorated classes. :param inst: Instance of an ``attrs``-decorated class. ...
def astuple( inst, recurse=True, filter=None, tuple_factory=tuple, retain_collection_types=False, ): """ Return the ``attrs`` attribute values of *inst* as a tuple. Optionally recurse into other ``attrs``-decorated classes. :param inst: Instance of an ``attrs``-decorated class. ...
[ "Return", "the", "attrs", "attribute", "values", "of", "*", "inst", "*", "as", "a", "tuple", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/attr/_funcs.py#L116-L212
[ "def", "astuple", "(", "inst", ",", "recurse", "=", "True", ",", "filter", "=", "None", ",", "tuple_factory", "=", "tuple", ",", "retain_collection_types", "=", "False", ",", ")", ":", "attrs", "=", "fields", "(", "inst", ".", "__class__", ")", "rv", "...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
assoc
Copy *inst* and apply *changes*. :param inst: Instance of a class with ``attrs`` attributes. :param changes: Keyword changes in the new copy. :return: A copy of inst with *changes* incorporated. :raise attr.exceptions.AttrsAttributeNotFoundError: If *attr_name* couldn't be found on *cls*. ...
pipenv/vendor/attr/_funcs.py
def assoc(inst, **changes): """ Copy *inst* and apply *changes*. :param inst: Instance of a class with ``attrs`` attributes. :param changes: Keyword changes in the new copy. :return: A copy of inst with *changes* incorporated. :raise attr.exceptions.AttrsAttributeNotFoundError: If *attr_name*...
def assoc(inst, **changes): """ Copy *inst* and apply *changes*. :param inst: Instance of a class with ``attrs`` attributes. :param changes: Keyword changes in the new copy. :return: A copy of inst with *changes* incorporated. :raise attr.exceptions.AttrsAttributeNotFoundError: If *attr_name*...
[ "Copy", "*", "inst", "*", "and", "apply", "*", "changes", "*", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/attr/_funcs.py#L227-L262
[ "def", "assoc", "(", "inst", ",", "*", "*", "changes", ")", ":", "import", "warnings", "warnings", ".", "warn", "(", "\"assoc is deprecated and will be removed after 2018/01.\"", ",", "DeprecationWarning", ",", "stacklevel", "=", "2", ",", ")", "new", "=", "copy...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
evolve
Create a new instance, based on *inst* with *changes* applied. :param inst: Instance of a class with ``attrs`` attributes. :param changes: Keyword changes in the new copy. :return: A copy of inst with *changes* incorporated. :raise TypeError: If *attr_name* couldn't be found in the class ``__...
pipenv/vendor/attr/_funcs.py
def evolve(inst, **changes): """ Create a new instance, based on *inst* with *changes* applied. :param inst: Instance of a class with ``attrs`` attributes. :param changes: Keyword changes in the new copy. :return: A copy of inst with *changes* incorporated. :raise TypeError: If *attr_name* co...
def evolve(inst, **changes): """ Create a new instance, based on *inst* with *changes* applied. :param inst: Instance of a class with ``attrs`` attributes. :param changes: Keyword changes in the new copy. :return: A copy of inst with *changes* incorporated. :raise TypeError: If *attr_name* co...
[ "Create", "a", "new", "instance", "based", "on", "*", "inst", "*", "with", "*", "changes", "*", "applied", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/attr/_funcs.py#L265-L290
[ "def", "evolve", "(", "inst", ",", "*", "*", "changes", ")", ":", "cls", "=", "inst", ".", "__class__", "attrs", "=", "fields", "(", "cls", ")", "for", "a", "in", "attrs", ":", "if", "not", "a", ".", "init", ":", "continue", "attr_name", "=", "a"...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
get
Constructs a request to the PyPI server and returns a :class:`yarg.package.Package`. :param package_name: case sensitive name of the package on the PyPI server. :param pypi_server: (option) URL to the PyPI server. >>> import yarg >>> package = yarg.get('yarg') <Package yarg>
pipenv/vendor/yarg/client.py
def get(package_name, pypi_server="https://pypi.python.org/pypi/"): """ Constructs a request to the PyPI server and returns a :class:`yarg.package.Package`. :param package_name: case sensitive name of the package on the PyPI server. :param pypi_server: (option) URL to the PyPI server. >>> ...
def get(package_name, pypi_server="https://pypi.python.org/pypi/"): """ Constructs a request to the PyPI server and returns a :class:`yarg.package.Package`. :param package_name: case sensitive name of the package on the PyPI server. :param pypi_server: (option) URL to the PyPI server. >>> ...
[ "Constructs", "a", "request", "to", "the", "PyPI", "server", "and", "returns", "a", ":", "class", ":", "yarg", ".", "package", ".", "Package", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/yarg/client.py#L32-L54
[ "def", "get", "(", "package_name", ",", "pypi_server", "=", "\"https://pypi.python.org/pypi/\"", ")", ":", "if", "not", "pypi_server", ".", "endswith", "(", "\"/\"", ")", ":", "pypi_server", "=", "pypi_server", "+", "\"/\"", "response", "=", "requests", ".", "...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
resolve_ctx
Parse into a hierarchy of contexts. Contexts are connected through the parent variable. :param cli: command definition :param prog_name: the program that is running :param args: full list of args :return: the final context/command parsed
pipenv/vendor/click/_bashcomplete.py
def resolve_ctx(cli, prog_name, args): """ Parse into a hierarchy of contexts. Contexts are connected through the parent variable. :param cli: command definition :param prog_name: the program that is running :param args: full list of args :return: the final context/command parsed """ ctx...
def resolve_ctx(cli, prog_name, args): """ Parse into a hierarchy of contexts. Contexts are connected through the parent variable. :param cli: command definition :param prog_name: the program that is running :param args: full list of args :return: the final context/command parsed """ ctx...
[ "Parse", "into", "a", "hierarchy", "of", "contexts", ".", "Contexts", "are", "connected", "through", "the", "parent", "variable", ".", ":", "param", "cli", ":", "command", "definition", ":", "param", "prog_name", ":", "the", "program", "that", "is", "running...
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/click/_bashcomplete.py#L85-L119
[ "def", "resolve_ctx", "(", "cli", ",", "prog_name", ",", "args", ")", ":", "ctx", "=", "cli", ".", "make_context", "(", "prog_name", ",", "args", ",", "resilient_parsing", "=", "True", ")", "args", "=", "ctx", ".", "protected_args", "+", "ctx", ".", "a...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
is_incomplete_option
:param all_args: the full original list of args supplied :param cmd_param: the current command paramter :return: whether or not the last option declaration (i.e. starts "-" or "--") is incomplete and corresponds to this cmd_param. In other words whether this cmd_param option can still accept values
pipenv/vendor/click/_bashcomplete.py
def is_incomplete_option(all_args, cmd_param): """ :param all_args: the full original list of args supplied :param cmd_param: the current command paramter :return: whether or not the last option declaration (i.e. starts "-" or "--") is incomplete and corresponds to this cmd_param. In other words whe...
def is_incomplete_option(all_args, cmd_param): """ :param all_args: the full original list of args supplied :param cmd_param: the current command paramter :return: whether or not the last option declaration (i.e. starts "-" or "--") is incomplete and corresponds to this cmd_param. In other words whe...
[ ":", "param", "all_args", ":", "the", "full", "original", "list", "of", "args", "supplied", ":", "param", "cmd_param", ":", "the", "current", "command", "paramter", ":", "return", ":", "whether", "or", "not", "the", "last", "option", "declaration", "(", "i...
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/click/_bashcomplete.py#L130-L149
[ "def", "is_incomplete_option", "(", "all_args", ",", "cmd_param", ")", ":", "if", "not", "isinstance", "(", "cmd_param", ",", "Option", ")", ":", "return", "False", "if", "cmd_param", ".", "is_flag", ":", "return", "False", "last_option", "=", "None", "for",...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
is_incomplete_argument
:param current_params: the current params and values for this argument as already entered :param cmd_param: the current command parameter :return: whether or not the last argument is incomplete and corresponds to this cmd_param. In other words whether or not the this cmd_param argument can still accept valu...
pipenv/vendor/click/_bashcomplete.py
def is_incomplete_argument(current_params, cmd_param): """ :param current_params: the current params and values for this argument as already entered :param cmd_param: the current command parameter :return: whether or not the last argument is incomplete and corresponds to this cmd_param. In other wor...
def is_incomplete_argument(current_params, cmd_param): """ :param current_params: the current params and values for this argument as already entered :param cmd_param: the current command parameter :return: whether or not the last argument is incomplete and corresponds to this cmd_param. In other wor...
[ ":", "param", "current_params", ":", "the", "current", "params", "and", "values", "for", "this", "argument", "as", "already", "entered", ":", "param", "cmd_param", ":", "the", "current", "command", "parameter", ":", "return", ":", "whether", "or", "not", "th...
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/click/_bashcomplete.py#L152-L169
[ "def", "is_incomplete_argument", "(", "current_params", ",", "cmd_param", ")", ":", "if", "not", "isinstance", "(", "cmd_param", ",", "Argument", ")", ":", "return", "False", "current_param_values", "=", "current_params", "[", "cmd_param", ".", "name", "]", "if"...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
get_user_autocompletions
:param ctx: context associated with the parsed command :param args: full list of args :param incomplete: the incomplete text to autocomplete :param cmd_param: command definition :return: all the possible user-specified completions for the param
pipenv/vendor/click/_bashcomplete.py
def get_user_autocompletions(ctx, args, incomplete, cmd_param): """ :param ctx: context associated with the parsed command :param args: full list of args :param incomplete: the incomplete text to autocomplete :param cmd_param: command definition :return: all the possible user-specified completio...
def get_user_autocompletions(ctx, args, incomplete, cmd_param): """ :param ctx: context associated with the parsed command :param args: full list of args :param incomplete: the incomplete text to autocomplete :param cmd_param: command definition :return: all the possible user-specified completio...
[ ":", "param", "ctx", ":", "context", "associated", "with", "the", "parsed", "command", ":", "param", "args", ":", "full", "list", "of", "args", ":", "param", "incomplete", ":", "the", "incomplete", "text", "to", "autocomplete", ":", "param", "cmd_param", "...
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/click/_bashcomplete.py#L172-L191
[ "def", "get_user_autocompletions", "(", "ctx", ",", "args", ",", "incomplete", ",", "cmd_param", ")", ":", "results", "=", "[", "]", "if", "isinstance", "(", "cmd_param", ".", "type", ",", "Choice", ")", ":", "# Choices don't support descriptions.", "results", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
get_visible_commands_starting_with
:param ctx: context associated with the parsed command :starts_with: string that visible commands must start with. :return: all visible (not hidden) commands that start with starts_with.
pipenv/vendor/click/_bashcomplete.py
def get_visible_commands_starting_with(ctx, starts_with): """ :param ctx: context associated with the parsed command :starts_with: string that visible commands must start with. :return: all visible (not hidden) commands that start with starts_with. """ for c in ctx.command.list_commands(ctx): ...
def get_visible_commands_starting_with(ctx, starts_with): """ :param ctx: context associated with the parsed command :starts_with: string that visible commands must start with. :return: all visible (not hidden) commands that start with starts_with. """ for c in ctx.command.list_commands(ctx): ...
[ ":", "param", "ctx", ":", "context", "associated", "with", "the", "parsed", "command", ":", "starts_with", ":", "string", "that", "visible", "commands", "must", "start", "with", ".", ":", "return", ":", "all", "visible", "(", "not", "hidden", ")", "command...
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/click/_bashcomplete.py#L194-L204
[ "def", "get_visible_commands_starting_with", "(", "ctx", ",", "starts_with", ")", ":", "for", "c", "in", "ctx", ".", "command", ".", "list_commands", "(", "ctx", ")", ":", "if", "c", ".", "startswith", "(", "starts_with", ")", ":", "command", "=", "ctx", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
get_choices
:param cli: command definition :param prog_name: the program that is running :param args: full list of args :param incomplete: the incomplete text to autocomplete :return: all the possible completions for the incomplete
pipenv/vendor/click/_bashcomplete.py
def get_choices(cli, prog_name, args, incomplete): """ :param cli: command definition :param prog_name: the program that is running :param args: full list of args :param incomplete: the incomplete text to autocomplete :return: all the possible completions for the incomplete """ all_args ...
def get_choices(cli, prog_name, args, incomplete): """ :param cli: command definition :param prog_name: the program that is running :param args: full list of args :param incomplete: the incomplete text to autocomplete :return: all the possible completions for the incomplete """ all_args ...
[ ":", "param", "cli", ":", "command", "definition", ":", "param", "prog_name", ":", "the", "program", "that", "is", "running", ":", "param", "args", ":", "full", "list", "of", "args", ":", "param", "incomplete", ":", "the", "incomplete", "text", "to", "au...
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/click/_bashcomplete.py#L222-L265
[ "def", "get_choices", "(", "cli", ",", "prog_name", ",", "args", ",", "incomplete", ")", ":", "all_args", "=", "copy", ".", "deepcopy", "(", "args", ")", "ctx", "=", "resolve_ctx", "(", "cli", ",", "prog_name", ",", "args", ")", "if", "ctx", "is", "N...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
interpret
Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping
pipenv/vendor/distlib/markers.py
def interpret(marker, execution_context=None): """ Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping """ try: exp...
def interpret(marker, execution_context=None): """ Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping """ try: exp...
[ "Interpret", "a", "marker", "and", "return", "a", "result", "depending", "on", "environment", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/markers.py#L113-L131
[ "def", "interpret", "(", "marker", ",", "execution_context", "=", "None", ")", ":", "try", ":", "expr", ",", "rest", "=", "parse_marker", "(", "marker", ")", "except", "Exception", "as", "e", ":", "raise", "SyntaxError", "(", "'Unable to interpret marker synta...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Evaluator.evaluate
Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context.
pipenv/vendor/distlib/markers.py
def evaluate(self, expr, context): """ Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. """ if isinstance(expr, string_types): if expr[0] in '\'"': result = expr[1:-1] else: ...
def evaluate(self, expr, context): """ Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. """ if isinstance(expr, string_types): if expr[0] in '\'"': result = expr[1:-1] else: ...
[ "Evaluate", "a", "marker", "expression", "returned", "by", "the", ":", "func", ":", "parse_requirement", "function", "in", "the", "specified", "context", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/distlib/markers.py#L50-L75
[ "def", "evaluate", "(", "self", ",", "expr", ",", "context", ")", ":", "if", "isinstance", "(", "expr", ",", "string_types", ")", ":", "if", "expr", "[", "0", "]", "in", "'\\'\"'", ":", "result", "=", "expr", "[", "1", ":", "-", "1", "]", "else",...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
colored
Colorize text using a reimplementation of the colorizer from https://github.com/pavdmyt/yaspin so that it works on windows. Available text colors: red, green, yellow, blue, magenta, cyan, white. Available text highlights: on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white....
pipenv/vendor/vistir/termcolors.py
def colored(text, color=None, on_color=None, attrs=None): """Colorize text using a reimplementation of the colorizer from https://github.com/pavdmyt/yaspin so that it works on windows. Available text colors: red, green, yellow, blue, magenta, cyan, white. Available text highlights: on_...
def colored(text, color=None, on_color=None, attrs=None): """Colorize text using a reimplementation of the colorizer from https://github.com/pavdmyt/yaspin so that it works on windows. Available text colors: red, green, yellow, blue, magenta, cyan, white. Available text highlights: on_...
[ "Colorize", "text", "using", "a", "reimplementation", "of", "the", "colorizer", "from", "https", ":", "//", "github", ".", "com", "/", "pavdmyt", "/", "yaspin", "so", "that", "it", "works", "on", "windows", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/vistir/termcolors.py#L85-L132
[ "def", "colored", "(", "text", ",", "color", "=", "None", ",", "on_color", "=", "None", ",", "attrs", "=", "None", ")", ":", "if", "os", ".", "getenv", "(", "\"ANSI_COLORS_DISABLED\"", ")", "is", "None", ":", "style", "=", "\"NORMAL\"", "if", "\"bold\"...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser.inc_n
Increments the parser by n characters if the end of the input has not been reached.
pipenv/vendor/tomlkit/parser.py
def inc_n(self, n, exception=None): # type: (int, Optional[ParseError]) -> bool """ Increments the parser by n characters if the end of the input has not been reached. """ return self._src.inc_n(n=n, exception=exception)
def inc_n(self, n, exception=None): # type: (int, Optional[ParseError]) -> bool """ Increments the parser by n characters if the end of the input has not been reached. """ return self._src.inc_n(n=n, exception=exception)
[ "Increments", "the", "parser", "by", "n", "characters", "if", "the", "end", "of", "the", "input", "has", "not", "been", "reached", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L91-L96
[ "def", "inc_n", "(", "self", ",", "n", ",", "exception", "=", "None", ")", ":", "# type: (int, Optional[ParseError]) -> bool", "return", "self", ".", "_src", ".", "inc_n", "(", "n", "=", "n", ",", "exception", "=", "exception", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser.consume
Consume chars until min/max is satisfied is valid.
pipenv/vendor/tomlkit/parser.py
def consume(self, chars, min=0, max=-1): """ Consume chars until min/max is satisfied is valid. """ return self._src.consume(chars=chars, min=min, max=max)
def consume(self, chars, min=0, max=-1): """ Consume chars until min/max is satisfied is valid. """ return self._src.consume(chars=chars, min=min, max=max)
[ "Consume", "chars", "until", "min", "/", "max", "is", "satisfied", "is", "valid", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L98-L102
[ "def", "consume", "(", "self", ",", "chars", ",", "min", "=", "0", ",", "max", "=", "-", "1", ")", ":", "return", "self", ".", "_src", ".", "consume", "(", "chars", "=", "chars", ",", "min", "=", "min", ",", "max", "=", "max", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser.parse_error
Creates a generic "parse error" at the current position.
pipenv/vendor/tomlkit/parser.py
def parse_error(self, exception=ParseError, *args): """ Creates a generic "parse error" at the current position. """ return self._src.parse_error(exception, *args)
def parse_error(self, exception=ParseError, *args): """ Creates a generic "parse error" at the current position. """ return self._src.parse_error(exception, *args)
[ "Creates", "a", "generic", "parse", "error", "at", "the", "current", "position", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L116-L120
[ "def", "parse_error", "(", "self", ",", "exception", "=", "ParseError", ",", "*", "args", ")", ":", "return", "self", ".", "_src", ".", "parse_error", "(", "exception", ",", "*", "args", ")" ]
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser._merge_ws
Merges the given Item with the last one currently in the given Container if both are whitespace items. Returns True if the items were merged.
pipenv/vendor/tomlkit/parser.py
def _merge_ws(self, item, container): # type: (Item, Container) -> bool """ Merges the given Item with the last one currently in the given Container if both are whitespace items. Returns True if the items were merged. """ last = container.last_item() if not last...
def _merge_ws(self, item, container): # type: (Item, Container) -> bool """ Merges the given Item with the last one currently in the given Container if both are whitespace items. Returns True if the items were merged. """ last = container.last_item() if not last...
[ "Merges", "the", "given", "Item", "with", "the", "last", "one", "currently", "in", "the", "given", "Container", "if", "both", "are", "whitespace", "items", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L158-L178
[ "def", "_merge_ws", "(", "self", ",", "item", ",", "container", ")", ":", "# type: (Item, Container) -> bool", "last", "=", "container", ".", "last_item", "(", ")", "if", "not", "last", ":", "return", "False", "if", "not", "isinstance", "(", "item", ",", "...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser._is_child
Returns whether a key is strictly a child of another key. AoT siblings are not considered children of one another.
pipenv/vendor/tomlkit/parser.py
def _is_child(self, parent, child): # type: (str, str) -> bool """ Returns whether a key is strictly a child of another key. AoT siblings are not considered children of one another. """ parent_parts = tuple(self._split_table_name(parent)) child_parts = tuple(self._split_...
def _is_child(self, parent, child): # type: (str, str) -> bool """ Returns whether a key is strictly a child of another key. AoT siblings are not considered children of one another. """ parent_parts = tuple(self._split_table_name(parent)) child_parts = tuple(self._split_...
[ "Returns", "whether", "a", "key", "is", "strictly", "a", "child", "of", "another", "key", ".", "AoT", "siblings", "are", "not", "considered", "children", "of", "one", "another", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L180-L191
[ "def", "_is_child", "(", "self", ",", "parent", ",", "child", ")", ":", "# type: (str, str) -> bool", "parent_parts", "=", "tuple", "(", "self", ".", "_split_table_name", "(", "parent", ")", ")", "child_parts", "=", "tuple", "(", "self", ".", "_split_table_nam...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser._parse_item
Attempts to parse the next item and returns it, along with its key if the item is value-like.
pipenv/vendor/tomlkit/parser.py
def _parse_item(self): # type: () -> Optional[Tuple[Optional[Key], Item]] """ Attempts to parse the next item and returns it, along with its key if the item is value-like. """ self.mark() with self._state as state: while True: c = self._curren...
def _parse_item(self): # type: () -> Optional[Tuple[Optional[Key], Item]] """ Attempts to parse the next item and returns it, along with its key if the item is value-like. """ self.mark() with self._state as state: while True: c = self._curren...
[ "Attempts", "to", "parse", "the", "next", "item", "and", "returns", "it", "along", "with", "its", "key", "if", "the", "item", "is", "value", "-", "like", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L236-L270
[ "def", "_parse_item", "(", "self", ")", ":", "# type: () -> Optional[Tuple[Optional[Key], Item]]", "self", ".", "mark", "(", ")", "with", "self", ".", "_state", "as", "state", ":", "while", "True", ":", "c", "=", "self", ".", "_current", "if", "c", "==", "...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser._parse_comment_trail
Returns (comment_ws, comment, trail) If there is no comment, comment_ws and comment will simply be empty.
pipenv/vendor/tomlkit/parser.py
def _parse_comment_trail(self): # type: () -> Tuple[str, str, str] """ Returns (comment_ws, comment, trail) If there is no comment, comment_ws and comment will simply be empty. """ if self.end(): return "", "", "" comment = "" comment_ws = ""...
def _parse_comment_trail(self): # type: () -> Tuple[str, str, str] """ Returns (comment_ws, comment, trail) If there is no comment, comment_ws and comment will simply be empty. """ if self.end(): return "", "", "" comment = "" comment_ws = ""...
[ "Returns", "(", "comment_ws", "comment", "trail", ")", "If", "there", "is", "no", "comment", "comment_ws", "and", "comment", "will", "simply", "be", "empty", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L272-L325
[ "def", "_parse_comment_trail", "(", "self", ")", ":", "# type: () -> Tuple[str, str, str]", "if", "self", ".", "end", "(", ")", ":", "return", "\"\"", ",", "\"\"", ",", "\"\"", "comment", "=", "\"\"", "comment_ws", "=", "\"\"", "self", ".", "mark", "(", ")...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser._parse_quoted_key
Parses a key enclosed in either single or double quotes.
pipenv/vendor/tomlkit/parser.py
def _parse_quoted_key(self): # type: () -> Key """ Parses a key enclosed in either single or double quotes. """ quote_style = self._current key_type = None dotted = False for t in KeyType: if t.value == quote_style: key_type = t ...
def _parse_quoted_key(self): # type: () -> Key """ Parses a key enclosed in either single or double quotes. """ quote_style = self._current key_type = None dotted = False for t in KeyType: if t.value == quote_style: key_type = t ...
[ "Parses", "a", "key", "enclosed", "in", "either", "single", "or", "double", "quotes", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L381-L412
[ "def", "_parse_quoted_key", "(", "self", ")", ":", "# type: () -> Key", "quote_style", "=", "self", ".", "_current", "key_type", "=", "None", "dotted", "=", "False", "for", "t", "in", "KeyType", ":", "if", "t", ".", "value", "==", "quote_style", ":", "key_...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser._parse_bare_key
Parses a bare key.
pipenv/vendor/tomlkit/parser.py
def _parse_bare_key(self): # type: () -> Key """ Parses a bare key. """ key_type = None dotted = False self.mark() while self._current.is_bare_key_char() and self.inc(): pass key = self.extract() if self._current == ".": ...
def _parse_bare_key(self): # type: () -> Key """ Parses a bare key. """ key_type = None dotted = False self.mark() while self._current.is_bare_key_char() and self.inc(): pass key = self.extract() if self._current == ".": ...
[ "Parses", "a", "bare", "key", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L414-L433
[ "def", "_parse_bare_key", "(", "self", ")", ":", "# type: () -> Key", "key_type", "=", "None", "dotted", "=", "False", "self", ".", "mark", "(", ")", "while", "self", ".", "_current", ".", "is_bare_key_char", "(", ")", "and", "self", ".", "inc", "(", ")"...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser._parse_value
Attempts to parse a value at the current position.
pipenv/vendor/tomlkit/parser.py
def _parse_value(self): # type: () -> Item """ Attempts to parse a value at the current position. """ self.mark() c = self._current trivia = Trivia() if c == StringType.SLB.value: return self._parse_basic_string() elif c == StringType.SLL.val...
def _parse_value(self): # type: () -> Item """ Attempts to parse a value at the current position. """ self.mark() c = self._current trivia = Trivia() if c == StringType.SLB.value: return self._parse_basic_string() elif c == StringType.SLL.val...
[ "Attempts", "to", "parse", "a", "value", "at", "the", "current", "position", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L469-L542
[ "def", "_parse_value", "(", "self", ")", ":", "# type: () -> Item", "self", ".", "mark", "(", ")", "c", "=", "self", ".", "_current", "trivia", "=", "Trivia", "(", ")", "if", "c", "==", "StringType", ".", "SLB", ".", "value", ":", "return", "self", "...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser._parse_table
Parses a table element.
pipenv/vendor/tomlkit/parser.py
def _parse_table( self, parent_name=None ): # type: (Optional[str]) -> Tuple[Key, Union[Table, AoT]] """ Parses a table element. """ if self._current != "[": raise self.parse_error( InternalParserError, "_parse_table() called on non-bracket charac...
def _parse_table( self, parent_name=None ): # type: (Optional[str]) -> Tuple[Key, Union[Table, AoT]] """ Parses a table element. """ if self._current != "[": raise self.parse_error( InternalParserError, "_parse_table() called on non-bracket charac...
[ "Parses", "a", "table", "element", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L855-L1005
[ "def", "_parse_table", "(", "self", ",", "parent_name", "=", "None", ")", ":", "# type: (Optional[str]) -> Tuple[Key, Union[Table, AoT]]", "if", "self", ".", "_current", "!=", "\"[\"", ":", "raise", "self", ".", "parse_error", "(", "InternalParserError", ",", "\"_pa...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser._peek_table
Peeks ahead non-intrusively by cloning then restoring the initial state of the parser. Returns the name of the table about to be parsed, as well as whether it is part of an AoT.
pipenv/vendor/tomlkit/parser.py
def _peek_table(self): # type: () -> Tuple[bool, str] """ Peeks ahead non-intrusively by cloning then restoring the initial state of the parser. Returns the name of the table about to be parsed, as well as whether it is part of an AoT. """ # we always want to re...
def _peek_table(self): # type: () -> Tuple[bool, str] """ Peeks ahead non-intrusively by cloning then restoring the initial state of the parser. Returns the name of the table about to be parsed, as well as whether it is part of an AoT. """ # we always want to re...
[ "Peeks", "ahead", "non", "-", "intrusively", "by", "cloning", "then", "restoring", "the", "initial", "state", "of", "the", "parser", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L1007-L1035
[ "def", "_peek_table", "(", "self", ")", ":", "# type: () -> Tuple[bool, str]", "# we always want to restore after exiting this scope", "with", "self", ".", "_state", "(", "save_marker", "=", "True", ",", "restore", "=", "True", ")", ":", "if", "self", ".", "_current...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser._parse_aot
Parses all siblings of the provided table first and bundles them into an AoT.
pipenv/vendor/tomlkit/parser.py
def _parse_aot(self, first, name_first): # type: (Table, str) -> AoT """ Parses all siblings of the provided table first and bundles them into an AoT. """ payload = [first] self._aot_stack.append(name_first) while not self.end(): is_aot_next, name_nex...
def _parse_aot(self, first, name_first): # type: (Table, str) -> AoT """ Parses all siblings of the provided table first and bundles them into an AoT. """ payload = [first] self._aot_stack.append(name_first) while not self.end(): is_aot_next, name_nex...
[ "Parses", "all", "siblings", "of", "the", "provided", "table", "first", "and", "bundles", "them", "into", "an", "AoT", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L1037-L1054
[ "def", "_parse_aot", "(", "self", ",", "first", ",", "name_first", ")", ":", "# type: (Table, str) -> AoT", "payload", "=", "[", "first", "]", "self", ".", "_aot_stack", ".", "append", "(", "name_first", ")", "while", "not", "self", ".", "end", "(", ")", ...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser._peek
Peeks ahead n characters. n is the max number of characters that will be peeked.
pipenv/vendor/tomlkit/parser.py
def _peek(self, n): # type: (int) -> str """ Peeks ahead n characters. n is the max number of characters that will be peeked. """ # we always want to restore after exiting this scope with self._state(restore=True): buf = "" for _ in range(n): ...
def _peek(self, n): # type: (int) -> str """ Peeks ahead n characters. n is the max number of characters that will be peeked. """ # we always want to restore after exiting this scope with self._state(restore=True): buf = "" for _ in range(n): ...
[ "Peeks", "ahead", "n", "characters", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L1056-L1072
[ "def", "_peek", "(", "self", ",", "n", ")", ":", "# type: (int) -> str", "# we always want to restore after exiting this scope", "with", "self", ".", "_state", "(", "restore", "=", "True", ")", ":", "buf", "=", "\"\"", "for", "_", "in", "range", "(", "n", ")...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
Parser._peek_unicode
Peeks ahead non-intrusively by cloning then restoring the initial state of the parser. Returns the unicode value is it's a valid one else None.
pipenv/vendor/tomlkit/parser.py
def _peek_unicode( self, is_long ): # type: (bool) -> Tuple[Optional[str], Optional[str]] """ Peeks ahead non-intrusively by cloning then restoring the initial state of the parser. Returns the unicode value is it's a valid one else None. """ # we always want...
def _peek_unicode( self, is_long ): # type: (bool) -> Tuple[Optional[str], Optional[str]] """ Peeks ahead non-intrusively by cloning then restoring the initial state of the parser. Returns the unicode value is it's a valid one else None. """ # we always want...
[ "Peeks", "ahead", "non", "-", "intrusively", "by", "cloning", "then", "restoring", "the", "initial", "state", "of", "the", "parser", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/tomlkit/parser.py#L1074-L1111
[ "def", "_peek_unicode", "(", "self", ",", "is_long", ")", ":", "# type: (bool) -> Tuple[Optional[str], Optional[str]]", "# we always want to restore after exiting this scope", "with", "self", ".", "_state", "(", "save_marker", "=", "True", ",", "restore", "=", "True", ")"...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
split_first
Given a string and an iterable of delimiters, split on the first found delimiter. Return two split parts and the matched delimiter. If not found, then the first part is the full input string. Example:: >>> split_first('foo/bar?baz', '?/=') ('foo', 'bar?baz', '/') >>> split_first('...
pipenv/vendor/urllib3/util/url.py
def split_first(s, delims): """ Given a string and an iterable of delimiters, split on the first found delimiter. Return two split parts and the matched delimiter. If not found, then the first part is the full input string. Example:: >>> split_first('foo/bar?baz', '?/=') ('foo', '...
def split_first(s, delims): """ Given a string and an iterable of delimiters, split on the first found delimiter. Return two split parts and the matched delimiter. If not found, then the first part is the full input string. Example:: >>> split_first('foo/bar?baz', '?/=') ('foo', '...
[ "Given", "a", "string", "and", "an", "iterable", "of", "delimiters", "split", "on", "the", "first", "found", "delimiter", ".", "Return", "two", "split", "parts", "and", "the", "matched", "delimiter", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/util/url.py#L99-L129
[ "def", "split_first", "(", "s", ",", "delims", ")", ":", "min_idx", "=", "None", "min_delim", "=", "None", "for", "d", "in", "delims", ":", "idx", "=", "s", ".", "find", "(", "d", ")", "if", "idx", "<", "0", ":", "continue", "if", "min_idx", "is"...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde
train
parse_url
Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is performed to parse incomplete urls. Fields not provided will be None. Partly backwards-compatible with :mod:`urlparse`. Example:: >>> parse_url('http://google.com/mail/') Url(scheme='http', host='google.com', port=None,...
pipenv/vendor/urllib3/util/url.py
def parse_url(url): """ Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is performed to parse incomplete urls. Fields not provided will be None. Partly backwards-compatible with :mod:`urlparse`. Example:: >>> parse_url('http://google.com/mail/') Url(scheme='http...
def parse_url(url): """ Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is performed to parse incomplete urls. Fields not provided will be None. Partly backwards-compatible with :mod:`urlparse`. Example:: >>> parse_url('http://google.com/mail/') Url(scheme='http...
[ "Given", "a", "url", "return", "a", "parsed", ":", "class", ":", ".", "Url", "namedtuple", ".", "Best", "-", "effort", "is", "performed", "to", "parse", "incomplete", "urls", ".", "Fields", "not", "provided", "will", "be", "None", "." ]
pypa/pipenv
python
https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/util/url.py#L132-L222
[ "def", "parse_url", "(", "url", ")", ":", "# While this code has overlap with stdlib's urlparse, it is much", "# simplified for our needs and less annoying.", "# Additionally, this implementations does silly things to be optimal", "# on CPython.", "if", "not", "url", ":", "# Empty", "r...
cae8d76c210b9777e90aab76e9c4b0e53bb19cde