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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Genius-x/genius-x | 9fc9f194e6d1fb92dd0e33d43db19ddb67cda7b0 | cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Cursor.translation_unit | (self) | return self._tu | Returns the TranslationUnit to which this Cursor belongs. | Returns the TranslationUnit to which this Cursor belongs. | [
"Returns",
"the",
"TranslationUnit",
"to",
"which",
"this",
"Cursor",
"belongs",
"."
] | def translation_unit(self):
"""Returns the TranslationUnit to which this Cursor belongs."""
# If this triggers an AttributeError, the instance was not properly
# created.
return self._tu | [
"def",
"translation_unit",
"(",
"self",
")",
":",
"# If this triggers an AttributeError, the instance was not properly",
"# created.",
"return",
"self",
".",
"_tu"
] | https://github.com/Genius-x/genius-x/blob/9fc9f194e6d1fb92dd0e33d43db19ddb67cda7b0/cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1268-L1272 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | GraphicsRenderer.CreatePath | (*args, **kwargs) | return _gdi_.GraphicsRenderer_CreatePath(*args, **kwargs) | CreatePath(self) -> GraphicsPath | CreatePath(self) -> GraphicsPath | [
"CreatePath",
"(",
"self",
")",
"-",
">",
"GraphicsPath"
] | def CreatePath(*args, **kwargs):
"""CreatePath(self) -> GraphicsPath"""
return _gdi_.GraphicsRenderer_CreatePath(*args, **kwargs) | [
"def",
"CreatePath",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsRenderer_CreatePath",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L6775-L6777 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/handlers.py | python | SocketHandler.close | (self) | Closes the socket. | Closes the socket. | [
"Closes",
"the",
"socket",
"."
] | def close(self):
"""
Closes the socket.
"""
self.acquire()
try:
if self.sock:
self.sock.close()
self.sock = None
finally:
self.release()
logging.Handler.close(self) | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"acquire",
"(",
")",
"try",
":",
"if",
"self",
".",
"sock",
":",
"self",
".",
"sock",
".",
"close",
"(",
")",
"self",
".",
"sock",
"=",
"None",
"finally",
":",
"self",
".",
"release",
"(",
")"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/handlers.py#L585-L596 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/mesa/MesaLib/src/mesa/main/APIspec.py | python | Checker.always_check | (self, name) | return False | Return true if the parameter is checked in all possible pathes. | Return true if the parameter is checked in all possible pathes. | [
"Return",
"true",
"if",
"the",
"parameter",
"is",
"checked",
"in",
"all",
"possible",
"pathes",
"."
] | def always_check(self, name):
"""Return true if the parameter is checked in all possible pathes."""
if name in self.switches:
return True
# a param is always checked if any of the switch always checks it
for switch in self.switches.itervalues():
# a switch always... | [
"def",
"always_check",
"(",
"self",
",",
"name",
")",
":",
"if",
"name",
"in",
"self",
".",
"switches",
":",
"return",
"True",
"# a param is always checked if any of the switch always checks it",
"for",
"switch",
"in",
"self",
".",
"switches",
".",
"itervalues",
"... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/mesa/MesaLib/src/mesa/main/APIspec.py#L379-L394 | |
CaoWGG/TensorRT-YOLOv4 | 4d7c2edce99e8794a4cb4ea3540d51ce91158a36 | onnx-tensorrt/third_party/onnx/third_party/benchmark/tools/gbench/util.py | python | find_benchmark_flag | (prefix, benchmark_flags) | return result | Search the specified list of flags for a flag matching `<prefix><arg>` and
if it is found return the arg it specifies. If specified more than once the
last value is returned. If the flag is not found None is returned. | Search the specified list of flags for a flag matching `<prefix><arg>` and
if it is found return the arg it specifies. If specified more than once the
last value is returned. If the flag is not found None is returned. | [
"Search",
"the",
"specified",
"list",
"of",
"flags",
"for",
"a",
"flag",
"matching",
"<prefix",
">",
"<arg",
">",
"and",
"if",
"it",
"is",
"found",
"return",
"the",
"arg",
"it",
"specifies",
".",
"If",
"specified",
"more",
"than",
"once",
"the",
"last",
... | def find_benchmark_flag(prefix, benchmark_flags):
"""
Search the specified list of flags for a flag matching `<prefix><arg>` and
if it is found return the arg it specifies. If specified more than once the
last value is returned. If the flag is not found None is returned.
"""
assert prefix.starts... | [
"def",
"find_benchmark_flag",
"(",
"prefix",
",",
"benchmark_flags",
")",
":",
"assert",
"prefix",
".",
"startswith",
"(",
"'--'",
")",
"and",
"prefix",
".",
"endswith",
"(",
"'='",
")",
"result",
"=",
"None",
"for",
"f",
"in",
"benchmark_flags",
":",
"if"... | https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/benchmark/tools/gbench/util.py#L87-L98 | |
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | scripts/plotting/load_events.py | python | load_values | (filename, event_names=None, layer_event_names=None, model=0) | return results | Load specified events from filename.
model specifies the model to load events from; -1 means any model.
event_names is a sequence of event names not associated with any layer to
load.
layer_event_names is a sequence of layer event names to load.
This assumes events are named in a relatively standard way:
... | Load specified events from filename. | [
"Load",
"specified",
"events",
"from",
"filename",
"."
] | def load_values(filename, event_names=None, layer_event_names=None, model=0):
"""Load specified events from filename.
model specifies the model to load events from; -1 means any model.
event_names is a sequence of event names not associated with any layer to
load.
layer_event_names is a sequence of layer eve... | [
"def",
"load_values",
"(",
"filename",
",",
"event_names",
"=",
"None",
",",
"layer_event_names",
"=",
"None",
",",
"model",
"=",
"0",
")",
":",
"if",
"event_names",
"is",
"None",
":",
"event_names",
"=",
"[",
"]",
"if",
"layer_event_names",
"is",
"None",
... | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/scripts/plotting/load_events.py#L59-L123 | |
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | clang/bindings/python/clang/cindex.py | python | Cursor.storage_class | (self) | return StorageClass.from_id(self._storage_class) | Retrieves the storage class (if any) of the entity pointed at by the
cursor. | Retrieves the storage class (if any) of the entity pointed at by the
cursor. | [
"Retrieves",
"the",
"storage",
"class",
"(",
"if",
"any",
")",
"of",
"the",
"entity",
"pointed",
"at",
"by",
"the",
"cursor",
"."
] | def storage_class(self):
"""
Retrieves the storage class (if any) of the entity pointed at by the
cursor.
"""
if not hasattr(self, '_storage_class'):
self._storage_class = conf.lib.clang_Cursor_getStorageClass(self)
return StorageClass.from_id(self._storage_c... | [
"def",
"storage_class",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_storage_class'",
")",
":",
"self",
".",
"_storage_class",
"=",
"conf",
".",
"lib",
".",
"clang_Cursor_getStorageClass",
"(",
"self",
")",
"return",
"StorageClass",
".... | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/bindings/python/clang/cindex.py#L1612-L1620 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/compiler_machinery.py | python | PassManager.add_pass | (self, pss, description="") | Append a pass to the PassManager's compilation pipeline | Append a pass to the PassManager's compilation pipeline | [
"Append",
"a",
"pass",
"to",
"the",
"PassManager",
"s",
"compilation",
"pipeline"
] | def add_pass(self, pss, description=""):
"""
Append a pass to the PassManager's compilation pipeline
"""
self._validate_pass(pss)
func_desc_tuple = (pss, description)
self.passes.append(func_desc_tuple)
self._finalized = False | [
"def",
"add_pass",
"(",
"self",
",",
"pss",
",",
"description",
"=",
"\"\"",
")",
":",
"self",
".",
"_validate_pass",
"(",
"pss",
")",
"func_desc_tuple",
"=",
"(",
"pss",
",",
"description",
")",
"self",
".",
"passes",
".",
"append",
"(",
"func_desc_tupl... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/compiler_machinery.py#L194-L201 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | Font.__ne__ | (*args, **kwargs) | return _gdi_.Font___ne__(*args, **kwargs) | __ne__(self, Font other) -> bool | __ne__(self, Font other) -> bool | [
"__ne__",
"(",
"self",
"Font",
"other",
")",
"-",
">",
"bool"
] | def __ne__(*args, **kwargs):
"""__ne__(self, Font other) -> bool"""
return _gdi_.Font___ne__(*args, **kwargs) | [
"def",
"__ne__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Font___ne__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L2181-L2183 | |
RapidsAtHKUST/CommunityDetectionCodes | 23dbafd2e57ab0f5f0528b1322c4a409f21e5892 | Algorithms/2008-CliquePercolation/src_python/seq_clique_percolation.py | python | kcliquePercolator | (net, k, start, stop, evaluations, reverse=False, weightFunction=None) | K-clique percolator. This sorts the edges and combines the phases I-II. See
helpstring below for explanation of the arguments. | K-clique percolator. This sorts the edges and combines the phases I-II. See
helpstring below for explanation of the arguments. | [
"K",
"-",
"clique",
"percolator",
".",
"This",
"sorts",
"the",
"edges",
"and",
"combines",
"the",
"phases",
"I",
"-",
"II",
".",
"See",
"helpstring",
"below",
"for",
"explanation",
"of",
"the",
"arguments",
"."
] | def kcliquePercolator(net, k, start, stop, evaluations, reverse=False, weightFunction=None):
"""
K-clique percolator. This sorts the edges and combines the phases I-II. See
helpstring below for explanation of the arguments.
"""
if weightFunction is None: # unweighted clique percolation with thresho... | [
"def",
"kcliquePercolator",
"(",
"net",
",",
"k",
",",
"start",
",",
"stop",
",",
"evaluations",
",",
"reverse",
"=",
"False",
",",
"weightFunction",
"=",
"None",
")",
":",
"if",
"weightFunction",
"is",
"None",
":",
"# unweighted clique percolation with threshol... | https://github.com/RapidsAtHKUST/CommunityDetectionCodes/blob/23dbafd2e57ab0f5f0528b1322c4a409f21e5892/Algorithms/2008-CliquePercolation/src_python/seq_clique_percolation.py#L783-L800 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/SocketServer.py | python | BaseServer.serve_forever | (self, poll_interval=0.5) | Handle one request at a time until shutdown.
Polls for shutdown every poll_interval seconds. Ignores
self.timeout. If you need to do periodic tasks, do them in
another thread. | Handle one request at a time until shutdown. | [
"Handle",
"one",
"request",
"at",
"a",
"time",
"until",
"shutdown",
"."
] | def serve_forever(self, poll_interval=0.5):
"""Handle one request at a time until shutdown.
Polls for shutdown every poll_interval seconds. Ignores
self.timeout. If you need to do periodic tasks, do them in
another thread.
"""
self.__serving = True
self.__is_shut... | [
"def",
"serve_forever",
"(",
"self",
",",
"poll_interval",
"=",
"0.5",
")",
":",
"self",
".",
"__serving",
"=",
"True",
"self",
".",
"__is_shut_down",
".",
"clear",
"(",
")",
"while",
"self",
".",
"__serving",
":",
"# XXX: Consider using another file descriptor ... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/SocketServer.py#L210-L227 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py | python | extract_dask_labels | (labels) | Extract data from dask.Series for labels. | Extract data from dask.Series for labels. | [
"Extract",
"data",
"from",
"dask",
".",
"Series",
"for",
"labels",
"."
] | def extract_dask_labels(labels):
"""Extract data from dask.Series for labels."""
if isinstance(labels, dd.DataFrame):
ncol = labels.columns
elif isinstance(labels, dd.Series):
ncol = labels.name
if isinstance(labels, allowed_classes):
if len(ncol) > 1:
raise ValueError('Only one column for lab... | [
"def",
"extract_dask_labels",
"(",
"labels",
")",
":",
"if",
"isinstance",
"(",
"labels",
",",
"dd",
".",
"DataFrame",
")",
":",
"ncol",
"=",
"labels",
".",
"columns",
"elif",
"isinstance",
"(",
"labels",
",",
"dd",
".",
"Series",
")",
":",
"ncol",
"="... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py#L71-L82 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py | python | MH.list_folders | (self) | return result | Return a list of folder names. | Return a list of folder names. | [
"Return",
"a",
"list",
"of",
"folder",
"names",
"."
] | def list_folders(self):
"""Return a list of folder names."""
result = []
for entry in os.listdir(self._path):
if os.path.isdir(os.path.join(self._path, entry)):
result.append(entry)
return result | [
"def",
"list_folders",
"(",
"self",
")",
":",
"result",
"=",
"[",
"]",
"for",
"entry",
"in",
"os",
".",
"listdir",
"(",
"self",
".",
"_path",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
"."... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L1092-L1098 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/BaseHTTPServer.py | python | BaseHTTPRequestHandler.parse_request | (self) | return True | Parse a request (internal).
The request should be stored in self.raw_requestline; the results
are in self.command, self.path, self.request_version and
self.headers.
Return True for success, False for failure; on failure, an
error is sent back. | Parse a request (internal). | [
"Parse",
"a",
"request",
"(",
"internal",
")",
"."
] | def parse_request(self):
"""Parse a request (internal).
The request should be stored in self.raw_requestline; the results
are in self.command, self.path, self.request_version and
self.headers.
Return True for success, False for failure; on failure, an
error is sent back... | [
"def",
"parse_request",
"(",
"self",
")",
":",
"self",
".",
"command",
"=",
"None",
"# set in case of error on the first line",
"self",
".",
"request_version",
"=",
"version",
"=",
"self",
".",
"default_request_version",
"self",
".",
"close_connection",
"=",
"1",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/BaseHTTPServer.py#L232-L299 | |
msracver/Deep-Image-Analogy | 632b9287b42552e32dad64922967c8c9ec7fc4d3 | scripts/cpp_lint.py | python | CleanseComments | (line) | return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line) | Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed. | Removes //-comments and single-line C-style /* */ comments. | [
"Removes",
"//",
"-",
"comments",
"and",
"single",
"-",
"line",
"C",
"-",
"style",
"/",
"*",
"*",
"/",
"comments",
"."
] | def CleanseComments(line):
"""Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed.
"""
commentpos = line.find('//')
if commentpos != -1 and not IsCppString(line[:commentpos]):
line = line[:commentpos]... | [
"def",
"CleanseComments",
"(",
"line",
")",
":",
"commentpos",
"=",
"line",
".",
"find",
"(",
"'//'",
")",
"if",
"commentpos",
"!=",
"-",
"1",
"and",
"not",
"IsCppString",
"(",
"line",
"[",
":",
"commentpos",
"]",
")",
":",
"line",
"=",
"line",
"[",
... | https://github.com/msracver/Deep-Image-Analogy/blob/632b9287b42552e32dad64922967c8c9ec7fc4d3/scripts/cpp_lint.py#L1167-L1180 | |
crankyoldgit/IRremoteESP8266 | 6bc095af80e5aec47d66f8c6263f3a943ea3b4d5 | tools/scrape_supported_devices.py | python | errorexit | (msg) | Print an error and exit on critical error | Print an error and exit on critical error | [
"Print",
"an",
"error",
"and",
"exit",
"on",
"critical",
"error"
] | def errorexit(msg):
"""Print an error and exit on critical error"""
sys.stderr.write(f"{msg}\n")
sys.exit(1) | [
"def",
"errorexit",
"(",
"msg",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"f\"{msg}\\n\"",
")",
"sys",
".",
"exit",
"(",
"1",
")"
] | https://github.com/crankyoldgit/IRremoteESP8266/blob/6bc095af80e5aec47d66f8c6263f3a943ea3b4d5/tools/scrape_supported_devices.py#L279-L282 | ||
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/generator/msvs.py | python | _ShardName | (name, number) | return '#'.join(parts) | Add a shard number to the end of a target.
Arguments:
name: name of the target (foo#target)
number: shard number
Returns:
Target name with shard added (foo_1#target) | Add a shard number to the end of a target. | [
"Add",
"a",
"shard",
"number",
"to",
"the",
"end",
"of",
"a",
"target",
"."
] | def _ShardName(name, number):
"""Add a shard number to the end of a target.
Arguments:
name: name of the target (foo#target)
number: shard number
Returns:
Target name with shard added (foo_1#target)
"""
parts = name.rsplit('#', 1)
parts[0] = '%s_%d' % (parts[0], number)
return '#'.join(parts) | [
"def",
"_ShardName",
"(",
"name",
",",
"number",
")",
":",
"parts",
"=",
"name",
".",
"rsplit",
"(",
"'#'",
",",
"1",
")",
"parts",
"[",
"0",
"]",
"=",
"'%s_%d'",
"%",
"(",
"parts",
"[",
"0",
"]",
",",
"number",
")",
"return",
"'#'",
".",
"join... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/msvs.py#L1717-L1728 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/internetcontent/nv_python_libs/tedtalks/tedtalks_api.py | python | Videos.updateTedTalks | (self, create=False) | return | Create or update the tedtalks.xml user preferences file
return nothing | Create or update the tedtalks.xml user preferences file
return nothing | [
"Create",
"or",
"update",
"the",
"tedtalks",
".",
"xml",
"user",
"preferences",
"file",
"return",
"nothing"
] | def updateTedTalks(self, create=False):
''' Create or update the tedtalks.xml user preferences file
return nothing
'''
userDefaultFile = '%s/nv_python_libs/configs/XML/defaultUserPrefs/tedtalks.xml' % (baseProcessingDir, )
if os.path.isfile(userDefaultFile):
# Read th... | [
"def",
"updateTedTalks",
"(",
"self",
",",
"create",
"=",
"False",
")",
":",
"userDefaultFile",
"=",
"'%s/nv_python_libs/configs/XML/defaultUserPrefs/tedtalks.xml'",
"%",
"(",
"baseProcessingDir",
",",
")",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"userDefaultFi... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/tedtalks/tedtalks_api.py#L251-L299 | |
Tencent/PhoenixGo | fbf67f9aec42531bff9569c44b85eb4c3f37b7be | configure.py | python | convert_version_to_int | (version) | return int(version_str) | Convert a version number to a integer that can be used to compare.
Version strings of the form X.YZ and X.Y.Z-xxxxx are supported. The
'xxxxx' part, for instance 'homebrew' on OS/X, is ignored.
Args:
version: a version to be converted
Returns:
An integer if converted successfully, otherwise return No... | Convert a version number to a integer that can be used to compare. | [
"Convert",
"a",
"version",
"number",
"to",
"a",
"integer",
"that",
"can",
"be",
"used",
"to",
"compare",
"."
] | def convert_version_to_int(version):
"""Convert a version number to a integer that can be used to compare.
Version strings of the form X.YZ and X.Y.Z-xxxxx are supported. The
'xxxxx' part, for instance 'homebrew' on OS/X, is ignored.
Args:
version: a version to be converted
Returns:
An integer if c... | [
"def",
"convert_version_to_int",
"(",
"version",
")",
":",
"version",
"=",
"version",
".",
"split",
"(",
"'-'",
")",
"[",
"0",
"]",
"version_segments",
"=",
"version",
".",
"split",
"(",
"'.'",
")",
"for",
"seg",
"in",
"version_segments",
":",
"if",
"not... | https://github.com/Tencent/PhoenixGo/blob/fbf67f9aec42531bff9569c44b85eb4c3f37b7be/configure.py#L421-L440 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/ndarray/ndarray.py | python | NDArray._get_nd_basic_indexing | (self, key) | return sliced_nd.reshape(oshape) | This function is called when key is a slice, or an integer,
or a tuple of slices or integers | This function is called when key is a slice, or an integer,
or a tuple of slices or integers | [
"This",
"function",
"is",
"called",
"when",
"key",
"is",
"a",
"slice",
"or",
"an",
"integer",
"or",
"a",
"tuple",
"of",
"slices",
"or",
"integers"
] | def _get_nd_basic_indexing(self, key):
"""This function is called when key is a slice, or an integer,
or a tuple of slices or integers"""
shape = self.shape
if isinstance(key, integer_types):
if key > shape[0] - 1:
raise IndexError(
'index ... | [
"def",
"_get_nd_basic_indexing",
"(",
"self",
",",
"key",
")",
":",
"shape",
"=",
"self",
".",
"shape",
"if",
"isinstance",
"(",
"key",
",",
"integer_types",
")",
":",
"if",
"key",
">",
"shape",
"[",
"0",
"]",
"-",
"1",
":",
"raise",
"IndexError",
"(... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L758-L821 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/cnn_chinese_text_classification/data_helpers.py | python | get_chinese_text | () | Download the chinese_text dataset and unzip it | Download the chinese_text dataset and unzip it | [
"Download",
"the",
"chinese_text",
"dataset",
"and",
"unzip",
"it"
] | def get_chinese_text():
"""Download the chinese_text dataset and unzip it"""
if not os.path.isdir("data/"):
os.system("mkdir data/")
if (not os.path.exists('data/pos.txt')) or \
(not os.path.exists('data/neg')):
os.system("wget -q https://raw.githubusercontent.com/dmlc/web-data/master... | [
"def",
"get_chinese_text",
"(",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"\"data/\"",
")",
":",
"os",
".",
"system",
"(",
"\"mkdir data/\"",
")",
"if",
"(",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"'data/pos.txt'",
")",
")",... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/cnn_chinese_text_classification/data_helpers.py#L51-L61 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/timeseries/python/timeseries/state_space_models/periodic.py | python | ResolutionCycleModel.transition_power_noise_accumulator | (self, num_steps) | return current_accumulation + noise_addition_scalar * array_ops.gather(
remaining_step_noise_additions, indices=remaining_whole_steps) | Sum the transitioned covariance matrix over a number of steps.
Args:
num_steps: An integer Tensor of any shape [...] indicating the number of
steps to compute for each part of the batch.
Returns:
A [..., self._num_latent_values - 1, self._num_latent_values - 1] floating
point Tensor ... | Sum the transitioned covariance matrix over a number of steps. | [
"Sum",
"the",
"transitioned",
"covariance",
"matrix",
"over",
"a",
"number",
"of",
"steps",
"."
] | def transition_power_noise_accumulator(self, num_steps):
"""Sum the transitioned covariance matrix over a number of steps.
Args:
num_steps: An integer Tensor of any shape [...] indicating the number of
steps to compute for each part of the batch.
Returns:
A [..., self._num_latent_value... | [
"def",
"transition_power_noise_accumulator",
"(",
"self",
",",
"num_steps",
")",
":",
"def",
"_whole_periods_folded",
"(",
")",
":",
"\"\"\"A more efficient special casing for integer periods.\n\n We knock off full periods, leaving at most self._true_periodicity steps to\n comput... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/state_space_models/periodic.py#L334-L426 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM2_Duplicate_REQUEST.__init__ | (self, objectHandle = TPM_HANDLE(), newParentHandle = TPM_HANDLE(), encryptionKeyIn = None, symmetricAlg = None) | This command duplicates a loaded object so that it may be used in a
different hierarchy. The new parent key for the duplicate may be on the
same or different TPM or TPM_RH_NULL. Only the public area of
newParentHandle is required to be loaded.
Attributes:
objectHandle (TPM_H... | This command duplicates a loaded object so that it may be used in a
different hierarchy. The new parent key for the duplicate may be on the
same or different TPM or TPM_RH_NULL. Only the public area of
newParentHandle is required to be loaded. | [
"This",
"command",
"duplicates",
"a",
"loaded",
"object",
"so",
"that",
"it",
"may",
"be",
"used",
"in",
"a",
"different",
"hierarchy",
".",
"The",
"new",
"parent",
"key",
"for",
"the",
"duplicate",
"may",
"be",
"on",
"the",
"same",
"or",
"different",
"T... | def __init__(self, objectHandle = TPM_HANDLE(), newParentHandle = TPM_HANDLE(), encryptionKeyIn = None, symmetricAlg = None):
""" This command duplicates a loaded object so that it may be used in a
different hierarchy. The new parent key for the duplicate may be on the
same or different TPM or T... | [
"def",
"__init__",
"(",
"self",
",",
"objectHandle",
"=",
"TPM_HANDLE",
"(",
")",
",",
"newParentHandle",
"=",
"TPM_HANDLE",
"(",
")",
",",
"encryptionKeyIn",
"=",
"None",
",",
"symmetricAlg",
"=",
"None",
")",
":",
"self",
".",
"objectHandle",
"=",
"objec... | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L10271-L10294 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/_cpreqbody.py | python | Entity.default_proc | (self) | Called if a more-specific processor is not found for the ``Content-Type``. | Called if a more-specific processor is not found for the ``Content-Type``. | [
"Called",
"if",
"a",
"more",
"-",
"specific",
"processor",
"is",
"not",
"found",
"for",
"the",
"Content",
"-",
"Type",
"."
] | def default_proc(self):
"""Called if a more-specific processor is not found for the ``Content-Type``."""
# Leave the fp alone for someone else to read. This works fine
# for request.body, but the Part subclasses need to override this
# so they can move on to the next part.
pass | [
"def",
"default_proc",
"(",
"self",
")",
":",
"# Leave the fp alone for someone else to read. This works fine",
"# for request.body, but the Part subclasses need to override this",
"# so they can move on to the next part.",
"pass"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/_cpreqbody.py#L517-L522 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgi.py | python | FieldStorage.read_lines_to_eof | (self) | Internal: read lines until EOF. | Internal: read lines until EOF. | [
"Internal",
":",
"read",
"lines",
"until",
"EOF",
"."
] | def read_lines_to_eof(self):
"""Internal: read lines until EOF."""
while 1:
line = self.fp.readline(1<<16) # bytes
self.bytes_read += len(line)
if not line:
self.done = -1
break
self.__write(line) | [
"def",
"read_lines_to_eof",
"(",
"self",
")",
":",
"while",
"1",
":",
"line",
"=",
"self",
".",
"fp",
".",
"readline",
"(",
"1",
"<<",
"16",
")",
"# bytes",
"self",
".",
"bytes_read",
"+=",
"len",
"(",
"line",
")",
"if",
"not",
"line",
":",
"self",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgi.py#L743-L751 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/genpy/src/genpy/rostime.py | python | Duration.__mul__ | (self, val) | Multiply this duration by an integer or float
:param val: multiplication factor, ``int/float``
:returns: :class:`Duration` multiplied by val | Multiply this duration by an integer or float
:param val: multiplication factor, ``int/float``
:returns: :class:`Duration` multiplied by val | [
"Multiply",
"this",
"duration",
"by",
"an",
"integer",
"or",
"float",
":",
"param",
"val",
":",
"multiplication",
"factor",
"int",
"/",
"float",
":",
"returns",
":",
":",
"class",
":",
"Duration",
"multiplied",
"by",
"val"
] | def __mul__(self, val):
"""
Multiply this duration by an integer or float
:param val: multiplication factor, ``int/float``
:returns: :class:`Duration` multiplied by val
"""
t = type(val)
if t in (int, long):
return Duration(self.secs * val, self.nsecs ... | [
"def",
"__mul__",
"(",
"self",
",",
"val",
")",
":",
"t",
"=",
"type",
"(",
"val",
")",
"if",
"t",
"in",
"(",
"int",
",",
"long",
")",
":",
"return",
"Duration",
"(",
"self",
".",
"secs",
"*",
"val",
",",
"self",
".",
"nsecs",
"*",
"val",
")"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/genpy/src/genpy/rostime.py#L377-L389 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/more-itertools/py3/more_itertools/recipes.py | python | random_product | (*args, repeat=1) | return tuple(choice(pool) for pool in pools) | Draw an item at random from each of the input iterables.
>>> random_product('abc', range(4), 'XYZ') # doctest:+SKIP
('c', 3, 'Z')
If *repeat* is provided as a keyword argument, that many items will be
drawn from each iterable.
>>> random_product('abcd', range(4), repeat=2) # doctest... | Draw an item at random from each of the input iterables. | [
"Draw",
"an",
"item",
"at",
"random",
"from",
"each",
"of",
"the",
"input",
"iterables",
"."
] | def random_product(*args, repeat=1):
"""Draw an item at random from each of the input iterables.
>>> random_product('abc', range(4), 'XYZ') # doctest:+SKIP
('c', 3, 'Z')
If *repeat* is provided as a keyword argument, that many items will be
drawn from each iterable.
>>> random_pr... | [
"def",
"random_product",
"(",
"*",
"args",
",",
"repeat",
"=",
"1",
")",
":",
"pools",
"=",
"[",
"tuple",
"(",
"pool",
")",
"for",
"pool",
"in",
"args",
"]",
"*",
"repeat",
"return",
"tuple",
"(",
"choice",
"(",
"pool",
")",
"for",
"pool",
"in",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/more-itertools/py3/more_itertools/recipes.py#L488-L505 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.StyleSetFontEncoding | (*args, **kwargs) | return _stc.StyledTextCtrl_StyleSetFontEncoding(*args, **kwargs) | StyleSetFontEncoding(self, int style, int encoding)
Set the font encoding to be used by a style. | StyleSetFontEncoding(self, int style, int encoding) | [
"StyleSetFontEncoding",
"(",
"self",
"int",
"style",
"int",
"encoding",
")"
] | def StyleSetFontEncoding(*args, **kwargs):
"""
StyleSetFontEncoding(self, int style, int encoding)
Set the font encoding to be used by a style.
"""
return _stc.StyledTextCtrl_StyleSetFontEncoding(*args, **kwargs) | [
"def",
"StyleSetFontEncoding",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_StyleSetFontEncoding",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L6573-L6579 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/perf/PRESUBMIT.py | python | _CheckJson | (input_api, output_api) | return [] | Checks whether JSON files in this change can be parsed. | Checks whether JSON files in this change can be parsed. | [
"Checks",
"whether",
"JSON",
"files",
"in",
"this",
"change",
"can",
"be",
"parsed",
"."
] | def _CheckJson(input_api, output_api):
"""Checks whether JSON files in this change can be parsed."""
for affected_file in input_api.AffectedFiles(include_deletes=False):
filename = affected_file.AbsoluteLocalPath()
if os.path.splitext(filename)[1] != '.json':
continue
try:
input_api.json.loa... | [
"def",
"_CheckJson",
"(",
"input_api",
",",
"output_api",
")",
":",
"for",
"affected_file",
"in",
"input_api",
".",
"AffectedFiles",
"(",
"include_deletes",
"=",
"False",
")",
":",
"filename",
"=",
"affected_file",
".",
"AbsoluteLocalPath",
"(",
")",
"if",
"os... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/perf/PRESUBMIT.py#L76-L86 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | MenuItemList.__len__ | (*args, **kwargs) | return _core_.MenuItemList___len__(*args, **kwargs) | __len__(self) -> size_t | __len__(self) -> size_t | [
"__len__",
"(",
"self",
")",
"-",
">",
"size_t"
] | def __len__(*args, **kwargs):
"""__len__(self) -> size_t"""
return _core_.MenuItemList___len__(*args, **kwargs) | [
"def",
"__len__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItemList___len__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L11972-L11974 | |
shader-slang/slang | b8982fcf43b86c1e39dcc3dd19bff2821633eda6 | external/vulkan/registry/vkconventions.py | python | VulkanConventions.extension_include_string | (self, ext) | return 'include::{{appendices}}/{name}{suffix}[]'.format(
name=ext.name, suffix=self.file_suffix) | Return format string for include:: line for an extension appendix
file. ext is an object with the following members:
- name - extension string string
- vendor - vendor portion of name
- barename - remainder of name | Return format string for include:: line for an extension appendix
file. ext is an object with the following members:
- name - extension string string
- vendor - vendor portion of name
- barename - remainder of name | [
"Return",
"format",
"string",
"for",
"include",
"::",
"line",
"for",
"an",
"extension",
"appendix",
"file",
".",
"ext",
"is",
"an",
"object",
"with",
"the",
"following",
"members",
":",
"-",
"name",
"-",
"extension",
"string",
"string",
"-",
"vendor",
"-",... | def extension_include_string(self, ext):
"""Return format string for include:: line for an extension appendix
file. ext is an object with the following members:
- name - extension string string
- vendor - vendor portion of name
- barename - remainder of name"""
... | [
"def",
"extension_include_string",
"(",
"self",
",",
"ext",
")",
":",
"return",
"'include::{{appendices}}/{name}{suffix}[]'",
".",
"format",
"(",
"name",
"=",
"ext",
".",
"name",
",",
"suffix",
"=",
"self",
".",
"file_suffix",
")"
] | https://github.com/shader-slang/slang/blob/b8982fcf43b86c1e39dcc3dd19bff2821633eda6/external/vulkan/registry/vkconventions.py#L238-L246 | |
google/nucleus | 68d3947fafba1337f294c0668a6e1c7f3f1273e3 | nucleus/util/variantcall_utils.py | python | get_min_dp | (variant_call) | return struct_utils.get_int_field(
variant_call.info, 'MIN_DP', is_single_field=True) | Gets the 'MIN_DP' field of the VariantCall. | Gets the 'MIN_DP' field of the VariantCall. | [
"Gets",
"the",
"MIN_DP",
"field",
"of",
"the",
"VariantCall",
"."
] | def get_min_dp(variant_call):
"""Gets the 'MIN_DP' field of the VariantCall."""
return struct_utils.get_int_field(
variant_call.info, 'MIN_DP', is_single_field=True) | [
"def",
"get_min_dp",
"(",
"variant_call",
")",
":",
"return",
"struct_utils",
".",
"get_int_field",
"(",
"variant_call",
".",
"info",
",",
"'MIN_DP'",
",",
"is_single_field",
"=",
"True",
")"
] | https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/util/variantcall_utils.py#L187-L190 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py | python | File.prepare | (self) | Prepare for this file to be created. | Prepare for this file to be created. | [
"Prepare",
"for",
"this",
"file",
"to",
"be",
"created",
"."
] | def prepare(self):
"""Prepare for this file to be created."""
SCons.Node.Node.prepare(self)
if self.get_state() != SCons.Node.up_to_date:
if self.exists():
if self.is_derived() and not self.precious:
self._rmv_existing()
else:
... | [
"def",
"prepare",
"(",
"self",
")",
":",
"SCons",
".",
"Node",
".",
"Node",
".",
"prepare",
"(",
"self",
")",
"if",
"self",
".",
"get_state",
"(",
")",
"!=",
"SCons",
".",
"Node",
".",
"up_to_date",
":",
"if",
"self",
".",
"exists",
"(",
")",
":"... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py#L3081-L3094 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/input.py | python | QualifyDependencies | (targets) | Make dependency links fully-qualified relative to the current directory.
|targets| is a dict mapping fully-qualified target names to their target
dicts. For each target in this dict, keys known to contain dependency
links are examined, and any dependencies referenced will be rewritten
so that they are fully-q... | Make dependency links fully-qualified relative to the current directory. | [
"Make",
"dependency",
"links",
"fully",
"-",
"qualified",
"relative",
"to",
"the",
"current",
"directory",
"."
] | def QualifyDependencies(targets):
"""Make dependency links fully-qualified relative to the current directory.
|targets| is a dict mapping fully-qualified target names to their target
dicts. For each target in this dict, keys known to contain dependency
links are examined, and any dependencies referenced will ... | [
"def",
"QualifyDependencies",
"(",
"targets",
")",
":",
"all_dependency_sections",
"=",
"[",
"dep",
"+",
"op",
"for",
"dep",
"in",
"dependency_sections",
"for",
"op",
"in",
"(",
"''",
",",
"'!'",
",",
"'/'",
")",
"]",
"for",
"target",
",",
"target_dict",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/input.py#L1353-L1389 | ||
networkit/networkit | 695b7a786a894a303fa8587597d5ef916e797729 | networkit/GEXFIO.py | python | GEXFWriter.__init__ | (self) | Initializes the class. | Initializes the class. | [
"Initializes",
"the",
"class",
"."
] | def __init__(self):
""" Initializes the class. """
self.edgeIdctr = 0
self.q = queue.Queue()
self.hasDynamicWeight = False | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"edgeIdctr",
"=",
"0",
"self",
".",
"q",
"=",
"queue",
".",
"Queue",
"(",
")",
"self",
".",
"hasDynamicWeight",
"=",
"False"
] | https://github.com/networkit/networkit/blob/695b7a786a894a303fa8587597d5ef916e797729/networkit/GEXFIO.py#L263-L267 | ||
cinder/Cinder | e83f5bb9c01a63eec20168d02953a0879e5100f7 | docs/libs/bs4/builder/__init__.py | python | TreeBuilder._replace_cdata_list_attribute_values | (self, tag_name, attrs) | return attrs | Replaces class="foo bar" with class=["foo", "bar"]
Modifies its input in place. | Replaces class="foo bar" with class=["foo", "bar"] | [
"Replaces",
"class",
"=",
"foo",
"bar",
"with",
"class",
"=",
"[",
"foo",
"bar",
"]"
] | def _replace_cdata_list_attribute_values(self, tag_name, attrs):
"""Replaces class="foo bar" with class=["foo", "bar"]
Modifies its input in place.
"""
if not attrs:
return attrs
if self.cdata_list_attributes:
universal = self.cdata_list_attributes.get('*... | [
"def",
"_replace_cdata_list_attribute_values",
"(",
"self",
",",
"tag_name",
",",
"attrs",
")",
":",
"if",
"not",
"attrs",
":",
"return",
"attrs",
"if",
"self",
".",
"cdata_list_attributes",
":",
"universal",
"=",
"self",
".",
"cdata_list_attributes",
".",
"get"... | https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/libs/bs4/builder/__init__.py#L145-L173 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/enum_type_wrapper.py | python | EnumTypeWrapper.Value | (self, name) | Returns the value coresponding to the given enum name. | Returns the value coresponding to the given enum name. | [
"Returns",
"the",
"value",
"coresponding",
"to",
"the",
"given",
"enum",
"name",
"."
] | def Value(self, name):
"""Returns the value coresponding to the given enum name."""
if name in self._enum_type.values_by_name:
return self._enum_type.values_by_name[name].number
raise ValueError('Enum %s has no value defined for name %s' % (
self._enum_type.name, name)) | [
"def",
"Value",
"(",
"self",
",",
"name",
")",
":",
"if",
"name",
"in",
"self",
".",
"_enum_type",
".",
"values_by_name",
":",
"return",
"self",
".",
"_enum_type",
".",
"values_by_name",
"[",
"name",
"]",
".",
"number",
"raise",
"ValueError",
"(",
"'Enum... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/enum_type_wrapper.py#L58-L63 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/mapreduce/mapreduce/handlers.py | python | MapperWorkerCallbackHandler._has_old_request_ended | (self, shard_state) | return True | Whether previous slice retry has ended according to Logs API.
Args:
shard_state: shard state.
Returns:
True if the request of previous slice retry has ended. False if it has
not or unknown. | Whether previous slice retry has ended according to Logs API. | [
"Whether",
"previous",
"slice",
"retry",
"has",
"ended",
"according",
"to",
"Logs",
"API",
"."
] | def _has_old_request_ended(self, shard_state):
"""Whether previous slice retry has ended according to Logs API.
Args:
shard_state: shard state.
Returns:
True if the request of previous slice retry has ended. False if it has
not or unknown.
"""
assert shard_state.slice_start_time is... | [
"def",
"_has_old_request_ended",
"(",
"self",
",",
"shard_state",
")",
":",
"assert",
"shard_state",
".",
"slice_start_time",
"is",
"not",
"None",
"assert",
"shard_state",
".",
"slice_request_id",
"is",
"not",
"None",
"request_ids",
"=",
"[",
"shard_state",
".",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/handlers.py#L290-L314 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/_supervised_learning.py | python | SupervisedLearningModel.__str__ | (self) | return self.__class__.__name__ | Return a string description of the model to the ``print`` method.
Returns
-------
out : string
A description of the model. | Return a string description of the model to the ``print`` method. | [
"Return",
"a",
"string",
"description",
"of",
"the",
"model",
"to",
"the",
"print",
"method",
"."
] | def __str__(self):
"""
Return a string description of the model to the ``print`` method.
Returns
-------
out : string
A description of the model.
"""
return self.__class__.__name__ | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"self",
".",
"__class__",
".",
"__name__"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/_supervised_learning.py#L36-L45 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge2.py | python | ExodusModel._order_element_faces_by_block | (members) | return members_by_block | Sort element faces by element block id.
This takes in a list of members of the form:
* '(element_block_id, element_index, face_index)'
This outputs a dictionary with the form
* 'output[element_block_id] = list of (element_index, face_index)' | Sort element faces by element block id. | [
"Sort",
"element",
"faces",
"by",
"element",
"block",
"id",
"."
] | def _order_element_faces_by_block(members):
"""
Sort element faces by element block id.
This takes in a list of members of the form:
* '(element_block_id, element_index, face_index)'
This outputs a dictionary with the form
* 'output[element_block_id] = list of (element_... | [
"def",
"_order_element_faces_by_block",
"(",
"members",
")",
":",
"members_by_block",
"=",
"dict",
"(",
")",
"for",
"element_block_id",
",",
"element_index",
",",
"face_index",
"in",
"members",
":",
"if",
"element_block_id",
"not",
"in",
"members_by_block",
":",
"... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L1401-L1418 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PowderILLParameterScan.py | python | PowderILLParameterScan._configure | (self) | Configures the input properties | Configures the input properties | [
"Configures",
"the",
"input",
"properties"
] | def _configure(self):
"""
Configures the input properties
"""
self._out_name = self.getPropertyValue('OutputWorkspace')
self._observable = self.getPropertyValue('Observable')
self._sort_x_axis = self.getProperty('SortObservableAxis').value
self._normalise_opti... | [
"def",
"_configure",
"(",
"self",
")",
":",
"self",
".",
"_out_name",
"=",
"self",
".",
"getPropertyValue",
"(",
"'OutputWorkspace'",
")",
"self",
".",
"_observable",
"=",
"self",
".",
"getPropertyValue",
"(",
"'Observable'",
")",
"self",
".",
"_sort_x_axis",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PowderILLParameterScan.py#L200-L215 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/cookielib.py | python | split_header_words | (header_values) | return result | r"""Parse header values into a list of lists containing key,value pairs.
The function knows how to deal with ",", ";" and "=" as well as quoted
values after "=". A list of space separated tokens are parsed as if they
were separated by ";".
If the header_values passed as argument contains multiple val... | r"""Parse header values into a list of lists containing key,value pairs. | [
"r",
"Parse",
"header",
"values",
"into",
"a",
"list",
"of",
"lists",
"containing",
"key",
"value",
"pairs",
"."
] | def split_header_words(header_values):
r"""Parse header values into a list of lists containing key,value pairs.
The function knows how to deal with ",", ";" and "=" as well as quoted
values after "=". A list of space separated tokens are parsed as if they
were separated by ";".
If the header_valu... | [
"def",
"split_header_words",
"(",
"header_values",
")",
":",
"assert",
"not",
"isinstance",
"(",
"header_values",
",",
"basestring",
")",
"result",
"=",
"[",
"]",
"for",
"text",
"in",
"header_values",
":",
"orig_text",
"=",
"text",
"pairs",
"=",
"[",
"]",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/cookielib.py#L326-L409 | |
chipsalliance/verible | aa14e0074ff89945bf65eecfb9ef78684d996058 | verilog/tools/syntax/export_json_examples/verible_verilog_syntax.py | python | VeribleVerilogSyntax.parse_files | (self, paths: List[str], options: Dict[str, Any] = None) | return self._parse(paths, options = options) | Parse multiple SystemVerilog files.
Args:
paths: list of paths to files to parse.
options: dict with parsing options.
Available options:
gen_tree (boolean): whether to generate syntax tree.
skip_null (boolean): null nodes won't be stored in a tree if True.
gen_toke... | Parse multiple SystemVerilog files. | [
"Parse",
"multiple",
"SystemVerilog",
"files",
"."
] | def parse_files(self, paths: List[str], options: Dict[str, Any] = None) \
-> Dict[str, SyntaxData]:
"""Parse multiple SystemVerilog files.
Args:
paths: list of paths to files to parse.
options: dict with parsing options.
Available options:
gen_tree (boolean): whe... | [
"def",
"parse_files",
"(",
"self",
",",
"paths",
":",
"List",
"[",
"str",
"]",
",",
"options",
":",
"Dict",
"[",
"str",
",",
"Any",
"]",
"=",
"None",
")",
"->",
"Dict",
"[",
"str",
",",
"SyntaxData",
"]",
":",
"return",
"self",
".",
"_parse",
"("... | https://github.com/chipsalliance/verible/blob/aa14e0074ff89945bf65eecfb9ef78684d996058/verilog/tools/syntax/export_json_examples/verible_verilog_syntax.py#L476-L493 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | Argument.AddInitArgs | (self, args) | return args.append(self) | Adds init arguments for this argument to the given list. | Adds init arguments for this argument to the given list. | [
"Adds",
"init",
"arguments",
"for",
"this",
"argument",
"to",
"the",
"given",
"list",
"."
] | def AddInitArgs(self, args):
"""Adds init arguments for this argument to the given list."""
return args.append(self) | [
"def",
"AddInitArgs",
"(",
"self",
",",
"args",
")",
":",
"return",
"args",
".",
"append",
"(",
"self",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L4556-L4558 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/plotconfigdialog/__init__.py | python | generate_ax_name | (ax) | return position | Generate a name for the given axes. This will come from the
title of the axes (if there is one) and the position of the axes
on the figure. | Generate a name for the given axes. This will come from the
title of the axes (if there is one) and the position of the axes
on the figure. | [
"Generate",
"a",
"name",
"for",
"the",
"given",
"axes",
".",
"This",
"will",
"come",
"from",
"the",
"title",
"of",
"the",
"axes",
"(",
"if",
"there",
"is",
"one",
")",
"and",
"the",
"position",
"of",
"the",
"axes",
"on",
"the",
"figure",
"."
] | def generate_ax_name(ax):
"""
Generate a name for the given axes. This will come from the
title of the axes (if there is one) and the position of the axes
on the figure.
"""
title = ax.get_title()
position = "({}, {})".format(row_num(ax), col_num(ax))
if title:
return "{}: {}".fo... | [
"def",
"generate_ax_name",
"(",
"ax",
")",
":",
"title",
"=",
"ax",
".",
"get_title",
"(",
")",
"position",
"=",
"\"({}, {})\"",
".",
"format",
"(",
"row_num",
"(",
"ax",
")",
",",
"col_num",
"(",
"ax",
")",
")",
"if",
"title",
":",
"return",
"\"{}: ... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/plotconfigdialog/__init__.py#L15-L25 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/lite/toco/logging/gen_html.py | python | gen_conversion_log_html | (conversion_log_dir, quantization_enabled,
tflite_graph_path) | Generates an HTML report about the conversion process.
Args:
conversion_log_dir: A string specifying the file directory of the conversion
logs. It's required that before calling this function, the
`conversion_log_dir`
already contains the following files: `toco_log_before.pb`,
`toco_log... | Generates an HTML report about the conversion process. | [
"Generates",
"an",
"HTML",
"report",
"about",
"the",
"conversion",
"process",
"."
] | def gen_conversion_log_html(conversion_log_dir, quantization_enabled,
tflite_graph_path):
"""Generates an HTML report about the conversion process.
Args:
conversion_log_dir: A string specifying the file directory of the conversion
logs. It's required that before calling this f... | [
"def",
"gen_conversion_log_html",
"(",
"conversion_log_dir",
",",
"quantization_enabled",
",",
"tflite_graph_path",
")",
":",
"template_filename",
"=",
"_resource_loader",
".",
"get_path_to_datafile",
"(",
"\"template.html\"",
")",
"if",
"not",
"os",
".",
"path",
".",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/toco/logging/gen_html.py#L204-L265 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/mpi_collectives/__init__.py | python | DistributedOptimizer._create_slots | (self, *args, **kwargs) | return self._optimizer._create_slots(*args, **kwargs) | Calls this same method on the underlying optimizer. | Calls this same method on the underlying optimizer. | [
"Calls",
"this",
"same",
"method",
"on",
"the",
"underlying",
"optimizer",
"."
] | def _create_slots(self, *args, **kwargs):
"""Calls this same method on the underlying optimizer."""
return self._optimizer._create_slots(*args, **kwargs) | [
"def",
"_create_slots",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_optimizer",
".",
"_create_slots",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/mpi_collectives/__init__.py#L223-L225 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/gluon/utils.py | python | download | (url, path=None, overwrite=False, sha1_hash=None, retries=5, verify_ssl=True) | return fname | Download an given URL
Parameters
----------
url : str
URL to download
path : str, optional
Destination path to store downloaded file. By default stores to the
current directory with same name as in url.
overwrite : bool, optional
Whether to overwrite destination file... | Download an given URL | [
"Download",
"an",
"given",
"URL"
] | def download(url, path=None, overwrite=False, sha1_hash=None, retries=5, verify_ssl=True):
"""Download an given URL
Parameters
----------
url : str
URL to download
path : str, optional
Destination path to store downloaded file. By default stores to the
current directory with... | [
"def",
"download",
"(",
"url",
",",
"path",
"=",
"None",
",",
"overwrite",
"=",
"False",
",",
"sha1_hash",
"=",
"None",
",",
"retries",
"=",
"5",
",",
"verify_ssl",
"=",
"True",
")",
":",
"if",
"path",
"is",
"None",
":",
"fname",
"=",
"url",
".",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/utils.py#L259-L350 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/defchararray.py | python | translate | (a, table, deletechars=None) | For each element in `a`, return a copy of the string where all
characters occurring in the optional argument `deletechars` are
removed, and the remaining characters have been mapped through the
given translation table.
Calls `str.translate` element-wise.
Parameters
----------
a : array-lik... | For each element in `a`, return a copy of the string where all
characters occurring in the optional argument `deletechars` are
removed, and the remaining characters have been mapped through the
given translation table. | [
"For",
"each",
"element",
"in",
"a",
"return",
"a",
"copy",
"of",
"the",
"string",
"where",
"all",
"characters",
"occurring",
"in",
"the",
"optional",
"argument",
"deletechars",
"are",
"removed",
"and",
"the",
"remaining",
"characters",
"have",
"been",
"mapped... | def translate(a, table, deletechars=None):
"""
For each element in `a`, return a copy of the string where all
characters occurring in the optional argument `deletechars` are
removed, and the remaining characters have been mapped through the
given translation table.
Calls `str.translate` element... | [
"def",
"translate",
"(",
"a",
",",
"table",
",",
"deletechars",
"=",
"None",
")",
":",
"a_arr",
"=",
"numpy",
".",
"asarray",
"(",
"a",
")",
"if",
"issubclass",
"(",
"a_arr",
".",
"dtype",
".",
"type",
",",
"unicode_",
")",
":",
"return",
"_vec_strin... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/defchararray.py#L1504-L1537 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/algorithms/openpmd.py | python | openPMDReader.SetFileName | (self, name) | Specify filename for the file to read. | Specify filename for the file to read. | [
"Specify",
"filename",
"for",
"the",
"file",
"to",
"read",
"."
] | def SetFileName(self, name):
"""Specify filename for the file to read."""
if self._filename != name:
self._filename = name
self._timevalues = None
if self._series:
self._series = None
self.Modified() | [
"def",
"SetFileName",
"(",
"self",
",",
"name",
")",
":",
"if",
"self",
".",
"_filename",
"!=",
"name",
":",
"self",
".",
"_filename",
"=",
"name",
"self",
".",
"_timevalues",
"=",
"None",
"if",
"self",
".",
"_series",
":",
"self",
".",
"_series",
"=... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/algorithms/openpmd.py#L72-L79 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/configdialog.py | python | KeysPage.save_new_key_set | (keyset_name, keyset) | Save a newly created core key set.
Add keyset to idleConf.userCfg['keys'], not to disk.
If the keyset doesn't exist, it is created. The
binding/keys are taken from the keyset argument.
keyset_name - string, the name of the new key set
keyset - dictionary containing the new key... | Save a newly created core key set. | [
"Save",
"a",
"newly",
"created",
"core",
"key",
"set",
"."
] | def save_new_key_set(keyset_name, keyset):
"""Save a newly created core key set.
Add keyset to idleConf.userCfg['keys'], not to disk.
If the keyset doesn't exist, it is created. The
binding/keys are taken from the keyset argument.
keyset_name - string, the name of the new key ... | [
"def",
"save_new_key_set",
"(",
"keyset_name",
",",
"keyset",
")",
":",
"idleConf",
".",
"userCfg",
"[",
"'keys'",
"]",
".",
"AddSection",
"(",
"keyset_name",
")",
"for",
"event",
"in",
"keyset",
":",
"value",
"=",
"keyset",
"[",
"event",
"]",
"idleConf",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/configdialog.py#L1723-L1736 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/beautifulsoup4/bs4/element.py | python | PageElement._is_xml | (self) | return self.parent._is_xml | Is this element part of an XML tree or an HTML tree?
This is used when mapping a formatter name ("minimal") to an
appropriate function (one that performs entity-substitution on
the contents of <script> and <style> tags, or not). It's
inefficient, but it should be called very rarely. | Is this element part of an XML tree or an HTML tree? | [
"Is",
"this",
"element",
"part",
"of",
"an",
"XML",
"tree",
"or",
"an",
"HTML",
"tree?"
] | def _is_xml(self):
"""Is this element part of an XML tree or an HTML tree?
This is used when mapping a formatter name ("minimal") to an
appropriate function (one that performs entity-substitution on
the contents of <script> and <style> tags, or not). It's
inefficient, but it sho... | [
"def",
"_is_xml",
"(",
"self",
")",
":",
"if",
"self",
".",
"parent",
"is",
"None",
":",
"# This is the top-level object. It should have .is_xml set",
"# from tree creation. If not, take a guess--BS is usually",
"# used on HTML markup.",
"return",
"getattr",
"(",
"self",
",",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/beautifulsoup4/bs4/element.py#L164-L177 | |
ros-planning/moveit | ee48dc5cedc981d0869352aa3db0b41469c2735c | moveit_commander/src/moveit_commander/move_group.py | python | MoveGroupCommander.clear_pose_targets | (self) | Clear all known pose targets | Clear all known pose targets | [
"Clear",
"all",
"known",
"pose",
"targets"
] | def clear_pose_targets(self):
""" Clear all known pose targets """
self._g.clear_pose_targets() | [
"def",
"clear_pose_targets",
"(",
"self",
")",
":",
"self",
".",
"_g",
".",
"clear_pose_targets",
"(",
")"
] | https://github.com/ros-planning/moveit/blob/ee48dc5cedc981d0869352aa3db0b41469c2735c/moveit_commander/src/moveit_commander/move_group.py#L391-L393 | ||
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/yapf/yapf/yapflib/file_resources.py | python | WriteReformattedCode | (filename,
reformatted_code,
in_place=False,
encoding='') | Emit the reformatted code.
Write the reformatted code into the file, if in_place is True. Otherwise,
write to stdout.
Arguments:
filename: (unicode) The name of the unformatted file.
reformatted_code: (unicode) The reformatted code.
in_place: (bool) If True, then write the reformatted code to the fi... | Emit the reformatted code. | [
"Emit",
"the",
"reformatted",
"code",
"."
] | def WriteReformattedCode(filename,
reformatted_code,
in_place=False,
encoding=''):
"""Emit the reformatted code.
Write the reformatted code into the file, if in_place is True. Otherwise,
write to stdout.
Arguments:
filename: (unico... | [
"def",
"WriteReformattedCode",
"(",
"filename",
",",
"reformatted_code",
",",
"in_place",
"=",
"False",
",",
"encoding",
"=",
"''",
")",
":",
"if",
"in_place",
":",
"with",
"py3compat",
".",
"open_with_encoding",
"(",
"filename",
",",
"mode",
"=",
"'w'",
","... | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/yapf/yapf/yapflib/file_resources.py#L79-L99 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PyProperty._SetSelf | (*args, **kwargs) | return _propgrid.PyProperty__SetSelf(*args, **kwargs) | _SetSelf(self, PyObject self) | _SetSelf(self, PyObject self) | [
"_SetSelf",
"(",
"self",
"PyObject",
"self",
")"
] | def _SetSelf(*args, **kwargs):
"""_SetSelf(self, PyObject self)"""
return _propgrid.PyProperty__SetSelf(*args, **kwargs) | [
"def",
"_SetSelf",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PyProperty__SetSelf",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L4508-L4510 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | GDALTransformerInfoShadow.TransformPoint | (self, *args) | return _gdal.GDALTransformerInfoShadow_TransformPoint(self, *args) | r"""
TransformPoint(GDALTransformerInfoShadow self, int bDstToSrc, double [3] inout) -> int
TransformPoint(GDALTransformerInfoShadow self, int bDstToSrc, double x, double y, double z=0.0) -> int | r"""
TransformPoint(GDALTransformerInfoShadow self, int bDstToSrc, double [3] inout) -> int
TransformPoint(GDALTransformerInfoShadow self, int bDstToSrc, double x, double y, double z=0.0) -> int | [
"r",
"TransformPoint",
"(",
"GDALTransformerInfoShadow",
"self",
"int",
"bDstToSrc",
"double",
"[",
"3",
"]",
"inout",
")",
"-",
">",
"int",
"TransformPoint",
"(",
"GDALTransformerInfoShadow",
"self",
"int",
"bDstToSrc",
"double",
"x",
"double",
"y",
"double",
"... | def TransformPoint(self, *args):
r"""
TransformPoint(GDALTransformerInfoShadow self, int bDstToSrc, double [3] inout) -> int
TransformPoint(GDALTransformerInfoShadow self, int bDstToSrc, double x, double y, double z=0.0) -> int
"""
return _gdal.GDALTransformerInfoShadow_Transform... | [
"def",
"TransformPoint",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_gdal",
".",
"GDALTransformerInfoShadow_TransformPoint",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L4006-L4011 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PGChoices.Insert | (*args) | return _propgrid.PGChoices_Insert(*args) | Insert(self, String label, int index, int value=INT_MAX)
Insert(self, entry, int index) | Insert(self, String label, int index, int value=INT_MAX)
Insert(self, entry, int index) | [
"Insert",
"(",
"self",
"String",
"label",
"int",
"index",
"int",
"value",
"=",
"INT_MAX",
")",
"Insert",
"(",
"self",
"entry",
"int",
"index",
")"
] | def Insert(*args):
"""
Insert(self, String label, int index, int value=INT_MAX)
Insert(self, entry, int index)
"""
return _propgrid.PGChoices_Insert(*args) | [
"def",
"Insert",
"(",
"*",
"args",
")",
":",
"return",
"_propgrid",
".",
"PGChoices_Insert",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L297-L302 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/__init__.py | python | Reporter.info | (self, *args, **kwargs) | return self.system_message(self.INFO_LEVEL, *args, **kwargs) | Level-1, "INFO": a minor issue that can be ignored. Typically there is
no effect on processing, and level-1 system messages are not reported. | Level-1, "INFO": a minor issue that can be ignored. Typically there is
no effect on processing, and level-1 system messages are not reported. | [
"Level",
"-",
"1",
"INFO",
":",
"a",
"minor",
"issue",
"that",
"can",
"be",
"ignored",
".",
"Typically",
"there",
"is",
"no",
"effect",
"on",
"processing",
"and",
"level",
"-",
"1",
"system",
"messages",
"are",
"not",
"reported",
"."
] | def info(self, *args, **kwargs):
"""
Level-1, "INFO": a minor issue that can be ignored. Typically there is
no effect on processing, and level-1 system messages are not reported.
"""
return self.system_message(self.INFO_LEVEL, *args, **kwargs) | [
"def",
"info",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"system_message",
"(",
"self",
".",
"INFO_LEVEL",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/__init__.py#L209-L214 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | fpIsNaN | (a, ctx=None) | return _mk_fp_unary_pred(Z3_mk_fpa_is_nan, a, ctx) | Create a Z3 floating-point isNaN expression.
>>> s = FPSort(8, 24)
>>> x = FP('x', s)
>>> y = FP('y', s)
>>> fpIsNaN(x)
fpIsNaN(x) | Create a Z3 floating-point isNaN expression. | [
"Create",
"a",
"Z3",
"floating",
"-",
"point",
"isNaN",
"expression",
"."
] | def fpIsNaN(a, ctx=None):
"""Create a Z3 floating-point isNaN expression.
>>> s = FPSort(8, 24)
>>> x = FP('x', s)
>>> y = FP('y', s)
>>> fpIsNaN(x)
fpIsNaN(x)
"""
return _mk_fp_unary_pred(Z3_mk_fpa_is_nan, a, ctx) | [
"def",
"fpIsNaN",
"(",
"a",
",",
"ctx",
"=",
"None",
")",
":",
"return",
"_mk_fp_unary_pred",
"(",
"Z3_mk_fpa_is_nan",
",",
"a",
",",
"ctx",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L10200-L10209 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | cmake/developer_package/cpplint/cpplint.py | python | IsDerivedFunction | (clean_lines, linenum) | return False | Check if current line contains an inherited function.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains a function with "override"
virt-specifier. | Check if current line contains an inherited function. | [
"Check",
"if",
"current",
"line",
"contains",
"an",
"inherited",
"function",
"."
] | def IsDerivedFunction(clean_lines, linenum):
"""Check if current line contains an inherited function.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains a function with "override"
virt-specifier.
""... | [
"def",
"IsDerivedFunction",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"# Scan back a few lines for start of current function",
"for",
"i",
"in",
"xrange",
"(",
"linenum",
",",
"max",
"(",
"-",
"1",
",",
"linenum",
"-",
"10",
")",
",",
"-",
"1",
")",
":",... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/cmake/developer_package/cpplint/cpplint.py#L5205-L5224 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/learn/python/learn/utils/export.py | python | _export_graph | (graph, saver, checkpoint_path, export_dir,
default_graph_signature, named_graph_signatures,
exports_to_keep) | Exports graph via session_bundle, by creating a Session. | Exports graph via session_bundle, by creating a Session. | [
"Exports",
"graph",
"via",
"session_bundle",
"by",
"creating",
"a",
"Session",
"."
] | def _export_graph(graph, saver, checkpoint_path, export_dir,
default_graph_signature, named_graph_signatures,
exports_to_keep):
"""Exports graph via session_bundle, by creating a Session."""
with graph.as_default():
with tf_session.Session('') as session:
variables.init... | [
"def",
"_export_graph",
"(",
"graph",
",",
"saver",
",",
"checkpoint_path",
",",
"export_dir",
",",
"default_graph_signature",
",",
"named_graph_signatures",
",",
"exports_to_keep",
")",
":",
"with",
"graph",
".",
"as_default",
"(",
")",
":",
"with",
"tf_session",... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/utils/export.py#L59-L76 | ||
line/stellite | 5bd1c1f5f0cdc22a65319068f4f8b2ca7769bfa1 | tools/build.py | python | BuildObject.execute | (self, command, env=None, cwd=None) | execute shell command | execute shell command | [
"execute",
"shell",
"command"
] | def execute(self, command, env=None, cwd=None):
"""execute shell command"""
res = self.execute_with_error(command, env=env, cwd=cwd)
if bool(res) == True:
return
raise Exception('command execution are failed') | [
"def",
"execute",
"(",
"self",
",",
"command",
",",
"env",
"=",
"None",
",",
"cwd",
"=",
"None",
")",
":",
"res",
"=",
"self",
".",
"execute_with_error",
"(",
"command",
",",
"env",
"=",
"env",
",",
"cwd",
"=",
"cwd",
")",
"if",
"bool",
"(",
"res... | https://github.com/line/stellite/blob/5bd1c1f5f0cdc22a65319068f4f8b2ca7769bfa1/tools/build.py#L717-L723 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | cmake/developer_package/cpplint/cpplint.py | python | FindCheckMacro | (line) | return (None, -1) | Find a replaceable CHECK-like macro.
Args:
line: line to search on.
Returns:
(macro name, start position), or (None, -1) if no replaceable
macro is found. | Find a replaceable CHECK-like macro. | [
"Find",
"a",
"replaceable",
"CHECK",
"-",
"like",
"macro",
"."
] | def FindCheckMacro(line):
"""Find a replaceable CHECK-like macro.
Args:
line: line to search on.
Returns:
(macro name, start position), or (None, -1) if no replaceable
macro is found.
"""
for macro in _CHECK_MACROS:
i = line.find(macro)
if i >= 0:
# Find opening pa... | [
"def",
"FindCheckMacro",
"(",
"line",
")",
":",
"for",
"macro",
"in",
"_CHECK_MACROS",
":",
"i",
"=",
"line",
".",
"find",
"(",
"macro",
")",
"if",
"i",
">=",
"0",
":",
"# Find opening parenthesis. Do a regular expression match here",
"# to make sure that we are ma... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/cmake/developer_package/cpplint/cpplint.py#L4342-L4362 | |
CMU-Perceptual-Computing-Lab/caffe_rtpose | a4778bb1c3eb74d7250402016047216f77b4dba6 | python/caffe/pycaffe.py | python | _Net_params | (self) | return self._params_dict | An OrderedDict (bottom to top, i.e., input to output) of network
parameters indexed by name; each is a list of multiple blobs (e.g.,
weights and biases) | An OrderedDict (bottom to top, i.e., input to output) of network
parameters indexed by name; each is a list of multiple blobs (e.g.,
weights and biases) | [
"An",
"OrderedDict",
"(",
"bottom",
"to",
"top",
"i",
".",
"e",
".",
"input",
"to",
"output",
")",
"of",
"network",
"parameters",
"indexed",
"by",
"name",
";",
"each",
"is",
"a",
"list",
"of",
"multiple",
"blobs",
"(",
"e",
".",
"g",
".",
"weights",
... | def _Net_params(self):
"""
An OrderedDict (bottom to top, i.e., input to output) of network
parameters indexed by name; each is a list of multiple blobs (e.g.,
weights and biases)
"""
if not hasattr(self, '_params_dict'):
self._params_dict = OrderedDict([(name, lr.blobs)
... | [
"def",
"_Net_params",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_params_dict'",
")",
":",
"self",
".",
"_params_dict",
"=",
"OrderedDict",
"(",
"[",
"(",
"name",
",",
"lr",
".",
"blobs",
")",
"for",
"name",
",",
"lr",
"in",
... | https://github.com/CMU-Perceptual-Computing-Lab/caffe_rtpose/blob/a4778bb1c3eb74d7250402016047216f77b4dba6/python/caffe/pycaffe.py#L48-L59 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/device_worker.py | python | HeterSection._gen_worker_desc | (self, trainer_desc) | Generator worker desc, which device worker is HeterSectionWorker.
Args:
trainer_desc(TrainerDesc): a TrainerDesc object | Generator worker desc, which device worker is HeterSectionWorker.
Args:
trainer_desc(TrainerDesc): a TrainerDesc object | [
"Generator",
"worker",
"desc",
"which",
"device",
"worker",
"is",
"HeterSectionWorker",
".",
"Args",
":",
"trainer_desc",
"(",
"TrainerDesc",
")",
":",
"a",
"TrainerDesc",
"object"
] | def _gen_worker_desc(self, trainer_desc):
"""
Generator worker desc, which device worker is HeterSectionWorker.
Args:
trainer_desc(TrainerDesc): a TrainerDesc object
"""
from google.protobuf import text_format
from . import core
trainer_desc.device_wor... | [
"def",
"_gen_worker_desc",
"(",
"self",
",",
"trainer_desc",
")",
":",
"from",
"google",
".",
"protobuf",
"import",
"text_format",
"from",
".",
"import",
"core",
"trainer_desc",
".",
"device_worker_name",
"=",
"\"HeterSectionWorker\"",
"heter_pipeline_opt",
"=",
"se... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/device_worker.py#L455-L475 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgi.py | python | parse | (fp=None, environ=os.environ, keep_blank_values=0,
strict_parsing=0, separator='&') | return urllib.parse.parse_qs(qs, keep_blank_values, strict_parsing,
encoding=encoding, separator=separator) | Parse a query in the environment or from a file (default stdin)
Arguments, all optional:
fp : file pointer; default: sys.stdin.buffer
environ : environment dictionary; default: os.environ
keep_blank_values: flag indicating whether blank values in
perc... | Parse a query in the environment or from a file (default stdin) | [
"Parse",
"a",
"query",
"in",
"the",
"environment",
"or",
"from",
"a",
"file",
"(",
"default",
"stdin",
")"
] | def parse(fp=None, environ=os.environ, keep_blank_values=0,
strict_parsing=0, separator='&'):
"""Parse a query in the environment or from a file (default stdin)
Arguments, all optional:
fp : file pointer; default: sys.stdin.buffer
environ : environment dicti... | [
"def",
"parse",
"(",
"fp",
"=",
"None",
",",
"environ",
"=",
"os",
".",
"environ",
",",
"keep_blank_values",
"=",
"0",
",",
"strict_parsing",
"=",
"0",
",",
"separator",
"=",
"'&'",
")",
":",
"if",
"fp",
"is",
"None",
":",
"fp",
"=",
"sys",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgi.py#L120-L187 | |
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Transpose.py | python | Transpose.first_dim | (self, first_dim) | Sets the first dimension to be switched. | Sets the first dimension to be switched. | [
"Sets",
"the",
"first",
"dimension",
"to",
"be",
"switched",
"."
] | def first_dim(self, first_dim):
"""Sets the first dimension to be switched.
"""
first_index = self.dimensions.index(first_dim)
self._internal.set_first_dim(first_index) | [
"def",
"first_dim",
"(",
"self",
",",
"first_dim",
")",
":",
"first_index",
"=",
"self",
".",
"dimensions",
".",
"index",
"(",
"first_dim",
")",
"self",
".",
"_internal",
".",
"set_first_dim",
"(",
"first_index",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Transpose.py#L70-L75 | ||
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | tools/workspace/pybind11/pybind_coverage_xml_parser.py | python | FileCoverage.__init__ | (self, xml_file, pybind_strings, file_coverage_csv) | Constructor for `FileCoverage` instance.
Args:
xml_file: XML file to process.
pybind_strings (list): Documentation strings parsed from pybind
bindings.
file_coverage_csv (str): Name of the CSV file to write file
coverage st... | Constructor for `FileCoverage` instance. | [
"Constructor",
"for",
"FileCoverage",
"instance",
"."
] | def __init__(self, xml_file, pybind_strings, file_coverage_csv):
"""Constructor for `FileCoverage` instance.
Args:
xml_file: XML file to process.
pybind_strings (list): Documentation strings parsed from pybind
bindings.
file_coverage_c... | [
"def",
"__init__",
"(",
"self",
",",
"xml_file",
",",
"pybind_strings",
",",
"file_coverage_csv",
")",
":",
"self",
".",
"xml_root",
"=",
"ET",
".",
"parse",
"(",
"xml_file",
")",
".",
"getroot",
"(",
")",
"self",
".",
"pybind_strings",
"=",
"pybind_string... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/workspace/pybind11/pybind_coverage_xml_parser.py#L197-L212 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | python | VisualStudioVersion.UsesVcxproj | (self) | return self.uses_vcxproj | Returns true if this version uses a vcxproj file. | Returns true if this version uses a vcxproj file. | [
"Returns",
"true",
"if",
"this",
"version",
"uses",
"a",
"vcxproj",
"file",
"."
] | def UsesVcxproj(self):
"""Returns true if this version uses a vcxproj file."""
return self.uses_vcxproj | [
"def",
"UsesVcxproj",
"(",
"self",
")",
":",
"return",
"self",
".",
"uses_vcxproj"
] | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py#L50-L52 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextParagraphLayoutBox.Reset | (*args, **kwargs) | return _richtext.RichTextParagraphLayoutBox_Reset(*args, **kwargs) | Reset(self) | Reset(self) | [
"Reset",
"(",
"self",
")"
] | def Reset(*args, **kwargs):
"""Reset(self)"""
return _richtext.RichTextParagraphLayoutBox_Reset(*args, **kwargs) | [
"def",
"Reset",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraphLayoutBox_Reset",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1652-L1654 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py | python | Decimal.scaleb | (self, other, context=None) | return d | Returns self operand after adding the second value to its exp. | Returns self operand after adding the second value to its exp. | [
"Returns",
"self",
"operand",
"after",
"adding",
"the",
"second",
"value",
"to",
"its",
"exp",
"."
] | def scaleb(self, other, context=None):
"""Returns self operand after adding the second value to its exp."""
if context is None:
context = getcontext()
other = _convert_other(other, raiseit=True)
ans = self._check_nans(other, context)
if ans:
return ans
... | [
"def",
"scaleb",
"(",
"self",
",",
"other",
",",
"context",
"=",
"None",
")",
":",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"getcontext",
"(",
")",
"other",
"=",
"_convert_other",
"(",
"other",
",",
"raiseit",
"=",
"True",
")",
"ans",
"=",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L3565-L3588 | |
neilogd/Engine | 58fe0eed517b894e67dd646f0f5adfe328e129fb | 3rdparty/jsoncpp/doxybuild.py | python | do_subst_in_file | (targetfile, sourcefile, dict) | Replace all instances of the keys of dict with their values.
For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'},
then all instances of %VERSION% in the file will be replaced with 1.2345 etc. | Replace all instances of the keys of dict with their values.
For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'},
then all instances of %VERSION% in the file will be replaced with 1.2345 etc. | [
"Replace",
"all",
"instances",
"of",
"the",
"keys",
"of",
"dict",
"with",
"their",
"values",
".",
"For",
"example",
"if",
"dict",
"is",
"{",
"%VERSION%",
":",
"1",
".",
"2345",
"%BASE%",
":",
"MyProg",
"}",
"then",
"all",
"instances",
"of",
"%VERSION%",
... | def do_subst_in_file(targetfile, sourcefile, dict):
"""Replace all instances of the keys of dict with their values.
For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'},
then all instances of %VERSION% in the file will be replaced with 1.2345 etc.
"""
with open(sourcefile, 'r') as f:
... | [
"def",
"do_subst_in_file",
"(",
"targetfile",
",",
"sourcefile",
",",
"dict",
")",
":",
"with",
"open",
"(",
"sourcefile",
",",
"'r'",
")",
"as",
"f",
":",
"contents",
"=",
"f",
".",
"read",
"(",
")",
"for",
"(",
"k",
",",
"v",
")",
"in",
"list",
... | https://github.com/neilogd/Engine/blob/58fe0eed517b894e67dd646f0f5adfe328e129fb/3rdparty/jsoncpp/doxybuild.py#L41-L52 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PGChoices.ExtractData | (*args, **kwargs) | return _propgrid.PGChoices_ExtractData(*args, **kwargs) | ExtractData(self) | ExtractData(self) | [
"ExtractData",
"(",
"self",
")"
] | def ExtractData(*args, **kwargs):
"""ExtractData(self)"""
return _propgrid.PGChoices_ExtractData(*args, **kwargs) | [
"def",
"ExtractData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGChoices_ExtractData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L339-L341 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/MSVSProject.py | python | Tool.__init__ | (self, name, attrs=None) | Initializes the tool.
Args:
name: Tool name.
attrs: Dict of tool attributes; may be None. | Initializes the tool. | [
"Initializes",
"the",
"tool",
"."
] | def __init__(self, name, attrs=None):
"""Initializes the tool.
Args:
name: Tool name.
attrs: Dict of tool attributes; may be None.
"""
self._attrs = attrs or {}
self._attrs['Name'] = name | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"attrs",
"=",
"None",
")",
":",
"self",
".",
"_attrs",
"=",
"attrs",
"or",
"{",
"}",
"self",
".",
"_attrs",
"[",
"'Name'",
"]",
"=",
"name"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/MSVSProject.py#L16-L24 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.SetFoldMarginHiColour | (*args, **kwargs) | return _stc.StyledTextCtrl_SetFoldMarginHiColour(*args, **kwargs) | SetFoldMarginHiColour(self, bool useSetting, Colour fore) | SetFoldMarginHiColour(self, bool useSetting, Colour fore) | [
"SetFoldMarginHiColour",
"(",
"self",
"bool",
"useSetting",
"Colour",
"fore",
")"
] | def SetFoldMarginHiColour(*args, **kwargs):
"""SetFoldMarginHiColour(self, bool useSetting, Colour fore)"""
return _stc.StyledTextCtrl_SetFoldMarginHiColour(*args, **kwargs) | [
"def",
"SetFoldMarginHiColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetFoldMarginHiColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L4322-L4324 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiMDIChildFrame.GetIcons | (*args, **kwargs) | return _aui.AuiMDIChildFrame_GetIcons(*args, **kwargs) | GetIcons(self) -> wxIconBundle | GetIcons(self) -> wxIconBundle | [
"GetIcons",
"(",
"self",
")",
"-",
">",
"wxIconBundle"
] | def GetIcons(*args, **kwargs):
"""GetIcons(self) -> wxIconBundle"""
return _aui.AuiMDIChildFrame_GetIcons(*args, **kwargs) | [
"def",
"GetIcons",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiMDIChildFrame_GetIcons",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L1546-L1548 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/hooks.py | python | HierarchicalEmitter._emit | (self, event_name, kwargs, stop_on_response=False) | return responses | Emit an event with optional keyword arguments.
:type event_name: string
:param event_name: Name of the event
:type kwargs: dict
:param kwargs: Arguments to be passed to the handler functions.
:type stop_on_response: boolean
:param stop_on_response: Whether to stop on the... | Emit an event with optional keyword arguments. | [
"Emit",
"an",
"event",
"with",
"optional",
"keyword",
"arguments",
"."
] | def _emit(self, event_name, kwargs, stop_on_response=False):
"""
Emit an event with optional keyword arguments.
:type event_name: string
:param event_name: Name of the event
:type kwargs: dict
:param kwargs: Arguments to be passed to the handler functions.
:type ... | [
"def",
"_emit",
"(",
"self",
",",
"event_name",
",",
"kwargs",
",",
"stop_on_response",
"=",
"False",
")",
":",
"responses",
"=",
"[",
"]",
"# Invoke the event handlers from most specific",
"# to least specific, each time stripping off a dot.",
"handlers_to_call",
"=",
"s... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/hooks.py#L177-L215 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/ops/functions.py | python | UserFunction.serialize | (self) | return {} | Generates a dictionary that captures the state of this user-defined function.
This method must be overridden, if a user function has any state that needs
to be preserved in the model dictionary. | Generates a dictionary that captures the state of this user-defined function. | [
"Generates",
"a",
"dictionary",
"that",
"captures",
"the",
"state",
"of",
"this",
"user",
"-",
"defined",
"function",
"."
] | def serialize(self):
'''
Generates a dictionary that captures the state of this user-defined function.
This method must be overridden, if a user function has any state that needs
to be preserved in the model dictionary.
'''
return {} | [
"def",
"serialize",
"(",
"self",
")",
":",
"return",
"{",
"}"
] | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/ops/functions.py#L1932-L1939 | |
baidu/lac | 3e10dbed9bfd87bea927c84a6627a167c17b5617 | python/LAC/reader.py | python | SegDataset.parse_tag | (self, line) | return "".join(words), tags | convert segment data to lac data format | convert segment data to lac data format | [
"convert",
"segment",
"data",
"to",
"lac",
"data",
"format"
] | def parse_tag(self, line):
"""convert segment data to lac data format"""
tags = []
words = line.strip().split()
for word in words:
if len(word) == 1:
tags.append('-S')
else:
tags += ['-B'] + ['-I'] * (len(word) - 2) + ['-E']
... | [
"def",
"parse_tag",
"(",
"self",
",",
"line",
")",
":",
"tags",
"=",
"[",
"]",
"words",
"=",
"line",
".",
"strip",
"(",
")",
".",
"split",
"(",
")",
"for",
"word",
"in",
"words",
":",
"if",
"len",
"(",
"word",
")",
"==",
"1",
":",
"tags",
"."... | https://github.com/baidu/lac/blob/3e10dbed9bfd87bea927c84a6627a167c17b5617/python/LAC/reader.py#L192-L203 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | KeyEvent.GetPosition | (*args, **kwargs) | return _core_.KeyEvent_GetPosition(*args, **kwargs) | GetPosition(self) -> Point
Find the position of the event, if applicable. | GetPosition(self) -> Point | [
"GetPosition",
"(",
"self",
")",
"-",
">",
"Point"
] | def GetPosition(*args, **kwargs):
"""
GetPosition(self) -> Point
Find the position of the event, if applicable.
"""
return _core_.KeyEvent_GetPosition(*args, **kwargs) | [
"def",
"GetPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"KeyEvent_GetPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L6061-L6067 | |
wujian16/Cornell-MOE | df299d1be882d2af9796d7a68b3f9505cac7a53e | moe/optimal_learning/python/cpp_wrappers/knowledge_gradient_mcmc.py | python | KnowledgeGradientMCMC.problem_size | (self) | return self.num_to_sample * self.dim | Return the number of independent parameters to optimize. | Return the number of independent parameters to optimize. | [
"Return",
"the",
"number",
"of",
"independent",
"parameters",
"to",
"optimize",
"."
] | def problem_size(self):
"""Return the number of independent parameters to optimize."""
return self.num_to_sample * self.dim | [
"def",
"problem_size",
"(",
"self",
")",
":",
"return",
"self",
".",
"num_to_sample",
"*",
"self",
".",
"dim"
] | https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/cpp_wrappers/knowledge_gradient_mcmc.py#L437-L439 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/recurrent/python/ops/recurrent.py | python | _Pack | (elements, struct_template) | return nest.pack_sequence_as(struct_template, elements) | Packs the list of tensors according to the structure.
In the event that `elements` should be a scalar, `struct_template` must
contain exactly one non-trivial element (for instance, `[[], {'x':elt}]`).
Args:
elements: Elements to be packed. A list of tensor, or a single tensor.
struct_template: The conta... | Packs the list of tensors according to the structure. | [
"Packs",
"the",
"list",
"of",
"tensors",
"according",
"to",
"the",
"structure",
"."
] | def _Pack(elements, struct_template):
"""Packs the list of tensors according to the structure.
In the event that `elements` should be a scalar, `struct_template` must
contain exactly one non-trivial element (for instance, `[[], {'x':elt}]`).
Args:
elements: Elements to be packed. A list of tensor, or a si... | [
"def",
"_Pack",
"(",
"elements",
",",
"struct_template",
")",
":",
"if",
"not",
"nest",
".",
"is_sequence",
"(",
"elements",
")",
":",
"return",
"nest",
".",
"pack_sequence_as",
"(",
"struct_template",
",",
"[",
"elements",
"]",
")",
"return",
"nest",
".",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/recurrent/python/ops/recurrent.py#L139-L154 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | DataFormat.GetType | (*args, **kwargs) | return _misc_.DataFormat_GetType(*args, **kwargs) | GetType(self) -> int
Returns the platform-specific number identifying the format. | GetType(self) -> int | [
"GetType",
"(",
"self",
")",
"-",
">",
"int"
] | def GetType(*args, **kwargs):
"""
GetType(self) -> int
Returns the platform-specific number identifying the format.
"""
return _misc_.DataFormat_GetType(*args, **kwargs) | [
"def",
"GetType",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DataFormat_GetType",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4866-L4872 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/ssd/dataset/imdb.py | python | Imdb.save_imglist | (self, fname=None, root=None, shuffle=False) | save imglist to disk
Parameters:
----------
fname : str
saved filename | save imglist to disk | [
"save",
"imglist",
"to",
"disk"
] | def save_imglist(self, fname=None, root=None, shuffle=False):
"""
save imglist to disk
Parameters:
----------
fname : str
saved filename
"""
def progress_bar(count, total, suffix=''):
import sys
bar_len = 24
filled_... | [
"def",
"save_imglist",
"(",
"self",
",",
"fname",
"=",
"None",
",",
"root",
"=",
"None",
",",
"shuffle",
"=",
"False",
")",
":",
"def",
"progress_bar",
"(",
"count",
",",
"total",
",",
"suffix",
"=",
"''",
")",
":",
"import",
"sys",
"bar_len",
"=",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/ssd/dataset/imdb.py#L70-L110 | ||
JarveeLee/SynthText_Chinese_version | 4b2cbc7d14741f21d0bb17966a339ab3574b09a8 | colorize3_poisson.py | python | FontColor.sample_from_data | (self, bg_mat) | bg_mat : this is a nxmx3 RGB image.
returns a tuple : (RGB_foreground, RGB_background)
each of these is a 3-vector. | bg_mat : this is a nxmx3 RGB image.
returns a tuple : (RGB_foreground, RGB_background)
each of these is a 3-vector. | [
"bg_mat",
":",
"this",
"is",
"a",
"nxmx3",
"RGB",
"image",
".",
"returns",
"a",
"tuple",
":",
"(",
"RGB_foreground",
"RGB_background",
")",
"each",
"of",
"these",
"is",
"a",
"3",
"-",
"vector",
"."
] | def sample_from_data(self, bg_mat):
"""
bg_mat : this is a nxmx3 RGB image.
returns a tuple : (RGB_foreground, RGB_background)
each of these is a 3-vector.
"""
bg_orig = bg_mat.copy()
bg_mat = cv.cvtColor(bg_mat, cv.cv.CV_RGB2Lab)
bg_mat = np.resh... | [
"def",
"sample_from_data",
"(",
"self",
",",
"bg_mat",
")",
":",
"bg_orig",
"=",
"bg_mat",
".",
"copy",
"(",
")",
"bg_mat",
"=",
"cv",
".",
"cvtColor",
"(",
"bg_mat",
",",
"cv",
".",
"cv",
".",
"CV_RGB2Lab",
")",
"bg_mat",
"=",
"np",
".",
"reshape",
... | https://github.com/JarveeLee/SynthText_Chinese_version/blob/4b2cbc7d14741f21d0bb17966a339ab3574b09a8/colorize3_poisson.py#L65-L92 | ||
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | Contains | (a, b) | return BoolRef(Z3_mk_seq_contains(a.ctx_ref(), a.as_ast(), b.as_ast()), a.ctx) | Check if 'a' contains 'b'
>>> s1 = Contains("abc", "ab")
>>> simplify(s1)
True
>>> s2 = Contains("abc", "bc")
>>> simplify(s2)
True
>>> x, y, z = Strings('x y z')
>>> s3 = Contains(Concat(x,y,z), y)
>>> simplify(s3)
True | Check if 'a' contains 'b'
>>> s1 = Contains("abc", "ab")
>>> simplify(s1)
True
>>> s2 = Contains("abc", "bc")
>>> simplify(s2)
True
>>> x, y, z = Strings('x y z')
>>> s3 = Contains(Concat(x,y,z), y)
>>> simplify(s3)
True | [
"Check",
"if",
"a",
"contains",
"b",
">>>",
"s1",
"=",
"Contains",
"(",
"abc",
"ab",
")",
">>>",
"simplify",
"(",
"s1",
")",
"True",
">>>",
"s2",
"=",
"Contains",
"(",
"abc",
"bc",
")",
">>>",
"simplify",
"(",
"s2",
")",
"True",
">>>",
"x",
"y",
... | def Contains(a, b):
"""Check if 'a' contains 'b'
>>> s1 = Contains("abc", "ab")
>>> simplify(s1)
True
>>> s2 = Contains("abc", "bc")
>>> simplify(s2)
True
>>> x, y, z = Strings('x y z')
>>> s3 = Contains(Concat(x,y,z), y)
>>> simplify(s3)
True
"""
ctx = _get_ctx2(a, b... | [
"def",
"Contains",
"(",
"a",
",",
"b",
")",
":",
"ctx",
"=",
"_get_ctx2",
"(",
"a",
",",
"b",
")",
"a",
"=",
"_coerce_seq",
"(",
"a",
",",
"ctx",
")",
"b",
"=",
"_coerce_seq",
"(",
"b",
",",
"ctx",
")",
"return",
"BoolRef",
"(",
"Z3_mk_seq_contai... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L10895-L10911 | |
avast/retdec | b9879088a5f0278508185ec645494e6c5c57a455 | scripts/type_extractor/type_extractor/io.py | python | print_types_info_txt | (f_out, functions, typedefs, structs, unions, enums, ident=4) | Text output for types and functions. | Text output for types and functions. | [
"Text",
"output",
"for",
"types",
"and",
"functions",
"."
] | def print_types_info_txt(f_out, functions, typedefs, structs, unions, enums, ident=4):
"""Text output for types and functions."""
for sname, sinfo in structs.items():
f_out.write('Struct' + '\n')
f_out.write('Name: ' + sinfo.name_text + '\n')
if sinfo.type_name_text:
f_out.wr... | [
"def",
"print_types_info_txt",
"(",
"f_out",
",",
"functions",
",",
"typedefs",
",",
"structs",
",",
"unions",
",",
"enums",
",",
"ident",
"=",
"4",
")",
":",
"for",
"sname",
",",
"sinfo",
"in",
"structs",
".",
"items",
"(",
")",
":",
"f_out",
".",
"... | https://github.com/avast/retdec/blob/b9879088a5f0278508185ec645494e6c5c57a455/scripts/type_extractor/type_extractor/io.py#L65-L92 | ||
olliw42/storm32bgc | 99d62a6130ae2950514022f50eb669c45a8cc1ba | old/betacopter/old/betacopter36dev-v005/modules/uavcan/libuavcan/dsdl_compiler/pyuavcan/uavcan/dsdl/signature.py | python | Signature.get_value | (self) | return (self._crc & Signature.MASK64) ^ Signature.MASK64 | Returns integer signature value | Returns integer signature value | [
"Returns",
"integer",
"signature",
"value"
] | def get_value(self):
'''Returns integer signature value'''
return (self._crc & Signature.MASK64) ^ Signature.MASK64 | [
"def",
"get_value",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"_crc",
"&",
"Signature",
".",
"MASK64",
")",
"^",
"Signature",
".",
"MASK64"
] | https://github.com/olliw42/storm32bgc/blob/99d62a6130ae2950514022f50eb669c45a8cc1ba/old/betacopter/old/betacopter36dev-v005/modules/uavcan/libuavcan/dsdl_compiler/pyuavcan/uavcan/dsdl/signature.py#L51-L53 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/ecs/__init__.py | python | ECSConnection.item_search | (self, search_index, **params) | return self.get_response('ItemSearch', params) | Returns items that satisfy the search criteria, including one or more search
indices.
For a full list of search terms,
:see: http://docs.amazonwebservices.com/AWSECommerceService/2010-09-01/DG/index.html?ItemSearch.html | Returns items that satisfy the search criteria, including one or more search
indices. | [
"Returns",
"items",
"that",
"satisfy",
"the",
"search",
"criteria",
"including",
"one",
"or",
"more",
"search",
"indices",
"."
] | def item_search(self, search_index, **params):
"""
Returns items that satisfy the search criteria, including one or more search
indices.
For a full list of search terms,
:see: http://docs.amazonwebservices.com/AWSECommerceService/2010-09-01/DG/index.html?ItemSearch.html
... | [
"def",
"item_search",
"(",
"self",
",",
"search_index",
",",
"*",
"*",
"params",
")",
":",
"params",
"[",
"'SearchIndex'",
"]",
"=",
"search_index",
"return",
"self",
".",
"get_response",
"(",
"'ItemSearch'",
",",
"params",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ecs/__init__.py#L87-L96 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/atom/mock_service.py | python | MockRequest.ConcealSecrets | (self, conceal_func) | Conceal secret data in this request. | Conceal secret data in this request. | [
"Conceal",
"secret",
"data",
"in",
"this",
"request",
"."
] | def ConcealSecrets(self, conceal_func):
"""Conceal secret data in this request."""
if self.extra_headers.has_key('Authorization'):
self.extra_headers['Authorization'] = conceal_func(
self.extra_headers['Authorization']) | [
"def",
"ConcealSecrets",
"(",
"self",
",",
"conceal_func",
")",
":",
"if",
"self",
".",
"extra_headers",
".",
"has_key",
"(",
"'Authorization'",
")",
":",
"self",
".",
"extra_headers",
"[",
"'Authorization'",
"]",
"=",
"conceal_func",
"(",
"self",
".",
"extr... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/atom/mock_service.py#L169-L173 | ||
dmlc/nnvm | dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38 | python/nnvm/frontend/darknet.py | python | _get_convolution_weights | (layer, opname, params, dtype) | Get the convolution layer weights and biases. | Get the convolution layer weights and biases. | [
"Get",
"the",
"convolution",
"layer",
"weights",
"and",
"biases",
"."
] | def _get_convolution_weights(layer, opname, params, dtype):
"""Get the convolution layer weights and biases."""
if layer.nweights == 0:
return
if (layer.n * layer.c * layer.size * layer.size) != layer.nweights:
raise RuntimeError("layer weights size not matching with n c h w")
weights ... | [
"def",
"_get_convolution_weights",
"(",
"layer",
",",
"opname",
",",
"params",
",",
"dtype",
")",
":",
"if",
"layer",
".",
"nweights",
"==",
"0",
":",
"return",
"if",
"(",
"layer",
".",
"n",
"*",
"layer",
".",
"c",
"*",
"layer",
".",
"size",
"*",
"... | https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/frontend/darknet.py#L397-L418 | ||
HKUST-Aerial-Robotics/Fast-Planner | 2ddd7793eecd573dbb5b47e2c985aa06606df3cf | uav_simulator/Utils/multi_map_server/src/multi_map_server/msg/_SparseMap3D.py | python | SparseMap3D.serialize_numpy | (self, buff, numpy) | serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module | serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module | [
"serialize",
"message",
"with",
"numpy",
"array",
"types",
"into",
"buffer",
":",
"param",
"buff",
":",
"buffer",
"StringIO",
":",
"param",
"numpy",
":",
"numpy",
"python",
"module"
] | def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
_x = self
buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
_x = s... | [
"def",
"serialize_numpy",
"(",
"self",
",",
"buff",
",",
"numpy",
")",
":",
"try",
":",
"_x",
"=",
"self",
"buff",
".",
"write",
"(",
"_struct_3I",
".",
"pack",
"(",
"_x",
".",
"header",
".",
"seq",
",",
"_x",
".",
"header",
".",
"stamp",
".",
"s... | https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/multi_map_server/src/multi_map_server/msg/_SparseMap3D.py#L230-L268 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/pgen2/conv.py | python | Converter.finish_off | (self) | Create additional useful structures. (Internal). | Create additional useful structures. (Internal). | [
"Create",
"additional",
"useful",
"structures",
".",
"(",
"Internal",
")",
"."
] | def finish_off(self):
"""Create additional useful structures. (Internal)."""
self.keywords = {} # map from keyword strings to arc labels
self.tokens = {} # map from numeric token values to arc labels
for ilabel, (type, value) in enumerate(self.labels):
if type == token.NAM... | [
"def",
"finish_off",
"(",
"self",
")",
":",
"self",
".",
"keywords",
"=",
"{",
"}",
"# map from keyword strings to arc labels",
"self",
".",
"tokens",
"=",
"{",
"}",
"# map from numeric token values to arc labels",
"for",
"ilabel",
",",
"(",
"type",
",",
"value",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/pgen2/conv.py#L249-L257 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Canvas.gettags | (self, *args) | return self.tk.splitlist(
self.tk.call((self._w, 'gettags') + args)) | Return tags associated with the first item specified in ARGS. | Return tags associated with the first item specified in ARGS. | [
"Return",
"tags",
"associated",
"with",
"the",
"first",
"item",
"specified",
"in",
"ARGS",
"."
] | def gettags(self, *args):
"""Return tags associated with the first item specified in ARGS."""
return self.tk.splitlist(
self.tk.call((self._w, 'gettags') + args)) | [
"def",
"gettags",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"self",
".",
"tk",
".",
"splitlist",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"(",
"self",
".",
"_w",
",",
"'gettags'",
")",
"+",
"args",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L2388-L2391 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/concat_benchmark.py | python | ConcatBenchmark._run_graph | (self, device, input_shape, variable, num_inputs, axis, grad,
num_iters) | return duration | Run the graph and print its execution time.
Args:
device: string, the device to run on.
input_shape: shape of the input tensors.
variable: whether or not the input shape should be fixed
num_inputs: the number of inputs to concat
axis: axis to be concat'ed
grad: if True compute t... | Run the graph and print its execution time. | [
"Run",
"the",
"graph",
"and",
"print",
"its",
"execution",
"time",
"."
] | def _run_graph(self, device, input_shape, variable, num_inputs, axis, grad,
num_iters):
"""Run the graph and print its execution time.
Args:
device: string, the device to run on.
input_shape: shape of the input tensors.
variable: whether or not the input shape should be fixed... | [
"def",
"_run_graph",
"(",
"self",
",",
"device",
",",
"input_shape",
",",
"variable",
",",
"num_inputs",
",",
"axis",
",",
"grad",
",",
"num_iters",
")",
":",
"graph",
"=",
"tf",
".",
"Graph",
"(",
")",
"with",
"graph",
".",
"as_default",
"(",
")",
"... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/concat_benchmark.py#L75-L124 | |
alibaba/MNN | c4d9566171d589c3ded23aa18ffb197016995a12 | pymnn/pip_package/MNN/expr/__init__.py | python | exp | (x) | return _F.exp(x) | exp(x)
Return the exp(x), element-wise.
Parameters
----------
x : var_like, input value.
Returns
-------
y : Var. The exp of `x`.
Example:
-------
>>> expr.exp([9., 4.5])
var([8102.449, 90.01698]) | exp(x)
Return the exp(x), element-wise. | [
"exp",
"(",
"x",
")",
"Return",
"the",
"exp",
"(",
"x",
")",
"element",
"-",
"wise",
"."
] | def exp(x):
'''
exp(x)
Return the exp(x), element-wise.
Parameters
----------
x : var_like, input value.
Returns
-------
y : Var. The exp of `x`.
Example:
-------
>>> expr.exp([9., 4.5])
var([8102.449, 90.01698])
'''
x = _to_var(x)
return _F.exp(x) | [
"def",
"exp",
"(",
"x",
")",
":",
"x",
"=",
"_to_var",
"(",
"x",
")",
"return",
"_F",
".",
"exp",
"(",
"x",
")"
] | https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L308-L327 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/module/bucketing_module.py | python | BucketingModule.get_params | (self) | return params | Gets current parameters.
Returns
-------
`(arg_params, aux_params)`
A pair of dictionaries each mapping parameter names to NDArray values. | Gets current parameters. | [
"Gets",
"current",
"parameters",
"."
] | def get_params(self):
"""Gets current parameters.
Returns
-------
`(arg_params, aux_params)`
A pair of dictionaries each mapping parameter names to NDArray values.
"""
assert self.binded and self.params_initialized
self._curr_module._params_dirty = se... | [
"def",
"get_params",
"(",
"self",
")",
":",
"assert",
"self",
".",
"binded",
"and",
"self",
".",
"params_initialized",
"self",
".",
"_curr_module",
".",
"_params_dirty",
"=",
"self",
".",
"_params_dirty",
"params",
"=",
"self",
".",
"_curr_module",
".",
"get... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/module/bucketing_module.py#L158-L170 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rosgraph/src/rosgraph/impl/graph.py | python | Graph.update | (self) | return updated | Update all the stats. This method may take awhile to complete as it will
communicate with all nodes + master. | Update all the stats. This method may take awhile to complete as it will
communicate with all nodes + master. | [
"Update",
"all",
"the",
"stats",
".",
"This",
"method",
"may",
"take",
"awhile",
"to",
"complete",
"as",
"it",
"will",
"communicate",
"with",
"all",
"nodes",
"+",
"master",
"."
] | def update(self):
"""
Update all the stats. This method may take awhile to complete as it will
communicate with all nodes + master.
"""
last_node_refresh = self.last_node_refresh
# nodes left to check
update_queue = None
# True if there a... | [
"def",
"update",
"(",
"self",
")",
":",
"last_node_refresh",
"=",
"self",
".",
"last_node_refresh",
"# nodes left to check",
"update_queue",
"=",
"None",
"# True if there are still more stats to fetch this cycle",
"work_to_do",
"=",
"True",
"# return value. True if new data dif... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosgraph/src/rosgraph/impl/graph.py#L522-L578 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/training/input.py | python | _shuffle_batch_join | (tensors_list, batch_size, capacity,
min_after_dequeue, keep_input, seed=None,
enqueue_many=False, shapes=None,
allow_smaller_final_batch=False, shared_name=None,
name=None) | Helper function for `shuffle_batch_join` and `maybe_shuffle_batch_join`. | Helper function for `shuffle_batch_join` and `maybe_shuffle_batch_join`. | [
"Helper",
"function",
"for",
"shuffle_batch_join",
"and",
"maybe_shuffle_batch_join",
"."
] | def _shuffle_batch_join(tensors_list, batch_size, capacity,
min_after_dequeue, keep_input, seed=None,
enqueue_many=False, shapes=None,
allow_smaller_final_batch=False, shared_name=None,
name=None):
"""Helper function for `... | [
"def",
"_shuffle_batch_join",
"(",
"tensors_list",
",",
"batch_size",
",",
"capacity",
",",
"min_after_dequeue",
",",
"keep_input",
",",
"seed",
"=",
"None",
",",
"enqueue_many",
"=",
"False",
",",
"shapes",
"=",
"None",
",",
"allow_smaller_final_batch",
"=",
"F... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/input.py#L796-L831 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/wsgiref/handlers.py | python | BaseHandler.write | (self, data) | write()' callable as specified by PEP 333 | write()' callable as specified by PEP 333 | [
"write",
"()",
"callable",
"as",
"specified",
"by",
"PEP",
"333"
] | def write(self, data):
"""'write()' callable as specified by PEP 333"""
assert type(data) is StringType,"write() argument must be string"
if not self.status:
raise AssertionError("write() before start_response()")
elif not self.headers_sent:
# Before the first ... | [
"def",
"write",
"(",
"self",
",",
"data",
")",
":",
"assert",
"type",
"(",
"data",
")",
"is",
"StringType",
",",
"\"write() argument must be string\"",
"if",
"not",
"self",
".",
"status",
":",
"raise",
"AssertionError",
"(",
"\"write() before start_response()\"",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/wsgiref/handlers.py#L201-L218 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.