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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
raspberrypi/tools | 13474ee775d0c5ec8a7da4fb0a9fa84187abfc87 | arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/share/gdb/python/gdb/command/explore.py | python | CompoundExplorer.explore_type | (name, datatype, is_child) | return False | Function to explore struct/class and union types.
See Explorer.explore_type for more information. | Function to explore struct/class and union types.
See Explorer.explore_type for more information. | [
"Function",
"to",
"explore",
"struct",
"/",
"class",
"and",
"union",
"types",
".",
"See",
"Explorer",
".",
"explore_type",
"for",
"more",
"information",
"."
] | def explore_type(name, datatype, is_child):
"""Function to explore struct/class and union types.
See Explorer.explore_type for more information.
"""
type_code = datatype.code
type_desc = ""
if type_code == gdb.TYPE_CODE_STRUCT:
type_desc = "struct/class"
... | [
"def",
"explore_type",
"(",
"name",
",",
"datatype",
",",
"is_child",
")",
":",
"type_code",
"=",
"datatype",
".",
"code",
"type_desc",
"=",
"\"\"",
"if",
"type_code",
"==",
"gdb",
".",
"TYPE_CODE_STRUCT",
":",
"type_desc",
"=",
"\"struct/class\"",
"else",
"... | https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/share/gdb/python/gdb/command/explore.py#L473-L547 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/feature_column_ops.py | python | _check_forbidden_sequence_columns | (feature_columns) | Recursively checks `feature_columns` for `_FORBIDDEN_SEQUENCE_COLUMNS`. | Recursively checks `feature_columns` for `_FORBIDDEN_SEQUENCE_COLUMNS`. | [
"Recursively",
"checks",
"feature_columns",
"for",
"_FORBIDDEN_SEQUENCE_COLUMNS",
"."
] | def _check_forbidden_sequence_columns(feature_columns):
"""Recursively checks `feature_columns` for `_FORBIDDEN_SEQUENCE_COLUMNS`."""
all_feature_columns = _gather_feature_columns(feature_columns)
for feature_column in all_feature_columns:
if isinstance(feature_column, _FORBIDDEN_SEQUENCE_COLUMNS):
rais... | [
"def",
"_check_forbidden_sequence_columns",
"(",
"feature_columns",
")",
":",
"all_feature_columns",
"=",
"_gather_feature_columns",
"(",
"feature_columns",
")",
"for",
"feature_column",
"in",
"all_feature_columns",
":",
"if",
"isinstance",
"(",
"feature_column",
",",
"_F... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/feature_column_ops.py#L911-L919 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/inputsplitter.py | python | InputSplitter.__init__ | (self) | Create a new InputSplitter instance. | Create a new InputSplitter instance. | [
"Create",
"a",
"new",
"InputSplitter",
"instance",
"."
] | def __init__(self):
"""Create a new InputSplitter instance.
"""
self._buffer = []
self._compile = codeop.CommandCompiler()
self.encoding = get_input_encoding() | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"_buffer",
"=",
"[",
"]",
"self",
".",
"_compile",
"=",
"codeop",
".",
"CommandCompiler",
"(",
")",
"self",
".",
"encoding",
"=",
"get_input_encoding",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/inputsplitter.py#L215-L220 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/dataview.py | python | PyDataViewCustomRenderer.GetView | (*args, **kwargs) | return _dataview.PyDataViewCustomRenderer_GetView(*args, **kwargs) | GetView(self) -> DataViewCtrl | GetView(self) -> DataViewCtrl | [
"GetView",
"(",
"self",
")",
"-",
">",
"DataViewCtrl"
] | def GetView(*args, **kwargs):
"""GetView(self) -> DataViewCtrl"""
return _dataview.PyDataViewCustomRenderer_GetView(*args, **kwargs) | [
"def",
"GetView",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"PyDataViewCustomRenderer_GetView",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L1509-L1511 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/webapp2/webapp2_extras/securecookie.py | python | SecureCookieSerializer.__init__ | (self, secret_key) | Initiliazes the serializer/deserializer.
:param secret_key:
A random string to be used as the HMAC secret for the cookie
signature. | Initiliazes the serializer/deserializer. | [
"Initiliazes",
"the",
"serializer",
"/",
"deserializer",
"."
] | def __init__(self, secret_key):
"""Initiliazes the serializer/deserializer.
:param secret_key:
A random string to be used as the HMAC secret for the cookie
signature.
"""
self.secret_key = secret_key | [
"def",
"__init__",
"(",
"self",
",",
"secret_key",
")",
":",
"self",
".",
"secret_key",
"=",
"secret_key"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2_extras/securecookie.py#L27-L34 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/pgen2/grammar.py | python | Grammar.copy | (self) | return new | Copy the grammar. | Copy the grammar. | [
"Copy",
"the",
"grammar",
"."
] | def copy(self):
"""
Copy the grammar.
"""
new = self.__class__()
for dict_attr in ("symbol2number", "number2symbol", "dfas", "keywords",
"tokens", "symbol2label"):
setattr(new, dict_attr, getattr(self, dict_attr).copy())
new.labels = ... | [
"def",
"copy",
"(",
"self",
")",
":",
"new",
"=",
"self",
".",
"__class__",
"(",
")",
"for",
"dict_attr",
"in",
"(",
"\"symbol2number\"",
",",
"\"number2symbol\"",
",",
"\"dfas\"",
",",
"\"keywords\"",
",",
"\"tokens\"",
",",
"\"symbol2label\"",
")",
":",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/pgen2/grammar.py#L100-L111 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/psutil/psutil/__init__.py | python | Process.get_ext_memory_info | (self) | return self._platform_impl.get_ext_memory_info() | Return a namedtuple with variable fields depending on the
platform representing extended memory information about
the process. All numbers are expressed in bytes. | Return a namedtuple with variable fields depending on the
platform representing extended memory information about
the process. All numbers are expressed in bytes. | [
"Return",
"a",
"namedtuple",
"with",
"variable",
"fields",
"depending",
"on",
"the",
"platform",
"representing",
"extended",
"memory",
"information",
"about",
"the",
"process",
".",
"All",
"numbers",
"are",
"expressed",
"in",
"bytes",
"."
] | def get_ext_memory_info(self):
"""Return a namedtuple with variable fields depending on the
platform representing extended memory information about
the process. All numbers are expressed in bytes.
"""
return self._platform_impl.get_ext_memory_info() | [
"def",
"get_ext_memory_info",
"(",
"self",
")",
":",
"return",
"self",
".",
"_platform_impl",
".",
"get_ext_memory_info",
"(",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/psutil/psutil/__init__.py#L642-L647 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/urlhandler/protocol_socket.py | python | Serial.cts | (self) | return True | Read terminal status line: Clear To Send | Read terminal status line: Clear To Send | [
"Read",
"terminal",
"status",
"line",
":",
"Clear",
"To",
"Send"
] | def cts(self):
"""Read terminal status line: Clear To Send"""
if not self.is_open:
raise portNotOpenError
if self.logger:
self.logger.info('returning dummy for cts')
return True | [
"def",
"cts",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_open",
":",
"raise",
"portNotOpenError",
"if",
"self",
".",
"logger",
":",
"self",
".",
"logger",
".",
"info",
"(",
"'returning dummy for cts'",
")",
"return",
"True"
] | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/urlhandler/protocol_socket.py#L301-L307 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/msvs_emulation.py | python | GenerateEnvironmentFiles | (toplevel_build_dir, generator_flags,
system_includes, open_out) | return cl_paths | It's not sufficient to have the absolute path to the compiler, linker,
etc. on Windows, as those tools rely on .dlls being in the PATH. We also
need to support both x86 and x64 compilers within the same build (to support
msvs_target_platform hackery). Different architectures require a different
compiler binary,... | It's not sufficient to have the absolute path to the compiler, linker,
etc. on Windows, as those tools rely on .dlls being in the PATH. We also
need to support both x86 and x64 compilers within the same build (to support
msvs_target_platform hackery). Different architectures require a different
compiler binary,... | [
"It",
"s",
"not",
"sufficient",
"to",
"have",
"the",
"absolute",
"path",
"to",
"the",
"compiler",
"linker",
"etc",
".",
"on",
"Windows",
"as",
"those",
"tools",
"rely",
"on",
".",
"dlls",
"being",
"in",
"the",
"PATH",
".",
"We",
"also",
"need",
"to",
... | def GenerateEnvironmentFiles(toplevel_build_dir, generator_flags,
system_includes, open_out):
"""It's not sufficient to have the absolute path to the compiler, linker,
etc. on Windows, as those tools rely on .dlls being in the PATH. We also
need to support both x86 and x64 compilers w... | [
"def",
"GenerateEnvironmentFiles",
"(",
"toplevel_build_dir",
",",
"generator_flags",
",",
"system_includes",
",",
"open_out",
")",
":",
"archs",
"=",
"(",
"'x86'",
",",
"'x64'",
")",
"if",
"generator_flags",
".",
"get",
"(",
"'ninja_use_custom_environment_files'",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/msvs_emulation.py#L1030-L1087 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/_asarray.py | python | asfortranarray | (a, dtype=None) | return array(a, dtype, copy=False, order='F', ndmin=1) | Return an array (ndim >= 1) laid out in Fortran order in memory.
Parameters
----------
a : array_like
Input array.
dtype : str or dtype object, optional
By default, the data-type is inferred from the input data.
Returns
-------
out : ndarray
The input `a` in Fortran... | Return an array (ndim >= 1) laid out in Fortran order in memory. | [
"Return",
"an",
"array",
"(",
"ndim",
">",
"=",
"1",
")",
"laid",
"out",
"in",
"Fortran",
"order",
"in",
"memory",
"."
] | def asfortranarray(a, dtype=None):
"""
Return an array (ndim >= 1) laid out in Fortran order in memory.
Parameters
----------
a : array_like
Input array.
dtype : str or dtype object, optional
By default, the data-type is inferred from the input data.
Returns
-------
... | [
"def",
"asfortranarray",
"(",
"a",
",",
"dtype",
"=",
"None",
")",
":",
"return",
"array",
"(",
"a",
",",
"dtype",
",",
"copy",
"=",
"False",
",",
"order",
"=",
"'F'",
",",
"ndmin",
"=",
"1",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/_asarray.py#L183-L220 | |
google/clif | cab24d6a105609a65c95a36a1712ae3c20c7b5df | clif/python/slots.py | python | GenSetItem | (setitem_slots) | Combine __setitem__ / __delitem__ funcs into one xx_setitem slot. | Combine __setitem__ / __delitem__ funcs into one xx_setitem slot. | [
"Combine",
"__setitem__",
"/",
"__delitem__",
"funcs",
"into",
"one",
"xx_setitem",
"slot",
"."
] | def GenSetItem(setitem_slots):
"""Combine __setitem__ / __delitem__ funcs into one xx_setitem slot."""
assert len(setitem_slots) == 2, 'Need __setitem__ / __delitem__ funcs.'
setitem, delitem = setitem_slots
assert setitem or delitem, 'Need one or both __setitem__ / __delitem__ funcs.'
yield ''
yield 'int s... | [
"def",
"GenSetItem",
"(",
"setitem_slots",
")",
":",
"assert",
"len",
"(",
"setitem_slots",
")",
"==",
"2",
",",
"'Need __setitem__ / __delitem__ funcs.'",
"setitem",
",",
"delitem",
"=",
"setitem_slots",
"assert",
"setitem",
"or",
"delitem",
",",
"'Need one or both... | https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/python/slots.py#L152-L186 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Misc._report_exception | (self) | Internal function. | Internal function. | [
"Internal",
"function",
"."
] | def _report_exception(self):
"""Internal function."""
exc, val, tb = sys.exc_info()
root = self._root()
root.report_callback_exception(exc, val, tb) | [
"def",
"_report_exception",
"(",
"self",
")",
":",
"exc",
",",
"val",
",",
"tb",
"=",
"sys",
".",
"exc_info",
"(",
")",
"root",
"=",
"self",
".",
"_root",
"(",
")",
"root",
".",
"report_callback_exception",
"(",
"exc",
",",
"val",
",",
"tb",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L1448-L1452 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/generator/make.py | python | MakefileWriter.WritePchTargets | (self, pch_commands) | Writes make rules to compile prefix headers. | Writes make rules to compile prefix headers. | [
"Writes",
"make",
"rules",
"to",
"compile",
"prefix",
"headers",
"."
] | def WritePchTargets(self, pch_commands):
"""Writes make rules to compile prefix headers."""
if not pch_commands:
return
for gch, lang_flag, lang, input in pch_commands:
extra_flags = {
"c": "$(CFLAGS_C_$(BUILDTYPE))",
"cc": "$(CFLAGS_CC_$(... | [
"def",
"WritePchTargets",
"(",
"self",
",",
"pch_commands",
")",
":",
"if",
"not",
"pch_commands",
":",
"return",
"for",
"gch",
",",
"lang_flag",
",",
"lang",
",",
"input",
"in",
"pch_commands",
":",
"extra_flags",
"=",
"{",
"\"c\"",
":",
"\"$(CFLAGS_C_$(BUI... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/generator/make.py#L1422-L1451 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/docview.py | python | DocTemplate.GetDocumentName | (self) | return self._docTypeName | Returns the document type name, as passed to the document template
constructor. | Returns the document type name, as passed to the document template
constructor. | [
"Returns",
"the",
"document",
"type",
"name",
"as",
"passed",
"to",
"the",
"document",
"template",
"constructor",
"."
] | def GetDocumentName(self):
"""
Returns the document type name, as passed to the document template
constructor.
"""
return self._docTypeName | [
"def",
"GetDocumentName",
"(",
"self",
")",
":",
"return",
"self",
".",
"_docTypeName"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/docview.py#L1229-L1234 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py | python | Bits._assertsanity | (self) | return True | Check internal self consistency as a debugging aid. | Check internal self consistency as a debugging aid. | [
"Check",
"internal",
"self",
"consistency",
"as",
"a",
"debugging",
"aid",
"."
] | def _assertsanity(self):
"""Check internal self consistency as a debugging aid."""
assert self.len >= 0
assert 0 <= self._offset, "offset={0}".format(self._offset)
assert (self.len + self._offset + 7) // 8 == self._datastore.bytelength + self._datastore.byteoffset
return True | [
"def",
"_assertsanity",
"(",
"self",
")",
":",
"assert",
"self",
".",
"len",
">=",
"0",
"assert",
"0",
"<=",
"self",
".",
"_offset",
",",
"\"offset={0}\"",
".",
"format",
"(",
"self",
".",
"_offset",
")",
"assert",
"(",
"self",
".",
"len",
"+",
"self... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L1195-L1200 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/plugins/db_manager/dlg_table_properties.py | python | DlgTableProperties.addColumn | (self) | open dialog to set column info and add column to table | open dialog to set column info and add column to table | [
"open",
"dialog",
"to",
"set",
"column",
"info",
"and",
"add",
"column",
"to",
"table"
] | def addColumn(self):
""" open dialog to set column info and add column to table """
dlg = DlgFieldProperties(self, None, self.table)
if not dlg.exec_():
return
fld = dlg.getField()
with OverrideCursor(Qt.WaitCursor):
self.aboutToChangeTable.emit()
... | [
"def",
"addColumn",
"(",
"self",
")",
":",
"dlg",
"=",
"DlgFieldProperties",
"(",
"self",
",",
"None",
",",
"self",
".",
"table",
")",
"if",
"not",
"dlg",
".",
"exec_",
"(",
")",
":",
"return",
"fld",
"=",
"dlg",
".",
"getField",
"(",
")",
"with",
... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/db_manager/dlg_table_properties.py#L126-L140 | ||
NREL/EnergyPlus | fadc5973b85c70e8cc923efb69c144e808a26078 | cmake/ReverseDDPostProcess.py | python | configure_root_dirs | (test_dir: str) | return os.path.join(test_dir, 'Regular'), os.path.join(test_dir, 'Reversed') | Set up the test directories based on prescribed names | Set up the test directories based on prescribed names | [
"Set",
"up",
"the",
"test",
"directories",
"based",
"on",
"prescribed",
"names"
] | def configure_root_dirs(test_dir: str) -> Tuple[str, str]:
"""Set up the test directories based on prescribed names"""
return os.path.join(test_dir, 'Regular'), os.path.join(test_dir, 'Reversed') | [
"def",
"configure_root_dirs",
"(",
"test_dir",
":",
"str",
")",
"->",
"Tuple",
"[",
"str",
",",
"str",
"]",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"test_dir",
",",
"'Regular'",
")",
",",
"os",
".",
"path",
".",
"join",
"(",
"test_dir",
... | https://github.com/NREL/EnergyPlus/blob/fadc5973b85c70e8cc923efb69c144e808a26078/cmake/ReverseDDPostProcess.py#L73-L75 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/basislist.py | python | BasisFamily.add_rifit | (self, fit) | Function to add basis *fit* as associated fitting basis
member *rifit* to a BasisFamily object. | Function to add basis *fit* as associated fitting basis
member *rifit* to a BasisFamily object. | [
"Function",
"to",
"add",
"basis",
"*",
"fit",
"*",
"as",
"associated",
"fitting",
"basis",
"member",
"*",
"rifit",
"*",
"to",
"a",
"BasisFamily",
"object",
"."
] | def add_rifit(self, fit):
"""Function to add basis *fit* as associated fitting basis
member *rifit* to a BasisFamily object.
"""
self.rifit = sanitize_basisname(fit) | [
"def",
"add_rifit",
"(",
"self",
",",
"fit",
")",
":",
"self",
".",
"rifit",
"=",
"sanitize_basisname",
"(",
"fit",
")"
] | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/basislist.py#L105-L110 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/training/summary_io.py | python | SummaryWriter.close | (self) | Flushes the event file to disk and close the file.
Call this method when you do not need the summary writer anymore. | Flushes the event file to disk and close the file. | [
"Flushes",
"the",
"event",
"file",
"to",
"disk",
"and",
"close",
"the",
"file",
"."
] | def close(self):
"""Flushes the event file to disk and close the file.
Call this method when you do not need the summary writer anymore.
"""
self.flush()
self._ev_writer.Close()
self._closed = True | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"flush",
"(",
")",
"self",
".",
"_ev_writer",
".",
"Close",
"(",
")",
"self",
".",
"_closed",
"=",
"True"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/training/summary_io.py#L274-L281 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/layers/python/layers/feature_column.py | python | _get_feature_config | (feature_column) | Returns configuration for the base feature defined in feature_column. | Returns configuration for the base feature defined in feature_column. | [
"Returns",
"configuration",
"for",
"the",
"base",
"feature",
"defined",
"in",
"feature_column",
"."
] | def _get_feature_config(feature_column):
"""Returns configuration for the base feature defined in feature_column."""
if not isinstance(feature_column, _FeatureColumn):
raise TypeError(
"feature_columns should only contain instances of _FeatureColumn. "
"Given column is {}".format(feature_column)... | [
"def",
"_get_feature_config",
"(",
"feature_column",
")",
":",
"if",
"not",
"isinstance",
"(",
"feature_column",
",",
"_FeatureColumn",
")",
":",
"raise",
"TypeError",
"(",
"\"feature_columns should only contain instances of _FeatureColumn. \"",
"\"Given column is {}\"",
".",... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/layers/python/layers/feature_column.py#L2462-L2476 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/stack.py | python | Monitor.wait | (self) | Waits for the operation to complete, displaying events as they occur. | Waits for the operation to complete, displaying events as they occur. | [
"Waits",
"for",
"the",
"operation",
"to",
"complete",
"displaying",
"events",
"as",
"they",
"occur",
"."
] | def wait(self):
"""Waits for the operation to complete, displaying events as they occur."""
errors = []
failed_resources = set([])
done = False
while not done:
for monitored_stack_id in self.monitored_stacks:
try:
res = self.clie... | [
"def",
"wait",
"(",
"self",
")",
":",
"errors",
"=",
"[",
"]",
"failed_resources",
"=",
"set",
"(",
"[",
"]",
")",
"done",
"=",
"False",
"while",
"not",
"done",
":",
"for",
"monitored_stack_id",
"in",
"self",
".",
"monitored_stacks",
":",
"try",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/stack.py#L1130-L1201 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py | python | get_host | (url) | return p.scheme or 'http', p.hostname, p.port | Deprecated. Use :func:`.parse_url` instead. | Deprecated. Use :func:`.parse_url` instead. | [
"Deprecated",
".",
"Use",
":",
"func",
":",
".",
"parse_url",
"instead",
"."
] | def get_host(url):
"""
Deprecated. Use :func:`.parse_url` instead.
"""
p = parse_url(url)
return p.scheme or 'http', p.hostname, p.port | [
"def",
"get_host",
"(",
"url",
")",
":",
"p",
"=",
"parse_url",
"(",
"url",
")",
"return",
"p",
".",
"scheme",
"or",
"'http'",
",",
"p",
".",
"hostname",
",",
"p",
".",
"port"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py#L209-L214 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBBreakpoint.GetIgnoreCount | (self) | return _lldb.SBBreakpoint_GetIgnoreCount(self) | GetIgnoreCount(self) -> uint32_t | GetIgnoreCount(self) -> uint32_t | [
"GetIgnoreCount",
"(",
"self",
")",
"-",
">",
"uint32_t"
] | def GetIgnoreCount(self):
"""GetIgnoreCount(self) -> uint32_t"""
return _lldb.SBBreakpoint_GetIgnoreCount(self) | [
"def",
"GetIgnoreCount",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBBreakpoint_GetIgnoreCount",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L1502-L1504 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/internal/image_processing/frame_generator.py | python | FrameGenerator.__init__ | (self) | Initializes the FrameGenerator object. | Initializes the FrameGenerator object. | [
"Initializes",
"the",
"FrameGenerator",
"object",
"."
] | def __init__(self):
""" Initializes the FrameGenerator object. """
self._generator = self._CreateGenerator() | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"_generator",
"=",
"self",
".",
"_CreateGenerator",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/image_processing/frame_generator.py#L20-L22 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/factorization/python/ops/clustering_ops.py | python | KMeans._mini_batch_training_op | (self, inputs, cluster_idx_list,
cluster_centers, cluster_centers_var,
total_counts) | return tf.group(*update_ops) | Creates an op for training for mini batch case.
Args:
inputs: list of input Tensors.
cluster_idx_list: A vector (or list of vectors). Each element in the
vector corresponds to an input row in 'inp' and specifies the cluster id
corresponding to the input.
cluster_centers: Tensor of... | Creates an op for training for mini batch case. | [
"Creates",
"an",
"op",
"for",
"training",
"for",
"mini",
"batch",
"case",
"."
] | def _mini_batch_training_op(self, inputs, cluster_idx_list,
cluster_centers, cluster_centers_var,
total_counts):
"""Creates an op for training for mini batch case.
Args:
inputs: list of input Tensors.
cluster_idx_list: A vector (or list of... | [
"def",
"_mini_batch_training_op",
"(",
"self",
",",
"inputs",
",",
"cluster_idx_list",
",",
"cluster_centers",
",",
"cluster_centers_var",
",",
"total_counts",
")",
":",
"update_ops",
"=",
"[",
"]",
"for",
"inp",
",",
"cluster_idx",
"in",
"zip",
"(",
"inputs",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/clustering_ops.py#L307-L376 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/framework/ops.py | python | Graph.finalized | (self) | return self._finalized | True if this graph has been finalized. | True if this graph has been finalized. | [
"True",
"if",
"this",
"graph",
"has",
"been",
"finalized",
"."
] | def finalized(self):
"""True if this graph has been finalized."""
return self._finalized | [
"def",
"finalized",
"(",
"self",
")",
":",
"return",
"self",
".",
"_finalized"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/ops.py#L2364-L2366 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/tensorrt.py | python | set_use_fp16 | (status) | Set an environment variable which will enable or disable the use of FP16 precision in
TensorRT
Note: The mode FP16 force the whole TRT node to be executed in FP16
:param status: Boolean, True if TensorRT should run in FP16, False for FP32 | Set an environment variable which will enable or disable the use of FP16 precision in
TensorRT
Note: The mode FP16 force the whole TRT node to be executed in FP16
:param status: Boolean, True if TensorRT should run in FP16, False for FP32 | [
"Set",
"an",
"environment",
"variable",
"which",
"will",
"enable",
"or",
"disable",
"the",
"use",
"of",
"FP16",
"precision",
"in",
"TensorRT",
"Note",
":",
"The",
"mode",
"FP16",
"force",
"the",
"whole",
"TRT",
"node",
"to",
"be",
"executed",
"in",
"FP16",... | def set_use_fp16(status):
"""
Set an environment variable which will enable or disable the use of FP16 precision in
TensorRT
Note: The mode FP16 force the whole TRT node to be executed in FP16
:param status: Boolean, True if TensorRT should run in FP16, False for FP32
"""
os.environ["MXNET_T... | [
"def",
"set_use_fp16",
"(",
"status",
")",
":",
"os",
".",
"environ",
"[",
"\"MXNET_TENSORRT_USE_FP16\"",
"]",
"=",
"str",
"(",
"int",
"(",
"status",
")",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/tensorrt.py#L21-L28 | ||
simon-anders/htseq | 5ba0507ea237e2e067ea79fb28febbc56a37f0d4 | python3/HTSeq/StepVector.py | python | StepVector.__setitem__ | ( self, index, value ) | To set element i of StepVector sv to the value v, write
sv[i] = v
If you want to set a whole step, say, all values from i to j (not
including j), write
sv[i:j] = v
Note that the StepVector class will only notice that all the values
from i to j are equal if you assign them in th... | To set element i of StepVector sv to the value v, write
sv[i] = v
If you want to set a whole step, say, all values from i to j (not
including j), write
sv[i:j] = v
Note that the StepVector class will only notice that all the values
from i to j are equal if you assign them in th... | [
"To",
"set",
"element",
"i",
"of",
"StepVector",
"sv",
"to",
"the",
"value",
"v",
"write",
"sv",
"[",
"i",
"]",
"=",
"v",
"If",
"you",
"want",
"to",
"set",
"a",
"whole",
"step",
"say",
"all",
"values",
"from",
"i",
"to",
"j",
"(",
"not",
"includi... | def __setitem__( self, index, value ):
"""To set element i of StepVector sv to the value v, write
sv[i] = v
If you want to set a whole step, say, all values from i to j (not
including j), write
sv[i:j] = v
Note that the StepVector class will only notice that all the values
... | [
"def",
"__setitem__",
"(",
"self",
",",
"index",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"StepVector",
")",
":",
"if",
"self",
".",
"_swigobj",
"is",
"value",
".",
"_swigobj",
"and",
"value",
".",
"start",
"==",
"index",
".",
"... | https://github.com/simon-anders/htseq/blob/5ba0507ea237e2e067ea79fb28febbc56a37f0d4/python3/HTSeq/StepVector.py#L497-L533 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py | python | load_module_image | (context, image) | return Module(weakref.proxy(context), handle, info_log,
_module_finalizer(context, handle)) | image must be a pointer | image must be a pointer | [
"image",
"must",
"be",
"a",
"pointer"
] | def load_module_image(context, image):
"""
image must be a pointer
"""
logsz = int(get_numba_envvar('CUDA_LOG_SIZE', 1024))
jitinfo = (c_char * logsz)()
jiterrors = (c_char * logsz)()
options = {
enums.CU_JIT_INFO_LOG_BUFFER: addressof(jitinfo),
enums.CU_JIT_INFO_LOG_BUFFER... | [
"def",
"load_module_image",
"(",
"context",
",",
"image",
")",
":",
"logsz",
"=",
"int",
"(",
"get_numba_envvar",
"(",
"'CUDA_LOG_SIZE'",
",",
"1024",
")",
")",
"jitinfo",
"=",
"(",
"c_char",
"*",
"logsz",
")",
"(",
")",
"jiterrors",
"=",
"(",
"c_char",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py#L926-L957 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/log_det.py | python | log_det.is_atom_concave | (self) | return True | Is the atom concave? | Is the atom concave? | [
"Is",
"the",
"atom",
"concave?"
] | def is_atom_concave(self) -> bool:
"""Is the atom concave?
"""
return True | [
"def",
"is_atom_concave",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"True"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/log_det.py#L71-L74 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py | python | Analysis.total_branches | (self) | return sum([count for count in exit_counts.values() if count > 1]) | How many total branches are there? | How many total branches are there? | [
"How",
"many",
"total",
"branches",
"are",
"there?"
] | def total_branches(self):
"""How many total branches are there?"""
exit_counts = self.parser.exit_counts()
return sum([count for count in exit_counts.values() if count > 1]) | [
"def",
"total_branches",
"(",
"self",
")",
":",
"exit_counts",
"=",
"self",
".",
"parser",
".",
"exit_counts",
"(",
")",
"return",
"sum",
"(",
"[",
"count",
"for",
"count",
"in",
"exit_counts",
".",
"values",
"(",
")",
"if",
"count",
">",
"1",
"]",
"... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py#L114-L117 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/knobctrl.py | python | KnobCtrl.Draw | (self, dc) | Draws everything on the empty bitmap.
Here all the chosen styles are applied.
:param `dc`: an instance of :class:`DC`. | Draws everything on the empty bitmap.
Here all the chosen styles are applied. | [
"Draws",
"everything",
"on",
"the",
"empty",
"bitmap",
".",
"Here",
"all",
"the",
"chosen",
"styles",
"are",
"applied",
"."
] | def Draw(self, dc):
"""
Draws everything on the empty bitmap.
Here all the chosen styles are applied.
:param `dc`: an instance of :class:`DC`.
"""
size = self.GetClientSize()
if size.x < 21 or size.y < 21:
return
dc.SetClip... | [
"def",
"Draw",
"(",
"self",
",",
"dc",
")",
":",
"size",
"=",
"self",
".",
"GetClientSize",
"(",
")",
"if",
"size",
".",
"x",
"<",
"21",
"or",
"size",
".",
"y",
"<",
"21",
":",
"return",
"dc",
".",
"SetClippingRegionAsRegion",
"(",
"self",
".",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/knobctrl.py#L576-L596 | ||
may0324/DeepCompression-caffe | 0aff6c1287bda4cfc7f378ed8a16524e1afabd8c | scripts/download_model_binary.py | python | reporthook | (count, block_size, total_size) | From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/ | From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/ | [
"From",
"http",
":",
"//",
"blog",
".",
"moleculea",
".",
"com",
"/",
"2012",
"/",
"10",
"/",
"04",
"/",
"urlretrieve",
"-",
"progres",
"-",
"indicator",
"/"
] | def reporthook(count, block_size, total_size):
"""
From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/
"""
global start_time
if count == 0:
start_time = time.time()
return
duration = (time.time() - start_time) or 0.01
progress_size = int(count * block_siz... | [
"def",
"reporthook",
"(",
"count",
",",
"block_size",
",",
"total_size",
")",
":",
"global",
"start_time",
"if",
"count",
"==",
"0",
":",
"start_time",
"=",
"time",
".",
"time",
"(",
")",
"return",
"duration",
"=",
"(",
"time",
".",
"time",
"(",
")",
... | https://github.com/may0324/DeepCompression-caffe/blob/0aff6c1287bda4cfc7f378ed8a16524e1afabd8c/scripts/download_model_binary.py#L13-L27 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/bayesflow/python/ops/stochastic_variables.py | python | make_stochastic_variable_getter | (dist_cls,
dist_kwargs=None,
param_initializers=None,
prior=None) | return functools.partial(
get_stochastic_variable,
dist_cls=dist_cls,
dist_kwargs=dist_kwargs,
param_initializers=param_initializers,
prior=prior) | `get_stochastic_variable` with args partially applied. | `get_stochastic_variable` with args partially applied. | [
"get_stochastic_variable",
"with",
"args",
"partially",
"applied",
"."
] | def make_stochastic_variable_getter(dist_cls,
dist_kwargs=None,
param_initializers=None,
prior=None):
"""`get_stochastic_variable` with args partially applied."""
return functools.partial(
get_stochasti... | [
"def",
"make_stochastic_variable_getter",
"(",
"dist_cls",
",",
"dist_kwargs",
"=",
"None",
",",
"param_initializers",
"=",
"None",
",",
"prior",
"=",
"None",
")",
":",
"return",
"functools",
".",
"partial",
"(",
"get_stochastic_variable",
",",
"dist_cls",
"=",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/bayesflow/python/ops/stochastic_variables.py#L141-L151 | |
NVlabs/fermat | 06e8c03ac59ab440cbb13897f90631ef1861e769 | contrib/assimp-4.1.0/port/PyAssimp/pyassimp/core.py | python | _init | (self, target = None, parent = None) | return self | Custom initialize() for C structs, adds safely accessible member functionality.
:param target: set the object which receive the added methods. Useful when manipulating
pointers, to skip the intermediate 'contents' deferencing. | Custom initialize() for C structs, adds safely accessible member functionality. | [
"Custom",
"initialize",
"()",
"for",
"C",
"structs",
"adds",
"safely",
"accessible",
"member",
"functionality",
"."
] | def _init(self, target = None, parent = None):
"""
Custom initialize() for C structs, adds safely accessible member functionality.
:param target: set the object which receive the added methods. Useful when manipulating
pointers, to skip the intermediate 'contents' deferencing.
"""
if not target... | [
"def",
"_init",
"(",
"self",
",",
"target",
"=",
"None",
",",
"parent",
"=",
"None",
")",
":",
"if",
"not",
"target",
":",
"target",
"=",
"self",
"dirself",
"=",
"dir",
"(",
"self",
")",
"for",
"m",
"in",
"dirself",
":",
"if",
"m",
".",
"startswi... | https://github.com/NVlabs/fermat/blob/06e8c03ac59ab440cbb13897f90631ef1861e769/contrib/assimp-4.1.0/port/PyAssimp/pyassimp/core.py#L94-L224 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | DateSpan.__mul__ | (*args, **kwargs) | return _misc_.DateSpan___mul__(*args, **kwargs) | __mul__(self, int n) -> DateSpan | __mul__(self, int n) -> DateSpan | [
"__mul__",
"(",
"self",
"int",
"n",
")",
"-",
">",
"DateSpan"
] | def __mul__(*args, **kwargs):
"""__mul__(self, int n) -> DateSpan"""
return _misc_.DateSpan___mul__(*args, **kwargs) | [
"def",
"__mul__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateSpan___mul__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L4729-L4731 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py | python | SourceLoader.path_stats | (self, path) | return {'mtime': self.path_mtime(path)} | Optional method returning a metadata dict for the specified path
to by the path (str).
Possible keys:
- 'mtime' (mandatory) is the numeric timestamp of last source
code modification;
- 'size' (optional) is the size in bytes of the source code.
Implementing this method ... | Optional method returning a metadata dict for the specified path
to by the path (str).
Possible keys:
- 'mtime' (mandatory) is the numeric timestamp of last source
code modification;
- 'size' (optional) is the size in bytes of the source code. | [
"Optional",
"method",
"returning",
"a",
"metadata",
"dict",
"for",
"the",
"specified",
"path",
"to",
"by",
"the",
"path",
"(",
"str",
")",
".",
"Possible",
"keys",
":",
"-",
"mtime",
"(",
"mandatory",
")",
"is",
"the",
"numeric",
"timestamp",
"of",
"last... | def path_stats(self, path):
"""Optional method returning a metadata dict for the specified path
to by the path (str).
Possible keys:
- 'mtime' (mandatory) is the numeric timestamp of last source
code modification;
- 'size' (optional) is the size in bytes of the source c... | [
"def",
"path_stats",
"(",
"self",
",",
"path",
")",
":",
"return",
"{",
"'mtime'",
":",
"self",
".",
"path_mtime",
"(",
"path",
")",
"}"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py#L745-L756 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/utils/text.py | python | SList.sort | (self,field= None, nums = False) | return SList([t[1] for t in dsu]) | sort by specified fields (see fields())
Example::
a.sort(1, nums = True)
Sorts a by second field, in numerical order (so that 21 > 3) | sort by specified fields (see fields()) | [
"sort",
"by",
"specified",
"fields",
"(",
"see",
"fields",
"()",
")"
] | def sort(self,field= None, nums = False):
""" sort by specified fields (see fields())
Example::
a.sort(1, nums = True)
Sorts a by second field, in numerical order (so that 21 > 3)
"""
#decorate, sort, undecorate
if field is not None:
dsu = [[... | [
"def",
"sort",
"(",
"self",
",",
"field",
"=",
"None",
",",
"nums",
"=",
"False",
")",
":",
"#decorate, sort, undecorate",
"if",
"field",
"is",
"not",
"None",
":",
"dsu",
"=",
"[",
"[",
"SList",
"(",
"[",
"line",
"]",
")",
".",
"fields",
"(",
"fiel... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/utils/text.py#L204-L231 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/tools/gyp/pylib/gyp/mac_tool.py | python | MacTool._CommandifyName | (self, name_string) | return name_string.title().replace('-', '') | Transforms a tool name like copy-info-plist to CopyInfoPlist | Transforms a tool name like copy-info-plist to CopyInfoPlist | [
"Transforms",
"a",
"tool",
"name",
"like",
"copy",
"-",
"info",
"-",
"plist",
"to",
"CopyInfoPlist"
] | def _CommandifyName(self, name_string):
"""Transforms a tool name like copy-info-plist to CopyInfoPlist"""
return name_string.title().replace('-', '') | [
"def",
"_CommandifyName",
"(",
"self",
",",
"name_string",
")",
":",
"return",
"name_string",
".",
"title",
"(",
")",
".",
"replace",
"(",
"'-'",
",",
"''",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/mac_tool.py#L40-L42 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py | python | WorkingSet.run_script | (self, requires, script_name) | Locate distribution for `requires` and run `script_name` script | Locate distribution for `requires` and run `script_name` script | [
"Locate",
"distribution",
"for",
"requires",
"and",
"run",
"script_name",
"script"
] | def run_script(self, requires, script_name):
"""Locate distribution for `requires` and run `script_name` script"""
ns = sys._getframe(1).f_globals
name = ns['__name__']
ns.clear()
ns['__name__'] = name
self.require(requires)[0].run_script(script_name, ns) | [
"def",
"run_script",
"(",
"self",
",",
"requires",
",",
"script_name",
")",
":",
"ns",
"=",
"sys",
".",
"_getframe",
"(",
"1",
")",
".",
"f_globals",
"name",
"=",
"ns",
"[",
"'__name__'",
"]",
"ns",
".",
"clear",
"(",
")",
"ns",
"[",
"'__name__'",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py#L658-L664 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/macosxSupport.py | python | addOpenEventSupport | (root, flist) | This ensures that the application will respond to open AppleEvents, which
makes is feasible to use IDLE as the default application for python files. | This ensures that the application will respond to open AppleEvents, which
makes is feasible to use IDLE as the default application for python files. | [
"This",
"ensures",
"that",
"the",
"application",
"will",
"respond",
"to",
"open",
"AppleEvents",
"which",
"makes",
"is",
"feasible",
"to",
"use",
"IDLE",
"as",
"the",
"default",
"application",
"for",
"python",
"files",
"."
] | def addOpenEventSupport(root, flist):
"""
This ensures that the application will respond to open AppleEvents, which
makes is feasible to use IDLE as the default application for python files.
"""
def doOpenFile(*args):
for fn in args:
flist.open(fn)
# The command below is a h... | [
"def",
"addOpenEventSupport",
"(",
"root",
",",
"flist",
")",
":",
"def",
"doOpenFile",
"(",
"*",
"args",
")",
":",
"for",
"fn",
"in",
"args",
":",
"flist",
".",
"open",
"(",
"fn",
")",
"# The command below is a hook in aquatk that is called whenever the app",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/macosxSupport.py#L58-L70 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Tools/msvc.py | python | gather_icl_versions | (conf, versions) | Checks ICL compilers
:param versions: list to modify
:type versions: list | Checks ICL compilers | [
"Checks",
"ICL",
"compilers"
] | def gather_icl_versions(conf, versions):
"""
Checks ICL compilers
:param versions: list to modify
:type versions: list
"""
version_pattern = re.compile('^...?.?\....?.?')
try:
all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Intel\\Compilers\\C++')
except WindowsEr... | [
"def",
"gather_icl_versions",
"(",
"conf",
",",
"versions",
")",
":",
"version_pattern",
"=",
"re",
".",
"compile",
"(",
"'^...?.?\\....?.?'",
")",
"try",
":",
"all_versions",
"=",
"Utils",
".",
"winreg",
".",
"OpenKey",
"(",
"Utils",
".",
"winreg",
".",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/msvc.py#L390-L443 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py | python | TarFile.extractfile | (self, member) | Extract a member from the archive as a file object. `member' may be
a filename or a TarInfo object. If `member' is a regular file, a
file-like object is returned. If `member' is a link, a file-like
object is constructed from the link's target. If `member' is none of
the above... | Extract a member from the archive as a file object. `member' may be
a filename or a TarInfo object. If `member' is a regular file, a
file-like object is returned. If `member' is a link, a file-like
object is constructed from the link's target. If `member' is none of
the above... | [
"Extract",
"a",
"member",
"from",
"the",
"archive",
"as",
"a",
"file",
"object",
".",
"member",
"may",
"be",
"a",
"filename",
"or",
"a",
"TarInfo",
"object",
".",
"If",
"member",
"is",
"a",
"regular",
"file",
"a",
"file",
"-",
"like",
"object",
"is",
... | def extractfile(self, member):
"""Extract a member from the archive as a file object. `member' may be
a filename or a TarInfo object. If `member' is a regular file, a
file-like object is returned. If `member' is a link, a file-like
object is constructed from the link's target. I... | [
"def",
"extractfile",
"(",
"self",
",",
"member",
")",
":",
"self",
".",
"_check",
"(",
"\"r\"",
")",
"if",
"isinstance",
"(",
"member",
",",
"str",
")",
":",
"tarinfo",
"=",
"self",
".",
"getmember",
"(",
"member",
")",
"else",
":",
"tarinfo",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L2199-L2235 | ||
codilime/veles | e65de5a7c268129acffcdb03034efd8d256d025c | python/veles/async_conn/conn.py | python | AsyncConnection.get_node | (self, id) | return self.get_node_norefresh(id).refresh() | Fetches an AsyncNode with the given id from the server. If this
node is already available, it is refreshed. Returns an awaitable
of AsyncNode. | Fetches an AsyncNode with the given id from the server. If this
node is already available, it is refreshed. Returns an awaitable
of AsyncNode. | [
"Fetches",
"an",
"AsyncNode",
"with",
"the",
"given",
"id",
"from",
"the",
"server",
".",
"If",
"this",
"node",
"is",
"already",
"available",
"it",
"is",
"refreshed",
".",
"Returns",
"an",
"awaitable",
"of",
"AsyncNode",
"."
] | def get_node(self, id):
"""
Fetches an AsyncNode with the given id from the server. If this
node is already available, it is refreshed. Returns an awaitable
of AsyncNode.
"""
return self.get_node_norefresh(id).refresh() | [
"def",
"get_node",
"(",
"self",
",",
"id",
")",
":",
"return",
"self",
".",
"get_node_norefresh",
"(",
"id",
")",
".",
"refresh",
"(",
")"
] | https://github.com/codilime/veles/blob/e65de5a7c268129acffcdb03034efd8d256d025c/python/veles/async_conn/conn.py#L53-L59 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/android/pylib/forwarder.py | python | Forwarder._GetInstanceLocked | (tool) | return Forwarder._instance | Returns the singleton instance.
Note that the global lock must be acquired before calling this method.
Args:
tool: Tool class to use to get wrapper, if necessary, for executing the
forwarder (see valgrind_tools.py). | Returns the singleton instance. | [
"Returns",
"the",
"singleton",
"instance",
"."
] | def _GetInstanceLocked(tool):
"""Returns the singleton instance.
Note that the global lock must be acquired before calling this method.
Args:
tool: Tool class to use to get wrapper, if necessary, for executing the
forwarder (see valgrind_tools.py).
"""
if not Forwarder._instance:... | [
"def",
"_GetInstanceLocked",
"(",
"tool",
")",
":",
"if",
"not",
"Forwarder",
".",
"_instance",
":",
"Forwarder",
".",
"_instance",
"=",
"Forwarder",
"(",
"tool",
")",
"return",
"Forwarder",
".",
"_instance"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/forwarder.py#L174-L185 | |
sonyxperiadev/WebGL | 0299b38196f78c6d5f74bcf6fa312a3daee6de60 | Tools/Scripts/webkitpy/style/checkers/cpp.py | python | _process_lines | (filename, file_extension, lines, error, min_confidence) | Performs lint checks and reports any errors to the given error function.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
lines: An array of strings, each representing a line of the file, with the
last element... | Performs lint checks and reports any errors to the given error function. | [
"Performs",
"lint",
"checks",
"and",
"reports",
"any",
"errors",
"to",
"the",
"given",
"error",
"function",
"."
] | def _process_lines(filename, file_extension, lines, error, min_confidence):
"""Performs lint checks and reports any errors to the given error function.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
lines: An array o... | [
"def",
"_process_lines",
"(",
"filename",
",",
"file_extension",
",",
"lines",
",",
"error",
",",
"min_confidence",
")",
":",
"lines",
"=",
"(",
"[",
"'// marker so line numbers and indices both start at 1'",
"]",
"+",
"lines",
"+",
"[",
"'// marker so line numbers en... | https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/style/checkers/cpp.py#L3367-L3403 | ||
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/models/TopoFactory.py | python | TopoFactory.__set_base_id_list | (self, id, size, inst) | return [
n,
b,
w,
inst,
component_calculated_window_range,
self.__compute_component_ID_amount(comp),
] | Routine to set up the base id and window size with actual or instance set values.
Routine also checks window size against component max IDs needed if they are found. | Routine to set up the base id and window size with actual or instance set values.
Routine also checks window size against component max IDs needed if they are found. | [
"Routine",
"to",
"set",
"up",
"the",
"base",
"id",
"and",
"window",
"size",
"with",
"actual",
"or",
"instance",
"set",
"values",
".",
"Routine",
"also",
"checks",
"window",
"size",
"against",
"component",
"max",
"IDs",
"needed",
"if",
"they",
"are",
"found... | def __set_base_id_list(self, id, size, inst):
"""
Routine to set up the base id and window size with actual or instance set values.
Routine also checks window size against component max IDs needed if they are found.
"""
comp = inst.get_component_object()
# set instance na... | [
"def",
"__set_base_id_list",
"(",
"self",
",",
"id",
",",
"size",
",",
"inst",
")",
":",
"comp",
"=",
"inst",
".",
"get_component_object",
"(",
")",
"# set instance name",
"n",
"=",
"inst",
".",
"get_name",
"(",
")",
"#",
"\"\"\"\n Logic for calculating... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/models/TopoFactory.py#L621-L704 | |
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/cccc.py | python | Isotxs._read_file_control | (self) | Reads the file control block. This block is always present and gives
many parameters for the file including number of energy groups, number
of isotopes, etc. | Reads the file control block. This block is always present and gives
many parameters for the file including number of energy groups, number
of isotopes, etc. | [
"Reads",
"the",
"file",
"control",
"block",
".",
"This",
"block",
"is",
"always",
"present",
"and",
"gives",
"many",
"parameters",
"for",
"the",
"file",
"including",
"number",
"of",
"energy",
"groups",
"number",
"of",
"isotopes",
"etc",
"."
] | def _read_file_control(self):
"""Reads the file control block. This block is always present and gives
many parameters for the file including number of energy groups, number
of isotopes, etc.
"""
# Get file control record
fc = self.get_fortran_record()
# Read dat... | [
"def",
"_read_file_control",
"(",
"self",
")",
":",
"# Get file control record",
"fc",
"=",
"self",
".",
"get_fortran_record",
"(",
")",
"# Read data from file control record",
"self",
".",
"fc",
"[",
"'ngroup'",
"]",
"=",
"fc",
".",
"get_int",
"(",
")",
"[",
... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/cccc.py#L133-L153 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PropertyGridInterface.GetPropertyParent | (*args, **kwargs) | return _propgrid.PropertyGridInterface_GetPropertyParent(*args, **kwargs) | GetPropertyParent(self, PGPropArg id) -> PGProperty | GetPropertyParent(self, PGPropArg id) -> PGProperty | [
"GetPropertyParent",
"(",
"self",
"PGPropArg",
"id",
")",
"-",
">",
"PGProperty"
] | def GetPropertyParent(*args, **kwargs):
"""GetPropertyParent(self, PGPropArg id) -> PGProperty"""
return _propgrid.PropertyGridInterface_GetPropertyParent(*args, **kwargs) | [
"def",
"GetPropertyParent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_GetPropertyParent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L1237-L1239 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/math_ops.py | python | _BatchMatMulShape | (op) | return [batch_dims.concatenate([output_rows, output_cols])] | Shape function for BatchMatMul op. | Shape function for BatchMatMul op. | [
"Shape",
"function",
"for",
"BatchMatMul",
"op",
"."
] | def _BatchMatMulShape(op):
"""Shape function for BatchMatMul op."""
a_shape = op.inputs[0].get_shape()
adj_a = op.get_attr("adj_x")
b_shape = op.inputs[1].get_shape()
adj_b = op.get_attr("adj_y")
if a_shape.dims is None and b_shape.dims is None:
return [tensor_shape.unknown_shape()]
batch_dims = a_sha... | [
"def",
"_BatchMatMulShape",
"(",
"op",
")",
":",
"a_shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
"adj_a",
"=",
"op",
".",
"get_attr",
"(",
"\"adj_x\"",
")",
"b_shape",
"=",
"op",
".",
"inputs",
"[",
"1",
"]",
".",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L1549-L1563 | |
infinidb/infinidb | 6c9f5dfdabc41ad80e81ba9e1a4eb0d7271a5d23 | writeengine/bulk/checkidx.py | python | main | () | Validate indexes.. | Validate indexes.. | [
"Validate",
"indexes",
".."
] | def main():
"""
Validate indexes..
"""
if not os.access('.', os.W_OK):
os.chdir('/tmp')
print 'Changing to /tmp to have permission to write files'
if len(os.getenv('LD_LIBRARY_PATH'))<5:
print 'Suspicous LD_LIBRARY_PATH: %s'%os.getenv('LD_LIBRARY_PATH')
home = os.getenv('HOME')
genii = ... | [
"def",
"main",
"(",
")",
":",
"if",
"not",
"os",
".",
"access",
"(",
"'.'",
",",
"os",
".",
"W_OK",
")",
":",
"os",
".",
"chdir",
"(",
"'/tmp'",
")",
"print",
"'Changing to /tmp to have permission to write files'",
"if",
"len",
"(",
"os",
".",
"getenv",
... | https://github.com/infinidb/infinidb/blob/6c9f5dfdabc41ad80e81ba9e1a4eb0d7271a5d23/writeengine/bulk/checkidx.py#L70-L93 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/estimator/__init__.py | python | model_to_estimator_v2 | (
keras_model=None,
keras_model_path=None,
custom_objects=None,
model_dir=None,
config=None,
checkpoint_format='checkpoint') | return keras_lib.model_to_estimator( # pylint:disable=unexpected-keyword-arg
keras_model=keras_model,
keras_model_path=keras_model_path,
custom_objects=custom_objects,
model_dir=model_dir,
config=config,
checkpoint_format=checkpoint_format,
use_v2_estimator=True) | Constructs an `Estimator` instance from given keras model.
For usage example, please see:
[Creating estimators from Keras
Models](https://tensorflow.org/guide/estimators#model_to_estimator).
__Sample Weights__
Estimators returned by `model_to_estimator` are configured to handle sample
weights (similar to ... | Constructs an `Estimator` instance from given keras model. | [
"Constructs",
"an",
"Estimator",
"instance",
"from",
"given",
"keras",
"model",
"."
] | def model_to_estimator_v2(
keras_model=None,
keras_model_path=None,
custom_objects=None,
model_dir=None,
config=None,
checkpoint_format='checkpoint'):
"""Constructs an `Estimator` instance from given keras model.
For usage example, please see:
[Creating estimators from Keras
Models](htt... | [
"def",
"model_to_estimator_v2",
"(",
"keras_model",
"=",
"None",
",",
"keras_model_path",
"=",
"None",
",",
"custom_objects",
"=",
"None",
",",
"model_dir",
"=",
"None",
",",
"config",
"=",
"None",
",",
"checkpoint_format",
"=",
"'checkpoint'",
")",
":",
"try"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/estimator/__init__.py#L111-L187 | |
alibaba/MNN | c4d9566171d589c3ded23aa18ffb197016995a12 | pymnn/pip_package/MNN/expr/__init__.py | python | log | (x) | return _F.log(x) | log(x)
Return the log(x), element-wise.
Parameters
----------
x : var_like, input value.
Returns
-------
y : Var. The log of `x`.
Example:
-------
>>> expr.log([9., 4.5])
var([2.1972246, 1.5040774]) | log(x)
Return the log(x), element-wise. | [
"log",
"(",
"x",
")",
"Return",
"the",
"log",
"(",
"x",
")",
"element",
"-",
"wise",
"."
] | def log(x):
'''
log(x)
Return the log(x), element-wise.
Parameters
----------
x : var_like, input value.
Returns
-------
y : Var. The log of `x`.
Example:
-------
>>> expr.log([9., 4.5])
var([2.1972246, 1.5040774])
'''
x = _to_var(x)
return _F.log(x) | [
"def",
"log",
"(",
"x",
")",
":",
"x",
"=",
"_to_var",
"(",
"x",
")",
"return",
"_F",
".",
"log",
"(",
"x",
")"
] | https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L328-L347 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/operator.py | python | add | (a, b) | return a + b | Same as a + b. | Same as a + b. | [
"Same",
"as",
"a",
"+",
"b",
"."
] | def add(a, b):
"Same as a + b."
return a + b | [
"def",
"add",
"(",
"a",
",",
"b",
")",
":",
"return",
"a",
"+",
"b"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/operator.py#L75-L77 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/boosted_trees/examples/mnist.py | python | get_input_fn | (dataset_split,
batch_size,
capacity=10000,
min_after_dequeue=3000) | return _input_fn | Input function over MNIST data. | Input function over MNIST data. | [
"Input",
"function",
"over",
"MNIST",
"data",
"."
] | def get_input_fn(dataset_split,
batch_size,
capacity=10000,
min_after_dequeue=3000):
"""Input function over MNIST data."""
def _input_fn():
"""Prepare features and labels."""
images_batch, labels_batch = tf.train.shuffle_batch(
tensors=[dataset_spl... | [
"def",
"get_input_fn",
"(",
"dataset_split",
",",
"batch_size",
",",
"capacity",
"=",
"10000",
",",
"min_after_dequeue",
"=",
"3000",
")",
":",
"def",
"_input_fn",
"(",
")",
":",
"\"\"\"Prepare features and labels.\"\"\"",
"images_batch",
",",
"labels_batch",
"=",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/boosted_trees/examples/mnist.py#L47-L66 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ftplib.py | python | parse227 | (resp) | return host, port | Parse the '227' response for a PASV request.
Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
Return ('host.addr.as.numbers', port#) tuple. | Parse the '227' response for a PASV request.
Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
Return ('host.addr.as.numbers', port#) tuple. | [
"Parse",
"the",
"227",
"response",
"for",
"a",
"PASV",
"request",
".",
"Raises",
"error_proto",
"if",
"it",
"does",
"not",
"contain",
"(",
"h1",
"h2",
"h3",
"h4",
"p1",
"p2",
")",
"Return",
"(",
"host",
".",
"addr",
".",
"as",
".",
"numbers",
"port#"... | def parse227(resp):
'''Parse the '227' response for a PASV request.
Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
Return ('host.addr.as.numbers', port#) tuple.'''
if resp[:3] != '227':
raise error_reply, resp
global _227_re
if _227_re is None:
import re
... | [
"def",
"parse227",
"(",
"resp",
")",
":",
"if",
"resp",
"[",
":",
"3",
"]",
"!=",
"'227'",
":",
"raise",
"error_reply",
",",
"resp",
"global",
"_227_re",
"if",
"_227_re",
"is",
"None",
":",
"import",
"re",
"_227_re",
"=",
"re",
".",
"compile",
"(",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ftplib.py#L794-L811 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/external/bazel_tools/tools/build_defs/pkg/make_deb.py | python | AddArFileEntry | (fileobj, filename,
content='', timestamp=0,
owner_id=0, group_id=0, mode=0o644) | Add a AR file entry to fileobj. | Add a AR file entry to fileobj. | [
"Add",
"a",
"AR",
"file",
"entry",
"to",
"fileobj",
"."
] | def AddArFileEntry(fileobj, filename,
content='', timestamp=0,
owner_id=0, group_id=0, mode=0o644):
"""Add a AR file entry to fileobj."""
fileobj.write((filename + '/').ljust(16)) # filename (SysV)
fileobj.write(str(timestamp).ljust(12)) # timestamp
fileobj.write(st... | [
"def",
"AddArFileEntry",
"(",
"fileobj",
",",
"filename",
",",
"content",
"=",
"''",
",",
"timestamp",
"=",
"0",
",",
"owner_id",
"=",
"0",
",",
"group_id",
"=",
"0",
",",
"mode",
"=",
"0o644",
")",
":",
"fileobj",
".",
"write",
"(",
"(",
"filename",... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/tools/build_defs/pkg/make_deb.py#L75-L88 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/foldpanelbar.py | python | CaptionBarStyle.GetCaptionStyle | (self) | return self._captionStyle | Returns the caption style for the caption bar.
:note: Please be warned this will result in an assertion failure
when this property is not previously set.
:see: :meth:`~CaptionBarStyle.SetCaptionStyle`, :meth:`~CaptionBarStyle.CaptionStyleUsed` | Returns the caption style for the caption bar.
:note: Please be warned this will result in an assertion failure
when this property is not previously set.
:see: :meth:`~CaptionBarStyle.SetCaptionStyle`, :meth:`~CaptionBarStyle.CaptionStyleUsed` | [
"Returns",
"the",
"caption",
"style",
"for",
"the",
"caption",
"bar",
".",
":",
"note",
":",
"Please",
"be",
"warned",
"this",
"will",
"result",
"in",
"an",
"assertion",
"failure",
"when",
"this",
"property",
"is",
"not",
"previously",
"set",
".",
":",
"... | def GetCaptionStyle(self):
"""
Returns the caption style for the caption bar.
:note: Please be warned this will result in an assertion failure
when this property is not previously set.
:see: :meth:`~CaptionBarStyle.SetCaptionStyle`, :meth:`~CaptionBarStyle.Capt... | [
"def",
"GetCaptionStyle",
"(",
"self",
")",
":",
"return",
"self",
".",
"_captionStyle"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/foldpanelbar.py#L498-L508 | |
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/sat/python/visualization.py | python | SvgWrapper.AddXScale | (self, step=1) | Add an scale on the x axis. | Add an scale on the x axis. | [
"Add",
"an",
"scale",
"on",
"the",
"x",
"axis",
"."
] | def AddXScale(self, step=1):
"""Add an scale on the x axis."""
o = self.__offset
s = self.__scaling
y = self.__sizey * s + o / 2.0 + o
dy = self.__offset / 4.0
self.__dwg.add(
self.__dwg.line((o, y), (self.__sizex * s + o, y), stroke='black'))
for i in... | [
"def",
"AddXScale",
"(",
"self",
",",
"step",
"=",
"1",
")",
":",
"o",
"=",
"self",
".",
"__offset",
"s",
"=",
"self",
".",
"__scaling",
"y",
"=",
"self",
".",
"__sizey",
"*",
"s",
"+",
"o",
"/",
"2.0",
"+",
"o",
"dy",
"=",
"self",
".",
"__of... | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/sat/python/visualization.py#L132-L143 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/crywaflib/msvs.py | python | compile_template | (line) | return Task.funex(fun) | Compile a template expression into a python function (like jsps, but way shorter) | Compile a template expression into a python function (like jsps, but way shorter) | [
"Compile",
"a",
"template",
"expression",
"into",
"a",
"python",
"function",
"(",
"like",
"jsps",
"but",
"way",
"shorter",
")"
] | def compile_template(line):
"""
Compile a template expression into a python function (like jsps, but way shorter)
"""
extr = []
def repl(match):
g = match.group
if g('dollar'): return "$"
elif g('backslash'):
return "\\"
elif g('subst'):
extr.append(g('code'))
return "<<|@|>>"
return None
lin... | [
"def",
"compile_template",
"(",
"line",
")",
":",
"extr",
"=",
"[",
"]",
"def",
"repl",
"(",
"match",
")",
":",
"g",
"=",
"match",
".",
"group",
"if",
"g",
"(",
"'dollar'",
")",
":",
"return",
"\"$\"",
"elif",
"g",
"(",
"'backslash'",
")",
":",
"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/msvs.py#L613-L667 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/dataframe/transform.py | python | TensorFlowTransform._produce_output_series | (self, input_series=None) | return [TransformedSeries(input_series, self, output_name)
for output_name in self.output_names] | Apply this `Transform` to the provided `Series`, producing `Series`.
Args:
input_series: None, a `Series`, or a list of input `Series`, acting as
positional arguments.
Returns:
A namedtuple of the output `Series`. | Apply this `Transform` to the provided `Series`, producing `Series`. | [
"Apply",
"this",
"Transform",
"to",
"the",
"provided",
"Series",
"producing",
"Series",
"."
] | def _produce_output_series(self, input_series=None):
"""Apply this `Transform` to the provided `Series`, producing `Series`.
Args:
input_series: None, a `Series`, or a list of input `Series`, acting as
positional arguments.
Returns:
A namedtuple of the output `Series`.
"""
ret... | [
"def",
"_produce_output_series",
"(",
"self",
",",
"input_series",
"=",
"None",
")",
":",
"return",
"[",
"TransformedSeries",
"(",
"input_series",
",",
"self",
",",
"output_name",
")",
"for",
"output_name",
"in",
"self",
".",
"output_names",
"]"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/dataframe/transform.py#L266-L277 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/plotting/markers.py | python | RangeMarker.is_marker_moving | (self) | return self.min_marker.is_marker_moving() or self.max_marker.is_marker_moving() | Returns true if one of the markers is being moved
:return: True if one of the markers is being moved. | Returns true if one of the markers is being moved
:return: True if one of the markers is being moved. | [
"Returns",
"true",
"if",
"one",
"of",
"the",
"markers",
"is",
"being",
"moved",
":",
"return",
":",
"True",
"if",
"one",
"of",
"the",
"markers",
"is",
"being",
"moved",
"."
] | def is_marker_moving(self):
"""
Returns true if one of the markers is being moved
:return: True if one of the markers is being moved.
"""
return self.min_marker.is_marker_moving() or self.max_marker.is_marker_moving() | [
"def",
"is_marker_moving",
"(",
"self",
")",
":",
"return",
"self",
".",
"min_marker",
".",
"is_marker_moving",
"(",
")",
"or",
"self",
".",
"max_marker",
".",
"is_marker_moving",
"(",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/plotting/markers.py#L1170-L1175 | |
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | python_packaging/src/gmxapi/simulation/fileio.py | python | read_tpr | (tprfile: typing.Union[str, TprFile]) | return _SimulationInput(tprfile) | Get a simulation input object from a TPR run input file.
Arguments:
tprfile : TPR input object or filename
Returns:
simulation input object
The returned object may be inspected by the user. Simulation input parameters
may be extracted through the `parameters` attribute.
Example:... | Get a simulation input object from a TPR run input file. | [
"Get",
"a",
"simulation",
"input",
"object",
"from",
"a",
"TPR",
"run",
"input",
"file",
"."
] | def read_tpr(tprfile: typing.Union[str, TprFile]):
"""
Get a simulation input object from a TPR run input file.
Arguments:
tprfile : TPR input object or filename
Returns:
simulation input object
The returned object may be inspected by the user. Simulation input parameters
may... | [
"def",
"read_tpr",
"(",
"tprfile",
":",
"typing",
".",
"Union",
"[",
"str",
",",
"TprFile",
"]",
")",
":",
"if",
"not",
"isinstance",
"(",
"tprfile",
",",
"TprFile",
")",
":",
"try",
":",
"tprfile",
"=",
"TprFile",
"(",
"os",
".",
"fsencode",
"(",
... | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/python_packaging/src/gmxapi/simulation/fileio.py#L176-L203 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/tensor_array_ops.py | python | TensorArray.concat | (self, name=None) | Return the values in the TensorArray as a concatenated `Tensor`.
All of the values must have been written, their ranks must match, and
and their shapes must all match for all dimensions except the first.
Args:
name: A name for the operation (optional).
Returns:
All the tensors in the Tens... | Return the values in the TensorArray as a concatenated `Tensor`. | [
"Return",
"the",
"values",
"in",
"the",
"TensorArray",
"as",
"a",
"concatenated",
"Tensor",
"."
] | def concat(self, name=None):
"""Return the values in the TensorArray as a concatenated `Tensor`.
All of the values must have been written, their ranks must match, and
and their shapes must all match for all dimensions except the first.
Args:
name: A name for the operation (optional).
Return... | [
"def",
"concat",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"if",
"self",
".",
"_elem_shape",
"and",
"self",
".",
"_elem_shape",
"[",
"0",
"]",
".",
"dims",
"is",
"not",
"None",
":",
"element_shape_except0",
"=",
"tensor_shape",
".",
"TensorShape",... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/tensor_array_ops.py#L255-L281 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | ComboBox.GetClassDefaultAttributes | (*args, **kwargs) | return _controls_.ComboBox_GetClassDefaultAttributes(*args, **kwargs) | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
co... | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def GetClassDefaultAttributes(*args, **kwargs):
"""
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control... | [
"def",
"GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ComboBox_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L669-L684 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/asyncio/selector_events.py | python | BaseSelectorEventLoop._remove_writer | (self, fd) | Remove a writer callback. | Remove a writer callback. | [
"Remove",
"a",
"writer",
"callback",
"."
] | def _remove_writer(self, fd):
"""Remove a writer callback."""
if self.is_closed():
return False
try:
key = self._selector.get_key(fd)
except KeyError:
return False
else:
mask, (reader, writer) = key.events, key.data
# Re... | [
"def",
"_remove_writer",
"(",
"self",
",",
"fd",
")",
":",
"if",
"self",
".",
"is_closed",
"(",
")",
":",
"return",
"False",
"try",
":",
"key",
"=",
"self",
".",
"_selector",
".",
"get_key",
"(",
"fd",
")",
"except",
"KeyError",
":",
"return",
"False... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/selector_events.py#L303-L324 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb2/layer1.py | python | DynamoDBConnection.create_table | (self, attribute_definitions, table_name, key_schema,
provisioned_throughput, local_secondary_indexes=None,
global_secondary_indexes=None) | return self.make_request(action='CreateTable',
body=json.dumps(params)) | The CreateTable operation adds a new table to your account. In
an AWS account, table names must be unique within each region.
That is, you can have two tables with same name if you create
the tables in different regions.
CreateTable is an asynchronous operation. Upon receiving a
... | The CreateTable operation adds a new table to your account. In
an AWS account, table names must be unique within each region.
That is, you can have two tables with same name if you create
the tables in different regions. | [
"The",
"CreateTable",
"operation",
"adds",
"a",
"new",
"table",
"to",
"your",
"account",
".",
"In",
"an",
"AWS",
"account",
"table",
"names",
"must",
"be",
"unique",
"within",
"each",
"region",
".",
"That",
"is",
"you",
"can",
"have",
"two",
"tables",
"w... | def create_table(self, attribute_definitions, table_name, key_schema,
provisioned_throughput, local_secondary_indexes=None,
global_secondary_indexes=None):
"""
The CreateTable operation adds a new table to your account. In
an AWS account, table names mus... | [
"def",
"create_table",
"(",
"self",
",",
"attribute_definitions",
",",
"table_name",
",",
"key_schema",
",",
"provisioned_throughput",
",",
"local_secondary_indexes",
"=",
"None",
",",
"global_secondary_indexes",
"=",
"None",
")",
":",
"params",
"=",
"{",
"'Attribut... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb2/layer1.py#L422-L565 | |
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | lib/rpn/generate_anchors.py | python | generate_anchors | (base_size=16, ratios=[0.5, 1, 2],
scales=2**np.arange(3, 6)) | return anchors | Generate anchor (reference) windows by enumerating aspect ratios X
scales wrt a reference (0, 0, 15, 15) window. | Generate anchor (reference) windows by enumerating aspect ratios X
scales wrt a reference (0, 0, 15, 15) window. | [
"Generate",
"anchor",
"(",
"reference",
")",
"windows",
"by",
"enumerating",
"aspect",
"ratios",
"X",
"scales",
"wrt",
"a",
"reference",
"(",
"0",
"0",
"15",
"15",
")",
"window",
"."
] | def generate_anchors(base_size=16, ratios=[0.5, 1, 2],
scales=2**np.arange(3, 6)):
"""
Generate anchor (reference) windows by enumerating aspect ratios X
scales wrt a reference (0, 0, 15, 15) window.
"""
base_anchor = np.array([1, 1, base_size, base_size]) - 1
ratio_anchors... | [
"def",
"generate_anchors",
"(",
"base_size",
"=",
"16",
",",
"ratios",
"=",
"[",
"0.5",
",",
"1",
",",
"2",
"]",
",",
"scales",
"=",
"2",
"**",
"np",
".",
"arange",
"(",
"3",
",",
"6",
")",
")",
":",
"base_anchor",
"=",
"np",
".",
"array",
"(",... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/rpn/generate_anchors.py#L37-L48 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/containers.py | python | MessageMap.get_or_create | (self, key) | return self[key] | get_or_create() is an alias for getitem (ie. map[key]).
Args:
key: The key to get or create in the map.
This is useful in cases where you want to be explicit that the call is
mutating the map. This can avoid lint errors for statements like this
that otherwise would appear to be pointless statem... | get_or_create() is an alias for getitem (ie. map[key]). | [
"get_or_create",
"()",
"is",
"an",
"alias",
"for",
"getitem",
"(",
"ie",
".",
"map",
"[",
"key",
"]",
")",
"."
] | def get_or_create(self, key):
"""get_or_create() is an alias for getitem (ie. map[key]).
Args:
key: The key to get or create in the map.
This is useful in cases where you want to be explicit that the call is
mutating the map. This can avoid lint errors for statements like this
that otherwis... | [
"def",
"get_or_create",
"(",
"self",
",",
"key",
")",
":",
"return",
"self",
"[",
"key",
"]"
] | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/containers.py#L448-L460 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | GraphicsBrush.__init__ | (self, *args, **kwargs) | __init__(self) -> GraphicsBrush
A wx.GraphicsBrush is a native representation of a brush. It is used
for filling a path on a `wx.GraphicsContext`. The contents are
specific and private to the respective renderer. The only way to get a
valid instance is via a Create...Brush call on the g... | __init__(self) -> GraphicsBrush | [
"__init__",
"(",
"self",
")",
"-",
">",
"GraphicsBrush"
] | def __init__(self, *args, **kwargs):
"""
__init__(self) -> GraphicsBrush
A wx.GraphicsBrush is a native representation of a brush. It is used
for filling a path on a `wx.GraphicsContext`. The contents are
specific and private to the respective renderer. The only way to get a
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_gdi_",
".",
"GraphicsBrush_swiginit",
"(",
"self",
",",
"_gdi_",
".",
"new_GraphicsBrush",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L5545-L5555 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py | python | CRL.set_nextUpdate | (self, when) | return self._set_boundary_time(_lib.X509_CRL_get_nextUpdate, when) | Set when the CRL will next be udpated.
The timestamp is formatted as an ASN.1 TIME::
YYYYMMDDhhmmssZ
.. versionadded:: 16.1.0
:param bytes when: A timestamp string.
:return: ``None`` | Set when the CRL will next be udpated. | [
"Set",
"when",
"the",
"CRL",
"will",
"next",
"be",
"udpated",
"."
] | def set_nextUpdate(self, when):
"""
Set when the CRL will next be udpated.
The timestamp is formatted as an ASN.1 TIME::
YYYYMMDDhhmmssZ
.. versionadded:: 16.1.0
:param bytes when: A timestamp string.
:return: ``None``
"""
return self._set_... | [
"def",
"set_nextUpdate",
"(",
"self",
",",
"when",
")",
":",
"return",
"self",
".",
"_set_boundary_time",
"(",
"_lib",
".",
"X509_CRL_get_nextUpdate",
",",
"when",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py#L2204-L2217 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | clang/utils/check_cfc/check_cfc.py | python | is_normal_compile | (args) | return compile_step and not bitcode and not query and not dependency and input_is_valid | Check if this is a normal compile which will output an object file rather
than a preprocess or link. args is a list of command line arguments. | Check if this is a normal compile which will output an object file rather
than a preprocess or link. args is a list of command line arguments. | [
"Check",
"if",
"this",
"is",
"a",
"normal",
"compile",
"which",
"will",
"output",
"an",
"object",
"file",
"rather",
"than",
"a",
"preprocess",
"or",
"link",
".",
"args",
"is",
"a",
"list",
"of",
"command",
"line",
"arguments",
"."
] | def is_normal_compile(args):
"""Check if this is a normal compile which will output an object file rather
than a preprocess or link. args is a list of command line arguments."""
compile_step = '-c' in args
# Bitcode cannot be disassembled in the same way
bitcode = '-flto' in args or '-emit-llvm' in ... | [
"def",
"is_normal_compile",
"(",
"args",
")",
":",
"compile_step",
"=",
"'-c'",
"in",
"args",
"# Bitcode cannot be disassembled in the same way",
"bitcode",
"=",
"'-flto'",
"in",
"args",
"or",
"'-emit-llvm'",
"in",
"args",
"# Version and help are queries of the compiler and... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/utils/check_cfc/check_cfc.py#L217-L230 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/process/plugins.py | python | Monitor.graceful | (self) | Stop the callback's background task thread and restart it. | Stop the callback's background task thread and restart it. | [
"Stop",
"the",
"callback",
"s",
"background",
"task",
"thread",
"and",
"restart",
"it",
"."
] | def graceful(self):
"""Stop the callback's background task thread and restart it."""
self.stop()
self.start() | [
"def",
"graceful",
"(",
"self",
")",
":",
"self",
".",
"stop",
"(",
")",
"self",
".",
"start",
"(",
")"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/process/plugins.py#L534-L537 | ||
numworks/epsilon | 8952d2f8b1de1c3f064eec8ffcea804c5594ba4c | build/device/usb/legacy.py | python | DeviceHandle.resetEndpoint | (self, endpoint) | r"""Reset all states for the specified endpoint.
Arguments:
endpoint: endpoint number. | r"""Reset all states for the specified endpoint. | [
"r",
"Reset",
"all",
"states",
"for",
"the",
"specified",
"endpoint",
"."
] | def resetEndpoint(self, endpoint):
r"""Reset all states for the specified endpoint.
Arguments:
endpoint: endpoint number.
"""
self.clearHalt(endpoint) | [
"def",
"resetEndpoint",
"(",
"self",
",",
"endpoint",
")",
":",
"self",
".",
"clearHalt",
"(",
"endpoint",
")"
] | https://github.com/numworks/epsilon/blob/8952d2f8b1de1c3f064eec8ffcea804c5594ba4c/build/device/usb/legacy.py#L245-L251 | ||
limbo018/DREAMPlace | 146c3b9fd003d1acd52c96d9fd02e3f0a05154e4 | dreamplace/ops/dct/discrete_spectral_transform.py | python | idsct2 | (x, expk_0=None, expk_1=None) | return idxt(idxt(x, 0, expk_1).transpose_(dim0=-2, dim1=-1), 1, expk_0).transpose_(dim0=-2, dim1=-1) | Batch 2D Inverse Discrete Sine-Cosine Transformation without normalization to coefficients.
It computes following equation, which is slightly different from standard DCT formulation.
y_{u, v} = \sum_p \sum_q x_{p, q} sin(pi/M*p*(u+0.5)) cos(pi/N*q*(v+0.5))
Compute 1D DST and then 1D DCT.
@param x batch ... | Batch 2D Inverse Discrete Sine-Cosine Transformation without normalization to coefficients.
It computes following equation, which is slightly different from standard DCT formulation.
y_{u, v} = \sum_p \sum_q x_{p, q} sin(pi/M*p*(u+0.5)) cos(pi/N*q*(v+0.5))
Compute 1D DST and then 1D DCT. | [
"Batch",
"2D",
"Inverse",
"Discrete",
"Sine",
"-",
"Cosine",
"Transformation",
"without",
"normalization",
"to",
"coefficients",
".",
"It",
"computes",
"following",
"equation",
"which",
"is",
"slightly",
"different",
"from",
"standard",
"DCT",
"formulation",
".",
... | def idsct2(x, expk_0=None, expk_1=None):
""" Batch 2D Inverse Discrete Sine-Cosine Transformation without normalization to coefficients.
It computes following equation, which is slightly different from standard DCT formulation.
y_{u, v} = \sum_p \sum_q x_{p, q} sin(pi/M*p*(u+0.5)) cos(pi/N*q*(v+0.5))
Co... | [
"def",
"idsct2",
"(",
"x",
",",
"expk_0",
"=",
"None",
",",
"expk_1",
"=",
"None",
")",
":",
"return",
"idxt",
"(",
"idxt",
"(",
"x",
",",
"0",
",",
"expk_1",
")",
".",
"transpose_",
"(",
"dim0",
"=",
"-",
"2",
",",
"dim1",
"=",
"-",
"1",
")"... | https://github.com/limbo018/DREAMPlace/blob/146c3b9fd003d1acd52c96d9fd02e3f0a05154e4/dreamplace/ops/dct/discrete_spectral_transform.py#L385-L394 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/__init__.py | python | net_if_stats | () | return _psplatform.net_if_stats() | Return information about each NIC (network interface card)
installed on the system as a dictionary whose keys are the
NIC names and value is a namedtuple with the following fields:
- isup: whether the interface is up (bool)
- duplex: can be either NIC_DUPLEX_FULL, NIC_DUPLEX_HALF or
NI... | Return information about each NIC (network interface card)
installed on the system as a dictionary whose keys are the
NIC names and value is a namedtuple with the following fields: | [
"Return",
"information",
"about",
"each",
"NIC",
"(",
"network",
"interface",
"card",
")",
"installed",
"on",
"the",
"system",
"as",
"a",
"dictionary",
"whose",
"keys",
"are",
"the",
"NIC",
"names",
"and",
"value",
"is",
"a",
"namedtuple",
"with",
"the",
"... | def net_if_stats():
"""Return information about each NIC (network interface card)
installed on the system as a dictionary whose keys are the
NIC names and value is a namedtuple with the following fields:
- isup: whether the interface is up (bool)
- duplex: can be either NIC_DUPLEX_FULL, NIC_DUPLE... | [
"def",
"net_if_stats",
"(",
")",
":",
"return",
"_psplatform",
".",
"net_if_stats",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/__init__.py#L2206-L2218 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/tools/gyp/pylib/gyp/generator/android.py | python | AndroidMkWriter.ExtractIncludesFromCFlags | (self, cflags) | return (clean_cflags, include_paths) | Extract includes "-I..." out from cflags
Args:
cflags: A list of compiler flags, which may be mixed with "-I.."
Returns:
A tuple of lists: (clean_clfags, include_paths). "-I.." is trimmed. | Extract includes "-I..." out from cflags | [
"Extract",
"includes",
"-",
"I",
"...",
"out",
"from",
"cflags"
] | def ExtractIncludesFromCFlags(self, cflags):
"""Extract includes "-I..." out from cflags
Args:
cflags: A list of compiler flags, which may be mixed with "-I.."
Returns:
A tuple of lists: (clean_clfags, include_paths). "-I.." is trimmed.
"""
clean_cflags = []
include_paths = []
i... | [
"def",
"ExtractIncludesFromCFlags",
"(",
"self",
",",
"cflags",
")",
":",
"clean_cflags",
"=",
"[",
"]",
"include_paths",
"=",
"[",
"]",
"if",
"cflags",
":",
"for",
"flag",
"in",
"cflags",
":",
"if",
"flag",
".",
"startswith",
"(",
"'-I'",
")",
":",
"i... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/android.py#L724-L741 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Text.delete | (self, index1, index2=None) | Delete the characters between INDEX1 and INDEX2 (not included). | Delete the characters between INDEX1 and INDEX2 (not included). | [
"Delete",
"the",
"characters",
"between",
"INDEX1",
"and",
"INDEX2",
"(",
"not",
"included",
")",
"."
] | def delete(self, index1, index2=None):
"""Delete the characters between INDEX1 and INDEX2 (not included)."""
self.tk.call(self._w, 'delete', index1, index2) | [
"def",
"delete",
"(",
"self",
",",
"index1",
",",
"index2",
"=",
"None",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'delete'",
",",
"index1",
",",
"index2",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2913-L2915 | ||
intel-iot-devkit/how-to-code-samples | b4ea616f36bbfa2e042beb1698f968cfd651d79f | close-call-reporter/python/iot_close_call_reporter/__main__.py | python | main | () | Start main function. | Start main function. | [
"Start",
"main",
"function",
"."
] | def main():
"""
Start main function.
"""
runner = Runner()
print("Running {0} example.".format(runner.project_name))
runner.start()
def signal_handle(sig, frame):
reactor.stop()
_exit(0)
signal(SIGINT, signal_handle)
reactor.run(installSignalHandlers=0) | [
"def",
"main",
"(",
")",
":",
"runner",
"=",
"Runner",
"(",
")",
"print",
"(",
"\"Running {0} example.\"",
".",
"format",
"(",
"runner",
".",
"project_name",
")",
")",
"runner",
".",
"start",
"(",
")",
"def",
"signal_handle",
"(",
"sig",
",",
"frame",
... | https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/close-call-reporter/python/iot_close_call_reporter/__main__.py#L32-L48 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/platform.py | python | _platform | (*args) | return platform | Helper to format the platform string in a filename
compatible format e.g. "system-version-machine". | Helper to format the platform string in a filename
compatible format e.g. "system-version-machine". | [
"Helper",
"to",
"format",
"the",
"platform",
"string",
"in",
"a",
"filename",
"compatible",
"format",
"e",
".",
"g",
".",
"system",
"-",
"version",
"-",
"machine",
"."
] | def _platform(*args):
""" Helper to format the platform string in a filename
compatible format e.g. "system-version-machine".
"""
# Format the platform string
platform = string.join(
map(string.strip,
filter(len, args)),
'-')
# Cleanup some possible filename obs... | [
"def",
"_platform",
"(",
"*",
"args",
")",
":",
"# Format the platform string",
"platform",
"=",
"string",
".",
"join",
"(",
"map",
"(",
"string",
".",
"strip",
",",
"filter",
"(",
"len",
",",
"args",
")",
")",
",",
"'-'",
")",
"# Cleanup some possible fil... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/platform.py#L922-L956 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Configure.py | python | ConfigurationContext.eval_rules | (self, rules) | Execute the configuration tests. The method :py:meth:`waflib.Configure.ConfigurationContext.err_handler`
is used to process the eventual exceptions
:param rules: list of configuration method names
:type rules: list of string | Execute the configuration tests. The method :py:meth:`waflib.Configure.ConfigurationContext.err_handler`
is used to process the eventual exceptions | [
"Execute",
"the",
"configuration",
"tests",
".",
"The",
"method",
":",
"py",
":",
"meth",
":",
"waflib",
".",
"Configure",
".",
"ConfigurationContext",
".",
"err_handler",
"is",
"used",
"to",
"process",
"the",
"eventual",
"exceptions"
] | def eval_rules(self, rules):
"""
Execute the configuration tests. The method :py:meth:`waflib.Configure.ConfigurationContext.err_handler`
is used to process the eventual exceptions
:param rules: list of configuration method names
:type rules: list of string
"""
self.rules = Utils.to_list(rules)
for x i... | [
"def",
"eval_rules",
"(",
"self",
",",
"rules",
")",
":",
"self",
".",
"rules",
"=",
"Utils",
".",
"to_list",
"(",
"rules",
")",
"for",
"x",
"in",
"self",
".",
"rules",
":",
"f",
"=",
"getattr",
"(",
"self",
",",
"x",
")",
"if",
"not",
"f",
":"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Configure.py#L356-L377 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSVersion.py | python | VisualStudioVersion.Path | (self) | return self.path | Returns the path to Visual Studio installation. | Returns the path to Visual Studio installation. | [
"Returns",
"the",
"path",
"to",
"Visual",
"Studio",
"installation",
"."
] | def Path(self):
"""Returns the path to Visual Studio installation."""
return self.path | [
"def",
"Path",
"(",
"self",
")",
":",
"return",
"self",
".",
"path"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSVersion.py#L57-L59 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | algorithms/src/LocalizationAndMapping/icp_lidar_localization/fast_gicp/thirdparty/pybind11/pybind11/setup_helpers.py | python | has_flag | (compiler, flag) | Return the flag if a flag name is supported on the
specified compiler, otherwise None (can be used as a boolean).
If multiple flags are passed, return the first that matches. | Return the flag if a flag name is supported on the
specified compiler, otherwise None (can be used as a boolean).
If multiple flags are passed, return the first that matches. | [
"Return",
"the",
"flag",
"if",
"a",
"flag",
"name",
"is",
"supported",
"on",
"the",
"specified",
"compiler",
"otherwise",
"None",
"(",
"can",
"be",
"used",
"as",
"a",
"boolean",
")",
".",
"If",
"multiple",
"flags",
"are",
"passed",
"return",
"the",
"firs... | def has_flag(compiler, flag):
"""
Return the flag if a flag name is supported on the
specified compiler, otherwise None (can be used as a boolean).
If multiple flags are passed, return the first that matches.
"""
with tmp_chdir():
fname = "flagcheck.cpp"
with open(fname, "w") as... | [
"def",
"has_flag",
"(",
"compiler",
",",
"flag",
")",
":",
"with",
"tmp_chdir",
"(",
")",
":",
"fname",
"=",
"\"flagcheck.cpp\"",
"with",
"open",
"(",
"fname",
",",
"\"w\"",
")",
"as",
"f",
":",
"# Don't trigger -Wunused-parameter.",
"f",
".",
"write",
"("... | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/icp_lidar_localization/fast_gicp/thirdparty/pybind11/pybind11/setup_helpers.py#L232-L249 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/initfini.py | python | initialize_all_asmprinters | () | Initialize all code generators. Necessary before generating
any assembly or machine code via the :meth:`TargetMachine.emit_object`
and :meth:`TargetMachine.emit_assembly` methods. | Initialize all code generators. Necessary before generating
any assembly or machine code via the :meth:`TargetMachine.emit_object`
and :meth:`TargetMachine.emit_assembly` methods. | [
"Initialize",
"all",
"code",
"generators",
".",
"Necessary",
"before",
"generating",
"any",
"assembly",
"or",
"machine",
"code",
"via",
"the",
":",
"meth",
":",
"TargetMachine",
".",
"emit_object",
"and",
":",
"meth",
":",
"TargetMachine",
".",
"emit_assembly",
... | def initialize_all_asmprinters():
"""
Initialize all code generators. Necessary before generating
any assembly or machine code via the :meth:`TargetMachine.emit_object`
and :meth:`TargetMachine.emit_assembly` methods.
"""
ffi.lib.LLVMPY_InitializeAllAsmPrinters() | [
"def",
"initialize_all_asmprinters",
"(",
")",
":",
"ffi",
".",
"lib",
".",
"LLVMPY_InitializeAllAsmPrinters",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/initfini.py#L22-L28 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | IconLocation.IsOk | (*args, **kwargs) | return _gdi_.IconLocation_IsOk(*args, **kwargs) | IsOk(self) -> bool | IsOk(self) -> bool | [
"IsOk",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsOk(*args, **kwargs):
"""IsOk(self) -> bool"""
return _gdi_.IconLocation_IsOk(*args, **kwargs) | [
"def",
"IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"IconLocation_IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L1351-L1353 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/calibration.py | python | _CalibratedClassifier.predict_proba | (self, X) | return proba | Posterior probabilities of classification
This function returns posterior probabilities of classification
according to each class on an array of test vectors X.
Parameters
----------
X : array-like, shape (n_samples, n_features)
The samples.
Returns
... | Posterior probabilities of classification | [
"Posterior",
"probabilities",
"of",
"classification"
] | def predict_proba(self, X):
"""Posterior probabilities of classification
This function returns posterior probabilities of classification
according to each class on an array of test vectors X.
Parameters
----------
X : array-like, shape (n_samples, n_features)
... | [
"def",
"predict_proba",
"(",
"self",
",",
"X",
")",
":",
"n_classes",
"=",
"len",
"(",
"self",
".",
"classes_",
")",
"proba",
"=",
"np",
".",
"zeros",
"(",
"(",
"X",
".",
"shape",
"[",
"0",
"]",
",",
"n_classes",
")",
")",
"df",
",",
"idx_pos_cla... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/calibration.py#L348-L387 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PGChoices.AllocExclusive | (*args, **kwargs) | return _propgrid.PGChoices_AllocExclusive(*args, **kwargs) | AllocExclusive(self) | AllocExclusive(self) | [
"AllocExclusive",
"(",
"self",
")"
] | def AllocExclusive(*args, **kwargs):
"""AllocExclusive(self)"""
return _propgrid.PGChoices_AllocExclusive(*args, **kwargs) | [
"def",
"AllocExclusive",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGChoices_AllocExclusive",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L326-L328 | |
facebook/watchman | 0917460c71b000b96be9b9575d77f06f2f6053bb | build/fbcode_builder/getdeps/builder.py | python | CargoBuilder._resolve_dep_to_crates | (build_source_dir, dep_to_git) | return dep_to_crates | This function traverse the build_source_dir in search of Cargo.toml
files, extracts the crate names from them using _extract_crates
function and returns a merged result containing crate names per
dependency name from all Cargo.toml files in the project. | This function traverse the build_source_dir in search of Cargo.toml
files, extracts the crate names from them using _extract_crates
function and returns a merged result containing crate names per
dependency name from all Cargo.toml files in the project. | [
"This",
"function",
"traverse",
"the",
"build_source_dir",
"in",
"search",
"of",
"Cargo",
".",
"toml",
"files",
"extracts",
"the",
"crate",
"names",
"from",
"them",
"using",
"_extract_crates",
"function",
"and",
"returns",
"a",
"merged",
"result",
"containing",
... | def _resolve_dep_to_crates(build_source_dir, dep_to_git):
"""
This function traverse the build_source_dir in search of Cargo.toml
files, extracts the crate names from them using _extract_crates
function and returns a merged result containing crate names per
dependency name from a... | [
"def",
"_resolve_dep_to_crates",
"(",
"build_source_dir",
",",
"dep_to_git",
")",
":",
"if",
"not",
"dep_to_git",
":",
"return",
"{",
"}",
"# no deps, so don't waste time traversing files",
"dep_to_crates",
"=",
"{",
"}",
"for",
"root",
",",
"_",
",",
"files",
"in... | https://github.com/facebook/watchman/blob/0917460c71b000b96be9b9575d77f06f2f6053bb/build/fbcode_builder/getdeps/builder.py#L1431-L1450 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/window/ewm.py | python | EWM.mean | (self, *args, **kwargs) | return self._apply("ewma", **kwargs) | Exponential weighted moving average.
Parameters
----------
*args, **kwargs
Arguments and keyword arguments to be passed into func. | Exponential weighted moving average. | [
"Exponential",
"weighted",
"moving",
"average",
"."
] | def mean(self, *args, **kwargs):
"""
Exponential weighted moving average.
Parameters
----------
*args, **kwargs
Arguments and keyword arguments to be passed into func.
"""
nv.validate_window_func("mean", args, kwargs)
return self._apply("ewma"... | [
"def",
"mean",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"nv",
".",
"validate_window_func",
"(",
"\"mean\"",
",",
"args",
",",
"kwargs",
")",
"return",
"self",
".",
"_apply",
"(",
"\"ewma\"",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/window/ewm.py#L257-L267 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/otci/otci/otci.py | python | OTCI.get_ifconfig_state | (self) | return self.__parse_values(self.execute_command('ifconfig'), up=True, down=False) | Get the status of the IPv6 interface. | Get the status of the IPv6 interface. | [
"Get",
"the",
"status",
"of",
"the",
"IPv6",
"interface",
"."
] | def get_ifconfig_state(self) -> bool:
"""Get the status of the IPv6 interface."""
return self.__parse_values(self.execute_command('ifconfig'), up=True, down=False) | [
"def",
"get_ifconfig_state",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"__parse_values",
"(",
"self",
".",
"execute_command",
"(",
"'ifconfig'",
")",
",",
"up",
"=",
"True",
",",
"down",
"=",
"False",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L193-L195 | |
lballabio/quantlib-old | 136336947ed4fea9ecc1da6edad188700e821739 | gensrc/gensrc/serialization/serializable.py | python | Serializable.groupName | (self) | return self.groupName_ | Return unique identifier for this object. | Return unique identifier for this object. | [
"Return",
"unique",
"identifier",
"for",
"this",
"object",
"."
] | def groupName(self):
"""Return unique identifier for this object."""
return self.groupName_ | [
"def",
"groupName",
"(",
"self",
")",
":",
"return",
"self",
".",
"groupName_"
] | https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/serialization/serializable.py#L42-L44 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/external/bazel_tools/tools/android/merge_manifests.py | python | MergeManifests._RemoveAndroidLabel | (self, node) | Remove android:label.
We do this because it is not required by merger manifest,
and it might contain @string references that will not allow compilation.
Args:
node: Node for which to remove Android labels. | Remove android:label. | [
"Remove",
"android",
":",
"label",
"."
] | def _RemoveAndroidLabel(self, node):
"""Remove android:label.
We do this because it is not required by merger manifest,
and it might contain @string references that will not allow compilation.
Args:
node: Node for which to remove Android labels.
"""
if node.hasAttribute(self._ANDROID_LAB... | [
"def",
"_RemoveAndroidLabel",
"(",
"self",
",",
"node",
")",
":",
"if",
"node",
".",
"hasAttribute",
"(",
"self",
".",
"_ANDROID_LABEL",
")",
":",
"node",
".",
"removeAttribute",
"(",
"self",
".",
"_ANDROID_LABEL",
")"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/external/bazel_tools/tools/android/merge_manifests.py#L200-L210 | ||
H-uru/Plasma | c2140ea046e82e9c199e257a7f2e7edb42602871 | Scripts/Python/kdshTreeRings.py | python | kdshTreeRings.__del__ | (self) | unload the dialog that we loaded | unload the dialog that we loaded | [
"unload",
"the",
"dialog",
"that",
"we",
"loaded"
] | def __del__(self):
"unload the dialog that we loaded" | [
"def",
"__del__",
"(",
"self",
")",
":"
] | https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/kdshTreeRings.py#L215-L216 | ||
baidu/bigflow | 449245016c0df7d1252e85581e588bfc60cefad3 | bigflow_python/python/bigflow/util/utils.py | python | detect_ptype | (runtime_value) | Detect the default PType type for a runtime value
Args:
runtime_value (object): a runtime value, cannot be PType
Returns:
class: detected PType class | Detect the default PType type for a runtime value | [
"Detect",
"the",
"default",
"PType",
"type",
"for",
"a",
"runtime",
"value"
] | def detect_ptype(runtime_value):
"""
Detect the default PType type for a runtime value
Args:
runtime_value (object): a runtime value, cannot be PType
Returns:
class: detected PType class
"""
import collections
def helper(nested_level, v):
if isinstance(v, collections... | [
"def",
"detect_ptype",
"(",
"runtime_value",
")",
":",
"import",
"collections",
"def",
"helper",
"(",
"nested_level",
",",
"v",
")",
":",
"if",
"isinstance",
"(",
"v",
",",
"collections",
".",
"MutableMapping",
")",
":",
"return",
"helper",
"(",
"nested_leve... | https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/util/utils.py#L95-L123 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/refactor.py | python | get_all_fix_names | (fixer_pkg, remove_prefix=True) | return fix_names | Return a sorted list of all available fix names in the given package. | Return a sorted list of all available fix names in the given package. | [
"Return",
"a",
"sorted",
"list",
"of",
"all",
"available",
"fix",
"names",
"in",
"the",
"given",
"package",
"."
] | def get_all_fix_names(fixer_pkg, remove_prefix=True):
"""Return a sorted list of all available fix names in the given package."""
pkg = __import__(fixer_pkg, [], [], ["*"])
fixer_dir = os.path.dirname(pkg.__file__)
fix_names = []
for name in sorted(os.listdir(fixer_dir)):
if name.startswith(... | [
"def",
"get_all_fix_names",
"(",
"fixer_pkg",
",",
"remove_prefix",
"=",
"True",
")",
":",
"pkg",
"=",
"__import__",
"(",
"fixer_pkg",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"\"*\"",
"]",
")",
"fixer_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"("... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/refactor.py#L33-L43 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HtmlCell.FindCellByPos | (*args, **kwargs) | return _html.HtmlCell_FindCellByPos(*args, **kwargs) | FindCellByPos(self, int x, int y, unsigned int flags=HTML_FIND_EXACT) -> HtmlCell | FindCellByPos(self, int x, int y, unsigned int flags=HTML_FIND_EXACT) -> HtmlCell | [
"FindCellByPos",
"(",
"self",
"int",
"x",
"int",
"y",
"unsigned",
"int",
"flags",
"=",
"HTML_FIND_EXACT",
")",
"-",
">",
"HtmlCell"
] | def FindCellByPos(*args, **kwargs):
"""FindCellByPos(self, int x, int y, unsigned int flags=HTML_FIND_EXACT) -> HtmlCell"""
return _html.HtmlCell_FindCellByPos(*args, **kwargs) | [
"def",
"FindCellByPos",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlCell_FindCellByPos",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L714-L716 | |
p4lang/behavioral-model | 81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9 | tools/cpplint.py | python | _IsParentOrSame | (parent, child) | return child == os.path.join(prefix, child_suffix) | Return true if child is subdirectory of parent.
Assumes both paths are absolute and don't contain symlinks. | Return true if child is subdirectory of parent.
Assumes both paths are absolute and don't contain symlinks. | [
"Return",
"true",
"if",
"child",
"is",
"subdirectory",
"of",
"parent",
".",
"Assumes",
"both",
"paths",
"are",
"absolute",
"and",
"don",
"t",
"contain",
"symlinks",
"."
] | def _IsParentOrSame(parent, child):
"""Return true if child is subdirectory of parent.
Assumes both paths are absolute and don't contain symlinks.
"""
parent = os.path.normpath(parent)
child = os.path.normpath(child)
if parent == child:
return True
prefix = os.path.commonprefix([parent, child])
if ... | [
"def",
"_IsParentOrSame",
"(",
"parent",
",",
"child",
")",
":",
"parent",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"parent",
")",
"child",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"child",
")",
"if",
"parent",
"==",
"child",
":",
"return",... | https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/cpplint.py#L6858-L6874 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/debug/lib/grpc_debug_server.py | python | EventListenerBaseStreamHandler.__init__ | (self) | Constructor of EventListenerBaseStreamHandler. | Constructor of EventListenerBaseStreamHandler. | [
"Constructor",
"of",
"EventListenerBaseStreamHandler",
"."
] | def __init__(self):
"""Constructor of EventListenerBaseStreamHandler.""" | [
"def",
"__init__",
"(",
"self",
")",
":"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/grpc_debug_server.py#L53-L54 | ||
deeplearningais/CUV | 4e920ad1304af9de3e5f755cc2e9c5c96e06c324 | examples/mlp/multi_layer_perceptron.py | python | MLP.__init__ | (self, neurons, batch_size) | Constructor
@param neurons -- array of sizes of layers.
@param batch_size -- size of batch being used for training. | Constructor | [
"Constructor"
] | def __init__(self, neurons, batch_size):
"""
Constructor
@param neurons -- array of sizes of layers.
@param batch_size -- size of batch being used for training.
"""
self.n_layers = len(neurons) - 1
self.batch_size = batch_size
self.neuron_layers = []
... | [
"def",
"__init__",
"(",
"self",
",",
"neurons",
",",
"batch_size",
")",
":",
"self",
".",
"n_layers",
"=",
"len",
"(",
"neurons",
")",
"-",
"1",
"self",
".",
"batch_size",
"=",
"batch_size",
"self",
".",
"neuron_layers",
"=",
"[",
"]",
"self",
".",
"... | https://github.com/deeplearningais/CUV/blob/4e920ad1304af9de3e5f755cc2e9c5c96e06c324/examples/mlp/multi_layer_perceptron.py#L23-L42 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/vector_sinh_arcsinh_diag.py | python | VectorSinhArcsinhDiag.loc | (self) | return self._loc | The `loc` in `Y := loc + scale @ F(Z) * (2 / F(2)). | The `loc` in `Y := loc + scale | [
"The",
"loc",
"in",
"Y",
":",
"=",
"loc",
"+",
"scale"
] | def loc(self):
"""The `loc` in `Y := loc + scale @ F(Z) * (2 / F(2))."""
return self._loc | [
"def",
"loc",
"(",
"self",
")",
":",
"return",
"self",
".",
"_loc"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/vector_sinh_arcsinh_diag.py#L257-L259 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.