repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/utils.py
generate_lorem_ipsum
def generate_lorem_ipsum(n=5, html=True, min=20, max=100): """Generate some lorem impsum for the template.""" from jinja2.constants import LOREM_IPSUM_WORDS from random import choice, randrange words = LOREM_IPSUM_WORDS.split() result = [] for _ in xrange(n): next_capitalized = True ...
python
def generate_lorem_ipsum(n=5, html=True, min=20, max=100): """Generate some lorem impsum for the template.""" from jinja2.constants import LOREM_IPSUM_WORDS from random import choice, randrange words = LOREM_IPSUM_WORDS.split() result = [] for _ in xrange(n): next_capitalized = True ...
[ "def", "generate_lorem_ipsum", "(", "n", "=", "5", ",", "html", "=", "True", ",", "min", "=", "20", ",", "max", "=", "100", ")", ":", "from", "jinja2", ".", "constants", "import", "LOREM_IPSUM_WORDS", "from", "random", "import", "choice", ",", "randrange...
Generate some lorem impsum for the template.
[ "Generate", "some", "lorem", "impsum", "for", "the", "template", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/utils.py#L302-L348
train
Generate some lorem impsum for the template.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/utils.py
Markup.unescape
def unescape(self): r"""Unescape markup again into an unicode string. This also resolves known HTML4 and XHTML entities: >>> Markup("Main &raquo; <em>About</em>").unescape() u'Main \xbb <em>About</em>' """ from jinja2.constants import HTML_ENTITIES def handle_ma...
python
def unescape(self): r"""Unescape markup again into an unicode string. This also resolves known HTML4 and XHTML entities: >>> Markup("Main &raquo; <em>About</em>").unescape() u'Main \xbb <em>About</em>' """ from jinja2.constants import HTML_ENTITIES def handle_ma...
[ "def", "unescape", "(", "self", ")", ":", "from", "jinja2", ".", "constants", "import", "HTML_ENTITIES", "def", "handle_match", "(", "m", ")", ":", "name", "=", "m", ".", "group", "(", "1", ")", "if", "name", "in", "HTML_ENTITIES", ":", "return", "unic...
r"""Unescape markup again into an unicode string. This also resolves known HTML4 and XHTML entities: >>> Markup("Main &raquo; <em>About</em>").unescape() u'Main \xbb <em>About</em>'
[ "r", "Unescape", "markup", "again", "into", "an", "unicode", "string", ".", "This", "also", "resolves", "known", "HTML4", "and", "XHTML", "entities", ":" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/utils.py#L452-L472
train
r Unescape markup again into an unicode string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/utils.py
Markup.striptags
def striptags(self): r"""Unescape markup into an unicode string and strip all tags. This also resolves known HTML4 and XHTML entities. Whitespace is normalized to one: >>> Markup("Main &raquo; <em>About</em>").striptags() u'Main \xbb About' """ stripped = u' '...
python
def striptags(self): r"""Unescape markup into an unicode string and strip all tags. This also resolves known HTML4 and XHTML entities. Whitespace is normalized to one: >>> Markup("Main &raquo; <em>About</em>").striptags() u'Main \xbb About' """ stripped = u' '...
[ "def", "striptags", "(", "self", ")", ":", "stripped", "=", "u' '", ".", "join", "(", "_striptags_re", ".", "sub", "(", "''", ",", "self", ")", ".", "split", "(", ")", ")", "return", "Markup", "(", "stripped", ")", ".", "unescape", "(", ")" ]
r"""Unescape markup into an unicode string and strip all tags. This also resolves known HTML4 and XHTML entities. Whitespace is normalized to one: >>> Markup("Main &raquo; <em>About</em>").striptags() u'Main \xbb About'
[ "r", "Unescape", "markup", "into", "an", "unicode", "string", "and", "strip", "all", "tags", ".", "This", "also", "resolves", "known", "HTML4", "and", "XHTML", "entities", ".", "Whitespace", "is", "normalized", "to", "one", ":" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/utils.py#L474-L483
train
Unescape markup into an unicode string and strip all tags.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/utils.py
LRUCache._remove
def _remove(self, obj): """Python 2.4 compatibility.""" for idx, item in enumerate(self._queue): if item == obj: del self._queue[idx] break
python
def _remove(self, obj): """Python 2.4 compatibility.""" for idx, item in enumerate(self._queue): if item == obj: del self._queue[idx] break
[ "def", "_remove", "(", "self", ",", "obj", ")", ":", "for", "idx", ",", "item", "in", "enumerate", "(", "self", ".", "_queue", ")", ":", "if", "item", "==", "obj", ":", "del", "self", ".", "_queue", "[", "idx", "]", "break" ]
Python 2.4 compatibility.
[ "Python", "2", ".", "4", "compatibility", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/utils.py#L572-L577
train
Remove an item from the queue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/utils.py
Cycler.next
def next(self): """Goes one item ahead and returns it.""" rv = self.current self.pos = (self.pos + 1) % len(self.items) return rv
python
def next(self): """Goes one item ahead and returns it.""" rv = self.current self.pos = (self.pos + 1) % len(self.items) return rv
[ "def", "next", "(", "self", ")", ":", "rv", "=", "self", ".", "current", "self", ".", "pos", "=", "(", "self", ".", "pos", "+", "1", ")", "%", "len", "(", "self", ".", "items", ")", "return", "rv" ]
Goes one item ahead and returns it.
[ "Goes", "one", "item", "ahead", "and", "returns", "it", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/utils.py#L757-L761
train
Goes one item ahead and returns it.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/recipes/libtorrent/__init__.py
get_lib_from
def get_lib_from(search_directory, lib_extension='.so'): '''Scan directories recursively until find any file with the given extension. The default extension to search is ``.so``.''' for root, dirs, files in walk(search_directory): for file in files: if file.endswith(lib_extension): ...
python
def get_lib_from(search_directory, lib_extension='.so'): '''Scan directories recursively until find any file with the given extension. The default extension to search is ``.so``.''' for root, dirs, files in walk(search_directory): for file in files: if file.endswith(lib_extension): ...
[ "def", "get_lib_from", "(", "search_directory", ",", "lib_extension", "=", "'.so'", ")", ":", "for", "root", ",", "dirs", ",", "files", "in", "walk", "(", "search_directory", ")", ":", "for", "file", "in", "files", ":", "if", "file", ".", "endswith", "("...
Scan directories recursively until find any file with the given extension. The default extension to search is ``.so``.
[ "Scan", "directories", "recursively", "until", "find", "any", "file", "with", "the", "given", "extension", ".", "The", "default", "extension", "to", "search", "is", ".", "so", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/recipes/libtorrent/__init__.py#L12-L21
train
Scan directories recursively until find any file with the given lib_extension.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/parser.py
Parser.parse_set
def parse_set(self): """Parse an assign statement.""" lineno = next(self.stream).lineno target = self.parse_assign_target() self.stream.expect('assign') expr = self.parse_tuple() return nodes.Assign(target, expr, lineno=lineno)
python
def parse_set(self): """Parse an assign statement.""" lineno = next(self.stream).lineno target = self.parse_assign_target() self.stream.expect('assign') expr = self.parse_tuple() return nodes.Assign(target, expr, lineno=lineno)
[ "def", "parse_set", "(", "self", ")", ":", "lineno", "=", "next", "(", "self", ".", "stream", ")", ".", "lineno", "target", "=", "self", ".", "parse_assign_target", "(", ")", "self", ".", "stream", ".", "expect", "(", "'assign'", ")", "expr", "=", "s...
Parse an assign statement.
[ "Parse", "an", "assign", "statement", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/parser.py#L168-L174
train
Parse an assign statement.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/parser.py
Parser.parse_assign_target
def parse_assign_target(self, with_tuple=True, name_only=False, extra_end_rules=None): """Parse an assignment target. As Jinja2 allows assignments to tuples, this function can parse all allowed assignment targets. Per default assignments to tuples are parsed, that c...
python
def parse_assign_target(self, with_tuple=True, name_only=False, extra_end_rules=None): """Parse an assignment target. As Jinja2 allows assignments to tuples, this function can parse all allowed assignment targets. Per default assignments to tuples are parsed, that c...
[ "def", "parse_assign_target", "(", "self", ",", "with_tuple", "=", "True", ",", "name_only", "=", "False", ",", "extra_end_rules", "=", "None", ")", ":", "if", "name_only", ":", "token", "=", "self", ".", "stream", ".", "expect", "(", "'name'", ")", "tar...
Parse an assignment target. As Jinja2 allows assignments to tuples, this function can parse all allowed assignment targets. Per default assignments to tuples are parsed, that can be disable however by setting `with_tuple` to `False`. If only assignments to names are wanted `name_only`...
[ "Parse", "an", "assignment", "target", ".", "As", "Jinja2", "allows", "assignments", "to", "tuples", "this", "function", "can", "parse", "all", "allowed", "assignment", "targets", ".", "Per", "default", "assignments", "to", "tuples", "are", "parsed", "that", "...
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/parser.py#L356-L378
train
Parse an assignment target.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/parser.py
Parser.parse_tuple
def parse_tuple(self, simplified=False, with_condexpr=True, extra_end_rules=None, explicit_parentheses=False): """Works like `parse_expression` but if multiple expressions are delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created. This method could also return a...
python
def parse_tuple(self, simplified=False, with_condexpr=True, extra_end_rules=None, explicit_parentheses=False): """Works like `parse_expression` but if multiple expressions are delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created. This method could also return a...
[ "def", "parse_tuple", "(", "self", ",", "simplified", "=", "False", ",", "with_condexpr", "=", "True", ",", "extra_end_rules", "=", "None", ",", "explicit_parentheses", "=", "False", ")", ":", "lineno", "=", "self", ".", "stream", ".", "current", ".", "lin...
Works like `parse_expression` but if multiple expressions are delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created. This method could also return a regular expression instead of a tuple if no commas where found. The default parsing mode is a full tuple. If `simplified` i...
[ "Works", "like", "parse_expression", "but", "if", "multiple", "expressions", "are", "delimited", "by", "a", "comma", "a", ":", "class", ":", "~jinja2", ".", "nodes", ".", "Tuple", "node", "is", "created", ".", "This", "method", "could", "also", "return", "...
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/parser.py#L577-L630
train
Parses a tuple from the current line and returns the first element.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/distribution.py
Distribution.get_distribution
def get_distribution(cls, ctx, name=None, recipes=[], ndk_api=None, force_build=False, extra_dist_dirs=[], require_perfect_match=False, allow_replace_dist=True): '''Takes information abou...
python
def get_distribution(cls, ctx, name=None, recipes=[], ndk_api=None, force_build=False, extra_dist_dirs=[], require_perfect_match=False, allow_replace_dist=True): '''Takes information abou...
[ "def", "get_distribution", "(", "cls", ",", "ctx", ",", "name", "=", "None", ",", "recipes", "=", "[", "]", ",", "ndk_api", "=", "None", ",", "force_build", "=", "False", ",", "extra_dist_dirs", "=", "[", "]", ",", "require_perfect_match", "=", "False", ...
Takes information about the distribution, and decides what kind of distribution it will be. If parameters conflict (e.g. a dist with that name already exists, but doesn't have the right set of recipes), an error is thrown. Parameters ---------- name : str ...
[ "Takes", "information", "about", "the", "distribution", "and", "decides", "what", "kind", "of", "distribution", "it", "will", "be", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/distribution.py#L45-L159
train
Returns a new instance of the class Distribution with the specified name recipes and optional extra directories.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/distribution.py
Distribution.get_distributions
def get_distributions(cls, ctx, extra_dist_dirs=[]): '''Returns all the distributions found locally.''' if extra_dist_dirs: raise BuildInterruptingException( 'extra_dist_dirs argument to get_distributions ' 'is not yet implemented') dist_dir = ctx.dist...
python
def get_distributions(cls, ctx, extra_dist_dirs=[]): '''Returns all the distributions found locally.''' if extra_dist_dirs: raise BuildInterruptingException( 'extra_dist_dirs argument to get_distributions ' 'is not yet implemented') dist_dir = ctx.dist...
[ "def", "get_distributions", "(", "cls", ",", "ctx", ",", "extra_dist_dirs", "=", "[", "]", ")", ":", "if", "extra_dist_dirs", ":", "raise", "BuildInterruptingException", "(", "'extra_dist_dirs argument to get_distributions '", "'is not yet implemented'", ")", "dist_dir", ...
Returns all the distributions found locally.
[ "Returns", "all", "the", "distributions", "found", "locally", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/distribution.py#L168-L204
train
Returns all the distributions found locally.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/distribution.py
Distribution.save_info
def save_info(self, dirn): ''' Save information about the distribution in its dist_dir. ''' with current_directory(dirn): info('Saving distribution info') with open('dist_info.json', 'w') as fileh: json.dump({'dist_name': self.ctx.dist_name, ...
python
def save_info(self, dirn): ''' Save information about the distribution in its dist_dir. ''' with current_directory(dirn): info('Saving distribution info') with open('dist_info.json', 'w') as fileh: json.dump({'dist_name': self.ctx.dist_name, ...
[ "def", "save_info", "(", "self", ",", "dirn", ")", ":", "with", "current_directory", "(", "dirn", ")", ":", "info", "(", "'Saving distribution info'", ")", "with", "open", "(", "'dist_info.json'", ",", "'w'", ")", "as", "fileh", ":", "json", ".", "dump", ...
Save information about the distribution in its dist_dir.
[ "Save", "information", "about", "the", "distribution", "in", "its", "dist_dir", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/distribution.py#L206-L221
train
Save information about the distribution in dist_dir.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/bccache.py
Bucket.load_bytecode
def load_bytecode(self, f): """Loads bytecode from a file or file like object.""" # make sure the magic header is correct magic = f.read(len(bc_magic)) if magic != bc_magic: self.reset() return # the source code of the file changed, we need to reload ...
python
def load_bytecode(self, f): """Loads bytecode from a file or file like object.""" # make sure the magic header is correct magic = f.read(len(bc_magic)) if magic != bc_magic: self.reset() return # the source code of the file changed, we need to reload ...
[ "def", "load_bytecode", "(", "self", ",", "f", ")", ":", "# make sure the magic header is correct", "magic", "=", "f", ".", "read", "(", "len", "(", "bc_magic", ")", ")", "if", "magic", "!=", "bc_magic", ":", "self", ".", "reset", "(", ")", "return", "# ...
Loads bytecode from a file or file like object.
[ "Loads", "bytecode", "from", "a", "file", "or", "file", "like", "object", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/bccache.py#L53-L70
train
Loads bytecode from a file or file - like object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/bccache.py
Bucket.write_bytecode
def write_bytecode(self, f): """Dump the bytecode into the file or file like object passed.""" if self.code is None: raise TypeError('can\'t write empty bucket') f.write(bc_magic) pickle.dump(self.checksum, f, 2) if isinstance(f, file): marshal.dump(self.c...
python
def write_bytecode(self, f): """Dump the bytecode into the file or file like object passed.""" if self.code is None: raise TypeError('can\'t write empty bucket') f.write(bc_magic) pickle.dump(self.checksum, f, 2) if isinstance(f, file): marshal.dump(self.c...
[ "def", "write_bytecode", "(", "self", ",", "f", ")", ":", "if", "self", ".", "code", "is", "None", ":", "raise", "TypeError", "(", "'can\\'t write empty bucket'", ")", "f", ".", "write", "(", "bc_magic", ")", "pickle", ".", "dump", "(", "self", ".", "c...
Dump the bytecode into the file or file like object passed.
[ "Dump", "the", "bytecode", "into", "the", "file", "or", "file", "like", "object", "passed", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/bccache.py#L72-L81
train
Dump the bytecode into the file or file like object passed.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/recipes/psycopg2/__init__.py
Psycopg2Recipe.install_python_package
def install_python_package(self, arch, name=None, env=None, is_dir=True): '''Automate the installation of a Python package (or a cython package where the cython components are pre-built).''' if env is None: env = self.get_recipe_env(arch) with current_directory(self.get_buil...
python
def install_python_package(self, arch, name=None, env=None, is_dir=True): '''Automate the installation of a Python package (or a cython package where the cython components are pre-built).''' if env is None: env = self.get_recipe_env(arch) with current_directory(self.get_buil...
[ "def", "install_python_package", "(", "self", ",", "arch", ",", "name", "=", "None", ",", "env", "=", "None", ",", "is_dir", "=", "True", ")", ":", "if", "env", "is", "None", ":", "env", "=", "self", ".", "get_recipe_env", "(", "arch", ")", "with", ...
Automate the installation of a Python package (or a cython package where the cython components are pre-built).
[ "Automate", "the", "installation", "of", "a", "Python", "package", "(", "or", "a", "cython", "package", "where", "the", "cython", "components", "are", "pre", "-", "built", ")", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/recipes/psycopg2/__init__.py#L34-L47
train
Automate the installation of a Python package or a cython package where the cython components are pre - built.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/debug.py
_init_ugly_crap
def _init_ugly_crap(): """This function implements a few ugly things so that we can patch the traceback objects. The function returned allows resetting `tb_next` on any python traceback object. """ import ctypes from types import TracebackType # figure out side of _Py_ssize_t if hasatt...
python
def _init_ugly_crap(): """This function implements a few ugly things so that we can patch the traceback objects. The function returned allows resetting `tb_next` on any python traceback object. """ import ctypes from types import TracebackType # figure out side of _Py_ssize_t if hasatt...
[ "def", "_init_ugly_crap", "(", ")", ":", "import", "ctypes", "from", "types", "import", "TracebackType", "# figure out side of _Py_ssize_t", "if", "hasattr", "(", "ctypes", ".", "pythonapi", ",", "'Py_InitModule4_64'", ")", ":", "_Py_ssize_t", "=", "ctypes", ".", ...
This function implements a few ugly things so that we can patch the traceback objects. The function returned allows resetting `tb_next` on any python traceback object.
[ "This", "function", "implements", "a", "few", "ugly", "things", "so", "that", "we", "can", "patch", "the", "traceback", "objects", ".", "The", "function", "returned", "allows", "resetting", "tb_next", "on", "any", "python", "traceback", "object", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/debug.py#L239-L297
train
This function implements a few ugly things so that we can patch the traceback objects.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/debug.py
ProcessedTraceback.chain_frames
def chain_frames(self): """Chains the frames. Requires ctypes or the speedups extension.""" prev_tb = None for tb in self.frames: if prev_tb is not None: prev_tb.tb_next = tb prev_tb = tb prev_tb.tb_next = None
python
def chain_frames(self): """Chains the frames. Requires ctypes or the speedups extension.""" prev_tb = None for tb in self.frames: if prev_tb is not None: prev_tb.tb_next = tb prev_tb = tb prev_tb.tb_next = None
[ "def", "chain_frames", "(", "self", ")", ":", "prev_tb", "=", "None", "for", "tb", "in", "self", ".", "frames", ":", "if", "prev_tb", "is", "not", "None", ":", "prev_tb", ".", "tb_next", "=", "tb", "prev_tb", "=", "tb", "prev_tb", ".", "tb_next", "="...
Chains the frames. Requires ctypes or the speedups extension.
[ "Chains", "the", "frames", ".", "Requires", "ctypes", "or", "the", "speedups", "extension", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/debug.py#L62-L69
train
Chains the frames. Requires ctypes or the speedups extension.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/lexer.py
compile_rules
def compile_rules(environment): """Compiles all the rules from the environment into a list of rules.""" e = re.escape rules = [ (len(environment.comment_start_string), 'comment', e(environment.comment_start_string)), (len(environment.block_start_string), 'block', e(environm...
python
def compile_rules(environment): """Compiles all the rules from the environment into a list of rules.""" e = re.escape rules = [ (len(environment.comment_start_string), 'comment', e(environment.comment_start_string)), (len(environment.block_start_string), 'block', e(environm...
[ "def", "compile_rules", "(", "environment", ")", ":", "e", "=", "re", ".", "escape", "rules", "=", "[", "(", "len", "(", "environment", ".", "comment_start_string", ")", ",", "'comment'", ",", "e", "(", "environment", ".", "comment_start_string", ")", ")",...
Compiles all the rules from the environment into a list of rules.
[ "Compiles", "all", "the", "rules", "from", "the", "environment", "into", "a", "list", "of", "rules", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/lexer.py#L186-L206
train
Compiles all the rules from the environment into a list of rules.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/lexer.py
TokenStream.look
def look(self): """Look at the next token.""" old_token = next(self) result = self.current self.push(result) self.current = old_token return result
python
def look(self): """Look at the next token.""" old_token = next(self) result = self.current self.push(result) self.current = old_token return result
[ "def", "look", "(", "self", ")", ":", "old_token", "=", "next", "(", "self", ")", "result", "=", "self", ".", "current", "self", ".", "push", "(", "result", ")", "self", ".", "current", "=", "old_token", "return", "result" ]
Look at the next token.
[ "Look", "at", "the", "next", "token", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/lexer.py#L312-L318
train
Look at the next token.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/lexer.py
TokenStream.next
def next(self): """Go one token ahead and return the old one""" rv = self.current if self._pushed: self.current = self._pushed.popleft() elif self.current.type is not TOKEN_EOF: try: self.current = self._next() except StopIteration: ...
python
def next(self): """Go one token ahead and return the old one""" rv = self.current if self._pushed: self.current = self._pushed.popleft() elif self.current.type is not TOKEN_EOF: try: self.current = self._next() except StopIteration: ...
[ "def", "next", "(", "self", ")", ":", "rv", "=", "self", ".", "current", "if", "self", ".", "_pushed", ":", "self", ".", "current", "=", "self", ".", "_pushed", ".", "popleft", "(", ")", "elif", "self", ".", "current", ".", "type", "is", "not", "...
Go one token ahead and return the old one
[ "Go", "one", "token", "ahead", "and", "return", "the", "old", "one" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/lexer.py#L336-L346
train
Go one token ahead and return the old one
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/lexer.py
TokenStream.close
def close(self): """Close the stream.""" self.current = Token(self.current.lineno, TOKEN_EOF, '') self._next = None self.closed = True
python
def close(self): """Close the stream.""" self.current = Token(self.current.lineno, TOKEN_EOF, '') self._next = None self.closed = True
[ "def", "close", "(", "self", ")", ":", "self", ".", "current", "=", "Token", "(", "self", ".", "current", ".", "lineno", ",", "TOKEN_EOF", ",", "''", ")", "self", ".", "_next", "=", "None", "self", ".", "closed", "=", "True" ]
Close the stream.
[ "Close", "the", "stream", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/lexer.py#L348-L352
train
Close the stream.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/lexer.py
TokenStream.expect
def expect(self, expr): """Expect a given token type and return it. This accepts the same argument as :meth:`jinja2.lexer.Token.test`. """ if not self.current.test(expr): expr = describe_token_expr(expr) if self.current.type is TOKEN_EOF: raise Te...
python
def expect(self, expr): """Expect a given token type and return it. This accepts the same argument as :meth:`jinja2.lexer.Token.test`. """ if not self.current.test(expr): expr = describe_token_expr(expr) if self.current.type is TOKEN_EOF: raise Te...
[ "def", "expect", "(", "self", ",", "expr", ")", ":", "if", "not", "self", ".", "current", ".", "test", "(", "expr", ")", ":", "expr", "=", "describe_token_expr", "(", "expr", ")", "if", "self", ".", "current", ".", "type", "is", "TOKEN_EOF", ":", "...
Expect a given token type and return it. This accepts the same argument as :meth:`jinja2.lexer.Token.test`.
[ "Expect", "a", "given", "token", "type", "and", "return", "it", ".", "This", "accepts", "the", "same", "argument", "as", ":", "meth", ":", "jinja2", ".", "lexer", ".", "Token", ".", "test", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/lexer.py#L354-L372
train
Expect a given token type and return it.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/lexer.py
Lexer.tokeniter
def tokeniter(self, source, name, filename=None, state=None): """This method tokenizes the text and returns the tokens in a generator. Use this method if you just want to tokenize a template. """ source = '\n'.join(unicode(source).splitlines()) pos = 0 lineno = 1 ...
python
def tokeniter(self, source, name, filename=None, state=None): """This method tokenizes the text and returns the tokens in a generator. Use this method if you just want to tokenize a template. """ source = '\n'.join(unicode(source).splitlines()) pos = 0 lineno = 1 ...
[ "def", "tokeniter", "(", "self", ",", "source", ",", "name", ",", "filename", "=", "None", ",", "state", "=", "None", ")", ":", "source", "=", "'\\n'", ".", "join", "(", "unicode", "(", "source", ")", ".", "splitlines", "(", ")", ")", "pos", "=", ...
This method tokenizes the text and returns the tokens in a generator. Use this method if you just want to tokenize a template.
[ "This", "method", "tokenizes", "the", "text", "and", "returns", "the", "tokens", "in", "a", "generator", ".", "Use", "this", "method", "if", "you", "just", "want", "to", "tokenize", "a", "template", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/lexer.py#L547-L680
train
This method tokenizes the text and returns the tokens in a sequence.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/recipes/shapely/__init__.py
ShapelyRecipe.get_recipe_env
def get_recipe_env(self, arch, with_flags_in_cc=True): """ Add libgeos headers to path """ env = super(ShapelyRecipe, self).get_recipe_env(arch, with_flags_in_cc) libgeos_dir = Recipe.get_recipe('libgeos', self.ctx).get_build_dir(arch.arch) env['CFLAGS'] += " -I{}/dist/include".format(li...
python
def get_recipe_env(self, arch, with_flags_in_cc=True): """ Add libgeos headers to path """ env = super(ShapelyRecipe, self).get_recipe_env(arch, with_flags_in_cc) libgeos_dir = Recipe.get_recipe('libgeos', self.ctx).get_build_dir(arch.arch) env['CFLAGS'] += " -I{}/dist/include".format(li...
[ "def", "get_recipe_env", "(", "self", ",", "arch", ",", "with_flags_in_cc", "=", "True", ")", ":", "env", "=", "super", "(", "ShapelyRecipe", ",", "self", ")", ".", "get_recipe_env", "(", "arch", ",", "with_flags_in_cc", ")", "libgeos_dir", "=", "Recipe", ...
Add libgeos headers to path
[ "Add", "libgeos", "headers", "to", "path" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/recipes/shapely/__init__.py#L14-L19
train
Add libgeos headers to path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/recommendations.py
read_ndk_version
def read_ndk_version(ndk_dir): """Read the NDK version from the NDK dir, if possible""" try: with open(join(ndk_dir, 'source.properties')) as fileh: ndk_data = fileh.read() except IOError: info('Could not determine NDK version, no source.properties ' 'in the NDK dir'...
python
def read_ndk_version(ndk_dir): """Read the NDK version from the NDK dir, if possible""" try: with open(join(ndk_dir, 'source.properties')) as fileh: ndk_data = fileh.read() except IOError: info('Could not determine NDK version, no source.properties ' 'in the NDK dir'...
[ "def", "read_ndk_version", "(", "ndk_dir", ")", ":", "try", ":", "with", "open", "(", "join", "(", "ndk_dir", ",", "'source.properties'", ")", ")", "as", "fileh", ":", "ndk_data", "=", "fileh", ".", "read", "(", ")", "except", "IOError", ":", "info", "...
Read the NDK version from the NDK dir, if possible
[ "Read", "the", "NDK", "version", "from", "the", "NDK", "dir", "if", "possible" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/recommendations.py#L38-L59
train
Read the NDK version from the NDK dir if possible
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/recommendations.py
check_target_api
def check_target_api(api, arch): """Warn if the user's target API is less than the current minimum recommendation """ if api >= ARMEABI_MAX_TARGET_API and arch == 'armeabi': raise BuildInterruptingException( 'Asked to build for armeabi architecture with API ' '{}, but AP...
python
def check_target_api(api, arch): """Warn if the user's target API is less than the current minimum recommendation """ if api >= ARMEABI_MAX_TARGET_API and arch == 'armeabi': raise BuildInterruptingException( 'Asked to build for armeabi architecture with API ' '{}, but AP...
[ "def", "check_target_api", "(", "api", ",", "arch", ")", ":", "if", "api", ">=", "ARMEABI_MAX_TARGET_API", "and", "arch", "==", "'armeabi'", ":", "raise", "BuildInterruptingException", "(", "'Asked to build for armeabi architecture with API '", "'{}, but API {} or greater d...
Warn if the user's target API is less than the current minimum recommendation
[ "Warn", "if", "the", "user", "s", "target", "API", "is", "less", "than", "the", "current", "minimum", "recommendation" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/recommendations.py#L75-L89
train
Warn if the user s target API is less than the current minimum availabe recommendation
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/recommendations.py
check_ndk_api
def check_ndk_api(ndk_api, android_api): """Warn if the user's NDK is too high or low.""" if ndk_api > android_api: raise BuildInterruptingException( 'Target NDK API is {}, higher than the target Android API {}.'.format( ndk_api, android_api), instructions=('The N...
python
def check_ndk_api(ndk_api, android_api): """Warn if the user's NDK is too high or low.""" if ndk_api > android_api: raise BuildInterruptingException( 'Target NDK API is {}, higher than the target Android API {}.'.format( ndk_api, android_api), instructions=('The N...
[ "def", "check_ndk_api", "(", "ndk_api", ",", "android_api", ")", ":", "if", "ndk_api", ">", "android_api", ":", "raise", "BuildInterruptingException", "(", "'Target NDK API is {}, higher than the target Android API {}.'", ".", "format", "(", "ndk_api", ",", "android_api",...
Warn if the user's NDK is too high or low.
[ "Warn", "if", "the", "user", "s", "NDK", "is", "too", "high", "or", "low", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/recommendations.py#L97-L107
train
Warn if the user s NDK is too high or low.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/optimizer.py
Optimizer.visit_If
def visit_If(self, node): """Eliminate dead code.""" # do not optimize ifs that have a block inside so that it doesn't # break super(). if node.find(nodes.Block) is not None: return self.generic_visit(node) try: val = self.visit(node.test).as_const() ...
python
def visit_If(self, node): """Eliminate dead code.""" # do not optimize ifs that have a block inside so that it doesn't # break super(). if node.find(nodes.Block) is not None: return self.generic_visit(node) try: val = self.visit(node.test).as_const() ...
[ "def", "visit_If", "(", "self", ",", "node", ")", ":", "# do not optimize ifs that have a block inside so that it doesn't", "# break super().", "if", "node", ".", "find", "(", "nodes", ".", "Block", ")", "is", "not", "None", ":", "return", "self", ".", "generic_vi...
Eliminate dead code.
[ "Eliminate", "dead", "code", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/optimizer.py#L35-L52
train
Eliminate dead code.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/optimizer.py
Optimizer.fold
def fold(self, node): """Do constant folding.""" node = self.generic_visit(node) try: return nodes.Const.from_untrusted(node.as_const(), lineno=node.lineno, environment=self.environment) ...
python
def fold(self, node): """Do constant folding.""" node = self.generic_visit(node) try: return nodes.Const.from_untrusted(node.as_const(), lineno=node.lineno, environment=self.environment) ...
[ "def", "fold", "(", "self", ",", "node", ")", ":", "node", "=", "self", ".", "generic_visit", "(", "node", ")", "try", ":", "return", "nodes", ".", "Const", ".", "from_untrusted", "(", "node", ".", "as_const", "(", ")", ",", "lineno", "=", "node", ...
Do constant folding.
[ "Do", "constant", "folding", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/optimizer.py#L54-L62
train
Do constant folding.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_forceescape
def do_forceescape(value): """Enforce HTML escaping. This will probably double escape variables.""" if hasattr(value, '__html__'): value = value.__html__() return escape(unicode(value))
python
def do_forceescape(value): """Enforce HTML escaping. This will probably double escape variables.""" if hasattr(value, '__html__'): value = value.__html__() return escape(unicode(value))
[ "def", "do_forceescape", "(", "value", ")", ":", "if", "hasattr", "(", "value", ",", "'__html__'", ")", ":", "value", "=", "value", ".", "__html__", "(", ")", "return", "escape", "(", "unicode", "(", "value", ")", ")" ]
Enforce HTML escaping. This will probably double escape variables.
[ "Enforce", "HTML", "escaping", ".", "This", "will", "probably", "double", "escape", "variables", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L51-L55
train
Enforce HTML escaping.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_replace
def do_replace(eval_ctx, s, old, new, count=None): """Return a copy of the value with all occurrences of a substring replaced with a new one. The first argument is the substring that should be replaced, the second is the replacement string. If the optional third argument ``count`` is given, only the fir...
python
def do_replace(eval_ctx, s, old, new, count=None): """Return a copy of the value with all occurrences of a substring replaced with a new one. The first argument is the substring that should be replaced, the second is the replacement string. If the optional third argument ``count`` is given, only the fir...
[ "def", "do_replace", "(", "eval_ctx", ",", "s", ",", "old", ",", "new", ",", "count", "=", "None", ")", ":", "if", "count", "is", "None", ":", "count", "=", "-", "1", "if", "not", "eval_ctx", ".", "autoescape", ":", "return", "unicode", "(", "s", ...
Return a copy of the value with all occurrences of a substring replaced with a new one. The first argument is the substring that should be replaced, the second is the replacement string. If the optional third argument ``count`` is given, only the first ``count`` occurrences are replaced: .. sourcec...
[ "Return", "a", "copy", "of", "the", "value", "with", "all", "occurrences", "of", "a", "substring", "replaced", "with", "a", "new", "one", ".", "The", "first", "argument", "is", "the", "substring", "that", "should", "be", "replaced", "the", "second", "is", ...
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L59-L83
train
Return a copy of the value with all occurrences of a substring replaced with a new one.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_xmlattr
def do_xmlattr(_eval_ctx, d, autospace=True): """Create an SGML/XML attribute string based on the items in a dict. All values that are neither `none` nor `undefined` are automatically escaped: .. sourcecode:: html+jinja <ul{{ {'class': 'my_list', 'missing': none, 'id': 'list-%d...
python
def do_xmlattr(_eval_ctx, d, autospace=True): """Create an SGML/XML attribute string based on the items in a dict. All values that are neither `none` nor `undefined` are automatically escaped: .. sourcecode:: html+jinja <ul{{ {'class': 'my_list', 'missing': none, 'id': 'list-%d...
[ "def", "do_xmlattr", "(", "_eval_ctx", ",", "d", ",", "autospace", "=", "True", ")", ":", "rv", "=", "u' '", ".", "join", "(", "u'%s=\"%s\"'", "%", "(", "escape", "(", "key", ")", ",", "escape", "(", "value", ")", ")", "for", "key", ",", "value", ...
Create an SGML/XML attribute string based on the items in a dict. All values that are neither `none` nor `undefined` are automatically escaped: .. sourcecode:: html+jinja <ul{{ {'class': 'my_list', 'missing': none, 'id': 'list-%d'|format(variable)}|xmlattr }}> ... <...
[ "Create", "an", "SGML", "/", "XML", "attribute", "string", "based", "on", "the", "items", "in", "a", "dict", ".", "All", "values", "that", "are", "neither", "none", "nor", "undefined", "are", "automatically", "escaped", ":" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L97-L129
train
Create an SGML or XML attribute string based on the items in a dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_sort
def do_sort(value, case_sensitive=False): """Sort an iterable. If the iterable is made of strings the second parameter can be used to control the case sensitiveness of the comparison which is disabled by default. .. sourcecode:: jinja {% for item in iterable|sort %} ... {%...
python
def do_sort(value, case_sensitive=False): """Sort an iterable. If the iterable is made of strings the second parameter can be used to control the case sensitiveness of the comparison which is disabled by default. .. sourcecode:: jinja {% for item in iterable|sort %} ... {%...
[ "def", "do_sort", "(", "value", ",", "case_sensitive", "=", "False", ")", ":", "if", "not", "case_sensitive", ":", "def", "sort_func", "(", "item", ")", ":", "if", "isinstance", "(", "item", ",", "basestring", ")", ":", "item", "=", "item", ".", "lower...
Sort an iterable. If the iterable is made of strings the second parameter can be used to control the case sensitiveness of the comparison which is disabled by default. .. sourcecode:: jinja {% for item in iterable|sort %} ... {% endfor %}
[ "Sort", "an", "iterable", ".", "If", "the", "iterable", "is", "made", "of", "strings", "the", "second", "parameter", "can", "be", "used", "to", "control", "the", "case", "sensitiveness", "of", "the", "comparison", "which", "is", "disabled", "by", "default", ...
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L179-L197
train
Sort an iterable.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_default
def do_default(value, default_value=u'', boolean=False): """If the value is undefined it will return the passed default value, otherwise the value of the variable: .. sourcecode:: jinja {{ my_variable|default('my_variable is not defined') }} This will output the value of ``my_variable`` if th...
python
def do_default(value, default_value=u'', boolean=False): """If the value is undefined it will return the passed default value, otherwise the value of the variable: .. sourcecode:: jinja {{ my_variable|default('my_variable is not defined') }} This will output the value of ``my_variable`` if th...
[ "def", "do_default", "(", "value", ",", "default_value", "=", "u''", ",", "boolean", "=", "False", ")", ":", "if", "(", "boolean", "and", "not", "value", ")", "or", "isinstance", "(", "value", ",", "Undefined", ")", ":", "return", "default_value", "retur...
If the value is undefined it will return the passed default value, otherwise the value of the variable: .. sourcecode:: jinja {{ my_variable|default('my_variable is not defined') }} This will output the value of ``my_variable`` if the variable was defined, otherwise ``'my_variable is not defi...
[ "If", "the", "value", "is", "undefined", "it", "will", "return", "the", "passed", "default", "value", "otherwise", "the", "value", "of", "the", "variable", ":" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L200-L219
train
Default function for the base class
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_join
def do_join(eval_ctx, value, d=u''): """Return a string which is the concatenation of the strings in the sequence. The separator between elements is an empty string per default, you can define it with the optional parameter: .. sourcecode:: jinja {{ [1, 2, 3]|join('|') }} -> 1|2|3 ...
python
def do_join(eval_ctx, value, d=u''): """Return a string which is the concatenation of the strings in the sequence. The separator between elements is an empty string per default, you can define it with the optional parameter: .. sourcecode:: jinja {{ [1, 2, 3]|join('|') }} -> 1|2|3 ...
[ "def", "do_join", "(", "eval_ctx", ",", "value", ",", "d", "=", "u''", ")", ":", "# no automatic escaping? joining is a lot eaiser then", "if", "not", "eval_ctx", ".", "autoescape", ":", "return", "unicode", "(", "d", ")", ".", "join", "(", "imap", "(", "un...
Return a string which is the concatenation of the strings in the sequence. The separator between elements is an empty string per default, you can define it with the optional parameter: .. sourcecode:: jinja {{ [1, 2, 3]|join('|') }} -> 1|2|3 {{ [1, 2, 3]|join }} ->...
[ "Return", "a", "string", "which", "is", "the", "concatenation", "of", "the", "strings", "in", "the", "sequence", ".", "The", "separator", "between", "elements", "is", "an", "empty", "string", "per", "default", "you", "can", "define", "it", "with", "the", "...
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L223-L257
train
Returns a string which is the concatenation of the strings in the sequence.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_filesizeformat
def do_filesizeformat(value, binary=False): """Format the value like a 'human-readable' file size (i.e. 13 KB, 4.1 MB, 102 bytes, etc). Per default decimal prefixes are used (mega, giga, etc.), if the second parameter is set to `True` the binary prefixes are used (mebi, gibi). """ bytes = float...
python
def do_filesizeformat(value, binary=False): """Format the value like a 'human-readable' file size (i.e. 13 KB, 4.1 MB, 102 bytes, etc). Per default decimal prefixes are used (mega, giga, etc.), if the second parameter is set to `True` the binary prefixes are used (mebi, gibi). """ bytes = float...
[ "def", "do_filesizeformat", "(", "value", ",", "binary", "=", "False", ")", ":", "bytes", "=", "float", "(", "value", ")", "base", "=", "binary", "and", "1024", "or", "1000", "middle", "=", "binary", "and", "'i'", "or", "''", "if", "bytes", "<", "bas...
Format the value like a 'human-readable' file size (i.e. 13 KB, 4.1 MB, 102 bytes, etc). Per default decimal prefixes are used (mega, giga, etc.), if the second parameter is set to `True` the binary prefixes are used (mebi, gibi).
[ "Format", "the", "value", "like", "a", "human", "-", "readable", "file", "size", "(", "i", ".", "e", ".", "13", "KB", "4", ".", "1", "MB", "102", "bytes", "etc", ")", ".", "Per", "default", "decimal", "prefixes", "are", "used", "(", "mega", "giga",...
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L292-L307
train
Format the value like a human - readable file size.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_urlize
def do_urlize(eval_ctx, value, trim_url_limit=None, nofollow=False): """Converts URLs in plain text into clickable links. If you pass the filter an additional integer it will shorten the urls to that number. Also a third argument exists that makes the urls "nofollow": .. sourcecode:: jinja ...
python
def do_urlize(eval_ctx, value, trim_url_limit=None, nofollow=False): """Converts URLs in plain text into clickable links. If you pass the filter an additional integer it will shorten the urls to that number. Also a third argument exists that makes the urls "nofollow": .. sourcecode:: jinja ...
[ "def", "do_urlize", "(", "eval_ctx", ",", "value", ",", "trim_url_limit", "=", "None", ",", "nofollow", "=", "False", ")", ":", "rv", "=", "urlize", "(", "value", ",", "trim_url_limit", ",", "nofollow", ")", "if", "eval_ctx", ".", "autoescape", ":", "rv"...
Converts URLs in plain text into clickable links. If you pass the filter an additional integer it will shorten the urls to that number. Also a third argument exists that makes the urls "nofollow": .. sourcecode:: jinja {{ mytext|urlize(40, true) }} links are shortened to 40 chars ...
[ "Converts", "URLs", "in", "plain", "text", "into", "clickable", "links", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L320-L335
train
Converts URLs in plain text into clickable links.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_indent
def do_indent(s, width=4, indentfirst=False): """Return a copy of the passed string, each line indented by 4 spaces. The first line is not indented. If you want to change the number of spaces or indent the first line too you can pass additional parameters to the filter: .. sourcecode:: jinja ...
python
def do_indent(s, width=4, indentfirst=False): """Return a copy of the passed string, each line indented by 4 spaces. The first line is not indented. If you want to change the number of spaces or indent the first line too you can pass additional parameters to the filter: .. sourcecode:: jinja ...
[ "def", "do_indent", "(", "s", ",", "width", "=", "4", ",", "indentfirst", "=", "False", ")", ":", "indention", "=", "u' '", "*", "width", "rv", "=", "(", "u'\\n'", "+", "indention", ")", ".", "join", "(", "s", ".", "splitlines", "(", ")", ")", "i...
Return a copy of the passed string, each line indented by 4 spaces. The first line is not indented. If you want to change the number of spaces or indent the first line too you can pass additional parameters to the filter: .. sourcecode:: jinja {{ mytext|indent(2, true) }} indent by...
[ "Return", "a", "copy", "of", "the", "passed", "string", "each", "line", "indented", "by", "4", "spaces", ".", "The", "first", "line", "is", "not", "indented", ".", "If", "you", "want", "to", "change", "the", "number", "of", "spaces", "or", "indent", "t...
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L338-L353
train
Return a copy of the passed string indented by width spaces.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_truncate
def do_truncate(s, length=255, killwords=False, end='...'): """Return a truncated copy of the string. The length is specified with the first parameter which defaults to ``255``. If the second parameter is ``true`` the filter will cut the text at length. Otherwise it will try to save the last word. If th...
python
def do_truncate(s, length=255, killwords=False, end='...'): """Return a truncated copy of the string. The length is specified with the first parameter which defaults to ``255``. If the second parameter is ``true`` the filter will cut the text at length. Otherwise it will try to save the last word. If th...
[ "def", "do_truncate", "(", "s", ",", "length", "=", "255", ",", "killwords", "=", "False", ",", "end", "=", "'...'", ")", ":", "if", "len", "(", "s", ")", "<=", "length", ":", "return", "s", "elif", "killwords", ":", "return", "s", "[", ":", "len...
Return a truncated copy of the string. The length is specified with the first parameter which defaults to ``255``. If the second parameter is ``true`` the filter will cut the text at length. Otherwise it will try to save the last word. If the text was in fact truncated it will append an ellipsis sign (`...
[ "Return", "a", "truncated", "copy", "of", "the", "string", ".", "The", "length", "is", "specified", "with", "the", "first", "parameter", "which", "defaults", "to", "255", ".", "If", "the", "second", "parameter", "is", "true", "the", "filter", "will", "cut"...
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L356-L384
train
Return a truncated copy of the string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_wordwrap
def do_wordwrap(s, width=79, break_long_words=True): """ Return a copy of the string passed to the filter wrapped after ``79`` characters. You can override this default using the first parameter. If you set the second parameter to `false` Jinja will not split words apart if they are longer than `w...
python
def do_wordwrap(s, width=79, break_long_words=True): """ Return a copy of the string passed to the filter wrapped after ``79`` characters. You can override this default using the first parameter. If you set the second parameter to `false` Jinja will not split words apart if they are longer than `w...
[ "def", "do_wordwrap", "(", "s", ",", "width", "=", "79", ",", "break_long_words", "=", "True", ")", ":", "import", "textwrap", "return", "u'\\n'", ".", "join", "(", "textwrap", ".", "wrap", "(", "s", ",", "width", "=", "width", ",", "expand_tabs", "=",...
Return a copy of the string passed to the filter wrapped after ``79`` characters. You can override this default using the first parameter. If you set the second parameter to `false` Jinja will not split words apart if they are longer than `width`.
[ "Return", "a", "copy", "of", "the", "string", "passed", "to", "the", "filter", "wrapped", "after", "79", "characters", ".", "You", "can", "override", "this", "default", "using", "the", "first", "parameter", ".", "If", "you", "set", "the", "second", "parame...
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L387-L397
train
Returns a copy of the string passed to the filter wrapped after characters.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_int
def do_int(value, default=0): """Convert the value into an integer. If the conversion doesn't work it will return ``0``. You can override this default using the first parameter. """ try: return int(value) except (TypeError, ValueError): # this quirk is necessary so that "42.23"|i...
python
def do_int(value, default=0): """Convert the value into an integer. If the conversion doesn't work it will return ``0``. You can override this default using the first parameter. """ try: return int(value) except (TypeError, ValueError): # this quirk is necessary so that "42.23"|i...
[ "def", "do_int", "(", "value", ",", "default", "=", "0", ")", ":", "try", ":", "return", "int", "(", "value", ")", "except", "(", "TypeError", ",", "ValueError", ")", ":", "# this quirk is necessary so that \"42.23\"|int gives 42.", "try", ":", "return", "int"...
Convert the value into an integer. If the conversion doesn't work it will return ``0``. You can override this default using the first parameter.
[ "Convert", "the", "value", "into", "an", "integer", ".", "If", "the", "conversion", "doesn", "t", "work", "it", "will", "return", "0", ".", "You", "can", "override", "this", "default", "using", "the", "first", "parameter", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L405-L417
train
Convert the value into an integer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_striptags
def do_striptags(value): """Strip SGML/XML tags and replace adjacent whitespace by one space. """ if hasattr(value, '__html__'): value = value.__html__() return Markup(unicode(value)).striptags()
python
def do_striptags(value): """Strip SGML/XML tags and replace adjacent whitespace by one space. """ if hasattr(value, '__html__'): value = value.__html__() return Markup(unicode(value)).striptags()
[ "def", "do_striptags", "(", "value", ")", ":", "if", "hasattr", "(", "value", ",", "'__html__'", ")", ":", "value", "=", "value", ".", "__html__", "(", ")", "return", "Markup", "(", "unicode", "(", "value", ")", ")", ".", "striptags", "(", ")" ]
Strip SGML/XML tags and replace adjacent whitespace by one space.
[ "Strip", "SGML", "/", "XML", "tags", "and", "replace", "adjacent", "whitespace", "by", "one", "space", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L451-L456
train
Strip SGML and XML tags and replace adjacent whitespace by one space.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py
do_groupby
def do_groupby(environment, value, attribute): """Group a sequence of objects by a common attribute. If you for example have a list of dicts or objects that represent persons with `gender`, `first_name` and `last_name` attributes and you want to group all users by genders you can do something like the ...
python
def do_groupby(environment, value, attribute): """Group a sequence of objects by a common attribute. If you for example have a list of dicts or objects that represent persons with `gender`, `first_name` and `last_name` attributes and you want to group all users by genders you can do something like the ...
[ "def", "do_groupby", "(", "environment", ",", "value", ",", "attribute", ")", ":", "expr", "=", "lambda", "x", ":", "environment", ".", "getitem", "(", "x", ",", "attribute", ")", "return", "sorted", "(", "map", "(", "_GroupTuple", ",", "groupby", "(", ...
Group a sequence of objects by a common attribute. If you for example have a list of dicts or objects that represent persons with `gender`, `first_name` and `last_name` attributes and you want to group all users by genders you can do something like the following snippet: .. sourcecode:: html+jinja...
[ "Group", "a", "sequence", "of", "objects", "by", "a", "common", "attribute", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L575-L610
train
Group a sequence of objects by a common attribute.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/pythonpackage.py
extract_metainfo_files_from_package
def extract_metainfo_files_from_package( package, output_folder, debug=False ): """ Extracts metdata files from the given package to the given folder, which may be referenced in any way that is permitted in a requirements.txt file or install_requires=[] listing. ...
python
def extract_metainfo_files_from_package( package, output_folder, debug=False ): """ Extracts metdata files from the given package to the given folder, which may be referenced in any way that is permitted in a requirements.txt file or install_requires=[] listing. ...
[ "def", "extract_metainfo_files_from_package", "(", "package", ",", "output_folder", ",", "debug", "=", "False", ")", ":", "if", "package", "is", "None", ":", "raise", "ValueError", "(", "\"package cannot be None\"", ")", "if", "not", "os", ".", "path", ".", "e...
Extracts metdata files from the given package to the given folder, which may be referenced in any way that is permitted in a requirements.txt file or install_requires=[] listing. Current supported metadata files that will be extracted: - pytoml.yml (only if package wasn't obtained as ...
[ "Extracts", "metdata", "files", "from", "the", "given", "package", "to", "the", "given", "folder", "which", "may", "be", "referenced", "in", "any", "way", "that", "is", "permitted", "in", "a", "requirements", ".", "txt", "file", "or", "install_requires", "="...
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/pythonpackage.py#L74-L143
train
Extracts metdata files from the given package to the given folder.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/pythonpackage.py
_get_system_python_executable
def _get_system_python_executable(): """ Returns the path the system-wide python binary. (In case we're running in a virtualenv or venv) """ # This function is required by get_package_as_folder() to work # inside a virtualenv, since venv creation will fail with # the virtualenv's local pytho...
python
def _get_system_python_executable(): """ Returns the path the system-wide python binary. (In case we're running in a virtualenv or venv) """ # This function is required by get_package_as_folder() to work # inside a virtualenv, since venv creation will fail with # the virtualenv's local pytho...
[ "def", "_get_system_python_executable", "(", ")", ":", "# This function is required by get_package_as_folder() to work", "# inside a virtualenv, since venv creation will fail with", "# the virtualenv's local python binary.", "# (venv/virtualenv incompatibility)", "# Abort if not in virtualenv or v...
Returns the path the system-wide python binary. (In case we're running in a virtualenv or venv)
[ "Returns", "the", "path", "the", "system", "-", "wide", "python", "binary", ".", "(", "In", "case", "we", "re", "running", "in", "a", "virtualenv", "or", "venv", ")" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/pythonpackage.py#L146-L231
train
Returns the path to the system - wide python executable.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/pythonpackage.py
get_package_as_folder
def get_package_as_folder(dependency): """ This function downloads the given package / dependency and extracts the raw contents into a folder. Afterwards, it returns a tuple with the type of distribution obtained, and the temporary folder it extracted to. It is the caller's responsi...
python
def get_package_as_folder(dependency): """ This function downloads the given package / dependency and extracts the raw contents into a folder. Afterwards, it returns a tuple with the type of distribution obtained, and the temporary folder it extracted to. It is the caller's responsi...
[ "def", "get_package_as_folder", "(", "dependency", ")", ":", "venv_parent", "=", "tempfile", ".", "mkdtemp", "(", "prefix", "=", "\"pythonpackage-venv-\"", ")", "try", ":", "# Create a venv to install into:", "try", ":", "if", "int", "(", "sys", ".", "version", ...
This function downloads the given package / dependency and extracts the raw contents into a folder. Afterwards, it returns a tuple with the type of distribution obtained, and the temporary folder it extracted to. It is the caller's responsibility to delete the returned temp folder after...
[ "This", "function", "downloads", "the", "given", "package", "/", "dependency", "and", "extracts", "the", "raw", "contents", "into", "a", "folder", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/pythonpackage.py#L234-L386
train
This function downloads the given package and extracts the raw contents into a folder.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/pythonpackage.py
parse_as_folder_reference
def parse_as_folder_reference(dep): """ See if a dependency reference refers to a folder path. If it does, return the folder path (which parses and resolves file:// urls in the process). If it doesn't, return None. """ # Special case: pep508 urls if dep.find("@") > 0 and ( ...
python
def parse_as_folder_reference(dep): """ See if a dependency reference refers to a folder path. If it does, return the folder path (which parses and resolves file:// urls in the process). If it doesn't, return None. """ # Special case: pep508 urls if dep.find("@") > 0 and ( ...
[ "def", "parse_as_folder_reference", "(", "dep", ")", ":", "# Special case: pep508 urls", "if", "dep", ".", "find", "(", "\"@\"", ")", ">", "0", "and", "(", "(", "dep", ".", "find", "(", "\"@\"", ")", "<", "dep", ".", "find", "(", "\"/\"", ")", "or", ...
See if a dependency reference refers to a folder path. If it does, return the folder path (which parses and resolves file:// urls in the process). If it doesn't, return None.
[ "See", "if", "a", "dependency", "reference", "refers", "to", "a", "folder", "path", ".", "If", "it", "does", "return", "the", "folder", "path", "(", "which", "parses", "and", "resolves", "file", ":", "//", "urls", "in", "the", "process", ")", ".", "If"...
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/pythonpackage.py#L479-L501
train
Parse a dependency reference into a folder path.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/pythonpackage.py
_extract_info_from_package
def _extract_info_from_package(dependency, extract_type=None, debug=False, include_build_requirements=False ): """ Internal function to extract metainfo from a package. Currently suppo...
python
def _extract_info_from_package(dependency, extract_type=None, debug=False, include_build_requirements=False ): """ Internal function to extract metainfo from a package. Currently suppo...
[ "def", "_extract_info_from_package", "(", "dependency", ",", "extract_type", "=", "None", ",", "debug", "=", "False", ",", "include_build_requirements", "=", "False", ")", ":", "output_folder", "=", "tempfile", ".", "mkdtemp", "(", "prefix", "=", "\"pythonpackage-...
Internal function to extract metainfo from a package. Currently supported info types: - name - dependencies (a list of dependencies)
[ "Internal", "function", "to", "extract", "metainfo", "from", "a", "package", ".", "Currently", "supported", "info", "types", ":" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/pythonpackage.py#L504-L554
train
Internal function to extract metainfo from a package.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/pythonpackage.py
get_package_dependencies
def get_package_dependencies(package, recursive=False, verbose=False, include_build_requirements=False): """ Obtain the dependencies from a package. Please note this function is possibly SLOW, especially if you enable ...
python
def get_package_dependencies(package, recursive=False, verbose=False, include_build_requirements=False): """ Obtain the dependencies from a package. Please note this function is possibly SLOW, especially if you enable ...
[ "def", "get_package_dependencies", "(", "package", ",", "recursive", "=", "False", ",", "verbose", "=", "False", ",", "include_build_requirements", "=", "False", ")", ":", "packages_processed", "=", "set", "(", ")", "package_queue", "=", "[", "package", "]", "...
Obtain the dependencies from a package. Please note this function is possibly SLOW, especially if you enable the recursive mode.
[ "Obtain", "the", "dependencies", "from", "a", "package", ".", "Please", "note", "this", "function", "is", "possibly", "SLOW", "especially", "if", "you", "enable", "the", "recursive", "mode", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/pythonpackage.py#L578-L653
train
Get the dependencies of a package.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/pythonpackage.py
get_dep_names_of_package
def get_dep_names_of_package( package, keep_version_pins=False, recursive=False, verbose=False, include_build_requirements=False ): """ Gets the dependencies from the package in the given folder, then attempts to deduce the actual package name resulting ...
python
def get_dep_names_of_package( package, keep_version_pins=False, recursive=False, verbose=False, include_build_requirements=False ): """ Gets the dependencies from the package in the given folder, then attempts to deduce the actual package name resulting ...
[ "def", "get_dep_names_of_package", "(", "package", ",", "keep_version_pins", "=", "False", ",", "recursive", "=", "False", ",", "verbose", "=", "False", ",", "include_build_requirements", "=", "False", ")", ":", "# First, obtain the dependencies:", "dependencies", "="...
Gets the dependencies from the package in the given folder, then attempts to deduce the actual package name resulting from each dependency line, stripping away everything else.
[ "Gets", "the", "dependencies", "from", "the", "package", "in", "the", "given", "folder", "then", "attempts", "to", "deduce", "the", "actual", "package", "name", "resulting", "from", "each", "dependency", "line", "stripping", "away", "everything", "else", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/pythonpackage.py#L656-L693
train
Gets the dependency names of a package in the given folder.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/build.py
run_pymodules_install
def run_pymodules_install(ctx, modules, project_dir, ignore_setup_py=False): """ This function will take care of all non-recipe things, by: 1. Processing them from --requirements (the modules argument) and installing them 2. Installing the user project/app itself via setup.py if ...
python
def run_pymodules_install(ctx, modules, project_dir, ignore_setup_py=False): """ This function will take care of all non-recipe things, by: 1. Processing them from --requirements (the modules argument) and installing them 2. Installing the user project/app itself via setup.py if ...
[ "def", "run_pymodules_install", "(", "ctx", ",", "modules", ",", "project_dir", ",", "ignore_setup_py", "=", "False", ")", ":", "info", "(", "'*** PYTHON PACKAGE / PROJECT INSTALL STAGE ***'", ")", "modules", "=", "list", "(", "filter", "(", "ctx", ".", "not_has_p...
This function will take care of all non-recipe things, by: 1. Processing them from --requirements (the modules argument) and installing them 2. Installing the user project/app itself via setup.py if ignore_setup_py=True
[ "This", "function", "will", "take", "care", "of", "all", "non", "-", "recipe", "things", "by", ":" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/build.py#L596-L806
train
This function will process all python modules and install them via pip.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/build.py
Context.setup_dirs
def setup_dirs(self, storage_dir): '''Calculates all the storage and build dirs, and makes sure the directories exist where necessary.''' self.storage_dir = expanduser(storage_dir) if ' ' in self.storage_dir: raise ValueError('storage dir path cannot contain spaces, please ' ...
python
def setup_dirs(self, storage_dir): '''Calculates all the storage and build dirs, and makes sure the directories exist where necessary.''' self.storage_dir = expanduser(storage_dir) if ' ' in self.storage_dir: raise ValueError('storage dir path cannot contain spaces, please ' ...
[ "def", "setup_dirs", "(", "self", ",", "storage_dir", ")", ":", "self", ".", "storage_dir", "=", "expanduser", "(", "storage_dir", ")", "if", "' '", "in", "self", ".", "storage_dir", ":", "raise", "ValueError", "(", "'storage dir path cannot contain spaces, please...
Calculates all the storage and build dirs, and makes sure the directories exist where necessary.
[ "Calculates", "all", "the", "storage", "and", "build", "dirs", "and", "makes", "sure", "the", "directories", "exist", "where", "necessary", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/build.py#L107-L115
train
Calculates all the storage and build dirs and makes sure the directories exist where necessary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/build.py
Context.prepare_build_environment
def prepare_build_environment(self, user_sdk_dir, user_ndk_dir, user_android_api, user_ndk_api): '''Checks that build dependencies exist and sets internal variables for...
python
def prepare_build_environment(self, user_sdk_dir, user_ndk_dir, user_android_api, user_ndk_api): '''Checks that build dependencies exist and sets internal variables for...
[ "def", "prepare_build_environment", "(", "self", ",", "user_sdk_dir", ",", "user_ndk_dir", ",", "user_android_api", ",", "user_ndk_api", ")", ":", "self", ".", "ensure_dirs", "(", ")", "if", "self", ".", "_build_env_prepared", ":", "return", "ok", "=", "True", ...
Checks that build dependencies exist and sets internal variables for the Android SDK etc. ..warning:: This *must* be called before trying any build stuff
[ "Checks", "that", "build", "dependencies", "exist", "and", "sets", "internal", "variables", "for", "the", "Android", "SDK", "etc", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/build.py#L176-L409
train
Prepares the build environment for the Android SDK and the Android API.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/build.py
Context.get_site_packages_dir
def get_site_packages_dir(self, arch=None): '''Returns the location of site-packages in the python-install build dir. ''' if self.python_recipe.name == 'python2legacy': return join(self.get_python_install_dir(), 'lib', 'python2.7', 'site-packages') ...
python
def get_site_packages_dir(self, arch=None): '''Returns the location of site-packages in the python-install build dir. ''' if self.python_recipe.name == 'python2legacy': return join(self.get_python_install_dir(), 'lib', 'python2.7', 'site-packages') ...
[ "def", "get_site_packages_dir", "(", "self", ",", "arch", "=", "None", ")", ":", "if", "self", ".", "python_recipe", ".", "name", "==", "'python2legacy'", ":", "return", "join", "(", "self", ".", "get_python_install_dir", "(", ")", ",", "'lib'", ",", "'pyt...
Returns the location of site-packages in the python-install build dir.
[ "Returns", "the", "location", "of", "site", "-", "packages", "in", "the", "python", "-", "install", "build", "dir", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/build.py#L470-L477
train
Returns the location of site - packages in the python - install build dir.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/build.py
Context.get_libs_dir
def get_libs_dir(self, arch): '''The libs dir for a given arch.''' ensure_dir(join(self.libs_dir, arch)) return join(self.libs_dir, arch)
python
def get_libs_dir(self, arch): '''The libs dir for a given arch.''' ensure_dir(join(self.libs_dir, arch)) return join(self.libs_dir, arch)
[ "def", "get_libs_dir", "(", "self", ",", "arch", ")", ":", "ensure_dir", "(", "join", "(", "self", ".", "libs_dir", ",", "arch", ")", ")", "return", "join", "(", "self", ".", "libs_dir", ",", "arch", ")" ]
The libs dir for a given arch.
[ "The", "libs", "dir", "for", "a", "given", "arch", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/build.py#L479-L482
train
The libs dir for a given arch.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/logger.py
shorten_string
def shorten_string(string, max_width): ''' make limited length string in form: "the string is very lo...(and 15 more)" ''' string_len = len(string) if string_len <= max_width: return string visible = max_width - 16 - int(log10(string_len)) # expected suffix len "...(and XXXXX more)...
python
def shorten_string(string, max_width): ''' make limited length string in form: "the string is very lo...(and 15 more)" ''' string_len = len(string) if string_len <= max_width: return string visible = max_width - 16 - int(log10(string_len)) # expected suffix len "...(and XXXXX more)...
[ "def", "shorten_string", "(", "string", ",", "max_width", ")", ":", "string_len", "=", "len", "(", "string", ")", "if", "string_len", "<=", "max_width", ":", "return", "string", "visible", "=", "max_width", "-", "16", "-", "int", "(", "log10", "(", "stri...
make limited length string in form: "the string is very lo...(and 15 more)"
[ "make", "limited", "length", "string", "in", "form", ":", "the", "string", "is", "very", "lo", "...", "(", "and", "15", "more", ")" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/logger.py#L106-L120
train
make limited length string in form : the string is very lo... and 15 more
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/logger.py
shprint
def shprint(command, *args, **kwargs): '''Runs the command (which should be an sh.Command instance), while logging the output.''' kwargs["_iter"] = True kwargs["_out_bufsize"] = 1 kwargs["_err_to_out"] = True kwargs["_bg"] = True is_critical = kwargs.pop('_critical', False) tail_n = kwar...
python
def shprint(command, *args, **kwargs): '''Runs the command (which should be an sh.Command instance), while logging the output.''' kwargs["_iter"] = True kwargs["_out_bufsize"] = 1 kwargs["_err_to_out"] = True kwargs["_bg"] = True is_critical = kwargs.pop('_critical', False) tail_n = kwar...
[ "def", "shprint", "(", "command", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "\"_iter\"", "]", "=", "True", "kwargs", "[", "\"_out_bufsize\"", "]", "=", "1", "kwargs", "[", "\"_err_to_out\"", "]", "=", "True", "kwargs", "[", ...
Runs the command (which should be an sh.Command instance), while logging the output.
[ "Runs", "the", "command", "(", "which", "should", "be", "an", "sh", ".", "Command", "instance", ")", "while", "logging", "the", "output", "." ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/logger.py#L142-L243
train
Runs the command while Formula logging the output.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/argparse.py
_ActionsContainer.add_argument
def add_argument(self, *args, **kwargs): """ add_argument(dest, ..., name=value, ...) add_argument(option_string, option_string, ..., name=value, ...) """ # if no positional args are supplied or only one is supplied and # it doesn't look like an option string, par...
python
def add_argument(self, *args, **kwargs): """ add_argument(dest, ..., name=value, ...) add_argument(option_string, option_string, ..., name=value, ...) """ # if no positional args are supplied or only one is supplied and # it doesn't look like an option string, par...
[ "def", "add_argument", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# if no positional args are supplied or only one is supplied and\r", "# it doesn't look like an option string, parse a positional\r", "# argument\r", "chars", "=", "self", ".", "prefix_c...
add_argument(dest, ..., name=value, ...) add_argument(option_string, option_string, ..., name=value, ...)
[ "add_argument", "(", "dest", "...", "name", "=", "value", "...", ")", "add_argument", "(", "option_string", "option_string", "...", "name", "=", "value", "...", ")" ]
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/argparse.py#L1276-L1314
train
add an argument to the icalEntry object
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kivy/python-for-android
pythonforandroid/bootstraps/pygame/build/buildlib/argparse.py
ArgumentParser.error
def error(self, message): """error(message: string) Prints a usage message incorporating the message to stderr and exits. If you override this in a subclass, it should not return -- it should either exit or raise an exception. """ self.print_usage(_sys....
python
def error(self, message): """error(message: string) Prints a usage message incorporating the message to stderr and exits. If you override this in a subclass, it should not return -- it should either exit or raise an exception. """ self.print_usage(_sys....
[ "def", "error", "(", "self", ",", "message", ")", ":", "self", ".", "print_usage", "(", "_sys", ".", "stderr", ")", "self", ".", "exit", "(", "2", ",", "_", "(", "'%s: error: %s\\n'", ")", "%", "(", "self", ".", "prog", ",", "message", ")", ")" ]
error(message: string) Prints a usage message incorporating the message to stderr and exits. If you override this in a subclass, it should not return -- it should either exit or raise an exception.
[ "error", "(", "message", ":", "string", ")", "Prints", "a", "usage", "message", "incorporating", "the", "message", "to", "stderr", "and", "exits", ".", "If", "you", "override", "this", "in", "a", "subclass", "it", "should", "not", "return", "--", "it", "...
8e0e8056bc22e4d5bd3398a6b0301f38ff167933
https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/argparse.py#L2348-L2358
train
Print an error message and exit.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
isexception
def isexception(obj): """Given an object, return a boolean indicating whether it is an instance or subclass of :py:class:`Exception`. """ if isinstance(obj, Exception): return True if isclass(obj) and issubclass(obj, Exception): return True return False
python
def isexception(obj): """Given an object, return a boolean indicating whether it is an instance or subclass of :py:class:`Exception`. """ if isinstance(obj, Exception): return True if isclass(obj) and issubclass(obj, Exception): return True return False
[ "def", "isexception", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "Exception", ")", ":", "return", "True", "if", "isclass", "(", "obj", ")", "and", "issubclass", "(", "obj", ",", "Exception", ")", ":", "return", "True", "return", "False"...
Given an object, return a boolean indicating whether it is an instance or subclass of :py:class:`Exception`.
[ "Given", "an", "object", "return", "a", "boolean", "indicating", "whether", "it", "is", "an", "instance", "or", "subclass", "of", ":", "py", ":", "class", ":", "Exception", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L16-L24
train
Given an object return a boolean indicating whether it is an instance or subclass of Exception.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
_reduce_datetimes
def _reduce_datetimes(row): """Receives a row, converts datetimes to strings.""" row = list(row) for i in range(len(row)): if hasattr(row[i], 'isoformat'): row[i] = row[i].isoformat() return tuple(row)
python
def _reduce_datetimes(row): """Receives a row, converts datetimes to strings.""" row = list(row) for i in range(len(row)): if hasattr(row[i], 'isoformat'): row[i] = row[i].isoformat() return tuple(row)
[ "def", "_reduce_datetimes", "(", "row", ")", ":", "row", "=", "list", "(", "row", ")", "for", "i", "in", "range", "(", "len", "(", "row", ")", ")", ":", "if", "hasattr", "(", "row", "[", "i", "]", ",", "'isoformat'", ")", ":", "row", "[", "i", ...
Receives a row, converts datetimes to strings.
[ "Receives", "a", "row", "converts", "datetimes", "to", "strings", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L424-L432
train
Receives a row converts datetimes to strings.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
Record.as_dict
def as_dict(self, ordered=False): """Returns the row as a dictionary, as ordered.""" items = zip(self.keys(), self.values()) return OrderedDict(items) if ordered else dict(items)
python
def as_dict(self, ordered=False): """Returns the row as a dictionary, as ordered.""" items = zip(self.keys(), self.values()) return OrderedDict(items) if ordered else dict(items)
[ "def", "as_dict", "(", "self", ",", "ordered", "=", "False", ")", ":", "items", "=", "zip", "(", "self", ".", "keys", "(", ")", ",", "self", ".", "values", "(", ")", ")", "return", "OrderedDict", "(", "items", ")", "if", "ordered", "else", "dict", ...
Returns the row as a dictionary, as ordered.
[ "Returns", "the", "row", "as", "a", "dictionary", "as", "ordered", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L81-L85
train
Returns the row as a dictionary as ordered.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
Record.dataset
def dataset(self): """A Tablib Dataset containing the row.""" data = tablib.Dataset() data.headers = self.keys() row = _reduce_datetimes(self.values()) data.append(row) return data
python
def dataset(self): """A Tablib Dataset containing the row.""" data = tablib.Dataset() data.headers = self.keys() row = _reduce_datetimes(self.values()) data.append(row) return data
[ "def", "dataset", "(", "self", ")", ":", "data", "=", "tablib", ".", "Dataset", "(", ")", "data", ".", "headers", "=", "self", ".", "keys", "(", ")", "row", "=", "_reduce_datetimes", "(", "self", ".", "values", "(", ")", ")", "data", ".", "append",...
A Tablib Dataset containing the row.
[ "A", "Tablib", "Dataset", "containing", "the", "row", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L88-L96
train
A Tablib Dataset containing the row.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
RecordCollection.dataset
def dataset(self): """A Tablib Dataset representation of the RecordCollection.""" # Create a new Tablib Dataset. data = tablib.Dataset() # If the RecordCollection is empty, just return the empty set # Check number of rows by typecasting to list if len(list(self)) == 0: ...
python
def dataset(self): """A Tablib Dataset representation of the RecordCollection.""" # Create a new Tablib Dataset. data = tablib.Dataset() # If the RecordCollection is empty, just return the empty set # Check number of rows by typecasting to list if len(list(self)) == 0: ...
[ "def", "dataset", "(", "self", ")", ":", "# Create a new Tablib Dataset.", "data", "=", "tablib", ".", "Dataset", "(", ")", "# If the RecordCollection is empty, just return the empty set", "# Check number of rows by typecasting to list", "if", "len", "(", "list", "(", "self...
A Tablib Dataset representation of the RecordCollection.
[ "A", "Tablib", "Dataset", "representation", "of", "the", "RecordCollection", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L170-L188
train
A Tablib Dataset representation of the RecordCollection.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
RecordCollection.all
def all(self, as_dict=False, as_ordereddict=False): """Returns a list of all rows for the RecordCollection. If they haven't been fetched yet, consume the iterator and cache the results.""" # By calling list it calls the __iter__ method rows = list(self) if as_dict: ...
python
def all(self, as_dict=False, as_ordereddict=False): """Returns a list of all rows for the RecordCollection. If they haven't been fetched yet, consume the iterator and cache the results.""" # By calling list it calls the __iter__ method rows = list(self) if as_dict: ...
[ "def", "all", "(", "self", ",", "as_dict", "=", "False", ",", "as_ordereddict", "=", "False", ")", ":", "# By calling list it calls the __iter__ method", "rows", "=", "list", "(", "self", ")", "if", "as_dict", ":", "return", "[", "r", ".", "as_dict", "(", ...
Returns a list of all rows for the RecordCollection. If they haven't been fetched yet, consume the iterator and cache the results.
[ "Returns", "a", "list", "of", "all", "rows", "for", "the", "RecordCollection", ".", "If", "they", "haven", "t", "been", "fetched", "yet", "consume", "the", "iterator", "and", "cache", "the", "results", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L190-L202
train
Returns a list of all rows for the RecordCollection.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
RecordCollection.one
def one(self, default=None, as_dict=False, as_ordereddict=False): """Returns a single record for the RecordCollection, ensuring that it is the only record, or returns `default`. If `default` is an instance or subclass of Exception, then raise it instead of returning it.""" # Ensure that...
python
def one(self, default=None, as_dict=False, as_ordereddict=False): """Returns a single record for the RecordCollection, ensuring that it is the only record, or returns `default`. If `default` is an instance or subclass of Exception, then raise it instead of returning it.""" # Ensure that...
[ "def", "one", "(", "self", ",", "default", "=", "None", ",", "as_dict", "=", "False", ",", "as_ordereddict", "=", "False", ")", ":", "# Ensure that we don't have more than one row.", "try", ":", "self", "[", "1", "]", "except", "IndexError", ":", "return", "...
Returns a single record for the RecordCollection, ensuring that it is the only record, or returns `default`. If `default` is an instance or subclass of Exception, then raise it instead of returning it.
[ "Returns", "a", "single", "record", "for", "the", "RecordCollection", "ensuring", "that", "it", "is", "the", "only", "record", "or", "returns", "default", ".", "If", "default", "is", "an", "instance", "or", "subclass", "of", "Exception", "then", "raise", "it...
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L228-L241
train
Returns a single record for the RecordCollection ensuring that it is the only record. If default is an instance of Exception then raise it instead of returning it.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
Database.get_connection
def get_connection(self): """Get a connection to this Database. Connections are retrieved from a pool. """ if not self.open: raise exc.ResourceClosedError('Database closed.') return Connection(self._engine.connect())
python
def get_connection(self): """Get a connection to this Database. Connections are retrieved from a pool. """ if not self.open: raise exc.ResourceClosedError('Database closed.') return Connection(self._engine.connect())
[ "def", "get_connection", "(", "self", ")", ":", "if", "not", "self", ".", "open", ":", "raise", "exc", ".", "ResourceClosedError", "(", "'Database closed.'", ")", "return", "Connection", "(", "self", ".", "_engine", ".", "connect", "(", ")", ")" ]
Get a connection to this Database. Connections are retrieved from a pool.
[ "Get", "a", "connection", "to", "this", "Database", ".", "Connections", "are", "retrieved", "from", "a", "pool", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L285-L292
train
Get a connection to this Database.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
Database.query
def query(self, query, fetchall=False, **params): """Executes the given SQL query against the Database. Parameters can, optionally, be provided. Returns a RecordCollection, which can be iterated over to get result rows as dictionaries. """ with self.get_connection() as conn: ...
python
def query(self, query, fetchall=False, **params): """Executes the given SQL query against the Database. Parameters can, optionally, be provided. Returns a RecordCollection, which can be iterated over to get result rows as dictionaries. """ with self.get_connection() as conn: ...
[ "def", "query", "(", "self", ",", "query", ",", "fetchall", "=", "False", ",", "*", "*", "params", ")", ":", "with", "self", ".", "get_connection", "(", ")", "as", "conn", ":", "return", "conn", ".", "query", "(", "query", ",", "fetchall", ",", "*"...
Executes the given SQL query against the Database. Parameters can, optionally, be provided. Returns a RecordCollection, which can be iterated over to get result rows as dictionaries.
[ "Executes", "the", "given", "SQL", "query", "against", "the", "Database", ".", "Parameters", "can", "optionally", "be", "provided", ".", "Returns", "a", "RecordCollection", "which", "can", "be", "iterated", "over", "to", "get", "result", "rows", "as", "diction...
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L294-L300
train
Executes a SQL query against the Database. Returns a RecordCollection object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
Database.bulk_query
def bulk_query(self, query, *multiparams): """Bulk insert or update.""" with self.get_connection() as conn: conn.bulk_query(query, *multiparams)
python
def bulk_query(self, query, *multiparams): """Bulk insert or update.""" with self.get_connection() as conn: conn.bulk_query(query, *multiparams)
[ "def", "bulk_query", "(", "self", ",", "query", ",", "*", "multiparams", ")", ":", "with", "self", ".", "get_connection", "(", ")", "as", "conn", ":", "conn", ".", "bulk_query", "(", "query", ",", "*", "multiparams", ")" ]
Bulk insert or update.
[ "Bulk", "insert", "or", "update", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L302-L306
train
Bulk insert or update.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
Database.query_file
def query_file(self, path, fetchall=False, **params): """Like Database.query, but takes a filename to load a query from.""" with self.get_connection() as conn: return conn.query_file(path, fetchall, **params)
python
def query_file(self, path, fetchall=False, **params): """Like Database.query, but takes a filename to load a query from.""" with self.get_connection() as conn: return conn.query_file(path, fetchall, **params)
[ "def", "query_file", "(", "self", ",", "path", ",", "fetchall", "=", "False", ",", "*", "*", "params", ")", ":", "with", "self", ".", "get_connection", "(", ")", "as", "conn", ":", "return", "conn", ".", "query_file", "(", "path", ",", "fetchall", ",...
Like Database.query, but takes a filename to load a query from.
[ "Like", "Database", ".", "query", "but", "takes", "a", "filename", "to", "load", "a", "query", "from", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L308-L312
train
Like Database. query but takes a filename to load a query from.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
Database.bulk_query_file
def bulk_query_file(self, path, *multiparams): """Like Database.bulk_query, but takes a filename to load a query from.""" with self.get_connection() as conn: conn.bulk_query_file(path, *multiparams)
python
def bulk_query_file(self, path, *multiparams): """Like Database.bulk_query, but takes a filename to load a query from.""" with self.get_connection() as conn: conn.bulk_query_file(path, *multiparams)
[ "def", "bulk_query_file", "(", "self", ",", "path", ",", "*", "multiparams", ")", ":", "with", "self", ".", "get_connection", "(", ")", "as", "conn", ":", "conn", ".", "bulk_query_file", "(", "path", ",", "*", "multiparams", ")" ]
Like Database.bulk_query, but takes a filename to load a query from.
[ "Like", "Database", ".", "bulk_query", "but", "takes", "a", "filename", "to", "load", "a", "query", "from", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L314-L318
train
Like Database. bulk_query but takes a filename to load a query from.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
Database.transaction
def transaction(self): """A context manager for executing a transaction on this Database.""" conn = self.get_connection() tx = conn.transaction() try: yield conn tx.commit() except: tx.rollback() finally: conn.close()
python
def transaction(self): """A context manager for executing a transaction on this Database.""" conn = self.get_connection() tx = conn.transaction() try: yield conn tx.commit() except: tx.rollback() finally: conn.close()
[ "def", "transaction", "(", "self", ")", ":", "conn", "=", "self", ".", "get_connection", "(", ")", "tx", "=", "conn", ".", "transaction", "(", ")", "try", ":", "yield", "conn", "tx", ".", "commit", "(", ")", "except", ":", "tx", ".", "rollback", "(...
A context manager for executing a transaction on this Database.
[ "A", "context", "manager", "for", "executing", "a", "transaction", "on", "this", "Database", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L321-L332
train
A context manager for executing a transaction on this Database.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
Connection.query
def query(self, query, fetchall=False, **params): """Executes the given SQL query against the connected Database. Parameters can, optionally, be provided. Returns a RecordCollection, which can be iterated over to get result rows as dictionaries. """ # Execute the given query. ...
python
def query(self, query, fetchall=False, **params): """Executes the given SQL query against the connected Database. Parameters can, optionally, be provided. Returns a RecordCollection, which can be iterated over to get result rows as dictionaries. """ # Execute the given query. ...
[ "def", "query", "(", "self", ",", "query", ",", "fetchall", "=", "False", ",", "*", "*", "params", ")", ":", "# Execute the given query.", "cursor", "=", "self", ".", "_conn", ".", "execute", "(", "text", "(", "query", ")", ",", "*", "*", "params", "...
Executes the given SQL query against the connected Database. Parameters can, optionally, be provided. Returns a RecordCollection, which can be iterated over to get result rows as dictionaries.
[ "Executes", "the", "given", "SQL", "query", "against", "the", "connected", "Database", ".", "Parameters", "can", "optionally", "be", "provided", ".", "Returns", "a", "RecordCollection", "which", "can", "be", "iterated", "over", "to", "get", "result", "rows", "...
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L355-L374
train
Executes a given SQL query against the connected Database. Returns a RecordCollection which can be iterated over to get result rows as dictionaries.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
Connection.bulk_query
def bulk_query(self, query, *multiparams): """Bulk insert or update.""" self._conn.execute(text(query), *multiparams)
python
def bulk_query(self, query, *multiparams): """Bulk insert or update.""" self._conn.execute(text(query), *multiparams)
[ "def", "bulk_query", "(", "self", ",", "query", ",", "*", "multiparams", ")", ":", "self", ".", "_conn", ".", "execute", "(", "text", "(", "query", ")", ",", "*", "multiparams", ")" ]
Bulk insert or update.
[ "Bulk", "insert", "or", "update", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L376-L379
train
Bulk insert or update.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
Connection.query_file
def query_file(self, path, fetchall=False, **params): """Like Connection.query, but takes a filename to load a query from.""" # If path doesn't exists if not os.path.exists(path): raise IOError("File '{}' not found!".format(path)) # If it's a directory if os.path.is...
python
def query_file(self, path, fetchall=False, **params): """Like Connection.query, but takes a filename to load a query from.""" # If path doesn't exists if not os.path.exists(path): raise IOError("File '{}' not found!".format(path)) # If it's a directory if os.path.is...
[ "def", "query_file", "(", "self", ",", "path", ",", "fetchall", "=", "False", ",", "*", "*", "params", ")", ":", "# If path doesn't exists", "if", "not", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "raise", "IOError", "(", "\"File '{}' not f...
Like Connection.query, but takes a filename to load a query from.
[ "Like", "Connection", ".", "query", "but", "takes", "a", "filename", "to", "load", "a", "query", "from", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L381-L397
train
Like Connection. query but takes a filename to load a query from.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
kennethreitz/records
records.py
Connection.bulk_query_file
def bulk_query_file(self, path, *multiparams): """Like Connection.bulk_query, but takes a filename to load a query from. """ # If path doesn't exists if not os.path.exists(path): raise IOError("File '{}'' not found!".format(path)) # If it's a directory ...
python
def bulk_query_file(self, path, *multiparams): """Like Connection.bulk_query, but takes a filename to load a query from. """ # If path doesn't exists if not os.path.exists(path): raise IOError("File '{}'' not found!".format(path)) # If it's a directory ...
[ "def", "bulk_query_file", "(", "self", ",", "path", ",", "*", "multiparams", ")", ":", "# If path doesn't exists", "if", "not", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "raise", "IOError", "(", "\"File '{}'' not found!\"", ".", "format", "(",...
Like Connection.bulk_query, but takes a filename to load a query from.
[ "Like", "Connection", ".", "bulk_query", "but", "takes", "a", "filename", "to", "load", "a", "query", "from", "." ]
ecd857266c5e7830d657cbe0196816314790563b
https://github.com/kennethreitz/records/blob/ecd857266c5e7830d657cbe0196816314790563b/records.py#L399-L416
train
Like Connection. bulk_query but takes a filename to load a query from.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/process.py
extractWithoutOrder
def extractWithoutOrder(query, choices, processor=default_processor, scorer=default_scorer, score_cutoff=0): """Select the best match in a list or dictionary of choices. Find best matches in a list or dictionary of choices, return a generator of tuples containing the match and its score. If a dictionary ...
python
def extractWithoutOrder(query, choices, processor=default_processor, scorer=default_scorer, score_cutoff=0): """Select the best match in a list or dictionary of choices. Find best matches in a list or dictionary of choices, return a generator of tuples containing the match and its score. If a dictionary ...
[ "def", "extractWithoutOrder", "(", "query", ",", "choices", ",", "processor", "=", "default_processor", ",", "scorer", "=", "default_scorer", ",", "score_cutoff", "=", "0", ")", ":", "# Catch generators without lengths", "def", "no_process", "(", "x", ")", ":", ...
Select the best match in a list or dictionary of choices. Find best matches in a list or dictionary of choices, return a generator of tuples containing the match and its score. If a dictionary is used, also returns the key for each match. Arguments: query: An object representing the thing we w...
[ "Select", "the", "best", "match", "in", "a", "list", "or", "dictionary", "of", "choices", "." ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/process.py#L16-L119
train
This function returns a generator that returns the key for each match in a list or dictionary of choices.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/process.py
extract
def extract(query, choices, processor=default_processor, scorer=default_scorer, limit=5): """Select the best match in a list or dictionary of choices. Find best matches in a list or dictionary of choices, return a list of tuples containing the match and its score. If a dictionary is used, also returns ...
python
def extract(query, choices, processor=default_processor, scorer=default_scorer, limit=5): """Select the best match in a list or dictionary of choices. Find best matches in a list or dictionary of choices, return a list of tuples containing the match and its score. If a dictionary is used, also returns ...
[ "def", "extract", "(", "query", ",", "choices", ",", "processor", "=", "default_processor", ",", "scorer", "=", "default_scorer", ",", "limit", "=", "5", ")", ":", "sl", "=", "extractWithoutOrder", "(", "query", ",", "choices", ",", "processor", ",", "scor...
Select the best match in a list or dictionary of choices. Find best matches in a list or dictionary of choices, return a list of tuples containing the match and its score. If a dictionary is used, also returns the key for each match. Arguments: query: An object representing the thing we want t...
[ "Select", "the", "best", "match", "in", "a", "list", "or", "dictionary", "of", "choices", "." ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/process.py#L122-L169
train
Select the best match in a list or dictionary of choices and return the key for each match.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/process.py
extractBests
def extractBests(query, choices, processor=default_processor, scorer=default_scorer, score_cutoff=0, limit=5): """Get a list of the best matches to a collection of choices. Convenience function for getting the choices with best scores. Args: query: A string to match against choices: A list...
python
def extractBests(query, choices, processor=default_processor, scorer=default_scorer, score_cutoff=0, limit=5): """Get a list of the best matches to a collection of choices. Convenience function for getting the choices with best scores. Args: query: A string to match against choices: A list...
[ "def", "extractBests", "(", "query", ",", "choices", ",", "processor", "=", "default_processor", ",", "scorer", "=", "default_scorer", ",", "score_cutoff", "=", "0", ",", "limit", "=", "5", ")", ":", "best_list", "=", "extractWithoutOrder", "(", "query", ","...
Get a list of the best matches to a collection of choices. Convenience function for getting the choices with best scores. Args: query: A string to match against choices: A list or dictionary of choices, suitable for use with extract(). processor: Optional function for trans...
[ "Get", "a", "list", "of", "the", "best", "matches", "to", "a", "collection", "of", "choices", "." ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/process.py#L172-L194
train
Extract the best matches to a collection of choices.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/process.py
extractOne
def extractOne(query, choices, processor=default_processor, scorer=default_scorer, score_cutoff=0): """Find the single best match above a score in a list of choices. This is a convenience method which returns the single best choice. See extract() for the full arguments list. Args: query: A str...
python
def extractOne(query, choices, processor=default_processor, scorer=default_scorer, score_cutoff=0): """Find the single best match above a score in a list of choices. This is a convenience method which returns the single best choice. See extract() for the full arguments list. Args: query: A str...
[ "def", "extractOne", "(", "query", ",", "choices", ",", "processor", "=", "default_processor", ",", "scorer", "=", "default_scorer", ",", "score_cutoff", "=", "0", ")", ":", "best_list", "=", "extractWithoutOrder", "(", "query", ",", "choices", ",", "processor...
Find the single best match above a score in a list of choices. This is a convenience method which returns the single best choice. See extract() for the full arguments list. Args: query: A string to match against choices: A list or dictionary of choices, suitable for use with ex...
[ "Find", "the", "single", "best", "match", "above", "a", "score", "in", "a", "list", "of", "choices", "." ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/process.py#L197-L222
train
Given a query string and a list of choices returns the single best match and its score.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/process.py
dedupe
def dedupe(contains_dupes, threshold=70, scorer=fuzz.token_set_ratio): """This convenience function takes a list of strings containing duplicates and uses fuzzy matching to identify and remove duplicates. Specifically, it uses the process.extract to identify duplicates that score greater than a user defined...
python
def dedupe(contains_dupes, threshold=70, scorer=fuzz.token_set_ratio): """This convenience function takes a list of strings containing duplicates and uses fuzzy matching to identify and remove duplicates. Specifically, it uses the process.extract to identify duplicates that score greater than a user defined...
[ "def", "dedupe", "(", "contains_dupes", ",", "threshold", "=", "70", ",", "scorer", "=", "fuzz", ".", "token_set_ratio", ")", ":", "extractor", "=", "[", "]", "# iterate over items in *contains_dupes*", "for", "item", "in", "contains_dupes", ":", "# return all dup...
This convenience function takes a list of strings containing duplicates and uses fuzzy matching to identify and remove duplicates. Specifically, it uses the process.extract to identify duplicates that score greater than a user defined threshold. Then, it looks for the longest item in the duplicate list sinc...
[ "This", "convenience", "function", "takes", "a", "list", "of", "strings", "containing", "duplicates", "and", "uses", "fuzzy", "matching", "to", "identify", "and", "remove", "duplicates", ".", "Specifically", "it", "uses", "the", "process", ".", "extract", "to", ...
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/process.py#L225-L285
train
This function dedupes the duplicate list of the items in contains_dupes and returns a list of the items that are not in the duplicate list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/utils.py
make_type_consistent
def make_type_consistent(s1, s2): """If both objects aren't either both string or unicode instances force them to unicode""" if isinstance(s1, str) and isinstance(s2, str): return s1, s2 elif isinstance(s1, unicode) and isinstance(s2, unicode): return s1, s2 else: return unicod...
python
def make_type_consistent(s1, s2): """If both objects aren't either both string or unicode instances force them to unicode""" if isinstance(s1, str) and isinstance(s2, str): return s1, s2 elif isinstance(s1, unicode) and isinstance(s2, unicode): return s1, s2 else: return unicod...
[ "def", "make_type_consistent", "(", "s1", ",", "s2", ")", ":", "if", "isinstance", "(", "s1", ",", "str", ")", "and", "isinstance", "(", "s2", ",", "str", ")", ":", "return", "s1", ",", "s2", "elif", "isinstance", "(", "s1", ",", "unicode", ")", "a...
If both objects aren't either both string or unicode instances force them to unicode
[ "If", "both", "objects", "aren", "t", "either", "both", "string", "or", "unicode", "instances", "force", "them", "to", "unicode" ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/utils.py#L73-L82
train
Make sure that both objects are either string or unicode instances force them to unicode
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/utils.py
full_process
def full_process(s, force_ascii=False): """Process string by -- removing all but letters and numbers -- trim whitespace -- force to lower case if force_ascii == True, force convert to ascii""" if force_ascii: s = asciidammit(s) # Keep only Letters and Numbers (see Un...
python
def full_process(s, force_ascii=False): """Process string by -- removing all but letters and numbers -- trim whitespace -- force to lower case if force_ascii == True, force convert to ascii""" if force_ascii: s = asciidammit(s) # Keep only Letters and Numbers (see Un...
[ "def", "full_process", "(", "s", ",", "force_ascii", "=", "False", ")", ":", "if", "force_ascii", ":", "s", "=", "asciidammit", "(", "s", ")", "# Keep only Letters and Numbers (see Unicode docs).", "string_out", "=", "StringProcessor", ".", "replace_non_letters_non_nu...
Process string by -- removing all but letters and numbers -- trim whitespace -- force to lower case if force_ascii == True, force convert to ascii
[ "Process", "string", "by", "--", "removing", "all", "but", "letters", "and", "numbers", "--", "trim", "whitespace", "--", "force", "to", "lower", "case", "if", "force_ascii", "==", "True", "force", "convert", "to", "ascii" ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/utils.py#L85-L100
train
Process string by and return it as a unicode string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/fuzz.py
partial_ratio
def partial_ratio(s1, s2): """"Return the ratio of the most similar substring as a number between 0 and 100.""" s1, s2 = utils.make_type_consistent(s1, s2) if len(s1) <= len(s2): shorter = s1 longer = s2 else: shorter = s2 longer = s1 m = SequenceMatcher(None, s...
python
def partial_ratio(s1, s2): """"Return the ratio of the most similar substring as a number between 0 and 100.""" s1, s2 = utils.make_type_consistent(s1, s2) if len(s1) <= len(s2): shorter = s1 longer = s2 else: shorter = s2 longer = s1 m = SequenceMatcher(None, s...
[ "def", "partial_ratio", "(", "s1", ",", "s2", ")", ":", "s1", ",", "s2", "=", "utils", ".", "make_type_consistent", "(", "s1", ",", "s2", ")", "if", "len", "(", "s1", ")", "<=", "len", "(", "s2", ")", ":", "shorter", "=", "s1", "longer", "=", "...
Return the ratio of the most similar substring as a number between 0 and 100.
[ "Return", "the", "ratio", "of", "the", "most", "similar", "substring", "as", "a", "number", "between", "0", "and", "100", "." ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/fuzz.py#L34-L68
train
Return the ratio of the most similar substring as a number between 0 and 100.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/fuzz.py
_process_and_sort
def _process_and_sort(s, force_ascii, full_process=True): """Return a cleaned string with token sorted.""" # pull tokens ts = utils.full_process(s, force_ascii=force_ascii) if full_process else s tokens = ts.split() # sort tokens and join sorted_string = u" ".join(sorted(tokens)) return sor...
python
def _process_and_sort(s, force_ascii, full_process=True): """Return a cleaned string with token sorted.""" # pull tokens ts = utils.full_process(s, force_ascii=force_ascii) if full_process else s tokens = ts.split() # sort tokens and join sorted_string = u" ".join(sorted(tokens)) return sor...
[ "def", "_process_and_sort", "(", "s", ",", "force_ascii", ",", "full_process", "=", "True", ")", ":", "# pull tokens", "ts", "=", "utils", ".", "full_process", "(", "s", ",", "force_ascii", "=", "force_ascii", ")", "if", "full_process", "else", "s", "tokens"...
Return a cleaned string with token sorted.
[ "Return", "a", "cleaned", "string", "with", "token", "sorted", "." ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/fuzz.py#L75-L83
train
Return a cleaned string with token sorted.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/fuzz.py
token_sort_ratio
def token_sort_ratio(s1, s2, force_ascii=True, full_process=True): """Return a measure of the sequences' similarity between 0 and 100 but sorting the token before comparing. """ return _token_sort(s1, s2, partial=False, force_ascii=force_ascii, full_process=full_process)
python
def token_sort_ratio(s1, s2, force_ascii=True, full_process=True): """Return a measure of the sequences' similarity between 0 and 100 but sorting the token before comparing. """ return _token_sort(s1, s2, partial=False, force_ascii=force_ascii, full_process=full_process)
[ "def", "token_sort_ratio", "(", "s1", ",", "s2", ",", "force_ascii", "=", "True", ",", "full_process", "=", "True", ")", ":", "return", "_token_sort", "(", "s1", ",", "s2", ",", "partial", "=", "False", ",", "force_ascii", "=", "force_ascii", ",", "full_...
Return a measure of the sequences' similarity between 0 and 100 but sorting the token before comparing.
[ "Return", "a", "measure", "of", "the", "sequences", "similarity", "between", "0", "and", "100", "but", "sorting", "the", "token", "before", "comparing", "." ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/fuzz.py#L101-L105
train
Return a measure of the sequences s similarity between 0 and 100 but sorting the token before comparing.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/fuzz.py
partial_token_sort_ratio
def partial_token_sort_ratio(s1, s2, force_ascii=True, full_process=True): """Return the ratio of the most similar substring as a number between 0 and 100 but sorting the token before comparing. """ return _token_sort(s1, s2, partial=True, force_ascii=force_ascii, full_process=full_process)
python
def partial_token_sort_ratio(s1, s2, force_ascii=True, full_process=True): """Return the ratio of the most similar substring as a number between 0 and 100 but sorting the token before comparing. """ return _token_sort(s1, s2, partial=True, force_ascii=force_ascii, full_process=full_process)
[ "def", "partial_token_sort_ratio", "(", "s1", ",", "s2", ",", "force_ascii", "=", "True", ",", "full_process", "=", "True", ")", ":", "return", "_token_sort", "(", "s1", ",", "s2", ",", "partial", "=", "True", ",", "force_ascii", "=", "force_ascii", ",", ...
Return the ratio of the most similar substring as a number between 0 and 100 but sorting the token before comparing.
[ "Return", "the", "ratio", "of", "the", "most", "similar", "substring", "as", "a", "number", "between", "0", "and", "100", "but", "sorting", "the", "token", "before", "comparing", "." ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/fuzz.py#L108-L112
train
Return the ratio of the most similar substring as a number between 0 and 100 but sorting the most similar substring before comparing.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/fuzz.py
_token_set
def _token_set(s1, s2, partial=True, force_ascii=True, full_process=True): """Find all alphanumeric tokens in each string... - treat them as a set - construct two strings of the form: <sorted_intersection><sorted_remainder> - take ratios of those two strings - controls fo...
python
def _token_set(s1, s2, partial=True, force_ascii=True, full_process=True): """Find all alphanumeric tokens in each string... - treat them as a set - construct two strings of the form: <sorted_intersection><sorted_remainder> - take ratios of those two strings - controls fo...
[ "def", "_token_set", "(", "s1", ",", "s2", ",", "partial", "=", "True", ",", "force_ascii", "=", "True", ",", "full_process", "=", "True", ")", ":", "if", "not", "full_process", "and", "s1", "==", "s2", ":", "return", "100", "p1", "=", "utils", ".", ...
Find all alphanumeric tokens in each string... - treat them as a set - construct two strings of the form: <sorted_intersection><sorted_remainder> - take ratios of those two strings - controls for unordered partial matches
[ "Find", "all", "alphanumeric", "tokens", "in", "each", "string", "...", "-", "treat", "them", "as", "a", "set", "-", "construct", "two", "strings", "of", "the", "form", ":", "<sorted_intersection", ">", "<sorted_remainder", ">", "-", "take", "ratios", "of", ...
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/fuzz.py#L116-L165
train
Return the set of alphanumeric tokens in the two strings.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/fuzz.py
QRatio
def QRatio(s1, s2, force_ascii=True, full_process=True): """ Quick ratio comparison between two strings. Runs full_process from utils on both strings Short circuits if either of the strings is empty after processing. :param s1: :param s2: :param force_ascii: Allow only ASCII characters (De...
python
def QRatio(s1, s2, force_ascii=True, full_process=True): """ Quick ratio comparison between two strings. Runs full_process from utils on both strings Short circuits if either of the strings is empty after processing. :param s1: :param s2: :param force_ascii: Allow only ASCII characters (De...
[ "def", "QRatio", "(", "s1", ",", "s2", ",", "force_ascii", "=", "True", ",", "full_process", "=", "True", ")", ":", "if", "full_process", ":", "p1", "=", "utils", ".", "full_process", "(", "s1", ",", "force_ascii", "=", "force_ascii", ")", "p2", "=", ...
Quick ratio comparison between two strings. Runs full_process from utils on both strings Short circuits if either of the strings is empty after processing. :param s1: :param s2: :param force_ascii: Allow only ASCII characters (Default: True) :full_process: Process inputs, used here to avoid do...
[ "Quick", "ratio", "comparison", "between", "two", "strings", "." ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/fuzz.py#L181-L207
train
Quick ratio comparison between two strings.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/fuzz.py
UQRatio
def UQRatio(s1, s2, full_process=True): """ Unicode quick ratio Calls QRatio with force_ascii set to False :param s1: :param s2: :return: similarity ratio """ return QRatio(s1, s2, force_ascii=False, full_process=full_process)
python
def UQRatio(s1, s2, full_process=True): """ Unicode quick ratio Calls QRatio with force_ascii set to False :param s1: :param s2: :return: similarity ratio """ return QRatio(s1, s2, force_ascii=False, full_process=full_process)
[ "def", "UQRatio", "(", "s1", ",", "s2", ",", "full_process", "=", "True", ")", ":", "return", "QRatio", "(", "s1", ",", "s2", ",", "force_ascii", "=", "False", ",", "full_process", "=", "full_process", ")" ]
Unicode quick ratio Calls QRatio with force_ascii set to False :param s1: :param s2: :return: similarity ratio
[ "Unicode", "quick", "ratio" ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/fuzz.py#L210-L220
train
Unicode quick ratio of two strings
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/fuzz.py
WRatio
def WRatio(s1, s2, force_ascii=True, full_process=True): """ Return a measure of the sequences' similarity between 0 and 100, using different algorithms. **Steps in the order they occur** #. Run full_process from utils on both strings #. Short circuit if this makes either string empty #. Take ...
python
def WRatio(s1, s2, force_ascii=True, full_process=True): """ Return a measure of the sequences' similarity between 0 and 100, using different algorithms. **Steps in the order they occur** #. Run full_process from utils on both strings #. Short circuit if this makes either string empty #. Take ...
[ "def", "WRatio", "(", "s1", ",", "s2", ",", "force_ascii", "=", "True", ",", "full_process", "=", "True", ")", ":", "if", "full_process", ":", "p1", "=", "utils", ".", "full_process", "(", "s1", ",", "force_ascii", "=", "force_ascii", ")", "p2", "=", ...
Return a measure of the sequences' similarity between 0 and 100, using different algorithms. **Steps in the order they occur** #. Run full_process from utils on both strings #. Short circuit if this makes either string empty #. Take the ratio of the two processed strings (fuzz.ratio) #. Run checks...
[ "Return", "a", "measure", "of", "the", "sequences", "similarity", "between", "0", "and", "100", "using", "different", "algorithms", "." ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/fuzz.py#L224-L299
train
Returns a measure of the sequences s similarity between 0 and 100.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
fuzzywuzzy/fuzz.py
UWRatio
def UWRatio(s1, s2, full_process=True): """Return a measure of the sequences' similarity between 0 and 100, using different algorithms. Same as WRatio but preserving unicode. """ return WRatio(s1, s2, force_ascii=False, full_process=full_process)
python
def UWRatio(s1, s2, full_process=True): """Return a measure of the sequences' similarity between 0 and 100, using different algorithms. Same as WRatio but preserving unicode. """ return WRatio(s1, s2, force_ascii=False, full_process=full_process)
[ "def", "UWRatio", "(", "s1", ",", "s2", ",", "full_process", "=", "True", ")", ":", "return", "WRatio", "(", "s1", ",", "s2", ",", "force_ascii", "=", "False", ",", "full_process", "=", "full_process", ")" ]
Return a measure of the sequences' similarity between 0 and 100, using different algorithms. Same as WRatio but preserving unicode.
[ "Return", "a", "measure", "of", "the", "sequences", "similarity", "between", "0", "and", "100", "using", "different", "algorithms", ".", "Same", "as", "WRatio", "but", "preserving", "unicode", "." ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/fuzzywuzzy/fuzz.py#L302-L306
train
Return a measure of the sequences s similarity between 0 and 100 using different algorithms.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
seatgeek/fuzzywuzzy
benchmarks.py
print_result_from_timeit
def print_result_from_timeit(stmt='pass', setup='pass', number=1000000): """ Clean function to know how much time took the execution of one statement """ units = ["s", "ms", "us", "ns"] duration = timeit(stmt, setup, number=int(number)) avg_duration = duration / float(number) thousands = int...
python
def print_result_from_timeit(stmt='pass', setup='pass', number=1000000): """ Clean function to know how much time took the execution of one statement """ units = ["s", "ms", "us", "ns"] duration = timeit(stmt, setup, number=int(number)) avg_duration = duration / float(number) thousands = int...
[ "def", "print_result_from_timeit", "(", "stmt", "=", "'pass'", ",", "setup", "=", "'pass'", ",", "number", "=", "1000000", ")", ":", "units", "=", "[", "\"s\"", ",", "\"ms\"", ",", "\"us\"", ",", "\"ns\"", "]", "duration", "=", "timeit", "(", "stmt", "...
Clean function to know how much time took the execution of one statement
[ "Clean", "function", "to", "know", "how", "much", "time", "took", "the", "execution", "of", "one", "statement" ]
778162c5a73256745eb6ae22f925bc2dbcf7c894
https://github.com/seatgeek/fuzzywuzzy/blob/778162c5a73256745eb6ae22f925bc2dbcf7c894/benchmarks.py#L47-L57
train
Print the result of a timeit statement.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
aws/sagemaker-python-sdk
src/sagemaker/pipeline.py
PipelineModel.deploy
def deploy(self, initial_instance_count, instance_type, endpoint_name=None, tags=None): """Deploy this ``Model`` to an ``Endpoint`` and optionally return a ``Predictor``. Create a SageMaker ``Model`` and ``EndpointConfig``, and deploy an ``Endpoint`` from this ``Model``. If ``self.predictor_cls...
python
def deploy(self, initial_instance_count, instance_type, endpoint_name=None, tags=None): """Deploy this ``Model`` to an ``Endpoint`` and optionally return a ``Predictor``. Create a SageMaker ``Model`` and ``EndpointConfig``, and deploy an ``Endpoint`` from this ``Model``. If ``self.predictor_cls...
[ "def", "deploy", "(", "self", ",", "initial_instance_count", ",", "instance_type", ",", "endpoint_name", "=", "None", ",", "tags", "=", "None", ")", ":", "if", "not", "self", ".", "sagemaker_session", ":", "self", ".", "sagemaker_session", "=", "Session", "(...
Deploy this ``Model`` to an ``Endpoint`` and optionally return a ``Predictor``. Create a SageMaker ``Model`` and ``EndpointConfig``, and deploy an ``Endpoint`` from this ``Model``. If ``self.predictor_cls`` is not None, this method returns a the result of invoking ``self.predictor_cls`` on the ...
[ "Deploy", "this", "Model", "to", "an", "Endpoint", "and", "optionally", "return", "a", "Predictor", "." ]
a9e724c7d3f5572b68c3903548c792a59d99799a
https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/pipeline.py#L70-L106
train
Deploy this Model to an Endpoint and optionally return a Predictor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
aws/sagemaker-python-sdk
src/sagemaker/pipeline.py
PipelineModel._create_sagemaker_pipeline_model
def _create_sagemaker_pipeline_model(self, instance_type): """Create a SageMaker Model Entity Args: instance_type (str): The EC2 instance type that this Model will be used for, this is only used to determine if the image needs GPU support or not. accelerator_type...
python
def _create_sagemaker_pipeline_model(self, instance_type): """Create a SageMaker Model Entity Args: instance_type (str): The EC2 instance type that this Model will be used for, this is only used to determine if the image needs GPU support or not. accelerator_type...
[ "def", "_create_sagemaker_pipeline_model", "(", "self", ",", "instance_type", ")", ":", "if", "not", "self", ".", "sagemaker_session", ":", "self", ".", "sagemaker_session", "=", "Session", "(", ")", "containers", "=", "self", ".", "pipeline_container_def", "(", ...
Create a SageMaker Model Entity Args: instance_type (str): The EC2 instance type that this Model will be used for, this is only used to determine if the image needs GPU support or not. accelerator_type (str): Type of Elastic Inference accelerator to attach to an endpoint...
[ "Create", "a", "SageMaker", "Model", "Entity" ]
a9e724c7d3f5572b68c3903548c792a59d99799a
https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/pipeline.py#L108-L124
train
Create a SageMaker Model Entity
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
aws/sagemaker-python-sdk
src/sagemaker/pipeline.py
PipelineModel.delete_model
def delete_model(self): """Delete the SageMaker model backing this pipeline model. This does not delete the list of SageMaker models used in multiple containers to build the inference pipeline. """ if self.name is None: raise ValueError('The SageMaker model must be created ...
python
def delete_model(self): """Delete the SageMaker model backing this pipeline model. This does not delete the list of SageMaker models used in multiple containers to build the inference pipeline. """ if self.name is None: raise ValueError('The SageMaker model must be created ...
[ "def", "delete_model", "(", "self", ")", ":", "if", "self", ".", "name", "is", "None", ":", "raise", "ValueError", "(", "'The SageMaker model must be created before attempting to delete.'", ")", "self", ".", "sagemaker_session", ".", "delete_model", "(", "self", "."...
Delete the SageMaker model backing this pipeline model. This does not delete the list of SageMaker models used in multiple containers to build the inference pipeline.
[ "Delete", "the", "SageMaker", "model", "backing", "this", "pipeline", "model", ".", "This", "does", "not", "delete", "the", "list", "of", "SageMaker", "models", "used", "in", "multiple", "containers", "to", "build", "the", "inference", "pipeline", "." ]
a9e724c7d3f5572b68c3903548c792a59d99799a
https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/pipeline.py#L158-L167
train
Delete the SageMaker model backing this pipeline model.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
aws/sagemaker-python-sdk
src/sagemaker/local/image.py
_stream_output
def _stream_output(process): """Stream the output of a process to stdout This function takes an existing process that will be polled for output. Only stdout will be polled and sent to sys.stdout. Args: process(subprocess.Popen): a process that has been started with stdout=PIPE and ...
python
def _stream_output(process): """Stream the output of a process to stdout This function takes an existing process that will be polled for output. Only stdout will be polled and sent to sys.stdout. Args: process(subprocess.Popen): a process that has been started with stdout=PIPE and ...
[ "def", "_stream_output", "(", "process", ")", ":", "exit_code", "=", "None", "while", "exit_code", "is", "None", ":", "stdout", "=", "process", ".", "stdout", ".", "readline", "(", ")", ".", "decode", "(", "\"utf-8\"", ")", "sys", ".", "stdout", ".", "...
Stream the output of a process to stdout This function takes an existing process that will be polled for output. Only stdout will be polled and sent to sys.stdout. Args: process(subprocess.Popen): a process that has been started with stdout=PIPE and stderr=STDOUT Returns (int): pr...
[ "Stream", "the", "output", "of", "a", "process", "to", "stdout" ]
a9e724c7d3f5572b68c3903548c792a59d99799a
https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/image.py#L570-L592
train
Stream the output of a process to stdout
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
aws/sagemaker-python-sdk
src/sagemaker/local/image.py
_SageMakerContainer.train
def train(self, input_data_config, output_data_config, hyperparameters, job_name): """Run a training job locally using docker-compose. Args: input_data_config (dict): The Input Data Configuration, this contains data such as the channels to be used for training. hy...
python
def train(self, input_data_config, output_data_config, hyperparameters, job_name): """Run a training job locally using docker-compose. Args: input_data_config (dict): The Input Data Configuration, this contains data such as the channels to be used for training. hy...
[ "def", "train", "(", "self", ",", "input_data_config", ",", "output_data_config", ",", "hyperparameters", ",", "job_name", ")", ":", "self", ".", "container_root", "=", "self", ".", "_create_tmp_folder", "(", ")", "os", ".", "mkdir", "(", "os", ".", "path", ...
Run a training job locally using docker-compose. Args: input_data_config (dict): The Input Data Configuration, this contains data such as the channels to be used for training. hyperparameters (dict): The HyperParameters for the training job. job_name (str): Na...
[ "Run", "a", "training", "job", "locally", "using", "docker", "-", "compose", ".", "Args", ":", "input_data_config", "(", "dict", ")", ":", "The", "Input", "Data", "Configuration", "this", "contains", "data", "such", "as", "the", "channels", "to", "be", "us...
a9e724c7d3f5572b68c3903548c792a59d99799a
https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/image.py#L87-L151
train
Run a training job locally using Docker - Compose.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
aws/sagemaker-python-sdk
src/sagemaker/local/image.py
_SageMakerContainer.serve
def serve(self, model_dir, environment): """Host a local endpoint using docker-compose. Args: primary_container (dict): dictionary containing the container runtime settings for serving. Expected keys: - 'ModelDataUrl' pointing to a file or s3:// location. ...
python
def serve(self, model_dir, environment): """Host a local endpoint using docker-compose. Args: primary_container (dict): dictionary containing the container runtime settings for serving. Expected keys: - 'ModelDataUrl' pointing to a file or s3:// location. ...
[ "def", "serve", "(", "self", ",", "model_dir", ",", "environment", ")", ":", "logger", ".", "info", "(", "\"serving\"", ")", "self", ".", "container_root", "=", "self", ".", "_create_tmp_folder", "(", ")", "logger", ".", "info", "(", "'creating hosting dir i...
Host a local endpoint using docker-compose. Args: primary_container (dict): dictionary containing the container runtime settings for serving. Expected keys: - 'ModelDataUrl' pointing to a file or s3:// location. - 'Environment' a dictionary of environm...
[ "Host", "a", "local", "endpoint", "using", "docker", "-", "compose", ".", "Args", ":", "primary_container", "(", "dict", ")", ":", "dictionary", "containing", "the", "container", "runtime", "settings", "for", "serving", ".", "Expected", "keys", ":", "-", "Mo...
a9e724c7d3f5572b68c3903548c792a59d99799a
https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/image.py#L153-L187
train
Start a local container using docker - compose.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
aws/sagemaker-python-sdk
src/sagemaker/local/image.py
_SageMakerContainer.stop_serving
def stop_serving(self): """Stop the serving container. The serving container runs in async mode to allow the SDK to do other tasks. """ if self.container: self.container.down() self.container.join() self._cleanup() # for serving we can delete ...
python
def stop_serving(self): """Stop the serving container. The serving container runs in async mode to allow the SDK to do other tasks. """ if self.container: self.container.down() self.container.join() self._cleanup() # for serving we can delete ...
[ "def", "stop_serving", "(", "self", ")", ":", "if", "self", ".", "container", ":", "self", ".", "container", ".", "down", "(", ")", "self", ".", "container", ".", "join", "(", ")", "self", ".", "_cleanup", "(", ")", "# for serving we can delete everything ...
Stop the serving container. The serving container runs in async mode to allow the SDK to do other tasks.
[ "Stop", "the", "serving", "container", "." ]
a9e724c7d3f5572b68c3903548c792a59d99799a
https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/image.py#L189-L199
train
Stop the serving container.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...