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
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/framework/gpu_util.py
python
compute_capability_from_device_desc
(device_attrs)
return GpuInfo(match.group(1), cc)
Returns the GpuInfo given a DeviceAttributes proto. Args: device_attrs: A DeviceAttributes proto. Returns A gpu_info tuple. Both fields are None if `device_attrs` does not have a valid physical_device_desc field.
Returns the GpuInfo given a DeviceAttributes proto.
[ "Returns", "the", "GpuInfo", "given", "a", "DeviceAttributes", "proto", "." ]
def compute_capability_from_device_desc(device_attrs): """Returns the GpuInfo given a DeviceAttributes proto. Args: device_attrs: A DeviceAttributes proto. Returns A gpu_info tuple. Both fields are None if `device_attrs` does not have a valid physical_device_desc field. """ # TODO(jingyue): The ...
[ "def", "compute_capability_from_device_desc", "(", "device_attrs", ")", ":", "# TODO(jingyue): The device description generator has to be in sync with", "# this file. Another option is to put compute capability in", "# DeviceAttributes, but I avoided that to keep DeviceAttributes", "# target-indep...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/gpu_util.py#L31-L53
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.DelLineRight
(*args, **kwargs)
return _stc.StyledTextCtrl_DelLineRight(*args, **kwargs)
DelLineRight(self) Delete forwards from the current position to the end of the line.
DelLineRight(self)
[ "DelLineRight", "(", "self", ")" ]
def DelLineRight(*args, **kwargs): """ DelLineRight(self) Delete forwards from the current position to the end of the line. """ return _stc.StyledTextCtrl_DelLineRight(*args, **kwargs)
[ "def", "DelLineRight", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_DelLineRight", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L5154-L5160
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py
python
PartitionedVariable._concat
(self)
Returns the overall concatenated value as a `Tensor`. This is different from using the partitioned variable directly as a tensor (through tensor conversion and `as_tensor`) in that it creates a new set of operations that keeps the control dependencies from its scope. Returns: `Tensor` containing...
Returns the overall concatenated value as a `Tensor`.
[ "Returns", "the", "overall", "concatenated", "value", "as", "a", "Tensor", "." ]
def _concat(self): """Returns the overall concatenated value as a `Tensor`. This is different from using the partitioned variable directly as a tensor (through tensor conversion and `as_tensor`) in that it creates a new set of operations that keeps the control dependencies from its scope. Returns:...
[ "def", "_concat", "(", "self", ")", ":", "if", "len", "(", "self", ".", "_variable_list", ")", "==", "1", ":", "with", "ops", ".", "name_scope", "(", "None", ")", ":", "return", "array_ops", ".", "identity", "(", "self", ".", "_variable_list", "[", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py#L2915-L2941
ianmaclarty/amulet
3d1363e0a0dde5e4c346409cefab66c2dc91b237
third_party/freetype-2.5.5/src/tools/glnames.py
python
dump_array
( the_array, write, array_name )
dumps a given encoding
dumps a given encoding
[ "dumps", "a", "given", "encoding" ]
def dump_array( the_array, write, array_name ): """dumps a given encoding""" write( " static const unsigned char " + array_name + "[" + repr( len( the_array ) ) + "L] =\n" ) write( " {\n" ) line = "" comma = " " col = 0 for value in the_array: line += comma line += "%3d" % ord...
[ "def", "dump_array", "(", "the_array", ",", "write", ",", "array_name", ")", ":", "write", "(", "\" static const unsigned char \"", "+", "array_name", "+", "\"[\"", "+", "repr", "(", "len", "(", "the_array", ")", ")", "+", "\"L] =\\n\"", ")", "write", "(",...
https://github.com/ianmaclarty/amulet/blob/3d1363e0a0dde5e4c346409cefab66c2dc91b237/third_party/freetype-2.5.5/src/tools/glnames.py#L5210-L5235
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/quantization/quantize.py
python
disable_fake_quant
(module: Module)
r"""Recursively disable ``module`` fake quantization in QATModule through :meth:`~.Module.apply` Args: module: root module to do disable fake quantization recursively.
r"""Recursively disable ``module`` fake quantization in QATModule through :meth:`~.Module.apply`
[ "r", "Recursively", "disable", "module", "fake", "quantization", "in", "QATModule", "through", ":", "meth", ":", "~", ".", "Module", ".", "apply" ]
def disable_fake_quant(module: Module): r"""Recursively disable ``module`` fake quantization in QATModule through :meth:`~.Module.apply` Args: module: root module to do disable fake quantization recursively. """ _propagate(module, "set_fake_quant", False)
[ "def", "disable_fake_quant", "(", "module", ":", "Module", ")", ":", "_propagate", "(", "module", ",", "\"set_fake_quant\"", ",", "False", ")" ]
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/quantization/quantize.py#L268-L275
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/osx_carbon/gizmos.py
python
LEDNumberCtrl.SetAlignment
(*args, **kwargs)
return _gizmos.LEDNumberCtrl_SetAlignment(*args, **kwargs)
SetAlignment(self, int Alignment, bool Redraw=True)
SetAlignment(self, int Alignment, bool Redraw=True)
[ "SetAlignment", "(", "self", "int", "Alignment", "bool", "Redraw", "=", "True", ")" ]
def SetAlignment(*args, **kwargs): """SetAlignment(self, int Alignment, bool Redraw=True)""" return _gizmos.LEDNumberCtrl_SetAlignment(*args, **kwargs)
[ "def", "SetAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "LEDNumberCtrl_SetAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_carbon/gizmos.py#L338-L340
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/fcompiler/__init__.py
python
get_default_fcompiler
(osname=None, platform=None, requiref90=False, c_compiler=None)
return compiler_type
Determine the default Fortran compiler to use for the given platform.
Determine the default Fortran compiler to use for the given platform.
[ "Determine", "the", "default", "Fortran", "compiler", "to", "use", "for", "the", "given", "platform", "." ]
def get_default_fcompiler(osname=None, platform=None, requiref90=False, c_compiler=None): """Determine the default Fortran compiler to use for the given platform.""" matching_compiler_types = available_fcompilers_for_platform(osname, ...
[ "def", "get_default_fcompiler", "(", "osname", "=", "None", ",", "platform", "=", "None", ",", "requiref90", "=", "False", ",", "c_compiler", "=", "None", ")", ":", "matching_compiler_types", "=", "available_fcompilers_for_platform", "(", "osname", ",", "platform"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/fcompiler/__init__.py#L847-L860
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
TopLevelWindow.ShowFullScreen
(*args, **kwargs)
return _windows_.TopLevelWindow_ShowFullScreen(*args, **kwargs)
ShowFullScreen(self, bool show, long style=FULLSCREEN_ALL) -> bool
ShowFullScreen(self, bool show, long style=FULLSCREEN_ALL) -> bool
[ "ShowFullScreen", "(", "self", "bool", "show", "long", "style", "=", "FULLSCREEN_ALL", ")", "-", ">", "bool" ]
def ShowFullScreen(*args, **kwargs): """ShowFullScreen(self, bool show, long style=FULLSCREEN_ALL) -> bool""" return _windows_.TopLevelWindow_ShowFullScreen(*args, **kwargs)
[ "def", "ShowFullScreen", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "TopLevelWindow_ShowFullScreen", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L441-L443
ErLinErYi/PlantsVsZombies
3a61d9dd4ffb65749a92c4f785315f79077b8555
PlantsVsZombies/cocos2d/plugin/tools/pluginx-bindings-generator/genbindings-lua.py
python
_check_ndk_root_env
()
return NDK_ROOT
Checking the environment NDK_ROOT, which will be used for building
Checking the environment NDK_ROOT, which will be used for building
[ "Checking", "the", "environment", "NDK_ROOT", "which", "will", "be", "used", "for", "building" ]
def _check_ndk_root_env(): ''' Checking the environment NDK_ROOT, which will be used for building ''' try: NDK_ROOT = os.environ['NDK_ROOT'] except Exception: print "NDK_ROOT not defined. Please define NDK_ROOT in your environment." sys.exit(1) return NDK_ROOT
[ "def", "_check_ndk_root_env", "(", ")", ":", "try", ":", "NDK_ROOT", "=", "os", ".", "environ", "[", "'NDK_ROOT'", "]", "except", "Exception", ":", "print", "\"NDK_ROOT not defined. Please define NDK_ROOT in your environment.\"", "sys", ".", "exit", "(", "1", ")", ...
https://github.com/ErLinErYi/PlantsVsZombies/blob/3a61d9dd4ffb65749a92c4f785315f79077b8555/PlantsVsZombies/cocos2d/plugin/tools/pluginx-bindings-generator/genbindings-lua.py#L19-L29
ros-planning/moveit
ee48dc5cedc981d0869352aa3db0b41469c2735c
moveit_commander/src/moveit_commander/move_group.py
python
MoveGroupCommander.get_interface_description
(self)
return desc
Get the description of the planner interface (list of planner ids)
Get the description of the planner interface (list of planner ids)
[ "Get", "the", "description", "of", "the", "planner", "interface", "(", "list", "of", "planner", "ids", ")" ]
def get_interface_description(self): """ Get the description of the planner interface (list of planner ids) """ desc = PlannerInterfaceDescription() conversions.msg_from_string(desc, self._g.get_interface_description()) return desc
[ "def", "get_interface_description", "(", "self", ")", ":", "desc", "=", "PlannerInterfaceDescription", "(", ")", "conversions", ".", "msg_from_string", "(", "desc", ",", "self", ".", "_g", ".", "get_interface_description", "(", ")", ")", "return", "desc" ]
https://github.com/ros-planning/moveit/blob/ee48dc5cedc981d0869352aa3db0b41469c2735c/moveit_commander/src/moveit_commander/move_group.py#L103-L107
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/util/_cloudpickle/_cloudpickle_py27.py
python
_rehydrate_skeleton_class
(skeleton_class, class_dict)
return skeleton_class
Put attributes from `class_dict` back on `skeleton_class`. See CloudPickler.save_dynamic_class for more info.
Put attributes from `class_dict` back on `skeleton_class`.
[ "Put", "attributes", "from", "class_dict", "back", "on", "skeleton_class", "." ]
def _rehydrate_skeleton_class(skeleton_class, class_dict): """Put attributes from `class_dict` back on `skeleton_class`. See CloudPickler.save_dynamic_class for more info. """ for attrname, attr in class_dict.items(): setattr(skeleton_class, attrname, attr) return skeleton_class
[ "def", "_rehydrate_skeleton_class", "(", "skeleton_class", ",", "class_dict", ")", ":", "for", "attrname", ",", "attr", "in", "class_dict", ".", "items", "(", ")", ":", "setattr", "(", "skeleton_class", ",", "attrname", ",", "attr", ")", "return", "skeleton_cl...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/util/_cloudpickle/_cloudpickle_py27.py#L1219-L1226
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/summary/text_summary.py
python
text_summary
(name, tensor, collections=None)
return t_summary
Summarizes textual data. Text data summarized via this plugin will be visible in the Text Dashboard in TensorBoard. The standard TensorBoard Text Dashboard will render markdown in the strings, and will automatically organize 1d and 2d tensors into tables. If a tensor with more than 2 dimensions is provided, a ...
Summarizes textual data.
[ "Summarizes", "textual", "data", "." ]
def text_summary(name, tensor, collections=None): """Summarizes textual data. Text data summarized via this plugin will be visible in the Text Dashboard in TensorBoard. The standard TensorBoard Text Dashboard will render markdown in the strings, and will automatically organize 1d and 2d tensors into tables. ...
[ "def", "text_summary", "(", "name", ",", "tensor", ",", "collections", "=", "None", ")", ":", "if", "tensor", ".", "dtype", "!=", "dtypes", ".", "string", ":", "raise", "ValueError", "(", "\"Expected tensor %s to have dtype string, got %s\"", "%", "(", "tensor",...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/summary/text_summary.py#L40-L80
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/polynomial/legendre.py
python
legvander
(x, deg)
return np.moveaxis(v, 0, -1)
Pseudo-Vandermonde matrix of given degree. Returns the pseudo-Vandermonde matrix of degree `deg` and sample points `x`. The pseudo-Vandermonde matrix is defined by .. math:: V[..., i] = L_i(x) where `0 <= i <= deg`. The leading indices of `V` index the elements of `x` and the last index is the de...
Pseudo-Vandermonde matrix of given degree.
[ "Pseudo", "-", "Vandermonde", "matrix", "of", "given", "degree", "." ]
def legvander(x, deg): """Pseudo-Vandermonde matrix of given degree. Returns the pseudo-Vandermonde matrix of degree `deg` and sample points `x`. The pseudo-Vandermonde matrix is defined by .. math:: V[..., i] = L_i(x) where `0 <= i <= deg`. The leading indices of `V` index the elements of `x...
[ "def", "legvander", "(", "x", ",", "deg", ")", ":", "ideg", "=", "int", "(", "deg", ")", "if", "ideg", "!=", "deg", ":", "raise", "ValueError", "(", "\"deg must be integer\"", ")", "if", "ideg", "<", "0", ":", "raise", "ValueError", "(", "\"deg must be...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/polynomial/legendre.py#L1224-L1276
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/key_bindings.py
python
_MergedKeyBindings._update_cache
(self)
If one of the original registries was changed. Update our merged version.
If one of the original registries was changed. Update our merged version.
[ "If", "one", "of", "the", "original", "registries", "was", "changed", ".", "Update", "our", "merged", "version", "." ]
def _update_cache(self) -> None: """ If one of the original registries was changed. Update our merged version. """ expected_version = tuple(r._version for r in self.registries) if self._last_version != expected_version: bindings2 = KeyBindings() ...
[ "def", "_update_cache", "(", "self", ")", "->", "None", ":", "expected_version", "=", "tuple", "(", "r", ".", "_version", "for", "r", "in", "self", ".", "registries", ")", "if", "self", ".", "_last_version", "!=", "expected_version", ":", "bindings2", "=",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/key_bindings.py#L595-L609
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/sndhdr.py
python
whathdr
(filename)
return None
Recognize sound headers
Recognize sound headers
[ "Recognize", "sound", "headers" ]
def whathdr(filename): """Recognize sound headers""" f = open(filename, 'rb') h = f.read(512) for tf in tests: res = tf(h, f) if res: return res return None
[ "def", "whathdr", "(", "filename", ")", ":", "f", "=", "open", "(", "filename", ",", "'rb'", ")", "h", "=", "f", ".", "read", "(", "512", ")", "for", "tf", "in", "tests", ":", "res", "=", "tf", "(", "h", ",", "f", ")", "if", "res", ":", "re...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/sndhdr.py#L41-L49
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nn_impl.py
python
swish
(features)
return features * math_ops.sigmoid(features), grad
Computes the Swish activation function: `x * sigmoid(x)`. Source: "Searching for Activation Functions" (Ramachandran et al. 2017) https://arxiv.org/abs/1710.05941 Args: features: A `Tensor` representing preactivation values. name: A name for the operation (optional). Returns: The activation value...
Computes the Swish activation function: `x * sigmoid(x)`.
[ "Computes", "the", "Swish", "activation", "function", ":", "x", "*", "sigmoid", "(", "x", ")", "." ]
def swish(features): # pylint: disable=g-doc-args """Computes the Swish activation function: `x * sigmoid(x)`. Source: "Searching for Activation Functions" (Ramachandran et al. 2017) https://arxiv.org/abs/1710.05941 Args: features: A `Tensor` representing preactivation values. name: A name for the o...
[ "def", "swish", "(", "features", ")", ":", "# pylint: disable=g-doc-args", "# pylint: enable=g-doc-args", "features", "=", "ops", ".", "convert_to_tensor", "(", "features", ",", "name", "=", "\"features\"", ")", "def", "grad", "(", "dy", ")", ":", "\"\"\"Gradient ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nn_impl.py#L504-L535
nest/nest-simulator
f2623eb78518cdbd55e77e0ed486bf1111bcb62f
pynest/nest/lib/hl_api_helper.py
python
get_help_fname
(obj)
Get file name for help object Raises FileNotFound if no help is available for ``obj``. Parameters ---------- obj : string Object to get help filename for Returns ------- string: File name of the help text for obj
Get file name for help object
[ "Get", "file", "name", "for", "help", "object" ]
def get_help_fname(obj): """Get file name for help object Raises FileNotFound if no help is available for ``obj``. Parameters ---------- obj : string Object to get help filename for Returns ------- string: File name of the help text for obj """ docdir = sli_fu...
[ "def", "get_help_fname", "(", "obj", ")", ":", "docdir", "=", "sli_func", "(", "\"statusdict/prgdocdir ::\"", ")", "help_fname", "=", "os", ".", "path", ".", "join", "(", "docdir", ",", "'html'", ",", "'models'", ",", "f'{obj}.rst'", ")", "if", "os", ".", ...
https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/lib/hl_api_helper.py#L369-L391
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pydoc.py
python
cram
(text, maxlen)
return text
Omit part of a string if needed to make it fit in a maximum length.
Omit part of a string if needed to make it fit in a maximum length.
[ "Omit", "part", "of", "a", "string", "if", "needed", "to", "make", "it", "fit", "in", "a", "maximum", "length", "." ]
def cram(text, maxlen): """Omit part of a string if needed to make it fit in a maximum length.""" if len(text) > maxlen: pre = max(0, (maxlen-3)//2) post = max(0, maxlen-3-pre) return text[:pre] + '...' + text[len(text)-post:] return text
[ "def", "cram", "(", "text", ",", "maxlen", ")", ":", "if", "len", "(", "text", ")", ">", "maxlen", ":", "pre", "=", "max", "(", "0", ",", "(", "maxlen", "-", "3", ")", "//", "2", ")", "post", "=", "max", "(", "0", ",", "maxlen", "-", "3", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pydoc.py#L127-L133
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/eclib/segmentbk.py
python
SegmentBook.CurrentPage
(self)
Get the currently selected page @return: wxWindow or None
Get the currently selected page @return: wxWindow or None
[ "Get", "the", "currently", "selected", "page", "@return", ":", "wxWindow", "or", "None" ]
def CurrentPage(self): """Get the currently selected page @return: wxWindow or None """ idx = self._segbar.GetSelection() if idx != -1: return self._pages[idx]['page'] else: return None
[ "def", "CurrentPage", "(", "self", ")", ":", "idx", "=", "self", ".", "_segbar", ".", "GetSelection", "(", ")", "if", "idx", "!=", "-", "1", ":", "return", "self", ".", "_pages", "[", "idx", "]", "[", "'page'", "]", "else", ":", "return", "None" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/segmentbk.py#L264-L273
CGRU/cgru
1881a4128530e3d31ac6c25314c18314fc50c2c7
plugins/maya/afanasy/maya_ui_proc.py
python
getDefaultStrValue
(self_prefix, name, value)
return ret
getDefaultStrValue :param self_prefix: :param name: :param value: :return:
getDefaultStrValue
[ "getDefaultStrValue" ]
def getDefaultStrValue(self_prefix, name, value): """getDefaultStrValue :param self_prefix: :param name: :param value: :return: """ var_name = self_prefix + name if cmds.optionVar(exists=var_name) == 1: ret = cmds.optionVar(q=var_name) else: cmds.optionVar(sv=(var_name, value)) ret = value return ret
[ "def", "getDefaultStrValue", "(", "self_prefix", ",", "name", ",", "value", ")", ":", "var_name", "=", "self_prefix", "+", "name", "if", "cmds", ".", "optionVar", "(", "exists", "=", "var_name", ")", "==", "1", ":", "ret", "=", "cmds", ".", "optionVar", ...
https://github.com/CGRU/cgru/blob/1881a4128530e3d31ac6c25314c18314fc50c2c7/plugins/maya/afanasy/maya_ui_proc.py#L34-L48
nnrg/opennero
43e12a1bcba6e228639db3886fec1dc47ddc24cb
mods/Roomba/module.py
python
SandboxMod.mark
(self, x, y, marker)
Mark a position (x, y) with the specified color
Mark a position (x, y) with the specified color
[ "Mark", "a", "position", "(", "x", "y", ")", "with", "the", "specified", "color" ]
def mark(self, x, y, marker): """ Mark a position (x, y) with the specified color """ # remove the previous object, if necessary self.unmark(x, y) # add a new marker object id = common.addObject(marker, OpenNero.Vector3f(x, y, -1), OpenNero.Vector3f(0,0,0), OpenNero.Vector3f(0.5,...
[ "def", "mark", "(", "self", ",", "x", ",", "y", ",", "marker", ")", ":", "# remove the previous object, if necessary", "self", ".", "unmark", "(", "x", ",", "y", ")", "# add a new marker object", "id", "=", "common", ".", "addObject", "(", "marker", ",", "...
https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/Roomba/module.py#L30-L37
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/connectionpool.py
python
HTTPConnectionPool._make_request
( self, conn, method, url, timeout=_Default, chunked=False, **httplib_request_kw )
return httplib_response
Perform a request on a given urllib connection object taken from our pool. :param conn: a connection from one of our connection pools :param timeout: Socket timeout in seconds for the request. This can be a float or integer, which will set the same t...
[]
def _make_request( self, conn, method, url, timeout=_Default, chunked=False, **httplib_request_kw ): """ Perform a request on a given urllib connection object taken from our pool. :param conn: a connection from one of our connection pools :para...
[ "def", "_make_request", "(", "self", ",", "conn", ",", "method", ",", "url", ",", "timeout", "=", "_Default", ",", "chunked", "=", "False", ",", "*", "*", "httplib_request_kw", ")", ":", "self", ".", "num_requests", "+=", "1", "timeout_obj", "=", "self",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/connectionpool.py#L713-L947
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py
python
FieldDescriptor.__init__
(self, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options=None, has_default_value=True)
The arguments are as described in the description of FieldDescriptor attributes above. Note that containing_type may be None, and may be set later if necessary (to deal with circular references between message types, for example). Likewise for extension_scope.
The arguments are as described in the description of FieldDescriptor attributes above.
[ "The", "arguments", "are", "as", "described", "in", "the", "description", "of", "FieldDescriptor", "attributes", "above", "." ]
def __init__(self, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options=None, has_default_value=True): """The arguments are as described in the description of FieldDescripto...
[ "def", "__init__", "(", "self", ",", "name", ",", "full_name", ",", "index", ",", "number", ",", "type", ",", "cpp_type", ",", "label", ",", "default_value", ",", "message_type", ",", "enum_type", ",", "containing_type", ",", "is_extension", ",", "extension_...
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py#L373-L398
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/js/src/builtin/make_intl_data.py
python
writeLanguageTagData
(intlData, fileDate, url, langTagMappings, langSubtagMappings, extlangMappings)
Writes the language tag data to the Intl data file.
Writes the language tag data to the Intl data file.
[ "Writes", "the", "language", "tag", "data", "to", "the", "Intl", "data", "file", "." ]
def writeLanguageTagData(intlData, fileDate, url, langTagMappings, langSubtagMappings, extlangMappings): """ Writes the language tag data to the Intl data file. """ writeMappingsVar(intlData, langTagMappings, "langTagMappings", "Mappings from complete tags to preferred values", fileDate, ur...
[ "def", "writeLanguageTagData", "(", "intlData", ",", "fileDate", ",", "url", ",", "langTagMappings", ",", "langSubtagMappings", ",", "extlangMappings", ")", ":", "writeMappingsVar", "(", "intlData", ",", "langTagMappings", ",", "\"langTagMappings\"", ",", "\"Mappings ...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/js/src/builtin/make_intl_data.py#L159-L166
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
com/win32com/demos/excelRTDServer.py
python
ExcelRTDServer.CreateTopic
(self, TopicStrings=None)
Topic factory method. Subclass must override. Topic objects need to provide: * GetValue() method which returns an atomic value. Will raise NotImplemented if not overridden.
Topic factory method. Subclass must override.
[ "Topic", "factory", "method", ".", "Subclass", "must", "override", "." ]
def CreateTopic(self, TopicStrings=None): """Topic factory method. Subclass must override. Topic objects need to provide: * GetValue() method which returns an atomic value. Will raise NotImplemented if not overridden. """ raise NotImplemented("Subclass must implement"...
[ "def", "CreateTopic", "(", "self", ",", "TopicStrings", "=", "None", ")", ":", "raise", "NotImplemented", "(", "\"Subclass must implement\"", ")" ]
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32com/demos/excelRTDServer.py#L231-L239
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
configs/common/MemConfig.py
python
create_mem_intf
(intf, r, i, intlv_bits, intlv_size, xor_low_bit)
return interface
Helper function for creating a single memoy controller from the given options. This function is invoked multiple times in config_mem function to create an array of controllers.
Helper function for creating a single memoy controller from the given options. This function is invoked multiple times in config_mem function to create an array of controllers.
[ "Helper", "function", "for", "creating", "a", "single", "memoy", "controller", "from", "the", "given", "options", ".", "This", "function", "is", "invoked", "multiple", "times", "in", "config_mem", "function", "to", "create", "an", "array", "of", "controllers", ...
def create_mem_intf(intf, r, i, intlv_bits, intlv_size, xor_low_bit): """ Helper function for creating a single memoy controller from the given options. This function is invoked multiple times in config_mem function to create an array of controllers. """ import math int...
[ "def", "create_mem_intf", "(", "intf", ",", "r", ",", "i", ",", "intlv_bits", ",", "intlv_size", ",", "xor_low_bit", ")", ":", "import", "math", "intlv_low_bit", "=", "int", "(", "math", ".", "log", "(", "intlv_size", ",", "2", ")", ")", "# Use basic has...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/configs/common/MemConfig.py#L40-L103
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/eclib/outbuff.py
python
OutputBuffer.Clear
(self)
Clear the Buffer
Clear the Buffer
[ "Clear", "the", "Buffer" ]
def Clear(self): """Clear the Buffer""" self.SetReadOnly(False) self.ClearAll() self.EmptyUndoBuffer() self.SetReadOnly(True)
[ "def", "Clear", "(", "self", ")", ":", "self", ".", "SetReadOnly", "(", "False", ")", "self", ".", "ClearAll", "(", ")", "self", ".", "EmptyUndoBuffer", "(", ")", "self", ".", "SetReadOnly", "(", "True", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/outbuff.py#L366-L371
arx/ArxLibertatis
0313c51625f3f55016cdad43d2c7f7296d27949c
scripts/cpplint.py
python
CheckCStyleCast
(filename, linenum, line, raw_line, cast_type, pattern, error)
return True
Checks for a C-style cast by looking for the pattern. This also handles sizeof(type) warnings, due to similarity of content. Args: filename: The name of the current file. linenum: The number of the line to check. line: The line of code to check. raw_line: The raw line of code to check, with commen...
Checks for a C-style cast by looking for the pattern.
[ "Checks", "for", "a", "C", "-", "style", "cast", "by", "looking", "for", "the", "pattern", "." ]
def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern, error): """Checks for a C-style cast by looking for the pattern. This also handles sizeof(type) warnings, due to similarity of content. Args: filename: The name of the current file. linenum: The number of the ...
[ "def", "CheckCStyleCast", "(", "filename", ",", "linenum", ",", "line", ",", "raw_line", ",", "cast_type", ",", "pattern", ",", "error", ")", ":", "match", "=", "Search", "(", "pattern", ",", "line", ")", "if", "not", "match", ":", "return", "False", "...
https://github.com/arx/ArxLibertatis/blob/0313c51625f3f55016cdad43d2c7f7296d27949c/scripts/cpplint.py#L3006-L3068
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/ply/example/yply/yparse.py
python
p_defsection
(p)
defsection : definitions SECTION | SECTION
defsection : definitions SECTION | SECTION
[ "defsection", ":", "definitions", "SECTION", "|", "SECTION" ]
def p_defsection(p): '''defsection : definitions SECTION | SECTION''' p.lexer.lastsection = 1 print "tokens = ", repr(tokenlist) print print "precedence = ", repr(preclist) print print "# -------------- RULES ----------------" print
[ "def", "p_defsection", "(", "p", ")", ":", "p", ".", "lexer", ".", "lastsection", "=", "1", "print", "\"tokens = \"", ",", "repr", "(", "tokenlist", ")", "print", "print", "\"precedence = \"", ",", "repr", "(", "preclist", ")", "print", "print", "\"# -----...
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/yply/yparse.py#L19-L28
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/customtreectrl.py
python
CustomTreeCtrl.PaintItem
(self, item, dc, level, align)
Actually draws an item. :param `item`: an instance of :class:`GenericTreeItem`; :param `dc`: an instance of :class:`DC`; :param integer `level`: the item level in the tree hierarchy; :param integer `align`: an integer specifying the alignment type: =============== ============...
Actually draws an item.
[ "Actually", "draws", "an", "item", "." ]
def PaintItem(self, item, dc, level, align): """ Actually draws an item. :param `item`: an instance of :class:`GenericTreeItem`; :param `dc`: an instance of :class:`DC`; :param integer `level`: the item level in the tree hierarchy; :param integer `align`: an integer spec...
[ "def", "PaintItem", "(", "self", ",", "item", ",", "dc", ",", "level", ",", "align", ")", ":", "attr", "=", "item", ".", "GetAttributes", "(", ")", "if", "attr", "and", "attr", ".", "HasFont", "(", ")", ":", "dc", ".", "SetFont", "(", "attr", "."...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L6467-L6753
maidsafe-archive/MaidSafe
defd65e1c8cfb6a1cbdeaaa0eee31d065421792d
src/third_party_libs/googlemock/scripts/generator/cpp/utils.py
python
ReadFile
(filename, print_error=True)
Returns the contents of a file.
Returns the contents of a file.
[ "Returns", "the", "contents", "of", "a", "file", "." ]
def ReadFile(filename, print_error=True): """Returns the contents of a file.""" try: fp = open(filename) try: return fp.read() finally: fp.close() except IOError: if print_error: print('Error reading %s: %s' % (filename, sys.exc_info()[1]))...
[ "def", "ReadFile", "(", "filename", ",", "print_error", "=", "True", ")", ":", "try", ":", "fp", "=", "open", "(", "filename", ")", "try", ":", "return", "fp", ".", "read", "(", ")", "finally", ":", "fp", ".", "close", "(", ")", "except", "IOError"...
https://github.com/maidsafe-archive/MaidSafe/blob/defd65e1c8cfb6a1cbdeaaa0eee31d065421792d/src/third_party_libs/googlemock/scripts/generator/cpp/utils.py#L30-L41
CanalTP/navitia
cb84ce9859070187e708818b058e6a7e0b7f891b
source/tyr/tyr/resources.py
python
check_cities_job
()
return ( models.Job.query.join(models.DataSet) .filter(models.DataSet.type == 'cities') .order_by(models.Job.created_at.desc()) .first() )
Check status of cities job in Tyr db :return: the latest cities job
Check status of cities job in Tyr db :return: the latest cities job
[ "Check", "status", "of", "cities", "job", "in", "Tyr", "db", ":", "return", ":", "the", "latest", "cities", "job" ]
def check_cities_job(): """ Check status of cities job in Tyr db :return: the latest cities job """ return ( models.Job.query.join(models.DataSet) .filter(models.DataSet.type == 'cities') .order_by(models.Job.created_at.desc()) .first() )
[ "def", "check_cities_job", "(", ")", ":", "return", "(", "models", ".", "Job", ".", "query", ".", "join", "(", "models", ".", "DataSet", ")", ".", "filter", "(", "models", ".", "DataSet", ".", "type", "==", "'cities'", ")", ".", "order_by", "(", "mod...
https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/tyr/tyr/resources.py#L2304-L2314
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/csv.py
python
Sniffer._guess_quote_and_delimiter
(self, data, delimiters)
return (quotechar, doublequote, delim, skipinitialspace)
Looks for text enclosed between two identical quotes (the probable quotechar) which are preceded and followed by the same character (the probable delimiter). For example: ,'some text', The quote with the most wins, same with the delimiter. If there is no ...
Looks for text enclosed between two identical quotes (the probable quotechar) which are preceded and followed by the same character (the probable delimiter). For example: ,'some text', The quote with the most wins, same with the delimiter. If there is no ...
[ "Looks", "for", "text", "enclosed", "between", "two", "identical", "quotes", "(", "the", "probable", "quotechar", ")", "which", "are", "preceded", "and", "followed", "by", "the", "same", "character", "(", "the", "probable", "delimiter", ")", ".", "For", "exa...
def _guess_quote_and_delimiter(self, data, delimiters): """ Looks for text enclosed between two identical quotes (the probable quotechar) which are preceded and followed by the same character (the probable delimiter). For example: ,'some text', Th...
[ "def", "_guess_quote_and_delimiter", "(", "self", ",", "data", ",", "delimiters", ")", ":", "matches", "=", "[", "]", "for", "restr", "in", "(", "r'(?P<delim>[^\\w\\n\"\\'])(?P<space> ?)(?P<quote>[\"\\']).*?(?P=quote)(?P=delim)'", ",", "# ,\".*?\",", "r'(?:^|\\n)(?P<quote>[...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/csv.py#L204-L277
tkn-tub/ns3-gym
19bfe0a583e641142609939a090a09dfc63a095f
src/flow-monitor/examples/flowmon-parse-results.py
python
FiveTuple.__init__
(self, el)
The initializer. @param self The object pointer. @param el The element.
The initializer.
[ "The", "initializer", "." ]
def __init__(self, el): '''The initializer. @param self The object pointer. @param el The element. ''' self.sourceAddress = el.get('sourceAddress') self.destinationAddress = el.get('destinationAddress') self.sourcePort = int(el.get('sourcePort')) self.dest...
[ "def", "__init__", "(", "self", ",", "el", ")", ":", "self", ".", "sourceAddress", "=", "el", ".", "get", "(", "'sourceAddress'", ")", "self", ".", "destinationAddress", "=", "el", ".", "get", "(", "'destinationAddress'", ")", "self", ".", "sourcePort", ...
https://github.com/tkn-tub/ns3-gym/blob/19bfe0a583e641142609939a090a09dfc63a095f/src/flow-monitor/examples/flowmon-parse-results.py#L32-L41
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/layers/python/ops/sparse_ops.py
python
indicators_to_sparse_ids
(indicators, ignore_value=None, dtype=dtypes.int64)
Convert a dense indicator tensor to sparse IDs. This is commonly used for converting a dense classification label to sparse. In the following example, we have an input of shape (2, 2, num_classes), where num_classes=4. ```python indicators = [ [ [0, 0, 1, 0], [0, 0, 0, 0] ], [ [1, ...
Convert a dense indicator tensor to sparse IDs.
[ "Convert", "a", "dense", "indicator", "tensor", "to", "sparse", "IDs", "." ]
def indicators_to_sparse_ids(indicators, ignore_value=None, dtype=dtypes.int64): """Convert a dense indicator tensor to sparse IDs. This is commonly used for converting a dense classification label to sparse. In the following example, we have an input of shape (2, 2, num_classes), where num_classes=4. ```py...
[ "def", "indicators_to_sparse_ids", "(", "indicators", ",", "ignore_value", "=", "None", ",", "dtype", "=", "dtypes", ".", "int64", ")", ":", "if", "not", "dtype", ".", "is_integer", ":", "raise", "ValueError", "(", "\"Invalid dtype {} not integer.\"", ".", "form...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/layers/python/ops/sparse_ops.py#L82-L187
mysql/mysql-workbench
2f35f9034f015cbcd22139a60e1baa2e3e8e795c
modules/db.generic/db_generic_re_grt.py
python
GenericReverseEngineering.connect
(cls, connection, password)
return 1
Establishes a connection to the server and stores the connection object in the connections pool. It first looks for a connection with the given connection parameters in the connections pool to reuse existent connections. If such a connection is found, it queries the server to ensure that the co...
Establishes a connection to the server and stores the connection object in the connections pool.
[ "Establishes", "a", "connection", "to", "the", "server", "and", "stores", "the", "connection", "object", "in", "the", "connections", "pool", "." ]
def connect(cls, connection, password): '''Establishes a connection to the server and stores the connection object in the connections pool. It first looks for a connection with the given connection parameters in the connections pool to reuse existent connections. If such a connection is found, ...
[ "def", "connect", "(", "cls", ",", "connection", ",", "password", ")", ":", "try", ":", "con", "=", "cls", ".", "get_connection", "(", "connection", ")", "try", ":", "if", "not", "con", ".", "cursor", "(", ")", ".", "execute", "(", "'SELECT 1'", ")",...
https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/modules/db.generic/db_generic_re_grt.py#L123-L153
GoSSIP-SJTU/Armariris
ad5d868482956b2194a77b39c8d543c7c2318200
tools/clang/bindings/python/clang/cindex.py
python
SourceLocation.column
(self)
return self._get_instantiation()[2]
Get the column represented by this source location.
Get the column represented by this source location.
[ "Get", "the", "column", "represented", "by", "this", "source", "location", "." ]
def column(self): """Get the column represented by this source location.""" return self._get_instantiation()[2]
[ "def", "column", "(", "self", ")", ":", "return", "self", ".", "_get_instantiation", "(", ")", "[", "2", "]" ]
https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/tools/clang/bindings/python/clang/cindex.py#L208-L210
pisa-engine/pisa
0efb7926d4928c8aae672ba4d7a1419891f2676d
script/ext/baker.py
python
Baker.parse_args
(self, scriptname, cmd, argv, test=False)
return vargs, kwargs
Parse arguments from argv. :param scriptname: The script filename. :param cmd: The command which is being called. :param argv: The argument list. :param test: If True prints to stdout.
Parse arguments from argv.
[ "Parse", "arguments", "from", "argv", "." ]
def parse_args(self, scriptname, cmd, argv, test=False): """ Parse arguments from argv. :param scriptname: The script filename. :param cmd: The command which is being called. :param argv: The argument list. :param test: If True prints to stdout. """ keywo...
[ "def", "parse_args", "(", "self", ",", "scriptname", ",", "cmd", ",", "argv", ",", "test", "=", "False", ")", ":", "keywords", "=", "cmd", ".", "keywords", "shortopts", "=", "cmd", ".", "shortopts", "def", "type_error", "(", "name", ",", "value", ",", ...
https://github.com/pisa-engine/pisa/blob/0efb7926d4928c8aae672ba4d7a1419891f2676d/script/ext/baker.py#L592-L732
ablab/quast
5f6709528129a6ad266a6b24ef3f40b88f0fe04b
quast_libs/site_packages/joblib3/logger.py
python
PrintTime.__call__
(self, msg='', total=False)
Print the time elapsed between the last call and the current call, with an optional message.
Print the time elapsed between the last call and the current call, with an optional message.
[ "Print", "the", "time", "elapsed", "between", "the", "last", "call", "and", "the", "current", "call", "with", "an", "optional", "message", "." ]
def __call__(self, msg='', total=False): """ Print the time elapsed between the last call and the current call, with an optional message. """ if not total: time_lapse = time.time() - self.last_time full_msg = "%s: %s" % (msg, format_time(time_lapse)) e...
[ "def", "__call__", "(", "self", ",", "msg", "=", "''", ",", "total", "=", "False", ")", ":", "if", "not", "total", ":", "time_lapse", "=", "time", ".", "time", "(", ")", "-", "self", ".", "last_time", "full_msg", "=", "\"%s: %s\"", "%", "(", "msg",...
https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/site_packages/joblib3/logger.py#L133-L157
carla-simulator/carla
8854804f4d7748e14d937ec763a2912823a7e5f5
PythonAPI/carla/agents/navigation/behavior_agent.py
python
BehaviorAgent.run_step
(self, debug=False)
return control
Execute one step of navigation. :param debug: boolean for debugging :return control: carla.VehicleControl
Execute one step of navigation.
[ "Execute", "one", "step", "of", "navigation", "." ]
def run_step(self, debug=False): """ Execute one step of navigation. :param debug: boolean for debugging :return control: carla.VehicleControl """ self._update_information() control = None if self._behavior.tailgate_counter > 0: self....
[ "def", "run_step", "(", "self", ",", "debug", "=", "False", ")", ":", "self", ".", "_update_information", "(", ")", "control", "=", "None", "if", "self", ".", "_behavior", ".", "tailgate_counter", ">", "0", ":", "self", ".", "_behavior", ".", "tailgate_c...
https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/carla/agents/navigation/behavior_agent.py#L240-L306
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/pymock/mock.py
python
NonCallableMagicMock.mock_add_spec
(self, spec, spec_set=False)
Add a spec to a mock. `spec` can either be an object or a list of strings. Only attributes on the `spec` can be fetched as attributes from the mock. If `spec_set` is True then only attributes on the spec can be set.
Add a spec to a mock. `spec` can either be an object or a list of strings. Only attributes on the `spec` can be fetched as attributes from the mock.
[ "Add", "a", "spec", "to", "a", "mock", ".", "spec", "can", "either", "be", "an", "object", "or", "a", "list", "of", "strings", ".", "Only", "attributes", "on", "the", "spec", "can", "be", "fetched", "as", "attributes", "from", "the", "mock", "." ]
def mock_add_spec(self, spec, spec_set=False): """Add a spec to a mock. `spec` can either be an object or a list of strings. Only attributes on the `spec` can be fetched as attributes from the mock. If `spec_set` is True then only attributes on the spec can be set.""" self._mock...
[ "def", "mock_add_spec", "(", "self", ",", "spec", ",", "spec_set", "=", "False", ")", ":", "self", ".", "_mock_add_spec", "(", "spec", ",", "spec_set", ")", "self", ".", "_mock_set_magics", "(", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/pymock/mock.py#L1879-L1886
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/bz2.py
python
BZ2File.writelines
(self, seq)
Write a sequence of byte strings to the file. Returns the number of uncompressed bytes written. seq can be any iterable yielding byte strings. Line separators are not added between the written byte strings.
Write a sequence of byte strings to the file.
[ "Write", "a", "sequence", "of", "byte", "strings", "to", "the", "file", "." ]
def writelines(self, seq): """Write a sequence of byte strings to the file. Returns the number of uncompressed bytes written. seq can be any iterable yielding byte strings. Line separators are not added between the written byte strings. """ with self._lock: ...
[ "def", "writelines", "(", "self", ",", "seq", ")", ":", "with", "self", ".", "_lock", ":", "return", "_compression", ".", "BaseStream", ".", "writelines", "(", "self", ",", "seq", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/bz2.py#L246-L255
tfwu/FaceDetection-ConvNet-3D
f9251c48eb40c5aec8fba7455115c355466555be
python/build/lib.linux-x86_64-2.7/mxnet/symbol.py
python
maximum
(left, right)
maximum left and right Parameters --------- left: Symbol or Number right: Symbol or Number Returns ------- result: Symbol or Number
maximum left and right
[ "maximum", "left", "and", "right" ]
def maximum(left, right): """ maximum left and right Parameters --------- left: Symbol or Number right: Symbol or Number Returns ------- result: Symbol or Number """ if isinstance(left, Symbol) and isinstance(right, Symbol): return Symbol._Maximum(left, right) if i...
[ "def", "maximum", "(", "left", ",", "right", ")", ":", "if", "isinstance", "(", "left", ",", "Symbol", ")", "and", "isinstance", "(", "right", ",", "Symbol", ")", ":", "return", "Symbol", ".", "_Maximum", "(", "left", ",", "right", ")", "if", "isinst...
https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/symbol.py#L1059-L1080
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/boost_1_66_0/tools/build/src/build/feature.py
python
get_values
(feature, properties)
return result
Returns all values of the given feature specified by the given property set.
Returns all values of the given feature specified by the given property set.
[ "Returns", "all", "values", "of", "the", "given", "feature", "specified", "by", "the", "given", "property", "set", "." ]
def get_values (feature, properties): """ Returns all values of the given feature specified by the given property set. """ if feature[0] != '<': feature = '<' + feature + '>' result = [] for p in properties: if get_grist (p) == feature: result.append (replace_grist (p, '')) ...
[ "def", "get_values", "(", "feature", ",", "properties", ")", ":", "if", "feature", "[", "0", "]", "!=", "'<'", ":", "feature", "=", "'<'", "+", "feature", "+", "'>'", "result", "=", "[", "]", "for", "p", "in", "properties", ":", "if", "get_grist", ...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/tools/build/src/build/feature.py#L552-L562
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Cipher/_mode_eax.py
python
EaxMode.__init__
(self, factory, key, nonce, mac_len, cipher_params)
EAX cipher mode
EAX cipher mode
[ "EAX", "cipher", "mode" ]
def __init__(self, factory, key, nonce, mac_len, cipher_params): """EAX cipher mode""" self.block_size = factory.block_size """The block size of the underlying cipher, in bytes.""" self.nonce = _copy_bytes(None, None, nonce) """The nonce originally used to create the object."""...
[ "def", "__init__", "(", "self", ",", "factory", ",", "key", ",", "nonce", ",", "mac_len", ",", "cipher_params", ")", ":", "self", ".", "block_size", "=", "factory", ".", "block_size", "\"\"\"The block size of the underlying cipher, in bytes.\"\"\"", "self", ".", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Cipher/_mode_eax.py#L80-L125
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Tools/fc_scan.py
python
fortran_parser.find_deps
(self, node)
return (incs, uses, mods)
Parse a fortran file to read the dependencies used and provided :param node: fortran file to read :type node: :py:class:`waflib.Node.Node` :return: lists representing the includes, the modules used, and the modules created by a fortran file :rtype: tuple of list of strings
Parse a fortran file to read the dependencies used and provided
[ "Parse", "a", "fortran", "file", "to", "read", "the", "dependencies", "used", "and", "provided" ]
def find_deps(self, node): """ Parse a fortran file to read the dependencies used and provided :param node: fortran file to read :type node: :py:class:`waflib.Node.Node` :return: lists representing the includes, the modules used, and the modules created by a fortran file :rtype: tuple of list of strings ...
[ "def", "find_deps", "(", "self", ",", "node", ")", ":", "txt", "=", "node", ".", "read", "(", ")", "incs", "=", "[", "]", "uses", "=", "[", "]", "mods", "=", "[", "]", "for", "line", "in", "txt", ".", "splitlines", "(", ")", ":", "# line by lin...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/fc_scan.py#L42-L66
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py
python
get_build_platform
()
return plat
Return this platform's string for platform-specific distributions XXX Currently this is the same as ``distutils.util.get_platform()``, but it needs some hacks for Linux and Mac OS X.
Return this platform's string for platform-specific distributions
[ "Return", "this", "platform", "s", "string", "for", "platform", "-", "specific", "distributions" ]
def get_build_platform(): """Return this platform's string for platform-specific distributions XXX Currently this is the same as ``distutils.util.get_platform()``, but it needs some hacks for Linux and Mac OS X. """ from sysconfig import get_platform plat = get_platform() if sys.platform =...
[ "def", "get_build_platform", "(", ")", ":", "from", "sysconfig", "import", "get_platform", "plat", "=", "get_platform", "(", ")", "if", "sys", ".", "platform", "==", "\"darwin\"", "and", "not", "plat", ".", "startswith", "(", "'macosx-'", ")", ":", "try", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py#L387-L408
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/easy_install.py
python
is_python
(text, filename='<string>')
Is this string a valid Python script?
Is this string a valid Python script?
[ "Is", "this", "string", "a", "valid", "Python", "script?" ]
def is_python(text, filename='<string>'): "Is this string a valid Python script?" try: compile(text, filename, 'exec') except (SyntaxError, TypeError): return False else: return True
[ "def", "is_python", "(", "text", ",", "filename", "=", "'<string>'", ")", ":", "try", ":", "compile", "(", "text", ",", "filename", ",", "'exec'", ")", "except", "(", "SyntaxError", ",", "TypeError", ")", ":", "return", "False", "else", ":", "return", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/easy_install.py#L1921-L1928
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/socket.py
python
SocketIO.seekable
(self)
return super().seekable()
True if the SocketIO is open for seeking.
True if the SocketIO is open for seeking.
[ "True", "if", "the", "SocketIO", "is", "open", "for", "seeking", "." ]
def seekable(self): """True if the SocketIO is open for seeking. """ if self.closed: raise ValueError("I/O operation on closed socket.") return super().seekable()
[ "def", "seekable", "(", "self", ")", ":", "if", "self", ".", "closed", ":", "raise", "ValueError", "(", "\"I/O operation on closed socket.\"", ")", "return", "super", "(", ")", ".", "seekable", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/socket.py#L628-L633
alibaba/MNN
c4d9566171d589c3ded23aa18ffb197016995a12
pymnn/pip_package/MNN/expr/__init__.py
python
cast
(x, dtype=_F.float)
return _F.cast(x, dtype)
cast(x, dtype=float) Return the dtype of x. Parameters ---------- x : var_like, input value. dtype : dtype. Default is float. Returns ------- z : Var. The dtype of `x`. Example: ------- >>> expr.cast([[0,1],[0,3]], float) var([[0., 1.], [0., 3.]], dtype=float3...
cast(x, dtype=float) Return the dtype of x.
[ "cast", "(", "x", "dtype", "=", "float", ")", "Return", "the", "dtype", "of", "x", "." ]
def cast(x, dtype=_F.float): ''' cast(x, dtype=float) Return the dtype of x. Parameters ---------- x : var_like, input value. dtype : dtype. Default is float. Returns ------- z : Var. The dtype of `x`. Example: ------- >>> expr.cast([[0,1],[0,3]], float) var([[...
[ "def", "cast", "(", "x", ",", "dtype", "=", "_F", ".", "float", ")", ":", "x", "=", "_to_var", "(", "x", ")", "return", "_F", ".", "cast", "(", "x", ",", "dtype", ")" ]
https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L1438-L1459
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/training/basic_session_run_hooks.py
python
FinalOpsHook.__init__
(self, final_ops, final_ops_feed_dict=None)
Initializes `FinalOpHook` with ops to run at the end of the session. Args: final_ops: A single `Tensor`, a list of `Tensors` or a dictionary of names to `Tensors`. final_ops_feed_dict: A feed dictionary to use when running `final_ops_dict`.
Initializes `FinalOpHook` with ops to run at the end of the session.
[ "Initializes", "FinalOpHook", "with", "ops", "to", "run", "at", "the", "end", "of", "the", "session", "." ]
def __init__(self, final_ops, final_ops_feed_dict=None): """Initializes `FinalOpHook` with ops to run at the end of the session. Args: final_ops: A single `Tensor`, a list of `Tensors` or a dictionary of names to `Tensors`. final_ops_feed_dict: A feed dictionary to use when running ...
[ "def", "__init__", "(", "self", ",", "final_ops", ",", "final_ops_feed_dict", "=", "None", ")", ":", "self", ".", "_final_ops", "=", "final_ops", "self", ".", "_final_ops_feed_dict", "=", "final_ops_feed_dict", "self", ".", "_final_ops_values", "=", "None" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/basic_session_run_hooks.py#L744-L755
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/idl/idl/parser.py
python
_parse_imports
(ctxt, spec, node)
Parse an imports section in the IDL file.
Parse an imports section in the IDL file.
[ "Parse", "an", "imports", "section", "in", "the", "IDL", "file", "." ]
def _parse_imports(ctxt, spec, node): # type: (errors.ParserContext, syntax.IDLSpec, Union[yaml.nodes.MappingNode, yaml.nodes.ScalarNode, yaml.nodes.SequenceNode]) -> None """Parse an imports section in the IDL file.""" if not ctxt.is_scalar_sequence(node, "imports"): return imports = syntax.Im...
[ "def", "_parse_imports", "(", "ctxt", ",", "spec", ",", "node", ")", ":", "# type: (errors.ParserContext, syntax.IDLSpec, Union[yaml.nodes.MappingNode, yaml.nodes.ScalarNode, yaml.nodes.SequenceNode]) -> None", "if", "not", "ctxt", ".", "is_scalar_sequence", "(", "node", ",", "...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/parser.py#L153-L161
Qihoo360/mongosync
55b647e81c072ebe91daaa3b9dc1a953c3c22e19
dep/mongo-cxx-driver/site_scons/buildscripts/cpplint.py
python
Search
(pattern, s)
return _regexp_compile_cache[pattern].search(s)
Searches the string for the pattern, caching the compiled regexp.
Searches the string for the pattern, caching the compiled regexp.
[ "Searches", "the", "string", "for", "the", "pattern", "caching", "the", "compiled", "regexp", "." ]
def Search(pattern, s): """Searches the string for the pattern, caching the compiled regexp.""" if not pattern in _regexp_compile_cache: _regexp_compile_cache[pattern] = sre_compile.compile(pattern) return _regexp_compile_cache[pattern].search(s)
[ "def", "Search", "(", "pattern", ",", "s", ")", ":", "if", "not", "pattern", "in", "_regexp_compile_cache", ":", "_regexp_compile_cache", "[", "pattern", "]", "=", "sre_compile", ".", "compile", "(", "pattern", ")", "return", "_regexp_compile_cache", "[", "pat...
https://github.com/Qihoo360/mongosync/blob/55b647e81c072ebe91daaa3b9dc1a953c3c22e19/dep/mongo-cxx-driver/site_scons/buildscripts/cpplint.py#L359-L363
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/pyclbr.py
python
readmodule
(module, path=None)
return res
Return Class objects for the top-level classes in module. This is the original interface, before Functions were added.
Return Class objects for the top-level classes in module.
[ "Return", "Class", "objects", "for", "the", "top", "-", "level", "classes", "in", "module", "." ]
def readmodule(module, path=None): """Return Class objects for the top-level classes in module. This is the original interface, before Functions were added. """ res = {} for key, value in _readmodule(module, path or []).items(): if isinstance(value, Class): res[key] = value ...
[ "def", "readmodule", "(", "module", ",", "path", "=", "None", ")", ":", "res", "=", "{", "}", "for", "key", ",", "value", "in", "_readmodule", "(", "module", ",", "path", "or", "[", "]", ")", ".", "items", "(", ")", ":", "if", "isinstance", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pyclbr.py#L97-L107
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/internal/tensor_encoding/core/gather_encoder.py
python
GatherEncoder.update_state
(self, state, state_update_tensors, name=None)
Updates the state of the `GatherEncoder`. Args: state: The (optional) current state. A tuple, matching the structure returned by the `initial_state` method. state_update_tensors: A tuple of `Tensor` values returned by the `encode` method, aggregated according to modes provided by the ...
Updates the state of the `GatherEncoder`.
[ "Updates", "the", "state", "of", "the", "GatherEncoder", "." ]
def update_state(self, state, state_update_tensors, name=None): """Updates the state of the `GatherEncoder`. Args: state: The (optional) current state. A tuple, matching the structure returned by the `initial_state` method. state_update_tensors: A tuple of `Tensor` values returned by the `e...
[ "def", "update_state", "(", "self", ",", "state", ",", "state_update_tensors", ",", "name", "=", "None", ")", ":", "values", "=", "list", "(", "state", ")", "+", "list", "(", "state_update_tensors", ")", "with", "tf", ".", "compat", ".", "v1", ".", "na...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/internal/tensor_encoding/core/gather_encoder.py#L530-L557
stellar-deprecated/stellard
67eabb2217bdfa9a6ea317f62338fb6bca458c90
src/protobuf/python/google/protobuf/message.py
python
Message.Clear
(self)
Clears all data that was set in the message.
Clears all data that was set in the message.
[ "Clears", "all", "data", "that", "was", "set", "in", "the", "message", "." ]
def Clear(self): """Clears all data that was set in the message.""" raise NotImplementedError
[ "def", "Clear", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/message.py#L121-L123
ablab/quast
5f6709528129a6ad266a6b24ef3f40b88f0fe04b
quast_libs/site_packages/bz2.py
python
BZ2File.readable
(self)
return self._mode == _MODE_READ
Return whether the file was opened for reading.
Return whether the file was opened for reading.
[ "Return", "whether", "the", "file", "was", "opened", "for", "reading", "." ]
def readable(self): """Return whether the file was opened for reading.""" self._check_not_closed() return self._mode == _MODE_READ
[ "def", "readable", "(", "self", ")", ":", "self", ".", "_check_not_closed", "(", ")", "return", "self", ".", "_mode", "==", "_MODE_READ" ]
https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/site_packages/bz2.py#L154-L157
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/fileinput.py
python
filename
()
return _state.filename()
Return the name of the file currently being read. Before the first line has been read, returns None.
Return the name of the file currently being read. Before the first line has been read, returns None.
[ "Return", "the", "name", "of", "the", "file", "currently", "being", "read", ".", "Before", "the", "first", "line", "has", "been", "read", "returns", "None", "." ]
def filename(): """ Return the name of the file currently being read. Before the first line has been read, returns None. """ if not _state: raise RuntimeError("no active input()") return _state.filename()
[ "def", "filename", "(", ")", ":", "if", "not", "_state", ":", "raise", "RuntimeError", "(", "\"no active input()\"", ")", "return", "_state", ".", "filename", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/fileinput.py#L119-L126
rrwick/Unicycler
96ffea71e3a78d63ade19d6124946773e65cf129
unicycler/alignment.py
python
Alignment.get_read_to_ref_ratio
(self)
return 1.0 / self.get_ref_to_read_ratio()
Returns the length ratio between the aligned parts of the read and reference.
Returns the length ratio between the aligned parts of the read and reference.
[ "Returns", "the", "length", "ratio", "between", "the", "aligned", "parts", "of", "the", "read", "and", "reference", "." ]
def get_read_to_ref_ratio(self): """ Returns the length ratio between the aligned parts of the read and reference. """ return 1.0 / self.get_ref_to_read_ratio()
[ "def", "get_read_to_ref_ratio", "(", "self", ")", ":", "return", "1.0", "/", "self", ".", "get_ref_to_read_ratio", "(", ")" ]
https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/alignment.py#L254-L258
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/pyclbr.py
python
_getname
(g)
return (".".join(parts), token)
Return (dotted-name or None, next-token) tuple for token source g.
Return (dotted-name or None, next-token) tuple for token source g.
[ "Return", "(", "dotted", "-", "name", "or", "None", "next", "-", "token", ")", "tuple", "for", "token", "source", "g", "." ]
def _getname(g): "Return (dotted-name or None, next-token) tuple for token source g." parts = [] tokentype, token = next(g)[0:2] if tokentype != NAME and token != '*': return (None, token) parts.append(token) while True: tokentype, token = next(g)[0:2] if token != '.': ...
[ "def", "_getname", "(", "g", ")", ":", "parts", "=", "[", "]", "tokentype", ",", "token", "=", "next", "(", "g", ")", "[", "0", ":", "2", "]", "if", "tokentype", "!=", "NAME", "and", "token", "!=", "'*'", ":", "return", "(", "None", ",", "token...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pyclbr.py#L344-L359
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/all_reduce.py
python
build_shuffle_then_shuffle
(input_tensors, first_gather_devices, second_gather_devices, red_op, un_op=None)
return _build_shuffle_hybrid( input_tensors, first_gather_devices, red_op, upper_level_f)
Construct hybrid of Shuffle within workers, Shuffle across workers.
Construct hybrid of Shuffle within workers, Shuffle across workers.
[ "Construct", "hybrid", "of", "Shuffle", "within", "workers", "Shuffle", "across", "workers", "." ]
def build_shuffle_then_shuffle(input_tensors, first_gather_devices, second_gather_devices, red_op, un_op=None): """Construct hybrid of Shuffle within workers, Shuffle across workers.""" def upper_builder(tensors): return build_shuffle_all_reduce(tensors, second_gather_devices, ...
[ "def", "build_shuffle_then_shuffle", "(", "input_tensors", ",", "first_gather_devices", ",", "second_gather_devices", ",", "red_op", ",", "un_op", "=", "None", ")", ":", "def", "upper_builder", "(", "tensors", ")", ":", "return", "build_shuffle_all_reduce", "(", "te...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/all_reduce.py#L851-L860
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/cpu.py
python
CPUContext.get_env_body
(self, builder, envptr)
return EnvBody(self, builder, ref=body_ptr, cast_ref=True)
From the given *envptr* (a pointer to a _dynfunc.Environment object), get a EnvBody allowing structured access to environment fields.
From the given *envptr* (a pointer to a _dynfunc.Environment object), get a EnvBody allowing structured access to environment fields.
[ "From", "the", "given", "*", "envptr", "*", "(", "a", "pointer", "to", "a", "_dynfunc", ".", "Environment", "object", ")", "get", "a", "EnvBody", "allowing", "structured", "access", "to", "environment", "fields", "." ]
def get_env_body(self, builder, envptr): """ From the given *envptr* (a pointer to a _dynfunc.Environment object), get a EnvBody allowing structured access to environment fields. """ body_ptr = cgutils.pointer_add( builder, envptr, _dynfunc._impl_info['offsetof_env_bo...
[ "def", "get_env_body", "(", "self", ",", "builder", ",", "envptr", ")", ":", "body_ptr", "=", "cgutils", ".", "pointer_add", "(", "builder", ",", "envptr", ",", "_dynfunc", ".", "_impl_info", "[", "'offsetof_env_body'", "]", ")", "return", "EnvBody", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/cpu.py#L98-L105
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/pyserial/serial/serialutil.py
python
SerialBase.dsrdtr
(self, dsrdtr=None)
Change DsrDtr flow control setting.
Change DsrDtr flow control setting.
[ "Change", "DsrDtr", "flow", "control", "setting", "." ]
def dsrdtr(self, dsrdtr=None): """Change DsrDtr flow control setting.""" if dsrdtr is None: # if not set, keep backwards compatibility and follow rtscts setting self._dsrdtr = self._rtscts else: # if defined independently, follow its value self._ds...
[ "def", "dsrdtr", "(", "self", ",", "dsrdtr", "=", "None", ")", ":", "if", "dsrdtr", "is", "None", ":", "# if not set, keep backwards compatibility and follow rtscts setting", "self", ".", "_dsrdtr", "=", "self", ".", "_rtscts", "else", ":", "# if defined independent...
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/serialutil.py#L440-L449
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/prefilter.py
python
PythonOpsChecker.check
(self, line_info)
If the 'rest' of the line begins with a function call or pretty much any python operator, we should simply execute the line (regardless of whether or not there's a possible autocall expansion). This avoids spurious (and very confusing) geattr() accesses.
If the 'rest' of the line begins with a function call or pretty much any python operator, we should simply execute the line (regardless of whether or not there's a possible autocall expansion). This avoids spurious (and very confusing) geattr() accesses.
[ "If", "the", "rest", "of", "the", "line", "begins", "with", "a", "function", "call", "or", "pretty", "much", "any", "python", "operator", "we", "should", "simply", "execute", "the", "line", "(", "regardless", "of", "whether", "or", "not", "there", "s", "...
def check(self, line_info): """If the 'rest' of the line begins with a function call or pretty much any python operator, we should simply execute the line (regardless of whether or not there's a possible autocall expansion). This avoids spurious (and very confusing) geattr() accesses.""...
[ "def", "check", "(", "self", ",", "line_info", ")", ":", "if", "line_info", ".", "the_rest", "and", "line_info", ".", "the_rest", "[", "0", "]", "in", "'!=()<>,+*/%^&|'", ":", "return", "self", ".", "prefilter_manager", ".", "get_handler_by_name", "(", "'nor...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/prefilter.py#L482-L490
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/asinh.py
python
_asinh_tbe
()
return
Asinh TBE register
Asinh TBE register
[ "Asinh", "TBE", "register" ]
def _asinh_tbe(): """Asinh TBE register""" return
[ "def", "_asinh_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/asinh.py#L35-L37
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/resource_variable_ops.py
python
BaseResourceVariable.__init__
( # pylint: disable=super-init-not-called self, trainable=None, shape=None, dtype=None, handle=None, constraint=None, synchronization=None, aggregation=None, distribute_strategy=None, name=None, unique_id=None, handle_name=None, graph_elemen...
Creates a variable from a handle. Args: trainable: If `True`, GradientTapes automatically watch uses of this Variable. shape: The variable's shape. This shape can be set to tf.TensorShape(None) in order to assign values of different shapes to this variable. Otherwise (i.e. if th...
Creates a variable from a handle.
[ "Creates", "a", "variable", "from", "a", "handle", "." ]
def __init__( # pylint: disable=super-init-not-called self, trainable=None, shape=None, dtype=None, handle=None, constraint=None, synchronization=None, aggregation=None, distribute_strategy=None, name=None, unique_id=None, handle_name=None, ...
[ "def", "__init__", "(", "# pylint: disable=super-init-not-called", "self", ",", "trainable", "=", "None", ",", "shape", "=", "None", ",", "dtype", "=", "None", ",", "handle", "=", "None", ",", "constraint", "=", "None", ",", "synchronization", "=", "None", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/resource_variable_ops.py#L359-L471
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/run.py
python
main
(del_exitfunc=False)
Start the Python execution server in a subprocess In the Python subprocess, RPCServer is instantiated with handlerclass MyHandler, which inherits register/unregister methods from RPCHandler via the mix-in class SocketIO. When the RPCServer 'server' is instantiated, the TCPServer initialization cre...
Start the Python execution server in a subprocess
[ "Start", "the", "Python", "execution", "server", "in", "a", "subprocess" ]
def main(del_exitfunc=False): """Start the Python execution server in a subprocess In the Python subprocess, RPCServer is instantiated with handlerclass MyHandler, which inherits register/unregister methods from RPCHandler via the mix-in class SocketIO. When the RPCServer 'server' is instantiated,...
[ "def", "main", "(", "del_exitfunc", "=", "False", ")", ":", "global", "exit_now", "global", "quitting", "global", "no_exitfunc", "no_exitfunc", "=", "del_exitfunc", "#time.sleep(15) # test subprocess not responding", "try", ":", "assert", "(", "len", "(", "sys", "."...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/run.py#L52-L118
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/distutils/util.py
python
execute
(func, args, msg=None, verbose=0, dry_run=0)
Perform some action that affects the outside world (eg. by writing to the filesystem). Such actions are special because they are disabled by the 'dry_run' flag. This method takes care of all that bureaucracy for you; all you have to do is supply the function to call and an argument tuple for it (to e...
Perform some action that affects the outside world (eg. by writing to the filesystem). Such actions are special because they are disabled by the 'dry_run' flag. This method takes care of all that bureaucracy for you; all you have to do is supply the function to call and an argument tuple for it (to e...
[ "Perform", "some", "action", "that", "affects", "the", "outside", "world", "(", "eg", ".", "by", "writing", "to", "the", "filesystem", ")", ".", "Such", "actions", "are", "special", "because", "they", "are", "disabled", "by", "the", "dry_run", "flag", ".",...
def execute (func, args, msg=None, verbose=0, dry_run=0): """Perform some action that affects the outside world (eg. by writing to the filesystem). Such actions are special because they are disabled by the 'dry_run' flag. This method takes care of all that bureaucracy for you; all you have to do is s...
[ "def", "execute", "(", "func", ",", "args", ",", "msg", "=", "None", ",", "verbose", "=", "0", ",", "dry_run", "=", "0", ")", ":", "if", "msg", "is", "None", ":", "msg", "=", "\"%s%r\"", "%", "(", "func", ".", "__name__", ",", "args", ")", "if"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/util.py#L288-L304
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/more-itertools/py2/more_itertools/more.py
python
rlocate
(iterable, pred=bool, window_size=None)
return reversed(list(locate(iterable, pred, window_size)))
Yield the index of each item in *iterable* for which *pred* returns ``True``, starting from the right and moving left. *pred* defaults to :func:`bool`, which will select truthy items: >>> list(rlocate([0, 1, 1, 0, 1, 0, 0])) # Truthy at 1, 2, and 4 [4, 2, 1] Set *pred* to a custom functi...
Yield the index of each item in *iterable* for which *pred* returns ``True``, starting from the right and moving left.
[ "Yield", "the", "index", "of", "each", "item", "in", "*", "iterable", "*", "for", "which", "*", "pred", "*", "returns", "True", "starting", "from", "the", "right", "and", "moving", "left", "." ]
def rlocate(iterable, pred=bool, window_size=None): """Yield the index of each item in *iterable* for which *pred* returns ``True``, starting from the right and moving left. *pred* defaults to :func:`bool`, which will select truthy items: >>> list(rlocate([0, 1, 1, 0, 1, 0, 0])) # Truthy at 1, 2,...
[ "def", "rlocate", "(", "iterable", ",", "pred", "=", "bool", ",", "window_size", "=", "None", ")", ":", "if", "window_size", "is", "None", ":", "try", ":", "len_iter", "=", "len", "(", "iterable", ")", "return", "(", "len_iter", "-", "i", "-", "1", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/more-itertools/py2/more_itertools/more.py#L2229-L2271
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/graphics.py
python
GraphicsContext.StrokeLineSegments
(self, beginPoints, endPoints)
Stroke a series of lines using the current pen. For each line the begin point is taken from the beginPoints sequence and the ending point is taken from the endPoints sequence.
Stroke a series of lines using the current pen. For each line the begin point is taken from the beginPoints sequence and the ending point is taken from the endPoints sequence.
[ "Stroke", "a", "series", "of", "lines", "using", "the", "current", "pen", ".", "For", "each", "line", "the", "begin", "point", "is", "taken", "from", "the", "beginPoints", "sequence", "and", "the", "ending", "point", "is", "taken", "from", "the", "endPoint...
def StrokeLineSegments(self, beginPoints, endPoints): """ Stroke a series of lines using the current pen. For each line the begin point is taken from the beginPoints sequence and the ending point is taken from the endPoints sequence. """ path = GraphicsPath() for...
[ "def", "StrokeLineSegments", "(", "self", ",", "beginPoints", ",", "endPoints", ")", ":", "path", "=", "GraphicsPath", "(", ")", "for", "begin", ",", "end", "in", "zip", "(", "beginPoints", ",", "endPoints", ")", ":", "path", ".", "MoveToPoint", "(", "be...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/graphics.py#L1498-L1508
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/third_party/websocket-client/websocket.py
python
_parse_url
(url)
return (hostname, port, resource, is_secure)
parse url and the result is tuple of (hostname, port, resource path and the flag of secure mode) url: url string.
parse url and the result is tuple of (hostname, port, resource path and the flag of secure mode)
[ "parse", "url", "and", "the", "result", "is", "tuple", "of", "(", "hostname", "port", "resource", "path", "and", "the", "flag", "of", "secure", "mode", ")" ]
def _parse_url(url): """ parse url and the result is tuple of (hostname, port, resource path and the flag of secure mode) url: url string. """ if ":" not in url: raise ValueError("url is invalid") scheme, url = url.split(":", 1) parsed = urlparse(url, scheme="http") if par...
[ "def", "_parse_url", "(", "url", ")", ":", "if", "\":\"", "not", "in", "url", ":", "raise", "ValueError", "(", "\"url is invalid\"", ")", "scheme", ",", "url", "=", "url", ".", "split", "(", "\":\"", ",", "1", ")", "parsed", "=", "urlparse", "(", "ur...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/websocket-client/websocket.py#L133-L173
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/examples/python/gdbremote.py
python
RegisterInfo.get_value_from_hex_string
(self, hex_str)
return '%s' % (value_str)
Dump the register value given a native byte order encoded hex ASCII byte string.
Dump the register value given a native byte order encoded hex ASCII byte string.
[ "Dump", "the", "register", "value", "given", "a", "native", "byte", "order", "encoded", "hex", "ASCII", "byte", "string", "." ]
def get_value_from_hex_string(self, hex_str): '''Dump the register value given a native byte order encoded hex ASCII byte string.''' encoding = self.info['encoding'] bit_size = self.bit_size() packet = Packet(hex_str) if encoding == 'uint': uval = packet.get_hex_uint(...
[ "def", "get_value_from_hex_string", "(", "self", ",", "hex_str", ")", ":", "encoding", "=", "self", ".", "info", "[", "'encoding'", "]", "bit_size", "=", "self", ".", "bit_size", "(", ")", "packet", "=", "Packet", "(", "hex_str", ")", "if", "encoding", "...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/examples/python/gdbremote.py#L356-L381
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/abins/sdata.py
python
SDataByAngle.set_angle_data
(self, angle_index: int, sdata: SData, add_to_existing: bool = False)
Set data for one angle from SData object Args: angle_index: Index (in self.angles) of angle corresponding to data sdata: New S values to replace current content at given angle add_to_existing: Instead of replacing existing da...
Set data for one angle from SData object
[ "Set", "data", "for", "one", "angle", "from", "SData", "object" ]
def set_angle_data(self, angle_index: int, sdata: SData, add_to_existing: bool = False) -> None: """Set data for one angle from SData object Args: angle_index: Index (in self.angles) of angle corresponding to data sdata: Ne...
[ "def", "set_angle_data", "(", "self", ",", "angle_index", ":", "int", ",", "sdata", ":", "SData", ",", "add_to_existing", ":", "bool", "=", "False", ")", "->", "None", ":", "data", "=", "sdata", ".", "extract", "(", ")", "if", "'frequencies'", "in", "d...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/sdata.py#L509-L531
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/query.py
python
CustomRun.entry_ok
(self)
return None if cli_args is None else (cli_args, restart)
Return apparently valid (cli_args, restart) or None
Return apparently valid (cli_args, restart) or None
[ "Return", "apparently", "valid", "(", "cli_args", "restart", ")", "or", "None" ]
def entry_ok(self): "Return apparently valid (cli_args, restart) or None" cli_args = self.cli_args_ok() restart = self.restartvar.get() return None if cli_args is None else (cli_args, restart)
[ "def", "entry_ok", "(", "self", ")", ":", "cli_args", "=", "self", ".", "cli_args_ok", "(", ")", "restart", "=", "self", ".", "restartvar", ".", "get", "(", ")", "return", "None", "if", "cli_args", "is", "None", "else", "(", "cli_args", ",", "restart",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/query.py#L377-L381
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
LoadResponse.fromBytes
(buffer)
return TpmBuffer(buffer).createObj(LoadResponse)
Returns new LoadResponse object constructed from its marshaled representation in the given byte buffer
Returns new LoadResponse object constructed from its marshaled representation in the given byte buffer
[ "Returns", "new", "LoadResponse", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "byte", "buffer" ]
def fromBytes(buffer): """ Returns new LoadResponse object constructed from its marshaled representation in the given byte buffer """ return TpmBuffer(buffer).createObj(LoadResponse)
[ "def", "fromBytes", "(", "buffer", ")", ":", "return", "TpmBuffer", "(", "buffer", ")", ".", "createObj", "(", "LoadResponse", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L9648-L9652
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/mindrecord/shardsegment.py
python
ShardSegment.set_category_field
(self, category_field)
return self._segment.set_category_field(category_field)
Select one category field to use.
Select one category field to use.
[ "Select", "one", "category", "field", "to", "use", "." ]
def set_category_field(self, category_field): """Select one category field to use.""" return self._segment.set_category_field(category_field)
[ "def", "set_category_field", "(", "self", ",", "category_field", ")", ":", "return", "self", ".", "_segment", ".", "set_category_field", "(", "category_field", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/mindrecord/shardsegment.py#L78-L80
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/webbrowser.py
python
open_new
(url)
return open(url, 1)
Open url in a new window of the default browser. If not possible, then open url in the only browser window.
Open url in a new window of the default browser.
[ "Open", "url", "in", "a", "new", "window", "of", "the", "default", "browser", "." ]
def open_new(url): """Open url in a new window of the default browser. If not possible, then open url in the only browser window. """ return open(url, 1)
[ "def", "open_new", "(", "url", ")", ":", "return", "open", "(", "url", ",", "1", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/webbrowser.py#L90-L95
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/devil/devil/android/device_utils.py
python
DeviceUtils.GetClientCache
(self, client_name)
return self._client_caches[client_name]
Returns client cache.
Returns client cache.
[ "Returns", "client", "cache", "." ]
def GetClientCache(self, client_name): """Returns client cache.""" if client_name not in self._client_caches: self._client_caches[client_name] = {} return self._client_caches[client_name]
[ "def", "GetClientCache", "(", "self", ",", "client_name", ")", ":", "if", "client_name", "not", "in", "self", ".", "_client_caches", ":", "self", ".", "_client_caches", "[", "client_name", "]", "=", "{", "}", "return", "self", ".", "_client_caches", "[", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/device_utils.py#L2205-L2209
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextCtrl.ScrollToLine
(*args, **kwargs)
return _stc.StyledTextCtrl_ScrollToLine(*args, **kwargs)
ScrollToLine(self, int line) Scroll enough to make the given line visible.
ScrollToLine(self, int line)
[ "ScrollToLine", "(", "self", "int", "line", ")" ]
def ScrollToLine(*args, **kwargs): """ ScrollToLine(self, int line) Scroll enough to make the given line visible. """ return _stc.StyledTextCtrl_ScrollToLine(*args, **kwargs)
[ "def", "ScrollToLine", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_ScrollToLine", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L6605-L6611
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
GBSpan.__init__
(self, *args, **kwargs)
__init__(self, int rowspan=1, int colspan=1) -> GBSpan Construct a new wxGBSpan, optionally setting the rowspan and colspan. The default is (1,1). (Meaning that the item occupies one cell in each direction.
__init__(self, int rowspan=1, int colspan=1) -> GBSpan
[ "__init__", "(", "self", "int", "rowspan", "=", "1", "int", "colspan", "=", "1", ")", "-", ">", "GBSpan" ]
def __init__(self, *args, **kwargs): """ __init__(self, int rowspan=1, int colspan=1) -> GBSpan Construct a new wxGBSpan, optionally setting the rowspan and colspan. The default is (1,1). (Meaning that the item occupies one cell in each direction. """ _core_.GBS...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_core_", ".", "GBSpan_swiginit", "(", "self", ",", "_core_", ".", "new_GBSpan", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L15645-L15653
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
PyScrolledWindow.DoSetSize
(*args, **kwargs)
return _windows_.PyScrolledWindow_DoSetSize(*args, **kwargs)
DoSetSize(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
DoSetSize(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
[ "DoSetSize", "(", "self", "int", "x", "int", "y", "int", "width", "int", "height", "int", "sizeFlags", "=", "SIZE_AUTO", ")" ]
def DoSetSize(*args, **kwargs): """DoSetSize(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)""" return _windows_.PyScrolledWindow_DoSetSize(*args, **kwargs)
[ "def", "DoSetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PyScrolledWindow_DoSetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L4516-L4518
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/binary-tree-postorder-traversal.py
python
Solution.postorderTraversal
(self, root)
return result
:type root: TreeNode :rtype: List[int]
:type root: TreeNode :rtype: List[int]
[ ":", "type", "root", ":", "TreeNode", ":", "rtype", ":", "List", "[", "int", "]" ]
def postorderTraversal(self, root): """ :type root: TreeNode :rtype: List[int] """ dummy = TreeNode(0) dummy.left = root result, cur = [], dummy while cur: if cur.left is None: cur = cur.right else: n...
[ "def", "postorderTraversal", "(", "self", ",", "root", ")", ":", "dummy", "=", "TreeNode", "(", "0", ")", "dummy", ".", "left", "=", "root", "result", ",", "cur", "=", "[", "]", ",", "dummy", "while", "cur", ":", "if", "cur", ".", "left", "is", "...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/binary-tree-postorder-traversal.py#L13-L37
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/retdec-3.2/scripts/type_extractor/type_extractor/header_text_filters.py
python
filter_out_comments
(text)
return text
Removes one-line and multi-line comments.
Removes one-line and multi-line comments.
[ "Removes", "one", "-", "line", "and", "multi", "-", "line", "comments", "." ]
def filter_out_comments(text): """Removes one-line and multi-line comments.""" text = re.sub(r'//(?:(?!\*/).)*$', '', text, flags=re.M) text = re.sub(r'(?<!/)/\*.*?\*/', ' ', text, flags=re.S) text = re.sub(r'//.*?$', '', text, flags=re.M) return text
[ "def", "filter_out_comments", "(", "text", ")", ":", "text", "=", "re", ".", "sub", "(", "r'//(?:(?!\\*/).)*$'", ",", "''", ",", "text", ",", "flags", "=", "re", ".", "M", ")", "text", "=", "re", ".", "sub", "(", "r'(?<!/)/\\*.*?\\*/'", ",", "' '", "...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/type_extractor/type_extractor/header_text_filters.py#L82-L87
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
clang/tools/scan-build-py/lib/libscanbuild/arguments.py
python
normalize_args_for_analyze
(args, from_build_command)
Normalize parsed arguments for analyze-build and scan-build. :param args: Parsed argument object. (Will be mutated.) :param from_build_command: Boolean value tells is the command suppose to run the analyzer against a build command or a compilation db.
Normalize parsed arguments for analyze-build and scan-build.
[ "Normalize", "parsed", "arguments", "for", "analyze", "-", "build", "and", "scan", "-", "build", "." ]
def normalize_args_for_analyze(args, from_build_command): """ Normalize parsed arguments for analyze-build and scan-build. :param args: Parsed argument object. (Will be mutated.) :param from_build_command: Boolean value tells is the command suppose to run the analyzer against a build command or a compi...
[ "def", "normalize_args_for_analyze", "(", "args", ",", "from_build_command", ")", ":", "# make plugins always a list. (it might be None when not specified.)", "if", "args", ".", "plugins", "is", "None", ":", "args", ".", "plugins", "=", "[", "]", "# make exclude directory...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/clang/tools/scan-build-py/lib/libscanbuild/arguments.py#L77-L104
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
external_tools/ply_info/example/ansic/cparse.py
python
p_labeled_statement_1
(t)
labeled_statement : ID COLON statement
labeled_statement : ID COLON statement
[ "labeled_statement", ":", "ID", "COLON", "statement" ]
def p_labeled_statement_1(t): 'labeled_statement : ID COLON statement' pass
[ "def", "p_labeled_statement_1", "(", "t", ")", ":", "pass" ]
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/cparse.py#L466-L468
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/third_party/png/png.py
python
Test.testPalExpand
(self)
Test that bitdepth can be used to fiddle with pallete image.
Test that bitdepth can be used to fiddle with pallete image.
[ "Test", "that", "bitdepth", "can", "be", "used", "to", "fiddle", "with", "pallete", "image", "." ]
def testPalExpand(self): """Test that bitdepth can be used to fiddle with pallete image.""" r = Reader(bytes=_pngsuite['basn3p04']) x,y,pixels,info = r.read() pixels = [list(row) for row in pixels] info['bitdepth'] = 8 w = Writer(**info) o = BytesIO() w.wr...
[ "def", "testPalExpand", "(", "self", ")", ":", "r", "=", "Reader", "(", "bytes", "=", "_pngsuite", "[", "'basn3p04'", "]", ")", "x", ",", "y", ",", "pixels", ",", "info", "=", "r", ".", "read", "(", ")", "pixels", "=", "[", "list", "(", "row", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/png/png.py#L2711-L2726
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py
python
HTTPConnectionPool._make_request
( self, conn, method, url, timeout=_Default, chunked=False, **httplib_request_kw )
return httplib_response
Perform a request on a given urllib connection object taken from our pool. :param conn: a connection from one of our connection pools :param timeout: Socket timeout in seconds for the request. This can be a float or integer, which will set the same timeout v...
Perform a request on a given urllib connection object taken from our pool.
[ "Perform", "a", "request", "on", "a", "given", "urllib", "connection", "object", "taken", "from", "our", "pool", "." ]
def _make_request( self, conn, method, url, timeout=_Default, chunked=False, **httplib_request_kw ): """ Perform a request on a given urllib connection object taken from our pool. :param conn: a connection from one of our connection pools :param timeout:...
[ "def", "_make_request", "(", "self", ",", "conn", ",", "method", ",", "url", ",", "timeout", "=", "_Default", ",", "chunked", "=", "False", ",", "*", "*", "httplib_request_kw", ")", ":", "self", ".", "num_requests", "+=", "1", "timeout_obj", "=", "self",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py#L357-L474
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
clang/docs/tools/dump_ast_matchers.py
python
add_matcher
(result_type, name, args, comment, is_dyncast=False)
Adds a matcher to one of our categories.
Adds a matcher to one of our categories.
[ "Adds", "a", "matcher", "to", "one", "of", "our", "categories", "." ]
def add_matcher(result_type, name, args, comment, is_dyncast=False): """Adds a matcher to one of our categories.""" if name == 'id': # FIXME: Figure out whether we want to support the 'id' matcher. return matcher_id = '%s%d' % (name, ids[name]) ids[name] += 1 args = unify_arguments(args) result_ty...
[ "def", "add_matcher", "(", "result_type", ",", "name", ",", "args", ",", "comment", ",", "is_dyncast", "=", "False", ")", ":", "if", "name", "==", "'id'", ":", "# FIXME: Figure out whether we want to support the 'id' matcher.", "return", "matcher_id", "=", "'%s%d'",...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/docs/tools/dump_ast_matchers.py#L113-L153
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/column/string.py
python
StringColumn.find_and_replace
( self, to_replace: ColumnLike, replacement: ColumnLike, all_nan: bool = False, )
return libcudf.replace.replace(res, df._data["old"], df._data["new"])
Return col with *to_replace* replaced with *value*
Return col with *to_replace* replaced with *value*
[ "Return", "col", "with", "*", "to_replace", "*", "replaced", "with", "*", "value", "*" ]
def find_and_replace( self, to_replace: ColumnLike, replacement: ColumnLike, all_nan: bool = False, ) -> StringColumn: """ Return col with *to_replace* replaced with *value* """ to_replace_col = column.as_column(to_replace) replacement_col = c...
[ "def", "find_and_replace", "(", "self", ",", "to_replace", ":", "ColumnLike", ",", "replacement", ":", "ColumnLike", ",", "all_nan", ":", "bool", "=", "False", ",", ")", "->", "StringColumn", ":", "to_replace_col", "=", "column", ".", "as_column", "(", "to_r...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/column/string.py#L5317-L5349
sfzhang15/RefineDet
52b6fe23dc1a160fe710b7734576dca509bf4fae
scripts/cpp_lint.py
python
ProcessFileData
(filename, file_extension, lines, error, extra_check_functions=[])
Performs lint checks and reports any errors to the given error function. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. lines: An array of strings, each representing a line of the file, with the last element being emp...
Performs lint checks and reports any errors to the given error function.
[ "Performs", "lint", "checks", "and", "reports", "any", "errors", "to", "the", "given", "error", "function", "." ]
def ProcessFileData(filename, file_extension, lines, error, extra_check_functions=[]): """Performs lint checks and reports any errors to the given error function. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. ...
[ "def", "ProcessFileData", "(", "filename", ",", "file_extension", ",", "lines", ",", "error", ",", "extra_check_functions", "=", "[", "]", ")", ":", "lines", "=", "(", "[", "'// marker so line numbers and indices both start at 1'", "]", "+", "lines", "+", "[", "...
https://github.com/sfzhang15/RefineDet/blob/52b6fe23dc1a160fe710b7734576dca509bf4fae/scripts/cpp_lint.py#L4648-L4691
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py
python
Session.options
(self, url, **kwargs)
return self.request('OPTIONS', url, **kwargs)
r"""Sends a OPTIONS request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response
r"""Sends a OPTIONS request. Returns :class:`Response` object.
[ "r", "Sends", "a", "OPTIONS", "request", ".", "Returns", ":", "class", ":", "Response", "object", "." ]
def options(self, url, **kwargs): r"""Sends a OPTIONS request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ kwargs.setdefault('allow_red...
[ "def", "options", "(", "self", ",", "url", ",", "*", "*", "kwargs", ")", ":", "kwargs", ".", "setdefault", "(", "'allow_redirects'", ",", "True", ")", "return", "self", ".", "request", "(", "'OPTIONS'", ",", "url", ",", "*", "*", "kwargs", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py#L545-L554
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/fixes/fix_import.py
python
traverse_imports
(names)
Walks over all the names imported in a dotted_as_names node.
Walks over all the names imported in a dotted_as_names node.
[ "Walks", "over", "all", "the", "names", "imported", "in", "a", "dotted_as_names", "node", "." ]
def traverse_imports(names): """ Walks over all the names imported in a dotted_as_names node. """ pending = [names] while pending: node = pending.pop() if node.type == token.NAME: yield node.value elif node.type == syms.dotted_name: yield "".join([ch.v...
[ "def", "traverse_imports", "(", "names", ")", ":", "pending", "=", "[", "names", "]", "while", "pending", ":", "node", "=", "pending", ".", "pop", "(", ")", "if", "node", ".", "type", "==", "token", ".", "NAME", ":", "yield", "node", ".", "value", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/fixes/fix_import.py#L19-L35
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py
python
Decimal._isinteger
(self)
return rest == '0'*len(rest)
Returns whether self is an integer
Returns whether self is an integer
[ "Returns", "whether", "self", "is", "an", "integer" ]
def _isinteger(self): """Returns whether self is an integer""" if self._is_special: return False if self._exp >= 0: return True rest = self._int[self._exp:] return rest == '0'*len(rest)
[ "def", "_isinteger", "(", "self", ")", ":", "if", "self", ".", "_is_special", ":", "return", "False", "if", "self", ".", "_exp", ">=", "0", ":", "return", "True", "rest", "=", "self", ".", "_int", "[", "self", ".", "_exp", ":", "]", "return", "rest...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py#L2788-L2795
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudformation/connection.py
python
CloudFormationConnection.list_stack_resources
(self, stack_name_or_id, next_token=None)
return self.get_list('ListStackResources', params, [('member', StackResourceSummary)])
Returns descriptions of all resources of the specified stack. For deleted stacks, ListStackResources returns resource information for up to 90 days after the stack has been deleted. :type stack_name_or_id: string :param stack_name_or_id: The name or the unique identifier associ...
Returns descriptions of all resources of the specified stack.
[ "Returns", "descriptions", "of", "all", "resources", "of", "the", "specified", "stack", "." ]
def list_stack_resources(self, stack_name_or_id, next_token=None): """ Returns descriptions of all resources of the specified stack. For deleted stacks, ListStackResources returns resource information for up to 90 days after the stack has been deleted. :type stack_name_...
[ "def", "list_stack_resources", "(", "self", ",", "stack_name_or_id", ",", "next_token", "=", "None", ")", ":", "params", "=", "{", "'StackName'", ":", "stack_name_or_id", "}", "if", "next_token", ":", "params", "[", "'NextToken'", "]", "=", "next_token", "retu...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudformation/connection.py#L717-L746
bundy-dns/bundy
3d41934996b82b0cd2fe22dd74d2abc1daba835d
src/lib/python/bundy/config/cfgmgr.py
python
ConfigManager.get_statistics_spec
(self, name = None)
return statistics
Returns a dict containing 'module_name': statistics_spec for all modules. If name is specified, only that module will be included
Returns a dict containing 'module_name': statistics_spec for all modules. If name is specified, only that module will be included
[ "Returns", "a", "dict", "containing", "module_name", ":", "statistics_spec", "for", "all", "modules", ".", "If", "name", "is", "specified", "only", "that", "module", "will", "be", "included" ]
def get_statistics_spec(self, name = None): """Returns a dict containing 'module_name': statistics_spec for all modules. If name is specified, only that module will be included""" statistics = {} if name: if name in self.module_specs: statistics[...
[ "def", "get_statistics_spec", "(", "self", ",", "name", "=", "None", ")", ":", "statistics", "=", "{", "}", "if", "name", ":", "if", "name", "in", "self", ".", "module_specs", ":", "statistics", "[", "name", "]", "=", "self", ".", "module_specs", "[", ...
https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/config/cfgmgr.py#L358-L369
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
ConfigBase.GetNumberOfEntries
(*args, **kwargs)
return _misc_.ConfigBase_GetNumberOfEntries(*args, **kwargs)
GetNumberOfEntries(self, bool recursive=False) -> size_t Get the number of entries in the current group, with or without its subgroups.
GetNumberOfEntries(self, bool recursive=False) -> size_t
[ "GetNumberOfEntries", "(", "self", "bool", "recursive", "=", "False", ")", "-", ">", "size_t" ]
def GetNumberOfEntries(*args, **kwargs): """ GetNumberOfEntries(self, bool recursive=False) -> size_t Get the number of entries in the current group, with or without its subgroups. """ return _misc_.ConfigBase_GetNumberOfEntries(*args, **kwargs)
[ "def", "GetNumberOfEntries", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "ConfigBase_GetNumberOfEntries", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L3205-L3212
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/metrics/histograms/extract_histograms.py
python
ExtractHistograms
(filename)
Load histogram definitions from a disk file. Args: filename: a file path to load data from. Returns: a dictionary of histogram descriptions. Raises: Error: if the file is not well-formatted.
Load histogram definitions from a disk file.
[ "Load", "histogram", "definitions", "from", "a", "disk", "file", "." ]
def ExtractHistograms(filename): """Load histogram definitions from a disk file. Args: filename: a file path to load data from. Returns: a dictionary of histogram descriptions. Raises: Error: if the file is not well-formatted. """ with open(filename, 'r') as f: histograms, had_errors = Ex...
[ "def", "ExtractHistograms", "(", "filename", ")", ":", "with", "open", "(", "filename", ",", "'r'", ")", "as", "f", ":", "histograms", ",", "had_errors", "=", "ExtractHistogramsFromFile", "(", "f", ")", "if", "had_errors", ":", "logging", ".", "error", "("...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/metrics/histograms/extract_histograms.py#L466-L483
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/revnet/revnet.py
python
RevNet.get_moving_stats
(self)
Get moving averages of batch normalization.
Get moving averages of batch normalization.
[ "Get", "moving", "averages", "of", "batch", "normalization", "." ]
def get_moving_stats(self): """Get moving averages of batch normalization.""" device = "/gpu:0" if tf.test.is_gpu_available() else "/cpu:0" with tf.device(device): return [v.read_value() for v in self.moving_average_variables]
[ "def", "get_moving_stats", "(", "self", ")", ":", "device", "=", "\"/gpu:0\"", "if", "tf", ".", "test", ".", "is_gpu_available", "(", ")", "else", "\"/cpu:0\"", "with", "tf", ".", "device", "(", "device", ")", ":", "return", "[", "v", ".", "read_value", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/revnet/revnet.py#L194-L198
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/reduction_gui/reduction/sans/hfir_options_script.py
python
ReductionOptions.get_this_class_variables
(self)
return pairs
Just for debug purposes Return: pairs of (var_name,var_value)
Just for debug purposes Return: pairs of (var_name,var_value)
[ "Just", "for", "debug", "purposes", "Return", ":", "pairs", "of", "(", "var_name", "var_value", ")" ]
def get_this_class_variables(self): ''' Just for debug purposes Return: pairs of (var_name,var_value) ''' attributes = inspect.getmembers( self, lambda a: not inspect.isroutine(a)) pairs = [a for a in attributes if not( a[0].startswith('__') and a[...
[ "def", "get_this_class_variables", "(", "self", ")", ":", "attributes", "=", "inspect", ".", "getmembers", "(", "self", ",", "lambda", "a", ":", "not", "inspect", ".", "isroutine", "(", "a", ")", ")", "pairs", "=", "[", "a", "for", "a", "in", "attribut...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/sans/hfir_options_script.py#L111-L120
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/bindings/scroll.py
python
scroll_half_page_down
(event: E)
Same as ControlF, but only scroll half a page.
Same as ControlF, but only scroll half a page.
[ "Same", "as", "ControlF", "but", "only", "scroll", "half", "a", "page", "." ]
def scroll_half_page_down(event: E) -> None: """ Same as ControlF, but only scroll half a page. """ scroll_forward(event, half=True)
[ "def", "scroll_half_page_down", "(", "event", ":", "E", ")", "->", "None", ":", "scroll_forward", "(", "event", ",", "half", "=", "True", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/bindings/scroll.py#L83-L87