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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathWaterline.py | python | ObjectWaterline.opPropertyDefaults | (self, obj, job) | return defaults | opPropertyDefaults(obj, job) ... returns a dictionary
of default values for the operation's properties. | opPropertyDefaults(obj, job) ... returns a dictionary
of default values for the operation's properties. | [
"opPropertyDefaults",
"(",
"obj",
"job",
")",
"...",
"returns",
"a",
"dictionary",
"of",
"default",
"values",
"for",
"the",
"operation",
"s",
"properties",
"."
] | def opPropertyDefaults(self, obj, job):
"""opPropertyDefaults(obj, job) ... returns a dictionary
of default values for the operation's properties."""
defaults = {
"OptimizeLinearPaths": True,
"InternalFeaturesCut": True,
"OptimizeStepOverTransitions": False,
... | [
"def",
"opPropertyDefaults",
"(",
"self",
",",
"obj",
",",
"job",
")",
":",
"defaults",
"=",
"{",
"\"OptimizeLinearPaths\"",
":",
"True",
",",
"\"InternalFeaturesCut\"",
":",
"True",
",",
"\"OptimizeStepOverTransitions\"",
":",
"False",
",",
"\"BoundaryEnforcement\"... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathWaterline.py#L464-L514 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/wms/ogc/common/geom.py | python | Rect.FromLowerLeftAndUpperRight | (xy0, xy1) | return Rect(xy0.x, xy0.y, xy1.x, xy1.y) | Make a Rect from the lower left and upper right corners.
Args:
xy0: One corner (not always lower-left)
xy1: The other, opposite corner.
Returns:
A Rect with the given corners. | Make a Rect from the lower left and upper right corners. | [
"Make",
"a",
"Rect",
"from",
"the",
"lower",
"left",
"and",
"upper",
"right",
"corners",
"."
] | def FromLowerLeftAndUpperRight(xy0, xy1):
"""Make a Rect from the lower left and upper right corners.
Args:
xy0: One corner (not always lower-left)
xy1: The other, opposite corner.
Returns:
A Rect with the given corners.
"""
return Rect(xy0.x, xy0.y, xy1.x, xy1.y) | [
"def",
"FromLowerLeftAndUpperRight",
"(",
"xy0",
",",
"xy1",
")",
":",
"return",
"Rect",
"(",
"xy0",
".",
"x",
",",
"xy0",
".",
"y",
",",
"xy1",
".",
"x",
",",
"xy1",
".",
"y",
")"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/wms/ogc/common/geom.py#L92-L101 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/training/queue_runner.py | python | QueueRunner.__init__ | (self, queue=None, enqueue_ops=None, close_op=None,
cancel_op=None, queue_runner_def=None) | Create a QueueRunner.
On construction the `QueueRunner` adds an op to close the queue. That op
will be run if the enqueue ops raise exceptions.
When you later call the `create_threads()` method, the `QueueRunner` will
create one thread for each op in `enqueue_ops`. Each thread will run its
enque... | Create a QueueRunner. | [
"Create",
"a",
"QueueRunner",
"."
] | def __init__(self, queue=None, enqueue_ops=None, close_op=None,
cancel_op=None, queue_runner_def=None):
"""Create a QueueRunner.
On construction the `QueueRunner` adds an op to close the queue. That op
will be run if the enqueue ops raise exceptions.
When you later call the `create_thr... | [
"def",
"__init__",
"(",
"self",
",",
"queue",
"=",
"None",
",",
"enqueue_ops",
"=",
"None",
",",
"close_op",
"=",
"None",
",",
"cancel_op",
"=",
"None",
",",
"queue_runner_def",
"=",
"None",
")",
":",
"if",
"queue_runner_def",
":",
"if",
"queue",
"or",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/queue_runner.py#L46-L84 | ||
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/data_structures/sarray.py | python | SArray._count_ngrams | (self, n=2, method="word", to_lower=True, ignore_space=True) | For documentation, see graphlab.text_analytics.count_ngrams().
..WARNING:: This function is deprecated, and will be removed in future
versions of GraphLab Create. Please use the `text_analytics.count_words`
function instead. | For documentation, see graphlab.text_analytics.count_ngrams(). | [
"For",
"documentation",
"see",
"graphlab",
".",
"text_analytics",
".",
"count_ngrams",
"()",
"."
] | def _count_ngrams(self, n=2, method="word", to_lower=True, ignore_space=True):
"""
For documentation, see graphlab.text_analytics.count_ngrams().
..WARNING:: This function is deprecated, and will be removed in future
versions of GraphLab Create. Please use the `text_analytics.count_word... | [
"def",
"_count_ngrams",
"(",
"self",
",",
"n",
"=",
"2",
",",
"method",
"=",
"\"word\"",
",",
"to_lower",
"=",
"True",
",",
"ignore_space",
"=",
"True",
")",
":",
"if",
"(",
"self",
".",
"dtype",
"(",
")",
"!=",
"str",
")",
":",
"raise",
"TypeError... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sarray.py#L1534-L1568 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/models/image/cifar10/cifar10_multi_gpu_train.py | python | average_gradients | (tower_grads) | return average_grads | Calculate the average gradient for each shared variable across all towers.
Note that this function provides a synchronization point across all towers.
Args:
tower_grads: List of lists of (gradient, variable) tuples. The outer list
is over individual gradients. The inner list is over the gradient
c... | Calculate the average gradient for each shared variable across all towers. | [
"Calculate",
"the",
"average",
"gradient",
"for",
"each",
"shared",
"variable",
"across",
"all",
"towers",
"."
] | def average_gradients(tower_grads):
"""Calculate the average gradient for each shared variable across all towers.
Note that this function provides a synchronization point across all towers.
Args:
tower_grads: List of lists of (gradient, variable) tuples. The outer list
is over individual gradients. Th... | [
"def",
"average_gradients",
"(",
"tower_grads",
")",
":",
"average_grads",
"=",
"[",
"]",
"for",
"grad_and_vars",
"in",
"zip",
"(",
"*",
"tower_grads",
")",
":",
"# Note that each grad_and_vars looks like the following:",
"# ((grad0_gpu0, var0_gpu0), ... , (grad0_gpuN, var0... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/models/image/cifar10/cifar10_multi_gpu_train.py#L110-L145 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/ttk.py | python | Treeview.identify_column | (self, x) | return self.identify("column", x, 0) | Returns the data column identifier of the cell at position x.
The tree column has ID #0. | Returns the data column identifier of the cell at position x. | [
"Returns",
"the",
"data",
"column",
"identifier",
"of",
"the",
"cell",
"at",
"position",
"x",
"."
] | def identify_column(self, x):
"""Returns the data column identifier of the cell at position x.
The tree column has ID #0."""
return self.identify("column", x, 0) | [
"def",
"identify_column",
"(",
"self",
",",
"x",
")",
":",
"return",
"self",
".",
"identify",
"(",
"\"column\"",
",",
"x",
",",
"0",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/ttk.py#L1321-L1325 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/logging/__init__.py | python | setLoggerClass | (klass) | Set the class to be used when instantiating a logger. The class should
define __init__() such that only a name argument is required, and the
__init__() should call Logger.__init__() | Set the class to be used when instantiating a logger. The class should
define __init__() such that only a name argument is required, and the
__init__() should call Logger.__init__() | [
"Set",
"the",
"class",
"to",
"be",
"used",
"when",
"instantiating",
"a",
"logger",
".",
"The",
"class",
"should",
"define",
"__init__",
"()",
"such",
"that",
"only",
"a",
"name",
"argument",
"is",
"required",
"and",
"the",
"__init__",
"()",
"should",
"call... | def setLoggerClass(klass):
"""
Set the class to be used when instantiating a logger. The class should
define __init__() such that only a name argument is required, and the
__init__() should call Logger.__init__()
"""
if klass != Logger:
if not issubclass(klass, Logger):
raise... | [
"def",
"setLoggerClass",
"(",
"klass",
")",
":",
"if",
"klass",
"!=",
"Logger",
":",
"if",
"not",
"issubclass",
"(",
"klass",
",",
"Logger",
")",
":",
"raise",
"TypeError",
"(",
"\"logger not derived from logging.Logger: \"",
"+",
"klass",
".",
"__name__",
")"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/logging/__init__.py#L972-L983 | ||
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/frame.py | python | Frame.mod | (self, other, axis, level=None, fill_value=None) | return self._binaryop(other, "mod", fill_value) | Get Modulo division of dataframe or series and other, element-wise
(binary operator `mod`).
Equivalent to ``frame % other``, but with support to substitute a
fill_value for missing data in one of the inputs. With reverse
version, `rmod`.
Parameters
----------
o... | Get Modulo division of dataframe or series and other, element-wise
(binary operator `mod`). | [
"Get",
"Modulo",
"division",
"of",
"dataframe",
"or",
"series",
"and",
"other",
"element",
"-",
"wise",
"(",
"binary",
"operator",
"mod",
")",
"."
] | def mod(self, other, axis, level=None, fill_value=None):
"""
Get Modulo division of dataframe or series and other, element-wise
(binary operator `mod`).
Equivalent to ``frame % other``, but with support to substitute a
fill_value for missing data in one of the inputs. With rever... | [
"def",
"mod",
"(",
"self",
",",
"other",
",",
"axis",
",",
"level",
"=",
"None",
",",
"fill_value",
"=",
"None",
")",
":",
"if",
"level",
"is",
"not",
"None",
":",
"raise",
"NotImplementedError",
"(",
"\"level parameter is not supported yet.\"",
")",
"return... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/frame.py#L5341-L5409 | |
CNugteren/CLBlast | 4500a03440e2cc54998c0edab366babf5e504d67 | scripts/generator/generator/routine.py | python | Routine.arguments_def_netlib | (self, flavour) | return result | As above, but for the Netlib CBLAS API | As above, but for the Netlib CBLAS API | [
"As",
"above",
"but",
"for",
"the",
"Netlib",
"CBLAS",
"API"
] | def arguments_def_netlib(self, flavour):
"""As above, but for the Netlib CBLAS API"""
result=(self.options_def_c() + self.sizes_def_netlib() +
self.scalar_def_void("alpha", flavour) +
list(chain(*[self.buffer_def_pointer(b, flavour) for b in self.buffers_first()])) +
... | [
"def",
"arguments_def_netlib",
"(",
"self",
",",
"flavour",
")",
":",
"result",
"=",
"(",
"self",
".",
"options_def_c",
"(",
")",
"+",
"self",
".",
"sizes_def_netlib",
"(",
")",
"+",
"self",
".",
"scalar_def_void",
"(",
"\"alpha\"",
",",
"flavour",
")",
... | https://github.com/CNugteren/CLBlast/blob/4500a03440e2cc54998c0edab366babf5e504d67/scripts/generator/generator/routine.py#L741-L753 | |
tomahawk-player/tomahawk-resolvers | 7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d | archive/spotify/breakpad/third_party/protobuf/protobuf/python/mox.py | python | MockObject.__init__ | (self, class_to_mock) | Initialize a mock object.
This determines the methods and properties of the class and stores them.
Args:
# class_to_mock: class to be mocked
class_to_mock: class | Initialize a mock object. | [
"Initialize",
"a",
"mock",
"object",
"."
] | def __init__(self, class_to_mock):
"""Initialize a mock object.
This determines the methods and properties of the class and stores them.
Args:
# class_to_mock: class to be mocked
class_to_mock: class
"""
# This is used to hack around the mixin/inheritance of MockAnything, which
# ... | [
"def",
"__init__",
"(",
"self",
",",
"class_to_mock",
")",
":",
"# This is used to hack around the mixin/inheritance of MockAnything, which",
"# is not a proper object (it can be anything. :-)",
"MockAnything",
".",
"__dict__",
"[",
"'__init__'",
"]",
"(",
"self",
")",
"# Get a... | https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/mox.py#L362-L384 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/auto_bisect/bisect_perf_regression.py | python | BisectPerformanceMetrics.CheckIfRevisionsInProperOrder | (
self, target_depot, good_revision, bad_revision) | return good_position <= bad_position | Checks that |good_revision| is an earlier revision than |bad_revision|.
Args:
good_revision: Number/tag of the known good revision.
bad_revision: Number/tag of the known bad revision.
Returns:
True if the revisions are in the proper order (good earlier than bad). | Checks that |good_revision| is an earlier revision than |bad_revision|. | [
"Checks",
"that",
"|good_revision|",
"is",
"an",
"earlier",
"revision",
"than",
"|bad_revision|",
"."
] | def CheckIfRevisionsInProperOrder(
self, target_depot, good_revision, bad_revision):
"""Checks that |good_revision| is an earlier revision than |bad_revision|.
Args:
good_revision: Number/tag of the known good revision.
bad_revision: Number/tag of the known bad revision.
Returns:
T... | [
"def",
"CheckIfRevisionsInProperOrder",
"(",
"self",
",",
"target_depot",
",",
"good_revision",
",",
"bad_revision",
")",
":",
"cwd",
"=",
"self",
".",
"depot_registry",
".",
"GetDepotDir",
"(",
"target_depot",
")",
"good_position",
"=",
"source_control",
".",
"Ge... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/auto_bisect/bisect_perf_regression.py#L1974-L1995 | |
jolibrain/deepdetect | 9bc840f0b1055426670d64b5285701d6faceabb9 | demo/imgsearch/dd_client.py | python | LOG | (msg) | Output a log message. | Output a log message. | [
"Output",
"a",
"log",
"message",
"."
] | def LOG(msg):
"""Output a log message."""
# XXX: may want to use python log manager classes instead of this stupid print
if VERBOSE:
msg = str(datetime.datetime.now()) + ' ' + msg
print (msg) | [
"def",
"LOG",
"(",
"msg",
")",
":",
"# XXX: may want to use python log manager classes instead of this stupid print",
"if",
"VERBOSE",
":",
"msg",
"=",
"str",
"(",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
")",
"+",
"' '",
"+",
"msg",
"print",
"(",
"m... | https://github.com/jolibrain/deepdetect/blob/9bc840f0b1055426670d64b5285701d6faceabb9/demo/imgsearch/dd_client.py#L35-L40 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tix.py | python | TixWidget._subwidget_name | (self,name) | Get a subwidget name (returns a String, not a Widget !) | Get a subwidget name (returns a String, not a Widget !) | [
"Get",
"a",
"subwidget",
"name",
"(",
"returns",
"a",
"String",
"not",
"a",
"Widget",
"!",
")"
] | def _subwidget_name(self,name):
"""Get a subwidget name (returns a String, not a Widget !)"""
try:
return self.tk.call(self._w, 'subwidget', name)
except TclError:
return None | [
"def",
"_subwidget_name",
"(",
"self",
",",
"name",
")",
":",
"try",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'subwidget'",
",",
"name",
")",
"except",
"TclError",
":",
"return",
"None"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tix.py#L372-L377 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/mozjs-38/extract/js/src/jit/arm/gen-double-encoder-table.py | python | encodeDouble | (value) | return (a << 31) | (B << 30) | (rep(b, 8) << 22) | cdefgh << 16 | Generate an ARM ARM 'VFP modified immediate constant' with format:
aBbbbbbb bbcdefgh 000...
We will return the top 32 bits of the double; the rest are 0. | Generate an ARM ARM 'VFP modified immediate constant' with format:
aBbbbbbb bbcdefgh 000... | [
"Generate",
"an",
"ARM",
"ARM",
"VFP",
"modified",
"immediate",
"constant",
"with",
"format",
":",
"aBbbbbbb",
"bbcdefgh",
"000",
"..."
] | def encodeDouble(value):
"""Generate an ARM ARM 'VFP modified immediate constant' with format:
aBbbbbbb bbcdefgh 000...
We will return the top 32 bits of the double; the rest are 0."""
assert (0 <= value) and (value <= 255)
a = value >> 7
b = (value >> 6) & 1
B = int(b == 0)
cdefgh = va... | [
"def",
"encodeDouble",
"(",
"value",
")",
":",
"assert",
"(",
"0",
"<=",
"value",
")",
"and",
"(",
"value",
"<=",
"255",
")",
"a",
"=",
"value",
">>",
"7",
"b",
"=",
"(",
"value",
">>",
"6",
")",
"&",
"1",
"B",
"=",
"int",
"(",
"b",
"==",
"... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/mozjs-38/extract/js/src/jit/arm/gen-double-encoder-table.py#L18-L28 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/_abcoll.py | python | Mapping.itervalues | (self) | D.itervalues() -> an iterator over the values of D | D.itervalues() -> an iterator over the values of D | [
"D",
".",
"itervalues",
"()",
"-",
">",
"an",
"iterator",
"over",
"the",
"values",
"of",
"D"
] | def itervalues(self):
'D.itervalues() -> an iterator over the values of D'
for key in self:
yield self[key] | [
"def",
"itervalues",
"(",
"self",
")",
":",
"for",
"key",
"in",
"self",
":",
"yield",
"self",
"[",
"key",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/_abcoll.py#L398-L401 | ||
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/extras/doxygen.py | python | configure | (conf) | Check if doxygen and tar commands are present in the system
If the commands are present, then conf.env.DOXYGEN and conf.env.TAR
variables will be set. Detection can be controlled by setting DOXYGEN and
TAR environmental variables. | Check if doxygen and tar commands are present in the system | [
"Check",
"if",
"doxygen",
"and",
"tar",
"commands",
"are",
"present",
"in",
"the",
"system"
] | def configure(conf):
'''
Check if doxygen and tar commands are present in the system
If the commands are present, then conf.env.DOXYGEN and conf.env.TAR
variables will be set. Detection can be controlled by setting DOXYGEN and
TAR environmental variables.
'''
conf.find_program('doxygen', var='DOXYGEN', mandato... | [
"def",
"configure",
"(",
"conf",
")",
":",
"conf",
".",
"find_program",
"(",
"'doxygen'",
",",
"var",
"=",
"'DOXYGEN'",
",",
"mandatory",
"=",
"False",
")",
"conf",
".",
"find_program",
"(",
"'tar'",
",",
"var",
"=",
"'TAR'",
",",
"mandatory",
"=",
"Fa... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/extras/doxygen.py#L226-L236 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py | python | Dir._create | (self) | Create this directory, silently and without worrying about
whether the builder is the default or not. | Create this directory, silently and without worrying about
whether the builder is the default or not. | [
"Create",
"this",
"directory",
"silently",
"and",
"without",
"worrying",
"about",
"whether",
"the",
"builder",
"is",
"the",
"default",
"or",
"not",
"."
] | def _create(self):
"""Create this directory, silently and without worrying about
whether the builder is the default or not."""
listDirs = []
parent = self
while parent:
if parent.exists():
break
listDirs.append(parent)
p = paren... | [
"def",
"_create",
"(",
"self",
")",
":",
"listDirs",
"=",
"[",
"]",
"parent",
"=",
"self",
"while",
"parent",
":",
"if",
"parent",
".",
"exists",
"(",
")",
":",
"break",
"listDirs",
".",
"append",
"(",
"parent",
")",
"p",
"=",
"parent",
".",
"up",
... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py#L1807-L1837 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/traceable_stack.py | python | TraceableObject.set_filename_and_line_from_caller | (self, offset=0) | Set filename and line using the caller's stack frame.
If the requested stack information is not available, a heuristic may
be applied and self.HEURISTIC USED will be returned. If the heuristic
fails then no change will be made to the filename and lineno members
(None by default) and self.FAILURE will ... | Set filename and line using the caller's stack frame. | [
"Set",
"filename",
"and",
"line",
"using",
"the",
"caller",
"s",
"stack",
"frame",
"."
] | def set_filename_and_line_from_caller(self, offset=0):
"""Set filename and line using the caller's stack frame.
If the requested stack information is not available, a heuristic may
be applied and self.HEURISTIC USED will be returned. If the heuristic
fails then no change will be made to the filename a... | [
"def",
"set_filename_and_line_from_caller",
"(",
"self",
",",
"offset",
"=",
"0",
")",
":",
"# Offset is defined in \"Args\" as relative to the caller. We are one frame",
"# beyond the caller.",
"local_offset",
"=",
"offset",
"+",
"1",
"frame_records",
"=",
"tf_stack",
".",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/traceable_stack.py#L35-L73 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/training/rmsprop.py | python | RMSPropOptimizer.__init__ | (self,
learning_rate,
decay=0.9,
momentum=0.0,
epsilon=1e-10,
use_locking=False,
centered=False,
name="RMSProp") | Construct a new RMSProp optimizer.
Note that in the dense implementation of this algorithm, variables and their
corresponding accumulators (momentum, gradient moving average, square
gradient moving average) will be updated even if the gradient is zero
(i.e. accumulators will decay, momentum will be app... | Construct a new RMSProp optimizer. | [
"Construct",
"a",
"new",
"RMSProp",
"optimizer",
"."
] | def __init__(self,
learning_rate,
decay=0.9,
momentum=0.0,
epsilon=1e-10,
use_locking=False,
centered=False,
name="RMSProp"):
"""Construct a new RMSProp optimizer.
Note that in the dense implementation of t... | [
"def",
"__init__",
"(",
"self",
",",
"learning_rate",
",",
"decay",
"=",
"0.9",
",",
"momentum",
"=",
"0.0",
",",
"epsilon",
"=",
"1e-10",
",",
"use_locking",
"=",
"False",
",",
"centered",
"=",
"False",
",",
"name",
"=",
"\"RMSProp\"",
")",
":",
"supe... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/rmsprop.py#L58-L104 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/grpc_debug_server.py | python | EventListenerBaseServicer.request_unwatch | (self, node_name, output_slot, debug_op) | Request disabling a debug tensor watchpoint or breakpoint.
This is the opposite of `request_watch()`.
Args:
node_name: (`str`) name of the node that the to-be-watched tensor belongs
to, e.g., "hidden/Weights".
output_slot: (`int`) output slot index of the tensor to watch.
debug_op: (... | Request disabling a debug tensor watchpoint or breakpoint. | [
"Request",
"disabling",
"a",
"debug",
"tensor",
"watchpoint",
"or",
"breakpoint",
"."
] | def request_unwatch(self, node_name, output_slot, debug_op):
"""Request disabling a debug tensor watchpoint or breakpoint.
This is the opposite of `request_watch()`.
Args:
node_name: (`str`) name of the node that the to-be-watched tensor belongs
to, e.g., "hidden/Weights".
output_slot:... | [
"def",
"request_unwatch",
"(",
"self",
",",
"node_name",
",",
"output_slot",
",",
"debug_op",
")",
":",
"self",
".",
"_debug_ops_state_change_queue",
".",
"put",
"(",
"_state_change",
"(",
"debug_service_pb2",
".",
"EventReply",
".",
"DebugOpStateChange",
".",
"DI... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/grpc_debug_server.py#L423-L438 | ||
firebreath/FireBreath | d79534ef5a91d78debd7b102a640ff7857750e48 | fbgen/gen_templates.py | python | Base.updateCfg | (self, cfg) | Override in sub-classes. Updates a configuration object with current
values. | Override in sub-classes. Updates a configuration object with current
values. | [
"Override",
"in",
"sub",
"-",
"classes",
".",
"Updates",
"a",
"configuration",
"object",
"with",
"current",
"values",
"."
] | def updateCfg(self, cfg):
"""
Override in sub-classes. Updates a configuration object with current
values.
"""
pass | [
"def",
"updateCfg",
"(",
"self",
",",
"cfg",
")",
":",
"pass"
] | https://github.com/firebreath/FireBreath/blob/d79534ef5a91d78debd7b102a640ff7857750e48/fbgen/gen_templates.py#L122-L127 | ||
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Conv.py | python | TimeConv.filter_count | (self, new_filter_count) | Sets the number of filters. | Sets the number of filters. | [
"Sets",
"the",
"number",
"of",
"filters",
"."
] | def filter_count(self, new_filter_count):
"""Sets the number of filters.
"""
self._internal.set_filter_count(int(new_filter_count)) | [
"def",
"filter_count",
"(",
"self",
",",
"new_filter_count",
")",
":",
"self",
".",
"_internal",
".",
"set_filter_count",
"(",
"int",
"(",
"new_filter_count",
")",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Conv.py#L1077-L1080 | ||
nlohmann/json | eb2182414749825be086c825edb5229e5c28503d | third_party/cpplint/cpplint.py | python | FilesBelongToSameModule | (filename_cc, filename_h) | return files_belong_to_same_module, common_path | Check if these two filenames belong to the same module.
The concept of a 'module' here is a as follows:
foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the
same 'module' if they are in the same directory.
some/path/public/xyzzy and some/path/internal/xyzzy are also considered
to belong to... | Check if these two filenames belong to the same module. | [
"Check",
"if",
"these",
"two",
"filenames",
"belong",
"to",
"the",
"same",
"module",
"."
] | def FilesBelongToSameModule(filename_cc, filename_h):
"""Check if these two filenames belong to the same module.
The concept of a 'module' here is a as follows:
foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the
same 'module' if they are in the same directory.
some/path/public/xyzzy and ... | [
"def",
"FilesBelongToSameModule",
"(",
"filename_cc",
",",
"filename_h",
")",
":",
"fileinfo_cc",
"=",
"FileInfo",
"(",
"filename_cc",
")",
"if",
"not",
"fileinfo_cc",
".",
"Extension",
"(",
")",
".",
"lstrip",
"(",
"'.'",
")",
"in",
"GetNonHeaderExtensions",
... | https://github.com/nlohmann/json/blob/eb2182414749825be086c825edb5229e5c28503d/third_party/cpplint/cpplint.py#L5967-L6022 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | scripts/update_onnx_weight.py | python | update_onnx_initializer | (onnx_file, ckpt_file, output_file) | Update onnx initializer. | Update onnx initializer. | [
"Update",
"onnx",
"initializer",
"."
] | def update_onnx_initializer(onnx_file, ckpt_file, output_file):
"Update onnx initializer."
with open(onnx_file, 'rb') as f:
data = f.read()
model = onnx_pb.ModelProto()
model.ParseFromString(data)
initializer = model.graph.initializer
param_dict = load_checkpoint(ckpt_file)
for i, _... | [
"def",
"update_onnx_initializer",
"(",
"onnx_file",
",",
"ckpt_file",
",",
"output_file",
")",
":",
"with",
"open",
"(",
"onnx_file",
",",
"'rb'",
")",
"as",
"f",
":",
"data",
"=",
"f",
".",
"read",
"(",
")",
"model",
"=",
"onnx_pb",
".",
"ModelProto",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/scripts/update_onnx_weight.py#L28-L56 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/crywaflib/msvs.py | python | msvs_generator.init | (self) | Some data that needs to be present | Some data that needs to be present | [
"Some",
"data",
"that",
"needs",
"to",
"be",
"present"
] | def init(self):
"""
Some data that needs to be present
"""
host = Utils.unversioned_sys_platform()
if host == 'linux' or host == 'darwin':
Logs.warn('Skipping MSVS project generation as host platform is not Windows')
return
# Remove unsupported MSBUILD platforms from list
strip_unsupported_msbui... | [
"def",
"init",
"(",
"self",
")",
":",
"host",
"=",
"Utils",
".",
"unversioned_sys_platform",
"(",
")",
"if",
"host",
"==",
"'linux'",
"or",
"host",
"==",
"'darwin'",
":",
"Logs",
".",
"warn",
"(",
"'Skipping MSVS project generation as host platform is not Windows'... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/msvs.py#L1631-L1696 | ||
kismetwireless/kismet | a7c0dc270c960fb1f58bd9cec4601c201885fd4e | capture_sdr_rtl433/KismetCaptureRtl433/kismetexternal/__init__.py | python | Datasource.send_datasource_error_report | (self, seqno=0, message=None) | When acting as a Kismet datasource, send a source error. This can be in response
to a specific command, or a runtime failure.
:param seqno: Command which failed, or 0
:param message: Optional user message
:return: None | When acting as a Kismet datasource, send a source error. This can be in response
to a specific command, or a runtime failure. | [
"When",
"acting",
"as",
"a",
"Kismet",
"datasource",
"send",
"a",
"source",
"error",
".",
"This",
"can",
"be",
"in",
"response",
"to",
"a",
"specific",
"command",
"or",
"a",
"runtime",
"failure",
"."
] | def send_datasource_error_report(self, seqno=0, message=None):
"""
When acting as a Kismet datasource, send a source error. This can be in response
to a specific command, or a runtime failure.
:param seqno: Command which failed, or 0
:param message: Optional user message
... | [
"def",
"send_datasource_error_report",
"(",
"self",
",",
"seqno",
"=",
"0",
",",
"message",
"=",
"None",
")",
":",
"report",
"=",
"datasource_pb2",
".",
"ErrorReport",
"(",
")",
"report",
".",
"success",
".",
"success",
"=",
"False",
"report",
".",
"succes... | https://github.com/kismetwireless/kismet/blob/a7c0dc270c960fb1f58bd9cec4601c201885fd4e/capture_sdr_rtl433/KismetCaptureRtl433/kismetexternal/__init__.py#L978-L998 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/searchbase.py | python | SearchDialogBase.make_button | (self, label, command, isdef=0) | return b | Return command button gridded in command frame. | Return command button gridded in command frame. | [
"Return",
"command",
"button",
"gridded",
"in",
"command",
"frame",
"."
] | def make_button(self, label, command, isdef=0):
"Return command button gridded in command frame."
b = Button(self.buttonframe,
text=label, command=command,
default=isdef and "active" or "normal")
cols,rows=self.buttonframe.grid_size()
b.grid(pady=1,r... | [
"def",
"make_button",
"(",
"self",
",",
"label",
",",
"command",
",",
"isdef",
"=",
"0",
")",
":",
"b",
"=",
"Button",
"(",
"self",
".",
"buttonframe",
",",
"text",
"=",
"label",
",",
"command",
"=",
"command",
",",
"default",
"=",
"isdef",
"and",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/searchbase.py#L162-L170 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/symbol/numpy/_symbol.py | python | ldexp | (x1, x2, out=None, **kwargs) | return _ufunc_helper(x1, x2, _npi.ldexp, _np.ldexp, _npi.ldexp_scalar, _npi.rldexp_scalar, out) | Returns x1 * 2**x2, element-wise.
The mantissas `x1` and twos exponents `x2` are used to construct
floating point numbers ``x1 * 2**x2``.
Parameters
----------
x1 : _Symbol
Array of multipliers.
x2 : _Symbol
Array of twos exponents.
out : _Symbol or None
Dummy parame... | Returns x1 * 2**x2, element-wise.
The mantissas `x1` and twos exponents `x2` are used to construct
floating point numbers ``x1 * 2**x2``. | [
"Returns",
"x1",
"*",
"2",
"**",
"x2",
"element",
"-",
"wise",
".",
"The",
"mantissas",
"x1",
"and",
"twos",
"exponents",
"x2",
"are",
"used",
"to",
"construct",
"floating",
"point",
"numbers",
"x1",
"*",
"2",
"**",
"x2",
"."
] | def ldexp(x1, x2, out=None, **kwargs):
"""
Returns x1 * 2**x2, element-wise.
The mantissas `x1` and twos exponents `x2` are used to construct
floating point numbers ``x1 * 2**x2``.
Parameters
----------
x1 : _Symbol
Array of multipliers.
x2 : _Symbol
Array of twos expone... | [
"def",
"ldexp",
"(",
"x1",
",",
"x2",
",",
"out",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_ufunc_helper",
"(",
"x1",
",",
"x2",
",",
"_npi",
".",
"ldexp",
",",
"_np",
".",
"ldexp",
",",
"_npi",
".",
"ldexp_scalar",
",",
"_npi",... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L6069-L6096 | |
xiaolonw/caffe-video_triplet | c39ea1ad6e937ccf7deba4510b7e555165abf05f | scripts/cpp_lint.py | python | _SetCountingStyle | (level) | Sets the module's counting options. | Sets the module's counting options. | [
"Sets",
"the",
"module",
"s",
"counting",
"options",
"."
] | def _SetCountingStyle(level):
"""Sets the module's counting options."""
_cpplint_state.SetCountingStyle(level) | [
"def",
"_SetCountingStyle",
"(",
"level",
")",
":",
"_cpplint_state",
".",
"SetCountingStyle",
"(",
"level",
")"
] | https://github.com/xiaolonw/caffe-video_triplet/blob/c39ea1ad6e937ccf7deba4510b7e555165abf05f/scripts/cpp_lint.py#L787-L789 | ||
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/mox.py | python | IsA.equals | (self, rhs) | Check to see if the RHS is an instance of class_name.
Args:
# rhs: the right hand side of the test
rhs: object
Returns:
bool | Check to see if the RHS is an instance of class_name. | [
"Check",
"to",
"see",
"if",
"the",
"RHS",
"is",
"an",
"instance",
"of",
"class_name",
"."
] | def equals(self, rhs):
"""Check to see if the RHS is an instance of class_name.
Args:
# rhs: the right hand side of the test
rhs: object
Returns:
bool
"""
try:
return isinstance(rhs, self._class_name)
except TypeError:
# Check raw types if there was a type error.... | [
"def",
"equals",
"(",
"self",
",",
"rhs",
")",
":",
"try",
":",
"return",
"isinstance",
"(",
"rhs",
",",
"self",
".",
"_class_name",
")",
"except",
"TypeError",
":",
"# Check raw types if there was a type error. This is helpful for",
"# things like cStringIO.StringIO."... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/mox.py#L807-L823 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/function.py | python | _DelayedRewriteGradientFunctions._construct_forward_backward | (self, num_doutputs) | Constructs a pair of forward and backward functions.
Args:
num_doutputs: The constructed backprop function will take output gradients
for the first `num_doutputs` outputs of the forward function. Defaults
to the number of outputs for the inference function, but when
higher-order gradi... | Constructs a pair of forward and backward functions. | [
"Constructs",
"a",
"pair",
"of",
"forward",
"and",
"backward",
"functions",
"."
] | def _construct_forward_backward(self, num_doutputs):
"""Constructs a pair of forward and backward functions.
Args:
num_doutputs: The constructed backprop function will take output gradients
for the first `num_doutputs` outputs of the forward function. Defaults
to the number of outputs for... | [
"def",
"_construct_forward_backward",
"(",
"self",
",",
"num_doutputs",
")",
":",
"trainable_outputs",
"=",
"[",
"output",
"for",
"output",
"in",
"self",
".",
"_func_graph",
".",
"outputs",
"[",
":",
"num_doutputs",
"]",
"if",
"gradients_util",
".",
"IsTrainable... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/function.py#L586-L657 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/pystache/pystache/renderer.py | python | Renderer._make_resolve_context | (self) | return resolve_context | Return the resolve_context function to pass to RenderEngine.__init__(). | Return the resolve_context function to pass to RenderEngine.__init__(). | [
"Return",
"the",
"resolve_context",
"function",
"to",
"pass",
"to",
"RenderEngine",
".",
"__init__",
"()",
"."
] | def _make_resolve_context(self):
"""
Return the resolve_context function to pass to RenderEngine.__init__().
"""
if self._is_missing_tags_strict():
return context_get
# Otherwise, ignore missing tags.
def resolve_context(stack, name):
try:
... | [
"def",
"_make_resolve_context",
"(",
"self",
")",
":",
"if",
"self",
".",
"_is_missing_tags_strict",
"(",
")",
":",
"return",
"context_get",
"# Otherwise, ignore missing tags.",
"def",
"resolve_context",
"(",
"stack",
",",
"name",
")",
":",
"try",
":",
"return",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/pystache/pystache/renderer.py#L306-L321 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/ContactStructuralMechanicsApplication/python_scripts/mpc_contact_process.py | python | MPCContactProcess._get_condition_name | (self) | return condition_name | This method returns the condition name
Keyword arguments:
self -- It signifies an instance of a class. | This method returns the condition name | [
"This",
"method",
"returns",
"the",
"condition",
"name"
] | def _get_condition_name(self):
""" This method returns the condition name
Keyword arguments:
self -- It signifies an instance of a class.
"""
# We define the condition name to be used
condition_name = "MPCMortarContact"
return condition_name | [
"def",
"_get_condition_name",
"(",
"self",
")",
":",
"# We define the condition name to be used",
"condition_name",
"=",
"\"MPCMortarContact\"",
"return",
"condition_name"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ContactStructuralMechanicsApplication/python_scripts/mpc_contact_process.py#L313-L323 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py | python | NeuralNetworkBuilder.add_reduce_l2 | (
self, name, input_name, output_name, axes=None, keepdims=True, reduce_all=False
) | return spec_layer | Add a reduce_l2 layer to the model that reduces the input tensor
using ``l2_normalization(elements across given dimensions)``.
Refer to the **ReduceL2LayerParams** message in specification
(NeuralNetwork.proto) for more details.
Parameters
----------
name: str
... | Add a reduce_l2 layer to the model that reduces the input tensor
using ``l2_normalization(elements across given dimensions)``.
Refer to the **ReduceL2LayerParams** message in specification
(NeuralNetwork.proto) for more details. | [
"Add",
"a",
"reduce_l2",
"layer",
"to",
"the",
"model",
"that",
"reduces",
"the",
"input",
"tensor",
"using",
"l2_normalization",
"(",
"elements",
"across",
"given",
"dimensions",
")",
".",
"Refer",
"to",
"the",
"**",
"ReduceL2LayerParams",
"**",
"message",
"i... | def add_reduce_l2(
self, name, input_name, output_name, axes=None, keepdims=True, reduce_all=False
):
"""
Add a reduce_l2 layer to the model that reduces the input tensor
using ``l2_normalization(elements across given dimensions)``.
Refer to the **ReduceL2LayerParams** messag... | [
"def",
"add_reduce_l2",
"(",
"self",
",",
"name",
",",
"input_name",
",",
"output_name",
",",
"axes",
"=",
"None",
",",
"keepdims",
"=",
"True",
",",
"reduce_all",
"=",
"False",
")",
":",
"spec_layer",
"=",
"self",
".",
"_add_generic_layer",
"(",
"name",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py#L7882-L7927 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/pimp.py | python | _run | (mode, verbose, force, args, prefargs, watcher) | Engine for the main program | Engine for the main program | [
"Engine",
"for",
"the",
"main",
"program"
] | def _run(mode, verbose, force, args, prefargs, watcher):
"""Engine for the main program"""
prefs = PimpPreferences(**prefargs)
if watcher:
prefs.setWatcher(watcher)
rv = prefs.check()
if rv:
sys.stdout.write(rv)
db = PimpDatabase(prefs)
db.appendURL(prefs.pimpDatabase)
... | [
"def",
"_run",
"(",
"mode",
",",
"verbose",
",",
"force",
",",
"args",
",",
"prefargs",
",",
"watcher",
")",
":",
"prefs",
"=",
"PimpPreferences",
"(",
"*",
"*",
"prefargs",
")",
"if",
"watcher",
":",
"prefs",
".",
"setWatcher",
"(",
"watcher",
")",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/pimp.py#L1011-L1093 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/lmbr_aws/cleanup_utils/cleanup_glue_utils.py | python | __glue_crawler_exists | (cleaner, glue_crawler_name) | return True | Verifies if a crawler exists. This is should be replaced once glue supports Waiter objects for crawlers.
:param cleaner: A Cleaner object from the main cleanup.py script
:param glue_crawler_name: Can be retrieved from the boto3 get_crawlers() with response['Crawlers']['Name']
:return: True if the crawler ex... | Verifies if a crawler exists. This is should be replaced once glue supports Waiter objects for crawlers.
:param cleaner: A Cleaner object from the main cleanup.py script
:param glue_crawler_name: Can be retrieved from the boto3 get_crawlers() with response['Crawlers']['Name']
:return: True if the crawler ex... | [
"Verifies",
"if",
"a",
"crawler",
"exists",
".",
"This",
"is",
"should",
"be",
"replaced",
"once",
"glue",
"supports",
"Waiter",
"objects",
"for",
"crawlers",
".",
":",
"param",
"cleaner",
":",
"A",
"Cleaner",
"object",
"from",
"the",
"main",
"cleanup",
".... | def __glue_crawler_exists(cleaner, glue_crawler_name):
"""
Verifies if a crawler exists. This is should be replaced once glue supports Waiter objects for crawlers.
:param cleaner: A Cleaner object from the main cleanup.py script
:param glue_crawler_name: Can be retrieved from the boto3 get_crawlers() wi... | [
"def",
"__glue_crawler_exists",
"(",
"cleaner",
",",
"glue_crawler_name",
")",
":",
"try",
":",
"cleaner",
".",
"glue",
".",
"get_crawler",
"(",
"Name",
"=",
"glue_crawler_name",
")",
"except",
"cleaner",
".",
"glue",
".",
"exceptions",
".",
"EntityNotFoundExcep... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/lmbr_aws/cleanup_utils/cleanup_glue_utils.py#L20-L35 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/onnx/mx2onnx/_op_translations.py | python | create_helper_trans_node | (op_name, input_node, node_name) | return trans_node | create extra transpose node for dot operator | create extra transpose node for dot operator | [
"create",
"extra",
"transpose",
"node",
"for",
"dot",
"operator"
] | def create_helper_trans_node(op_name, input_node, node_name):
"""create extra transpose node for dot operator"""
node_name = op_name + "_" + node_name
trans_node = onnx.helper.make_node(
'Transpose',
inputs=[input_node],
outputs=[node_name],
name=node_name
)
return tr... | [
"def",
"create_helper_trans_node",
"(",
"op_name",
",",
"input_node",
",",
"node_name",
")",
":",
"node_name",
"=",
"op_name",
"+",
"\"_\"",
"+",
"node_name",
"trans_node",
"=",
"onnx",
".",
"helper",
".",
"make_node",
"(",
"'Transpose'",
",",
"inputs",
"=",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L500-L509 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Node/FS.py | python | File.release_target_info | (self) | Called just after this node has been marked
up-to-date or was built completely.
This is where we try to release as many target node infos
as possible for clean builds and update runs, in order
to minimize the overall memory consumption.
We'd like to remove a lot more attri... | Called just after this node has been marked
up-to-date or was built completely. | [
"Called",
"just",
"after",
"this",
"node",
"has",
"been",
"marked",
"up",
"-",
"to",
"-",
"date",
"or",
"was",
"built",
"completely",
"."
] | def release_target_info(self):
"""Called just after this node has been marked
up-to-date or was built completely.
This is where we try to release as many target node infos
as possible for clean builds and update runs, in order
to minimize the overall memory consumption.
... | [
"def",
"release_target_info",
"(",
"self",
")",
":",
"if",
"self",
".",
"released_target_info",
"or",
"SCons",
".",
"Node",
".",
"interactive",
":",
"return",
"if",
"not",
"hasattr",
"(",
"self",
".",
"attributes",
",",
"'keep_targetinfo'",
")",
":",
"# Cach... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Node/FS.py#L3010-L3060 | ||
DLR-SC/tigl | d1c5901e948e33d10b1f9659ff3e22c4717b455f | thirdparty/nsiqcppstyle/nsiqcppstyle_state.py | python | _NsiqCppStyleState.ResetErrorCount | (self) | Sets the module's error statistic back to zero. | Sets the module's error statistic back to zero. | [
"Sets",
"the",
"module",
"s",
"error",
"statistic",
"back",
"to",
"zero",
"."
] | def ResetErrorCount(self):
"""Sets the module's error statistic back to zero."""
self.error_count = 0
self.errorPerChecker = {}
self.errorPerFile = {} | [
"def",
"ResetErrorCount",
"(",
"self",
")",
":",
"self",
".",
"error_count",
"=",
"0",
"self",
".",
"errorPerChecker",
"=",
"{",
"}",
"self",
".",
"errorPerFile",
"=",
"{",
"}"
] | https://github.com/DLR-SC/tigl/blob/d1c5901e948e33d10b1f9659ff3e22c4717b455f/thirdparty/nsiqcppstyle/nsiqcppstyle_state.py#L59-L63 | ||
commaai/openpilot | 4416c21b1e738ab7d04147c5ae52b5135e0cdb40 | pyextra/acados_template/acados_ocp.py | python | AcadosOcpDims.nphi | (self) | return self.__nphi | :math:`n_{\phi}` - number of convex-over-nonlinear constraints.
Type: int; default: 0 | :math:`n_{\phi}` - number of convex-over-nonlinear constraints.
Type: int; default: 0 | [
":",
"math",
":",
"n_",
"{",
"\\",
"phi",
"}",
"-",
"number",
"of",
"convex",
"-",
"over",
"-",
"nonlinear",
"constraints",
".",
"Type",
":",
"int",
";",
"default",
":",
"0"
] | def nphi(self):
""":math:`n_{\phi}` - number of convex-over-nonlinear constraints.
Type: int; default: 0"""
return self.__nphi | [
"def",
"nphi",
"(",
"self",
")",
":",
"return",
"self",
".",
"__nphi"
] | https://github.com/commaai/openpilot/blob/4416c21b1e738ab7d04147c5ae52b5135e0cdb40/pyextra/acados_template/acados_ocp.py#L146-L149 | |
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | Tools/mavlink_px4.py | python | MAVLink.file_transfer_dir_list_send | (self, transfer_uid, dir_path, flags) | return self.send(self.file_transfer_dir_list_encode(transfer_uid, dir_path, flags)) | Get directory listing
transfer_uid : Unique transfer ID (uint64_t)
dir_path : Directory path to list (char)
flags : RESERVED (uint8_t) | Get directory listing | [
"Get",
"directory",
"listing"
] | def file_transfer_dir_list_send(self, transfer_uid, dir_path, flags):
'''
Get directory listing
transfer_uid : Unique transfer ID (uint64_t)
dir_path : Directory path to list (char)
flags :... | [
"def",
"file_transfer_dir_list_send",
"(",
"self",
",",
"transfer_uid",
",",
"dir_path",
",",
"flags",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"file_transfer_dir_list_encode",
"(",
"transfer_uid",
",",
"dir_path",
",",
"flags",
")",
")"
] | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/mavlink_px4.py#L4954-L4963 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py | python | FileNodeInfo.__getstate__ | (self) | return state | Return all fields that shall be pickled. Walk the slots in the class
hierarchy and add those to the state dictionary. If a '__dict__' slot is
available, copy all entries to the dictionary. Also include the version
id, which is fixed for all instances of a class. | Return all fields that shall be pickled. Walk the slots in the class
hierarchy and add those to the state dictionary. If a '__dict__' slot is
available, copy all entries to the dictionary. Also include the version
id, which is fixed for all instances of a class. | [
"Return",
"all",
"fields",
"that",
"shall",
"be",
"pickled",
".",
"Walk",
"the",
"slots",
"in",
"the",
"class",
"hierarchy",
"and",
"add",
"those",
"to",
"the",
"state",
"dictionary",
".",
"If",
"a",
"__dict__",
"slot",
"is",
"available",
"copy",
"all",
... | def __getstate__(self):
"""
Return all fields that shall be pickled. Walk the slots in the class
hierarchy and add those to the state dictionary. If a '__dict__' slot is
available, copy all entries to the dictionary. Also include the version
id, which is fixed for all instances o... | [
"def",
"__getstate__",
"(",
"self",
")",
":",
"state",
"=",
"getattr",
"(",
"self",
",",
"'__dict__'",
",",
"{",
"}",
")",
".",
"copy",
"(",
")",
"for",
"obj",
"in",
"type",
"(",
"self",
")",
".",
"mro",
"(",
")",
":",
"for",
"name",
"in",
"get... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py#L2460-L2479 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/shutil.py | python | copytree | (src, dst, symlinks=False, ignore=None) | Recursively copy a directory tree using copy2().
The destination directory must not already exist.
If exception(s) occur, an Error is raised with a list of reasons.
If the optional symlinks flag is true, symbolic links in the
source tree result in symbolic links in the destination tree; if
it is f... | Recursively copy a directory tree using copy2(). | [
"Recursively",
"copy",
"a",
"directory",
"tree",
"using",
"copy2",
"()",
"."
] | def copytree(src, dst, symlinks=False, ignore=None):
"""Recursively copy a directory tree using copy2().
The destination directory must not already exist.
If exception(s) occur, an Error is raised with a list of reasons.
If the optional symlinks flag is true, symbolic links in the
source tree resu... | [
"def",
"copytree",
"(",
"src",
",",
"dst",
",",
"symlinks",
"=",
"False",
",",
"ignore",
"=",
"None",
")",
":",
"names",
"=",
"os",
".",
"listdir",
"(",
"src",
")",
"if",
"ignore",
"is",
"not",
"None",
":",
"ignored_names",
"=",
"ignore",
"(",
"src... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/shutil.py#L114-L177 | ||
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/clang/bindings/python/clang/cindex.py | python | Type.kind | (self) | return TypeKind.from_id(self._kind_id) | Return the kind of this type. | Return the kind of this type. | [
"Return",
"the",
"kind",
"of",
"this",
"type",
"."
] | def kind(self):
"""Return the kind of this type."""
return TypeKind.from_id(self._kind_id) | [
"def",
"kind",
"(",
"self",
")",
":",
"return",
"TypeKind",
".",
"from_id",
"(",
"self",
".",
"_kind_id",
")"
] | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/bindings/python/clang/cindex.py#L2187-L2189 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/array_ops.py | python | size | (input, name=None, out_type=dtypes.int32) | return size_internal(input, name, optimize=True, out_type=out_type) | Returns the size of a tensor.
This operation returns an integer representing the number of elements in
`input`.
For example:
```python
t = tf.constant([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]])
tf.size(t) # 12
```
Args:
input: A `Tensor` or `SparseTensor`.
name: A name for the operat... | Returns the size of a tensor. | [
"Returns",
"the",
"size",
"of",
"a",
"tensor",
"."
] | def size(input, name=None, out_type=dtypes.int32):
# pylint: disable=redefined-builtin
"""Returns the size of a tensor.
This operation returns an integer representing the number of elements in
`input`.
For example:
```python
t = tf.constant([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]])
tf.size(t)... | [
"def",
"size",
"(",
"input",
",",
"name",
"=",
"None",
",",
"out_type",
"=",
"dtypes",
".",
"int32",
")",
":",
"# pylint: disable=redefined-builtin",
"return",
"size_internal",
"(",
"input",
",",
"name",
",",
"optimize",
"=",
"True",
",",
"out_type",
"=",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/array_ops.py#L308-L331 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Checkbutton.deselect | (self) | Put the button in off-state. | Put the button in off-state. | [
"Put",
"the",
"button",
"in",
"off",
"-",
"state",
"."
] | def deselect(self):
"""Put the button in off-state."""
self.tk.call(self._w, 'deselect') | [
"def",
"deselect",
"(",
"self",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'deselect'",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L2418-L2420 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TreeEvent.GetPoint | (*args, **kwargs) | return _controls_.TreeEvent_GetPoint(*args, **kwargs) | GetPoint(self) -> Point | GetPoint(self) -> Point | [
"GetPoint",
"(",
"self",
")",
"-",
">",
"Point"
] | def GetPoint(*args, **kwargs):
"""GetPoint(self) -> Point"""
return _controls_.TreeEvent_GetPoint(*args, **kwargs) | [
"def",
"GetPoint",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeEvent_GetPoint",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L5131-L5133 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py | python | InstalledDistribution.exports | (self) | return result | Return the information exported by this distribution.
:return: A dictionary of exports, mapping an export category to a dict
of :class:`ExportEntry` instances describing the individual
export entries, and keyed by name. | Return the information exported by this distribution.
:return: A dictionary of exports, mapping an export category to a dict
of :class:`ExportEntry` instances describing the individual
export entries, and keyed by name. | [
"Return",
"the",
"information",
"exported",
"by",
"this",
"distribution",
".",
":",
"return",
":",
"A",
"dictionary",
"of",
"exports",
"mapping",
"an",
"export",
"category",
"to",
"a",
"dict",
"of",
":",
"class",
":",
"ExportEntry",
"instances",
"describing",
... | def exports(self):
"""
Return the information exported by this distribution.
:return: A dictionary of exports, mapping an export category to a dict
of :class:`ExportEntry` instances describing the individual
export entries, and keyed by name.
"""
... | [
"def",
"exports",
"(",
"self",
")",
":",
"result",
"=",
"{",
"}",
"r",
"=",
"self",
".",
"get_distinfo_resource",
"(",
"EXPORTS_FILENAME",
")",
"if",
"r",
":",
"result",
"=",
"self",
".",
"read_exports",
"(",
")",
"return",
"result"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py#L604-L615 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/calendar.py | python | Calendar.yeardayscalendar | (self, year, width=3) | return [months[i:i+width] for i in range(0, len(months), width) ] | Return the data for the specified year ready for formatting (similar to
yeardatescalendar()). Entries in the week lists are day numbers.
Day numbers outside this month are zero. | Return the data for the specified year ready for formatting (similar to
yeardatescalendar()). Entries in the week lists are day numbers.
Day numbers outside this month are zero. | [
"Return",
"the",
"data",
"for",
"the",
"specified",
"year",
"ready",
"for",
"formatting",
"(",
"similar",
"to",
"yeardatescalendar",
"()",
")",
".",
"Entries",
"in",
"the",
"week",
"lists",
"are",
"day",
"numbers",
".",
"Day",
"numbers",
"outside",
"this",
... | def yeardayscalendar(self, year, width=3):
"""
Return the data for the specified year ready for formatting (similar to
yeardatescalendar()). Entries in the week lists are day numbers.
Day numbers outside this month are zero.
"""
months = [
self.monthdayscalend... | [
"def",
"yeardayscalendar",
"(",
"self",
",",
"year",
",",
"width",
"=",
"3",
")",
":",
"months",
"=",
"[",
"self",
".",
"monthdayscalendar",
"(",
"year",
",",
"i",
")",
"for",
"i",
"in",
"range",
"(",
"January",
",",
"January",
"+",
"12",
")",
"]",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/calendar.py#L246-L256 | |
twhui/LiteFlowNet | 00925aebf2db9ac50f4b1666f718688b10dd10d1 | scripts/cpp_lint.py | python | ReplaceAll | (pattern, rep, s) | return _regexp_compile_cache[pattern].sub(rep, s) | Replaces instances of pattern in a string with a replacement.
The compiled regex is kept in a cache shared by Match and Search.
Args:
pattern: regex pattern
rep: replacement text
s: search string
Returns:
string with replacements made (or original string if no replacements) | Replaces instances of pattern in a string with a replacement. | [
"Replaces",
"instances",
"of",
"pattern",
"in",
"a",
"string",
"with",
"a",
"replacement",
"."
] | def ReplaceAll(pattern, rep, s):
"""Replaces instances of pattern in a string with a replacement.
The compiled regex is kept in a cache shared by Match and Search.
Args:
pattern: regex pattern
rep: replacement text
s: search string
Returns:
string with replacements made (or original string if... | [
"def",
"ReplaceAll",
"(",
"pattern",
",",
"rep",
",",
"s",
")",
":",
"if",
"pattern",
"not",
"in",
"_regexp_compile_cache",
":",
"_regexp_compile_cache",
"[",
"pattern",
"]",
"=",
"sre_compile",
".",
"compile",
"(",
"pattern",
")",
"return",
"_regexp_compile_c... | https://github.com/twhui/LiteFlowNet/blob/00925aebf2db9ac50f4b1666f718688b10dd10d1/scripts/cpp_lint.py#L525-L540 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/bayesflow/python/ops/csiszar_divergence_impl.py | python | arithmetic_geometric | (logu, self_normalized=False, name=None) | The Arithmetic-Geometric Csiszar-function in log-space.
A Csiszar-function is a member of,
```none
F = { f:R_+ to R : f convex }.
```
When `self_normalized = True` the Arithmetic-Geometric Csiszar-function is:
```none
f(u) = (1 + u) log( (1 + u) / sqrt(u) ) - (1 + u) log(2)
```
When `self_normali... | The Arithmetic-Geometric Csiszar-function in log-space. | [
"The",
"Arithmetic",
"-",
"Geometric",
"Csiszar",
"-",
"function",
"in",
"log",
"-",
"space",
"."
] | def arithmetic_geometric(logu, self_normalized=False, name=None):
"""The Arithmetic-Geometric Csiszar-function in log-space.
A Csiszar-function is a member of,
```none
F = { f:R_+ to R : f convex }.
```
When `self_normalized = True` the Arithmetic-Geometric Csiszar-function is:
```none
f(u) = (1 + u... | [
"def",
"arithmetic_geometric",
"(",
"logu",
",",
"self_normalized",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"arithmetic_geometric\"",
",",
"[",
"logu",
"]",
")",
":",
"logu",
"=",
"ops",
"."... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/bayesflow/python/ops/csiszar_divergence_impl.py#L274-L324 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | PyImageHandler._SetSelf | (*args, **kwargs) | return _core_.PyImageHandler__SetSelf(*args, **kwargs) | _SetSelf(self, PyObject self) | _SetSelf(self, PyObject self) | [
"_SetSelf",
"(",
"self",
"PyObject",
"self",
")"
] | def _SetSelf(*args, **kwargs):
"""_SetSelf(self, PyObject self)"""
return _core_.PyImageHandler__SetSelf(*args, **kwargs) | [
"def",
"_SetSelf",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyImageHandler__SetSelf",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L2734-L2736 | |
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/meta/asttools/visitors/print_visitor.py | python | print_ast | (ast, indent=' ', initlevel=0, newline='\n', file=sys.stdout) | Pretty print an ast node.
:param ast: the ast to print.
:param indent: how far to indent a newline.
:param initlevel: starting indent level
:param newline: The newline character.
:param file: file object to print to
To print a short ast you may want to use::
node = ast.par... | Pretty print an ast node.
:param ast: the ast to print.
:param indent: how far to indent a newline.
:param initlevel: starting indent level
:param newline: The newline character.
:param file: file object to print to
To print a short ast you may want to use::
node = ast.par... | [
"Pretty",
"print",
"an",
"ast",
"node",
".",
":",
"param",
"ast",
":",
"the",
"ast",
"to",
"print",
".",
":",
"param",
"indent",
":",
"how",
"far",
"to",
"indent",
"a",
"newline",
".",
":",
"param",
"initlevel",
":",
"starting",
"indent",
"level",
":... | def print_ast(ast, indent=' ', initlevel=0, newline='\n', file=sys.stdout):
'''
Pretty print an ast node.
:param ast: the ast to print.
:param indent: how far to indent a newline.
:param initlevel: starting indent level
:param newline: The newline character.
:param file: file object to ... | [
"def",
"print_ast",
"(",
"ast",
",",
"indent",
"=",
"' '",
",",
"initlevel",
"=",
"0",
",",
"newline",
"=",
"'\\n'",
",",
"file",
"=",
"sys",
".",
"stdout",
")",
":",
"visitor",
"=",
"ASTPrinter",
"(",
"indent",
"=",
"indent",
",",
"level",
"=",
"i... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/meta/asttools/visitors/print_visitor.py#L159-L178 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/s3transfer/manager.py | python | TransferManager.shutdown | (self, cancel=False, cancel_msg='') | Shutdown the TransferManager
It will wait till all transfers complete before it completely shuts
down.
:type cancel: boolean
:param cancel: If True, calls TransferFuture.cancel() for
all in-progress in transfers. This is useful if you want the
shutdown to happen... | Shutdown the TransferManager | [
"Shutdown",
"the",
"TransferManager"
] | def shutdown(self, cancel=False, cancel_msg=''):
"""Shutdown the TransferManager
It will wait till all transfers complete before it completely shuts
down.
:type cancel: boolean
:param cancel: If True, calls TransferFuture.cancel() for
all in-progress in transfers. T... | [
"def",
"shutdown",
"(",
"self",
",",
"cancel",
"=",
"False",
",",
"cancel_msg",
"=",
"''",
")",
":",
"self",
".",
"_shutdown",
"(",
"cancel",
",",
"cancel",
",",
"cancel_msg",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/s3transfer/manager.py#L541-L556 | ||
OAID/Caffe-HRT | aae71e498ab842c6f92bcc23fc668423615a4d65 | scripts/cpp_lint.py | python | _FunctionState.Count | (self) | Count line in current function body. | Count line in current function body. | [
"Count",
"line",
"in",
"current",
"function",
"body",
"."
] | def Count(self):
"""Count line in current function body."""
if self.in_a_function:
self.lines_in_function += 1 | [
"def",
"Count",
"(",
"self",
")",
":",
"if",
"self",
".",
"in_a_function",
":",
"self",
".",
"lines_in_function",
"+=",
"1"
] | https://github.com/OAID/Caffe-HRT/blob/aae71e498ab842c6f92bcc23fc668423615a4d65/scripts/cpp_lint.py#L831-L834 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextCtrl.ApplyItalicToSelection | (*args, **kwargs) | return _richtext.RichTextCtrl_ApplyItalicToSelection(*args, **kwargs) | ApplyItalicToSelection(self) -> bool
Apply italic to the selection | ApplyItalicToSelection(self) -> bool | [
"ApplyItalicToSelection",
"(",
"self",
")",
"-",
">",
"bool"
] | def ApplyItalicToSelection(*args, **kwargs):
"""
ApplyItalicToSelection(self) -> bool
Apply italic to the selection
"""
return _richtext.RichTextCtrl_ApplyItalicToSelection(*args, **kwargs) | [
"def",
"ApplyItalicToSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_ApplyItalicToSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L3963-L3969 | |
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | mlir/utils/spirv/gen_spirv_dialect.py | python | get_spirv_doc_from_html_spec | (url, settings) | return doc | Extracts instruction documentation from SPIR-V HTML spec.
Returns:
- A dict mapping from instruction opcode to documentation. | Extracts instruction documentation from SPIR-V HTML spec. | [
"Extracts",
"instruction",
"documentation",
"from",
"SPIR",
"-",
"V",
"HTML",
"spec",
"."
] | def get_spirv_doc_from_html_spec(url, settings):
"""Extracts instruction documentation from SPIR-V HTML spec.
Returns:
- A dict mapping from instruction opcode to documentation.
"""
if url is None:
url = SPIRV_HTML_SPEC_URL
response = requests.get(url)
spec = response.content
from bs4 import Be... | [
"def",
"get_spirv_doc_from_html_spec",
"(",
"url",
",",
"settings",
")",
":",
"if",
"url",
"is",
"None",
":",
"url",
"=",
"SPIRV_HTML_SPEC_URL",
"response",
"=",
"requests",
".",
"get",
"(",
"url",
")",
"spec",
"=",
"response",
".",
"content",
"from",
"bs4... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/mlir/utils/spirv/gen_spirv_dialect.py#L36-L70 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/quantization.py | python | _load_sym | (sym, logger=logging) | Given a str as a path the symbol .json file or a symbol, returns a Symbol object. | Given a str as a path the symbol .json file or a symbol, returns a Symbol object. | [
"Given",
"a",
"str",
"as",
"a",
"path",
"the",
"symbol",
".",
"json",
"file",
"or",
"a",
"symbol",
"returns",
"a",
"Symbol",
"object",
"."
] | def _load_sym(sym, logger=logging):
"""Given a str as a path the symbol .json file or a symbol, returns a Symbol object."""
if isinstance(sym, str): # sym is a symbol file path
cur_path = os.path.dirname(os.path.realpath(__file__))
symbol_file_path = os.path.join(cur_path, sym)
logger.i... | [
"def",
"_load_sym",
"(",
"sym",
",",
"logger",
"=",
"logging",
")",
":",
"if",
"isinstance",
"(",
"sym",
",",
"str",
")",
":",
"# sym is a symbol file path",
"cur_path",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"realpath",
"... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/quantization.py#L385-L396 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | .github/github_org_control/github_api.py | python | GithubOrgApi.get_valid_github_users | (self, emails) | return valid_users | Gets valid GitHub users by email and prints status | Gets valid GitHub users by email and prints status | [
"Gets",
"valid",
"GitHub",
"users",
"by",
"email",
"and",
"prints",
"status"
] | def get_valid_github_users(self, emails):
"""Gets valid GitHub users by email and prints status"""
valid_users = set()
wrong_emails = set()
no_account_emails = set()
no_account_names = set()
print(f"\nGitHub users from {len(emails)} invite emails (email - status):")
... | [
"def",
"get_valid_github_users",
"(",
"self",
",",
"emails",
")",
":",
"valid_users",
"=",
"set",
"(",
")",
"wrong_emails",
"=",
"set",
"(",
")",
"no_account_emails",
"=",
"set",
"(",
")",
"no_account_names",
"=",
"set",
"(",
")",
"print",
"(",
"f\"\\nGitH... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/.github/github_org_control/github_api.py#L267-L316 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/gn_args.py | python | GetMergedArgs | (build_args) | return MergeDicts(dict, required) | Return merged GN args. | Return merged GN args. | [
"Return",
"merged",
"GN",
"args",
"."
] | def GetMergedArgs(build_args):
"""
Return merged GN args.
"""
dict = MergeDicts(GetRecommendedDefaultArgs(), GetGNEnvArgs(), build_args)
# Verify that the user is not trying to override required args.
required = GetRequiredArgs()
for key in required.keys():
if key in dict:
assert dict[key] == r... | [
"def",
"GetMergedArgs",
"(",
"build_args",
")",
":",
"dict",
"=",
"MergeDicts",
"(",
"GetRecommendedDefaultArgs",
"(",
")",
",",
"GetGNEnvArgs",
"(",
")",
",",
"build_args",
")",
"# Verify that the user is not trying to override required args.",
"required",
"=",
"GetReq... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/gn_args.py#L246-L259 | |
Evolving-AI-Lab/fooling | 66f097dd6bd2eb6794ade3e187a7adfdf1887688 | caffe/scripts/cpp_lint.py | python | CheckAccess | (filename, clean_lines, linenum, nesting_state, error) | Checks for improper use of DISALLOW* macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A _NestingState instance which maintains information about
the current stac... | Checks for improper use of DISALLOW* macros. | [
"Checks",
"for",
"improper",
"use",
"of",
"DISALLOW",
"*",
"macros",
"."
] | def CheckAccess(filename, clean_lines, linenum, nesting_state, error):
"""Checks for improper use of DISALLOW* macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A _NestingState in... | [
"def",
"CheckAccess",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# get rid of comments and strings",
"matched",
"=",
"Match",
"(",
"(",
"r'... | https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/scripts/cpp_lint.py#L2416-L2444 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/DNSMergeRuns.py | python | DNSMergeRuns.category | (self) | return 'Workflow\\MLZ\\DNS' | Returns category | Returns category | [
"Returns",
"category"
] | def category(self):
"""
Returns category
"""
return 'Workflow\\MLZ\\DNS' | [
"def",
"category",
"(",
"self",
")",
":",
"return",
"'Workflow\\\\MLZ\\\\DNS'"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/DNSMergeRuns.py#L32-L36 | |
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/boost_1.75.0/tools/build/src/build/targets.py | python | BasicTarget.generate_dependency_properties | (self, properties, ps) | return (result_properties, usage_requirements) | Takes a target reference, which might be either target id
or a dependency property, and generates that target using
'property_set' as build request.
Returns a tuple (result, usage_requirements). | Takes a target reference, which might be either target id
or a dependency property, and generates that target using
'property_set' as build request. | [
"Takes",
"a",
"target",
"reference",
"which",
"might",
"be",
"either",
"target",
"id",
"or",
"a",
"dependency",
"property",
"and",
"generates",
"that",
"target",
"using",
"property_set",
"as",
"build",
"request",
"."
] | def generate_dependency_properties(self, properties, ps):
""" Takes a target reference, which might be either target id
or a dependency property, and generates that target using
'property_set' as build request.
Returns a tuple (result, usage_requirements).
"""
... | [
"def",
"generate_dependency_properties",
"(",
"self",
",",
"properties",
",",
"ps",
")",
":",
"assert",
"is_iterable_typed",
"(",
"properties",
",",
"property",
".",
"Property",
")",
"assert",
"isinstance",
"(",
"ps",
",",
"property_set",
".",
"PropertySet",
")"... | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/build/targets.py#L1147-L1167 | |
nileshkulkarni/csm | 0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc | csm/utils/transformations.py | python | _import_module | (name, package=None, warn=True, prefix='_py_', ignore='_') | Try import all public attributes from module into global namespace.
Existing attributes with name clashes are renamed with prefix.
Attributes starting with underscore are ignored by default.
Return True on successful import. | Try import all public attributes from module into global namespace. | [
"Try",
"import",
"all",
"public",
"attributes",
"from",
"module",
"into",
"global",
"namespace",
"."
] | def _import_module(name, package=None, warn=True, prefix='_py_', ignore='_'):
"""Try import all public attributes from module into global namespace.
Existing attributes with name clashes are renamed with prefix.
Attributes starting with underscore are ignored by default.
Return True on successful impo... | [
"def",
"_import_module",
"(",
"name",
",",
"package",
"=",
"None",
",",
"warn",
"=",
"True",
",",
"prefix",
"=",
"'_py_'",
",",
"ignore",
"=",
"'_'",
")",
":",
"import",
"warnings",
"from",
"importlib",
"import",
"import_module",
"try",
":",
"if",
"not",... | https://github.com/nileshkulkarni/csm/blob/0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc/csm/utils/transformations.py#L1893-L1922 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/urllib2.py | python | AbstractHTTPHandler.do_open | (self, http_class, req) | return resp | Return an addinfourl object for the request, using http_class.
http_class must implement the HTTPConnection API from httplib.
The addinfourl return value is a file-like object. It also
has methods and attributes including:
- info(): return a mimetools.Message object for the headers... | Return an addinfourl object for the request, using http_class. | [
"Return",
"an",
"addinfourl",
"object",
"for",
"the",
"request",
"using",
"http_class",
"."
] | def do_open(self, http_class, req):
"""Return an addinfourl object for the request, using http_class.
http_class must implement the HTTPConnection API from httplib.
The addinfourl return value is a file-like object. It also
has methods and attributes including:
- info(): re... | [
"def",
"do_open",
"(",
"self",
",",
"http_class",
",",
"req",
")",
":",
"host",
"=",
"req",
".",
"get_host",
"(",
")",
"if",
"not",
"host",
":",
"raise",
"URLError",
"(",
"'no host given'",
")",
"h",
"=",
"http_class",
"(",
"host",
",",
"timeout",
"=... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/urllib2.py#L1139-L1208 | |
intel-iot-devkit/how-to-code-samples | b4ea616f36bbfa2e042beb1698f968cfd651d79f | watering-system/python/iot_watering_system/runner.py | python | Runner.serve_index | (self) | return output | Serve the 'index.html' file. | Serve the 'index.html' file. | [
"Serve",
"the",
"index",
".",
"html",
"file",
"."
] | def serve_index(self):
"""
Serve the 'index.html' file.
"""
output = template("index", moisture=self.moisture)
return output | [
"def",
"serve_index",
"(",
"self",
")",
":",
"output",
"=",
"template",
"(",
"\"index\"",
",",
"moisture",
"=",
"self",
".",
"moisture",
")",
"return",
"output"
] | https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/watering-system/python/iot_watering_system/runner.py#L150-L157 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Inelastic/Direct/RunDescriptor.py | python | RunDescriptor.get_ws_clone | (self,clone_name='ws_clone') | return mtd[clone_name] | Get unbounded clone of existing Run workspace | Get unbounded clone of existing Run workspace | [
"Get",
"unbounded",
"clone",
"of",
"existing",
"Run",
"workspace"
] | def get_ws_clone(self,clone_name='ws_clone'):
"""Get unbounded clone of existing Run workspace"""
ws = self.get_workspace()
CloneWorkspace(InputWorkspace=ws,OutputWorkspace=clone_name)
mon_ws_name = ws.name() + '_monitors'
if mon_ws_name in mtd:
cl_mon_name = clone_na... | [
"def",
"get_ws_clone",
"(",
"self",
",",
"clone_name",
"=",
"'ws_clone'",
")",
":",
"ws",
"=",
"self",
".",
"get_workspace",
"(",
")",
"CloneWorkspace",
"(",
"InputWorkspace",
"=",
"ws",
",",
"OutputWorkspace",
"=",
"clone_name",
")",
"mon_ws_name",
"=",
"ws... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/Direct/RunDescriptor.py#L822-L831 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/base64.py | python | standard_b64encode | (s) | return b64encode(s) | Encode a string using the standard Base64 alphabet.
s is the string to encode. The encoded string is returned. | Encode a string using the standard Base64 alphabet. | [
"Encode",
"a",
"string",
"using",
"the",
"standard",
"Base64",
"alphabet",
"."
] | def standard_b64encode(s):
"""Encode a string using the standard Base64 alphabet.
s is the string to encode. The encoded string is returned.
"""
return b64encode(s) | [
"def",
"standard_b64encode",
"(",
"s",
")",
":",
"return",
"b64encode",
"(",
"s",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/base64.py#L79-L84 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/pyplugin_installer/version_compare.py | python | compareElements | (s1, s2) | compare two particular elements | compare two particular elements | [
"compare",
"two",
"particular",
"elements"
] | def compareElements(s1, s2):
""" compare two particular elements """
# check if the matter is easy solvable:
if s1 == s2:
return 0
# try to compare as numeric values (but only if the first character is not 0):
if s1 and s2 and s1.isnumeric() and s2.isnumeric() and s1[0] != '0' and s2[0] != '... | [
"def",
"compareElements",
"(",
"s1",
",",
"s2",
")",
":",
"# check if the matter is easy solvable:",
"if",
"s1",
"==",
"s2",
":",
"return",
"0",
"# try to compare as numeric values (but only if the first character is not 0):",
"if",
"s1",
"and",
"s2",
"and",
"s1",
".",
... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/pyplugin_installer/version_compare.py#L97-L120 | ||
esa/pagmo | 80281d549c8f1b470e1489a5d37c8f06b2e429c0 | PyGMO/util/__init__.py | python | _hypervolume_exclusive | (
self,
p_idx=None,
r=None,
algorithm=None,
*args,
**kwargs) | return self._original_exclusive(*args) | Compute the exlusive contribution to the total hypervolume by the point at index p_idx, given a reference point and the provided hypervolume algorithm.
Type 'hv_algorithm?' for a list of available hypervolume algorithms.
USAGE:
hv.exclusive(p_idx=0, r=[5.0]*2)
hv.exclusive(p_idx=0, r=[5... | Compute the exlusive contribution to the total hypervolume by the point at index p_idx, given a reference point and the provided hypervolume algorithm.
Type 'hv_algorithm?' for a list of available hypervolume algorithms. | [
"Compute",
"the",
"exlusive",
"contribution",
"to",
"the",
"total",
"hypervolume",
"by",
"the",
"point",
"at",
"index",
"p_idx",
"given",
"a",
"reference",
"point",
"and",
"the",
"provided",
"hypervolume",
"algorithm",
".",
"Type",
"hv_algorithm?",
"for",
"a",
... | def _hypervolume_exclusive(
self,
p_idx=None,
r=None,
algorithm=None,
*args,
**kwargs):
"""
Compute the exlusive contribution to the total hypervolume by the point at index p_idx, given a reference point and the provided hypervolume algorithm.
Type 'hv_algorit... | [
"def",
"_hypervolume_exclusive",
"(",
"self",
",",
"p_idx",
"=",
"None",
",",
"r",
"=",
"None",
",",
"algorithm",
"=",
"None",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"p_idx",
"is",
"None",
":",
"raise",
"TypeError",
"(",
"\"p_idx ... | https://github.com/esa/pagmo/blob/80281d549c8f1b470e1489a5d37c8f06b2e429c0/PyGMO/util/__init__.py#L157-L194 | |
zlgopen/awtk | 2c49e854a78749d9092907c027a7fba9062be549 | 3rd/mbedtls/scripts/abi_check.py | python | AbiChecker._abi_compliance_command | (self, mbed_module, output_path) | return abi_compliance_command | Build the command to run to analyze the library mbed_module.
The report will be placed in output_path. | Build the command to run to analyze the library mbed_module.
The report will be placed in output_path. | [
"Build",
"the",
"command",
"to",
"run",
"to",
"analyze",
"the",
"library",
"mbed_module",
".",
"The",
"report",
"will",
"be",
"placed",
"in",
"output_path",
"."
] | def _abi_compliance_command(self, mbed_module, output_path):
"""Build the command to run to analyze the library mbed_module.
The report will be placed in output_path."""
abi_compliance_command = [
"abi-compliance-checker",
"-l", mbed_module,
"-old", self.old_v... | [
"def",
"_abi_compliance_command",
"(",
"self",
",",
"mbed_module",
",",
"output_path",
")",
":",
"abi_compliance_command",
"=",
"[",
"\"abi-compliance-checker\"",
",",
"\"-l\"",
",",
"mbed_module",
",",
"\"-old\"",
",",
"self",
".",
"old_version",
".",
"abi_dumps",
... | https://github.com/zlgopen/awtk/blob/2c49e854a78749d9092907c027a7fba9062be549/3rd/mbedtls/scripts/abi_check.py#L247-L264 | |
linyouhappy/kongkongxiyou | 7a69b2913eb29f4be77f9a62fb90cdd72c4160f1 | cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | AvailabilityKind.get_all_kinds | () | return filter(None, AvailabilityKind._kinds) | Return all AvailabilityKind enumeration instances. | Return all AvailabilityKind enumeration instances. | [
"Return",
"all",
"AvailabilityKind",
"enumeration",
"instances",
"."
] | def get_all_kinds():
"""Return all AvailabilityKind enumeration instances."""
return filter(None, AvailabilityKind._kinds) | [
"def",
"get_all_kinds",
"(",
")",
":",
"return",
"filter",
"(",
"None",
",",
"AvailabilityKind",
".",
"_kinds",
")"
] | https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L480-L482 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/abc.py | python | SourceLoader.path_mtime | (self, path) | return int(self.path_stats(path)['mtime']) | Return the (int) modification time for the path (str). | Return the (int) modification time for the path (str). | [
"Return",
"the",
"(",
"int",
")",
"modification",
"time",
"for",
"the",
"path",
"(",
"str",
")",
"."
] | def path_mtime(self, path):
"""Return the (int) modification time for the path (str)."""
if self.path_stats.__func__ is SourceLoader.path_stats:
raise OSError
return int(self.path_stats(path)['mtime']) | [
"def",
"path_mtime",
"(",
"self",
",",
"path",
")",
":",
"if",
"self",
".",
"path_stats",
".",
"__func__",
"is",
"SourceLoader",
".",
"path_stats",
":",
"raise",
"OSError",
"return",
"int",
"(",
"self",
".",
"path_stats",
"(",
"path",
")",
"[",
"'mtime'"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/abc.py#L315-L319 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/metadata.py | python | _best_version | (fields) | return '2.0' | Detect the best version depending on the fields used. | Detect the best version depending on the fields used. | [
"Detect",
"the",
"best",
"version",
"depending",
"on",
"the",
"fields",
"used",
"."
] | def _best_version(fields):
"""Detect the best version depending on the fields used."""
def _has_marker(keys, markers):
for marker in markers:
if marker in keys:
return True
return False
keys = []
for key, value in fields.items():
if value in ([], 'UNK... | [
"def",
"_best_version",
"(",
"fields",
")",
":",
"def",
"_has_marker",
"(",
"keys",
",",
"markers",
")",
":",
"for",
"marker",
"in",
"markers",
":",
"if",
"marker",
"in",
"keys",
":",
"return",
"True",
"return",
"False",
"keys",
"=",
"[",
"]",
"for",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/metadata.py#L114-L168 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/multiprocessing/sharedctypes.py | python | RawArray | (typecode_or_type, size_or_initializer) | Returns a ctypes array allocated from shared memory | Returns a ctypes array allocated from shared memory | [
"Returns",
"a",
"ctypes",
"array",
"allocated",
"from",
"shared",
"memory"
] | def RawArray(typecode_or_type, size_or_initializer):
'''
Returns a ctypes array allocated from shared memory
'''
type_ = typecode_to_type.get(typecode_or_type, typecode_or_type)
if isinstance(size_or_initializer, int):
type_ = type_ * size_or_initializer
obj = _new_value(type_)
... | [
"def",
"RawArray",
"(",
"typecode_or_type",
",",
"size_or_initializer",
")",
":",
"type_",
"=",
"typecode_to_type",
".",
"get",
"(",
"typecode_or_type",
",",
"typecode_or_type",
")",
"if",
"isinstance",
"(",
"size_or_initializer",
",",
"int",
")",
":",
"type_",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/multiprocessing/sharedctypes.py#L54-L68 | ||
apache/parquet-cpp | 642da055adf009652689b20e68a198cffb857651 | build-support/cpplint.py | python | ExpectingFunctionArgs | (clean_lines, linenum) | return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or
(linenum >= 2 and
(Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$',
clean_lines.elided[linenum - 1]) or
Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$',
clean_lines.elided[... | Checks whether where function type arguments are expected.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if the line at 'linenum' is inside something that expects arguments
of function types. | Checks whether where function type arguments are expected. | [
"Checks",
"whether",
"where",
"function",
"type",
"arguments",
"are",
"expected",
"."
] | def ExpectingFunctionArgs(clean_lines, linenum):
"""Checks whether where function type arguments are expected.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if the line at 'linenum' is inside something that expects arguments
... | [
"def",
"ExpectingFunctionArgs",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"return",
"(",
"Match",
"(",
"r'^\\s*MOCK_(CONST_)?METHOD\\d+(_T)?\\('",
",",
"line",
")",
"or",
"(",
"linenum",
">=",
... | https://github.com/apache/parquet-cpp/blob/642da055adf009652689b20e68a198cffb857651/build-support/cpplint.py#L5441-L5460 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/android/pylib/valgrind_tools.py | python | AddressSanitizerTool.GetUtilWrapper | (self) | return self.GetTestWrapper() | Returns the wrapper for utilities, such as forwarder.
AddressSanitizer wrapper must be added to all instrumented binaries,
including forwarder and the like. This can be removed if such binaries
were built without instrumentation. | Returns the wrapper for utilities, such as forwarder. | [
"Returns",
"the",
"wrapper",
"for",
"utilities",
"such",
"as",
"forwarder",
"."
] | def GetUtilWrapper(self):
"""Returns the wrapper for utilities, such as forwarder.
AddressSanitizer wrapper must be added to all instrumented binaries,
including forwarder and the like. This can be removed if such binaries
were built without instrumentation. """
return self.GetTestWrapper() | [
"def",
"GetUtilWrapper",
"(",
"self",
")",
":",
"return",
"self",
".",
"GetTestWrapper",
"(",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/valgrind_tools.py#L113-L119 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | demo/DPU-for-RNN/rnn_u25_u50lv/apps/imdb_sentiment_detection/utils/hdf5_format.py | python | load_attributes_from_hdf5_group | (group, name) | return data | Loads attributes of the specified name from the HDF5 group.
This method deals with an inherent problem
of HDF5 file which is not able to store
data larger than HDF5_OBJECT_HEADER_LIMIT bytes.
Arguments:
group: A pointer to a HDF5 group.
name: A name of the attributes to load.
Returns:
dat... | Loads attributes of the specified name from the HDF5 group. | [
"Loads",
"attributes",
"of",
"the",
"specified",
"name",
"from",
"the",
"HDF5",
"group",
"."
] | def load_attributes_from_hdf5_group(group, name):
"""Loads attributes of the specified name from the HDF5 group.
This method deals with an inherent problem
of HDF5 file which is not able to store
data larger than HDF5_OBJECT_HEADER_LIMIT bytes.
Arguments:
group: A pointer to a HDF5 group.
name: ... | [
"def",
"load_attributes_from_hdf5_group",
"(",
"group",
",",
"name",
")",
":",
"if",
"name",
"in",
"group",
".",
"attrs",
":",
"data",
"=",
"[",
"n",
"for",
"n",
"in",
"group",
".",
"attrs",
"[",
"name",
"]",
"]",
"else",
":",
"data",
"=",
"[",
"]"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/demo/DPU-for-RNN/rnn_u25_u50lv/apps/imdb_sentiment_detection/utils/hdf5_format.py#L824-L847 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/fixer_util.py | python | Call | (func_name, args=None, prefix=None) | return node | A function call | A function call | [
"A",
"function",
"call"
] | def Call(func_name, args=None, prefix=None):
"""A function call"""
node = Node(syms.power, [func_name, ArgList(args)])
if prefix is not None:
node.prefix = prefix
return node | [
"def",
"Call",
"(",
"func_name",
",",
"args",
"=",
"None",
",",
"prefix",
"=",
"None",
")",
":",
"node",
"=",
"Node",
"(",
"syms",
".",
"power",
",",
"[",
"func_name",
",",
"ArgList",
"(",
"args",
")",
"]",
")",
"if",
"prefix",
"is",
"not",
"None... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/fixer_util.py#L61-L66 | |
AojunZhou/Incremental-Network-Quantization | c7f6a609d5817d8424ce224209cf4c50f1e4de50 | python/caffe/io.py | python | Transformer.set_transpose | (self, in_, order) | Set the input channel order for e.g. RGB to BGR conversion
as needed for the reference ImageNet model.
Parameters
----------
in_ : which input to assign this channel order
order : the order to transpose the dimensions | Set the input channel order for e.g. RGB to BGR conversion
as needed for the reference ImageNet model. | [
"Set",
"the",
"input",
"channel",
"order",
"for",
"e",
".",
"g",
".",
"RGB",
"to",
"BGR",
"conversion",
"as",
"needed",
"for",
"the",
"reference",
"ImageNet",
"model",
"."
] | def set_transpose(self, in_, order):
"""
Set the input channel order for e.g. RGB to BGR conversion
as needed for the reference ImageNet model.
Parameters
----------
in_ : which input to assign this channel order
order : the order to transpose the dimensions
... | [
"def",
"set_transpose",
"(",
"self",
",",
"in_",
",",
"order",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"if",
"len",
"(",
"order",
")",
"!=",
"len",
"(",
"self",
".",
"inputs",
"[",
"in_",
"]",
")",
"-",
"1",
":",
"raise",
"Except... | https://github.com/AojunZhou/Incremental-Network-Quantization/blob/c7f6a609d5817d8424ce224209cf4c50f1e4de50/python/caffe/io.py#L187-L201 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/utils/cpp_extension/cpp_extension.py | python | BuildExtension._check_abi | (self) | Check ABI Compatibility. | Check ABI Compatibility. | [
"Check",
"ABI",
"Compatibility",
"."
] | def _check_abi(self):
"""
Check ABI Compatibility.
"""
if hasattr(self.compiler, 'compiler_cxx'):
compiler = self.compiler.compiler_cxx[0]
elif IS_WINDOWS:
compiler = os.environ.get('CXX', 'cl')
else:
compiler = os.environ.get('CXX', 'c... | [
"def",
"_check_abi",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
".",
"compiler",
",",
"'compiler_cxx'",
")",
":",
"compiler",
"=",
"self",
".",
"compiler",
".",
"compiler_cxx",
"[",
"0",
"]",
"elif",
"IS_WINDOWS",
":",
"compiler",
"=",
"os",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/utils/cpp_extension/cpp_extension.py#L621-L639 | ||
vnpy/vnpy | f50f2535ed39dd33272e0985ed40c7078e4c19f6 | vnpy/trader/gateway.py | python | BaseGateway.write_log | (self, msg: str) | Write a log event from gateway. | Write a log event from gateway. | [
"Write",
"a",
"log",
"event",
"from",
"gateway",
"."
] | def write_log(self, msg: str) -> None:
"""
Write a log event from gateway.
"""
log = LogData(msg=msg, gateway_name=self.gateway_name)
self.on_log(log) | [
"def",
"write_log",
"(",
"self",
",",
"msg",
":",
"str",
")",
"->",
"None",
":",
"log",
"=",
"LogData",
"(",
"msg",
"=",
"msg",
",",
"gateway_name",
"=",
"self",
".",
"gateway_name",
")",
"self",
".",
"on_log",
"(",
"log",
")"
] | https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/trader/gateway.py#L156-L161 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/encodings/hex_codec.py | python | hex_encode | (input,errors='strict') | return (output, len(input)) | Encodes the object input and returns a tuple (output
object, length consumed).
errors defines the error handling to apply. It defaults to
'strict' handling which is the only currently supported
error handling for this codec. | Encodes the object input and returns a tuple (output
object, length consumed). | [
"Encodes",
"the",
"object",
"input",
"and",
"returns",
"a",
"tuple",
"(",
"output",
"object",
"length",
"consumed",
")",
"."
] | def hex_encode(input,errors='strict'):
""" Encodes the object input and returns a tuple (output
object, length consumed).
errors defines the error handling to apply. It defaults to
'strict' handling which is the only currently supported
error handling for this codec.
"""
a... | [
"def",
"hex_encode",
"(",
"input",
",",
"errors",
"=",
"'strict'",
")",
":",
"assert",
"errors",
"==",
"'strict'",
"output",
"=",
"binascii",
".",
"b2a_hex",
"(",
"input",
")",
"return",
"(",
"output",
",",
"len",
"(",
"input",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/encodings/hex_codec.py#L13-L25 | |
rbgirshick/caffe-fast-rcnn | 28a579eaf0668850705598b3075b8969f22226d9 | scripts/cpp_lint.py | python | CheckForCopyright | (filename, lines, error) | Logs an error if a Copyright message appears at the top of the file. | Logs an error if a Copyright message appears at the top of the file. | [
"Logs",
"an",
"error",
"if",
"a",
"Copyright",
"message",
"appears",
"at",
"the",
"top",
"of",
"the",
"file",
"."
] | def CheckForCopyright(filename, lines, error):
"""Logs an error if a Copyright message appears at the top of the file."""
# We'll check up to line 10. Don't forget there's a
# dummy line at the front.
for line in xrange(1, min(len(lines), 11)):
if _RE_COPYRIGHT.search(lines[line], re.I):
error(filena... | [
"def",
"CheckForCopyright",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# We'll check up to line 10. Don't forget there's a",
"# dummy line at the front.",
"for",
"line",
"in",
"xrange",
"(",
"1",
",",
"min",
"(",
"len",
"(",
"lines",
")",
",",
"11",
... | https://github.com/rbgirshick/caffe-fast-rcnn/blob/28a579eaf0668850705598b3075b8969f22226d9/scripts/cpp_lint.py#L1372-L1381 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TUInt_JavaUIntToCppUInt | (*args) | return _snap.TUInt_JavaUIntToCppUInt(*args) | TUInt_JavaUIntToCppUInt(uint const & JavaUInt) -> uint
Parameters:
JavaUInt: uint const & | TUInt_JavaUIntToCppUInt(uint const & JavaUInt) -> uint | [
"TUInt_JavaUIntToCppUInt",
"(",
"uint",
"const",
"&",
"JavaUInt",
")",
"-",
">",
"uint"
] | def TUInt_JavaUIntToCppUInt(*args):
"""
TUInt_JavaUIntToCppUInt(uint const & JavaUInt) -> uint
Parameters:
JavaUInt: uint const &
"""
return _snap.TUInt_JavaUIntToCppUInt(*args) | [
"def",
"TUInt_JavaUIntToCppUInt",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TUInt_JavaUIntToCppUInt",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L13892-L13900 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py | python | Decimal._log10_exp_bound | (self) | return len(num) + e - (num < "231") - 1 | Compute a lower bound for the adjusted exponent of self.log10().
In other words, find r such that self.log10() >= 10**r.
Assumes that self is finite and positive and that self != 1. | Compute a lower bound for the adjusted exponent of self.log10().
In other words, find r such that self.log10() >= 10**r.
Assumes that self is finite and positive and that self != 1. | [
"Compute",
"a",
"lower",
"bound",
"for",
"the",
"adjusted",
"exponent",
"of",
"self",
".",
"log10",
"()",
".",
"In",
"other",
"words",
"find",
"r",
"such",
"that",
"self",
".",
"log10",
"()",
">",
"=",
"10",
"**",
"r",
".",
"Assumes",
"that",
"self",... | def _log10_exp_bound(self):
"""Compute a lower bound for the adjusted exponent of self.log10().
In other words, find r such that self.log10() >= 10**r.
Assumes that self is finite and positive and that self != 1.
"""
# For x >= 10 or x < 0.1 we only need a bound on the integer
... | [
"def",
"_log10_exp_bound",
"(",
"self",
")",
":",
"# For x >= 10 or x < 0.1 we only need a bound on the integer",
"# part of log10(self), and this comes directly from the",
"# exponent of x. For 0.1 <= x <= 10 we use the inequalities",
"# 1-1/x <= log(x) <= x-1. If x > 1 we have |log10(x)| >",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L3138-L3166 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/learn/python/learn/estimators/tensor_signature.py | python | create_signatures | (tensors) | return TensorSignature(tensors) | Creates TensorSignature objects for given tensors.
Args:
tensors: Dict of `Tensor` objects or single `Tensor`.
Returns:
Dict of `TensorSignature` objects or single `TensorSignature`. | Creates TensorSignature objects for given tensors. | [
"Creates",
"TensorSignature",
"objects",
"for",
"given",
"tensors",
"."
] | def create_signatures(tensors):
"""Creates TensorSignature objects for given tensors.
Args:
tensors: Dict of `Tensor` objects or single `Tensor`.
Returns:
Dict of `TensorSignature` objects or single `TensorSignature`.
"""
if isinstance(tensors, dict):
return {
key: TensorSignature(tensor... | [
"def",
"create_signatures",
"(",
"tensors",
")",
":",
"if",
"isinstance",
"(",
"tensors",
",",
"dict",
")",
":",
"return",
"{",
"key",
":",
"TensorSignature",
"(",
"tensors",
"[",
"key",
"]",
")",
"for",
"key",
"in",
"tensors",
"}",
"if",
"tensors",
"i... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/estimators/tensor_signature.py#L123-L137 | |
Illumina/hap.py | 84011695b2ff2406c16a335106db6831fb67fdfe | src/python/Somatic/__init__.py | python | PiscesHCCSNVFeatures.collect | (self, vcfname, tag) | return GenericFeatures.collectFeatures(vcfname, tag, features, processor=StrelkaAdmixSNVFeatures.processValue) | Return a data frame with features collected from the given VCF, tagged by given type | Return a data frame with features collected from the given VCF, tagged by given type | [
"Return",
"a",
"data",
"frame",
"with",
"features",
"collected",
"from",
"the",
"given",
"VCF",
"tagged",
"by",
"given",
"type"
] | def collect(self, vcfname, tag):
""" Return a data frame with features collected from the given VCF, tagged by given type """
if tag not in ["TP", "FN"]:
return extractPiscesSNVFeatures(vcfname, tag, self.chr_depth)
else:
features = ["CHROM", "POS", "REF", "ALT", "QUAL",
... | [
"def",
"collect",
"(",
"self",
",",
"vcfname",
",",
"tag",
")",
":",
"if",
"tag",
"not",
"in",
"[",
"\"TP\"",
",",
"\"FN\"",
"]",
":",
"return",
"extractPiscesSNVFeatures",
"(",
"vcfname",
",",
"tag",
",",
"self",
".",
"chr_depth",
")",
"else",
":",
... | https://github.com/Illumina/hap.py/blob/84011695b2ff2406c16a335106db6831fb67fdfe/src/python/Somatic/__init__.py#L235-L243 | |
fritzsedlazeck/Sniffles | 82d885e5a74b526e18dd87b52554aea8139dd3aa | src/sniffles/leadprov.py | python | CIGAR_listreadstart_fwd | (ops) | Position in query read where CIGAR alignment starts (i.e. taking into account start clipping) | Position in query read where CIGAR alignment starts (i.e. taking into account start clipping) | [
"Position",
"in",
"query",
"read",
"where",
"CIGAR",
"alignment",
"starts",
"(",
"i",
".",
"e",
".",
"taking",
"into",
"account",
"start",
"clipping",
")"
] | def CIGAR_listreadstart_fwd(ops):
#TODO: Obsolete (see CIGAR_analyze)
"""
Position in query read where CIGAR alignment starts (i.e. taking into account start clipping)
"""
op,oplen=ops[0]
op2,op2len=ops[1]
if op=="H" or op=="S":
assert(op2!="H" and op2!="S")
return oplen
... | [
"def",
"CIGAR_listreadstart_fwd",
"(",
"ops",
")",
":",
"#TODO: Obsolete (see CIGAR_analyze)",
"op",
",",
"oplen",
"=",
"ops",
"[",
"0",
"]",
"op2",
",",
"op2len",
"=",
"ops",
"[",
"1",
"]",
"if",
"op",
"==",
"\"H\"",
"or",
"op",
"==",
"\"S\"",
":",
"a... | https://github.com/fritzsedlazeck/Sniffles/blob/82d885e5a74b526e18dd87b52554aea8139dd3aa/src/sniffles/leadprov.py#L111-L122 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/common.py | python | GetFlavor | (params) | return 'linux' | Returns |params.flavor| if it's set, the system's default flavor else. | Returns |params.flavor| if it's set, the system's default flavor else. | [
"Returns",
"|params",
".",
"flavor|",
"if",
"it",
"s",
"set",
"the",
"system",
"s",
"default",
"flavor",
"else",
"."
] | def GetFlavor(params):
"""Returns |params.flavor| if it's set, the system's default flavor else."""
flavors = {
'cygwin': 'win',
'win32': 'win',
'darwin': 'mac',
}
if 'flavor' in params:
return params['flavor']
if sys.platform in flavors:
return flavors[sys.platform]
if sys.platform.sta... | [
"def",
"GetFlavor",
"(",
"params",
")",
":",
"flavors",
"=",
"{",
"'cygwin'",
":",
"'win'",
",",
"'win32'",
":",
"'win'",
",",
"'darwin'",
":",
"'mac'",
",",
"}",
"if",
"'flavor'",
"in",
"params",
":",
"return",
"params",
"[",
"'flavor'",
"]",
"if",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/common.py#L410-L431 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | tools/clang_format.py | python | Repo.get_candidates | (self, candidates) | return valid_files | Get the set of candidate files to check by querying the repository
Returns the full path to the file for clang-format to consume. | Get the set of candidate files to check by querying the repository | [
"Get",
"the",
"set",
"of",
"candidate",
"files",
"to",
"check",
"by",
"querying",
"the",
"repository"
] | def get_candidates(self, candidates):
"""Get the set of candidate files to check by querying the repository
Returns the full path to the file for clang-format to consume.
"""
if candidates is not None and len(candidates) > 0:
candidates = [self._get_local_dir(f) for f in can... | [
"def",
"get_candidates",
"(",
"self",
",",
"candidates",
")",
":",
"if",
"candidates",
"is",
"not",
"None",
"and",
"len",
"(",
"candidates",
")",
">",
"0",
":",
"candidates",
"=",
"[",
"self",
".",
"_get_local_dir",
"(",
"f",
")",
"for",
"f",
"in",
"... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/tools/clang_format.py#L334-L351 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/composite/math_ops.py | python | _max | (*args) | return max(*args) | Returns the maximum value. | Returns the maximum value. | [
"Returns",
"the",
"maximum",
"value",
"."
] | def _max(*args):
"""Returns the maximum value."""
return max(*args) | [
"def",
"_max",
"(",
"*",
"args",
")",
":",
"return",
"max",
"(",
"*",
"args",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/math_ops.py#L683-L685 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | src/icebox/icebox_py/__init__.py | python | Symbols.string | (self, ptr) | return libicebox.symbols_string(self.proc, ptr) | Convert process virtual memory address to symbol string. | Convert process virtual memory address to symbol string. | [
"Convert",
"process",
"virtual",
"memory",
"address",
"to",
"symbol",
"string",
"."
] | def string(self, ptr):
"""Convert process virtual memory address to symbol string."""
return libicebox.symbols_string(self.proc, ptr) | [
"def",
"string",
"(",
"self",
",",
"ptr",
")",
":",
"return",
"libicebox",
".",
"symbols_string",
"(",
"self",
".",
"proc",
",",
"ptr",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/src/icebox/icebox_py/__init__.py#L140-L142 | |
koying/SPMC | beca52667112f2661204ebb42406115825512491 | tools/EventClients/lib/python/xbmcclient.py | python | XBMCClient.send_action | (self, actionmessage="", actiontype=ACTION_EXECBUILTIN) | return packet.send(self.sock, self.addr, self.uid) | Keyword arguments:
actionmessage -- the ActionString
actiontype -- The ActionType the ActionString should be sent to. | Keyword arguments:
actionmessage -- the ActionString
actiontype -- The ActionType the ActionString should be sent to. | [
"Keyword",
"arguments",
":",
"actionmessage",
"--",
"the",
"ActionString",
"actiontype",
"--",
"The",
"ActionType",
"the",
"ActionString",
"should",
"be",
"sent",
"to",
"."
] | def send_action(self, actionmessage="", actiontype=ACTION_EXECBUILTIN):
"""
Keyword arguments:
actionmessage -- the ActionString
actiontype -- The ActionType the ActionString should be sent to.
"""
packet = PacketACTION(actionmessage, actiontype)
return packet.sen... | [
"def",
"send_action",
"(",
"self",
",",
"actionmessage",
"=",
"\"\"",
",",
"actiontype",
"=",
"ACTION_EXECBUILTIN",
")",
":",
"packet",
"=",
"PacketACTION",
"(",
"actionmessage",
",",
"actiontype",
")",
"return",
"packet",
".",
"send",
"(",
"self",
".",
"soc... | https://github.com/koying/SPMC/blob/beca52667112f2661204ebb42406115825512491/tools/EventClients/lib/python/xbmcclient.py#L621-L628 | |
msracver/Deep-Image-Analogy | 632b9287b42552e32dad64922967c8c9ec7fc4d3 | scripts/cpp_lint.py | python | _GetTextInside | (text, start_pattern) | return text[start_position:position - 1] | r"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation symbol. This properly nested
occurrences of... | r"""Retrieves all the text between matching open and close parentheses. | [
"r",
"Retrieves",
"all",
"the",
"text",
"between",
"matching",
"open",
"and",
"close",
"parentheses",
"."
] | def _GetTextInside(text, start_pattern):
r"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation sy... | [
"def",
"_GetTextInside",
"(",
"text",
",",
"start_pattern",
")",
":",
"# TODO(sugawarayu): Audit cpplint.py to see what places could be profitably",
"# rewritten to use _GetTextInside (and use inferior regexp matching today).",
"# Give opening punctuations to get the matching close-punctuations.... | https://github.com/msracver/Deep-Image-Analogy/blob/632b9287b42552e32dad64922967c8c9ec7fc4d3/scripts/cpp_lint.py#L3752-L3805 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/lonely-pixel-ii.py | python | Solution2.findBlackPixel | (self, picture, N) | return sum(N * zip(row, cols).count(('B', N)) \
for row, cnt in lookup.iteritems() \
if cnt == N == row.count('B')) | :type picture: List[List[str]]
:type N: int
:rtype: int | :type picture: List[List[str]]
:type N: int
:rtype: int | [
":",
"type",
"picture",
":",
"List",
"[",
"List",
"[",
"str",
"]]",
":",
"type",
"N",
":",
"int",
":",
"rtype",
":",
"int"
] | def findBlackPixel(self, picture, N):
"""
:type picture: List[List[str]]
:type N: int
:rtype: int
"""
lookup = collections.Counter(map(tuple, picture))
cols = [col.count('B') for col in zip(*picture)]
return sum(N * zip(row, cols).count(('B', N)) \
... | [
"def",
"findBlackPixel",
"(",
"self",
",",
"picture",
",",
"N",
")",
":",
"lookup",
"=",
"collections",
".",
"Counter",
"(",
"map",
"(",
"tuple",
",",
"picture",
")",
")",
"cols",
"=",
"[",
"col",
".",
"count",
"(",
"'B'",
")",
"for",
"col",
"in",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/lonely-pixel-ii.py#L32-L42 | |
facebookresearch/faiss | eb8781557f556505ca93f6f21fff932e17f0d9e0 | contrib/client_server.py | python | run_index_server | (index: faiss.Index, port: int, v6: bool = False) | serve requests for that index forerver | serve requests for that index forerver | [
"serve",
"requests",
"for",
"that",
"index",
"forerver"
] | def run_index_server(index: faiss.Index, port: int, v6: bool = False):
""" serve requests for that index forerver """
rpc.run_server(
lambda s: SearchServer(s, index),
port, v6=v6) | [
"def",
"run_index_server",
"(",
"index",
":",
"faiss",
".",
"Index",
",",
"port",
":",
"int",
",",
"v6",
":",
"bool",
"=",
"False",
")",
":",
"rpc",
".",
"run_server",
"(",
"lambda",
"s",
":",
"SearchServer",
"(",
"s",
",",
"index",
")",
",",
"port... | https://github.com/facebookresearch/faiss/blob/eb8781557f556505ca93f6f21fff932e17f0d9e0/contrib/client_server.py#L37-L41 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | PageSetupDialogData.EnableOrientation | (*args, **kwargs) | return _windows_.PageSetupDialogData_EnableOrientation(*args, **kwargs) | EnableOrientation(self, bool flag) | EnableOrientation(self, bool flag) | [
"EnableOrientation",
"(",
"self",
"bool",
"flag",
")"
] | def EnableOrientation(*args, **kwargs):
"""EnableOrientation(self, bool flag)"""
return _windows_.PageSetupDialogData_EnableOrientation(*args, **kwargs) | [
"def",
"EnableOrientation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PageSetupDialogData_EnableOrientation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L4882-L4884 | |
lukasmonk/lucaschess | 13e2e5cb13b38a720ccf897af649054a64bcb914 | Code/Analisis.py | python | AnalizaPartida.grabaFNS | (self, fichero, fen) | Graba cada fen encontrado en el fichero "fichero" | Graba cada fen encontrado en el fichero "fichero" | [
"Graba",
"cada",
"fen",
"encontrado",
"en",
"el",
"fichero",
"fichero"
] | def grabaFNS(self, fichero, fen):
"""
Graba cada fen encontrado en el fichero "fichero"
"""
if not fichero:
return
f = open(fichero, "ab")
f.write("%s\r\n" % fen)
f.close()
self.procesador.entrenamientos.menu = None | [
"def",
"grabaFNS",
"(",
"self",
",",
"fichero",
",",
"fen",
")",
":",
"if",
"not",
"fichero",
":",
"return",
"f",
"=",
"open",
"(",
"fichero",
",",
"\"ab\"",
")",
"f",
".",
"write",
"(",
"\"%s\\r\\n\"",
"%",
"fen",
")",
"f",
".",
"close",
"(",
")... | https://github.com/lukasmonk/lucaschess/blob/13e2e5cb13b38a720ccf897af649054a64bcb914/Code/Analisis.py#L135-L145 | ||
deeplearningais/CUV | 4e920ad1304af9de3e5f755cc2e9c5c96e06c324 | examples/mlp/weight_layer.py | python | weight_layer.backward | (self, learnrate=0.01, decay=0.0) | Backward pass, calculates the deltas of lower layer and updates the
weights.
@param learnrate how strongly the gradient influences the weights
@param decay large values result in a regularization with
to the squared weight value | Backward pass, calculates the deltas of lower layer and updates the
weights. | [
"Backward",
"pass",
"calculates",
"the",
"deltas",
"of",
"lower",
"layer",
"and",
"updates",
"the",
"weights",
"."
] | def backward(self, learnrate=0.01, decay=0.0):
"""Backward pass, calculates the deltas of lower layer and updates the
weights.
@param learnrate how strongly the gradient influences the weights
@param decay large values result in a regularization with
... | [
"def",
"backward",
"(",
"self",
",",
"learnrate",
"=",
"0.01",
",",
"decay",
"=",
"0.0",
")",
":",
"cp",
".",
"prod",
"(",
"self",
".",
"source",
".",
"deltas",
",",
"self",
".",
"weight",
",",
"self",
".",
"target",
".",
"deltas",
",",
"'t'",
",... | https://github.com/deeplearningais/CUV/blob/4e920ad1304af9de3e5f755cc2e9c5c96e06c324/examples/mlp/weight_layer.py#L32-L51 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.