nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/aepack.py | python | unpack | (desc, formodulename="") | return mkunknown(desc.type, desc.data) | Unpack an AE descriptor to a python object | Unpack an AE descriptor to a python object | [
"Unpack",
"an",
"AE",
"descriptor",
"to",
"a",
"python",
"object"
] | def unpack(desc, formodulename=""):
"""Unpack an AE descriptor to a python object"""
t = desc.type
if t in unpacker_coercions:
desc = desc.AECoerceDesc(unpacker_coercions[t])
t = desc.type # This is a guess by Jack....
if t == typeAEList:
l = []
for i in range(desc.AECo... | [
"def",
"unpack",
"(",
"desc",
",",
"formodulename",
"=",
"\"\"",
")",
":",
"t",
"=",
"desc",
".",
"type",
"if",
"t",
"in",
"unpacker_coercions",
":",
"desc",
"=",
"desc",
".",
"AECoerceDesc",
"(",
"unpacker_coercions",
"[",
"t",
"]",
")",
"t",
"=",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/aepack.py#L131-L253 | |
cocos-creator/engine-native | 984c4c9f5838253313b44ccd429bd8fac4ec8a6a | tools/bindings-generator/clang/cindex.py | python | Cursor.availability | (self) | return AvailabilityKind.from_id(self._availability) | Retrieves the availability of the entity pointed at by the cursor. | Retrieves the availability of the entity pointed at by the cursor. | [
"Retrieves",
"the",
"availability",
"of",
"the",
"entity",
"pointed",
"at",
"by",
"the",
"cursor",
"."
] | def availability(self):
"""
Retrieves the availability of the entity pointed at by the cursor.
"""
if not hasattr(self, '_availability'):
self._availability = conf.lib.clang_getCursorAvailability(self)
return AvailabilityKind.from_id(self._availability) | [
"def",
"availability",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_availability'",
")",
":",
"self",
".",
"_availability",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorAvailability",
"(",
"self",
")",
"return",
"AvailabilityKind",
".... | https://github.com/cocos-creator/engine-native/blob/984c4c9f5838253313b44ccd429bd8fac4ec8a6a/tools/bindings-generator/clang/cindex.py#L1623-L1630 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/framework/docs.py | python | Library._write_class_markdown_to_file | (self, f, name, cls) | Write the class doc to `f`.
Args:
f: File to write to.
name: name to use.
cls: class object. | Write the class doc to `f`. | [
"Write",
"the",
"class",
"doc",
"to",
"f",
"."
] | def _write_class_markdown_to_file(self, f, name, cls):
"""Write the class doc to `f`.
Args:
f: File to write to.
name: name to use.
cls: class object.
"""
# Build the list of class methods to document.
methods = dict(self.get_class_members(name, cls))
# Used later to check if ... | [
"def",
"_write_class_markdown_to_file",
"(",
"self",
",",
"f",
",",
"name",
",",
"cls",
")",
":",
"# Build the list of class methods to document.",
"methods",
"=",
"dict",
"(",
"self",
".",
"get_class_members",
"(",
"name",
",",
"cls",
")",
")",
"# Used later to c... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/docs.py#L478-L511 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/packages/six.py | python | python_2_unicode_compatible | (klass) | return klass | A decorator that defines __unicode__ and __str__ methods under Python 2.
Under Python 3 it does nothing.
To support Python 2 and 3 with a single code base, define a __str__ method
returning text and apply this decorator to the class. | A decorator that defines __unicode__ and __str__ methods under Python 2.
Under Python 3 it does nothing. | [
"A",
"decorator",
"that",
"defines",
"__unicode__",
"and",
"__str__",
"methods",
"under",
"Python",
"2",
".",
"Under",
"Python",
"3",
"it",
"does",
"nothing",
"."
] | def python_2_unicode_compatible(klass):
"""
A decorator that defines __unicode__ and __str__ methods under Python 2.
Under Python 3 it does nothing.
To support Python 2 and 3 with a single code base, define a __str__ method
returning text and apply this decorator to the class.
"""
if PY2:
... | [
"def",
"python_2_unicode_compatible",
"(",
"klass",
")",
":",
"if",
"PY2",
":",
"if",
"'__str__'",
"not",
"in",
"klass",
".",
"__dict__",
":",
"raise",
"ValueError",
"(",
"\"@python_2_unicode_compatible cannot be applied \"",
"\"to %s because it doesn't define __str__().\""... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/packages/six.py#L828-L843 | |
yyzybb537/libgo | 4af17b7c67643c4d54aa354dcc77963ea07847d0 | third_party/boost.context/tools/build/src/util/path.py | python | glob_tree | (roots, patterns, exclude_patterns=None) | return result | Recursive version of GLOB. Builds the glob of files while
also searching in the subdirectories of the given roots. An
optional set of exclusion patterns will filter out the
matching entries from the result. The exclusions also apply
to the subdirectory scanning, such that directories that
match the ... | Recursive version of GLOB. Builds the glob of files while
also searching in the subdirectories of the given roots. An
optional set of exclusion patterns will filter out the
matching entries from the result. The exclusions also apply
to the subdirectory scanning, such that directories that
match the ... | [
"Recursive",
"version",
"of",
"GLOB",
".",
"Builds",
"the",
"glob",
"of",
"files",
"while",
"also",
"searching",
"in",
"the",
"subdirectories",
"of",
"the",
"given",
"roots",
".",
"An",
"optional",
"set",
"of",
"exclusion",
"patterns",
"will",
"filter",
"out... | def glob_tree(roots, patterns, exclude_patterns=None):
"""Recursive version of GLOB. Builds the glob of files while
also searching in the subdirectories of the given roots. An
optional set of exclusion patterns will filter out the
matching entries from the result. The exclusions also apply
to the su... | [
"def",
"glob_tree",
"(",
"roots",
",",
"patterns",
",",
"exclude_patterns",
"=",
"None",
")",
":",
"if",
"not",
"exclude_patterns",
":",
"exclude_patterns",
"=",
"[",
"]",
"result",
"=",
"glob",
"(",
"roots",
",",
"patterns",
",",
"exclude_patterns",
")",
... | https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/util/path.py#L872-L888 | |
shader-slang/slang | b8982fcf43b86c1e39dcc3dd19bff2821633eda6 | external/vulkan/registry/cgenerator.py | python | COutputGenerator.genStruct | (self, typeinfo, typeName, alias) | Generate struct (e.g. C "struct" type).
This is a special case of the <type> tag where the contents are
interpreted as a set of <member> tags instead of freeform C
C type declarations. The <member> tags are just like <param>
tags - they are a declaration of a struct or union member.
... | Generate struct (e.g. C "struct" type). | [
"Generate",
"struct",
"(",
"e",
".",
"g",
".",
"C",
"struct",
"type",
")",
"."
] | def genStruct(self, typeinfo, typeName, alias):
"""Generate struct (e.g. C "struct" type).
This is a special case of the <type> tag where the contents are
interpreted as a set of <member> tags instead of freeform C
C type declarations. The <member> tags are just like <param>
tag... | [
"def",
"genStruct",
"(",
"self",
",",
"typeinfo",
",",
"typeName",
",",
"alias",
")",
":",
"OutputGenerator",
".",
"genStruct",
"(",
"self",
",",
"typeinfo",
",",
"typeName",
",",
"alias",
")",
"typeElem",
"=",
"typeinfo",
".",
"elem",
"if",
"alias",
":"... | https://github.com/shader-slang/slang/blob/b8982fcf43b86c1e39dcc3dd19bff2821633eda6/external/vulkan/registry/cgenerator.py#L313-L354 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/logging/config.py | python | DictConfigurator.common_logger_config | (self, logger, config, incremental=False) | Perform configuration which is common to root and non-root loggers. | Perform configuration which is common to root and non-root loggers. | [
"Perform",
"configuration",
"which",
"is",
"common",
"to",
"root",
"and",
"non",
"-",
"root",
"loggers",
"."
] | def common_logger_config(self, logger, config, incremental=False):
"""
Perform configuration which is common to root and non-root loggers.
"""
level = config.get('level', None)
if level is not None:
logger.setLevel(logging._checkLevel(level))
if not incrementa... | [
"def",
"common_logger_config",
"(",
"self",
",",
"logger",
",",
"config",
",",
"incremental",
"=",
"False",
")",
":",
"level",
"=",
"config",
".",
"get",
"(",
"'level'",
",",
"None",
")",
"if",
"level",
"is",
"not",
"None",
":",
"logger",
".",
"setLeve... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/logging/config.py#L774-L790 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | compiler-rt/lib/asan/scripts/asan_symbolize.py | python | Symbolizer.symbolize | (self, addr, binary, offset) | return None | Symbolize the given address (pair of binary and offset).
Overriden in subclasses.
Args:
addr: virtual address of an instruction.
binary: path to executable/shared object containing this instruction.
offset: instruction offset in the @binary.
Returns:
list of strings (one str... | Symbolize the given address (pair of binary and offset). | [
"Symbolize",
"the",
"given",
"address",
"(",
"pair",
"of",
"binary",
"and",
"offset",
")",
"."
] | def symbolize(self, addr, binary, offset):
"""Symbolize the given address (pair of binary and offset).
Overriden in subclasses.
Args:
addr: virtual address of an instruction.
binary: path to executable/shared object containing this instruction.
offset: instruction offset in the @bin... | [
"def",
"symbolize",
"(",
"self",
",",
"addr",
",",
"binary",
",",
"offset",
")",
":",
"return",
"None"
] | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/compiler-rt/lib/asan/scripts/asan_symbolize.py#L66-L79 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/calendar.py | python | CalendarDateAttr.HasBorderColour | (*args, **kwargs) | return _calendar.CalendarDateAttr_HasBorderColour(*args, **kwargs) | HasBorderColour(self) -> bool | HasBorderColour(self) -> bool | [
"HasBorderColour",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasBorderColour(*args, **kwargs):
"""HasBorderColour(self) -> bool"""
return _calendar.CalendarDateAttr_HasBorderColour(*args, **kwargs) | [
"def",
"HasBorderColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_calendar",
".",
"CalendarDateAttr_HasBorderColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/calendar.py#L130-L132 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/crywaflib/msvs.py | python | make_uuid | (v, prefix = None) | return str(gid).upper() | simple utility function | simple utility function | [
"simple",
"utility",
"function"
] | def make_uuid(v, prefix = None):
"""
simple utility function
"""
if isinstance(v, dict):
keys = list(v.keys())
keys.sort()
tmp = str([(k, v[k]) for k in keys])
else:
tmp = str(v)
d = Utils.md5(tmp.encode()).hexdigest().upper()
if prefix:
d = '%s%s' % (prefix, d[8:])
gid = uuid.UUID(d, version = 4)
re... | [
"def",
"make_uuid",
"(",
"v",
",",
"prefix",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"v",
",",
"dict",
")",
":",
"keys",
"=",
"list",
"(",
"v",
".",
"keys",
"(",
")",
")",
"keys",
".",
"sort",
"(",
")",
"tmp",
"=",
"str",
"(",
"[",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/msvs.py#L710-L724 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Node.py | python | Node.__setstate__ | (self, data) | Deserializes from data | Deserializes from data | [
"Deserializes",
"from",
"data"
] | def __setstate__(self, data):
"Deserializes from data"
self.name = data[0]
self.parent = data[1]
if data[2] is not None:
self.children = data[2]
if data[3] is not None:
self.sig = data[3] | [
"def",
"__setstate__",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"name",
"=",
"data",
"[",
"0",
"]",
"self",
".",
"parent",
"=",
"data",
"[",
"1",
"]",
"if",
"data",
"[",
"2",
"]",
"is",
"not",
"None",
":",
"self",
".",
"children",
"=",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Node.py#L113-L120 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/configobj/configobj.py | python | InterpolationEngine._parse_match | (self, match) | Implementation-dependent helper function.
Will be passed a match object corresponding to the interpolation
key we just found (e.g., "%(foo)s" or "$foo"). Should look up that
key in the appropriate config file section (using the ``_fetch()``
helper function) and return a 3-tuple: (key, v... | Implementation-dependent helper function. | [
"Implementation",
"-",
"dependent",
"helper",
"function",
"."
] | def _parse_match(self, match):
"""Implementation-dependent helper function.
Will be passed a match object corresponding to the interpolation
key we just found (e.g., "%(foo)s" or "$foo"). Should look up that
key in the appropriate config file section (using the ``_fetch()``
help... | [
"def",
"_parse_match",
"(",
"self",
",",
"match",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/configobj/configobj.py#L403-L419 | ||
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/rfc2217.py | python | TelnetOption.__init__ | (self, connection, name, option, send_yes, send_no, ack_yes,
ack_no, initial_state, activation_callback=None) | \
Initialize option.
:param connection: connection used to transmit answers
:param name: a readable name for debug outputs
:param send_yes: what to send when option is to be enabled.
:param send_no: what to send when option is to be disabled.
:param ack_yes: what to expec... | \
Initialize option.
:param connection: connection used to transmit answers
:param name: a readable name for debug outputs
:param send_yes: what to send when option is to be enabled.
:param send_no: what to send when option is to be disabled.
:param ack_yes: what to expec... | [
"\\",
"Initialize",
"option",
".",
":",
"param",
"connection",
":",
"connection",
"used",
"to",
"transmit",
"answers",
":",
"param",
"name",
":",
"a",
"readable",
"name",
"for",
"debug",
"outputs",
":",
"param",
"send_yes",
":",
"what",
"to",
"send",
"when... | def __init__(self, connection, name, option, send_yes, send_no, ack_yes,
ack_no, initial_state, activation_callback=None):
"""\
Initialize option.
:param connection: connection used to transmit answers
:param name: a readable name for debug outputs
:param send_ye... | [
"def",
"__init__",
"(",
"self",
",",
"connection",
",",
"name",
",",
"option",
",",
"send_yes",
",",
"send_no",
",",
"ack_yes",
",",
"ack_no",
",",
"initial_state",
",",
"activation_callback",
"=",
"None",
")",
":",
"self",
".",
"connection",
"=",
"connect... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/rfc2217.py#L238-L260 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintsmolecule.py | python | LibmintsMolecule.set_units | (self, units) | Sets the geometry units (constructor use).
Parameters
----------
units : {'Angstrom', 'Bohr'}
Units of input geometry.
Returns
-------
None
Examples
--------
# [1]
>>> H2OH2O.set_units('Angstrom') | Sets the geometry units (constructor use). | [
"Sets",
"the",
"geometry",
"units",
"(",
"constructor",
"use",
")",
"."
] | def set_units(self, units):
"""Sets the geometry units (constructor use).
Parameters
----------
units : {'Angstrom', 'Bohr'}
Units of input geometry.
Returns
-------
None
Examples
--------
# [1]
>>> H2OH2O.set_units('... | [
"def",
"set_units",
"(",
"self",
",",
"units",
")",
":",
"if",
"units",
"==",
"'Angstrom'",
":",
"self",
".",
"PYunits",
"=",
"units",
"self",
".",
"PYinput_units_to_au",
"=",
"1.0",
"/",
"qcel",
".",
"constants",
".",
"bohr2angstroms",
"elif",
"units",
... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintsmolecule.py#L303-L328 | ||
casadi/casadi | 8d0f80a4d0fe2054384bfb9748f7a0f6bae540ff | misc/cpplint.py | python | Error | (filename, linenum, category, confidence, message) | Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
False positives can be suppressed by the use of
"cpplint(categor... | Logs the fact we've found a lint error. | [
"Logs",
"the",
"fact",
"we",
"ve",
"found",
"a",
"lint",
"error",
"."
] | def Error(filename, linenum, category, confidence, message):
"""Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
... | [
"def",
"Error",
"(",
"filename",
",",
"linenum",
",",
"category",
",",
"confidence",
",",
"message",
")",
":",
"if",
"_ShouldPrintError",
"(",
"category",
",",
"confidence",
",",
"linenum",
")",
":",
"_cpplint_state",
".",
"IncrementErrorCount",
"(",
"category... | https://github.com/casadi/casadi/blob/8d0f80a4d0fe2054384bfb9748f7a0f6bae540ff/misc/cpplint.py#L981-L1013 | ||
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/urlgrabber/keepalive.py | python | KeepAliveHandler.open_connections | (self) | return [(host, len(li)) for (host, li) in self._cm.get_all().items()] | return a list of connected hosts and the number of connections
to each. [('foo.com:80', 2), ('bar.org', 1)] | return a list of connected hosts and the number of connections
to each. [('foo.com:80', 2), ('bar.org', 1)] | [
"return",
"a",
"list",
"of",
"connected",
"hosts",
"and",
"the",
"number",
"of",
"connections",
"to",
"each",
".",
"[",
"(",
"foo",
".",
"com",
":",
"80",
"2",
")",
"(",
"bar",
".",
"org",
"1",
")",
"]"
] | def open_connections(self):
"""return a list of connected hosts and the number of connections
to each. [('foo.com:80', 2), ('bar.org', 1)]"""
return [(host, len(li)) for (host, li) in self._cm.get_all().items()] | [
"def",
"open_connections",
"(",
"self",
")",
":",
"return",
"[",
"(",
"host",
",",
"len",
"(",
"li",
")",
")",
"for",
"(",
"host",
",",
"li",
")",
"in",
"self",
".",
"_cm",
".",
"get_all",
"(",
")",
".",
"items",
"(",
")",
"]"
] | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/urlgrabber/keepalive.py#L182-L185 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pkgutil.py | python | get_importer | (path_item) | return importer | Retrieve a finder for the given path item
The returned finder is cached in sys.path_importer_cache
if it was newly created by a path hook.
The cache (or part of it) can be cleared manually if a
rescan of sys.path_hooks is necessary. | Retrieve a finder for the given path item | [
"Retrieve",
"a",
"finder",
"for",
"the",
"given",
"path",
"item"
] | def get_importer(path_item):
"""Retrieve a finder for the given path item
The returned finder is cached in sys.path_importer_cache
if it was newly created by a path hook.
The cache (or part of it) can be cleared manually if a
rescan of sys.path_hooks is necessary.
"""
try:
importer... | [
"def",
"get_importer",
"(",
"path_item",
")",
":",
"try",
":",
"importer",
"=",
"sys",
".",
"path_importer_cache",
"[",
"path_item",
"]",
"except",
"KeyError",
":",
"for",
"path_hook",
"in",
"sys",
".",
"path_hooks",
":",
"try",
":",
"importer",
"=",
"path... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pkgutil.py#L405-L426 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/generator/make.py | python | MakefileWriter.WriteSources | (self, configs, deps, sources,
extra_outputs, extra_link_deps,
part_of_all, precompiled_header) | Write Makefile code for any 'sources' from the gyp input.
These are source files necessary to build the current target.
configs, deps, sources: input from gyp.
extra_outputs: a list of extra outputs this action should be dependent on;
used to serialize action/rules before compilation
... | Write Makefile code for any 'sources' from the gyp input.
These are source files necessary to build the current target. | [
"Write",
"Makefile",
"code",
"for",
"any",
"sources",
"from",
"the",
"gyp",
"input",
".",
"These",
"are",
"source",
"files",
"necessary",
"to",
"build",
"the",
"current",
"target",
"."
] | def WriteSources(self, configs, deps, sources,
extra_outputs, extra_link_deps,
part_of_all, precompiled_header):
"""Write Makefile code for any 'sources' from the gyp input.
These are source files necessary to build the current target.
configs, deps, sources: input fro... | [
"def",
"WriteSources",
"(",
"self",
",",
"configs",
",",
"deps",
",",
"sources",
",",
"extra_outputs",
",",
"extra_link_deps",
",",
"part_of_all",
",",
"precompiled_header",
")",
":",
"# Write configuration-specific variables for CFLAGS, etc.",
"for",
"configname",
"in"... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/make.py#L1129-L1251 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/ObjectsFem.py | python | makeConstraintPulley | (
doc,
name="ConstraintPulley"
) | return obj | makeConstraintPulley(document, [name]):
makes a Fem ConstraintPulley object | makeConstraintPulley(document, [name]):
makes a Fem ConstraintPulley object | [
"makeConstraintPulley",
"(",
"document",
"[",
"name",
"]",
")",
":",
"makes",
"a",
"Fem",
"ConstraintPulley",
"object"
] | def makeConstraintPulley(
doc,
name="ConstraintPulley"
):
"""makeConstraintPulley(document, [name]):
makes a Fem ConstraintPulley object"""
obj = doc.addObject("Fem::ConstraintPulley", name)
return obj | [
"def",
"makeConstraintPulley",
"(",
"doc",
",",
"name",
"=",
"\"ConstraintPulley\"",
")",
":",
"obj",
"=",
"doc",
".",
"addObject",
"(",
"\"Fem::ConstraintPulley\"",
",",
"name",
")",
"return",
"obj"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/ObjectsFem.py#L261-L268 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/uuid.py | python | _random_getnode | () | return random.getrandbits(48) | (1 << 40) | Get a random node ID. | Get a random node ID. | [
"Get",
"a",
"random",
"node",
"ID",
"."
] | def _random_getnode():
"""Get a random node ID."""
# RFC 4122, $4.1.6 says "For systems with no IEEE address, a randomly or
# pseudo-randomly generated value may be used; see Section 4.5. The
# multicast bit must be set in such addresses, in order that they will
# never conflict with addresses obta... | [
"def",
"_random_getnode",
"(",
")",
":",
"# RFC 4122, $4.1.6 says \"For systems with no IEEE address, a randomly or",
"# pseudo-randomly generated value may be used; see Section 4.5. The",
"# multicast bit must be set in such addresses, in order that they will",
"# never conflict with addresses obt... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/uuid.py#L599-L612 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/report.py | python | _CreatePageState | (masters, bots, tests, checked) | return {
'charts': chart_states
} | Creates a page state dictionary for old URI parameters.
Based on original /report page, each combination of masters, bots, and
tests is a chart; therefor we create a list of chart states for those
combinations.
Args:
masters: A string with comma separated list of masters.
bots: A string with comma sep... | Creates a page state dictionary for old URI parameters. | [
"Creates",
"a",
"page",
"state",
"dictionary",
"for",
"old",
"URI",
"parameters",
"."
] | def _CreatePageState(masters, bots, tests, checked):
"""Creates a page state dictionary for old URI parameters.
Based on original /report page, each combination of masters, bots, and
tests is a chart; therefor we create a list of chart states for those
combinations.
Args:
masters: A string with comma se... | [
"def",
"_CreatePageState",
"(",
"masters",
",",
"bots",
",",
"tests",
",",
"checked",
")",
":",
"selected_series",
"=",
"[",
"]",
"if",
"checked",
":",
"if",
"checked",
"==",
"'all'",
":",
"selected_series",
"=",
"[",
"'all'",
"]",
"else",
":",
"selected... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/report.py#L83-L128 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | lineNumbersDefault | (val) | return ret | Set and return the previous value for enabling line numbers
in elements contents. This may break on old application and
is turned off by default. | Set and return the previous value for enabling line numbers
in elements contents. This may break on old application and
is turned off by default. | [
"Set",
"and",
"return",
"the",
"previous",
"value",
"for",
"enabling",
"line",
"numbers",
"in",
"elements",
"contents",
".",
"This",
"may",
"break",
"on",
"old",
"application",
"and",
"is",
"turned",
"off",
"by",
"default",
"."
] | def lineNumbersDefault(val):
"""Set and return the previous value for enabling line numbers
in elements contents. This may break on old application and
is turned off by default. """
ret = libxml2mod.xmlLineNumbersDefault(val)
return ret | [
"def",
"lineNumbersDefault",
"(",
"val",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlLineNumbersDefault",
"(",
"val",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L517-L522 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBDebugger.StateIsStoppedState | (state) | return _lldb.SBDebugger_StateIsStoppedState(state) | StateIsStoppedState(lldb::StateType state) -> bool | StateIsStoppedState(lldb::StateType state) -> bool | [
"StateIsStoppedState",
"(",
"lldb",
"::",
"StateType",
"state",
")",
"-",
">",
"bool"
] | def StateIsStoppedState(state):
"""StateIsStoppedState(lldb::StateType state) -> bool"""
return _lldb.SBDebugger_StateIsStoppedState(state) | [
"def",
"StateIsStoppedState",
"(",
"state",
")",
":",
"return",
"_lldb",
".",
"SBDebugger_StateIsStoppedState",
"(",
"state",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L4125-L4127 | |
danxuhk/ContinuousCRF-CNN | 2b6dcaf179620f118b225ed12c890414ca828e21 | scripts/cpp_lint.py | python | ProcessLine | (filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]) | Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
clean_lines: An array of strings, each representing a line of the file,
with comments stripped.
line: Number of line being ... | Processes a single line in the file. | [
"Processes",
"a",
"single",
"line",
"in",
"the",
"file",
"."
] | def ProcessLine(filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]):
"""Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (d... | [
"def",
"ProcessLine",
"(",
"filename",
",",
"file_extension",
",",
"clean_lines",
",",
"line",
",",
"include_state",
",",
"function_state",
",",
"nesting_state",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"raw_lines",
"=",
"clean_lines"... | https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/scripts/cpp_lint.py#L4604-L4646 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xmlDoc.saveFormatFile | (self, filename, format) | return ret | Dump an XML document to a file. Will use compression if
compiled in and enabled. If @filename is "-" the stdout
file is used. If @format is set then the document will be
indented on output. Note that @format = 1 provide node
indenting only if xmlIndentTreeOutput = 1 or
... | Dump an XML document to a file. Will use compression if
compiled in and enabled. If | [
"Dump",
"an",
"XML",
"document",
"to",
"a",
"file",
".",
"Will",
"use",
"compression",
"if",
"compiled",
"in",
"and",
"enabled",
".",
"If"
] | def saveFormatFile(self, filename, format):
"""Dump an XML document to a file. Will use compression if
compiled in and enabled. If @filename is "-" the stdout
file is used. If @format is set then the document will be
indented on output. Note that @format = 1 provide node
... | [
"def",
"saveFormatFile",
"(",
"self",
",",
"filename",
",",
"format",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlSaveFormatFile",
"(",
"filename",
",",
"self",
".",
"_o",
",",
"format",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L4499-L4507 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/jinja2/environment.py | python | Environment.make_globals | (self, d) | return dict(self.globals, **d) | Return a dict for the globals. | Return a dict for the globals. | [
"Return",
"a",
"dict",
"for",
"the",
"globals",
"."
] | def make_globals(self, d):
"""Return a dict for the globals."""
if not d:
return self.globals
return dict(self.globals, **d) | [
"def",
"make_globals",
"(",
"self",
",",
"d",
")",
":",
"if",
"not",
"d",
":",
"return",
"self",
".",
"globals",
"return",
"dict",
"(",
"self",
".",
"globals",
",",
"*",
"*",
"d",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/jinja2/environment.py#L843-L847 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.ChangeLexerState | (*args, **kwargs) | return _stc.StyledTextCtrl_ChangeLexerState(*args, **kwargs) | ChangeLexerState(self, int start, int end) -> int | ChangeLexerState(self, int start, int end) -> int | [
"ChangeLexerState",
"(",
"self",
"int",
"start",
"int",
"end",
")",
"-",
">",
"int"
] | def ChangeLexerState(*args, **kwargs):
"""ChangeLexerState(self, int start, int end) -> int"""
return _stc.StyledTextCtrl_ChangeLexerState(*args, **kwargs) | [
"def",
"ChangeLexerState",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_ChangeLexerState",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L6333-L6335 | |
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/BASIC/basparse.py | python | p_command_for_bad_final | (p) | command : FOR ID EQUALS expr TO error optstep | command : FOR ID EQUALS expr TO error optstep | [
"command",
":",
"FOR",
"ID",
"EQUALS",
"expr",
"TO",
"error",
"optstep"
] | def p_command_for_bad_final(p):
'''command : FOR ID EQUALS expr TO error optstep'''
p[0] = "BAD FINAL VALUE IN FOR STATEMENT" | [
"def",
"p_command_for_bad_final",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"\"BAD FINAL VALUE IN FOR STATEMENT\""
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/BASIC/basparse.py#L172-L174 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/cpplint.py | python | CloseExpression | (clean_lines, linenum, pos) | return (line, clean_lines.NumLines(), -1) | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
TODO(unknown): cpplint spends a fair bit of time matching parentheses.
Ideally we would want to index all... | If input points to ( or { or [ or <, finds the position that closes it. | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
"."
] | def CloseExpression(clean_lines, linenum, pos):
"""If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
TODO(unknown): cpplint spends a fair bit of time match... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"(",
"line",
"[",
"pos",
"]",
"not",
"in",
"'({[<'",
")",
"or",
"Match",
"(",
"r'<[<=]'",
",",
"... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/cpplint.py#L1746-L1787 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/ndarray/ndarray.py | python | NDArray.shape_array | (self, *args, **kwargs) | return op.shape_array(self, *args, **kwargs) | Convenience fluent method for :py:func:`shape_array`.
The arguments are the same as for :py:func:`shape_array`, with
this array as data. | Convenience fluent method for :py:func:`shape_array`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"shape_array",
"."
] | def shape_array(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`shape_array`.
The arguments are the same as for :py:func:`shape_array`, with
this array as data.
"""
return op.shape_array(self, *args, **kwargs) | [
"def",
"shape_array",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"shape_array",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L1286-L1292 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/tools/gyp/pylib/gyp/generator/make.py | python | Compilable | (filename) | return False | Return true if the file is compilable (should be in OBJS). | Return true if the file is compilable (should be in OBJS). | [
"Return",
"true",
"if",
"the",
"file",
"is",
"compilable",
"(",
"should",
"be",
"in",
"OBJS",
")",
"."
] | def Compilable(filename):
"""Return true if the file is compilable (should be in OBJS)."""
for res in (filename.endswith(e) for e in COMPILABLE_EXTENSIONS):
if res:
return True
return False | [
"def",
"Compilable",
"(",
"filename",
")",
":",
"for",
"res",
"in",
"(",
"filename",
".",
"endswith",
"(",
"e",
")",
"for",
"e",
"in",
"COMPILABLE_EXTENSIONS",
")",
":",
"if",
"res",
":",
"return",
"True",
"return",
"False"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/make.py#L554-L559 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/_custom_op/matmul_cube_fracz_right_mul_impl.py | python | get_cus_tile_info | (input_x1, input_x2, input_x3) | return mo_tile_, ko_tile_, no_tile_, core_m_num_, core_n_num_, diag_opt | get_cus_tile_info | get_cus_tile_info | [
"get_cus_tile_info"
] | def get_cus_tile_info(input_x1, input_x2, input_x3):
"""get_cus_tile_info"""
_, mo, _, _ = input_x1.shape
no, _, _, _ = input_x2.shape
c0 = input_x1.shape[-1]
diag_outer = 128 // c0
input_shape = (tuple(input_x1.shape), input_x1.dtype, tuple(input_x2.shape), input_x2.dtype,
tu... | [
"def",
"get_cus_tile_info",
"(",
"input_x1",
",",
"input_x2",
",",
"input_x3",
")",
":",
"_",
",",
"mo",
",",
"_",
",",
"_",
"=",
"input_x1",
".",
"shape",
"no",
",",
"_",
",",
"_",
",",
"_",
"=",
"input_x2",
".",
"shape",
"c0",
"=",
"input_x1",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/_custom_op/matmul_cube_fracz_right_mul_impl.py#L95-L139 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Validation/RecoB/scripts/cuy.py | python | nonzero | (self) | return False | True if options were given | True if options were given | [
"True",
"if",
"options",
"were",
"given"
] | def nonzero(self): # will become the nonzero method of optparse.Values
"True if options were given"
for v in self.__dict__.values():
if v is not None: return True
return False | [
"def",
"nonzero",
"(",
"self",
")",
":",
"# will become the nonzero method of optparse.Values",
"for",
"v",
"in",
"self",
".",
"__dict__",
".",
"values",
"(",
")",
":",
"if",
"v",
"is",
"not",
"None",
":",
"return",
"True",
"return",
"False"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/RecoB/scripts/cuy.py#L79-L83 | |
GoSSIP-SJTU/TripleDoggy | 03648d6b19c812504b14e8b98c8c7b3f443f4e54 | tools/clang/docs/tools/dump_ast_matchers.py | python | unify_arguments | (args) | return args | Gets rid of anything the user doesn't care about in the argument list. | Gets rid of anything the user doesn't care about in the argument list. | [
"Gets",
"rid",
"of",
"anything",
"the",
"user",
"doesn",
"t",
"care",
"about",
"in",
"the",
"argument",
"list",
"."
] | def unify_arguments(args):
"""Gets rid of anything the user doesn't care about in the argument list."""
args = re.sub(r'internal::', r'', args)
args = re.sub(r'extern const\s+(.*)&', r'\1 ', args)
args = re.sub(r'&', r' ', args)
args = re.sub(r'(^|\s)M\d?(\s)', r'\1Matcher<*>\2', args)
return args | [
"def",
"unify_arguments",
"(",
"args",
")",
":",
"args",
"=",
"re",
".",
"sub",
"(",
"r'internal::'",
",",
"r''",
",",
"args",
")",
"args",
"=",
"re",
".",
"sub",
"(",
"r'extern const\\s+(.*)&'",
",",
"r'\\1 '",
",",
"args",
")",
"args",
"=",
"re",
"... | https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/tools/clang/docs/tools/dump_ast_matchers.py#L95-L101 | |
CalcProgrammer1/OpenRGB | 8156b0167a7590dd8ba561dfde524bfcacf46b5e | dependencies/mbedtls-2.24.0/scripts/config.py | python | crypto_adapter | (adapter) | return continuation | Modify an adapter to disable non-crypto symbols.
``crypto_adapter(adapter)(name, active, section)`` is like
``adapter(name, active, section)``, but unsets all X.509 and TLS symbols. | Modify an adapter to disable non-crypto symbols. | [
"Modify",
"an",
"adapter",
"to",
"disable",
"non",
"-",
"crypto",
"symbols",
"."
] | def crypto_adapter(adapter):
"""Modify an adapter to disable non-crypto symbols.
``crypto_adapter(adapter)(name, active, section)`` is like
``adapter(name, active, section)``, but unsets all X.509 and TLS symbols.
"""
def continuation(name, active, section):
if not include_in_crypto(name):
... | [
"def",
"crypto_adapter",
"(",
"adapter",
")",
":",
"def",
"continuation",
"(",
"name",
",",
"active",
",",
"section",
")",
":",
"if",
"not",
"include_in_crypto",
"(",
"name",
")",
":",
"return",
"False",
"if",
"adapter",
"is",
"None",
":",
"return",
"act... | https://github.com/CalcProgrammer1/OpenRGB/blob/8156b0167a7590dd8ba561dfde524bfcacf46b5e/dependencies/mbedtls-2.24.0/scripts/config.py#L287-L299 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/text_format.py | python | Tokenizer._ConsumeSingleByteString | (self) | return result | Consume one token of a string literal.
String literals (whether bytes or text) can come in multiple adjacent
tokens which are automatically concatenated, like in C or Python. This
method only consumes one token.
Returns:
The token parsed.
Raises:
ParseError: When the wrong format data... | Consume one token of a string literal. | [
"Consume",
"one",
"token",
"of",
"a",
"string",
"literal",
"."
] | def _ConsumeSingleByteString(self):
"""Consume one token of a string literal.
String literals (whether bytes or text) can come in multiple adjacent
tokens which are automatically concatenated, like in C or Python. This
method only consumes one token.
Returns:
The token parsed.
Raises:
... | [
"def",
"_ConsumeSingleByteString",
"(",
"self",
")",
":",
"text",
"=",
"self",
".",
"token",
"if",
"len",
"(",
"text",
")",
"<",
"1",
"or",
"text",
"[",
"0",
"]",
"not",
"in",
"_QUOTES",
":",
"raise",
"self",
".",
"ParseError",
"(",
"'Expected string b... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/text_format.py#L1196-L1220 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/io/loader.py | python | parseLines | (text) | return esclines | Returns a list of lines from the given text. Understands end-of-line escapes '\\n | Returns a list of lines from the given text. Understands end-of-line escapes '\\n | [
"Returns",
"a",
"list",
"of",
"lines",
"from",
"the",
"given",
"text",
".",
"Understands",
"end",
"-",
"of",
"-",
"line",
"escapes",
"\\\\",
"n"
] | def parseLines(text):
"""Returns a list of lines from the given text. Understands end-of-line escapes '\\n'"""
lines = text.strip().split('\n')
esclines = []
esc = False
for l in lines:
if esc:
esclines[-1] = esclines[-1]+l
else:
esclines.append(l)
if... | [
"def",
"parseLines",
"(",
"text",
")",
":",
"lines",
"=",
"text",
".",
"strip",
"(",
")",
".",
"split",
"(",
"'\\n'",
")",
"esclines",
"=",
"[",
"]",
"esc",
"=",
"False",
"for",
"l",
"in",
"lines",
":",
"if",
"esc",
":",
"esclines",
"[",
"-",
"... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/io/loader.py#L437-L452 | |
Tom94/practical-path-guiding | fcf01afb436184e8a74bf300aa89f69b03ab25a2 | visualizer/nanogui/docs/exhale.py | python | ExhaleRoot.generateNodeDocuments | (self) | Creates all of the reStructuredText documents related to types parsed by
Doxygen. This includes all leaf-like documents (``class``, ``struct``,
``enum``, ``typedef``, ``union``, ``variable``, and ``define``), as well as
namespace, file, and directory pages.
During the reparenting phase... | Creates all of the reStructuredText documents related to types parsed by
Doxygen. This includes all leaf-like documents (``class``, ``struct``,
``enum``, ``typedef``, ``union``, ``variable``, and ``define``), as well as
namespace, file, and directory pages. | [
"Creates",
"all",
"of",
"the",
"reStructuredText",
"documents",
"related",
"to",
"types",
"parsed",
"by",
"Doxygen",
".",
"This",
"includes",
"all",
"leaf",
"-",
"like",
"documents",
"(",
"class",
"struct",
"enum",
"typedef",
"union",
"variable",
"and",
"defin... | def generateNodeDocuments(self):
'''
Creates all of the reStructuredText documents related to types parsed by
Doxygen. This includes all leaf-like documents (``class``, ``struct``,
``enum``, ``typedef``, ``union``, ``variable``, and ``define``), as well as
namespace, file, and d... | [
"def",
"generateNodeDocuments",
"(",
"self",
")",
":",
"# initialize all of the nodes",
"for",
"node",
"in",
"self",
".",
"all_nodes",
":",
"self",
".",
"initializeNodeFilenameAndLink",
"(",
"node",
")",
"# find the potentially nested items that were reparented",
"nested_en... | https://github.com/Tom94/practical-path-guiding/blob/fcf01afb436184e8a74bf300aa89f69b03ab25a2/visualizer/nanogui/docs/exhale.py#L2049-L2098 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/pydoc.py | python | TextDoc.docother | (self, object, name=None, mod=None, parent=None, maxlen=None, doc=None) | return line | Produce text documentation for a data object. | Produce text documentation for a data object. | [
"Produce",
"text",
"documentation",
"for",
"a",
"data",
"object",
"."
] | def docother(self, object, name=None, mod=None, parent=None, maxlen=None, doc=None):
"""Produce text documentation for a data object."""
repr = self.repr(object)
if maxlen:
line = (name and name + ' = ' or '') + repr
chop = maxlen - len(line)
if chop < 0: repr... | [
"def",
"docother",
"(",
"self",
",",
"object",
",",
"name",
"=",
"None",
",",
"mod",
"=",
"None",
",",
"parent",
"=",
"None",
",",
"maxlen",
"=",
"None",
",",
"doc",
"=",
"None",
")",
":",
"repr",
"=",
"self",
".",
"repr",
"(",
"object",
")",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/pydoc.py#L1319-L1329 | |
Netflix/NfWebCrypto | 499faf4eb9f9ccf0b21dc728e974970f54bd6c52 | plugin/ppapi/ppapi/generators/idl_parser.py | python | IDLParser.p_dictionary_block | (self, p) | dictionary_block : modifiers DICTIONARY SYMBOL '{' struct_list '}' '; | dictionary_block : modifiers DICTIONARY SYMBOL '{' struct_list '}' '; | [
"dictionary_block",
":",
"modifiers",
"DICTIONARY",
"SYMBOL",
"{",
"struct_list",
"}",
";"
] | def p_dictionary_block(self, p):
"""dictionary_block : modifiers DICTIONARY SYMBOL '{' struct_list '}' ';'"""
p[0] = self.BuildNamed('Dictionary', p, 3, ListFromConcat(p[1], p[5])) | [
"def",
"p_dictionary_block",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"self",
".",
"BuildNamed",
"(",
"'Dictionary'",
",",
"p",
",",
"3",
",",
"ListFromConcat",
"(",
"p",
"[",
"1",
"]",
",",
"p",
"[",
"5",
"]",
")",
")"
] | https://github.com/Netflix/NfWebCrypto/blob/499faf4eb9f9ccf0b21dc728e974970f54bd6c52/plugin/ppapi/ppapi/generators/idl_parser.py#L310-L312 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/distribute_coordinator.py | python | _run_single_worker | (worker_fn,
strategy,
cluster_spec,
task_type,
task_id,
session_config,
rpc_layer="",
worker_barrier=None,
coord=None) | Runs a single worker by calling `worker_fn` under context. | Runs a single worker by calling `worker_fn` under context. | [
"Runs",
"a",
"single",
"worker",
"by",
"calling",
"worker_fn",
"under",
"context",
"."
] | def _run_single_worker(worker_fn,
strategy,
cluster_spec,
task_type,
task_id,
session_config,
rpc_layer="",
worker_barrier=None,
coord=N... | [
"def",
"_run_single_worker",
"(",
"worker_fn",
",",
"strategy",
",",
"cluster_spec",
",",
"task_type",
",",
"task_id",
",",
"session_config",
",",
"rpc_layer",
"=",
"\"\"",
",",
"worker_barrier",
"=",
"None",
",",
"coord",
"=",
"None",
")",
":",
"session_confi... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/distribute_coordinator.py#L326-L360 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextObject.CalculateRange | (*args, **kwargs) | return _richtext.RichTextObject_CalculateRange(*args, **kwargs) | CalculateRange(self, long start, long OUTPUT) | CalculateRange(self, long start, long OUTPUT) | [
"CalculateRange",
"(",
"self",
"long",
"start",
"long",
"OUTPUT",
")"
] | def CalculateRange(*args, **kwargs):
"""CalculateRange(self, long start, long OUTPUT)"""
return _richtext.RichTextObject_CalculateRange(*args, **kwargs) | [
"def",
"CalculateRange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextObject_CalculateRange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L1210-L1212 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/html.py | python | HtmlCell.GetFirstChild | (*args, **kwargs) | return _html.HtmlCell_GetFirstChild(*args, **kwargs) | GetFirstChild(self) -> HtmlCell | GetFirstChild(self) -> HtmlCell | [
"GetFirstChild",
"(",
"self",
")",
"-",
">",
"HtmlCell"
] | def GetFirstChild(*args, **kwargs):
"""GetFirstChild(self) -> HtmlCell"""
return _html.HtmlCell_GetFirstChild(*args, **kwargs) | [
"def",
"GetFirstChild",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlCell_GetFirstChild",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html.py#L654-L656 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | GBSizerItemList.__contains__ | (*args, **kwargs) | return _core_.GBSizerItemList___contains__(*args, **kwargs) | __contains__(self, GBSizerItem obj) -> bool | __contains__(self, GBSizerItem obj) -> bool | [
"__contains__",
"(",
"self",
"GBSizerItem",
"obj",
")",
"-",
">",
"bool"
] | def __contains__(*args, **kwargs):
"""__contains__(self, GBSizerItem obj) -> bool"""
return _core_.GBSizerItemList___contains__(*args, **kwargs) | [
"def",
"__contains__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"GBSizerItemList___contains__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L15887-L15889 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ebmlib/searcheng.py | python | SearchEngine.SetQuery | (self, query) | Set the search query
@param query: string | Set the search query
@param query: string | [
"Set",
"the",
"search",
"query",
"@param",
"query",
":",
"string"
] | def SetQuery(self, query):
"""Set the search query
@param query: string
"""
self._query = query
self._CompileRegex() | [
"def",
"SetQuery",
"(",
"self",
",",
"query",
")",
":",
"self",
".",
"_query",
"=",
"query",
"self",
".",
"_CompileRegex",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/searcheng.py#L403-L409 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/utils.py | python | _Deprecate.__call__ | (self, func, *args, **kwargs) | return newfunc | Decorator call. Refer to ``decorate``. | Decorator call. Refer to ``decorate``. | [
"Decorator",
"call",
".",
"Refer",
"to",
"decorate",
"."
] | def __call__(self, func, *args, **kwargs):
"""
Decorator call. Refer to ``decorate``.
"""
old_name = self.old_name
new_name = self.new_name
message = self.message
if old_name is None:
try:
old_name = func.__name__
except ... | [
"def",
"__call__",
"(",
"self",
",",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"old_name",
"=",
"self",
".",
"old_name",
"new_name",
"=",
"self",
".",
"new_name",
"message",
"=",
"self",
".",
"message",
"if",
"old_name",
"is",
"Non... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/utils.py#L75-L130 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/tf_asymmetry_fitting/tf_asymmetry_fitting_model.py | python | TFAsymmetryFittingModel._get_normalisation_parameter_name_for_simultaneous_domain | (domain_index: int) | return f"f{domain_index}.N0" | Returns the parameter name to use for a simultaneous normalisation parameter for a specific domain. | Returns the parameter name to use for a simultaneous normalisation parameter for a specific domain. | [
"Returns",
"the",
"parameter",
"name",
"to",
"use",
"for",
"a",
"simultaneous",
"normalisation",
"parameter",
"for",
"a",
"specific",
"domain",
"."
] | def _get_normalisation_parameter_name_for_simultaneous_domain(domain_index: int) -> str:
"""Returns the parameter name to use for a simultaneous normalisation parameter for a specific domain."""
return f"f{domain_index}.N0" | [
"def",
"_get_normalisation_parameter_name_for_simultaneous_domain",
"(",
"domain_index",
":",
"int",
")",
"->",
"str",
":",
"return",
"f\"f{domain_index}.N0\""
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/tf_asymmetry_fitting/tf_asymmetry_fitting_model.py#L285-L287 | |
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | Tools/mavlink_px4.py | python | MAVLink.debug_vect_send | (self, name, time_usec, x, y, z) | return self.send(self.debug_vect_encode(name, time_usec, x, y, z)) | name : Name (char)
time_usec : Timestamp (uint64_t)
x : x (float)
y : y (float)
z : z (float) | [] | def debug_vect_send(self, name, time_usec, x, y, z):
'''
name : Name (char)
time_usec : Timestamp (uint64_t)
x : x (float)
y : y (float)
... | [
"def",
"debug_vect_send",
"(",
"self",
",",
"name",
",",
"time_usec",
",",
"x",
",",
"y",
",",
"z",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"debug_vect_encode",
"(",
"name",
",",
"time_usec",
",",
"x",
",",
"y",
",",
"z",
")",
... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/mavlink_px4.py#L5136-L5147 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/training/optimizer.py | python | Optimizer._get_or_make_slot_with_initializer | (self, var, initializer, shape, dtype,
slot_name, op_name) | return named_slots[_var_key(var)] | Find or create a slot for a variable, using an Initializer.
Args:
var: A `Variable` object.
initializer: An `Initializer`. The initial value of the slot.
shape: Shape of the initial value of the slot.
dtype: Type of the value of the slot.
slot_name: Name for the slot.
op_name: ... | Find or create a slot for a variable, using an Initializer. | [
"Find",
"or",
"create",
"a",
"slot",
"for",
"a",
"variable",
"using",
"an",
"Initializer",
"."
] | def _get_or_make_slot_with_initializer(self, var, initializer, shape, dtype,
slot_name, op_name):
"""Find or create a slot for a variable, using an Initializer.
Args:
var: A `Variable` object.
initializer: An `Initializer`. The initial value of the slot.
... | [
"def",
"_get_or_make_slot_with_initializer",
"(",
"self",
",",
"var",
",",
"initializer",
",",
"shape",
",",
"dtype",
",",
"slot_name",
",",
"op_name",
")",
":",
"named_slots",
"=",
"self",
".",
"_slot_dict",
"(",
"slot_name",
")",
"if",
"_var_key",
"(",
"va... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/optimizer.py#L730-L750 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Tools/qt4.py | python | qxx.scan | (self) | return (lst, names) | Re-use the C/C++ scanner, but remove the moc files from the dependencies
since the .cpp file already depends on all the headers | Re-use the C/C++ scanner, but remove the moc files from the dependencies
since the .cpp file already depends on all the headers | [
"Re",
"-",
"use",
"the",
"C",
"/",
"C",
"++",
"scanner",
"but",
"remove",
"the",
"moc",
"files",
"from",
"the",
"dependencies",
"since",
"the",
".",
"cpp",
"file",
"already",
"depends",
"on",
"all",
"the",
"headers"
] | def scan(self):
"""
Re-use the C/C++ scanner, but remove the moc files from the dependencies
since the .cpp file already depends on all the headers
"""
(nodes, names) = c_preproc.scan(self)
lst = []
for x in nodes:
# short lists, no need to use sets
if x.name.endswith('.moc'):
s = x.path_from(se... | [
"def",
"scan",
"(",
"self",
")",
":",
"(",
"nodes",
",",
"names",
")",
"=",
"c_preproc",
".",
"scan",
"(",
"self",
")",
"lst",
"=",
"[",
"]",
"for",
"x",
"in",
"nodes",
":",
"# short lists, no need to use sets",
"if",
"x",
".",
"name",
".",
"endswith... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/qt4.py#L117-L132 | |
etodd/lasercrabs | 91484d9ac3a47ac38b8f40ec3ff35194714dad8e | assets/script/etodd_blender_fbx/fbx_utils.py | python | elem_props_template_set | (template, elem, ptype_name, name, value, animatable=False, animated=False) | Only add a prop if the same value is not already defined in given template.
Note it is important to not give iterators as value, here! | Only add a prop if the same value is not already defined in given template.
Note it is important to not give iterators as value, here! | [
"Only",
"add",
"a",
"prop",
"if",
"the",
"same",
"value",
"is",
"not",
"already",
"defined",
"in",
"given",
"template",
".",
"Note",
"it",
"is",
"important",
"to",
"not",
"give",
"iterators",
"as",
"value",
"here!"
] | def elem_props_template_set(template, elem, ptype_name, name, value, animatable=False, animated=False):
"""
Only add a prop if the same value is not already defined in given template.
Note it is important to not give iterators as value, here!
"""
ptype = FBX_PROPERTIES_DEFINITIONS[ptype_name]
if... | [
"def",
"elem_props_template_set",
"(",
"template",
",",
"elem",
",",
"ptype_name",
",",
"name",
",",
"value",
",",
"animatable",
"=",
"False",
",",
"animated",
"=",
"False",
")",
":",
"ptype",
"=",
"FBX_PROPERTIES_DEFINITIONS",
"[",
"ptype_name",
"]",
"if",
... | https://github.com/etodd/lasercrabs/blob/91484d9ac3a47ac38b8f40ec3ff35194714dad8e/assets/script/etodd_blender_fbx/fbx_utils.py#L626-L645 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/distribute/distributed_training_utils.py | python | init_restore_or_wait_for_variables | () | Initialize or restore variables or wait for variables to be initialized. | Initialize or restore variables or wait for variables to be initialized. | [
"Initialize",
"or",
"restore",
"variables",
"or",
"wait",
"for",
"variables",
"to",
"be",
"initialized",
"."
] | def init_restore_or_wait_for_variables():
"""Initialize or restore variables or wait for variables to be initialized."""
session = K._get_session() # pylint: disable=protected-access
if not multi_worker_util.has_worker_context(
) or multi_worker_util.should_load_checkpoint():
# TODO(yuefengz): if checkpoin... | [
"def",
"init_restore_or_wait_for_variables",
"(",
")",
":",
"session",
"=",
"K",
".",
"_get_session",
"(",
")",
"# pylint: disable=protected-access",
"if",
"not",
"multi_worker_util",
".",
"has_worker_context",
"(",
")",
"or",
"multi_worker_util",
".",
"should_load_chec... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/distribute/distributed_training_utils.py#L403-L411 | ||
nsnam/ns-3-dev-git | efdb2e21f45c0a87a60b47c547b68fa140a7b686 | utils/grid.py | python | TimelineDataRange.sort | (self) | ! Sort ranges
@param self this object
@return none | ! Sort ranges | [
"!",
"Sort",
"ranges"
] | def sort(self):
"""! Sort ranges
@param self this object
@return none
"""
self.ranges.sort(ranges_cmp) | [
"def",
"sort",
"(",
"self",
")",
":",
"self",
".",
"ranges",
".",
"sort",
"(",
"ranges_cmp",
")"
] | https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/utils/grid.py#L165-L170 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/control_flow_grad.py | python | _MergeGrad | (op, grad, _) | Gradients for a Merge op are calculated using a Switch op. | Gradients for a Merge op are calculated using a Switch op. | [
"Gradients",
"for",
"a",
"Merge",
"op",
"are",
"calculated",
"using",
"a",
"Switch",
"op",
"."
] | def _MergeGrad(op, grad, _):
"""Gradients for a Merge op are calculated using a Switch op."""
input_op = op.inputs[0].op
graph = ops.get_default_graph()
# pylint: disable=protected-access
op_ctxt = input_op._get_control_flow_context()
grad_ctxt = graph._get_control_flow_context()
# pylint: enable=protecte... | [
"def",
"_MergeGrad",
"(",
"op",
",",
"grad",
",",
"_",
")",
":",
"input_op",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"op",
"graph",
"=",
"ops",
".",
"get_default_graph",
"(",
")",
"# pylint: disable=protected-access",
"op_ctxt",
"=",
"input_op",
".... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/control_flow_grad.py#L81-L122 | ||
stack-of-tasks/pinocchio | 593d4d43fded997bb9aa2421f4e55294dbd233c4 | bindings/python/pinocchio/visualize/rviz_visualizer.py | python | RVizVisualizer.display | (self, q = None) | Display the robot at configuration q in the viz by placing all the bodies. | Display the robot at configuration q in the viz by placing all the bodies. | [
"Display",
"the",
"robot",
"at",
"configuration",
"q",
"in",
"the",
"viz",
"by",
"placing",
"all",
"the",
"bodies",
"."
] | def display(self, q = None):
"""Display the robot at configuration q in the viz by placing all the bodies."""
# Update the robot kinematics and geometry.
if q is not None:
pin.forwardKinematics(self.model,self.data,q)
pin.updateGeometryPlacements(self.model, self.data, self.... | [
"def",
"display",
"(",
"self",
",",
"q",
"=",
"None",
")",
":",
"# Update the robot kinematics and geometry.",
"if",
"q",
"is",
"not",
"None",
":",
"pin",
".",
"forwardKinematics",
"(",
"self",
".",
"model",
",",
"self",
".",
"data",
",",
"q",
")",
"pin"... | https://github.com/stack-of-tasks/pinocchio/blob/593d4d43fded997bb9aa2421f4e55294dbd233c4/bindings/python/pinocchio/visualize/rviz_visualizer.py#L125-L135 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py | python | _cudnn_rnn | (inputs,
input_h,
input_c,
params,
is_training,
rnn_mode,
input_mode=CUDNN_INPUT_LINEAR_MODE,
direction=CUDNN_RNN_UNIDIRECTION,
dropout=0.,
seed=0,
name=None) | return (outputs, output_h, output_c) | Cudnn RNN.
Args:
inputs: the input sequence to the RNN model. A Tensor of shape [?,
batch_size, input_size].
input_h: the initial hidden state for h. A Tensor of shape [num_layers,
batch_size, num_units].
input_c: the initial hidden state for c. This is only relevant for LSTM.
A Tensor ... | Cudnn RNN. | [
"Cudnn",
"RNN",
"."
] | def _cudnn_rnn(inputs,
input_h,
input_c,
params,
is_training,
rnn_mode,
input_mode=CUDNN_INPUT_LINEAR_MODE,
direction=CUDNN_RNN_UNIDIRECTION,
dropout=0.,
seed=0,
name=Non... | [
"def",
"_cudnn_rnn",
"(",
"inputs",
",",
"input_h",
",",
"input_c",
",",
"params",
",",
"is_training",
",",
"rnn_mode",
",",
"input_mode",
"=",
"CUDNN_INPUT_LINEAR_MODE",
",",
"direction",
"=",
"CUDNN_RNN_UNIDIRECTION",
",",
"dropout",
"=",
"0.",
",",
"seed",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py#L767-L824 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/well_known_types.py | python | FieldMask.CanonicalFormFromMask | (self, mask) | Converts a FieldMask to the canonical form.
Removes paths that are covered by another path. For example,
"foo.bar" is covered by "foo" and will be removed if "foo"
is also in the FieldMask. Then sorts all paths in alphabetical order.
Args:
mask: The original FieldMask to be converted. | Converts a FieldMask to the canonical form. | [
"Converts",
"a",
"FieldMask",
"to",
"the",
"canonical",
"form",
"."
] | def CanonicalFormFromMask(self, mask):
"""Converts a FieldMask to the canonical form.
Removes paths that are covered by another path. For example,
"foo.bar" is covered by "foo" and will be removed if "foo"
is also in the FieldMask. Then sorts all paths in alphabetical order.
Args:
mask: The ... | [
"def",
"CanonicalFormFromMask",
"(",
"self",
",",
"mask",
")",
":",
"tree",
"=",
"_FieldMaskTree",
"(",
"mask",
")",
"tree",
".",
"ToFieldMask",
"(",
"self",
")"
] | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/well_known_types.py#L448-L459 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/mvn.py | python | MultivariateNormalOperatorPD.get_event_shape | (self) | return self._cov.get_shape()[-1:] | `TensorShape` available at graph construction time. | `TensorShape` available at graph construction time. | [
"TensorShape",
"available",
"at",
"graph",
"construction",
"time",
"."
] | def get_event_shape(self):
"""`TensorShape` available at graph construction time."""
# Recall _check_mu ensures mu and self._cov have same batch shape.
return self._cov.get_shape()[-1:] | [
"def",
"get_event_shape",
"(",
"self",
")",
":",
"# Recall _check_mu ensures mu and self._cov have same batch shape.",
"return",
"self",
".",
"_cov",
".",
"get_shape",
"(",
")",
"[",
"-",
"1",
":",
"]"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/mvn.py#L187-L190 | |
glotzerlab/hoomd-blue | f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a | hoomd/hpmc/integrate.py | python | HPMCIntegrator.rotate_moves | (self) | return self._cpp_obj.getCounters(1).rotate | tuple[int, int]: Count of the accepted and rejected rotate moves.
Note:
The counts are reset to 0 at the start of each
`hoomd.Simulation.run`. | tuple[int, int]: Count of the accepted and rejected rotate moves. | [
"tuple",
"[",
"int",
"int",
"]",
":",
"Count",
"of",
"the",
"accepted",
"and",
"rejected",
"rotate",
"moves",
"."
] | def rotate_moves(self):
"""tuple[int, int]: Count of the accepted and rejected rotate moves.
Note:
The counts are reset to 0 at the start of each
`hoomd.Simulation.run`.
"""
return self._cpp_obj.getCounters(1).rotate | [
"def",
"rotate_moves",
"(",
"self",
")",
":",
"return",
"self",
".",
"_cpp_obj",
".",
"getCounters",
"(",
"1",
")",
".",
"rotate"
] | https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/hpmc/integrate.py#L316-L323 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailcap.py | python | readmailcapfile | (fp) | return caps | Read a mailcap file and return a dictionary keyed by MIME type.
Each MIME type is mapped to an entry consisting of a list of
dictionaries; the list will contain more than one such dictionary
if a given MIME type appears more than once in the mailcap file.
Each dictionary contains key-value pairs for th... | Read a mailcap file and return a dictionary keyed by MIME type. | [
"Read",
"a",
"mailcap",
"file",
"and",
"return",
"a",
"dictionary",
"keyed",
"by",
"MIME",
"type",
"."
] | def readmailcapfile(fp):
"""Read a mailcap file and return a dictionary keyed by MIME type.
Each MIME type is mapped to an entry consisting of a list of
dictionaries; the list will contain more than one such dictionary
if a given MIME type appears more than once in the mailcap file.
Each dictionary... | [
"def",
"readmailcapfile",
"(",
"fp",
")",
":",
"caps",
"=",
"{",
"}",
"while",
"1",
":",
"line",
"=",
"fp",
".",
"readline",
"(",
")",
"if",
"not",
"line",
":",
"break",
"# Ignore comments and blank lines",
"if",
"line",
"[",
"0",
"]",
"==",
"'#'",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailcap.py#L53-L89 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/formats/format.py | python | DataFrameFormatter.write_result | (self, buf: IO[str]) | Render a DataFrame to a console-friendly tabular output. | Render a DataFrame to a console-friendly tabular output. | [
"Render",
"a",
"DataFrame",
"to",
"a",
"console",
"-",
"friendly",
"tabular",
"output",
"."
] | def write_result(self, buf: IO[str]) -> None:
"""
Render a DataFrame to a console-friendly tabular output.
"""
from pandas import Series
frame = self.frame
if len(frame.columns) == 0 or len(frame.index) == 0:
info_line = "Empty {name}\nColumns: {col}\nIndex:... | [
"def",
"write_result",
"(",
"self",
",",
"buf",
":",
"IO",
"[",
"str",
"]",
")",
"->",
"None",
":",
"from",
"pandas",
"import",
"Series",
"frame",
"=",
"self",
".",
"frame",
"if",
"len",
"(",
"frame",
".",
"columns",
")",
"==",
"0",
"or",
"len",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/formats/format.py#L806-L868 | ||
lhmRyan/deep-supervised-hashing-DSH | 631901f82e2ab031fbac33f914a5b08ef8e21d57 | scripts/cpp_lint.py | python | CheckVlogArguments | (filename, clean_lines, linenum, error) | Checks that VLOG() is only used for defining a logging level.
For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
VLOG(FATAL) are not.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to ... | Checks that VLOG() is only used for defining a logging level. | [
"Checks",
"that",
"VLOG",
"()",
"is",
"only",
"used",
"for",
"defining",
"a",
"logging",
"level",
"."
] | def CheckVlogArguments(filename, clean_lines, linenum, error):
"""Checks that VLOG() is only used for defining a logging level.
For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
VLOG(FATAL) are not.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines i... | [
"def",
"CheckVlogArguments",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"Search",
"(",
"r'\\bVLOG\\((INFO|ERROR|WARNING|DFATAL|FATAL)\\)'",
",",
"line",
")",
... | https://github.com/lhmRyan/deep-supervised-hashing-DSH/blob/631901f82e2ab031fbac33f914a5b08ef8e21d57/scripts/cpp_lint.py#L1708-L1724 | ||
GoldenCheetah/GoldenCheetah | 919a418895040144be5579884446ed6cd701bf0d | util/gh-downloads.py | python | error | (message) | Halt script due to critical error.
:param message: Error text. | Halt script due to critical error.
:param message: Error text. | [
"Halt",
"script",
"due",
"to",
"critical",
"error",
".",
":",
"param",
"message",
":",
"Error",
"text",
"."
] | def error(message):
"""
Halt script due to critical error.
:param message: Error text.
"""
sys.exit(_Text.ERROR + "Error: " + message + _Text.END) | [
"def",
"error",
"(",
"message",
")",
":",
"sys",
".",
"exit",
"(",
"_Text",
".",
"ERROR",
"+",
"\"Error: \"",
"+",
"message",
"+",
"_Text",
".",
"END",
")"
] | https://github.com/GoldenCheetah/GoldenCheetah/blob/919a418895040144be5579884446ed6cd701bf0d/util/gh-downloads.py#L115-L120 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/_custom_op/bessel_i1.py | python | bessel_i1_compute | (input_x, output_y, kernel_name="bessel_i1") | return res | bessel_i1_compute | bessel_i1_compute | [
"bessel_i1_compute"
] | def bessel_i1_compute(input_x, output_y, kernel_name="bessel_i1"):
"""bessel_i1_compute"""
dtype = input_x.dtype
shape = input_x.shape
has_improve_precision = False
if dtype != "float32":
input_x = dsl.cast_to(input_x, "float32")
dtype = "float32"
has_improve_precision = Tru... | [
"def",
"bessel_i1_compute",
"(",
"input_x",
",",
"output_y",
",",
"kernel_name",
"=",
"\"bessel_i1\"",
")",
":",
"dtype",
"=",
"input_x",
".",
"dtype",
"shape",
"=",
"input_x",
".",
"shape",
"has_improve_precision",
"=",
"False",
"if",
"dtype",
"!=",
"\"float3... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/_custom_op/bessel_i1.py#L85-L108 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Calibration/tube_calib.py | python | read_peak_file | (file_name) | return loaded_file | Load the file calibration
It returns a list of tuples, where the first value is the detector identification
and the second value is its calibration values.
Example of usage:
for (det_code, cal_values) in readPeakFile('pathname/TubeDemo'):
print(det_code)
print(cal_values) | Load the file calibration | [
"Load",
"the",
"file",
"calibration"
] | def read_peak_file(file_name):
"""Load the file calibration
It returns a list of tuples, where the first value is the detector identification
and the second value is its calibration values.
Example of usage:
for (det_code, cal_values) in readPeakFile('pathname/TubeDemo'):
print(det... | [
"def",
"read_peak_file",
"(",
"file_name",
")",
":",
"loaded_file",
"=",
"[",
"]",
"# split the entries to the main values:",
"# For example:",
"# MERLIN/door1/tube_1_1 [34.199347724575574, 525.5864438725401, 1001.7456248836971]",
"# Will be splited as:",
"# ['MERLIN/door1/tube_1_1', '',... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Calibration/tube_calib.py#L459-L495 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py | python | has_arithmetic_operator | (line) | return False | Return True if line contains any arithmetic operators. | Return True if line contains any arithmetic operators. | [
"Return",
"True",
"if",
"line",
"contains",
"any",
"arithmetic",
"operators",
"."
] | def has_arithmetic_operator(line):
"""Return True if line contains any arithmetic operators."""
for operator in pep8.ARITHMETIC_OP:
if operator in line:
return True
return False | [
"def",
"has_arithmetic_operator",
"(",
"line",
")",
":",
"for",
"operator",
"in",
"pep8",
".",
"ARITHMETIC_OP",
":",
"if",
"operator",
"in",
"line",
":",
"return",
"True",
"return",
"False"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py#L3453-L3459 | |
alexozer/jankdrone | c4b403eb254b41b832ab2bdfade12ba59c99e5dc | shm/lib/pyratemp/pyratemp.py | python | TemplateBase.__str__ | (self) | return self.__call__() | Alias for __call__(). | Alias for __call__(). | [
"Alias",
"for",
"__call__",
"()",
"."
] | def __str__(self):
"""Alias for __call__()."""
return self.__call__() | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"self",
".",
"__call__",
"(",
")"
] | https://github.com/alexozer/jankdrone/blob/c4b403eb254b41b832ab2bdfade12ba59c99e5dc/shm/lib/pyratemp/pyratemp.py#L1063-L1065 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | SAXCallback.endDocument | (self) | called at the end of the document | called at the end of the document | [
"called",
"at",
"the",
"end",
"of",
"the",
"document"
] | def endDocument(self):
"""called at the end of the document"""
pass | [
"def",
"endDocument",
"(",
"self",
")",
":",
"pass"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L168-L170 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | TextAttr.HasListStyleName | (*args, **kwargs) | return _controls_.TextAttr_HasListStyleName(*args, **kwargs) | HasListStyleName(self) -> bool | HasListStyleName(self) -> bool | [
"HasListStyleName",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasListStyleName(*args, **kwargs):
"""HasListStyleName(self) -> bool"""
return _controls_.TextAttr_HasListStyleName(*args, **kwargs) | [
"def",
"HasListStyleName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_HasListStyleName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L1848-L1850 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/tools/stats-viewer.py | python | StatsViewer.UpdateTime | (self) | Update the title of the window with the current time. | Update the title of the window with the current time. | [
"Update",
"the",
"title",
"of",
"the",
"window",
"with",
"the",
"current",
"time",
"."
] | def UpdateTime(self):
"""Update the title of the window with the current time."""
self.root.title("Stats Viewer [updated %s]" % time.strftime("%H:%M:%S")) | [
"def",
"UpdateTime",
"(",
"self",
")",
":",
"self",
".",
"root",
".",
"title",
"(",
"\"Stats Viewer [updated %s]\"",
"%",
"time",
".",
"strftime",
"(",
"\"%H:%M:%S\"",
")",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/tools/stats-viewer.py#L167-L169 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | chrome/common/extensions/docs/server2/app_yaml_helper.py | python | AppYamlHelper.GetFirstRevisionGreaterThan | (self, app_version) | return stored | Finds the first revision that the version in app.yaml was greater than
|app_version|.
WARNING: if there is no such revision (e.g. the app is up to date, or
*oops* the app is even newer) then this will throw a ValueError. Use
IsUpToDate to validate the input before calling this method. | Finds the first revision that the version in app.yaml was greater than
|app_version|. | [
"Finds",
"the",
"first",
"revision",
"that",
"the",
"version",
"in",
"app",
".",
"yaml",
"was",
"greater",
"than",
"|app_version|",
"."
] | def GetFirstRevisionGreaterThan(self, app_version):
'''Finds the first revision that the version in app.yaml was greater than
|app_version|.
WARNING: if there is no such revision (e.g. the app is up to date, or
*oops* the app is even newer) then this will throw a ValueError. Use
IsUpToDate to valid... | [
"def",
"GetFirstRevisionGreaterThan",
"(",
"self",
",",
"app_version",
")",
":",
"stored",
"=",
"self",
".",
"_store",
".",
"Get",
"(",
"app_version",
")",
".",
"Get",
"(",
")",
"if",
"stored",
"is",
"None",
":",
"stored",
"=",
"self",
".",
"_GetFirstRev... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/app_yaml_helper.py#L87-L100 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py | python | qa_digital_carrier_allocator_cvc.test_003_t | (self) | more advanced:
- 6 symbols per carrier
- 2 pilots per carrier
- have enough data for nearly 3 OFDM symbols
- send that twice
- add some random tags
- don't shift | more advanced:
- 6 symbols per carrier
- 2 pilots per carrier
- have enough data for nearly 3 OFDM symbols
- send that twice
- add some random tags
- don't shift | [
"more",
"advanced",
":",
"-",
"6",
"symbols",
"per",
"carrier",
"-",
"2",
"pilots",
"per",
"carrier",
"-",
"have",
"enough",
"data",
"for",
"nearly",
"3",
"OFDM",
"symbols",
"-",
"send",
"that",
"twice",
"-",
"add",
"some",
"random",
"tags",
"-",
"don"... | def test_003_t(self):
"""
more advanced:
- 6 symbols per carrier
- 2 pilots per carrier
- have enough data for nearly 3 OFDM symbols
- send that twice
- add some random tags
- don't shift
"""
tx_symbols = list(range(1, 16)) # 15 symbols
... | [
"def",
"test_003_t",
"(",
"self",
")",
":",
"tx_symbols",
"=",
"list",
"(",
"range",
"(",
"1",
",",
"16",
")",
")",
"# 15 symbols",
"pilot_symbols",
"=",
"(",
"(",
"1j",
",",
"2j",
")",
",",
"(",
"3j",
",",
"4j",
")",
")",
"occupied_carriers",
"=",... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py#L169-L281 | ||
shedskin/shedskin | ae88dbca7b1d9671cd8be448cb0b497122758936 | scripts/manpage.py | python | Translator.visit_substitution_definition | (self, node) | Internal only. | Internal only. | [
"Internal",
"only",
"."
] | def visit_substitution_definition(self, node):
"""Internal only."""
raise nodes.SkipNode | [
"def",
"visit_substitution_definition",
"(",
"self",
",",
"node",
")",
":",
"raise",
"nodes",
".",
"SkipNode"
] | https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/scripts/manpage.py#L845-L847 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/image/detection.py | python | DetHorizontalFlipAug._flip_label | (self, label) | Helper function to flip label. | Helper function to flip label. | [
"Helper",
"function",
"to",
"flip",
"label",
"."
] | def _flip_label(self, label):
"""Helper function to flip label."""
tmp = 1.0 - label[:, 1]
label[:, 1] = 1.0 - label[:, 3]
label[:, 3] = tmp | [
"def",
"_flip_label",
"(",
"self",
",",
"label",
")",
":",
"tmp",
"=",
"1.0",
"-",
"label",
"[",
":",
",",
"1",
"]",
"label",
"[",
":",
",",
"1",
"]",
"=",
"1.0",
"-",
"label",
"[",
":",
",",
"3",
"]",
"label",
"[",
":",
",",
"3",
"]",
"=... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/image/detection.py#L143-L147 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/linalg/special_matrices.py | python | hankel | (c, r=None) | return as_strided(vals, shape=out_shp, strides=(n, n)).copy() | Construct a Hankel matrix.
The Hankel matrix has constant anti-diagonals, with `c` as its
first column and `r` as its last row. If `r` is not given, then
`r = zeros_like(c)` is assumed.
Parameters
----------
c : array_like
First column of the matrix. Whatever the actual shape of `c`,... | Construct a Hankel matrix. | [
"Construct",
"a",
"Hankel",
"matrix",
"."
] | def hankel(c, r=None):
"""
Construct a Hankel matrix.
The Hankel matrix has constant anti-diagonals, with `c` as its
first column and `r` as its last row. If `r` is not given, then
`r = zeros_like(c)` is assumed.
Parameters
----------
c : array_like
First column of the matrix.... | [
"def",
"hankel",
"(",
"c",
",",
"r",
"=",
"None",
")",
":",
"c",
"=",
"np",
".",
"asarray",
"(",
"c",
")",
".",
"ravel",
"(",
")",
"if",
"r",
"is",
"None",
":",
"r",
"=",
"np",
".",
"zeros_like",
"(",
"c",
")",
"else",
":",
"r",
"=",
"np"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/special_matrices.py#L247-L301 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.GypPathToNinja | (self, path, env=None) | return os.path.normpath(os.path.join(self.build_to_base, path)) | Translate a gyp path to a ninja path, optionally expanding environment
variable references in |path| with |env|.
See the above discourse on path conversions. | Translate a gyp path to a ninja path, optionally expanding environment
variable references in |path| with |env|. | [
"Translate",
"a",
"gyp",
"path",
"to",
"a",
"ninja",
"path",
"optionally",
"expanding",
"environment",
"variable",
"references",
"in",
"|path|",
"with",
"|env|",
"."
] | def GypPathToNinja(self, path, env=None):
"""Translate a gyp path to a ninja path, optionally expanding environment
variable references in |path| with |env|.
See the above discourse on path conversions."""
if env:
if self.flavor == "mac":
path = gyp.xcode_emu... | [
"def",
"GypPathToNinja",
"(",
"self",
",",
"path",
",",
"env",
"=",
"None",
")",
":",
"if",
"env",
":",
"if",
"self",
".",
"flavor",
"==",
"\"mac\"",
":",
"path",
"=",
"gyp",
".",
"xcode_emulation",
".",
"ExpandEnvVars",
"(",
"path",
",",
"env",
")",... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/generator/ninja.py#L300-L318 | |
kevinlin311tw/cvpr16-deepbit | c60fb3233d7d534cfcee9d3ed47d77af437ee32a | python/caffe/detector.py | python | Detector.detect_windows | (self, images_windows) | return detections | Do windowed detection over given images and windows. Windows are
extracted then warped to the input dimensions of the net.
Parameters
----------
images_windows: (image filename, window list) iterable.
context_crop: size of context border to crop in pixels.
Returns
... | Do windowed detection over given images and windows. Windows are
extracted then warped to the input dimensions of the net. | [
"Do",
"windowed",
"detection",
"over",
"given",
"images",
"and",
"windows",
".",
"Windows",
"are",
"extracted",
"then",
"warped",
"to",
"the",
"input",
"dimensions",
"of",
"the",
"net",
"."
] | def detect_windows(self, images_windows):
"""
Do windowed detection over given images and windows. Windows are
extracted then warped to the input dimensions of the net.
Parameters
----------
images_windows: (image filename, window list) iterable.
context_crop: si... | [
"def",
"detect_windows",
"(",
"self",
",",
"images_windows",
")",
":",
"# Extract windows.",
"window_inputs",
"=",
"[",
"]",
"for",
"image_fname",
",",
"windows",
"in",
"images_windows",
":",
"image",
"=",
"caffe",
".",
"io",
".",
"load_image",
"(",
"image_fna... | https://github.com/kevinlin311tw/cvpr16-deepbit/blob/c60fb3233d7d534cfcee9d3ed47d77af437ee32a/python/caffe/detector.py#L56-L99 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.AddSelection | (*args, **kwargs) | return _stc.StyledTextCtrl_AddSelection(*args, **kwargs) | AddSelection(self, int caret, int anchor) -> int
Add a selection | AddSelection(self, int caret, int anchor) -> int | [
"AddSelection",
"(",
"self",
"int",
"caret",
"int",
"anchor",
")",
"-",
">",
"int"
] | def AddSelection(*args, **kwargs):
"""
AddSelection(self, int caret, int anchor) -> int
Add a selection
"""
return _stc.StyledTextCtrl_AddSelection(*args, **kwargs) | [
"def",
"AddSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_AddSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L6120-L6126 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/batch_ops.py | python | batch_function | (num_batch_threads,
max_batch_size,
batch_timeout_micros,
allowed_batch_sizes=None,
max_enqueued_batches=10,
autograph=True) | return decorator | Batches the computation done by the decorated function.
So, for example, in the following code
```python
@batch_function(1, 2, 3)
def layer(a):
return tf.matmul(a, a)
b = layer(w)
```
if more than one session.run call is simultaneously trying to compute `b`
the values of `w` will be gathered, no... | Batches the computation done by the decorated function. | [
"Batches",
"the",
"computation",
"done",
"by",
"the",
"decorated",
"function",
"."
] | def batch_function(num_batch_threads,
max_batch_size,
batch_timeout_micros,
allowed_batch_sizes=None,
max_enqueued_batches=10,
autograph=True):
"""Batches the computation done by the decorated function.
So, for example, ... | [
"def",
"batch_function",
"(",
"num_batch_threads",
",",
"max_batch_size",
",",
"batch_timeout_micros",
",",
"allowed_batch_sizes",
"=",
"None",
",",
"max_enqueued_batches",
"=",
"10",
",",
"autograph",
"=",
"True",
")",
":",
"def",
"decorator",
"(",
"fn",
")",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/batch_ops.py#L32-L111 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pathlib.py | python | PurePath.suffix | (self) | The final component's last suffix, if any.
This includes the leading period. For example: '.txt' | The final component's last suffix, if any. | [
"The",
"final",
"component",
"s",
"last",
"suffix",
"if",
"any",
"."
] | def suffix(self):
"""
The final component's last suffix, if any.
This includes the leading period. For example: '.txt'
"""
name = self.name
i = name.rfind('.')
if 0 < i < len(name) - 1:
return name[i:]
else:
return '' | [
"def",
"suffix",
"(",
"self",
")",
":",
"name",
"=",
"self",
".",
"name",
"i",
"=",
"name",
".",
"rfind",
"(",
"'.'",
")",
"if",
"0",
"<",
"i",
"<",
"len",
"(",
"name",
")",
"-",
"1",
":",
"return",
"name",
"[",
"i",
":",
"]",
"else",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pathlib.py#L804-L815 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/__init__.py | python | disable_warnings | (category=exceptions.HTTPWarning) | Helper for quickly disabling all urllib3 warnings. | Helper for quickly disabling all urllib3 warnings. | [
"Helper",
"for",
"quickly",
"disabling",
"all",
"urllib3",
"warnings",
"."
] | def disable_warnings(category=exceptions.HTTPWarning):
"""
Helper for quickly disabling all urllib3 warnings.
"""
warnings.simplefilter("ignore", category) | [
"def",
"disable_warnings",
"(",
"category",
"=",
"exceptions",
".",
"HTTPWarning",
")",
":",
"warnings",
".",
"simplefilter",
"(",
"\"ignore\"",
",",
"category",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/__init__.py#L82-L86 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/calendar.py | python | Calendar.itermonthdays2 | (self, year, month) | Like itermonthdates(), but will yield (day number, weekday number)
tuples. For days outside the specified month the day number is 0. | Like itermonthdates(), but will yield (day number, weekday number)
tuples. For days outside the specified month the day number is 0. | [
"Like",
"itermonthdates",
"()",
"but",
"will",
"yield",
"(",
"day",
"number",
"weekday",
"number",
")",
"tuples",
".",
"For",
"days",
"outside",
"the",
"specified",
"month",
"the",
"day",
"number",
"is",
"0",
"."
] | def itermonthdays2(self, year, month):
"""
Like itermonthdates(), but will yield (day number, weekday number)
tuples. For days outside the specified month the day number is 0.
"""
for date in self.itermonthdates(year, month):
if date.month != month:
yi... | [
"def",
"itermonthdays2",
"(",
"self",
",",
"year",
",",
"month",
")",
":",
"for",
"date",
"in",
"self",
".",
"itermonthdates",
"(",
"year",
",",
"month",
")",
":",
"if",
"date",
".",
"month",
"!=",
"month",
":",
"yield",
"(",
"0",
",",
"date",
".",... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/calendar.py#L168-L177 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py | python | get_default_monitors | (loss_op=None, summary_op=None, save_summary_steps=100,
output_dir=None, summary_writer=None) | return monitors | Returns a default set of typically-used monitors.
Args:
loss_op: `Tensor`, the loss tensor. This will be printed using `PrintTensor`
at the default interval.
summary_op: See `SummarySaver`.
save_summary_steps: See `SummarySaver`.
output_dir: See `SummarySaver`.
summary_writer: See `Summ... | Returns a default set of typically-used monitors. | [
"Returns",
"a",
"default",
"set",
"of",
"typically",
"-",
"used",
"monitors",
"."
] | def get_default_monitors(loss_op=None, summary_op=None, save_summary_steps=100,
output_dir=None, summary_writer=None):
"""Returns a default set of typically-used monitors.
Args:
loss_op: `Tensor`, the loss tensor. This will be printed using `PrintTensor`
at the default interval... | [
"def",
"get_default_monitors",
"(",
"loss_op",
"=",
"None",
",",
"summary_op",
"=",
"None",
",",
"save_summary_steps",
"=",
"100",
",",
"output_dir",
"=",
"None",
",",
"summary_writer",
"=",
"None",
")",
":",
"monitors",
"=",
"[",
"]",
"if",
"loss_op",
"is... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py#L764-L786 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | CollapsiblePane.Expand | (*args, **kwargs) | return _controls_.CollapsiblePane_Expand(*args, **kwargs) | Expand(self)
Same as Collapse(False). | Expand(self) | [
"Expand",
"(",
"self",
")"
] | def Expand(*args, **kwargs):
"""
Expand(self)
Same as Collapse(False).
"""
return _controls_.CollapsiblePane_Expand(*args, **kwargs) | [
"def",
"Expand",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"CollapsiblePane_Expand",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L7349-L7355 | |
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/service_reflection.py | python | _ServiceBuilder._CallMethod | (self, srvc, method_descriptor,
rpc_controller, request, callback) | return method(rpc_controller, request, callback) | Calls the method described by a given method descriptor.
Args:
srvc: Instance of the service for which this method is called.
method_descriptor: Descriptor that represent the method to call.
rpc_controller: RPC controller to use for this method's execution.
request: Request protocol message... | Calls the method described by a given method descriptor. | [
"Calls",
"the",
"method",
"described",
"by",
"a",
"given",
"method",
"descriptor",
"."
] | def _CallMethod(self, srvc, method_descriptor,
rpc_controller, request, callback):
"""Calls the method described by a given method descriptor.
Args:
srvc: Instance of the service for which this method is called.
method_descriptor: Descriptor that represent the method to call.
... | [
"def",
"_CallMethod",
"(",
"self",
",",
"srvc",
",",
"method_descriptor",
",",
"rpc_controller",
",",
"request",
",",
"callback",
")",
":",
"if",
"method_descriptor",
".",
"containing_service",
"!=",
"self",
".",
"descriptor",
":",
"raise",
"RuntimeError",
"(",
... | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/service_reflection.py#L156-L171 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/joblib/joblib/externals/cloudpickle/cloudpickle.py | python | unregister_pickle_by_value | (module) | Unregister that the input module should be pickled by value. | Unregister that the input module should be pickled by value. | [
"Unregister",
"that",
"the",
"input",
"module",
"should",
"be",
"pickled",
"by",
"value",
"."
] | def unregister_pickle_by_value(module):
"""Unregister that the input module should be pickled by value."""
if not isinstance(module, types.ModuleType):
raise ValueError(
f"Input should be a module object, got {str(module)} instead"
)
if module.__name__ not in _PICKLE_BY_VALUE_MOD... | [
"def",
"unregister_pickle_by_value",
"(",
"module",
")",
":",
"if",
"not",
"isinstance",
"(",
"module",
",",
"types",
".",
"ModuleType",
")",
":",
"raise",
"ValueError",
"(",
"f\"Input should be a module object, got {str(module)} instead\"",
")",
"if",
"module",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/externals/cloudpickle/cloudpickle.py#L171-L180 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/cryengine_modules.py | python | CryEditorCore | (ctx, *k, **kw) | return RunTaskGenerator(ctx, *k, **kw) | Wrapper for CryEngine Editor Core component | Wrapper for CryEngine Editor Core component | [
"Wrapper",
"for",
"CryEngine",
"Editor",
"Core",
"component"
] | def CryEditorCore(ctx, *k, **kw):
"""
Wrapper for CryEngine Editor Core component
"""
# Initialize the Task Generator
if not InitializeTaskGenerator(ctx, kw):
return
# Append common modules
AppendCommonModules(ctx,kw)
# Setup TaskGenerator specific settings
ctx.set_editor_f... | [
"def",
"CryEditorCore",
"(",
"ctx",
",",
"*",
"k",
",",
"*",
"*",
"kw",
")",
":",
"# Initialize the Task Generator",
"if",
"not",
"InitializeTaskGenerator",
"(",
"ctx",
",",
"kw",
")",
":",
"return",
"# Append common modules",
"AppendCommonModules",
"(",
"ctx",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/cryengine_modules.py#L1937-L1968 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Canvas.itemconfigure | (self, tagOrId, cnf=None, **kw) | return self._configure(('itemconfigure', tagOrId), cnf, kw) | Configure resources of an item TAGORID.
The values for resources are specified as keyword
arguments. To get an overview about
the allowed keyword arguments call the method without arguments. | Configure resources of an item TAGORID. | [
"Configure",
"resources",
"of",
"an",
"item",
"TAGORID",
"."
] | def itemconfigure(self, tagOrId, cnf=None, **kw):
"""Configure resources of an item TAGORID.
The values for resources are specified as keyword
arguments. To get an overview about
the allowed keyword arguments call the method without arguments.
"""
return self._configure(... | [
"def",
"itemconfigure",
"(",
"self",
",",
"tagOrId",
",",
"cnf",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"return",
"self",
".",
"_configure",
"(",
"(",
"'itemconfigure'",
",",
"tagOrId",
")",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L2342-L2349 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/json_schema_compiler/util_cc_helper.py | python | UtilCCHelper.PopulateArrayFromListFunction | (self, optional) | return ('%s::%s') % (_API_UTIL_NAMESPACE, populate_list_fn) | Returns the function to turn a list into a vector. | Returns the function to turn a list into a vector. | [
"Returns",
"the",
"function",
"to",
"turn",
"a",
"list",
"into",
"a",
"vector",
"."
] | def PopulateArrayFromListFunction(self, optional):
"""Returns the function to turn a list into a vector.
"""
populate_list_fn = ('PopulateOptionalArrayFromList' if optional
else 'PopulateArrayFromList')
return ('%s::%s') % (_API_UTIL_NAMESPACE, populate_list_fn) | [
"def",
"PopulateArrayFromListFunction",
"(",
"self",
",",
"optional",
")",
":",
"populate_list_fn",
"=",
"(",
"'PopulateOptionalArrayFromList'",
"if",
"optional",
"else",
"'PopulateArrayFromList'",
")",
"return",
"(",
"'%s::%s'",
")",
"%",
"(",
"_API_UTIL_NAMESPACE",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/json_schema_compiler/util_cc_helper.py#L15-L20 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/maps/client.py | python | MapsClient.get_features | (self, map_id, user_id='default', auth_token=None,
desired_class=gdata.maps.data.FeatureFeed, query=None,
**kwargs) | return self.get_feed(MAP_FEATURE_URL_TEMPLATE % (user_id, map_id),
auth_token=auth_token, desired_class=desired_class,
query=query, **kwargs) | Retrieves a Feature feed for the given map ID/user ID combination.
Args:
map_id: A string representing the ID of the map whose features should be
retrieved.
user_id: An optional string representing the user ID; should be 'default'.
Returns:
A gdata.maps.data.FeatureFeed. | Retrieves a Feature feed for the given map ID/user ID combination. | [
"Retrieves",
"a",
"Feature",
"feed",
"for",
"the",
"given",
"map",
"ID",
"/",
"user",
"ID",
"combination",
"."
] | def get_features(self, map_id, user_id='default', auth_token=None,
desired_class=gdata.maps.data.FeatureFeed, query=None,
**kwargs):
"""Retrieves a Feature feed for the given map ID/user ID combination.
Args:
map_id: A string representing the ID of the map whose feat... | [
"def",
"get_features",
"(",
"self",
",",
"map_id",
",",
"user_id",
"=",
"'default'",
",",
"auth_token",
"=",
"None",
",",
"desired_class",
"=",
"gdata",
".",
"maps",
".",
"data",
".",
"FeatureFeed",
",",
"query",
"=",
"None",
",",
"*",
"*",
"kwargs",
"... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/maps/client.py#L67-L82 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/third_party/websocket-client/websocket.py | python | WebSocketApp.__init__ | (self, url, header=[],
on_open=None, on_message=None, on_error=None,
on_close=None, keep_running=True, get_mask_key=None) | url: websocket url.
header: custom header for websocket handshake.
on_open: callable object which is called at opening websocket.
this function has one argument. The arugment is this class object.
on_message: callbale object which is called when recieved data.
on_message has 2... | url: websocket url.
header: custom header for websocket handshake.
on_open: callable object which is called at opening websocket.
this function has one argument. The arugment is this class object.
on_message: callbale object which is called when recieved data.
on_message has 2... | [
"url",
":",
"websocket",
"url",
".",
"header",
":",
"custom",
"header",
"for",
"websocket",
"handshake",
".",
"on_open",
":",
"callable",
"object",
"which",
"is",
"called",
"at",
"opening",
"websocket",
".",
"this",
"function",
"has",
"one",
"argument",
".",... | def __init__(self, url, header=[],
on_open=None, on_message=None, on_error=None,
on_close=None, keep_running=True, get_mask_key=None):
"""
url: websocket url.
header: custom header for websocket handshake.
on_open: callable object which is called at open... | [
"def",
"__init__",
"(",
"self",
",",
"url",
",",
"header",
"=",
"[",
"]",
",",
"on_open",
"=",
"None",
",",
"on_message",
"=",
"None",
",",
"on_error",
"=",
"None",
",",
"on_close",
"=",
"None",
",",
"keep_running",
"=",
"True",
",",
"get_mask_key",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/websocket-client/websocket.py#L773-L804 | ||
SpaceNetChallenge/BuildingDetectors | 3def3c44b5847c744cd2f3356182892d92496579 | qinhaifang/src/evalTools/script/preprocess_space_net_data.py | python | save_raw_label_img_worker | (image_name) | docstring for save_raw_label_img_worker | docstring for save_raw_label_img_worker | [
"docstring",
"for",
"save_raw_label_img_worker"
] | def save_raw_label_img_worker(image_name):
"""docstring for save_raw_label_img_worker
"""
try:
image_id = '_'.join(image_name.split('.')[0].split('_')[1:])
image_name = os.path.join(setting.PIC_3BAND_DIR, image_name)
label_map_file = os.path.join(setting.LABEL_MAP_DIR,
... | [
"def",
"save_raw_label_img_worker",
"(",
"image_name",
")",
":",
"try",
":",
"image_id",
"=",
"'_'",
".",
"join",
"(",
"image_name",
".",
"split",
"(",
"'.'",
")",
"[",
"0",
"]",
".",
"split",
"(",
"'_'",
")",
"[",
"1",
":",
"]",
")",
"image_name",
... | https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/evalTools/script/preprocess_space_net_data.py#L85-L102 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | DateTime.GetNextWeekDay | (*args, **kwargs) | return _misc_.DateTime_GetNextWeekDay(*args, **kwargs) | GetNextWeekDay(self, int weekday) -> DateTime | GetNextWeekDay(self, int weekday) -> DateTime | [
"GetNextWeekDay",
"(",
"self",
"int",
"weekday",
")",
"-",
">",
"DateTime"
] | def GetNextWeekDay(*args, **kwargs):
"""GetNextWeekDay(self, int weekday) -> DateTime"""
return _misc_.DateTime_GetNextWeekDay(*args, **kwargs) | [
"def",
"GetNextWeekDay",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_GetNextWeekDay",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L3857-L3859 | |
tangzhenyu/Scene-Text-Understanding | 0f7ffc7aea5971a50cdc03d33d0a41075285948b | ctpn_crnn_ocr/CTPN/src/detectors.py | python | TextDetector.detect | (self, im) | return text_lines | Detecting texts from an image
:return: the bounding boxes of the detected texts | Detecting texts from an image
:return: the bounding boxes of the detected texts | [
"Detecting",
"texts",
"from",
"an",
"image",
":",
"return",
":",
"the",
"bounding",
"boxes",
"of",
"the",
"detected",
"texts"
] | def detect(self, im):
"""
Detecting texts from an image
:return: the bounding boxes of the detected texts
"""
text_proposals, scores=self.text_proposal_detector.detect(im, cfg.MEAN)
keep_inds=np.where(scores>cfg.TEXT_PROPOSALS_MIN_SCORE)[0]
text_proposals, scores=... | [
"def",
"detect",
"(",
"self",
",",
"im",
")",
":",
"text_proposals",
",",
"scores",
"=",
"self",
".",
"text_proposal_detector",
".",
"detect",
"(",
"im",
",",
"cfg",
".",
"MEAN",
")",
"keep_inds",
"=",
"np",
".",
"where",
"(",
"scores",
">",
"cfg",
"... | https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/ctpn_crnn_ocr/CTPN/src/detectors.py#L34-L61 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/dateutil/zoneinfo/__init__.py | python | gettz | (name) | return _CLASS_ZONE_INSTANCE[0].zones.get(name) | This retrieves a time zone from the local zoneinfo tarball that is packaged
with dateutil.
:param name:
An IANA-style time zone name, as found in the zoneinfo file.
:return:
Returns a :class:`dateutil.tz.tzfile` time zone object.
.. warning::
It is generally inadvisable to use... | This retrieves a time zone from the local zoneinfo tarball that is packaged
with dateutil. | [
"This",
"retrieves",
"a",
"time",
"zone",
"from",
"the",
"local",
"zoneinfo",
"tarball",
"that",
"is",
"packaged",
"with",
"dateutil",
"."
] | def gettz(name):
"""
This retrieves a time zone from the local zoneinfo tarball that is packaged
with dateutil.
:param name:
An IANA-style time zone name, as found in the zoneinfo file.
:return:
Returns a :class:`dateutil.tz.tzfile` time zone object.
.. warning::
It is... | [
"def",
"gettz",
"(",
"name",
")",
":",
"warnings",
".",
"warn",
"(",
"\"zoneinfo.gettz() will be removed in future versions, \"",
"\"to use the dateutil-provided zoneinfo files, instantiate a \"",
"\"ZoneInfoFile object and use ZoneInfoFile.zones.get() \"",
"\"instead. See the documentatio... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/dateutil/zoneinfo/__init__.py#L109-L144 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | llvm/bindings/python/llvm/core.py | python | Module.datalayout | (self, new_data_layout) | new_data_layout is a string. | new_data_layout is a string. | [
"new_data_layout",
"is",
"a",
"string",
"."
] | def datalayout(self, new_data_layout):
"""new_data_layout is a string."""
lib.LLVMSetDataLayout(self, new_data_layout) | [
"def",
"datalayout",
"(",
"self",
",",
"new_data_layout",
")",
":",
"lib",
".",
"LLVMSetDataLayout",
"(",
"self",
",",
"new_data_layout",
")"
] | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/llvm/bindings/python/llvm/core.py#L212-L214 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_view.py | python | BasicFittingView.plot_guess_start_x | (self, value: float) | Sets the selected start X. | Sets the selected start X. | [
"Sets",
"the",
"selected",
"start",
"X",
"."
] | def plot_guess_start_x(self, value: float) -> None:
"""Sets the selected start X."""
self.fit_function_options.plot_guess_start_x = value | [
"def",
"plot_guess_start_x",
"(",
"self",
",",
"value",
":",
"float",
")",
"->",
"None",
":",
"self",
".",
"fit_function_options",
".",
"plot_guess_start_x",
"=",
"value"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_view.py#L237-L239 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/operations/math_ops.py | python | BesselI0e.__init__ | (self) | Initialize BesselI0e | Initialize BesselI0e | [
"Initialize",
"BesselI0e"
] | def __init__(self):
"""Initialize BesselI0e"""
self.init_prim_io_names(inputs=['x'], outputs='output') | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"init_prim_io_names",
"(",
"inputs",
"=",
"[",
"'x'",
"]",
",",
"outputs",
"=",
"'output'",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/math_ops.py#L5065-L5067 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/inspector_protocol/jinja2/runtime.py | python | markup_join | (seq) | return concat(buf) | Concatenation that escapes if necessary and converts to unicode. | Concatenation that escapes if necessary and converts to unicode. | [
"Concatenation",
"that",
"escapes",
"if",
"necessary",
"and",
"converts",
"to",
"unicode",
"."
] | def markup_join(seq):
"""Concatenation that escapes if necessary and converts to unicode."""
buf = []
iterator = imap(soft_unicode, seq)
for arg in iterator:
buf.append(arg)
if hasattr(arg, '__html__'):
return Markup(u'').join(chain(buf, iterator))
return concat(buf) | [
"def",
"markup_join",
"(",
"seq",
")",
":",
"buf",
"=",
"[",
"]",
"iterator",
"=",
"imap",
"(",
"soft_unicode",
",",
"seq",
")",
"for",
"arg",
"in",
"iterator",
":",
"buf",
".",
"append",
"(",
"arg",
")",
"if",
"hasattr",
"(",
"arg",
",",
"'__html_... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/runtime.py#L43-L51 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/cgitb.py | python | scanvars | (reader, frame, locals) | return vars | Scan one logical line of Python and look up values of variables used. | Scan one logical line of Python and look up values of variables used. | [
"Scan",
"one",
"logical",
"line",
"of",
"Python",
"and",
"look",
"up",
"values",
"of",
"variables",
"used",
"."
] | def scanvars(reader, frame, locals):
"""Scan one logical line of Python and look up values of variables used."""
vars, lasttoken, parent, prefix, value = [], None, None, '', __UNDEF__
for ttype, token, start, end, line in tokenize.generate_tokens(reader):
if ttype == tokenize.NEWLINE: break
... | [
"def",
"scanvars",
"(",
"reader",
",",
"frame",
",",
"locals",
")",
":",
"vars",
",",
"lasttoken",
",",
"parent",
",",
"prefix",
",",
"value",
"=",
"[",
"]",
",",
"None",
",",
"None",
",",
"''",
",",
"__UNDEF__",
"for",
"ttype",
",",
"token",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/cgitb.py#L80-L99 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.