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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/eslint.py | python | get_eslint_from_cache | (dest_file, platform, arch) | Get ESLint binary from mongodb's cache. | Get ESLint binary from mongodb's cache. | [
"Get",
"ESLint",
"binary",
"from",
"mongodb",
"s",
"cache",
"."
] | def get_eslint_from_cache(dest_file, platform, arch):
"""Get ESLint binary from mongodb's cache."""
# Get URL
if platform == "Linux":
url = ESLINT_HTTP_LINUX_CACHE
elif platform == "Darwin":
url = ESLINT_HTTP_DARWIN_CACHE
else:
raise ValueError('ESLint is not available as a b... | [
"def",
"get_eslint_from_cache",
"(",
"dest_file",
",",
"platform",
",",
"arch",
")",
":",
"# Get URL",
"if",
"platform",
"==",
"\"Linux\"",
":",
"url",
"=",
"ESLINT_HTTP_LINUX_CACHE",
"elif",
"platform",
"==",
"\"Darwin\"",
":",
"url",
"=",
"ESLINT_HTTP_DARWIN_CAC... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/eslint.py#L79-L100 | ||
vtraag/leidenalg | b53366829360e10922a2dbf57eb405a516c23bc9 | setup.py | python | BuildConfiguration.print_build_info | (self) | Prints the include and library path being used for debugging purposes. | Prints the include and library path being used for debugging purposes. | [
"Prints",
"the",
"include",
"and",
"library",
"path",
"being",
"used",
"for",
"debugging",
"purposes",
"."
] | def print_build_info(self):
"""Prints the include and library path being used for debugging purposes."""
if self.static_extension == "only_igraph":
build_type = "dynamic extension with vendored igraph source"
elif self.static_extension:
build_type = "static extension"
... | [
"def",
"print_build_info",
"(",
"self",
")",
":",
"if",
"self",
".",
"static_extension",
"==",
"\"only_igraph\"",
":",
"build_type",
"=",
"\"dynamic extension with vendored igraph source\"",
"elif",
"self",
".",
"static_extension",
":",
"build_type",
"=",
"\"static exte... | https://github.com/vtraag/leidenalg/blob/b53366829360e10922a2dbf57eb405a516c23bc9/setup.py#L618-L637 | ||
fasiondog/hikyuu | 842751aa25283f9fdafc6f560ea262f79e67a307 | hikyuu/fetcher/proxy/proxy.py | python | request_with_local | (url) | return requests.get(url).text | 通过本机ip直接获取请求,访问失败将抛出异常 | 通过本机ip直接获取请求,访问失败将抛出异常 | [
"通过本机ip直接获取请求,访问失败将抛出异常"
] | def request_with_local(url):
"""通过本机ip直接获取请求,访问失败将抛出异常"""
return requests.get(url).text | [
"def",
"request_with_local",
"(",
"url",
")",
":",
"return",
"requests",
".",
"get",
"(",
"url",
")",
".",
"text"
] | https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/fetcher/proxy/proxy.py#L34-L36 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/examples/image_retraining/retrain.py | python | get_random_cached_bottlenecks | (sess, image_lists, how_many, category,
bottleneck_dir, image_dir, jpeg_data_tensor,
bottleneck_tensor) | return bottlenecks, ground_truths | Retrieves bottleneck values for cached images.
If no distortions are being applied, this function can retrieve the cached
bottleneck values directly from disk for images. It picks a random set of
images from the specified category.
Args:
sess: Current TensorFlow Session.
image_lists: Dictionary of tra... | Retrieves bottleneck values for cached images. | [
"Retrieves",
"bottleneck",
"values",
"for",
"cached",
"images",
"."
] | def get_random_cached_bottlenecks(sess, image_lists, how_many, category,
bottleneck_dir, image_dir, jpeg_data_tensor,
bottleneck_tensor):
"""Retrieves bottleneck values for cached images.
If no distortions are being applied, this function can retr... | [
"def",
"get_random_cached_bottlenecks",
"(",
"sess",
",",
"image_lists",
",",
"how_many",
",",
"category",
",",
"bottleneck_dir",
",",
"image_dir",
",",
"jpeg_data_tensor",
",",
"bottleneck_tensor",
")",
":",
"class_count",
"=",
"len",
"(",
"image_lists",
".",
"ke... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/examples/image_retraining/retrain.py#L462-L501 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/engine/training.py | python | Model.compile | (self,
optimizer,
loss,
metrics=None,
loss_weights=None,
sample_weight_mode=None,
**kwargs) | Configures the model for training.
Arguments:
optimizer: str (name of optimizer) or optimizer object.
See [optimizers](/optimizers).
loss: str (name of objective function) or objective function.
See [losses](/losses).
If the model has multiple outputs, you can us... | Configures the model for training. | [
"Configures",
"the",
"model",
"for",
"training",
"."
] | def compile(self,
optimizer,
loss,
metrics=None,
loss_weights=None,
sample_weight_mode=None,
**kwargs):
"""Configures the model for training.
Arguments:
optimizer: str (name of optimizer) or optimizer object.
... | [
"def",
"compile",
"(",
"self",
",",
"optimizer",
",",
"loss",
",",
"metrics",
"=",
"None",
",",
"loss_weights",
"=",
"None",
",",
"sample_weight_mode",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"loss",
"=",
"loss",
"or",
"{",
"}",
"self",
".",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/engine/training.py#L604-L914 | ||
Manu343726/siplasplas | 9fae7559f87087cf8ef34f04bd1e774b84b2ea9c | reference/cindex.py | python | Type.translation_unit | (self) | return self._tu | The TranslationUnit to which this Type is associated. | The TranslationUnit to which this Type is associated. | [
"The",
"TranslationUnit",
"to",
"which",
"this",
"Type",
"is",
"associated",
"."
] | def translation_unit(self):
"""The TranslationUnit to which this Type is associated."""
# If this triggers an AttributeError, the instance was not properly
# instantiated.
return self._tu | [
"def",
"translation_unit",
"(",
"self",
")",
":",
"# If this triggers an AttributeError, the instance was not properly",
"# instantiated.",
"return",
"self",
".",
"_tu"
] | https://github.com/Manu343726/siplasplas/blob/9fae7559f87087cf8ef34f04bd1e774b84b2ea9c/reference/cindex.py#L1828-L1832 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/device_utils.py | python | _ParseModeString | (mode_str) | return mode | Parse a mode string, e.g. 'drwxrwxrwx', into a st_mode value.
Effectively the reverse of |mode_to_string| in, e.g.:
https://github.com/landley/toybox/blob/master/lib/lib.c#L896 | Parse a mode string, e.g. 'drwxrwxrwx', into a st_mode value. | [
"Parse",
"a",
"mode",
"string",
"e",
".",
"g",
".",
"drwxrwxrwx",
"into",
"a",
"st_mode",
"value",
"."
] | def _ParseModeString(mode_str):
"""Parse a mode string, e.g. 'drwxrwxrwx', into a st_mode value.
Effectively the reverse of |mode_to_string| in, e.g.:
https://github.com/landley/toybox/blob/master/lib/lib.c#L896
"""
if not _FILE_MODE_RE.match(mode_str):
raise ValueError('Unexpected file mode %r', mode_st... | [
"def",
"_ParseModeString",
"(",
"mode_str",
")",
":",
"if",
"not",
"_FILE_MODE_RE",
".",
"match",
"(",
"mode_str",
")",
":",
"raise",
"ValueError",
"(",
"'Unexpected file mode %r'",
",",
"mode_str",
")",
"mode",
"=",
"_FILE_MODE_KIND",
"[",
"mode_str",
"[",
"0... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/device_utils.py#L193-L208 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/converters/onnx/_operators_nd.py | python | _convert_gru | (
builder, node, graph, err
) | convert to CoreML GRU Layer:
https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L3104 | convert to CoreML GRU Layer:
https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L3104 | [
"convert",
"to",
"CoreML",
"GRU",
"Layer",
":",
"https",
":",
"//",
"github",
".",
"com",
"/",
"apple",
"/",
"coremltools",
"/",
"blob",
"/",
"655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492",
"/",
"mlmodel",
"/",
"format",
"/",
"NeuralNetwork",
".",
"proto#L3104"
] | def _convert_gru(
builder, node, graph, err
): # type: (NeuralNetworkBuilder, Node, Graph, ErrorHandling) -> None
"""
convert to CoreML GRU Layer:
https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L3104
"""
def get_weights(W, ... | [
"def",
"_convert_gru",
"(",
"builder",
",",
"node",
",",
"graph",
",",
"err",
")",
":",
"# type: (NeuralNetworkBuilder, Node, Graph, ErrorHandling) -> None",
"def",
"get_weights",
"(",
"W",
",",
"W_name",
",",
"R",
",",
"R_name",
",",
"B",
")",
":",
"\"\"\"\n ... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/onnx/_operators_nd.py#L899-L1118 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tix.py | python | tixCommand.tix_resetoptions | (self, newScheme, newFontSet, newScmPrio=None) | Resets the scheme and fontset of the Tix application to
newScheme and newFontSet, respectively. This affects only those
widgets created after this call. Therefore, it is best to call the
resetoptions command before the creation of any widgets in a Tix
application.
The optional ... | Resets the scheme and fontset of the Tix application to
newScheme and newFontSet, respectively. This affects only those
widgets created after this call. Therefore, it is best to call the
resetoptions command before the creation of any widgets in a Tix
application. | [
"Resets",
"the",
"scheme",
"and",
"fontset",
"of",
"the",
"Tix",
"application",
"to",
"newScheme",
"and",
"newFontSet",
"respectively",
".",
"This",
"affects",
"only",
"those",
"widgets",
"created",
"after",
"this",
"call",
".",
"Therefore",
"it",
"is",
"best"... | def tix_resetoptions(self, newScheme, newFontSet, newScmPrio=None):
"""Resets the scheme and fontset of the Tix application to
newScheme and newFontSet, respectively. This affects only those
widgets created after this call. Therefore, it is best to call the
resetoptions command before t... | [
"def",
"tix_resetoptions",
"(",
"self",
",",
"newScheme",
",",
"newFontSet",
",",
"newScmPrio",
"=",
"None",
")",
":",
"if",
"newScmPrio",
"is",
"not",
"None",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"'tix'",
",",
"'resetoptions'",
",",
"newS... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tix.py#L183-L201 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py2/jinja2/meta.py | python | find_undeclared_variables | (ast) | return codegen.undeclared_identifiers | Returns a set of all variables in the AST that will be looked up from
the context at runtime. Because at compile time it's not known which
variables will be used depending on the path the execution takes at
runtime, all variables are returned.
>>> from jinja2 import Environment, meta
>>> env = Env... | Returns a set of all variables in the AST that will be looked up from
the context at runtime. Because at compile time it's not known which
variables will be used depending on the path the execution takes at
runtime, all variables are returned. | [
"Returns",
"a",
"set",
"of",
"all",
"variables",
"in",
"the",
"AST",
"that",
"will",
"be",
"looked",
"up",
"from",
"the",
"context",
"at",
"runtime",
".",
"Because",
"at",
"compile",
"time",
"it",
"s",
"not",
"known",
"which",
"variables",
"will",
"be",
... | def find_undeclared_variables(ast):
"""Returns a set of all variables in the AST that will be looked up from
the context at runtime. Because at compile time it's not known which
variables will be used depending on the path the execution takes at
runtime, all variables are returned.
>>> from jinja2... | [
"def",
"find_undeclared_variables",
"(",
"ast",
")",
":",
"codegen",
"=",
"TrackingCodeGenerator",
"(",
"ast",
".",
"environment",
")",
"codegen",
".",
"visit",
"(",
"ast",
")",
"return",
"codegen",
".",
"undeclared_identifiers"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py2/jinja2/meta.py#L29-L50 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/resource_variable_ops.py | python | BaseResourceVariable._assign_dependencies | (self) | Makes assignments depend on the cached value, if any.
This prevents undefined behavior with reads not ordered wrt writes.
Yields:
None. | Makes assignments depend on the cached value, if any. | [
"Makes",
"assignments",
"depend",
"on",
"the",
"cached",
"value",
"if",
"any",
"."
] | def _assign_dependencies(self):
"""Makes assignments depend on the cached value, if any.
This prevents undefined behavior with reads not ordered wrt writes.
Yields:
None.
"""
if self._cached_value is not None:
with ops.control_dependencies([self._cached_value]):
yield
else:... | [
"def",
"_assign_dependencies",
"(",
"self",
")",
":",
"if",
"self",
".",
"_cached_value",
"is",
"not",
"None",
":",
"with",
"ops",
".",
"control_dependencies",
"(",
"[",
"self",
".",
"_cached_value",
"]",
")",
":",
"yield",
"else",
":",
"yield"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/resource_variable_ops.py#L497-L509 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pydoc.py | python | Helper.getline | (self, prompt) | Read one line, using input() when appropriate. | Read one line, using input() when appropriate. | [
"Read",
"one",
"line",
"using",
"input",
"()",
"when",
"appropriate",
"."
] | def getline(self, prompt):
"""Read one line, using input() when appropriate."""
if self.input is sys.stdin:
return input(prompt)
else:
self.output.write(prompt)
self.output.flush()
return self.input.readline() | [
"def",
"getline",
"(",
"self",
",",
"prompt",
")",
":",
"if",
"self",
".",
"input",
"is",
"sys",
".",
"stdin",
":",
"return",
"input",
"(",
"prompt",
")",
"else",
":",
"self",
".",
"output",
".",
"write",
"(",
"prompt",
")",
"self",
".",
"output",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pydoc.py#L1924-L1931 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/combo.py | python | BitmapComboBox.Insert | (*args, **kwargs) | return _combo.BitmapComboBox_Insert(*args, **kwargs) | Insert(self, String item, Bitmap bitmap, int pos, PyObject clientData=None) -> int
Insert an item into the control before the item at the ``pos`` index,
optionally associating some data object with the item. | Insert(self, String item, Bitmap bitmap, int pos, PyObject clientData=None) -> int | [
"Insert",
"(",
"self",
"String",
"item",
"Bitmap",
"bitmap",
"int",
"pos",
"PyObject",
"clientData",
"=",
"None",
")",
"-",
">",
"int"
] | def Insert(*args, **kwargs):
"""
Insert(self, String item, Bitmap bitmap, int pos, PyObject clientData=None) -> int
Insert an item into the control before the item at the ``pos`` index,
optionally associating some data object with the item.
"""
return _combo.BitmapComboB... | [
"def",
"Insert",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_combo",
".",
"BitmapComboBox_Insert",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/combo.py#L989-L996 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PropertyGrid.GetImageSize | (*args, **kwargs) | return _propgrid.PropertyGrid_GetImageSize(*args, **kwargs) | GetImageSize(self, PGProperty p=None, int item=-1) -> Size | GetImageSize(self, PGProperty p=None, int item=-1) -> Size | [
"GetImageSize",
"(",
"self",
"PGProperty",
"p",
"=",
"None",
"int",
"item",
"=",
"-",
"1",
")",
"-",
">",
"Size"
] | def GetImageSize(*args, **kwargs):
"""GetImageSize(self, PGProperty p=None, int item=-1) -> Size"""
return _propgrid.PropertyGrid_GetImageSize(*args, **kwargs) | [
"def",
"GetImageSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_GetImageSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L2091-L2093 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/locations.py | python | write_delete_marker_file | (directory) | Write the pip delete marker file into this directory. | Write the pip delete marker file into this directory. | [
"Write",
"the",
"pip",
"delete",
"marker",
"file",
"into",
"this",
"directory",
"."
] | def write_delete_marker_file(directory):
"""
Write the pip delete marker file into this directory.
"""
filepath = os.path.join(directory, PIP_DELETE_MARKER_FILENAME)
with open(filepath, 'w') as marker_fp:
marker_fp.write(DELETE_MARKER_MESSAGE) | [
"def",
"write_delete_marker_file",
"(",
"directory",
")",
":",
"filepath",
"=",
"os",
".",
"path",
".",
"join",
"(",
"directory",
",",
"PIP_DELETE_MARKER_FILENAME",
")",
"with",
"open",
"(",
"filepath",
",",
"'w'",
")",
"as",
"marker_fp",
":",
"marker_fp",
"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/locations.py#L63-L69 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | llvm/utils/sort_includes.py | python | sort_includes | (f) | Sort the #include lines of a specific file. | Sort the #include lines of a specific file. | [
"Sort",
"the",
"#include",
"lines",
"of",
"a",
"specific",
"file",
"."
] | def sort_includes(f):
"""Sort the #include lines of a specific file."""
# Skip files which are under INPUTS trees or test trees.
if 'INPUTS/' in f.name or 'test/' in f.name:
return
ext = os.path.splitext(f.name)[1]
if ext not in ['.cpp', '.c', '.h', '.inc', '.def']:
return
lines = f.readlines()
... | [
"def",
"sort_includes",
"(",
"f",
")",
":",
"# Skip files which are under INPUTS trees or test trees.",
"if",
"'INPUTS/'",
"in",
"f",
".",
"name",
"or",
"'test/'",
"in",
"f",
".",
"name",
":",
"return",
"ext",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"f... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/llvm/utils/sort_includes.py#L14-L82 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Tools/bgen/bgen/bgenOutput.py | python | OutHeader2 | (text) | Output a level 2 header comment (uses '-' dashes). | Output a level 2 header comment (uses '-' dashes). | [
"Output",
"a",
"level",
"2",
"header",
"comment",
"(",
"uses",
"-",
"dashes",
")",
"."
] | def OutHeader2(text):
"""Output a level 2 header comment (uses '-' dashes)."""
OutHeader(text, "-") | [
"def",
"OutHeader2",
"(",
"text",
")",
":",
"OutHeader",
"(",
"text",
",",
"\"-\"",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Tools/bgen/bgen/bgenOutput.py#L140-L142 | ||
OpenArkStudio/ARK | a7f8413dd416cd1ac5b12adbdd84f010f59f11e2 | build/tools/config_tool/config_xml.py | python | get_node_by_keyvalue | (nodelist, kv_map) | return result_nodes | find all nodes that match the key-value
nodelist: node list
kv_map: property map
return: all matched nodes | find all nodes that match the key-value
nodelist: node list
kv_map: property map
return: all matched nodes | [
"find",
"all",
"nodes",
"that",
"match",
"the",
"key",
"-",
"value",
"nodelist",
":",
"node",
"list",
"kv_map",
":",
"property",
"map",
"return",
":",
"all",
"matched",
"nodes"
] | def get_node_by_keyvalue(nodelist, kv_map):
'''
find all nodes that match the key-value
nodelist: node list
kv_map: property map
return: all matched nodes
'''
result_nodes = []
for node in nodelist:
if if_match(node, kv_map):
result_nodes.append(node)
return resul... | [
"def",
"get_node_by_keyvalue",
"(",
"nodelist",
",",
"kv_map",
")",
":",
"result_nodes",
"=",
"[",
"]",
"for",
"node",
"in",
"nodelist",
":",
"if",
"if_match",
"(",
"node",
",",
"kv_map",
")",
":",
"result_nodes",
".",
"append",
"(",
"node",
")",
"return... | https://github.com/OpenArkStudio/ARK/blob/a7f8413dd416cd1ac5b12adbdd84f010f59f11e2/build/tools/config_tool/config_xml.py#L56-L67 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | PageSetupDialogData.EnablePrinter | (*args, **kwargs) | return _windows_.PageSetupDialogData_EnablePrinter(*args, **kwargs) | EnablePrinter(self, bool flag) | EnablePrinter(self, bool flag) | [
"EnablePrinter",
"(",
"self",
"bool",
"flag",
")"
] | def EnablePrinter(*args, **kwargs):
"""EnablePrinter(self, bool flag)"""
return _windows_.PageSetupDialogData_EnablePrinter(*args, **kwargs) | [
"def",
"EnablePrinter",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PageSetupDialogData_EnablePrinter",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L4890-L4892 | |
kismetwireless/kismet | a7c0dc270c960fb1f58bd9cec4601c201885fd4e | capture_bt_geiger/KismetCaptureBtGeiger/kismetexternal/__init__.py | python | ExternalInterface.publish_event | (self, event, content_json) | Publish an event on the eventbus; see the docs for additional info and
limitations on events coming from the external api eventbus interface.
:param event: Event type UTF-8 string; should not collide with internal Kismet
eventbus events.
:param content_json: UTF-8 string JSON content of... | Publish an event on the eventbus; see the docs for additional info and
limitations on events coming from the external api eventbus interface. | [
"Publish",
"an",
"event",
"on",
"the",
"eventbus",
";",
"see",
"the",
"docs",
"for",
"additional",
"info",
"and",
"limitations",
"on",
"events",
"coming",
"from",
"the",
"external",
"api",
"eventbus",
"interface",
"."
] | def publish_event(self, event, content_json):
"""
Publish an event on the eventbus; see the docs for additional info and
limitations on events coming from the external api eventbus interface.
:param event: Event type UTF-8 string; should not collide with internal Kismet
eventbus... | [
"def",
"publish_event",
"(",
"self",
",",
"event",
",",
"content_json",
")",
":",
"pubevt",
"=",
"eventbus_pb2",
".",
"EventbusPublishEvent",
"(",
")",
"pubevt",
".",
"event_type",
"=",
"event",
"pubevt",
".",
"event_content_json",
"=",
"content_json",
"self",
... | https://github.com/kismetwireless/kismet/blob/a7c0dc270c960fb1f58bd9cec4601c201885fd4e/capture_bt_geiger/KismetCaptureBtGeiger/kismetexternal/__init__.py#L487-L502 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang/tools/scan-build-py/libscanbuild/analyze.py | python | filter_debug_flags | (opts, continuation=dispatch_ctu) | return continuation(opts) | Filter out nondebug macros when requested. | Filter out nondebug macros when requested. | [
"Filter",
"out",
"nondebug",
"macros",
"when",
"requested",
"."
] | def filter_debug_flags(opts, continuation=dispatch_ctu):
""" Filter out nondebug macros when requested. """
if opts.pop('force_debug'):
# lazy implementation just append an undefine macro at the end
opts.update({'flags': opts['flags'] + ['-UNDEBUG']})
return continuation(opts) | [
"def",
"filter_debug_flags",
"(",
"opts",
",",
"continuation",
"=",
"dispatch_ctu",
")",
":",
"if",
"opts",
".",
"pop",
"(",
"'force_debug'",
")",
":",
"# lazy implementation just append an undefine macro at the end",
"opts",
".",
"update",
"(",
"{",
"'flags'",
":",... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/tools/scan-build-py/libscanbuild/analyze.py#L667-L674 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetCompilerPdbName | (self, config, expand_special) | return pdbname | Get the pdb file name that should be used for compiler invocations, or
None if there's no explicit name specified. | Get the pdb file name that should be used for compiler invocations, or
None if there's no explicit name specified. | [
"Get",
"the",
"pdb",
"file",
"name",
"that",
"should",
"be",
"used",
"for",
"compiler",
"invocations",
"or",
"None",
"if",
"there",
"s",
"no",
"explicit",
"name",
"specified",
"."
] | def GetCompilerPdbName(self, config, expand_special):
"""Get the pdb file name that should be used for compiler invocations, or
None if there's no explicit name specified."""
config = self._TargetConfig(config)
pdbname = self._Setting(
('VCCLCompilerTool', 'ProgramDataBaseFileName'), config)
... | [
"def",
"GetCompilerPdbName",
"(",
"self",
",",
"config",
",",
"expand_special",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"pdbname",
"=",
"self",
".",
"_Setting",
"(",
"(",
"'VCCLCompilerTool'",
",",
"'ProgramDataBaseFileName'",
... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/msvs_emulation.py#L363-L371 | |
qboticslabs/mastering_ros | d83e78f30acc45b0f18522c1d5fae3a7f52974b9 | chapter_10_codes/seven_dof_arm_gazebo/scripts/pick_and_place_working_1.py | python | CokeCanPickAndPlace._create_pickup_goal | (self, group, target, grasps) | return goal | Create a MoveIt! PickupGoal | Create a MoveIt! PickupGoal | [
"Create",
"a",
"MoveIt!",
"PickupGoal"
] | def _create_pickup_goal(self, group, target, grasps):
"""
Create a MoveIt! PickupGoal
"""
# Create goal:
goal = PickupGoal()
goal.group_name = group
goal.target_name = target
goal.possible_grasps.extend(grasps)
goal.allowed_touch_objects.appen... | [
"def",
"_create_pickup_goal",
"(",
"self",
",",
"group",
",",
"target",
",",
"grasps",
")",
":",
"# Create goal:",
"goal",
"=",
"PickupGoal",
"(",
")",
"goal",
".",
"group_name",
"=",
"group",
"goal",
".",
"target_name",
"=",
"target",
"goal",
".",
"possib... | https://github.com/qboticslabs/mastering_ros/blob/d83e78f30acc45b0f18522c1d5fae3a7f52974b9/chapter_10_codes/seven_dof_arm_gazebo/scripts/pick_and_place_working_1.py#L245-L271 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/virtualenv/virtualenv.py | python | fixup_pth_and_egg_link | (home_dir, sys_path=None) | Makes .pth and .egg-link files use relative paths | Makes .pth and .egg-link files use relative paths | [
"Makes",
".",
"pth",
"and",
".",
"egg",
"-",
"link",
"files",
"use",
"relative",
"paths"
] | def fixup_pth_and_egg_link(home_dir, sys_path=None):
"""Makes .pth and .egg-link files use relative paths"""
home_dir = os.path.normcase(os.path.abspath(home_dir))
if sys_path is None:
sys_path = sys.path
for path in sys_path:
if not path:
path = '.'
if not os.path.is... | [
"def",
"fixup_pth_and_egg_link",
"(",
"home_dir",
",",
"sys_path",
"=",
"None",
")",
":",
"home_dir",
"=",
"os",
".",
"path",
".",
"normcase",
"(",
"os",
".",
"path",
".",
"abspath",
"(",
"home_dir",
")",
")",
"if",
"sys_path",
"is",
"None",
":",
"sys_... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/virtualenv/virtualenv.py#L1685-L1710 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PropertyGridInterface.GetPropertyHelpString | (*args, **kwargs) | return _propgrid.PropertyGridInterface_GetPropertyHelpString(*args, **kwargs) | GetPropertyHelpString(self, PGPropArg id) -> String | GetPropertyHelpString(self, PGPropArg id) -> String | [
"GetPropertyHelpString",
"(",
"self",
"PGPropArg",
"id",
")",
"-",
">",
"String"
] | def GetPropertyHelpString(*args, **kwargs):
"""GetPropertyHelpString(self, PGPropArg id) -> String"""
return _propgrid.PropertyGridInterface_GetPropertyHelpString(*args, **kwargs) | [
"def",
"GetPropertyHelpString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_GetPropertyHelpString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L1221-L1223 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/pymcuprog/configgenerator.py | python | ConfigGenerator._add_register | (self, name, value) | return reg | Shortcut to add a register into the XML
:param name: <register name="xxx">
:param value: <register value="xxx"> | Shortcut to add a register into the XML
:param name: <register name="xxx">
:param value: <register value="xxx"> | [
"Shortcut",
"to",
"add",
"a",
"register",
"into",
"the",
"XML",
":",
"param",
"name",
":",
"<register",
"name",
"=",
"xxx",
">",
":",
"param",
"value",
":",
"<register",
"value",
"=",
"xxx",
">"
] | def _add_register(self, name, value):
"""
Shortcut to add a register into the XML
:param name: <register name="xxx">
:param value: <register value="xxx">
"""
reg = ETree.Element("register")
reg.attrib["name"] = name
reg.attrib["value"] = value
retu... | [
"def",
"_add_register",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"reg",
"=",
"ETree",
".",
"Element",
"(",
"\"register\"",
")",
"reg",
".",
"attrib",
"[",
"\"name\"",
"]",
"=",
"name",
"reg",
".",
"attrib",
"[",
"\"value\"",
"]",
"=",
"value... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pymcuprog/configgenerator.py#L148-L157 | |
danxuhk/ContinuousCRF-CNN | 2b6dcaf179620f118b225ed12c890414ca828e21 | scripts/cpp_lint.py | python | _CppLintState.SetCountingStyle | (self, counting_style) | Sets the module's counting options. | Sets the module's counting options. | [
"Sets",
"the",
"module",
"s",
"counting",
"options",
"."
] | def SetCountingStyle(self, counting_style):
"""Sets the module's counting options."""
self.counting = counting_style | [
"def",
"SetCountingStyle",
"(",
"self",
",",
"counting_style",
")",
":",
"self",
".",
"counting",
"=",
"counting_style"
] | https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/scripts/cpp_lint.py#L717-L719 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/training/saver.py | python | _add_collection_def | (meta_graph_def, key) | Adds a collection to MetaGraphDef protocol buffer.
Args:
meta_graph_def: MetaGraphDef protocol buffer.
key: One of the GraphKeys or user-defined string. | Adds a collection to MetaGraphDef protocol buffer. | [
"Adds",
"a",
"collection",
"to",
"MetaGraphDef",
"protocol",
"buffer",
"."
] | def _add_collection_def(meta_graph_def, key):
"""Adds a collection to MetaGraphDef protocol buffer.
Args:
meta_graph_def: MetaGraphDef protocol buffer.
key: One of the GraphKeys or user-defined string.
"""
if not isinstance(key, six.string_types) and not isinstance(key, bytes):
logging.warning("Onl... | [
"def",
"_add_collection_def",
"(",
"meta_graph_def",
",",
"key",
")",
":",
"if",
"not",
"isinstance",
"(",
"key",
",",
"six",
".",
"string_types",
")",
"and",
"not",
"isinstance",
"(",
"key",
",",
"bytes",
")",
":",
"logging",
".",
"warning",
"(",
"\"Onl... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/training/saver.py#L1188-L1231 | ||
ucb-bar/esp-llvm | 8aec2ae754fd66d4e73b9b777a9f20c4583a0f03 | examples/Kaleidoscope/MCJIT/lazy/genk-timing.py | python | KScriptGenerator.setCallWeighting | (self, weight) | Sets the probably of generating a function call | Sets the probably of generating a function call | [
"Sets",
"the",
"probably",
"of",
"generating",
"a",
"function",
"call"
] | def setCallWeighting(self, weight):
""" Sets the probably of generating a function call"""
self.callWeighting = weight | [
"def",
"setCallWeighting",
"(",
"self",
",",
"weight",
")",
":",
"self",
".",
"callWeighting",
"=",
"weight"
] | https://github.com/ucb-bar/esp-llvm/blob/8aec2ae754fd66d4e73b9b777a9f20c4583a0f03/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py#L80-L82 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/_trustregion_constr/qp_subproblem.py | python | reinforce_box_boundaries | (x, lb, ub) | return np.minimum(np.maximum(x, lb), ub) | Return clipped value of x | Return clipped value of x | [
"Return",
"clipped",
"value",
"of",
"x"
] | def reinforce_box_boundaries(x, lb, ub):
"""Return clipped value of x"""
return np.minimum(np.maximum(x, lb), ub) | [
"def",
"reinforce_box_boundaries",
"(",
"x",
",",
"lb",
",",
"ub",
")",
":",
"return",
"np",
".",
"minimum",
"(",
"np",
".",
"maximum",
"(",
"x",
",",
"lb",
")",
",",
"ub",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/_trustregion_constr/qp_subproblem.py#L311-L313 | |
eric612/MobileNet-YOLO | 69b4441cb3ec8d553fbdef788ad033e246f901bd | scripts/cpp_lint.py | python | CheckAltTokens | (filename, clean_lines, linenum, error) | Check alternative keywords being used in boolean expressions.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Check alternative keywords being used in boolean expressions. | [
"Check",
"alternative",
"keywords",
"being",
"used",
"in",
"boolean",
"expressions",
"."
] | def CheckAltTokens(filename, clean_lines, linenum, error):
"""Check alternative keywords being used in boolean expressions.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call ... | [
"def",
"CheckAltTokens",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Avoid preprocessor lines",
"if",
"Match",
"(",
"r'^\\s*#'",
",",
"line",
")",
":",
"retur... | https://github.com/eric612/MobileNet-YOLO/blob/69b4441cb3ec8d553fbdef788ad033e246f901bd/scripts/cpp_lint.py#L3409-L3438 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/osr.py | python | SpatialReference.ExportToUSGS | (self, *args) | return _osr.SpatialReference_ExportToUSGS(self, *args) | r"""ExportToUSGS(SpatialReference self) -> OGRErr | r"""ExportToUSGS(SpatialReference self) -> OGRErr | [
"r",
"ExportToUSGS",
"(",
"SpatialReference",
"self",
")",
"-",
">",
"OGRErr"
] | def ExportToUSGS(self, *args):
r"""ExportToUSGS(SpatialReference self) -> OGRErr"""
return _osr.SpatialReference_ExportToUSGS(self, *args) | [
"def",
"ExportToUSGS",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_osr",
".",
"SpatialReference_ExportToUSGS",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/osr.py#L822-L824 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | python | PBXGroup.TakeOverOnlyChild | (self, recurse=False) | If this PBXGroup has only one child and it's also a PBXGroup, take
it over by making all of its children this object's children.
This function will continue to take over only children when those children
are groups. If there are three PBXGroups representing a, b, and c, with
c inside b and b inside a,... | If this PBXGroup has only one child and it's also a PBXGroup, take
it over by making all of its children this object's children. | [
"If",
"this",
"PBXGroup",
"has",
"only",
"one",
"child",
"and",
"it",
"s",
"also",
"a",
"PBXGroup",
"take",
"it",
"over",
"by",
"making",
"all",
"of",
"its",
"children",
"this",
"object",
"s",
"children",
"."
] | def TakeOverOnlyChild(self, recurse=False):
"""If this PBXGroup has only one child and it's also a PBXGroup, take
it over by making all of its children this object's children.
This function will continue to take over only children when those children
are groups. If there are three PBXGroups repres... | [
"def",
"TakeOverOnlyChild",
"(",
"self",
",",
"recurse",
"=",
"False",
")",
":",
"# At this stage, check that child class types are PBXGroup exactly,",
"# instead of using isinstance. The only subclass of PBXGroup,",
"# PBXVariantGroup, should not participate in reparenting in the same way:... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py#L1408-L1486 | ||
google/mysql-protobuf | 467cda676afaa49e762c5c9164a43f6ad31a1fbf | protobuf/python/google/protobuf/internal/decoder.py | python | _RaiseInvalidWireType | (buffer, pos, end) | Skip function for unknown wire types. Raises an exception. | Skip function for unknown wire types. Raises an exception. | [
"Skip",
"function",
"for",
"unknown",
"wire",
"types",
".",
"Raises",
"an",
"exception",
"."
] | def _RaiseInvalidWireType(buffer, pos, end):
"""Skip function for unknown wire types. Raises an exception."""
raise _DecodeError('Tag had invalid wire type.') | [
"def",
"_RaiseInvalidWireType",
"(",
"buffer",
",",
"pos",
",",
"end",
")",
":",
"raise",
"_DecodeError",
"(",
"'Tag had invalid wire type.'",
")"
] | https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/google/protobuf/internal/decoder.py#L835-L838 | ||
digibyte/digibyte | 0b8a04fb06d5470a15168e2f675aec57bcc24dac | contrib/devtools/security-check.py | python | get_ELF_program_headers | (executable) | return headers | Return type and flags for ELF program headers | Return type and flags for ELF program headers | [
"Return",
"type",
"and",
"flags",
"for",
"ELF",
"program",
"headers"
] | def get_ELF_program_headers(executable):
'''Return type and flags for ELF program headers'''
p = subprocess.Popen([READELF_CMD, '-l', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True)
(stdout, stderr) = p.communicate()
if p.returncode:
... | [
"def",
"get_ELF_program_headers",
"(",
"executable",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"READELF_CMD",
",",
"'-l'",
",",
"'-W'",
",",
"executable",
"]",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"stderr",
"=",
"subprocess",... | https://github.com/digibyte/digibyte/blob/0b8a04fb06d5470a15168e2f675aec57bcc24dac/contrib/devtools/security-check.py#L35-L62 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/textwrap.py | python | dedent | (text) | return text | Remove any common leading whitespace from every line in `text`.
This can be used to make triple-quoted strings line up with the left
edge of the display, while still presenting them in the source code
in indented form.
Note that tabs and spaces are both treated as whitespace, but they
are not equa... | Remove any common leading whitespace from every line in `text`. | [
"Remove",
"any",
"common",
"leading",
"whitespace",
"from",
"every",
"line",
"in",
"text",
"."
] | def dedent(text):
"""Remove any common leading whitespace from every line in `text`.
This can be used to make triple-quoted strings line up with the left
edge of the display, while still presenting them in the source code
in indented form.
Note that tabs and spaces are both treated as whitespace, ... | [
"def",
"dedent",
"(",
"text",
")",
":",
"# Look for the longest leading string of spaces and tabs common to",
"# all lines.",
"margin",
"=",
"None",
"text",
"=",
"_whitespace_only_re",
".",
"sub",
"(",
"''",
",",
"text",
")",
"indents",
"=",
"_leading_whitespace_re",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/textwrap.py#L366-L412 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.DocumentStartExtend | (*args, **kwargs) | return _stc.StyledTextCtrl_DocumentStartExtend(*args, **kwargs) | DocumentStartExtend(self)
Move caret to first position in document extending selection to new caret position. | DocumentStartExtend(self) | [
"DocumentStartExtend",
"(",
"self",
")"
] | def DocumentStartExtend(*args, **kwargs):
"""
DocumentStartExtend(self)
Move caret to first position in document extending selection to new caret position.
"""
return _stc.StyledTextCtrl_DocumentStartExtend(*args, **kwargs) | [
"def",
"DocumentStartExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_DocumentStartExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L4464-L4470 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/front/tf/ObjectDetectionAPI.py | python | ObjectDetectionAPIProposalReplacement.insert_detection_output_instead_of_proposal | (graph: Graph, match: SubgraphMatch,
pipeline_config: PipelineConfig) | return {'proposal_node': ObjectDetectionAPIProposalReplacement.ie_to_tf_proposals(graph, proposal_node, match,
pipeline_config,
max_proposal... | The function inserts DetectionOutput operation instead of Proposal operation which may result in an increase of
the accuracy for some models. The function is enabled with the custom attribute "operation_to_insert" with
value "DetectionOutput" in the transformation configuration file section for the
... | The function inserts DetectionOutput operation instead of Proposal operation which may result in an increase of
the accuracy for some models. The function is enabled with the custom attribute "operation_to_insert" with
value "DetectionOutput" in the transformation configuration file section for the
... | [
"The",
"function",
"inserts",
"DetectionOutput",
"operation",
"instead",
"of",
"Proposal",
"operation",
"which",
"may",
"result",
"in",
"an",
"increase",
"of",
"the",
"accuracy",
"for",
"some",
"models",
".",
"The",
"function",
"is",
"enabled",
"with",
"the",
... | def insert_detection_output_instead_of_proposal(graph: Graph, match: SubgraphMatch,
pipeline_config: PipelineConfig):
"""
The function inserts DetectionOutput operation instead of Proposal operation which may result in an increase of
the accura... | [
"def",
"insert_detection_output_instead_of_proposal",
"(",
"graph",
":",
"Graph",
",",
"match",
":",
"SubgraphMatch",
",",
"pipeline_config",
":",
"PipelineConfig",
")",
":",
"max_proposals",
"=",
"_value_or_raise",
"(",
"match",
",",
"pipeline_config",
",",
"'first_s... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/front/tf/ObjectDetectionAPI.py#L1364-L1492 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/lib2to3/pgen2/parse.py | python | Parser.push | (self, type, newdfa, newstate, context) | Push a nonterminal. (Internal) | Push a nonterminal. (Internal) | [
"Push",
"a",
"nonterminal",
".",
"(",
"Internal",
")"
] | def push(self, type, newdfa, newstate, context):
"""Push a nonterminal. (Internal)"""
dfa, state, node = self.stack[-1]
newnode = (type, None, context, [])
self.stack[-1] = (dfa, newstate, node)
self.stack.append((newdfa, 0, newnode)) | [
"def",
"push",
"(",
"self",
",",
"type",
",",
"newdfa",
",",
"newstate",
",",
"context",
")",
":",
"dfa",
",",
"state",
",",
"node",
"=",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
"newnode",
"=",
"(",
"type",
",",
"None",
",",
"context",
",",
"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/lib2to3/pgen2/parse.py#L184-L189 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/jinja2/compiler.py | python | CodeGenerator.pull_locals | (self, frame) | Pull all the references identifiers into the local scope. | Pull all the references identifiers into the local scope. | [
"Pull",
"all",
"the",
"references",
"identifiers",
"into",
"the",
"local",
"scope",
"."
] | def pull_locals(self, frame):
"""Pull all the references identifiers into the local scope."""
for name in frame.identifiers.undeclared:
self.writeline('l_%s = context.resolve(%r)' % (name, name)) | [
"def",
"pull_locals",
"(",
"self",
",",
"frame",
")",
":",
"for",
"name",
"in",
"frame",
".",
"identifiers",
".",
"undeclared",
":",
"self",
".",
"writeline",
"(",
"'l_%s = context.resolve(%r)'",
"%",
"(",
"name",
",",
"name",
")",
")"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/compiler.py#L574-L577 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | Dataset.AddFieldDomain | (self, *args) | return _gdal.Dataset_AddFieldDomain(self, *args) | r"""AddFieldDomain(Dataset self, FieldDomain fieldDomain) -> bool | r"""AddFieldDomain(Dataset self, FieldDomain fieldDomain) -> bool | [
"r",
"AddFieldDomain",
"(",
"Dataset",
"self",
"FieldDomain",
"fieldDomain",
")",
"-",
">",
"bool"
] | def AddFieldDomain(self, *args):
r"""AddFieldDomain(Dataset self, FieldDomain fieldDomain) -> bool"""
return _gdal.Dataset_AddFieldDomain(self, *args) | [
"def",
"AddFieldDomain",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_gdal",
".",
"Dataset_AddFieldDomain",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L2325-L2327 | |
nnrg/opennero | 43e12a1bcba6e228639db3886fec1dc47ddc24cb | mods/Maze/client.py | python | pauseAgent | (ui) | return closure | return a function that pauses and continues the agent | return a function that pauses and continues the agent | [
"return",
"a",
"function",
"that",
"pauses",
"and",
"continues",
"the",
"agent"
] | def pauseAgent(ui):
""" return a function that pauses and continues the agent """
def closure():
"""pauses and continues the agent"""
if ui.pauseAgentButton.text == 'Continue':
ui.pauseAgentButton.text = 'Pause'
enable_ai()
else:
ui.pauseAgentButton.te... | [
"def",
"pauseAgent",
"(",
"ui",
")",
":",
"def",
"closure",
"(",
")",
":",
"\"\"\"pauses and continues the agent\"\"\"",
"if",
"ui",
".",
"pauseAgentButton",
".",
"text",
"==",
"'Continue'",
":",
"ui",
".",
"pauseAgentButton",
".",
"text",
"=",
"'Pause'",
"ena... | https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/Maze/client.py#L211-L221 | |
nileshkulkarni/csm | 0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc | csm/utils/transformations.py | python | vector_product | (v0, v1, axis=0) | return numpy.cross(v0, v1, axis=axis) | Return vector perpendicular to vectors.
>>> v = vector_product([2, 0, 0], [0, 3, 0])
>>> numpy.allclose(v, [0, 0, 6])
True
>>> v0 = [[2, 0, 0, 2], [0, 2, 0, 2], [0, 0, 2, 2]]
>>> v1 = [[3], [0], [0]]
>>> v = vector_product(v0, v1)
>>> numpy.allclose(v, [[0, 0, 0, 0], [0, 0, 6, 6], [0, -6, 0... | Return vector perpendicular to vectors. | [
"Return",
"vector",
"perpendicular",
"to",
"vectors",
"."
] | def vector_product(v0, v1, axis=0):
"""Return vector perpendicular to vectors.
>>> v = vector_product([2, 0, 0], [0, 3, 0])
>>> numpy.allclose(v, [0, 0, 6])
True
>>> v0 = [[2, 0, 0, 2], [0, 2, 0, 2], [0, 0, 2, 2]]
>>> v1 = [[3], [0], [0]]
>>> v = vector_product(v0, v1)
>>> numpy.allclos... | [
"def",
"vector_product",
"(",
"v0",
",",
"v1",
",",
"axis",
"=",
"0",
")",
":",
"return",
"numpy",
".",
"cross",
"(",
"v0",
",",
"v1",
",",
"axis",
"=",
"axis",
")"
] | https://github.com/nileshkulkarni/csm/blob/0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc/csm/utils/transformations.py#L1786-L1804 | |
Vipermdl/OCR_detection_IC15 | 8eebd353d6fac97f5832a138d7af3bd3071670db | base/base_data_loader.py | python | BaseDataLoader.__len__ | (self) | return self._n_samples() // self.batch_size | :return: Total number of batches | :return: Total number of batches | [
":",
"return",
":",
"Total",
"number",
"of",
"batches"
] | def __len__(self):
"""
:return: Total number of batches
"""
return self._n_samples() // self.batch_size | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"self",
".",
"_n_samples",
"(",
")",
"//",
"self",
".",
"batch_size"
] | https://github.com/Vipermdl/OCR_detection_IC15/blob/8eebd353d6fac97f5832a138d7af3bd3071670db/base/base_data_loader.py#L38-L42 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/html2.py | python | WebView.SetEditable | (*args, **kwargs) | return _html2.WebView_SetEditable(*args, **kwargs) | SetEditable(self, bool enable=True) | SetEditable(self, bool enable=True) | [
"SetEditable",
"(",
"self",
"bool",
"enable",
"=",
"True",
")"
] | def SetEditable(*args, **kwargs):
"""SetEditable(self, bool enable=True)"""
return _html2.WebView_SetEditable(*args, **kwargs) | [
"def",
"SetEditable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html2",
".",
"WebView_SetEditable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html2.py#L199-L201 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/context.py | python | BaseContext.get_logger | (self) | return get_logger() | Return package logger -- if it does not already exist then
it is created. | Return package logger -- if it does not already exist then
it is created. | [
"Return",
"package",
"logger",
"--",
"if",
"it",
"does",
"not",
"already",
"exist",
"then",
"it",
"is",
"created",
"."
] | def get_logger(self):
'''Return package logger -- if it does not already exist then
it is created.
'''
from .util import get_logger
return get_logger() | [
"def",
"get_logger",
"(",
"self",
")",
":",
"from",
".",
"util",
"import",
"get_logger",
"return",
"get_logger",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/context.py#L151-L156 | |
cinder/Cinder | e83f5bb9c01a63eec20168d02953a0879e5100f7 | docs/libs/pystache/context.py | python | ContextStack._get_simple | (self, name) | Query the stack for a non-dotted name. | Query the stack for a non-dotted name. | [
"Query",
"the",
"stack",
"for",
"a",
"non",
"-",
"dotted",
"name",
"."
] | def _get_simple(self, name):
"""
Query the stack for a non-dotted name.
"""
for item in reversed(self._stack):
result = _get_value(item, name)
if result is not _NOT_FOUND:
return result
raise KeyNotFoundError(name, "part missing") | [
"def",
"_get_simple",
"(",
"self",
",",
"name",
")",
":",
"for",
"item",
"in",
"reversed",
"(",
"self",
".",
"_stack",
")",
":",
"result",
"=",
"_get_value",
"(",
"item",
",",
"name",
")",
"if",
"result",
"is",
"not",
"_NOT_FOUND",
":",
"return",
"re... | https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/libs/pystache/context.py#L304-L314 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/multi_threads_helpers.py | python | IntegratePeaksThread.set_integrated_peak_info | (self, scan_number, peak_integration_dict) | return | set the integrated peak information including
* calculate Lorentz correction
* add the integration result dictionary
* add motor step information
:return: | set the integrated peak information including
* calculate Lorentz correction
* add the integration result dictionary
* add motor step information
:return: | [
"set",
"the",
"integrated",
"peak",
"information",
"including",
"*",
"calculate",
"Lorentz",
"correction",
"*",
"add",
"the",
"integration",
"result",
"dictionary",
"*",
"add",
"motor",
"step",
"information",
":",
"return",
":"
] | def set_integrated_peak_info(self, scan_number, peak_integration_dict):
"""
set the integrated peak information including
* calculate Lorentz correction
* add the integration result dictionary
* add motor step information
:return:
"""
# get peak informatio... | [
"def",
"set_integrated_peak_info",
"(",
"self",
",",
"scan_number",
",",
"peak_integration_dict",
")",
":",
"# get peak information",
"peak_info_obj",
"=",
"self",
".",
"_mainWindow",
".",
"controller",
".",
"get_peak_info",
"(",
"self",
".",
"_expNumber",
",",
"sca... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/multi_threads_helpers.py#L315-L351 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | llvm/utils/lit/lit/llvm/subst.py | python | ToolSubst.__init__ | (self, key, command=None, pre=r'.-^/\<', post='-.', verbatim=False,
unresolved='warn', extra_args=None) | Construct a ToolSubst.
key: The text which is to be substituted.
command: The command to substitute when the key is matched. By default,
this will treat `key` as a tool name and search for it. If it is
a string, it is intereprted as an exact path. If it is an instance of
Fin... | Construct a ToolSubst. | [
"Construct",
"a",
"ToolSubst",
"."
] | def __init__(self, key, command=None, pre=r'.-^/\<', post='-.', verbatim=False,
unresolved='warn', extra_args=None):
"""Construct a ToolSubst.
key: The text which is to be substituted.
command: The command to substitute when the key is matched. By default,
this will t... | [
"def",
"__init__",
"(",
"self",
",",
"key",
",",
"command",
"=",
"None",
",",
"pre",
"=",
"r'.-^/\\<'",
",",
"post",
"=",
"'-.'",
",",
"verbatim",
"=",
"False",
",",
"unresolved",
"=",
"'warn'",
",",
"extra_args",
"=",
"None",
")",
":",
"self",
".",
... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/llvm/utils/lit/lit/llvm/subst.py#L42-L100 | ||
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetCflagsCC | (self, config) | return ['/TP'] + self._GetPchFlags(config, '.cc') | Returns the flags that need to be added to .cc compilations. | Returns the flags that need to be added to .cc compilations. | [
"Returns",
"the",
"flags",
"that",
"need",
"to",
"be",
"added",
"to",
".",
"cc",
"compilations",
"."
] | def GetCflagsCC(self, config):
"""Returns the flags that need to be added to .cc compilations."""
config = self._TargetConfig(config)
return ['/TP'] + self._GetPchFlags(config, '.cc') | [
"def",
"GetCflagsCC",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"return",
"[",
"'/TP'",
"]",
"+",
"self",
".",
"_GetPchFlags",
"(",
"config",
",",
"'.cc'",
")"
] | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/msvs_emulation.py#L496-L499 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/debug/wrappers/framework.py | python | NonInteractiveDebugWrapperSession.prepare_run_debug_urls | (self, fetches, feed_dict) | Abstract method to be implemented by concrete subclasses.
This method prepares the run-specific debug URL(s).
Args:
fetches: Same as the `fetches` argument to `Session.run()`
feed_dict: Same as the `feed_dict` argument to `Session.run()`
Returns:
debug_urls: (`str` or `list` of `str`) D... | Abstract method to be implemented by concrete subclasses. | [
"Abstract",
"method",
"to",
"be",
"implemented",
"by",
"concrete",
"subclasses",
"."
] | def prepare_run_debug_urls(self, fetches, feed_dict):
"""Abstract method to be implemented by concrete subclasses.
This method prepares the run-specific debug URL(s).
Args:
fetches: Same as the `fetches` argument to `Session.run()`
feed_dict: Same as the `feed_dict` argument to `Session.run()`... | [
"def",
"prepare_run_debug_urls",
"(",
"self",
",",
"fetches",
",",
"feed_dict",
")",
":"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/wrappers/framework.py#L799-L811 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/gdal-utils/osgeo_utils/auxiliary/base.py | python | get_byte | (number: int, i: int) | return (number & (0xff << (i * 8))) >> (i * 8) | returns the i-th byte from an integer | returns the i-th byte from an integer | [
"returns",
"the",
"i",
"-",
"th",
"byte",
"from",
"an",
"integer"
] | def get_byte(number: int, i: int):
""" returns the i-th byte from an integer"""
return (number & (0xff << (i * 8))) >> (i * 8) | [
"def",
"get_byte",
"(",
"number",
":",
"int",
",",
"i",
":",
"int",
")",
":",
"return",
"(",
"number",
"&",
"(",
"0xff",
"<<",
"(",
"i",
"*",
"8",
")",
")",
")",
">>",
"(",
"i",
"*",
"8",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/gdal-utils/osgeo_utils/auxiliary/base.py#L72-L74 | |
zeroc-ice/ice | 6df7df6039674d58fb5ab9a08e46f28591a210f7 | python/python/Ice/__init__.py | python | Value.ice_staticId | () | return '::Ice::Object' | Obtains the type id of this Slice class or interface.
Returns:
The type id. | Obtains the type id of this Slice class or interface.
Returns:
The type id. | [
"Obtains",
"the",
"type",
"id",
"of",
"this",
"Slice",
"class",
"or",
"interface",
".",
"Returns",
":",
"The",
"type",
"id",
"."
] | def ice_staticId():
'''Obtains the type id of this Slice class or interface.
Returns:
The type id.
'''
return '::Ice::Object' | [
"def",
"ice_staticId",
"(",
")",
":",
"return",
"'::Ice::Object'"
] | https://github.com/zeroc-ice/ice/blob/6df7df6039674d58fb5ab9a08e46f28591a210f7/python/python/Ice/__init__.py#L334-L339 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/hang_analyzer/dumper.py | python | Dumper.__init__ | (self, root_logger: logging.Logger, dbg_output: str) | Initialize dumper. | Initialize dumper. | [
"Initialize",
"dumper",
"."
] | def __init__(self, root_logger: logging.Logger, dbg_output: str):
"""Initialize dumper."""
self._root_logger = root_logger
self._dbg_output = dbg_output | [
"def",
"__init__",
"(",
"self",
",",
"root_logger",
":",
"logging",
".",
"Logger",
",",
"dbg_output",
":",
"str",
")",
":",
"self",
".",
"_root_logger",
"=",
"root_logger",
"self",
".",
"_dbg_output",
"=",
"dbg_output"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/hang_analyzer/dumper.py#L49-L52 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/skia/tools/copyright/fileparser.py | python | CParser.FindAllCommentBlocks | (self, file_contents) | return self._comment_pattern.findall(file_contents) | Returns a list of all comment blocks within these file contents. | Returns a list of all comment blocks within these file contents. | [
"Returns",
"a",
"list",
"of",
"all",
"comment",
"blocks",
"within",
"these",
"file",
"contents",
"."
] | def FindAllCommentBlocks(self, file_contents):
"""Returns a list of all comment blocks within these file contents.
"""
return self._comment_pattern.findall(file_contents) | [
"def",
"FindAllCommentBlocks",
"(",
"self",
",",
"file_contents",
")",
":",
"return",
"self",
".",
"_comment_pattern",
".",
"findall",
"(",
"file_contents",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/skia/tools/copyright/fileparser.py#L76-L79 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/guess-the-majority-in-a-hidden-array.py | python | Solution.guessMajority | (self, reader) | return 3 if count_a > count_b else idx_b | :type reader: ArrayReader
:rtype: integer | :type reader: ArrayReader
:rtype: integer | [
":",
"type",
"reader",
":",
"ArrayReader",
":",
"rtype",
":",
"integer"
] | def guessMajority(self, reader):
"""
:type reader: ArrayReader
:rtype: integer
"""
count_a, count_b, idx_b = 1, 0, None
value_0_1_2_3 = reader.query(0, 1, 2, 3)
for i in reversed(xrange(4, reader.length())):
value_0_1_2_i = reader.query(0, 1, 2, i)
... | [
"def",
"guessMajority",
"(",
"self",
",",
"reader",
")",
":",
"count_a",
",",
"count_b",
",",
"idx_b",
"=",
"1",
",",
"0",
",",
"None",
"value_0_1_2_3",
"=",
"reader",
".",
"query",
"(",
"0",
",",
"1",
",",
"2",
",",
"3",
")",
"for",
"i",
"in",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/guess-the-majority-in-a-hidden-array.py#L20-L42 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/msw/gizmos.py | python | TreeListColumnInfo.SetImage | (*args, **kwargs) | return _gizmos.TreeListColumnInfo_SetImage(*args, **kwargs) | SetImage(self, int image) | SetImage(self, int image) | [
"SetImage",
"(",
"self",
"int",
"image",
")"
] | def SetImage(*args, **kwargs):
"""SetImage(self, int image)"""
return _gizmos.TreeListColumnInfo_SetImage(*args, **kwargs) | [
"def",
"SetImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gizmos",
".",
"TreeListColumnInfo_SetImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/msw/gizmos.py#L440-L442 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/buttonpanel.py | python | ButtonInfo.Draw | (self, dc, rect) | Draws the button on :class:`ButtonPanel`. Actually the drawing is done in :class:`BPArt`.
:param `dc`: an instance of :class:`DC`;
:param Rect `rect`: the main caption text client rectangle. | Draws the button on :class:`ButtonPanel`. Actually the drawing is done in :class:`BPArt`. | [
"Draws",
"the",
"button",
"on",
":",
"class",
":",
"ButtonPanel",
".",
"Actually",
"the",
"drawing",
"is",
"done",
"in",
":",
"class",
":",
"BPArt",
"."
] | def Draw(self, dc, rect):
"""
Draws the button on :class:`ButtonPanel`. Actually the drawing is done in :class:`BPArt`.
:param `dc`: an instance of :class:`DC`;
:param Rect `rect`: the main caption text client rectangle.
"""
if not self.IsShown():
return
... | [
"def",
"Draw",
"(",
"self",
",",
"dc",
",",
"rect",
")",
":",
"if",
"not",
"self",
".",
"IsShown",
"(",
")",
":",
"return",
"buttonBitmap",
"=",
"self",
".",
"GetBitmap",
"(",
")",
"isVertical",
"=",
"self",
".",
"_parent",
".",
"IsVertical",
"(",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/buttonpanel.py#L1458-L1479 | ||
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/pymcuprog/nvmpic.py | python | NvmAccessProviderCmsisDapPic.read_device_id | (self) | return id_array | Get the device info from the device
:returns: Device ID raw bytes (Little endian) | Get the device info from the device | [
"Get",
"the",
"device",
"info",
"from",
"the",
"device"
] | def read_device_id(self):
"""
Get the device info from the device
:returns: Device ID raw bytes (Little endian)
"""
pic_id = self.pic.read_id()
id_array = binary.pack_le16(pic_id)
self.logger.info("Device ID read out: '%04X'", pic_id)
return id_array | [
"def",
"read_device_id",
"(",
"self",
")",
":",
"pic_id",
"=",
"self",
".",
"pic",
".",
"read_id",
"(",
")",
"id_array",
"=",
"binary",
".",
"pack_le16",
"(",
"pic_id",
")",
"self",
".",
"logger",
".",
"info",
"(",
"\"Device ID read out: '%04X'\"",
",",
... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pymcuprog/nvmpic.py#L151-L160 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/distutils/cmd.py | python | Command.move_file | (self, src, dst, level=1) | return file_util.move_file(src, dst, dry_run=self.dry_run) | Move a file respecting dry-run flag. | Move a file respecting dry-run flag. | [
"Move",
"a",
"file",
"respecting",
"dry",
"-",
"run",
"flag",
"."
] | def move_file (self, src, dst, level=1):
"""Move a file respecting dry-run flag."""
return file_util.move_file(src, dst, dry_run=self.dry_run) | [
"def",
"move_file",
"(",
"self",
",",
"src",
",",
"dst",
",",
"level",
"=",
"1",
")",
":",
"return",
"file_util",
".",
"move_file",
"(",
"src",
",",
"dst",
",",
"dry_run",
"=",
"self",
".",
"dry_run",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/cmd.py#L358-L360 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py | python | Decimal.logical_or | (self, other, context=None) | return _dec_from_triple(0, result.lstrip('0') or '0', 0) | Applies an 'or' operation between self and other's digits. | Applies an 'or' operation between self and other's digits. | [
"Applies",
"an",
"or",
"operation",
"between",
"self",
"and",
"other",
"s",
"digits",
"."
] | def logical_or(self, other, context=None):
"""Applies an 'or' operation between self and other's digits."""
if context is None:
context = getcontext()
other = _convert_other(other, raiseit=True)
if not self._islogical() or not other._islogical():
return context.... | [
"def",
"logical_or",
"(",
"self",
",",
"other",
",",
"context",
"=",
"None",
")",
":",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"getcontext",
"(",
")",
"other",
"=",
"_convert_other",
"(",
"other",
",",
"raiseit",
"=",
"True",
")",
"if",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py#L3300-L3315 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/compiler/pyassem.py | python | FlowGraph.getBlocksInOrder | (self) | return order | Return the blocks in reverse postorder
i.e. each node appears before all of its successors | Return the blocks in reverse postorder | [
"Return",
"the",
"blocks",
"in",
"reverse",
"postorder"
] | def getBlocksInOrder(self):
"""Return the blocks in reverse postorder
i.e. each node appears before all of its successors
"""
order = order_blocks(self.entry, self.exit)
return order | [
"def",
"getBlocksInOrder",
"(",
"self",
")",
":",
"order",
"=",
"order_blocks",
"(",
"self",
".",
"entry",
",",
"self",
".",
"exit",
")",
"return",
"order"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/compiler/pyassem.py#L76-L82 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/logging/__init__.py | python | Logger.isEnabledFor | (self, level) | Is this logger enabled for level 'level'? | Is this logger enabled for level 'level'? | [
"Is",
"this",
"logger",
"enabled",
"for",
"level",
"level",
"?"
] | def isEnabledFor(self, level):
"""
Is this logger enabled for level 'level'?
"""
try:
return self._cache[level]
except KeyError:
_acquireLock()
try:
if self.manager.disable >= level:
is_enabled = self._cache[... | [
"def",
"isEnabledFor",
"(",
"self",
",",
"level",
")",
":",
"try",
":",
"return",
"self",
".",
"_cache",
"[",
"level",
"]",
"except",
"KeyError",
":",
"_acquireLock",
"(",
")",
"try",
":",
"if",
"self",
".",
"manager",
".",
"disable",
">=",
"level",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/logging/__init__.py#L1614-L1631 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathUtils.py | python | getOffsetArea | (
fcShape,
offset,
removeHoles=False,
# Default: XY plane
plane=Part.makeCircle(10),
tolerance=1e-4,
) | return offsetShape | Make an offset area of a shape, projected onto a plane.
Positive offsets expand the area, negative offsets shrink it.
Inspired by _buildPathArea() from PathAreaOp.py module. Adjustments made
based on notes by @sliptonic at this webpage:
https://github.com/sliptonic/FreeCAD/wiki/PathArea-notes. | Make an offset area of a shape, projected onto a plane.
Positive offsets expand the area, negative offsets shrink it.
Inspired by _buildPathArea() from PathAreaOp.py module. Adjustments made
based on notes by | [
"Make",
"an",
"offset",
"area",
"of",
"a",
"shape",
"projected",
"onto",
"a",
"plane",
".",
"Positive",
"offsets",
"expand",
"the",
"area",
"negative",
"offsets",
"shrink",
"it",
".",
"Inspired",
"by",
"_buildPathArea",
"()",
"from",
"PathAreaOp",
".",
"py",... | def getOffsetArea(
fcShape,
offset,
removeHoles=False,
# Default: XY plane
plane=Part.makeCircle(10),
tolerance=1e-4,
):
"""Make an offset area of a shape, projected onto a plane.
Positive offsets expand the area, negative offsets shrink it.
Inspired by _buildPathArea() from PathArea... | [
"def",
"getOffsetArea",
"(",
"fcShape",
",",
"offset",
",",
"removeHoles",
"=",
"False",
",",
"# Default: XY plane",
"plane",
"=",
"Part",
".",
"makeCircle",
"(",
"10",
")",
",",
"tolerance",
"=",
"1e-4",
",",
")",
":",
"PathLog",
".",
"debug",
"(",
"\"g... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathUtils.py#L284-L325 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/Chem/MolStandardize/charge.py | python | Uncharger.uncharge | (self, mol) | return mol | Neutralize molecule by adding/removing hydrogens. Attempts to preserve zwitterions.
:param mol: The molecule to uncharge.
:type mol: :rdkit:`Mol <Chem.rdchem.Mol-class.html>`
:return: The uncharged molecule.
:rtype: :rdkit:`Mol <Chem.rdchem.Mol-class.html>` | Neutralize molecule by adding/removing hydrogens. Attempts to preserve zwitterions. | [
"Neutralize",
"molecule",
"by",
"adding",
"/",
"removing",
"hydrogens",
".",
"Attempts",
"to",
"preserve",
"zwitterions",
"."
] | def uncharge(self, mol):
"""Neutralize molecule by adding/removing hydrogens. Attempts to preserve zwitterions.
:param mol: The molecule to uncharge.
:type mol: :rdkit:`Mol <Chem.rdchem.Mol-class.html>`
:return: The uncharged molecule.
:rtype: :rdkit:`Mol <Chem.rdchem.Mol-class.... | [
"def",
"uncharge",
"(",
"self",
",",
"mol",
")",
":",
"log",
".",
"debug",
"(",
"'Running Uncharger'",
")",
"mol",
"=",
"copy",
".",
"deepcopy",
"(",
"mol",
")",
"# Get atom ids for matches",
"p",
"=",
"[",
"x",
"[",
"0",
"]",
"for",
"x",
"in",
"mol"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/MolStandardize/charge.py#L282-L326 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/framework/tensor_util.py | python | _GetDenseDimensions | (list_of_lists) | Returns the inferred dense dimensions of a list of lists. | Returns the inferred dense dimensions of a list of lists. | [
"Returns",
"the",
"inferred",
"dense",
"dimensions",
"of",
"a",
"list",
"of",
"lists",
"."
] | def _GetDenseDimensions(list_of_lists):
"""Returns the inferred dense dimensions of a list of lists."""
if not isinstance(list_of_lists, (list, tuple)):
return []
elif not list_of_lists:
return [0]
else:
return [len(list_of_lists)] + _GetDenseDimensions(list_of_lists[0]) | [
"def",
"_GetDenseDimensions",
"(",
"list_of_lists",
")",
":",
"if",
"not",
"isinstance",
"(",
"list_of_lists",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"return",
"[",
"]",
"elif",
"not",
"list_of_lists",
":",
"return",
"[",
"0",
"]",
"else",
":",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/tensor_util.py#L170-L177 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py | python | ApplyPaalmanPingsCorrection._get_factor_workspaces | (self) | return {factor: self._get_correction_factor_workspace(factor) for factor in self._factors} | :return: A dictionary of the factors to the factor workspaces. | :return: A dictionary of the factors to the factor workspaces. | [
":",
"return",
":",
"A",
"dictionary",
"of",
"the",
"factors",
"to",
"the",
"factor",
"workspaces",
"."
] | def _get_factor_workspaces(self):
"""
:return: A dictionary of the factors to the factor workspaces.
"""
return {factor: self._get_correction_factor_workspace(factor) for factor in self._factors} | [
"def",
"_get_factor_workspaces",
"(",
"self",
")",
":",
"return",
"{",
"factor",
":",
"self",
".",
"_get_correction_factor_workspace",
"(",
"factor",
")",
"for",
"factor",
"in",
"self",
".",
"_factors",
"}"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py#L319-L323 | |
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | tools/clang/bindings/python/clang/cindex.py | python | Cursor.is_pure_virtual_method | (self) | return conf.lib.clang_CXXMethod_isPureVirtual(self) | Returns True if the cursor refers to a C++ member function or member
function template that is declared pure virtual. | Returns True if the cursor refers to a C++ member function or member
function template that is declared pure virtual. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"member",
"function",
"or",
"member",
"function",
"template",
"that",
"is",
"declared",
"pure",
"virtual",
"."
] | def is_pure_virtual_method(self):
"""Returns True if the cursor refers to a C++ member function or member
function template that is declared pure virtual.
"""
return conf.lib.clang_CXXMethod_isPureVirtual(self) | [
"def",
"is_pure_virtual_method",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXMethod_isPureVirtual",
"(",
"self",
")"
] | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/tools/clang/bindings/python/clang/cindex.py#L1464-L1468 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/third_party/jinja2/filters.py | python | evalcontextfilter | (f) | return f | Decorator for marking eval-context dependent filters. An eval
context object is passed as first argument. For more information
about the eval context, see :ref:`eval-context`.
.. versionadded:: 2.4 | Decorator for marking eval-context dependent filters. An eval
context object is passed as first argument. For more information
about the eval context, see :ref:`eval-context`. | [
"Decorator",
"for",
"marking",
"eval",
"-",
"context",
"dependent",
"filters",
".",
"An",
"eval",
"context",
"object",
"is",
"passed",
"as",
"first",
"argument",
".",
"For",
"more",
"information",
"about",
"the",
"eval",
"context",
"see",
":",
"ref",
":",
... | def evalcontextfilter(f):
"""Decorator for marking eval-context dependent filters. An eval
context object is passed as first argument. For more information
about the eval context, see :ref:`eval-context`.
.. versionadded:: 2.4
"""
f.evalcontextfilter = True
return f | [
"def",
"evalcontextfilter",
"(",
"f",
")",
":",
"f",
".",
"evalcontextfilter",
"=",
"True",
"return",
"f"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/filters.py#L37-L45 | |
potassco/clingo | e0c91d8f95cc28de1c480a871f9c97c30de83d40 | libpyclingo/clingo/backend.py | python | Observer.theory_term_string | (self, term_id : int, name : str) | Observe string theory terms.
Parameters
----------
term_id
The id of the term.
name
The string value of the term. | Observe string theory terms. | [
"Observe",
"string",
"theory",
"terms",
"."
] | def theory_term_string(self, term_id : int, name : str) -> None:
'''
Observe string theory terms.
Parameters
----------
term_id
The id of the term.
name
The string value of the term.
''' | [
"def",
"theory_term_string",
"(",
"self",
",",
"term_id",
":",
"int",
",",
"name",
":",
"str",
")",
"->",
"None",
":"
] | https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/backend.py#L271-L281 | ||
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | build-support/cpplint.py | python | IsInitializerList | (clean_lines, linenum) | return False | Check if current line is inside constructor initializer list.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line appears to be inside constructor initializer
list, False otherwise. | Check if current line is inside constructor initializer list. | [
"Check",
"if",
"current",
"line",
"is",
"inside",
"constructor",
"initializer",
"list",
"."
] | def IsInitializerList(clean_lines, linenum):
"""Check if current line is inside constructor initializer list.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line appears to be inside constructor initializer
lis... | [
"def",
"IsInitializerList",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"for",
"i",
"in",
"xrange",
"(",
"linenum",
",",
"1",
",",
"-",
"1",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"i",
"]",
"if",
"i",
"==",
"linenum",
":",
"rem... | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L5242-L5281 | |
jeog/TDAmeritradeAPI | 91c738afd7d57b54f6231170bd64c2550fafd34d | python/tdma_api/execute.py | python | OrderTicket.get_duration | (self) | return clib.get_val('OrderTicket_GetDuration_ABI', c_int, self._obj) | Returns duration type as ORDER_DURATION_[] constant. | Returns duration type as ORDER_DURATION_[] constant. | [
"Returns",
"duration",
"type",
"as",
"ORDER_DURATION_",
"[]",
"constant",
"."
] | def get_duration(self):
"""Returns duration type as ORDER_DURATION_[] constant."""
return clib.get_val('OrderTicket_GetDuration_ABI', c_int, self._obj) | [
"def",
"get_duration",
"(",
"self",
")",
":",
"return",
"clib",
".",
"get_val",
"(",
"'OrderTicket_GetDuration_ABI'",
",",
"c_int",
",",
"self",
".",
"_obj",
")"
] | https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/execute.py#L314-L316 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/contrib/slim/quantization/imperative/fuse_utils.py | python | fuse_layers | (model, layers_to_fuse, inplace=False) | return model | fuse layers in layers_to_fuse
Args:
model(paddle.nn.Layer): The model to be fused.
layers_to_fuse(list): The layers' names to be fused. For
example,"fuse_list = [["conv1", "bn1"], ["conv2", "bn2"]]".
A TypeError would be raised if "fuse" was set as
... | fuse layers in layers_to_fuse | [
"fuse",
"layers",
"in",
"layers_to_fuse"
] | def fuse_layers(model, layers_to_fuse, inplace=False):
'''
fuse layers in layers_to_fuse
Args:
model(paddle.nn.Layer): The model to be fused.
layers_to_fuse(list): The layers' names to be fused. For
example,"fuse_list = [["conv1", "bn1"], ["conv2", "bn2"]]".
... | [
"def",
"fuse_layers",
"(",
"model",
",",
"layers_to_fuse",
",",
"inplace",
"=",
"False",
")",
":",
"if",
"inplace",
"==",
"False",
":",
"model",
"=",
"copy",
".",
"deepcopy",
"(",
"model",
")",
"for",
"layers",
"in",
"layers_to_fuse",
":",
"_fuse_layers",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/slim/quantization/imperative/fuse_utils.py#L31-L52 | |
htcondor/htcondor | 4829724575176d1d6c936e4693dfd78a728569b0 | bindings/python/htcondor/dags/dag.py | python | DAG.edges | (
self,
) | Iterate over ``((parent, child), edge)`` tuples,
for every edge in the graph. | Iterate over ``((parent, child), edge)`` tuples,
for every edge in the graph. | [
"Iterate",
"over",
"((",
"parent",
"child",
")",
"edge",
")",
"tuples",
"for",
"every",
"edge",
"in",
"the",
"graph",
"."
] | def edges(
self,
) -> Iterator[Tuple[Tuple[node.BaseNode, node.BaseNode], edges.BaseEdge]]:
"""
Iterate over ``((parent, child), edge)`` tuples,
for every edge in the graph.
"""
yield from self._edges | [
"def",
"edges",
"(",
"self",
",",
")",
"->",
"Iterator",
"[",
"Tuple",
"[",
"Tuple",
"[",
"node",
".",
"BaseNode",
",",
"node",
".",
"BaseNode",
"]",
",",
"edges",
".",
"BaseEdge",
"]",
"]",
":",
"yield",
"from",
"self",
".",
"_edges"
] | https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/bindings/python/htcondor/dags/dag.py#L269-L276 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | InputStream.readline | (*args, **kwargs) | return _core_.InputStream_readline(*args, **kwargs) | readline(self, int size=-1) -> PyObject | readline(self, int size=-1) -> PyObject | [
"readline",
"(",
"self",
"int",
"size",
"=",
"-",
"1",
")",
"-",
">",
"PyObject"
] | def readline(*args, **kwargs):
"""readline(self, int size=-1) -> PyObject"""
return _core_.InputStream_readline(*args, **kwargs) | [
"def",
"readline",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"InputStream_readline",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L2174-L2176 | |
telefonicaid/fiware-orion | 27c3202b9ddcfb9e3635a0af8d373f76e89b1d24 | scripts/cpplint.py | python | CleansedLines._CollapseStrings | (elided) | return elided | Collapses strings and chars on a line to simple "" or '' blocks.
We nix strings first so we're not fooled by text like '"http://"'
Args:
elided: The line being processed.
Returns:
The line with collapsed strings. | Collapses strings and chars on a line to simple "" or '' blocks. | [
"Collapses",
"strings",
"and",
"chars",
"on",
"a",
"line",
"to",
"simple",
"or",
"blocks",
"."
] | def _CollapseStrings(elided):
"""Collapses strings and chars on a line to simple "" or '' blocks.
We nix strings first so we're not fooled by text like '"http://"'
Args:
elided: The line being processed.
Returns:
The line with collapsed strings.
"""
if not _RE_PATTERN_INCLUDE.matc... | [
"def",
"_CollapseStrings",
"(",
"elided",
")",
":",
"if",
"not",
"_RE_PATTERN_INCLUDE",
".",
"match",
"(",
"elided",
")",
":",
"# Remove escaped characters first to make quote/single quote collapsing",
"# basic. Things that look like escaped characters shouldn't occur",
"# outside... | https://github.com/telefonicaid/fiware-orion/blob/27c3202b9ddcfb9e3635a0af8d373f76e89b1d24/scripts/cpplint.py#L947-L965 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/ndarray/ndarray.py | python | NDArray.one_hot | (self, *args, **kwargs) | return op.one_hot(self, *args, **kwargs) | Convenience fluent method for :py:func:`one_hot`.
The arguments are the same as for :py:func:`one_hot`, with
this array as data. | Convenience fluent method for :py:func:`one_hot`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"one_hot",
"."
] | def one_hot(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`one_hot`.
The arguments are the same as for :py:func:`one_hot`, with
this array as data.
"""
return op.one_hot(self, *args, **kwargs) | [
"def",
"one_hot",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"one_hot",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L1174-L1180 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextBuffer.EndParagraphSpacing | (*args, **kwargs) | return _richtext.RichTextBuffer_EndParagraphSpacing(*args, **kwargs) | EndParagraphSpacing(self) -> bool | EndParagraphSpacing(self) -> bool | [
"EndParagraphSpacing",
"(",
"self",
")",
"-",
">",
"bool"
] | def EndParagraphSpacing(*args, **kwargs):
"""EndParagraphSpacing(self) -> bool"""
return _richtext.RichTextBuffer_EndParagraphSpacing(*args, **kwargs) | [
"def",
"EndParagraphSpacing",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_EndParagraphSpacing",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L2409-L2411 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TextAttr.SetBulletFont | (*args, **kwargs) | return _controls_.TextAttr_SetBulletFont(*args, **kwargs) | SetBulletFont(self, String bulletFont) | SetBulletFont(self, String bulletFont) | [
"SetBulletFont",
"(",
"self",
"String",
"bulletFont",
")"
] | def SetBulletFont(*args, **kwargs):
"""SetBulletFont(self, String bulletFont)"""
return _controls_.TextAttr_SetBulletFont(*args, **kwargs) | [
"def",
"SetBulletFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_SetBulletFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1611-L1613 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py | python | PartitionedVariable._distribute_strategy | (self) | return None | The `tf.distribute.Strategy` that this variable was created under. | The `tf.distribute.Strategy` that this variable was created under. | [
"The",
"tf",
".",
"distribute",
".",
"Strategy",
"that",
"this",
"variable",
"was",
"created",
"under",
"."
] | def _distribute_strategy(self):
"""The `tf.distribute.Strategy` that this variable was created under."""
# NOTE(yuefengz): Today, no partitioned variables in a distribute strategy.
return None | [
"def",
"_distribute_strategy",
"(",
"self",
")",
":",
"# NOTE(yuefengz): Today, no partitioned variables in a distribute strategy.",
"return",
"None"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py#L2983-L2986 | |
taichi-dev/taichi | 973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6 | python/taichi/lang/impl.py | python | _Root.shape | (self) | return _root_fb.root.shape | Same as :func:`taichi.SNode.shape` | Same as :func:`taichi.SNode.shape` | [
"Same",
"as",
":",
"func",
":",
"taichi",
".",
"SNode",
".",
"shape"
] | def shape(self):
"""Same as :func:`taichi.SNode.shape`"""
return _root_fb.root.shape | [
"def",
"shape",
"(",
"self",
")",
":",
"return",
"_root_fb",
".",
"root",
".",
"shape"
] | https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/impl.py#L512-L514 | |
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | lib/datasets/pascal_voc.py | python | pascal_voc._load_pascal_annotation | (self, index) | return {'boxes' : boxes,
'gt_classes': gt_classes,
'gt_overlaps' : overlaps,
'flipped' : False,
'seg_areas' : seg_areas} | Load image and bounding boxes info from XML file in the PASCAL VOC
format. | Load image and bounding boxes info from XML file in the PASCAL VOC
format. | [
"Load",
"image",
"and",
"bounding",
"boxes",
"info",
"from",
"XML",
"file",
"in",
"the",
"PASCAL",
"VOC",
"format",
"."
] | def _load_pascal_annotation(self, index):
"""
Load image and bounding boxes info from XML file in the PASCAL VOC
format.
"""
filename = os.path.join(self._data_path, 'Annotations', index + '.xml')
tree = ET.parse(filename)
objs = tree.findall('object')
if ... | [
"def",
"_load_pascal_annotation",
"(",
"self",
",",
"index",
")",
":",
"filename",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_data_path",
",",
"'Annotations'",
",",
"index",
"+",
"'.xml'",
")",
"tree",
"=",
"ET",
".",
"parse",
"(",
"filen... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/datasets/pascal_voc.py#L180-L224 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/dateutil/parser.py | python | _parsems | (value) | Parse a I[.F] seconds value into (seconds, microseconds). | Parse a I[.F] seconds value into (seconds, microseconds). | [
"Parse",
"a",
"I",
"[",
".",
"F",
"]",
"seconds",
"value",
"into",
"(",
"seconds",
"microseconds",
")",
"."
] | def _parsems(value):
"""Parse a I[.F] seconds value into (seconds, microseconds)."""
if "." not in value:
return int(value), 0
else:
i, f = value.split(".")
return int(i), int(f.ljust(6, "0")[:6]) | [
"def",
"_parsems",
"(",
"value",
")",
":",
"if",
"\".\"",
"not",
"in",
"value",
":",
"return",
"int",
"(",
"value",
")",
",",
"0",
"else",
":",
"i",
",",
"f",
"=",
"value",
".",
"split",
"(",
"\".\"",
")",
"return",
"int",
"(",
"i",
")",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/dateutil/parser.py#L1365-L1371 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/os.py | python | execlp | (file, *args) | execlp(file, *args)
Execute the executable file (which is searched for along $PATH)
with argument list args, replacing the current process. | execlp(file, *args) | [
"execlp",
"(",
"file",
"*",
"args",
")"
] | def execlp(file, *args):
"""execlp(file, *args)
Execute the executable file (which is searched for along $PATH)
with argument list args, replacing the current process. """
execvp(file, args) | [
"def",
"execlp",
"(",
"file",
",",
"*",
"args",
")",
":",
"execvp",
"(",
"file",
",",
"args",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/os.py#L322-L327 | ||
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | tools/Polygraphy/polygraphy/tools/args/base.py | python | BaseArgs.register | (self, maker) | Registers another argument group with this one.
This can be used to pick up dependencies for example.
Args:
maker (BaseArgs): Another argument group. | Registers another argument group with this one.
This can be used to pick up dependencies for example. | [
"Registers",
"another",
"argument",
"group",
"with",
"this",
"one",
".",
"This",
"can",
"be",
"used",
"to",
"pick",
"up",
"dependencies",
"for",
"example",
"."
] | def register(self, maker):
"""
Registers another argument group with this one.
This can be used to pick up dependencies for example.
Args:
maker (BaseArgs): Another argument group.
"""
pass | [
"def",
"register",
"(",
"self",
",",
"maker",
")",
":",
"pass"
] | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/tools/Polygraphy/polygraphy/tools/args/base.py#L47-L55 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/gn/bin/gyp_flag_compare.py | python | Comparison.__init__ | (self, gyp_target, gn_target=None) | Creates a comparison of a GN and GYP target. If the target names differ
between the two build systems, then two names may be passed. | Creates a comparison of a GN and GYP target. If the target names differ
between the two build systems, then two names may be passed. | [
"Creates",
"a",
"comparison",
"of",
"a",
"GN",
"and",
"GYP",
"target",
".",
"If",
"the",
"target",
"names",
"differ",
"between",
"the",
"two",
"build",
"systems",
"then",
"two",
"names",
"may",
"be",
"passed",
"."
] | def __init__(self, gyp_target, gn_target=None):
"""Creates a comparison of a GN and GYP target. If the target names differ
between the two build systems, then two names may be passed.
"""
if gn_target is None:
gn_target = gyp_target
self._gyp_target = gyp_target
self._gn_target = gn_target... | [
"def",
"__init__",
"(",
"self",
",",
"gyp_target",
",",
"gn_target",
"=",
"None",
")",
":",
"if",
"gn_target",
"is",
"None",
":",
"gn_target",
"=",
"gyp_target",
"self",
".",
"_gyp_target",
"=",
"gyp_target",
"self",
".",
"_gn_target",
"=",
"gn_target",
"s... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/gn/bin/gyp_flag_compare.py#L90-L109 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | Joystick.GetXMin | (*args, **kwargs) | return _misc_.Joystick_GetXMin(*args, **kwargs) | GetXMin(self) -> int | GetXMin(self) -> int | [
"GetXMin",
"(",
"self",
")",
"-",
">",
"int"
] | def GetXMin(*args, **kwargs):
"""GetXMin(self) -> int"""
return _misc_.Joystick_GetXMin(*args, **kwargs) | [
"def",
"GetXMin",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Joystick_GetXMin",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L2186-L2188 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/_abcoll.py | python | MutableSequence.append | (self, value) | S.append(object) -- append object to the end of the sequence | S.append(object) -- append object to the end of the sequence | [
"S",
".",
"append",
"(",
"object",
")",
"--",
"append",
"object",
"to",
"the",
"end",
"of",
"the",
"sequence"
] | def append(self, value):
'S.append(object) -- append object to the end of the sequence'
self.insert(len(self), value) | [
"def",
"append",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"insert",
"(",
"len",
"(",
"self",
")",
",",
"value",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/_abcoll.py#L638-L640 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb/item.py | python | Item.delete_attribute | (self, attr_name, attr_value=None) | Queue the deletion of an attribute from an item in DynamoDB.
This call will result in a UpdateItem request being issued
with update action of DELETE when the save method is called.
:type attr_name: str
:param attr_name: Name of the attribute you want to alter.
:type attr_value:... | Queue the deletion of an attribute from an item in DynamoDB.
This call will result in a UpdateItem request being issued
with update action of DELETE when the save method is called. | [
"Queue",
"the",
"deletion",
"of",
"an",
"attribute",
"from",
"an",
"item",
"in",
"DynamoDB",
".",
"This",
"call",
"will",
"result",
"in",
"a",
"UpdateItem",
"request",
"being",
"issued",
"with",
"update",
"action",
"of",
"DELETE",
"when",
"the",
"save",
"m... | def delete_attribute(self, attr_name, attr_value=None):
"""
Queue the deletion of an attribute from an item in DynamoDB.
This call will result in a UpdateItem request being issued
with update action of DELETE when the save method is called.
:type attr_name: str
:param at... | [
"def",
"delete_attribute",
"(",
"self",
",",
"attr_name",
",",
"attr_value",
"=",
"None",
")",
":",
"self",
".",
"_updates",
"[",
"attr_name",
"]",
"=",
"(",
"\"DELETE\"",
",",
"attr_value",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb/item.py#L89-L103 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatnotebook.py | python | FNBDropSource.GiveFeedback | (self, effect) | return False | You may give some custom UI feedback during the drag and drop operation
in this function. It is called on each mouse move, so your implementation
must not be too slow.
:param `effect`: the effect to implement. One of ``wx.DragCopy``, ``wx.DragMove``,
``wx.DragLink`` and ``wx.DragNone``... | You may give some custom UI feedback during the drag and drop operation
in this function. It is called on each mouse move, so your implementation
must not be too slow. | [
"You",
"may",
"give",
"some",
"custom",
"UI",
"feedback",
"during",
"the",
"drag",
"and",
"drop",
"operation",
"in",
"this",
"function",
".",
"It",
"is",
"called",
"on",
"each",
"mouse",
"move",
"so",
"your",
"implementation",
"must",
"not",
"be",
"too",
... | def GiveFeedback(self, effect):
"""
You may give some custom UI feedback during the drag and drop operation
in this function. It is called on each mouse move, so your implementation
must not be too slow.
:param `effect`: the effect to implement. One of ``wx.DragCopy``, ``wx.Drag... | [
"def",
"GiveFeedback",
"(",
"self",
",",
"effect",
")",
":",
"self",
".",
"_win",
".",
"DrawDragHint",
"(",
")",
"return",
"False"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatnotebook.py#L992-L1009 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/retdec-3.2/scripts/retdec-utils.py | python | CmdRunner._get_memory_from_measured_output | (self, output) | return memory | Get memory in MB from output string generated by `config.LOG_TIME`.
`/usr/bin/time` format is expected. | Get memory in MB from output string generated by `config.LOG_TIME`.
`/usr/bin/time` format is expected. | [
"Get",
"memory",
"in",
"MB",
"from",
"output",
"string",
"generated",
"by",
"config",
".",
"LOG_TIME",
".",
"/",
"usr",
"/",
"bin",
"/",
"time",
"format",
"is",
"expected",
"."
] | def _get_memory_from_measured_output(self, output):
"""Get memory in MB from output string generated by `config.LOG_TIME`.
`/usr/bin/time` format is expected."""
memory = 0
s = re.search(r'Maximum resident set size \(kbytes\): (\d+)', output)
if s:
g = s.group(1)
... | [
"def",
"_get_memory_from_measured_output",
"(",
"self",
",",
"output",
")",
":",
"memory",
"=",
"0",
"s",
"=",
"re",
".",
"search",
"(",
"r'Maximum resident set size \\(kbytes\\): (\\d+)'",
",",
"output",
")",
"if",
"s",
":",
"g",
"=",
"s",
".",
"group",
"("... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/retdec-utils.py#L171-L183 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/wms/ogc/common/configs.py | python | Configs.__init__ | (self, config_file, default_values=None) | Load config key/value pairs from the config file. | Load config key/value pairs from the config file. | [
"Load",
"config",
"key",
"/",
"value",
"pairs",
"from",
"the",
"config",
"file",
"."
] | def __init__(self, config_file, default_values=None):
"""Load config key/value pairs from the config file."""
if default_values:
self._config_values = default_values
else:
self._config_values = {}
try:
fp = open(config_file)
for line in fp:
line = line.strip()
if ... | [
"def",
"__init__",
"(",
"self",
",",
"config_file",
",",
"default_values",
"=",
"None",
")",
":",
"if",
"default_values",
":",
"self",
".",
"_config_values",
"=",
"default_values",
"else",
":",
"self",
".",
"_config_values",
"=",
"{",
"}",
"try",
":",
"fp"... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/wms/ogc/common/configs.py#L25-L42 | ||
hszhao/PSPNet | cf7e5a99ba37e46118026e96be5821a9bc63bde0 | python/caffe/io.py | python | Transformer.set_raw_scale | (self, in_, scale) | Set the scale of raw features s.t. the input blob = input * scale.
While Python represents images in [0, 1], certain Caffe models
like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale
of these models must be 255.
Parameters
----------
in_ : which input ... | Set the scale of raw features s.t. the input blob = input * scale.
While Python represents images in [0, 1], certain Caffe models
like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale
of these models must be 255. | [
"Set",
"the",
"scale",
"of",
"raw",
"features",
"s",
".",
"t",
".",
"the",
"input",
"blob",
"=",
"input",
"*",
"scale",
".",
"While",
"Python",
"represents",
"images",
"in",
"[",
"0",
"1",
"]",
"certain",
"Caffe",
"models",
"like",
"CaffeNet",
"and",
... | def set_raw_scale(self, in_, scale):
"""
Set the scale of raw features s.t. the input blob = input * scale.
While Python represents images in [0, 1], certain Caffe models
like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale
of these models must be 255.
... | [
"def",
"set_raw_scale",
"(",
"self",
",",
"in_",
",",
"scale",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"self",
".",
"raw_scale",
"[",
"in_",
"]",
"=",
"scale"
] | https://github.com/hszhao/PSPNet/blob/cf7e5a99ba37e46118026e96be5821a9bc63bde0/python/caffe/io.py#L220-L233 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Image.RGBtoHSV | (*args, **kwargs) | return _core_.Image_RGBtoHSV(*args, **kwargs) | RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
Converts a color in RGB color space to HSV color space. | RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | [
"RGBtoHSV",
"(",
"Image_RGBValue",
"rgb",
")",
"-",
">",
"Image_HSVValue"
] | def RGBtoHSV(*args, **kwargs):
"""
RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
Converts a color in RGB color space to HSV color space.
"""
return _core_.Image_RGBtoHSV(*args, **kwargs) | [
"def",
"RGBtoHSV",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_RGBtoHSV",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L3661-L3667 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/math_ops.py | python | _maybe_get_dtype | (x) | return x | Returns a numpy type if available from x. Skips if x is numpy.ndarray. | Returns a numpy type if available from x. Skips if x is numpy.ndarray. | [
"Returns",
"a",
"numpy",
"type",
"if",
"available",
"from",
"x",
".",
"Skips",
"if",
"x",
"is",
"numpy",
".",
"ndarray",
"."
] | def _maybe_get_dtype(x):
"""Returns a numpy type if available from x. Skips if x is numpy.ndarray."""
# Don't put np.ndarray in this list, because np.result_type looks at the
# value (not just dtype) of np.ndarray to decide the result type.
if isinstance(x, numbers.Real):
return x
if isinstance(x, ops.Ten... | [
"def",
"_maybe_get_dtype",
"(",
"x",
")",
":",
"# Don't put np.ndarray in this list, because np.result_type looks at the",
"# value (not just dtype) of np.ndarray to decide the result type.",
"if",
"isinstance",
"(",
"x",
",",
"numbers",
".",
"Real",
")",
":",
"return",
"x",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_ops.py#L1326-L1340 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/difflib.py | python | SequenceMatcher.get_grouped_opcodes | (self, n=3) | Isolate change clusters by eliminating ranges with no changes.
Return a generator of groups with upto n lines of context.
Each group is in the same format as returned by get_opcodes().
>>> from pprint import pprint
>>> a = map(str, range(1,40))
>>> b = a[:]
>>> b[8:8] =... | Isolate change clusters by eliminating ranges with no changes. | [
"Isolate",
"change",
"clusters",
"by",
"eliminating",
"ranges",
"with",
"no",
"changes",
"."
] | def get_grouped_opcodes(self, n=3):
""" Isolate change clusters by eliminating ranges with no changes.
Return a generator of groups with upto n lines of context.
Each group is in the same format as returned by get_opcodes().
>>> from pprint import pprint
>>> a = map(str, range(... | [
"def",
"get_grouped_opcodes",
"(",
"self",
",",
"n",
"=",
"3",
")",
":",
"codes",
"=",
"self",
".",
"get_opcodes",
"(",
")",
"if",
"not",
"codes",
":",
"codes",
"=",
"[",
"(",
"\"equal\"",
",",
"0",
",",
"1",
",",
"0",
",",
"1",
")",
"]",
"# Fi... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/difflib.py#L586-L634 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/definition.py | python | define_service | (service_descriptor, module) | return service_class | Define a new service proxy.
Args:
service_descriptor: ServiceDescriptor class that describes the service.
module: Module to add service to. Request and response types are found
relative to this module.
Returns:
Service class proxy capable of communicating with a remote server. | Define a new service proxy. | [
"Define",
"a",
"new",
"service",
"proxy",
"."
] | def define_service(service_descriptor, module):
"""Define a new service proxy.
Args:
service_descriptor: ServiceDescriptor class that describes the service.
module: Module to add service to. Request and response types are found
relative to this module.
Returns:
Service class proxy capable of ... | [
"def",
"define_service",
"(",
"service_descriptor",
",",
"module",
")",
":",
"class_dict",
"=",
"{",
"'__module__'",
":",
"module",
".",
"__name__",
"}",
"class_name",
"=",
"service_descriptor",
".",
"name",
".",
"encode",
"(",
"'utf-8'",
")",
"for",
"method_d... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/definition.py#L169-L200 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/optimize/_differentialevolution.py | python | DifferentialEvolutionSolver._randtobest1 | (self, samples) | return bprime | randtobest1bin, randtobest1exp | randtobest1bin, randtobest1exp | [
"randtobest1bin",
"randtobest1exp"
] | def _randtobest1(self, samples):
"""randtobest1bin, randtobest1exp"""
r0, r1, r2 = samples[:3]
bprime = np.copy(self.population[r0])
bprime += self.scale * (self.population[0] - bprime)
bprime += self.scale * (self.population[r1] -
self.population[... | [
"def",
"_randtobest1",
"(",
"self",
",",
"samples",
")",
":",
"r0",
",",
"r1",
",",
"r2",
"=",
"samples",
"[",
":",
"3",
"]",
"bprime",
"=",
"np",
".",
"copy",
"(",
"self",
".",
"population",
"[",
"r0",
"]",
")",
"bprime",
"+=",
"self",
".",
"s... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_differentialevolution.py#L958-L965 | |
tangzhenyu/Scene-Text-Understanding | 0f7ffc7aea5971a50cdc03d33d0a41075285948b | SynthText_Chinese/text_utils.py | python | TextSource.is_good | (self, txt, f=0.35) | return [ (len(l)> self.min_nchar
and self.check_symb_frac(l,f)
and is_txt(l)) for l in txt ] | T/F return : T iff the lines in txt (a list of txt lines)
are "valid".
A given line l is valid iff:
1. It is not empty.
2. symbol_fraction > f
3. Has at-least self.min_nchar characters
... | T/F return : T iff the lines in txt (a list of txt lines)
are "valid".
A given line l is valid iff:
1. It is not empty.
2. symbol_fraction > f
3. Has at-least self.min_nchar characters
... | [
"T",
"/",
"F",
"return",
":",
"T",
"iff",
"the",
"lines",
"in",
"txt",
"(",
"a",
"list",
"of",
"txt",
"lines",
")",
"are",
"valid",
".",
"A",
"given",
"line",
"l",
"is",
"valid",
"iff",
":",
"1",
".",
"It",
"is",
"not",
"empty",
".",
"2",
"."... | def is_good(self, txt, f=0.35):
"""
T/F return : T iff the lines in txt (a list of txt lines)
are "valid".
A given line l is valid iff:
1. It is not empty.
2. symbol_fraction > f
3. Has a... | [
"def",
"is_good",
"(",
"self",
",",
"txt",
",",
"f",
"=",
"0.35",
")",
":",
"def",
"is_txt",
"(",
"l",
")",
":",
"char_ex",
"=",
"[",
"'i'",
",",
"'I'",
",",
"'o'",
",",
"'O'",
",",
"'0'",
",",
"'-'",
"]",
"chs",
"=",
"[",
"ch",
"in",
"char... | https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/SynthText_Chinese/text_utils.py#L577-L594 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/linalg_grad.py | python | _BatchMatrixDeterminantGrad | (op, grad) | return multipliers * a_adj_inv | Gradient for BatchMatrixDeterminant. | Gradient for BatchMatrixDeterminant. | [
"Gradient",
"for",
"BatchMatrixDeterminant",
"."
] | def _BatchMatrixDeterminantGrad(op, grad):
"""Gradient for BatchMatrixDeterminant."""
a = op.inputs[0]
c = op.outputs[0]
a_adj_inv = linalg_ops.batch_matrix_inverse(a, adjoint=True)
multipliers = array_ops.reshape(
grad * c, array_ops.concat(0, [array_ops.shape(c), [1, 1]]))
return multipliers * a_adj... | [
"def",
"_BatchMatrixDeterminantGrad",
"(",
"op",
",",
"grad",
")",
":",
"a",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"c",
"=",
"op",
".",
"outputs",
"[",
"0",
"]",
"a_adj_inv",
"=",
"linalg_ops",
".",
"batch_matrix_inverse",
"(",
"a",
",",
"adjoint",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/linalg_grad.py#L75-L82 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.