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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | lldb/third_party/Python/module/six/six.py | python | with_metaclass | (meta, *bases) | return type.__new__(metaclass, 'temporary_class', (), {}) | Create a base class with a metaclass. | Create a base class with a metaclass. | [
"Create",
"a",
"base",
"class",
"with",
"a",
"metaclass",
"."
] | def with_metaclass(meta, *bases):
"""Create a base class with a metaclass."""
# This requires a bit of explanation: the basic idea is to make a dummy
# metaclass for one level of class instantiation that replaces itself with
# the actual metaclass.
class metaclass(meta):
def __new__(cls, na... | [
"def",
"with_metaclass",
"(",
"meta",
",",
"*",
"bases",
")",
":",
"# This requires a bit of explanation: the basic idea is to make a dummy",
"# metaclass for one level of class instantiation that replaces itself with",
"# the actual metaclass.",
"class",
"metaclass",
"(",
"meta",
")... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/lldb/third_party/Python/module/six/six.py#L819-L828 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/LIBXML/python/libxml.py | python | SAXCallback.cdataBlock | (self, data) | called when CDATA section have been read, data is the string
containing the data, multiple consecutive cdataBlock() callback
are possible. | called when CDATA section have been read, data is the string
containing the data, multiple consecutive cdataBlock() callback
are possible. | [
"called",
"when",
"CDATA",
"section",
"have",
"been",
"read",
"data",
"is",
"the",
"string",
"containing",
"the",
"data",
"multiple",
"consecutive",
"cdataBlock",
"()",
"callback",
"are",
"possible",
"."
] | def cdataBlock(self, data):
"""called when CDATA section have been read, data is the string
containing the data, multiple consecutive cdataBlock() callback
are possible."""
pass | [
"def",
"cdataBlock",
"(",
"self",
",",
"data",
")",
":",
"pass"
] | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/LIBXML/python/libxml.py#L188-L192 | ||
NREL/EnergyPlus | fadc5973b85c70e8cc923efb69c144e808a26078 | src/EnergyPlus/api/func.py | python | Psychrometrics.dew_point | (self, state: c_void_p, humidity_ratio: float, barometric_pressure: float) | return self.api.psyTdpFnWPb(state, humidity_ratio, barometric_pressure) | Returns the psychrometric dew point temperature at the specified conditions.
:param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`.
:param humidity_ratio: Humidity ratio, in kgWater/kgDryAir
:param barometric_pressure: Barometric pressure, in... | Returns the psychrometric dew point temperature at the specified conditions. | [
"Returns",
"the",
"psychrometric",
"dew",
"point",
"temperature",
"at",
"the",
"specified",
"conditions",
"."
] | def dew_point(self, state: c_void_p, humidity_ratio: float, barometric_pressure: float) -> float:
"""
Returns the psychrometric dew point temperature at the specified conditions.
:param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`.
... | [
"def",
"dew_point",
"(",
"self",
",",
"state",
":",
"c_void_p",
",",
"humidity_ratio",
":",
"float",
",",
"barometric_pressure",
":",
"float",
")",
"->",
"float",
":",
"return",
"self",
".",
"api",
".",
"psyTdpFnWPb",
"(",
"state",
",",
"humidity_ratio",
"... | https://github.com/NREL/EnergyPlus/blob/fadc5973b85c70e8cc923efb69c144e808a26078/src/EnergyPlus/api/func.py#L527-L536 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/internals/managers.py | python | BaseBlockManager.any_extension_types | (self) | return any(block.is_extension for block in self.blocks) | Whether any of the blocks in this manager are extension blocks | Whether any of the blocks in this manager are extension blocks | [
"Whether",
"any",
"of",
"the",
"blocks",
"in",
"this",
"manager",
"are",
"extension",
"blocks"
] | def any_extension_types(self) -> bool:
"""Whether any of the blocks in this manager are extension blocks"""
return any(block.is_extension for block in self.blocks) | [
"def",
"any_extension_types",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"any",
"(",
"block",
".",
"is_extension",
"for",
"block",
"in",
"self",
".",
"blocks",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/managers.py#L486-L488 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/libs.py | python | get_cudalib | (lib, platform=None) | return max(candidates) if candidates else _dllnamepattern % lib | Find the path of a CUDA library based on a search of known locations. If
the search fails, return a generic filename for the library (e.g.
'libnvvm.so' for 'nvvm') so that we may attempt to load it using the system
loader's search mechanism. | Find the path of a CUDA library based on a search of known locations. If
the search fails, return a generic filename for the library (e.g.
'libnvvm.so' for 'nvvm') so that we may attempt to load it using the system
loader's search mechanism. | [
"Find",
"the",
"path",
"of",
"a",
"CUDA",
"library",
"based",
"on",
"a",
"search",
"of",
"known",
"locations",
".",
"If",
"the",
"search",
"fails",
"return",
"a",
"generic",
"filename",
"for",
"the",
"library",
"(",
"e",
".",
"g",
".",
"libnvvm",
".",
... | def get_cudalib(lib, platform=None):
"""
Find the path of a CUDA library based on a search of known locations. If
the search fails, return a generic filename for the library (e.g.
'libnvvm.so' for 'nvvm') so that we may attempt to load it using the system
loader's search mechanism.
"""
if li... | [
"def",
"get_cudalib",
"(",
"lib",
",",
"platform",
"=",
"None",
")",
":",
"if",
"lib",
"==",
"'nvvm'",
":",
"return",
"get_cuda_paths",
"(",
")",
"[",
"'nvvm'",
"]",
".",
"info",
"or",
"_dllnamepattern",
"%",
"'nvvm'",
"else",
":",
"libdir",
"=",
"get_... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/libs.py#L39-L52 | |
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/google/protobuf/reflection.py | python | _AddListFieldsMethod | (message_descriptor, cls) | Helper for _AddMessageMethods(). | Helper for _AddMessageMethods(). | [
"Helper",
"for",
"_AddMessageMethods",
"()",
"."
] | def _AddListFieldsMethod(message_descriptor, cls):
"""Helper for _AddMessageMethods()."""
# Ensure that we always list in ascending field-number order.
# For non-extension fields, we can do the sort once, here, at import-time.
# For extensions, we sort on each ListFields() call, though
# we could do better i... | [
"def",
"_AddListFieldsMethod",
"(",
"message_descriptor",
",",
"cls",
")",
":",
"# Ensure that we always list in ascending field-number order.",
"# For non-extension fields, we can do the sort once, here, at import-time.",
"# For extensions, we sort on each ListFields() call, though",
"# we co... | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/reflection.py#L503-L550 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/extras.py | python | mask_rowcols | (a, axis=None) | return a | Mask rows and/or columns of a 2D array that contain masked values.
Mask whole rows and/or columns of a 2D array that contain
masked values. The masking behavior is selected using the
`axis` parameter.
- If `axis` is None, rows *and* columns are masked.
- If `axis` is 0, only rows are masked.
... | Mask rows and/or columns of a 2D array that contain masked values. | [
"Mask",
"rows",
"and",
"/",
"or",
"columns",
"of",
"a",
"2D",
"array",
"that",
"contain",
"masked",
"values",
"."
] | def mask_rowcols(a, axis=None):
"""
Mask rows and/or columns of a 2D array that contain masked values.
Mask whole rows and/or columns of a 2D array that contain
masked values. The masking behavior is selected using the
`axis` parameter.
- If `axis` is None, rows *and* columns are masked.
... | [
"def",
"mask_rowcols",
"(",
"a",
",",
"axis",
"=",
"None",
")",
":",
"a",
"=",
"asarray",
"(",
"a",
")",
"if",
"a",
".",
"ndim",
"!=",
"2",
":",
"raise",
"NotImplementedError",
"(",
"\"compress2d works for 2D arrays only.\"",
")",
"m",
"=",
"getmask",
"(... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/extras.py#L770-L858 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/operations/array_ops.py | python | InplaceUpdate.__init__ | (self, indices) | Initialize InplaceUpdate | Initialize InplaceUpdate | [
"Initialize",
"InplaceUpdate"
] | def __init__(self, indices):
"""Initialize InplaceUpdate"""
self.init_prim_io_names(inputs=['x', 'v'], outputs=['y'])
self.indices = indices
validator.check_value_type("indices", indices, [int, tuple], self.name)
if isinstance(indices, int):
self.indices = (indices,)
... | [
"def",
"__init__",
"(",
"self",
",",
"indices",
")",
":",
"self",
".",
"init_prim_io_names",
"(",
"inputs",
"=",
"[",
"'x'",
",",
"'v'",
"]",
",",
"outputs",
"=",
"[",
"'y'",
"]",
")",
"self",
".",
"indices",
"=",
"indices",
"validator",
".",
"check_... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/array_ops.py#L5650-L5658 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/agents/tools/streaming_mean.py | python | StreamingMean.clear | (self) | Return the mean estimate and reset the streaming statistics. | Return the mean estimate and reset the streaming statistics. | [
"Return",
"the",
"mean",
"estimate",
"and",
"reset",
"the",
"streaming",
"statistics",
"."
] | def clear(self):
"""Return the mean estimate and reset the streaming statistics."""
value = self._sum / tf.cast(self._count, self._dtype)
with tf.control_dependencies([value]):
reset_value = self._sum.assign(tf.zeros_like(self._sum))
reset_count = self._count.assign(0)
with tf.control_depend... | [
"def",
"clear",
"(",
"self",
")",
":",
"value",
"=",
"self",
".",
"_sum",
"/",
"tf",
".",
"cast",
"(",
"self",
".",
"_count",
",",
"self",
".",
"_dtype",
")",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"value",
"]",
")",
":",
"reset_value... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/agents/tools/streaming_mean.py#L58-L65 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/expressions/expression.py | python | Expression.is_complex | (self) | Is the Leaf complex valued? | Is the Leaf complex valued? | [
"Is",
"the",
"Leaf",
"complex",
"valued?"
] | def is_complex(self) -> bool:
"""Is the Leaf complex valued?
"""
raise NotImplementedError() | [
"def",
"is_complex",
"(",
"self",
")",
"->",
"bool",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/expressions/expression.py#L383-L386 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/framework/tensor_shape.py | python | unknown_shape | (ndims=None) | Returns an unknown TensorShape, optionally with a known rank.
Args:
ndims: (Optional) If specified, the number of dimensions in the shape.
Returns:
An unknown TensorShape. | Returns an unknown TensorShape, optionally with a known rank. | [
"Returns",
"an",
"unknown",
"TensorShape",
"optionally",
"with",
"a",
"known",
"rank",
"."
] | def unknown_shape(ndims=None):
"""Returns an unknown TensorShape, optionally with a known rank.
Args:
ndims: (Optional) If specified, the number of dimensions in the shape.
Returns:
An unknown TensorShape.
"""
if ndims is None:
return TensorShape(None)
else:
return TensorShape([Dimension(N... | [
"def",
"unknown_shape",
"(",
"ndims",
"=",
"None",
")",
":",
"if",
"ndims",
"is",
"None",
":",
"return",
"TensorShape",
"(",
"None",
")",
"else",
":",
"return",
"TensorShape",
"(",
"[",
"Dimension",
"(",
"None",
")",
"]",
"*",
"ndims",
")"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/tensor_shape.py#L804-L816 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/package_index.py | python | distros_for_location | (location, basename, metadata=None) | return [] | Yield egg or source distribution objects based on basename | Yield egg or source distribution objects based on basename | [
"Yield",
"egg",
"or",
"source",
"distribution",
"objects",
"based",
"on",
"basename"
] | def distros_for_location(location, basename, metadata=None):
"""Yield egg or source distribution objects based on basename"""
if basename.endswith('.egg.zip'):
basename = basename[:-4] # strip the .zip
if basename.endswith('.egg') and '-' in basename:
# only one, unambiguous interpretation
... | [
"def",
"distros_for_location",
"(",
"location",
",",
"basename",
",",
"metadata",
"=",
"None",
")",
":",
"if",
"basename",
".",
"endswith",
"(",
"'.egg.zip'",
")",
":",
"basename",
"=",
"basename",
"[",
":",
"-",
"4",
"]",
"# strip the .zip",
"if",
"basena... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/package_index.py#L111-L141 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/__init__.py | python | Node.is_up_to_date | (self) | return None | Default check for whether the Node is current: unknown Node
subtypes are always out of date, so they will always get built. | Default check for whether the Node is current: unknown Node
subtypes are always out of date, so they will always get built. | [
"Default",
"check",
"for",
"whether",
"the",
"Node",
"is",
"current",
":",
"unknown",
"Node",
"subtypes",
"are",
"always",
"out",
"of",
"date",
"so",
"they",
"will",
"always",
"get",
"built",
"."
] | def is_up_to_date(self):
"""Default check for whether the Node is current: unknown Node
subtypes are always out of date, so they will always get built."""
return None | [
"def",
"is_up_to_date",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/__init__.py#L1511-L1514 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/wsgiref/handlers.py | python | BaseHandler.start_response | (self, status, headers,exc_info=None) | return self.write | start_response()' callable as specified by PEP 333 | start_response()' callable as specified by PEP 333 | [
"start_response",
"()",
"callable",
"as",
"specified",
"by",
"PEP",
"333"
] | def start_response(self, status, headers,exc_info=None):
"""'start_response()' callable as specified by PEP 333"""
if exc_info:
try:
if self.headers_sent:
# Re-raise original exception if headers sent
raise exc_info[0], exc_info[1], ex... | [
"def",
"start_response",
"(",
"self",
",",
"status",
",",
"headers",
",",
"exc_info",
"=",
"None",
")",
":",
"if",
"exc_info",
":",
"try",
":",
"if",
"self",
".",
"headers_sent",
":",
"# Re-raise original exception if headers sent",
"raise",
"exc_info",
"[",
"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/wsgiref/handlers.py#L166-L190 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibar.py | python | AuiToolBarItem.SetLongHelp | (self, s) | Sets the long help string for the toolbar item. This string is shown in the
statusbar (if any) of the parent frame when the mouse pointer is inside the
tool.
:param string `s`: the tool long help string. | Sets the long help string for the toolbar item. This string is shown in the
statusbar (if any) of the parent frame when the mouse pointer is inside the
tool. | [
"Sets",
"the",
"long",
"help",
"string",
"for",
"the",
"toolbar",
"item",
".",
"This",
"string",
"is",
"shown",
"in",
"the",
"statusbar",
"(",
"if",
"any",
")",
"of",
"the",
"parent",
"frame",
"when",
"the",
"mouse",
"pointer",
"is",
"inside",
"the",
"... | def SetLongHelp(self, s):
"""
Sets the long help string for the toolbar item. This string is shown in the
statusbar (if any) of the parent frame when the mouse pointer is inside the
tool.
:param string `s`: the tool long help string.
"""
self.long_help = s | [
"def",
"SetLongHelp",
"(",
"self",
",",
"s",
")",
":",
"self",
".",
"long_help",
"=",
"s"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibar.py#L574-L583 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/plots/datafunctions.py | python | get_normalize_by_bin_width | (workspace, axes, **kwargs) | return normalization, kwargs | Determine whether or not the workspace should be plotted as a
distribution. If the workspace is a distribution return False, else,
if there is already a curves on the axes, return according to
whether those curves are distributions. Else go by the global
setting.
:param workspace: :class:`mantid.api... | Determine whether or not the workspace should be plotted as a
distribution. If the workspace is a distribution return False, else,
if there is already a curves on the axes, return according to
whether those curves are distributions. Else go by the global
setting.
:param workspace: :class:`mantid.api... | [
"Determine",
"whether",
"or",
"not",
"the",
"workspace",
"should",
"be",
"plotted",
"as",
"a",
"distribution",
".",
"If",
"the",
"workspace",
"is",
"a",
"distribution",
"return",
"False",
"else",
"if",
"there",
"is",
"already",
"a",
"curves",
"on",
"the",
... | def get_normalize_by_bin_width(workspace, axes, **kwargs):
"""
Determine whether or not the workspace should be plotted as a
distribution. If the workspace is a distribution return False, else,
if there is already a curves on the axes, return according to
whether those curves are distributions. Else... | [
"def",
"get_normalize_by_bin_width",
"(",
"workspace",
",",
"axes",
",",
"*",
"*",
"kwargs",
")",
":",
"normalize_by_bin_width",
"=",
"kwargs",
".",
"pop",
"(",
"'normalize_by_bin_width'",
",",
"None",
")",
"if",
"normalize_by_bin_width",
"is",
"not",
"None",
":... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/plots/datafunctions.py#L61-L93 | |
Tencent/Pebble | 68315f176d9e328a233ace29b7579a829f89879f | tools/blade/src/blade/swig_library_target.py | python | SwigLibrary._pyswig_gen_python_file | (self, path, src) | return os.path.join(self.build_path, path, '%s.py' % swig_name) | Generate swig python file for python. | Generate swig python file for python. | [
"Generate",
"swig",
"python",
"file",
"for",
"python",
"."
] | def _pyswig_gen_python_file(self, path, src):
"""Generate swig python file for python. """
swig_name = src[:-2]
return os.path.join(self.build_path, path, '%s.py' % swig_name) | [
"def",
"_pyswig_gen_python_file",
"(",
"self",
",",
"path",
",",
"src",
")",
":",
"swig_name",
"=",
"src",
"[",
":",
"-",
"2",
"]",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"build_path",
",",
"path",
",",
"'%s.py'",
"%",
"swig_name... | https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/tools/blade/src/blade/swig_library_target.py#L58-L61 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/pycollapsiblepane.py | python | PyCollapsiblePane.GetBtnLabel | (self) | return self.GetLabel() + (self.IsCollapsed() and [" >>"] or [" <<"])[0] | Returns the button label. | Returns the button label. | [
"Returns",
"the",
"button",
"label",
"."
] | def GetBtnLabel(self):
""" Returns the button label. """
if self.GetAGWWindowStyleFlag() & CP_GTK_EXPANDER:
return self.GetLabel()
return self.GetLabel() + (self.IsCollapsed() and [" >>"] or [" <<"])[0] | [
"def",
"GetBtnLabel",
"(",
"self",
")",
":",
"if",
"self",
".",
"GetAGWWindowStyleFlag",
"(",
")",
"&",
"CP_GTK_EXPANDER",
":",
"return",
"self",
".",
"GetLabel",
"(",
")",
"return",
"self",
".",
"GetLabel",
"(",
")",
"+",
"(",
"self",
".",
"IsCollapsed"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/pycollapsiblepane.py#L467-L473 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/process.py | python | Process.is_alive | (self) | return self._popen.returncode is None | Return whether process is alive | Return whether process is alive | [
"Return",
"whether",
"process",
"is",
"alive"
] | def is_alive(self):
'''
Return whether process is alive
'''
if self is _current_process:
return True
assert self._parent_pid == os.getpid(), 'can only test a child process'
if self._popen is None:
return False
self._popen.poll()
ret... | [
"def",
"is_alive",
"(",
"self",
")",
":",
"if",
"self",
"is",
"_current_process",
":",
"return",
"True",
"assert",
"self",
".",
"_parent_pid",
"==",
"os",
".",
"getpid",
"(",
")",
",",
"'can only test a child process'",
"if",
"self",
".",
"_popen",
"is",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/process.py#L149-L159 | |
kevinlin311tw/Caffe-DeepBinaryCode | 9eaa7662be47d49f475ecbeea2bd51be105270d2 | scripts/cpp_lint.py | python | CleanseRawStrings | (raw_lines) | return lines_without_raw_strings | Removes C++11 raw strings from lines.
Before:
static const char kData[] = R"(
multi-line string
)";
After:
static const char kData[] = ""
(replaced by blank line)
"";
Args:
raw_lines: list of raw lines.
Returns:
list of lines with C++11 raw str... | Removes C++11 raw strings from lines. | [
"Removes",
"C",
"++",
"11",
"raw",
"strings",
"from",
"lines",
"."
] | def CleanseRawStrings(raw_lines):
"""Removes C++11 raw strings from lines.
Before:
static const char kData[] = R"(
multi-line string
)";
After:
static const char kData[] = ""
(replaced by blank line)
"";
Args:
raw_lines: list of raw lines.
Return... | [
"def",
"CleanseRawStrings",
"(",
"raw_lines",
")",
":",
"delimiter",
"=",
"None",
"lines_without_raw_strings",
"=",
"[",
"]",
"for",
"line",
"in",
"raw_lines",
":",
"if",
"delimiter",
":",
"# Inside a raw string, look for the end",
"end",
"=",
"line",
".",
"find",... | https://github.com/kevinlin311tw/Caffe-DeepBinaryCode/blob/9eaa7662be47d49f475ecbeea2bd51be105270d2/scripts/cpp_lint.py#L1062-L1120 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/ordered_dict.py | python | OrderedDict.update | (*args, **kwds) | od.update(E, **F) -> None. Update od from dict/iterable E and F.
If E is a dict instance, does: for k in E: od[k] = E[k]
If E has a .keys() method, does: for k in E.keys(): od[k] = E[k]
Or if E is an iterable of items, does: for k, v in E: od[k] = v
In either case, ... | od.update(E, **F) -> None. Update od from dict/iterable E and F. | [
"od",
".",
"update",
"(",
"E",
"**",
"F",
")",
"-",
">",
"None",
".",
"Update",
"od",
"from",
"dict",
"/",
"iterable",
"E",
"and",
"F",
"."
] | def update(*args, **kwds):
'''od.update(E, **F) -> None. Update od from dict/iterable E and F.
If E is a dict instance, does: for k in E: od[k] = E[k]
If E has a .keys() method, does: for k in E.keys(): od[k] = E[k]
Or if E is an iterable of items, does: for k, v in... | [
"def",
"update",
"(",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"if",
"len",
"(",
"args",
")",
">",
"2",
":",
"raise",
"TypeError",
"(",
"'update() takes at most 2 positional '",
"'arguments (%d given)'",
"%",
"(",
"len",
"(",
"args",
")",
",",
")",
... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/ordered_dict.py#L171-L200 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/control/robotinterface.py | python | RobotInterfaceBase.initialize | (self) | return True | Tries to connect to the robot. Returns true if ready to send
commands. This should probably be the first method called. | Tries to connect to the robot. Returns true if ready to send
commands. This should probably be the first method called. | [
"Tries",
"to",
"connect",
"to",
"the",
"robot",
".",
"Returns",
"true",
"if",
"ready",
"to",
"send",
"commands",
".",
"This",
"should",
"probably",
"be",
"the",
"first",
"method",
"called",
"."
] | def initialize(self) -> bool:
"""Tries to connect to the robot. Returns true if ready to send
commands. This should probably be the first method called.
"""
return True | [
"def",
"initialize",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"True"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/robotinterface.py#L271-L275 | |
xournalpp/xournalpp | 27acdbb1d9217f21fb40c33ee52f40ca51d296d9 | scripts/compare_license.py | python | get_whitelist_not_listed | () | return white_list | Whitelist for files containing the searched for substrings but
are not necessary for the copyright.txt | Whitelist for files containing the searched for substrings but
are not necessary for the copyright.txt | [
"Whitelist",
"for",
"files",
"containing",
"the",
"searched",
"for",
"substrings",
"but",
"are",
"not",
"necessary",
"for",
"the",
"copyright",
".",
"txt"
] | def get_whitelist_not_listed():
"""Whitelist for files containing the searched for substrings but
are not necessary for the copyright.txt"""
white_list = set()
white_list.add("ABOUT-NLS") # false positive
white_list.add("copyright.txt") # copyright/license summary file
white_list.add("scripts/co... | [
"def",
"get_whitelist_not_listed",
"(",
")",
":",
"white_list",
"=",
"set",
"(",
")",
"white_list",
".",
"add",
"(",
"\"ABOUT-NLS\"",
")",
"# false positive",
"white_list",
".",
"add",
"(",
"\"copyright.txt\"",
")",
"# copyright/license summary file",
"white_list",
... | https://github.com/xournalpp/xournalpp/blob/27acdbb1d9217f21fb40c33ee52f40ca51d296d9/scripts/compare_license.py#L96-L109 | |
priyankchheda/algorithms | c361aa9071573fa9966d5b02d05e524815abcf2b | binary_tree/top_view.py | python | main | () | operational function | operational function | [
"operational",
"function"
] | def main():
""" operational function """
root = Node(2)
root.left = Node(7)
root.left.left = Node(2)
root.left.right = Node(6)
root.left.right.left = Node(5)
root.left.right.right = Node(11)
root.right = Node(5)
root.right.right = Node(9)
root.right.right.left = Node(4)
root.... | [
"def",
"main",
"(",
")",
":",
"root",
"=",
"Node",
"(",
"2",
")",
"root",
".",
"left",
"=",
"Node",
"(",
"7",
")",
"root",
".",
"left",
".",
"left",
"=",
"Node",
"(",
"2",
")",
"root",
".",
"left",
".",
"right",
"=",
"Node",
"(",
"6",
")",
... | https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/binary_tree/top_view.py#L37-L51 | ||
dmlc/xgboost | 2775c2a1abd4b5b759ff517617434c8b9aeb4cc0 | demo/json-model/json_parser.py | python | Tree.split_index | (self, node_id: int) | return self.nodes[node_id][self._ind] | Split feature index of node. | Split feature index of node. | [
"Split",
"feature",
"index",
"of",
"node",
"."
] | def split_index(self, node_id: int):
'''Split feature index of node.'''
return self.nodes[node_id][self._ind] | [
"def",
"split_index",
"(",
"self",
",",
"node_id",
":",
"int",
")",
":",
"return",
"self",
".",
"nodes",
"[",
"node_id",
"]",
"[",
"self",
".",
"_ind",
"]"
] | https://github.com/dmlc/xgboost/blob/2775c2a1abd4b5b759ff517617434c8b9aeb4cc0/demo/json-model/json_parser.py#L39-L41 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/tools/api/lib/python_object_to_proto_visitor.py | python | PythonObjectToProtoVisitor.GetProtos | (self) | return self._protos | Return the list of protos stored. | Return the list of protos stored. | [
"Return",
"the",
"list",
"of",
"protos",
"stored",
"."
] | def GetProtos(self):
"""Return the list of protos stored."""
return self._protos | [
"def",
"GetProtos",
"(",
"self",
")",
":",
"return",
"self",
".",
"_protos"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/tools/api/lib/python_object_to_proto_visitor.py#L213-L215 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/_masked/__init__.py | python | mean | (input: Tensor,
dim: DimOrDims = None,
*,
keepdim: Optional[bool] = False,
dtype: Optional[DType] = None,
mask: Optional[Tensor] = None) | \
{reduction_signature}
{reduction_descr}
By definition, the identity value of a mean operation is the mean
value of the tensor. If all elements of the input tensor along given
dimension(s) :attr:`dim` are masked-out, the identity value of the
mean is undefined. Due to this ambiguity, the elements of output
tensor w... | \
{reduction_signature} | [
"\\",
"{",
"reduction_signature",
"}"
] | def mean(input: Tensor,
dim: DimOrDims = None,
*,
keepdim: Optional[bool] = False,
dtype: Optional[DType] = None,
mask: Optional[Tensor] = None) -> Tensor:
"""\
{reduction_signature}
{reduction_descr}
By definition, the identity value of a mean operation is the mean
va... | [
"def",
"mean",
"(",
"input",
":",
"Tensor",
",",
"dim",
":",
"DimOrDims",
"=",
"None",
",",
"*",
",",
"keepdim",
":",
"Optional",
"[",
"bool",
"]",
"=",
"False",
",",
"dtype",
":",
"Optional",
"[",
"DType",
"]",
"=",
"None",
",",
"mask",
":",
"Op... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/_masked/__init__.py#L526-L555 | ||
deepmind/reverb | ef3c8f0be1b720a741d2dee335e15e44668c291a | reverb/pip_package/setup.py | python | SetupToolsHelper._get_required_packages | (self) | return required_packages | Returns list of required packages. | Returns list of required packages. | [
"Returns",
"list",
"of",
"required",
"packages",
"."
] | def _get_required_packages(self):
"""Returns list of required packages."""
required_packages = [
'dataclasses; python_version < "3.7.0"', # Back-port for Python 3.6.
'dm-tree',
'portpicker',
]
return required_packages | [
"def",
"_get_required_packages",
"(",
"self",
")",
":",
"required_packages",
"=",
"[",
"'dataclasses; python_version < \"3.7.0\"'",
",",
"# Back-port for Python 3.6.",
"'dm-tree'",
",",
"'portpicker'",
",",
"]",
"return",
"required_packages"
] | https://github.com/deepmind/reverb/blob/ef3c8f0be1b720a741d2dee335e15e44668c291a/reverb/pip_package/setup.py#L84-L91 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/boost_1_66_0/tools/build/src/build/targets.py | python | ProjectTarget.add_constant | (self, name, value, path=0) | Adds a new constant for this project.
The constant will be available for use in Jamfile
module for this project. If 'path' is true,
the constant will be interpreted relatively
to the location of project. | Adds a new constant for this project. | [
"Adds",
"a",
"new",
"constant",
"for",
"this",
"project",
"."
] | def add_constant(self, name, value, path=0):
"""Adds a new constant for this project.
The constant will be available for use in Jamfile
module for this project. If 'path' is true,
the constant will be interpreted relatively
to the location of project.
"""
assert ... | [
"def",
"add_constant",
"(",
"self",
",",
"name",
",",
"value",
",",
"path",
"=",
"0",
")",
":",
"assert",
"isinstance",
"(",
"name",
",",
"basestring",
")",
"assert",
"is_iterable_typed",
"(",
"value",
",",
"basestring",
")",
"assert",
"isinstance",
"(",
... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/tools/build/src/build/targets.py#L619-L646 | ||
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 | Distribution._dep_map | (self) | return self.__dep_map | A map of extra to its list of (direct) requirements
for this distribution, including the null extra. | A map of extra to its list of (direct) requirements
for this distribution, including the null extra. | [
"A",
"map",
"of",
"extra",
"to",
"its",
"list",
"of",
"(",
"direct",
")",
"requirements",
"for",
"this",
"distribution",
"including",
"the",
"null",
"extra",
"."
] | def _dep_map(self):
"""
A map of extra to its list of (direct) requirements
for this distribution, including the null extra.
"""
try:
return self.__dep_map
except AttributeError:
self.__dep_map = self._filter_extras(self._build_dep_map())
r... | [
"def",
"_dep_map",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"__dep_map",
"except",
"AttributeError",
":",
"self",
".",
"__dep_map",
"=",
"self",
".",
"_filter_extras",
"(",
"self",
".",
"_build_dep_map",
"(",
")",
")",
"return",
"self",
... | 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#L2593-L2602 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/transpiler/memory_optimization_transpiler.py | python | memory_optimize | (input_program,
skip_opt_set=None,
print_log=False,
level=0,
skip_grads=True) | :api_attr: Static Graph
This API is deprecated since 1.6. Please do not use it. The better
memory optimization strategies are enabled by default. | :api_attr: Static Graph | [
":",
"api_attr",
":",
"Static",
"Graph"
] | def memory_optimize(input_program,
skip_opt_set=None,
print_log=False,
level=0,
skip_grads=True):
"""
:api_attr: Static Graph
This API is deprecated since 1.6. Please do not use it. The better
memory optimization strategies ar... | [
"def",
"memory_optimize",
"(",
"input_program",
",",
"skip_opt_set",
"=",
"None",
",",
"print_log",
"=",
"False",
",",
"level",
"=",
"0",
",",
"skip_grads",
"=",
"True",
")",
":",
"logging",
".",
"warn",
"(",
"'Caution! paddle.fluid.memory_optimize() is deprecated... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/transpiler/memory_optimization_transpiler.py#L18-L41 | ||
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/waitress/waitress/server.py | python | BaseWSGIServer.maintenance | (self, now) | Closes channels that have not had any activity in a while.
The timeout is configured through adj.channel_timeout (seconds). | Closes channels that have not had any activity in a while. | [
"Closes",
"channels",
"that",
"have",
"not",
"had",
"any",
"activity",
"in",
"a",
"while",
"."
] | def maintenance(self, now):
"""
Closes channels that have not had any activity in a while.
The timeout is configured through adj.channel_timeout (seconds).
"""
cutoff = now - self.adj.channel_timeout
for channel in self.active_channels.values():
if (not chann... | [
"def",
"maintenance",
"(",
"self",
",",
"now",
")",
":",
"cutoff",
"=",
"now",
"-",
"self",
".",
"adj",
".",
"channel_timeout",
"for",
"channel",
"in",
"self",
".",
"active_channels",
".",
"values",
"(",
")",
":",
"if",
"(",
"not",
"channel",
".",
"r... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/waitress/waitress/server.py#L168-L177 | ||
rrwick/Unicycler | 96ffea71e3a78d63ade19d6124946773e65cf129 | unicycler/misc.py | python | spades_version_from_spades_output | (spades_output) | return '' | Parses the SPAdes version from the output of spades.py -v | Parses the SPAdes version from the output of spades.py -v | [
"Parses",
"the",
"SPAdes",
"version",
"from",
"the",
"output",
"of",
"spades",
".",
"py",
"-",
"v"
] | def spades_version_from_spades_output(spades_output):
"""
Parses the SPAdes version from the output of spades.py -v
"""
try:
return re.search(r'v(\d+\.\d+\.\d+)', spades_output).group(1)
except (AttributeError, IndexError):
pass
try:
return re.search(r'v\.(\d+\.\d+\.\d+)'... | [
"def",
"spades_version_from_spades_output",
"(",
"spades_output",
")",
":",
"try",
":",
"return",
"re",
".",
"search",
"(",
"r'v(\\d+\\.\\d+\\.\\d+)'",
",",
"spades_output",
")",
".",
"group",
"(",
"1",
")",
"except",
"(",
"AttributeError",
",",
"IndexError",
")... | https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/misc.py#L824-L840 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TextAttr.GetFontStrikethrough | (*args, **kwargs) | return _controls_.TextAttr_GetFontStrikethrough(*args, **kwargs) | GetFontStrikethrough(self) -> bool | GetFontStrikethrough(self) -> bool | [
"GetFontStrikethrough",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetFontStrikethrough(*args, **kwargs):
"""GetFontStrikethrough(self) -> bool"""
return _controls_.TextAttr_GetFontStrikethrough(*args, **kwargs) | [
"def",
"GetFontStrikethrough",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_GetFontStrikethrough",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1687-L1689 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | DataHandler.WriteImmediateServiceUnitTest | (self, func, file) | Overrriden from TypeHandler. | Overrriden from TypeHandler. | [
"Overrriden",
"from",
"TypeHandler",
"."
] | def WriteImmediateServiceUnitTest(self, func, file):
"""Overrriden from TypeHandler."""
file.Write("// TODO(gman): %s\n\n" % func.name) | [
"def",
"WriteImmediateServiceUnitTest",
"(",
"self",
",",
"func",
",",
"file",
")",
":",
"file",
".",
"Write",
"(",
"\"// TODO(gman): %s\\n\\n\"",
"%",
"func",
".",
"name",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L3726-L3728 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | commonTools/framework/clean_workspace/util.py | python | _find_files | (file_name, dir_list=None) | A generator to find and return all all instances of
file_name in the passed dir_list. | A generator to find and return all all instances of
file_name in the passed dir_list. | [
"A",
"generator",
"to",
"find",
"and",
"return",
"all",
"all",
"instances",
"of",
"file_name",
"in",
"the",
"passed",
"dir_list",
"."
] | def _find_files(file_name, dir_list=None):
"""
A generator to find and return all all instances of
file_name in the passed dir_list.
"""
# import pyfind
if not dir_list:
dir_list = os.getcwd()
if not isinstance(dir_list, list):
dir_list = [dir_list]
if file_name:
... | [
"def",
"_find_files",
"(",
"file_name",
",",
"dir_list",
"=",
"None",
")",
":",
"# import pyfind",
"if",
"not",
"dir_list",
":",
"dir_list",
"=",
"os",
".",
"getcwd",
"(",
")",
"if",
"not",
"isinstance",
"(",
"dir_list",
",",
"list",
")",
":",
"dir_list"... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/commonTools/framework/clean_workspace/util.py#L27-L42 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/third_party/pyserial/serial/tools/list_ports_osx.py | python | get_string_property | (device_t, property) | return output | Search the given device for the specified string property
@param device_t Device to search
@param property String to search for.
@return Python string containing the value, or None if not found. | Search the given device for the specified string property | [
"Search",
"the",
"given",
"device",
"for",
"the",
"specified",
"string",
"property"
] | def get_string_property(device_t, property):
""" Search the given device for the specified string property
@param device_t Device to search
@param property String to search for.
@return Python string containing the value, or None if not found.
"""
key = cf.CFStringCreateWithCString(
kCF... | [
"def",
"get_string_property",
"(",
"device_t",
",",
"property",
")",
":",
"key",
"=",
"cf",
".",
"CFStringCreateWithCString",
"(",
"kCFAllocatorDefault",
",",
"property",
".",
"encode",
"(",
"\"mac_roman\"",
")",
",",
"kCFStringEncodingMacRoman",
")",
"CFContainer",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/pyserial/serial/tools/list_ports_osx.py#L67-L92 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/abc.py | python | MetaPathFinder.find_module | (self, fullname, path) | return found.loader if found is not None else None | Return a loader for the module.
If no module is found, return None. The fullname is a str and
the path is a list of strings or None.
This method is deprecated since Python 3.4 in favor of
finder.find_spec(). If find_spec() exists then backwards-compatible
functionality is prov... | Return a loader for the module. | [
"Return",
"a",
"loader",
"for",
"the",
"module",
"."
] | def find_module(self, fullname, path):
"""Return a loader for the module.
If no module is found, return None. The fullname is a str and
the path is a list of strings or None.
This method is deprecated since Python 3.4 in favor of
finder.find_spec(). If find_spec() exists then ... | [
"def",
"find_module",
"(",
"self",
",",
"fullname",
",",
"path",
")",
":",
"warnings",
".",
"warn",
"(",
"\"MetaPathFinder.find_module() is deprecated since Python \"",
"\"3.4 in favor of MetaPathFinder.find_spec() \"",
"\"(available since 3.4)\"",
",",
"DeprecationWarning",
",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/abc.py#L57-L76 | |
omnisci/omniscidb | b9c95f1bd602b4ffc8b0edf18bfad61031e08d86 | python/omnisci/thrift/OmniSci.py | python | Client.start_render_query | (self, session, widget_id, node_idx, vega_json) | return self.recv_start_render_query() | Parameters:
- session
- widget_id
- node_idx
- vega_json | Parameters:
- session
- widget_id
- node_idx
- vega_json | [
"Parameters",
":",
"-",
"session",
"-",
"widget_id",
"-",
"node_idx",
"-",
"vega_json"
] | def start_render_query(self, session, widget_id, node_idx, vega_json):
"""
Parameters:
- session
- widget_id
- node_idx
- vega_json
"""
self.send_start_render_query(session, widget_id, node_idx, vega_json)
return self.recv_start_render_query() | [
"def",
"start_render_query",
"(",
"self",
",",
"session",
",",
"widget_id",
",",
"node_idx",
",",
"vega_json",
")",
":",
"self",
".",
"send_start_render_query",
"(",
"session",
",",
"widget_id",
",",
"node_idx",
",",
"vega_json",
")",
"return",
"self",
".",
... | https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/python/omnisci/thrift/OmniSci.py#L3891-L3901 | |
plumonito/dtslam | 5994bb9cf7a11981b830370db206bceb654c085d | 3rdparty/opencv-git/3rdparty/jinja2/filters.py | python | do_forceescape | (value) | return escape(text_type(value)) | Enforce HTML escaping. This will probably double escape variables. | Enforce HTML escaping. This will probably double escape variables. | [
"Enforce",
"HTML",
"escaping",
".",
"This",
"will",
"probably",
"double",
"escape",
"variables",
"."
] | def do_forceescape(value):
"""Enforce HTML escaping. This will probably double escape variables."""
if hasattr(value, '__html__'):
value = value.__html__()
return escape(text_type(value)) | [
"def",
"do_forceescape",
"(",
"value",
")",
":",
"if",
"hasattr",
"(",
"value",
",",
"'__html__'",
")",
":",
"value",
"=",
"value",
".",
"__html__",
"(",
")",
"return",
"escape",
"(",
"text_type",
"(",
"value",
")",
")"
] | https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/filters.py#L73-L77 | |
rpp0/gr-lora | 90343d45a3c73c84d32d74b8603b6c01de025b08 | docs/doxygen/update_pydoc.py | python | argParse | () | return parser.parse_args() | Parses commandline args. | Parses commandline args. | [
"Parses",
"commandline",
"args",
"."
] | def argParse():
"""Parses commandline args."""
desc='Scrape the doxygen generated xml for docstrings to insert into python bindings'
parser = ArgumentParser(description=desc)
parser.add_argument("function", help="Operation to perform on docstrings", choices=["scrape","sub","copy"])
parser.add_argu... | [
"def",
"argParse",
"(",
")",
":",
"desc",
"=",
"'Scrape the doxygen generated xml for docstrings to insert into python bindings'",
"parser",
"=",
"ArgumentParser",
"(",
"description",
"=",
"desc",
")",
"parser",
".",
"add_argument",
"(",
"\"function\"",
",",
"help",
"="... | https://github.com/rpp0/gr-lora/blob/90343d45a3c73c84d32d74b8603b6c01de025b08/docs/doxygen/update_pydoc.py#L310-L323 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | lldb/third_party/Python/module/pexpect-4.6/pexpect/expect.py | python | searcher_string.__init__ | (self, strings) | This creates an instance of searcher_string. This argument 'strings'
may be a list; a sequence of strings; or the EOF or TIMEOUT types. | This creates an instance of searcher_string. This argument 'strings'
may be a list; a sequence of strings; or the EOF or TIMEOUT types. | [
"This",
"creates",
"an",
"instance",
"of",
"searcher_string",
".",
"This",
"argument",
"strings",
"may",
"be",
"a",
"list",
";",
"a",
"sequence",
"of",
"strings",
";",
"or",
"the",
"EOF",
"or",
"TIMEOUT",
"types",
"."
] | def __init__(self, strings):
'''This creates an instance of searcher_string. This argument 'strings'
may be a list; a sequence of strings; or the EOF or TIMEOUT types. '''
self.eof_index = -1
self.timeout_index = -1
self._strings = []
for n, s in enumerate(strings):
... | [
"def",
"__init__",
"(",
"self",
",",
"strings",
")",
":",
"self",
".",
"eof_index",
"=",
"-",
"1",
"self",
".",
"timeout_index",
"=",
"-",
"1",
"self",
".",
"_strings",
"=",
"[",
"]",
"for",
"n",
",",
"s",
"in",
"enumerate",
"(",
"strings",
")",
... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/pexpect-4.6/pexpect/expect.py#L144-L158 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/rnn/python/ops/rnn_cell.py | python | _get_sharded_variable | (name, shape, dtype, num_shards) | return shards | Get a list of sharded variables with the given dtype. | Get a list of sharded variables with the given dtype. | [
"Get",
"a",
"list",
"of",
"sharded",
"variables",
"with",
"the",
"given",
"dtype",
"."
] | def _get_sharded_variable(name, shape, dtype, num_shards):
"""Get a list of sharded variables with the given dtype."""
if num_shards > shape[0]:
raise ValueError("Too many shards: shape=%s, num_shards=%d" %
(shape, num_shards))
unit_shard_size = int(math.floor(shape[0] / num_shards))
re... | [
"def",
"_get_sharded_variable",
"(",
"name",
",",
"shape",
",",
"dtype",
",",
"num_shards",
")",
":",
"if",
"num_shards",
">",
"shape",
"[",
"0",
"]",
":",
"raise",
"ValueError",
"(",
"\"Too many shards: shape=%s, num_shards=%d\"",
"%",
"(",
"shape",
",",
"num... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L51-L66 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathSurfaceSupport.py | python | pathGeomToSpiralPointSet | (obj, compGeoShp) | return LINES | _pathGeomToSpiralPointSet(obj, compGeoShp)...
Convert a compound set of sequential line segments to directional, connected groupings. | _pathGeomToSpiralPointSet(obj, compGeoShp)...
Convert a compound set of sequential line segments to directional, connected groupings. | [
"_pathGeomToSpiralPointSet",
"(",
"obj",
"compGeoShp",
")",
"...",
"Convert",
"a",
"compound",
"set",
"of",
"sequential",
"line",
"segments",
"to",
"directional",
"connected",
"groupings",
"."
] | def pathGeomToSpiralPointSet(obj, compGeoShp):
"""_pathGeomToSpiralPointSet(obj, compGeoShp)...
Convert a compound set of sequential line segments to directional, connected groupings."""
PathLog.debug("_pathGeomToSpiralPointSet()")
# Extract intersection line segments for return value as []
LINES = ... | [
"def",
"pathGeomToSpiralPointSet",
"(",
"obj",
",",
"compGeoShp",
")",
":",
"PathLog",
".",
"debug",
"(",
"\"_pathGeomToSpiralPointSet()\"",
")",
"# Extract intersection line segments for return value as []",
"LINES",
"=",
"[",
"]",
"inLine",
"=",
"[",
"]",
"lnCnt",
"... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathSurfaceSupport.py#L1803-L1853 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/MooseDocs/base/executioners.py | python | Executioner.getGlobalAttribute | (self, key, default=None) | return self._global_attributes.get(key, default) | Get a global attribute that was communicated across processors. | Get a global attribute that was communicated across processors. | [
"Get",
"a",
"global",
"attribute",
"that",
"was",
"communicated",
"across",
"processors",
"."
] | def getGlobalAttribute(self, key, default=None):
"""Get a global attribute that was communicated across processors."""
return self._global_attributes.get(key, default) | [
"def",
"getGlobalAttribute",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"return",
"self",
".",
"_global_attributes",
".",
"get",
"(",
"key",
",",
"default",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/base/executioners.py#L237-L239 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py | python | Mailbox.pop | (self, key, default=None) | return result | Delete the keyed message and return it, or default. | Delete the keyed message and return it, or default. | [
"Delete",
"the",
"keyed",
"message",
"and",
"return",
"it",
"or",
"default",
"."
] | def pop(self, key, default=None):
"""Delete the keyed message and return it, or default."""
try:
result = self[key]
except KeyError:
return default
self.discard(key)
return result | [
"def",
"pop",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"try",
":",
"result",
"=",
"self",
"[",
"key",
"]",
"except",
"KeyError",
":",
"return",
"default",
"self",
".",
"discard",
"(",
"key",
")",
"return",
"result"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py#L147-L154 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | 3rdparty/protobuf-3.0.0/python/google/protobuf/descriptor_pool.py | python | DescriptorPool._GetTypeFromScope | (self, package, type_name, scope) | return scope[type_name] | Finds a given type name in the current scope.
Args:
package: The package the proto should be located in.
type_name: The name of the type to be found in the scope.
scope: Dict mapping short and full symbols to message and enum types.
Returns:
The descriptor for the requested type. | Finds a given type name in the current scope. | [
"Finds",
"a",
"given",
"type",
"name",
"in",
"the",
"current",
"scope",
"."
] | def _GetTypeFromScope(self, package, type_name, scope):
"""Finds a given type name in the current scope.
Args:
package: The package the proto should be located in.
type_name: The name of the type to be found in the scope.
scope: Dict mapping short and full symbols to message and enum types.
... | [
"def",
"_GetTypeFromScope",
"(",
"self",
",",
"package",
",",
"type_name",
",",
"scope",
")",
":",
"if",
"type_name",
"not",
"in",
"scope",
":",
"components",
"=",
"_PrefixWithDot",
"(",
"package",
")",
".",
"split",
"(",
"'.'",
")",
"while",
"components",... | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/descriptor_pool.py#L777-L797 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py | python | FlockTool._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/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py#L31-L33 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/util.py | python | Substituter.SubstituteMessage | (self, msg) | Apply substitutions to a tclib.Message object.
Text of the form [message_name] will be replaced by a new placeholder,
whose presentation will take the form the message_name_{UsageCount}, and
whose example will be the message's value. Existing placeholders are
not affected.
Args:
msg: A tclib... | Apply substitutions to a tclib.Message object. | [
"Apply",
"substitutions",
"to",
"a",
"tclib",
".",
"Message",
"object",
"."
] | def SubstituteMessage(self, msg):
'''Apply substitutions to a tclib.Message object.
Text of the form [message_name] will be replaced by a new placeholder,
whose presentation will take the form the message_name_{UsageCount}, and
whose example will be the message's value. Existing placeholders are
no... | [
"def",
"SubstituteMessage",
"(",
"self",
",",
"msg",
")",
":",
"from",
"grit",
"import",
"tclib",
"# avoid circular import",
"counts",
"=",
"{",
"}",
"text",
"=",
"msg",
".",
"GetPresentableContent",
"(",
")",
"placeholders",
"=",
"[",
"]",
"newtext",
"=",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/util.py#L586-L620 | ||
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/esptool/serial/urlhandler/protocol_socket.py | python | Serial._update_break_state | (self) | Set break: Controls TXD. When active, to transmitting is
possible. | Set break: Controls TXD. When active, to transmitting is
possible. | [
"Set",
"break",
":",
"Controls",
"TXD",
".",
"When",
"active",
"to",
"transmitting",
"is",
"possible",
"."
] | def _update_break_state(self):
"""Set break: Controls TXD. When active, to transmitting is
possible."""
if self.logger:
self.logger.info('ignored _update_break_state({!r})'.format(self._break_state)) | [
"def",
"_update_break_state",
"(",
"self",
")",
":",
"if",
"self",
".",
"logger",
":",
"self",
".",
"logger",
".",
"info",
"(",
"'ignored _update_break_state({!r})'",
".",
"format",
"(",
"self",
".",
"_break_state",
")",
")"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/serial/urlhandler/protocol_socket.py#L284-L288 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/plugins/mapmatching/mapmatching.py | python | GtfsServiceGenerator.correct_route | (self, ids_stop, ids_edge, net, fstar, distances) | return ids_edge | Can happen that edge of first and last stop is not part of the route
due to unprecise mapmatching. Here this problem is fixed. | Can happen that edge of first and last stop is not part of the route
due to unprecise mapmatching. Here this problem is fixed. | [
"Can",
"happen",
"that",
"edge",
"of",
"first",
"and",
"last",
"stop",
"is",
"not",
"part",
"of",
"the",
"route",
"due",
"to",
"unprecise",
"mapmatching",
".",
"Here",
"this",
"problem",
"is",
"fixed",
"."
] | def correct_route(self, ids_stop, ids_edge, net, fstar, distances):
"""
Can happen that edge of first and last stop is not part of the route
due to unprecise mapmatching. Here this problem is fixed.
"""
#print 'correct_route ids_stop'#,ids_stop
ids_edge_stop = net.lanes.i... | [
"def",
"correct_route",
"(",
"self",
",",
"ids_stop",
",",
"ids_edge",
",",
"net",
",",
"fstar",
",",
"distances",
")",
":",
"#print 'correct_route ids_stop'#,ids_stop",
"ids_edge_stop",
"=",
"net",
".",
"lanes",
".",
"ids_edge",
"[",
"net",
".",
"ptstops",
".... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/plugins/mapmatching/mapmatching.py#L8135-L8171 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | ListCtrl.InsertImageStringItem | (*args, **kwargs) | return _controls_.ListCtrl_InsertImageStringItem(*args, **kwargs) | InsertImageStringItem(self, long index, String label, int imageIndex) -> long | InsertImageStringItem(self, long index, String label, int imageIndex) -> long | [
"InsertImageStringItem",
"(",
"self",
"long",
"index",
"String",
"label",
"int",
"imageIndex",
")",
"-",
">",
"long"
] | def InsertImageStringItem(*args, **kwargs):
"""InsertImageStringItem(self, long index, String label, int imageIndex) -> long"""
return _controls_.ListCtrl_InsertImageStringItem(*args, **kwargs) | [
"def",
"InsertImageStringItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListCtrl_InsertImageStringItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L4712-L4714 | |
lattice/quda | 7d04db018e01718e80cf32d78f44e8cdffdbe46e | lib/generate/wrap.py | python | Param.isStatus | (self) | return self.type == "MPI_Status" | True if this Param is an MPI_Status. MPI_Status is handled differently
in c2f/f2c calls from the other handle types. | True if this Param is an MPI_Status. MPI_Status is handled differently
in c2f/f2c calls from the other handle types. | [
"True",
"if",
"this",
"Param",
"is",
"an",
"MPI_Status",
".",
"MPI_Status",
"is",
"handled",
"differently",
"in",
"c2f",
"/",
"f2c",
"calls",
"from",
"the",
"other",
"handle",
"types",
"."
] | def isStatus(self):
"""True if this Param is an MPI_Status. MPI_Status is handled differently
in c2f/f2c calls from the other handle types.
"""
return self.type == "MPI_Status" | [
"def",
"isStatus",
"(",
"self",
")",
":",
"return",
"self",
".",
"type",
"==",
"\"MPI_Status\""
] | https://github.com/lattice/quda/blob/7d04db018e01718e80cf32d78f44e8cdffdbe46e/lib/generate/wrap.py#L355-L359 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/boost_1_66_0/tools/build/src/util/__init__.py | python | abbreviate_dashed | (s) | return '-'.join(r) | Abbreviates each part of string that is delimited by a '-'. | Abbreviates each part of string that is delimited by a '-'. | [
"Abbreviates",
"each",
"part",
"of",
"string",
"that",
"is",
"delimited",
"by",
"a",
"-",
"."
] | def abbreviate_dashed(s):
"""Abbreviates each part of string that is delimited by a '-'."""
r = []
for part in s.split('-'):
r.append(abbreviate(part))
return '-'.join(r) | [
"def",
"abbreviate_dashed",
"(",
"s",
")",
":",
"r",
"=",
"[",
"]",
"for",
"part",
"in",
"s",
".",
"split",
"(",
"'-'",
")",
":",
"r",
".",
"append",
"(",
"abbreviate",
"(",
"part",
")",
")",
"return",
"'-'",
".",
"join",
"(",
"r",
")"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/tools/build/src/util/__init__.py#L281-L286 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/sampleGenerator.py | python | SampleGenerator.qoiFromRaw | (self, rawSolutions) | return rawSolutions | Function that generates additionally `QoI` from given QoI. For example,
if one wished to study the statisics of the product or sum or difference
of two or more QoI | Function that generates additionally `QoI` from given QoI. For example,
if one wished to study the statisics of the product or sum or difference
of two or more QoI | [
"Function",
"that",
"generates",
"additionally",
"QoI",
"from",
"given",
"QoI",
".",
"For",
"example",
"if",
"one",
"wished",
"to",
"study",
"the",
"statisics",
"of",
"the",
"product",
"or",
"sum",
"or",
"difference",
"of",
"two",
"or",
"more",
"QoI"
] | def qoiFromRaw(self, rawSolutions):
"""
Function that generates additionally `QoI` from given QoI. For example,
if one wished to study the statisics of the product or sum or difference
of two or more QoI
"""
return rawSolutions | [
"def",
"qoiFromRaw",
"(",
"self",
",",
"rawSolutions",
")",
":",
"return",
"rawSolutions"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/sampleGenerator.py#L32-L39 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/groupby/ops.py | python | BaseGrouper.size | (self) | return Series(out, index=self.result_index, dtype="int64") | Compute group sizes. | Compute group sizes. | [
"Compute",
"group",
"sizes",
"."
] | def size(self) -> Series:
"""
Compute group sizes.
"""
ids, _, ngroup = self.group_info
ids = ensure_platform_int(ids)
if ngroup:
out = np.bincount(ids[ids != -1], minlength=ngroup)
else:
out = []
return Series(out, index=self.resul... | [
"def",
"size",
"(",
"self",
")",
"->",
"Series",
":",
"ids",
",",
"_",
",",
"ngroup",
"=",
"self",
".",
"group_info",
"ids",
"=",
"ensure_platform_int",
"(",
"ids",
")",
"if",
"ngroup",
":",
"out",
"=",
"np",
".",
"bincount",
"(",
"ids",
"[",
"ids"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/groupby/ops.py#L235-L245 | |
google/tink | 59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14 | python/setup.py | python | _get_tink_version | () | Parses the version number from VERSION file. | Parses the version number from VERSION file. | [
"Parses",
"the",
"version",
"number",
"from",
"VERSION",
"file",
"."
] | def _get_tink_version():
"""Parses the version number from VERSION file."""
with open(os.path.join(_PROJECT_BASE_DIR, 'VERSION')) as f:
try:
version_line = next(
line for line in f if line.startswith('TINK_VERSION_LABEL'))
except StopIteration:
raise ValueError(
'Version not ... | [
"def",
"_get_tink_version",
"(",
")",
":",
"with",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"_PROJECT_BASE_DIR",
",",
"'VERSION'",
")",
")",
"as",
"f",
":",
"try",
":",
"version_line",
"=",
"next",
"(",
"line",
"for",
"line",
"in",
"f",
"if"... | https://github.com/google/tink/blob/59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14/python/setup.py#L36-L46 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | utils/lui/lldbutil.py | python | get_pc_addresses | (thread) | return [GetPCAddress(i) for i in range(thread.GetNumFrames())] | Returns a sequence of pc addresses for this thread. | Returns a sequence of pc addresses for this thread. | [
"Returns",
"a",
"sequence",
"of",
"pc",
"addresses",
"for",
"this",
"thread",
"."
] | def get_pc_addresses(thread):
"""
Returns a sequence of pc addresses for this thread.
"""
def GetPCAddress(i):
return thread.GetFrameAtIndex(i).GetPCAddress()
return [GetPCAddress(i) for i in range(thread.GetNumFrames())] | [
"def",
"get_pc_addresses",
"(",
"thread",
")",
":",
"def",
"GetPCAddress",
"(",
"i",
")",
":",
"return",
"thread",
".",
"GetFrameAtIndex",
"(",
"i",
")",
".",
"GetPCAddress",
"(",
")",
"return",
"[",
"GetPCAddress",
"(",
"i",
")",
"for",
"i",
"in",
"ra... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/utils/lui/lldbutil.py#L724-L731 | |
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/__init__.py | python | BaseNode.__init__ | (self, name) | Create a node with the given name. | Create a node with the given name. | [
"Create",
"a",
"node",
"with",
"the",
"given",
"name",
"."
] | def __init__(self, name):
"""Create a node with the given name."""
self.__name = name = name.canonize()
for n in _DEBUG_NODE_CREATION:
if self.__name == n:
import traceback
print('{} was instantiated at (most recent call last):'.format(self))
traceback.print_stack()
if next... | [
"def",
"__init__",
"(",
"self",
",",
"name",
")",
":",
"self",
".",
"__name",
"=",
"name",
"=",
"name",
".",
"canonize",
"(",
")",
"for",
"n",
"in",
"_DEBUG_NODE_CREATION",
":",
"if",
"self",
".",
"__name",
"==",
"n",
":",
"import",
"traceback",
"pri... | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L1372-L1391 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/layers/nn.py | python | reduce_all | (input, dim=None, keep_dim=False, name=None) | return out | This OP computes the ``logical and`` of tensor elements over the given dimension, and output the result.
Args:
input (Tensor): the input tensor, it's data type should be `bool`.
dim (list|int|optional): The dimension along which the logical and is computed.
If :attr:`None`, compute the ... | [] | def reduce_all(input, dim=None, keep_dim=False, name=None):
"""
This OP computes the ``logical and`` of tensor elements over the given dimension, and output the result.
Args:
input (Tensor): the input tensor, it's data type should be `bool`.
dim (list|int|optional): The dimension along whi... | [
"def",
"reduce_all",
"(",
"input",
",",
"dim",
"=",
"None",
",",
"keep_dim",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"check_variable_and_dtype",
"(",
"input",
",",
"'input'",
",",
"(",
"'bool'",
")",
",",
"'reduce_all'",
")",
"helper",
"=",
"... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/nn.py#L4819-L4878 | ||
microsoft/EdgeML | ef9f8a77f096acbdeb941014791f8eda1c1bc35b | tf/edgeml_tf/graph/rnn.py | python | EMI_GRU.getModelParams | (self) | return self.varList | Returns the GRU kernel and bias tensors.
returns [kernel1, bias1, kernel2, bias2] | Returns the GRU kernel and bias tensors.
returns [kernel1, bias1, kernel2, bias2] | [
"Returns",
"the",
"GRU",
"kernel",
"and",
"bias",
"tensors",
".",
"returns",
"[",
"kernel1",
"bias1",
"kernel2",
"bias2",
"]"
] | def getModelParams(self):
'''
Returns the GRU kernel and bias tensors.
returns [kernel1, bias1, kernel2, bias2]
'''
assert self.graphCreated is True, "Graph is not created"
assert len(self.varList) == 4
return self.varList | [
"def",
"getModelParams",
"(",
"self",
")",
":",
"assert",
"self",
".",
"graphCreated",
"is",
"True",
",",
"\"Graph is not created\"",
"assert",
"len",
"(",
"self",
".",
"varList",
")",
"==",
"4",
"return",
"self",
".",
"varList"
] | https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/tf/edgeml_tf/graph/rnn.py#L1554-L1561 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/Blast/3rdParty/assimp/port/PyAssimp/pyassimp/helper.py | python | try_load_functions | (library_path, dll) | return (library_path, load, load_mem, export, export2blob, release, dll) | Try to bind to aiImportFile and aiReleaseImport
Arguments
---------
library_path: path to current lib
dll: ctypes handle to library
Returns
---------
If unsuccessful:
None
If successful:
Tuple containing (library_path,
load from filena... | Try to bind to aiImportFile and aiReleaseImport | [
"Try",
"to",
"bind",
"to",
"aiImportFile",
"and",
"aiReleaseImport"
] | def try_load_functions(library_path, dll):
'''
Try to bind to aiImportFile and aiReleaseImport
Arguments
---------
library_path: path to current lib
dll: ctypes handle to library
Returns
---------
If unsuccessful:
None
If successful:
Tuple containing (l... | [
"def",
"try_load_functions",
"(",
"library_path",
",",
"dll",
")",
":",
"try",
":",
"load",
"=",
"dll",
".",
"aiImportFile",
"release",
"=",
"dll",
".",
"aiReleaseImport",
"load_mem",
"=",
"dll",
".",
"aiImportFileFromMemory",
"export",
"=",
"dll",
".",
"aiE... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/Blast/3rdParty/assimp/port/PyAssimp/pyassimp/helper.py#L160-L198 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | tools/caffe_converter/caffe_parser.py | python | get_layers | (proto) | Returns layers in a caffe_pb2.NetParameter object | Returns layers in a caffe_pb2.NetParameter object | [
"Returns",
"layers",
"in",
"a",
"caffe_pb2",
".",
"NetParameter",
"object"
] | def get_layers(proto):
"""Returns layers in a caffe_pb2.NetParameter object
"""
if len(proto.layer):
return proto.layer
elif len(proto.layers):
return proto.layers
else:
raise ValueError('Invalid proto file.') | [
"def",
"get_layers",
"(",
"proto",
")",
":",
"if",
"len",
"(",
"proto",
".",
"layer",
")",
":",
"return",
"proto",
".",
"layer",
"elif",
"len",
"(",
"proto",
".",
"layers",
")",
":",
"return",
"proto",
".",
"layers",
"else",
":",
"raise",
"ValueError... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/tools/caffe_converter/caffe_parser.py#L42-L50 | ||
GeometryCollective/boundary-first-flattening | 8250e5a0e85980ec50b5e8aa8f49dd6519f915cd | deps/nanogui/ext/pybind11/tools/clang/cindex.py | python | Index.create | (excludeDecls=False) | return Index(conf.lib.clang_createIndex(excludeDecls, 0)) | Create a new Index.
Parameters:
excludeDecls -- Exclude local declarations from translation units. | Create a new Index.
Parameters:
excludeDecls -- Exclude local declarations from translation units. | [
"Create",
"a",
"new",
"Index",
".",
"Parameters",
":",
"excludeDecls",
"--",
"Exclude",
"local",
"declarations",
"from",
"translation",
"units",
"."
] | def create(excludeDecls=False):
"""
Create a new Index.
Parameters:
excludeDecls -- Exclude local declarations from translation units.
"""
return Index(conf.lib.clang_createIndex(excludeDecls, 0)) | [
"def",
"create",
"(",
"excludeDecls",
"=",
"False",
")",
":",
"return",
"Index",
"(",
"conf",
".",
"lib",
".",
"clang_createIndex",
"(",
"excludeDecls",
",",
"0",
")",
")"
] | https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/ext/pybind11/tools/clang/cindex.py#L2265-L2271 | |
raspberrypi/tools | 13474ee775d0c5ec8a7da4fb0a9fa84187abfc87 | arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/share/gdb/python/gdb/command/explore.py | python | ArrayExplorer.explore_expr | (expr, value, is_child) | return True | Function to explore array values.
See Explorer.explore_expr for more information. | Function to explore array values.
See Explorer.explore_expr for more information. | [
"Function",
"to",
"explore",
"array",
"values",
".",
"See",
"Explorer",
".",
"explore_expr",
"for",
"more",
"information",
"."
] | def explore_expr(expr, value, is_child):
"""Function to explore array values.
See Explorer.explore_expr for more information.
"""
target_type = value.type.target()
print ("'%s' is an array of '%s'." % (expr, str(target_type)))
index = 0
try:
index = in... | [
"def",
"explore_expr",
"(",
"expr",
",",
"value",
",",
"is_child",
")",
":",
"target_type",
"=",
"value",
".",
"type",
".",
"target",
"(",
")",
"print",
"(",
"\"'%s' is an array of '%s'.\"",
"%",
"(",
"expr",
",",
"str",
"(",
"target_type",
")",
")",
")"... | https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/share/gdb/python/gdb/command/explore.py#L326-L352 | |
Smorodov/Multitarget-tracker | bee300e8bfd660c86cbeb6892c65a5b7195c9381 | thirdparty/pybind11/tools/clang/cindex.py | python | Cursor.get_arguments | (self) | Return an iterator for accessing the arguments of this cursor. | Return an iterator for accessing the arguments of this cursor. | [
"Return",
"an",
"iterator",
"for",
"accessing",
"the",
"arguments",
"of",
"this",
"cursor",
"."
] | def get_arguments(self):
"""Return an iterator for accessing the arguments of this cursor."""
num_args = conf.lib.clang_Cursor_getNumArguments(self)
for i in range(0, num_args):
yield conf.lib.clang_Cursor_getArgument(self, i) | [
"def",
"get_arguments",
"(",
"self",
")",
":",
"num_args",
"=",
"conf",
".",
"lib",
".",
"clang_Cursor_getNumArguments",
"(",
"self",
")",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"num_args",
")",
":",
"yield",
"conf",
".",
"lib",
".",
"clang_Cursor_get... | https://github.com/Smorodov/Multitarget-tracker/blob/bee300e8bfd660c86cbeb6892c65a5b7195c9381/thirdparty/pybind11/tools/clang/cindex.py#L1616-L1620 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchComponent.py | python | Component.setProperties | (self, obj) | Give the component its component specific properties, such as material.
You can learn more about properties here:
https://wiki.freecadweb.org/property | Give the component its component specific properties, such as material. | [
"Give",
"the",
"component",
"its",
"component",
"specific",
"properties",
"such",
"as",
"material",
"."
] | def setProperties(self, obj):
"""Give the component its component specific properties, such as material.
You can learn more about properties here:
https://wiki.freecadweb.org/property
"""
ArchIFC.IfcProduct.setProperties(self, obj)
pl = obj.PropertiesList
if no... | [
"def",
"setProperties",
"(",
"self",
",",
"obj",
")",
":",
"ArchIFC",
".",
"IfcProduct",
".",
"setProperties",
"(",
"self",
",",
"obj",
")",
"pl",
"=",
"obj",
".",
"PropertiesList",
"if",
"not",
"\"Base\"",
"in",
"pl",
":",
"obj",
".",
"addProperty",
"... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchComponent.py#L181-L233 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | NewSystemColourProperty | (*args, **kwargs) | return _propgrid.NewSystemColourProperty(*args, **kwargs) | NewSystemColourProperty(String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
ColourPropertyValue value=wxColourPropertyValue()) -> PGProperty | NewSystemColourProperty(String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
ColourPropertyValue value=wxColourPropertyValue()) -> PGProperty | [
"NewSystemColourProperty",
"(",
"String",
"label",
"=",
"(",
"*",
"wxPGProperty",
"::",
"sm_wxPG_LABEL",
")",
"String",
"name",
"=",
"(",
"*",
"wxPGProperty",
"::",
"sm_wxPG_LABEL",
")",
"ColourPropertyValue",
"value",
"=",
"wxColourPropertyValue",
"()",
")",
"-",... | def NewSystemColourProperty(*args, **kwargs):
"""
NewSystemColourProperty(String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
ColourPropertyValue value=wxColourPropertyValue()) -> PGProperty
"""
return _propgrid.NewSystemColourProperty(*args, **kwargs) | [
"def",
"NewSystemColourProperty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"NewSystemColourProperty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L3754-L3759 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-thci/OpenThread.py | python | OpenThreadTHCI.scanJoiner | (self, xEUI='*', strPSKd='THREADJPAKETEST') | scan Joiner
Args:
xEUI: Joiner's EUI-64
strPSKd: Joiner's PSKd for commissioning
Returns:
True: successful to add Joiner's steering data
False: fail to add Joiner's steering data | scan Joiner | [
"scan",
"Joiner"
] | def scanJoiner(self, xEUI='*', strPSKd='THREADJPAKETEST'):
"""scan Joiner
Args:
xEUI: Joiner's EUI-64
strPSKd: Joiner's PSKd for commissioning
Returns:
True: successful to add Joiner's steering data
False: fail to add Joiner's steering data
... | [
"def",
"scanJoiner",
"(",
"self",
",",
"xEUI",
"=",
"'*'",
",",
"strPSKd",
"=",
"'THREADJPAKETEST'",
")",
":",
"self",
".",
"log",
"(",
"\"scanJoiner on channel %s\"",
",",
"self",
".",
"getChannel",
"(",
")",
")",
"# long timeout value to avoid automatic joiner r... | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread.py#L2297-L2332 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/third_party/jinja2/compiler.py | python | CodeGenerator.write | (self, x) | Write a string into the output stream. | Write a string into the output stream. | [
"Write",
"a",
"string",
"into",
"the",
"output",
"stream",
"."
] | def write(self, x):
"""Write a string into the output stream."""
if self._new_lines:
if not self._first_write:
self.stream.write('\n' * self._new_lines)
self.code_lineno += self._new_lines
if self._write_debug_info is not None:
... | [
"def",
"write",
"(",
"self",
",",
"x",
")",
":",
"if",
"self",
".",
"_new_lines",
":",
"if",
"not",
"self",
".",
"_first_write",
":",
"self",
".",
"stream",
".",
"write",
"(",
"'\\n'",
"*",
"self",
".",
"_new_lines",
")",
"self",
".",
"code_lineno",
... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/third_party/jinja2/compiler.py#L496-L509 | ||
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/util/vtkAlgorithm.py | python | VTKPythonAlgorithmBase.GetInputData | (self, inInfo, i, j) | return inInfo[i].GetInformationObject(j).Get(vtkDataObject.DATA_OBJECT()) | Convenience method that returns an input data object
given a vector of information objects and two indices. | Convenience method that returns an input data object
given a vector of information objects and two indices. | [
"Convenience",
"method",
"that",
"returns",
"an",
"input",
"data",
"object",
"given",
"a",
"vector",
"of",
"information",
"objects",
"and",
"two",
"indices",
"."
] | def GetInputData(self, inInfo, i, j):
"""Convenience method that returns an input data object
given a vector of information objects and two indices."""
return inInfo[i].GetInformationObject(j).Get(vtkDataObject.DATA_OBJECT()) | [
"def",
"GetInputData",
"(",
"self",
",",
"inInfo",
",",
"i",
",",
"j",
")",
":",
"return",
"inInfo",
"[",
"i",
"]",
".",
"GetInformationObject",
"(",
"j",
")",
".",
"Get",
"(",
"vtkDataObject",
".",
"DATA_OBJECT",
"(",
")",
")"
] | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/util/vtkAlgorithm.py#L168-L172 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rospy/src/rospy/client.py | python | delete_param | (param_name) | Delete a parameter on the param server
NOTE: this method is thread-safe.
@param param_name: parameter name
@type param_name: str
@raise KeyError: if parameter is not set
@raise ROSException: if parameter server reports an error | Delete a parameter on the param server | [
"Delete",
"a",
"parameter",
"on",
"the",
"param",
"server"
] | def delete_param(param_name):
"""
Delete a parameter on the param server
NOTE: this method is thread-safe.
@param param_name: parameter name
@type param_name: str
@raise KeyError: if parameter is not set
@raise ROSException: if parameter server reports an error
"""
_in... | [
"def",
"delete_param",
"(",
"param_name",
")",
":",
"_init_param_server",
"(",
")",
"del",
"_param_server",
"[",
"param_name",
"]"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/client.py#L526-L538 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/intelc.py | python | vercmp | (a, b) | return cmp(linux_ver_normalize(b), linux_ver_normalize(a)) | Compare strings as floats,
but Intel changed Linux naming convention at 9.0 | Compare strings as floats,
but Intel changed Linux naming convention at 9.0 | [
"Compare",
"strings",
"as",
"floats",
"but",
"Intel",
"changed",
"Linux",
"naming",
"convention",
"at",
"9",
".",
"0"
] | def vercmp(a, b):
"""Compare strings as floats,
but Intel changed Linux naming convention at 9.0"""
return cmp(linux_ver_normalize(b), linux_ver_normalize(a)) | [
"def",
"vercmp",
"(",
"a",
",",
"b",
")",
":",
"return",
"cmp",
"(",
"linux_ver_normalize",
"(",
"b",
")",
",",
"linux_ver_normalize",
"(",
"a",
")",
")"
] | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/intelc.py#L116-L119 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/receptive_field/python/util/receptive_field.py | python | _get_layer_params | (node, name_to_order_node) | return kernel_size_x, kernel_size_y, stride_x, stride_y, padding_x, padding_y | Gets layer parameters relevant for RF computation.
Currently, only these nodes are supported:
- Conv2D
- DepthwiseConv2dNative
- Pad
- MaxPool
- AvgPool
- all nodes listed in _UNCHANGED_RF_LAYER_OPS
Args:
node: Tensorflow node (NodeDef proto).
name_to_order_node: Map from name to {order, node}... | Gets layer parameters relevant for RF computation. | [
"Gets",
"layer",
"parameters",
"relevant",
"for",
"RF",
"computation",
"."
] | def _get_layer_params(node, name_to_order_node):
"""Gets layer parameters relevant for RF computation.
Currently, only these nodes are supported:
- Conv2D
- DepthwiseConv2dNative
- Pad
- MaxPool
- AvgPool
- all nodes listed in _UNCHANGED_RF_LAYER_OPS
Args:
node: Tensorflow node (NodeDef proto).
... | [
"def",
"_get_layer_params",
"(",
"node",
",",
"name_to_order_node",
")",
":",
"logging",
".",
"vlog",
"(",
"3",
",",
"\"node.op = %s\"",
",",
"node",
".",
"op",
")",
"logging",
".",
"vlog",
"(",
"4",
",",
"\"node = %s\"",
",",
"node",
")",
"if",
"node",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/receptive_field/python/util/receptive_field.py#L186-L245 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/gui/DirectScrolledList.py | python | DirectScrolledList.refresh | (self) | Update the list - useful when adding or deleting items
or changing properties that would affect the scrolling | Update the list - useful when adding or deleting items
or changing properties that would affect the scrolling | [
"Update",
"the",
"list",
"-",
"useful",
"when",
"adding",
"or",
"deleting",
"items",
"or",
"changing",
"properties",
"that",
"would",
"affect",
"the",
"scrolling"
] | def refresh(self):
"""
Update the list - useful when adding or deleting items
or changing properties that would affect the scrolling
"""
assert self.notify.debugStateCall(self)
self.recordMaxHeight()
#print "refresh called"
self.scrollTo(self.index) | [
"def",
"refresh",
"(",
"self",
")",
":",
"assert",
"self",
".",
"notify",
".",
"debugStateCall",
"(",
"self",
")",
"self",
".",
"recordMaxHeight",
"(",
")",
"#print \"refresh called\"",
"self",
".",
"scrollTo",
"(",
"self",
".",
"index",
")"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/gui/DirectScrolledList.py#L451-L459 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBHostOS.GetLLDBPythonPath | () | return _lldb.SBHostOS_GetLLDBPythonPath() | GetLLDBPythonPath() -> SBFileSpec | GetLLDBPythonPath() -> SBFileSpec | [
"GetLLDBPythonPath",
"()",
"-",
">",
"SBFileSpec"
] | def GetLLDBPythonPath():
"""GetLLDBPythonPath() -> SBFileSpec"""
return _lldb.SBHostOS_GetLLDBPythonPath() | [
"def",
"GetLLDBPythonPath",
"(",
")",
":",
"return",
"_lldb",
".",
"SBHostOS_GetLLDBPythonPath",
"(",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L6044-L6046 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/jinja2/filters.py | python | do_forceescape | (value) | return escape(text_type(value)) | Enforce HTML escaping. This will probably double escape variables. | Enforce HTML escaping. This will probably double escape variables. | [
"Enforce",
"HTML",
"escaping",
".",
"This",
"will",
"probably",
"double",
"escape",
"variables",
"."
] | def do_forceescape(value):
"""Enforce HTML escaping. This will probably double escape variables."""
if hasattr(value, '__html__'):
value = value.__html__()
return escape(text_type(value)) | [
"def",
"do_forceescape",
"(",
"value",
")",
":",
"if",
"hasattr",
"(",
"value",
",",
"'__html__'",
")",
":",
"value",
"=",
"value",
".",
"__html__",
"(",
")",
"return",
"escape",
"(",
"text_type",
"(",
"value",
")",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/jinja2/filters.py#L73-L77 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | kratos/mpi/python_scripts/debug_utilities.py | python | CheckHistoricalVariableStatistics | (model_part, input_variable) | Compute the statistics of the given historical variable. | Compute the statistics of the given historical variable. | [
"Compute",
"the",
"statistics",
"of",
"the",
"given",
"historical",
"variable",
"."
] | def CheckHistoricalVariableStatistics(model_part, input_variable):
"""Compute the statistics of the given historical variable."""
data_comm = KratosMultiphysics.DataCommunicator.GetDefault()
if data_comm.IsDistributed():
mean_var = 0.0
fixed_count = 0
for node in model_part.GetC... | [
"def",
"CheckHistoricalVariableStatistics",
"(",
"model_part",
",",
"input_variable",
")",
":",
"data_comm",
"=",
"KratosMultiphysics",
".",
"DataCommunicator",
".",
"GetDefault",
"(",
")",
"if",
"data_comm",
".",
"IsDistributed",
"(",
")",
":",
"mean_var",
"=",
"... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/mpi/python_scripts/debug_utilities.py#L134-L157 | ||
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.checkQuery | (self) | return self.dispatcher._checkResult(
Indigo._lib.indigoCheckQuery(self.id)
) | Atom, Bond, Molecule, Reaction method verifies if object is query
Returns:
int: 1 if object is query, 0 otherwise | Atom, Bond, Molecule, Reaction method verifies if object is query | [
"Atom",
"Bond",
"Molecule",
"Reaction",
"method",
"verifies",
"if",
"object",
"is",
"query"
] | def checkQuery(self):
"""Atom, Bond, Molecule, Reaction method verifies if object is query
Returns:
int: 1 if object is query, 0 otherwise
"""
self.dispatcher._setSessionId()
return self.dispatcher._checkResult(
Indigo._lib.indigoCheckQuery(self.id)
... | [
"def",
"checkQuery",
"(",
"self",
")",
":",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"return",
"self",
".",
"dispatcher",
".",
"_checkResult",
"(",
"Indigo",
".",
"_lib",
".",
"indigoCheckQuery",
"(",
"self",
".",
"id",
")",
")"
] | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L1192-L1201 | |
zerotier/libzt | 41eb9aebc80a5f1c816fa26a06cefde9de906676 | src/bindings/python/sockets.py | python | socket.sendfile | (self, file, offset=0, count=None) | libzt does not support this (yet) | libzt does not support this (yet) | [
"libzt",
"does",
"not",
"support",
"this",
"(",
"yet",
")"
] | def sendfile(self, file, offset=0, count=None):
"""libzt does not support this (yet)"""
raise NotImplementedError("libzt does not support this (yet?)") | [
"def",
"sendfile",
"(",
"self",
",",
"file",
",",
"offset",
"=",
"0",
",",
"count",
"=",
"None",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"libzt does not support this (yet?)\"",
")"
] | https://github.com/zerotier/libzt/blob/41eb9aebc80a5f1c816fa26a06cefde9de906676/src/bindings/python/sockets.py#L409-L411 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py | python | IMetadataProvider.get_metadata | (name) | The named metadata resource as a string | The named metadata resource as a string | [
"The",
"named",
"metadata",
"resource",
"as",
"a",
"string"
] | def get_metadata(name):
"""The named metadata resource as a string""" | [
"def",
"get_metadata",
"(",
"name",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py#L507-L508 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | AlphaPixelData_Accessor.Get | (*args, **kwargs) | return _gdi_.AlphaPixelData_Accessor_Get(*args, **kwargs) | Get(self) -> PyObject | Get(self) -> PyObject | [
"Get",
"(",
"self",
")",
"-",
">",
"PyObject"
] | def Get(*args, **kwargs):
"""Get(self) -> PyObject"""
return _gdi_.AlphaPixelData_Accessor_Get(*args, **kwargs) | [
"def",
"Get",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"AlphaPixelData_Accessor_Get",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L1233-L1235 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/math_grad.py | python | _SparseMatMulGrad | (op, grad) | Gradient for SparseMatMul. | Gradient for SparseMatMul. | [
"Gradient",
"for",
"SparseMatMul",
"."
] | def _SparseMatMulGrad(op, grad):
"""Gradient for SparseMatMul."""
t_a = op.get_attr("transpose_a")
t_b = op.get_attr("transpose_b")
is_sparse = {
op.inputs[0]: op.get_attr("a_is_sparse"),
op.inputs[1]: op.get_attr("b_is_sparse"),
# Use heuristic to figure out if grad might be sparse
gra... | [
"def",
"_SparseMatMulGrad",
"(",
"op",
",",
"grad",
")",
":",
"t_a",
"=",
"op",
".",
"get_attr",
"(",
"\"transpose_a\"",
")",
"t_b",
"=",
"op",
".",
"get_attr",
"(",
"\"transpose_b\"",
")",
"is_sparse",
"=",
"{",
"op",
".",
"inputs",
"[",
"0",
"]",
"... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/math_grad.py#L652-L697 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Image.GetAlphaData | (*args, **kwargs) | return _core_.Image_GetAlphaData(*args, **kwargs) | GetAlphaData(self) -> PyObject
Returns a string containing a copy of the alpha bytes of the image. | GetAlphaData(self) -> PyObject | [
"GetAlphaData",
"(",
"self",
")",
"-",
">",
"PyObject"
] | def GetAlphaData(*args, **kwargs):
"""
GetAlphaData(self) -> PyObject
Returns a string containing a copy of the alpha bytes of the image.
"""
return _core_.Image_GetAlphaData(*args, **kwargs) | [
"def",
"GetAlphaData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_GetAlphaData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L3395-L3401 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/files.py | python | XPTFile.copy | (self, dest, skip_if_older=True) | return True | Link the registered XPTs and place the resulting linked XPT at the
destination given as a string or a Dest instance. Avoids an expensive
XPT linking if the interfaces in an existing destination match those of
the individual XPTs to link.
skip_if_older is ignored. | Link the registered XPTs and place the resulting linked XPT at the
destination given as a string or a Dest instance. Avoids an expensive
XPT linking if the interfaces in an existing destination match those of
the individual XPTs to link.
skip_if_older is ignored. | [
"Link",
"the",
"registered",
"XPTs",
"and",
"place",
"the",
"resulting",
"linked",
"XPT",
"at",
"the",
"destination",
"given",
"as",
"a",
"string",
"or",
"a",
"Dest",
"instance",
".",
"Avoids",
"an",
"expensive",
"XPT",
"linking",
"if",
"the",
"interfaces",
... | def copy(self, dest, skip_if_older=True):
'''
Link the registered XPTs and place the resulting linked XPT at the
destination given as a string or a Dest instance. Avoids an expensive
XPT linking if the interfaces in an existing destination match those of
the individual XPTs to li... | [
"def",
"copy",
"(",
"self",
",",
"dest",
",",
"skip_if_older",
"=",
"True",
")",
":",
"if",
"isinstance",
"(",
"dest",
",",
"basestring",
")",
":",
"dest",
"=",
"Dest",
"(",
"dest",
")",
"assert",
"isinstance",
"(",
"dest",
",",
"Dest",
")",
"from",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/files.py#L500-L535 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/_core_ex.py | python | CallAfter | (callableObj, *args, **kw) | Call the specified function after the current and pending event
handlers have been completed. This is also good for making GUI
method calls from non-GUI threads. Any extra positional or
keyword args are passed on to the callable when it is called.
:see: `wx.CallLater` | Call the specified function after the current and pending event
handlers have been completed. This is also good for making GUI
method calls from non-GUI threads. Any extra positional or
keyword args are passed on to the callable when it is called. | [
"Call",
"the",
"specified",
"function",
"after",
"the",
"current",
"and",
"pending",
"event",
"handlers",
"have",
"been",
"completed",
".",
"This",
"is",
"also",
"good",
"for",
"making",
"GUI",
"method",
"calls",
"from",
"non",
"-",
"GUI",
"threads",
".",
... | def CallAfter(callableObj, *args, **kw):
"""
Call the specified function after the current and pending event
handlers have been completed. This is also good for making GUI
method calls from non-GUI threads. Any extra positional or
keyword args are passed on to the callable when it is called.
... | [
"def",
"CallAfter",
"(",
"callableObj",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"assert",
"callable",
"(",
"callableObj",
")",
",",
"\"callableObj is not callable\"",
"app",
"=",
"wx",
".",
"GetApp",
"(",
")",
"assert",
"app",
"is",
"not",
"None... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/_core_ex.py#L148-L170 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Web/Python/paraview/web/protocols.py | python | ParaViewWebSelectionHandler.startSelection | (self, viewId, selectionType) | Method used to initialize an interactive selection | Method used to initialize an interactive selection | [
"Method",
"used",
"to",
"initialize",
"an",
"interactive",
"selection"
] | def startSelection(self, viewId, selectionType):
"""
Method used to initialize an interactive selection
"""
self.active_view = self.getView(viewId)
if self.active_view.IsSelectionAvailable():
self.previous_interaction = self.active_view.InteractionMode
sel... | [
"def",
"startSelection",
"(",
"self",
",",
"viewId",
",",
"selectionType",
")",
":",
"self",
".",
"active_view",
"=",
"self",
".",
"getView",
"(",
"viewId",
")",
"if",
"self",
".",
"active_view",
".",
"IsSelectionAvailable",
"(",
")",
":",
"self",
".",
"... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Web/Python/paraview/web/protocols.py#L3850-L3861 | ||
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/utilities/pythonlibs/audio/training/training_config.py | python | TrainingConfig.save | (self, filename) | save an options.json file in the self.filename location | save an options.json file in the self.filename location | [
"save",
"an",
"options",
".",
"json",
"file",
"in",
"the",
"self",
".",
"filename",
"location"
] | def save(self, filename):
""" save an options.json file in the self.filename location """
self.filename = filename
data = TrainingConfig.to_dict(self)
data["model"] = self.model.__dict__
with open(filename, "w") as f:
json.dump(data, f, indent=2, sort_keys=True)
... | [
"def",
"save",
"(",
"self",
",",
"filename",
")",
":",
"self",
".",
"filename",
"=",
"filename",
"data",
"=",
"TrainingConfig",
".",
"to_dict",
"(",
"self",
")",
"data",
"[",
"\"model\"",
"]",
"=",
"self",
".",
"model",
".",
"__dict__",
"with",
"open",... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/utilities/pythonlibs/audio/training/training_config.py#L100-L107 | ||
facebook/fbthrift | fb9c8562aba04c4fd9b17716eb5d970cc88a75bb | thrift/lib/py/transport/TTransport.py | python | CReadableTransport.cstringio_buf | (self) | A cStringIO buffer that contains the current chunk we are reading. | A cStringIO buffer that contains the current chunk we are reading. | [
"A",
"cStringIO",
"buffer",
"that",
"contains",
"the",
"current",
"chunk",
"we",
"are",
"reading",
"."
] | def cstringio_buf(self):
"""A cStringIO buffer that contains the current chunk we are reading."""
pass | [
"def",
"cstringio_buf",
"(",
"self",
")",
":",
"pass"
] | https://github.com/facebook/fbthrift/blob/fb9c8562aba04c4fd9b17716eb5d970cc88a75bb/thrift/lib/py/transport/TTransport.py#L101-L103 | ||
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | ext/scintilla/scripts/FileGenerator.py | python | UpdateFile | (filename, updated) | If the file contents are different to updated then copy updated into the
file else leave alone so Mercurial and make don't treat it as modified. | If the file contents are different to updated then copy updated into the
file else leave alone so Mercurial and make don't treat it as modified. | [
"If",
"the",
"file",
"contents",
"are",
"different",
"to",
"updated",
"then",
"copy",
"updated",
"into",
"the",
"file",
"else",
"leave",
"alone",
"so",
"Mercurial",
"and",
"make",
"don",
"t",
"treat",
"it",
"as",
"modified",
"."
] | def UpdateFile(filename, updated):
""" If the file contents are different to updated then copy updated into the
file else leave alone so Mercurial and make don't treat it as modified. """
newOrChanged = "Changed"
try:
with codecs.open(filename, "r", "utf-8") as infile:
original = inf... | [
"def",
"UpdateFile",
"(",
"filename",
",",
"updated",
")",
":",
"newOrChanged",
"=",
"\"Changed\"",
"try",
":",
"with",
"codecs",
".",
"open",
"(",
"filename",
",",
"\"r\"",
",",
"\"utf-8\"",
")",
"as",
"infile",
":",
"original",
"=",
"infile",
".",
"rea... | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/ext/scintilla/scripts/FileGenerator.py#L20-L35 | ||
cathywu/Sentiment-Analysis | eb501fd1375c0c3f3ab430f963255f1bb858e659 | PyML-0.7.9/PyML/evaluators/assess.py | python | cv | (classifier, data, numFolds = 5, **args) | return cvFromFolds(classifier, data, trainingPatterns, testingPatterns, **args) | perform k-fold cross validation
:Parameters:
- `classifier` - a classifier template
- `data` - a dataset
- `numFolds` - number of cross validation folds (default = 5)
:Returns:
a Results object.
:Keywords:
- `numFolds` - number of cross validation folds (default = 5)
-... | perform k-fold cross validation | [
"perform",
"k",
"-",
"fold",
"cross",
"validation"
] | def cv(classifier, data, numFolds = 5, **args) :
"""perform k-fold cross validation
:Parameters:
- `classifier` - a classifier template
- `data` - a dataset
- `numFolds` - number of cross validation folds (default = 5)
:Returns:
a Results object.
:Keywords:
- `numFolds` ... | [
"def",
"cv",
"(",
"classifier",
",",
"data",
",",
"numFolds",
"=",
"5",
",",
"*",
"*",
"args",
")",
":",
"if",
"'numFolds'",
"in",
"args",
":",
"numFolds",
"=",
"args",
"[",
"'numFolds'",
"]",
"if",
"'seed'",
"in",
"args",
":",
"random",
".",
"seed... | https://github.com/cathywu/Sentiment-Analysis/blob/eb501fd1375c0c3f3ab430f963255f1bb858e659/PyML-0.7.9/PyML/evaluators/assess.py#L160-L202 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PropertyGrid.GetSplitterPosition | (*args, **kwargs) | return _propgrid.PropertyGrid_GetSplitterPosition(*args, **kwargs) | GetSplitterPosition(self, int splitterIndex=0) -> int | GetSplitterPosition(self, int splitterIndex=0) -> int | [
"GetSplitterPosition",
"(",
"self",
"int",
"splitterIndex",
"=",
"0",
")",
"-",
">",
"int"
] | def GetSplitterPosition(*args, **kwargs):
"""GetSplitterPosition(self, int splitterIndex=0) -> int"""
return _propgrid.PropertyGrid_GetSplitterPosition(*args, **kwargs) | [
"def",
"GetSplitterPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_GetSplitterPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L2138-L2140 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/_pslinux.py | python | wrap_exceptions | (fun) | return wrapper | Decorator which translates bare OSError and IOError exceptions
into NoSuchProcess and AccessDenied. | Decorator which translates bare OSError and IOError exceptions
into NoSuchProcess and AccessDenied. | [
"Decorator",
"which",
"translates",
"bare",
"OSError",
"and",
"IOError",
"exceptions",
"into",
"NoSuchProcess",
"and",
"AccessDenied",
"."
] | def wrap_exceptions(fun):
"""Decorator which translates bare OSError and IOError exceptions
into NoSuchProcess and AccessDenied.
"""
@functools.wraps(fun)
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except PermissionError:
raise ... | [
"def",
"wrap_exceptions",
"(",
"fun",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"fun",
")",
"def",
"wrapper",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"return",
"fun",
"(",
"self",
",",
"*",
"args",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/_pslinux.py#L1509-L1527 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/dataview.py | python | DataViewVirtualListModel.GetValueByRow | (*args, **kwargs) | return _dataview.DataViewVirtualListModel_GetValueByRow(*args, **kwargs) | GetValueByRow(self, unsigned int row, unsigned int col) -> wxVariant
Override this method to return the data value to be used for the item
at the given row and column. | GetValueByRow(self, unsigned int row, unsigned int col) -> wxVariant | [
"GetValueByRow",
"(",
"self",
"unsigned",
"int",
"row",
"unsigned",
"int",
"col",
")",
"-",
">",
"wxVariant"
] | def GetValueByRow(*args, **kwargs):
"""
GetValueByRow(self, unsigned int row, unsigned int col) -> wxVariant
Override this method to return the data value to be used for the item
at the given row and column.
"""
return _dataview.DataViewVirtualListModel_GetValueByRow(*ar... | [
"def",
"GetValueByRow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewVirtualListModel_GetValueByRow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L970-L977 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/MSVSVersion.py | python | _RegistryQuery | (key, value=None) | return text | Use reg.exe to read a particular key through _RegistryQueryBase.
First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If
that fails, it falls back to System32. Sysnative is available on Vista and
up and available on Windows Server 2003 and XP through KB patch 942589. Note
that Sysnative w... | Use reg.exe to read a particular key through _RegistryQueryBase. | [
"Use",
"reg",
".",
"exe",
"to",
"read",
"a",
"particular",
"key",
"through",
"_RegistryQueryBase",
"."
] | def _RegistryQuery(key, value=None):
"""Use reg.exe to read a particular key through _RegistryQueryBase.
First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If
that fails, it falls back to System32. Sysnative is available on Vista and
up and available on Windows Server 2003 and XP throug... | [
"def",
"_RegistryQuery",
"(",
"key",
",",
"value",
"=",
"None",
")",
":",
"text",
"=",
"None",
"try",
":",
"text",
"=",
"_RegistryQueryBase",
"(",
"'Sysnative'",
",",
"key",
",",
"value",
")",
"except",
"OSError",
",",
"e",
":",
"if",
"e",
".",
"errn... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/MSVSVersion.py#L130-L155 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | Simulator.getState | (self) | return _robotsim.Simulator_getState(self) | r"""
getState(Simulator self) -> std::string
Gets the current simulation state, including controller parameters, etc.
Returns:
A Base64 string representing the binary data for the state | r"""
getState(Simulator self) -> std::string | [
"r",
"getState",
"(",
"Simulator",
"self",
")",
"-",
">",
"std",
"::",
"string"
] | def getState(self) -> "std::string":
r"""
getState(Simulator self) -> std::string
Gets the current simulation state, including controller parameters, etc.
Returns:
A Base64 string representing the binary data for the state
"""
return _robotsim.Simul... | [
"def",
"getState",
"(",
"self",
")",
"->",
"\"std::string\"",
":",
"return",
"_robotsim",
".",
"Simulator_getState",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L8243-L8255 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/httputil.py | python | HTTPMessageDelegate.data_received | (self, chunk: bytes) | Called when a chunk of data has been received.
May return a `.Future` for flow control. | Called when a chunk of data has been received. | [
"Called",
"when",
"a",
"chunk",
"of",
"data",
"has",
"been",
"received",
"."
] | def data_received(self, chunk: bytes) -> Optional[Awaitable[None]]:
"""Called when a chunk of data has been received.
May return a `.Future` for flow control.
"""
pass | [
"def",
"data_received",
"(",
"self",
",",
"chunk",
":",
"bytes",
")",
"->",
"Optional",
"[",
"Awaitable",
"[",
"None",
"]",
"]",
":",
"pass"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/httputil.py#L543-L548 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/parallel_device/parallel_device.py | python | ParallelDevice._assert_eager | (self) | Verifies that tracing is not active. | Verifies that tracing is not active. | [
"Verifies",
"that",
"tracing",
"is",
"not",
"active",
"."
] | def _assert_eager(self):
"""Verifies that tracing is not active."""
if not context.executing_eagerly():
raise NotImplementedError(
"ParallelDevice is currently not supported inside `tf.function`. It "
"can however run calls to a `tf.function` in parallel:\n\n"
"with ParallelD... | [
"def",
"_assert_eager",
"(",
"self",
")",
":",
"if",
"not",
"context",
".",
"executing_eagerly",
"(",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"ParallelDevice is currently not supported inside `tf.function`. It \"",
"\"can however run calls to a `tf.function` in parallel:... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/parallel_device/parallel_device.py#L197-L203 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PropertyGridManager.GetToolBar | (*args, **kwargs) | return _propgrid.PropertyGridManager_GetToolBar(*args, **kwargs) | GetToolBar(self) -> wxToolBar | GetToolBar(self) -> wxToolBar | [
"GetToolBar",
"(",
"self",
")",
"-",
">",
"wxToolBar"
] | def GetToolBar(*args, **kwargs):
"""GetToolBar(self) -> wxToolBar"""
return _propgrid.PropertyGridManager_GetToolBar(*args, **kwargs) | [
"def",
"GetToolBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridManager_GetToolBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L3521-L3523 | |
sonyxperiadev/WebGL | 0299b38196f78c6d5f74bcf6fa312a3daee6de60 | Tools/Scripts/webkitpy/common/system/logutils.py | python | _default_handlers | (stream) | return [handler] | Return a list of the default logging handlers to use.
Args:
stream: See the configure_logging() docstring. | Return a list of the default logging handlers to use. | [
"Return",
"a",
"list",
"of",
"the",
"default",
"logging",
"handlers",
"to",
"use",
"."
] | def _default_handlers(stream):
"""Return a list of the default logging handlers to use.
Args:
stream: See the configure_logging() docstring.
"""
# Create the filter.
def should_log(record):
"""Return whether a logging.LogRecord should be logged."""
# FIXME: Enable the logging... | [
"def",
"_default_handlers",
"(",
"stream",
")",
":",
"# Create the filter.",
"def",
"should_log",
"(",
"record",
")",
":",
"\"\"\"Return whether a logging.LogRecord should be logged.\"\"\"",
"# FIXME: Enable the logging of autoinstall messages once",
"# autoinstall is adjusted. ... | https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/common/system/logutils.py#L128-L155 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.