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
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/mixins.py
python
_disables_array_ufunc
(obj)
True when __array_ufunc__ is set to None.
True when __array_ufunc__ is set to None.
[ "True", "when", "__array_ufunc__", "is", "set", "to", "None", "." ]
def _disables_array_ufunc(obj): """True when __array_ufunc__ is set to None.""" try: return obj.__array_ufunc__ is None except AttributeError: return False
[ "def", "_disables_array_ufunc", "(", "obj", ")", ":", "try", ":", "return", "obj", ".", "__array_ufunc__", "is", "None", "except", "AttributeError", ":", "return", "False" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/mixins.py#L12-L17
eric612/MobileNet-YOLO
69b4441cb3ec8d553fbdef788ad033e246f901bd
python/caffe/draw.py
python
get_pooling_types_dict
()
return d
Get dictionary mapping pooling type number to type name
Get dictionary mapping pooling type number to type name
[ "Get", "dictionary", "mapping", "pooling", "type", "number", "to", "type", "name" ]
def get_pooling_types_dict(): """Get dictionary mapping pooling type number to type name """ desc = caffe_pb2.PoolingParameter.PoolMethod.DESCRIPTOR d = {} for k, v in desc.values_by_name.items(): d[v.number] = k return d
[ "def", "get_pooling_types_dict", "(", ")", ":", "desc", "=", "caffe_pb2", ".", "PoolingParameter", ".", "PoolMethod", ".", "DESCRIPTOR", "d", "=", "{", "}", "for", "k", ",", "v", "in", "desc", ".", "values_by_name", ".", "items", "(", ")", ":", "d", "[...
https://github.com/eric612/MobileNet-YOLO/blob/69b4441cb3ec8d553fbdef788ad033e246f901bd/python/caffe/draw.py#L36-L43
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/range.py
python
_range_tbe
()
return
Range TBE register
Range TBE register
[ "Range", "TBE", "register" ]
def _range_tbe(): """Range TBE register""" return
[ "def", "_range_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/range.py#L37-L39
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/crywaflib/msvs.py
python
vsnode.ptype
(self)
Return a special uuid for projects written in the solution file
Return a special uuid for projects written in the solution file
[ "Return", "a", "special", "uuid", "for", "projects", "written", "in", "the", "solution", "file" ]
def ptype(self): """ Return a special uuid for projects written in the solution file """ pass
[ "def", "ptype", "(", "self", ")", ":", "pass" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/msvs.py#L942-L946
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py
python
HDFStore.walk
(self, where="/")
Walk the pytables group hierarchy for pandas objects. This generator will yield the group path, subgroups and pandas object names for each group. Any non-pandas PyTables objects that are not a group will be ignored. The `where` group itself is listed first (preorder), then each of its...
Walk the pytables group hierarchy for pandas objects.
[ "Walk", "the", "pytables", "group", "hierarchy", "for", "pandas", "objects", "." ]
def walk(self, where="/"): """ Walk the pytables group hierarchy for pandas objects. This generator will yield the group path, subgroups and pandas object names for each group. Any non-pandas PyTables objects that are not a group will be ignored. The `where` group itse...
[ "def", "walk", "(", "self", ",", "where", "=", "\"/\"", ")", ":", "_tables", "(", ")", "self", ".", "_check_if_open", "(", ")", "for", "g", "in", "self", ".", "_handle", ".", "walk_groups", "(", "where", ")", ":", "if", "getattr", "(", "g", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py#L1343-L1388
InsightSoftwareConsortium/ITK
87acfce9a93d928311c38bc371b666b515b9f19d
Wrapping/Generators/Python/itk/support/template_class.py
python
itkTemplate.GetTypesAsList
(self)
return ctypes + classes + others
Helper method which returns the available template parameters.
Helper method which returns the available template parameters.
[ "Helper", "method", "which", "returns", "the", "available", "template", "parameters", "." ]
def GetTypesAsList(self): """Helper method which returns the available template parameters.""" # Make a list of allowed types, and sort them ctypes = [] classes = [] others = [] for key_tuple in self.__template__: key = str(key_tuple) if "itkCTyp...
[ "def", "GetTypesAsList", "(", "self", ")", ":", "# Make a list of allowed types, and sort them", "ctypes", "=", "[", "]", "classes", "=", "[", "]", "others", "=", "[", "]", "for", "key_tuple", "in", "self", ".", "__template__", ":", "key", "=", "str", "(", ...
https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Wrapping/Generators/Python/itk/support/template_class.py#L772-L793
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/mixture/dpgmm.py
python
_DPGMMBase._initialize_gamma
(self)
Initializes the concentration parameters
Initializes the concentration parameters
[ "Initializes", "the", "concentration", "parameters" ]
def _initialize_gamma(self): "Initializes the concentration parameters" self.gamma_ = self.alpha * np.ones((self.n_components, 3))
[ "def", "_initialize_gamma", "(", "self", ")", ":", "self", ".", "gamma_", "=", "self", ".", "alpha", "*", "np", ".", "ones", "(", "(", "self", ".", "n_components", ",", "3", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/mixture/dpgmm.py#L408-L410
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/accessor.py
python
_register_accessor
(name, cls)
return decorator
Register a custom accessor on {klass} objects. Parameters ---------- name : str Name under which the accessor should be registered. A warning is issued if this name conflicts with a preexisting attribute. Returns ------- callable A class decorator. See Also ---...
Register a custom accessor on {klass} objects.
[ "Register", "a", "custom", "accessor", "on", "{", "klass", "}", "objects", "." ]
def _register_accessor(name, cls): """ Register a custom accessor on {klass} objects. Parameters ---------- name : str Name under which the accessor should be registered. A warning is issued if this name conflicts with a preexisting attribute. Returns ------- callable ...
[ "def", "_register_accessor", "(", "name", ",", "cls", ")", ":", "def", "decorator", "(", "accessor", ")", ":", "if", "hasattr", "(", "cls", ",", "name", ")", ":", "warnings", ".", "warn", "(", "f\"registration of accessor {repr(accessor)} under name \"", "f\"{re...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/accessor.py#L191-L276
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/opencv-git/3rdparty/jinja2/sandbox.py
python
SandboxedEnvironment.call_unop
(self, context, operator, arg)
return self.unop_table[operator](arg)
For intercepted unary operator calls (:meth:`intercepted_unops`) this function is executed instead of the builtin operator. This can be used to fine tune the behavior of certain operators. .. versionadded:: 2.6
For intercepted unary operator calls (:meth:`intercepted_unops`) this function is executed instead of the builtin operator. This can be used to fine tune the behavior of certain operators.
[ "For", "intercepted", "unary", "operator", "calls", "(", ":", "meth", ":", "intercepted_unops", ")", "this", "function", "is", "executed", "instead", "of", "the", "builtin", "operator", ".", "This", "can", "be", "used", "to", "fine", "tune", "the", "behavior...
def call_unop(self, context, operator, arg): """For intercepted unary operator calls (:meth:`intercepted_unops`) this function is executed instead of the builtin operator. This can be used to fine tune the behavior of certain operators. .. versionadded:: 2.6 """ return ...
[ "def", "call_unop", "(", "self", ",", "context", ",", "operator", ",", "arg", ")", ":", "return", "self", ".", "unop_table", "[", "operator", "]", "(", "arg", ")" ]
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/sandbox.py#L295-L302
junhyukoh/caffe-lstm
598d45456fa2a1b127a644f4aa38daa8fb9fc722
scripts/cpp_lint.py
python
GetPreviousNonBlankLine
(clean_lines, linenum)
return ('', -1)
Return the most recent non-blank line and its line number. Args: clean_lines: A CleansedLines instance containing the file contents. linenum: The number of the line to check. Returns: A tuple with two elements. The first element is the contents of the last non-blank line before the current line, ...
Return the most recent non-blank line and its line number.
[ "Return", "the", "most", "recent", "non", "-", "blank", "line", "and", "its", "line", "number", "." ]
def GetPreviousNonBlankLine(clean_lines, linenum): """Return the most recent non-blank line and its line number. Args: clean_lines: A CleansedLines instance containing the file contents. linenum: The number of the line to check. Returns: A tuple with two elements. The first element is the contents ...
[ "def", "GetPreviousNonBlankLine", "(", "clean_lines", ",", "linenum", ")", ":", "prevlinenum", "=", "linenum", "-", "1", "while", "prevlinenum", ">=", "0", ":", "prevline", "=", "clean_lines", ".", "elided", "[", "prevlinenum", "]", "if", "not", "IsBlankLine",...
https://github.com/junhyukoh/caffe-lstm/blob/598d45456fa2a1b127a644f4aa38daa8fb9fc722/scripts/cpp_lint.py#L3046-L3066
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
python
find_compilation_database
(path)
return os.path.realpath(result)
Adjusts the directory until a compilation database is found.
Adjusts the directory until a compilation database is found.
[ "Adjusts", "the", "directory", "until", "a", "compilation", "database", "is", "found", "." ]
def find_compilation_database(path): """Adjusts the directory until a compilation database is found.""" result = './' while not os.path.isfile(os.path.join(result, path)): if os.path.realpath(result) == '/': print 'Error: could not find compilation database.' sys.exit(1) result += '../' retu...
[ "def", "find_compilation_database", "(", "path", ")", ":", "result", "=", "'./'", "while", "not", "os", ".", "path", ".", "isfile", "(", "os", ".", "path", ".", "join", "(", "result", ",", "path", ")", ")", ":", "if", "os", ".", "path", ".", "realp...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py#L37-L45
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/tools/stats-viewer.py
python
CounterCollection.CountersInUse
(self)
return self.data.IntAt(12)
Return the number of counters in active use.
Return the number of counters in active use.
[ "Return", "the", "number", "of", "counters", "in", "active", "use", "." ]
def CountersInUse(self): """Return the number of counters in active use.""" return self.data.IntAt(12)
[ "def", "CountersInUse", "(", "self", ")", ":", "return", "self", ".", "data", ".", "IntAt", "(", "12", ")" ]
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/tools/stats-viewer.py#L370-L372
h2oai/deepwater
80e345c582e6ef912a31f42707a2f31c01b064da
docs/sphinxext/apigen.py
python
ApiDocWriter.__init__
(self, package_name, rst_extension='.rst', package_skip_patterns=None, module_skip_patterns=None, )
Initialize package for parsing Parameters ---------- package_name : string Name of the top-level package. *package_name* must be the name of an importable package rst_extension : string, optional Extension for reST files, default '.rst' packa...
Initialize package for parsing
[ "Initialize", "package", "for", "parsing" ]
def __init__(self, package_name, rst_extension='.rst', package_skip_patterns=None, module_skip_patterns=None, ): ''' Initialize package for parsing Parameters ---------- package_name : string ...
[ "def", "__init__", "(", "self", ",", "package_name", ",", "rst_extension", "=", "'.rst'", ",", "package_skip_patterns", "=", "None", ",", "module_skip_patterns", "=", "None", ",", ")", ":", "if", "package_skip_patterns", "is", "None", ":", "package_skip_patterns",...
https://github.com/h2oai/deepwater/blob/80e345c582e6ef912a31f42707a2f31c01b064da/docs/sphinxext/apigen.py#L32-L71
electron/electron
8dfcf817e4182c48cd7e9d3471319c61224677e3
script/lib/git.py
python
remove_patch_filename
(patch)
Strip out the Patch-Filename trailer from a patch's message body
Strip out the Patch-Filename trailer from a patch's message body
[ "Strip", "out", "the", "Patch", "-", "Filename", "trailer", "from", "a", "patch", "s", "message", "body" ]
def remove_patch_filename(patch): """Strip out the Patch-Filename trailer from a patch's message body""" force_keep_next_line = False for i, l in enumerate(patch): is_patchfilename = l.startswith('Patch-Filename: ') next_is_patchfilename = i < len(patch) - 1 and patch[i + 1].startswith( 'Patch-Filen...
[ "def", "remove_patch_filename", "(", "patch", ")", ":", "force_keep_next_line", "=", "False", "for", "i", ",", "l", "in", "enumerate", "(", "patch", ")", ":", "is_patchfilename", "=", "l", ".", "startswith", "(", "'Patch-Filename: '", ")", "next_is_patchfilename...
https://github.com/electron/electron/blob/8dfcf817e4182c48cd7e9d3471319c61224677e3/script/lib/git.py#L215-L229
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/command/explore.py
python
Explorer.explore_type
(name, datatype, is_child)
Main function to explore a data type. Arguments: name: The string representing the path to the data type being explored. datatype: The gdb.Type value of the data type being explored. is_child: Boolean value to indicate if the name is a child. ...
Main function to explore a data type.
[ "Main", "function", "to", "explore", "a", "data", "type", "." ]
def explore_type(name, datatype, is_child): """Main function to explore a data type. Arguments: name: The string representing the path to the data type being explored. datatype: The gdb.Type value of the data type being explored. is_child: Boolean v...
[ "def", "explore_type", "(", "name", ",", "datatype", ",", "is_child", ")", ":", "type_code", "=", "datatype", ".", "code", "if", "type_code", "in", "Explorer", ".", "type_code_to_explorer_map", ":", "explorer_class", "=", "Explorer", ".", "type_code_to_explorer_ma...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/command/explore.py#L92-L115
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/ci_build/update_version.py
python
main
()
This script updates all instances of version in the tensorflow directory. Requirements: version: The version tag OR nightly: Create a nightly tag with current date Raises: RuntimeError: If the script is not being run from tf source dir
This script updates all instances of version in the tensorflow directory.
[ "This", "script", "updates", "all", "instances", "of", "version", "in", "the", "tensorflow", "directory", "." ]
def main(): """This script updates all instances of version in the tensorflow directory. Requirements: version: The version tag OR nightly: Create a nightly tag with current date Raises: RuntimeError: If the script is not being run from tf source dir """ parser = argparse.ArgumentParser(des...
[ "def", "main", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "\"Cherry picking automation.\"", ")", "# Arg information", "parser", ".", "add_argument", "(", "\"--version\"", ",", "help", "=", "\"<new_major_ver>.<new_minor_ve...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/ci_build/update_version.py#L265-L317
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/multitype_ops/not_in_impl.py
python
_str_not_in_dict
(x, y)
return F.not_in_dict(x, y)
Determine if a str not in dict. Args: x: str y: dict Returns: bool, if x not in y return true, x in y return false.
Determine if a str not in dict.
[ "Determine", "if", "a", "str", "not", "in", "dict", "." ]
def _str_not_in_dict(x, y): """ Determine if a str not in dict. Args: x: str y: dict Returns: bool, if x not in y return true, x in y return false. """ return F.not_in_dict(x, y)
[ "def", "_str_not_in_dict", "(", "x", ",", "y", ")", ":", "return", "F", ".", "not_in_dict", "(", "x", ",", "y", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/not_in_impl.py#L91-L102
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/imputil.py
python
_compile
(pathname, timestamp)
return code
Compile (and cache) a Python source file. The file specified by <pathname> is compiled to a code object and returned. Presuming the appropriate privileges exist, the bytecodes will be saved back to the filesystem for future imports. The source file's modification timestamp must be provided as a Lo...
Compile (and cache) a Python source file.
[ "Compile", "(", "and", "cache", ")", "a", "Python", "source", "file", "." ]
def _compile(pathname, timestamp): """Compile (and cache) a Python source file. The file specified by <pathname> is compiled to a code object and returned. Presuming the appropriate privileges exist, the bytecodes will be saved back to the filesystem for future imports. The source file's modif...
[ "def", "_compile", "(", "pathname", ",", "timestamp", ")", ":", "codestring", "=", "open", "(", "pathname", ",", "'rU'", ")", ".", "read", "(", ")", "if", "codestring", "and", "codestring", "[", "-", "1", "]", "!=", "'\\n'", ":", "codestring", "=", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/imputil.py#L415-L444
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py
python
CreateWrapper
(target_list, target_dicts, data, params)
return (new_target_list, new_target_dicts, new_data)
Initialize targets for the ninja wrapper. This sets up the necessary variables in the targets to generate Xcode projects that use ninja as an external builder. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. data: Dict ...
Initialize targets for the ninja wrapper.
[ "Initialize", "targets", "for", "the", "ninja", "wrapper", "." ]
def CreateWrapper(target_list, target_dicts, data, params): """Initialize targets for the ninja wrapper. This sets up the necessary variables in the targets to generate Xcode projects that use ninja as an external builder. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts...
[ "def", "CreateWrapper", "(", "target_list", ",", "target_dicts", ",", "data", ",", "params", ")", ":", "orig_gyp", "=", "params", "[", "'build_files'", "]", "[", "0", "]", "for", "gyp_name", ",", "gyp_dict", "in", "data", ".", "iteritems", "(", ")", ":",...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py#L152-L270
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
SizerFlags.Center
(*args, **kwargs)
return _core_.SizerFlags_Center(*args, **kwargs)
Center(self) -> SizerFlags Sets the centering alignment flags.
Center(self) -> SizerFlags
[ "Center", "(", "self", ")", "-", ">", "SizerFlags" ]
def Center(*args, **kwargs): """ Center(self) -> SizerFlags Sets the centering alignment flags. """ return _core_.SizerFlags_Center(*args, **kwargs)
[ "def", "Center", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SizerFlags_Center", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L13806-L13812
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/framework/ops.py
python
Operation.node_def
(self)
return self._node_def
Returns a serialized `NodeDef` representation of this operation. Returns: A [`NodeDef`](https://www.tensorflow.org/code/tensorflow/core/framework/node_def.proto) protocol buffer.
Returns a serialized `NodeDef` representation of this operation.
[ "Returns", "a", "serialized", "NodeDef", "representation", "of", "this", "operation", "." ]
def node_def(self): # pylint: disable=line-too-long """Returns a serialized `NodeDef` representation of this operation. Returns: A [`NodeDef`](https://www.tensorflow.org/code/tensorflow/core/framework/node_def.proto) protocol buffer. """ # pylint: enable=line-too-long return s...
[ "def", "node_def", "(", "self", ")", ":", "# pylint: disable=line-too-long", "# pylint: enable=line-too-long", "return", "self", ".", "_node_def" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/ops.py#L1978-L1988
Bitcoin-ABC/bitcoin-abc
aff7e41f00bef9d52786c6cffb49faca5c84d32e
contrib/buildbot/phabricator_wrapper.py
python
PhabWrapper.get_project_members
(self, project_PHID)
return [m["phid"] for m in project_data[0]["attachments"]["members"]["members"]]
Return a list of user PHIDs corresponding to the ABC members
Return a list of user PHIDs corresponding to the ABC members
[ "Return", "a", "list", "of", "user", "PHIDs", "corresponding", "to", "the", "ABC", "members" ]
def get_project_members(self, project_PHID): """ Return a list of user PHIDs corresponding to the ABC members """ project_data = self.project.search( constraints={ "phids": [project_PHID], }, attachments={ "members": True, }...
[ "def", "get_project_members", "(", "self", ",", "project_PHID", ")", ":", "project_data", "=", "self", ".", "project", ".", "search", "(", "constraints", "=", "{", "\"phids\"", ":", "[", "project_PHID", "]", ",", "}", ",", "attachments", "=", "{", "\"membe...
https://github.com/Bitcoin-ABC/bitcoin-abc/blob/aff7e41f00bef9d52786c6cffb49faca5c84d32e/contrib/buildbot/phabricator_wrapper.py#L296-L314
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/logging/handlers.py
python
DatagramHandler.__init__
(self, host, port)
Initializes the handler with a specific host address and port.
Initializes the handler with a specific host address and port.
[ "Initializes", "the", "handler", "with", "a", "specific", "host", "address", "and", "port", "." ]
def __init__(self, host, port): """ Initializes the handler with a specific host address and port. """ SocketHandler.__init__(self, host, port) self.closeOnError = 0
[ "def", "__init__", "(", "self", ",", "host", ",", "port", ")", ":", "SocketHandler", ".", "__init__", "(", "self", ",", "host", ",", "port", ")", "self", ".", "closeOnError", "=", "0" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/logging/handlers.py#L568-L573
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/module/executor_group.py
python
DataParallelExecutorGroup.get_params
(self, arg_params, aux_params)
Copy data from each executor to `arg_params` and `aux_params`. Parameters ---------- arg_params : list of NDArray Target parameter arrays. aux_params : list of NDArray Target aux arrays. Notes ----- - This function will inplace update the...
Copy data from each executor to `arg_params` and `aux_params`.
[ "Copy", "data", "from", "each", "executor", "to", "arg_params", "and", "aux_params", "." ]
def get_params(self, arg_params, aux_params): """ Copy data from each executor to `arg_params` and `aux_params`. Parameters ---------- arg_params : list of NDArray Target parameter arrays. aux_params : list of NDArray Target aux arrays. Notes ...
[ "def", "get_params", "(", "self", ",", "arg_params", ",", "aux_params", ")", ":", "for", "name", ",", "block", "in", "zip", "(", "self", ".", "param_names", ",", "self", ".", "param_arrays", ")", ":", "weight", "=", "sum", "(", "w", ".", "copyto", "(...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/module/executor_group.py#L373-L392
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py
python
StretchTool.activate
(self, canvas=None)
This call by metacanvas signals that the tool has been activated and can now interact with metacanvas.
This call by metacanvas signals that the tool has been activated and can now interact with metacanvas.
[ "This", "call", "by", "metacanvas", "signals", "that", "the", "tool", "has", "been", "activated", "and", "can", "now", "interact", "with", "metacanvas", "." ]
def activate(self, canvas=None): """ This call by metacanvas signals that the tool has been activated and can now interact with metacanvas. """ self.activate_select(canvas) self.is_animated = False self._is_active = True
[ "def", "activate", "(", "self", ",", "canvas", "=", "None", ")", ":", "self", ".", "activate_select", "(", "canvas", ")", "self", ".", "is_animated", "=", "False", "self", ".", "_is_active", "=", "True" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py#L1382-L1389
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
scripts/run_benchmark.py
python
CaffeBenchmark.run_benchmark
(self)
run intelcaffe training benchmark
run intelcaffe training benchmark
[ "run", "intelcaffe", "training", "benchmark" ]
def run_benchmark(self): '''run intelcaffe training benchmark''' self.detect_cpu() logging.info("Cpu model: {}".format(self.model_string)) if self.topology == 'all_train': for model in self.support_topologies: if model == 'all_train': conti...
[ "def", "run_benchmark", "(", "self", ")", ":", "self", ".", "detect_cpu", "(", ")", "logging", ".", "info", "(", "\"Cpu model: {}\"", ".", "format", "(", "self", ".", "model_string", ")", ")", "if", "self", ".", "topology", "==", "'all_train'", ":", "for...
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/scripts/run_benchmark.py#L418-L441
Atarity/Lightpack
4dee73a443cba4c4073291febe450e6c1941f3af
Software/apiexamples/liOSC/OSC.py
python
OSCRequestHandler.dispatchMessage
(self, pattern, tags, data)
return replies
Attmept to match the given OSC-address pattern, which may contain '*', against all callbacks registered with the OSCServer. Calls the matching callback and returns whatever it returns. If no match is found, and a 'default' callback is registered, it calls that one, or raises NoCallbackError if a 'default' callb...
Attmept to match the given OSC-address pattern, which may contain '*', against all callbacks registered with the OSCServer. Calls the matching callback and returns whatever it returns. If no match is found, and a 'default' callback is registered, it calls that one, or raises NoCallbackError if a 'default' callb...
[ "Attmept", "to", "match", "the", "given", "OSC", "-", "address", "pattern", "which", "may", "contain", "*", "against", "all", "callbacks", "registered", "with", "the", "OSCServer", ".", "Calls", "the", "matching", "callback", "and", "returns", "whatever", "it"...
def dispatchMessage(self, pattern, tags, data): """Attmept to match the given OSC-address pattern, which may contain '*', against all callbacks registered with the OSCServer. Calls the matching callback and returns whatever it returns. If no match is found, and a 'default' callback is registered, it calls that ...
[ "def", "dispatchMessage", "(", "self", ",", "pattern", ",", "tags", ",", "data", ")", ":", "if", "len", "(", "tags", ")", "!=", "len", "(", "data", ")", ":", "raise", "OSCServerError", "(", "\"Malformed OSC-message; got %d typetags [%s] vs. %d values\"", "%", ...
https://github.com/Atarity/Lightpack/blob/4dee73a443cba4c4073291febe450e6c1941f3af/Software/apiexamples/liOSC/OSC.py#L1612-L1650
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Misc.tk_setPalette
(self, *args, **kw)
Set a new color scheme for all widget elements. A single color as argument will cause that all colors of Tk widget elements are derived from this. Alternatively several keyword parameters and its associated colors can be given. The following keywords are valid: activeBackground,...
Set a new color scheme for all widget elements.
[ "Set", "a", "new", "color", "scheme", "for", "all", "widget", "elements", "." ]
def tk_setPalette(self, *args, **kw): """Set a new color scheme for all widget elements. A single color as argument will cause that all colors of Tk widget elements are derived from this. Alternatively several keyword parameters and its associated colors can be given. The follow...
[ "def", "tk_setPalette", "(", "self", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "self", ".", "tk", ".", "call", "(", "(", "'tk_setPalette'", ",", ")", "+", "_flatten", "(", "args", ")", "+", "_flatten", "(", "kw", ".", "items", "(", ")", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L411-L423
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/pkg_resources/__init__.py
python
register_namespace_handler
(importer_type, namespace_handler)
Register `namespace_handler` to declare namespace packages `importer_type` is the type or class of a PEP 302 "Importer" (sys.path item handler), and `namespace_handler` is a callable like this:: def namespace_handler(importer, path_entry, moduleName, module): # return a path_entry to use f...
Register `namespace_handler` to declare namespace packages
[ "Register", "namespace_handler", "to", "declare", "namespace", "packages" ]
def register_namespace_handler(importer_type, namespace_handler): """Register `namespace_handler` to declare namespace packages `importer_type` is the type or class of a PEP 302 "Importer" (sys.path item handler), and `namespace_handler` is a callable like this:: def namespace_handler(importer, pa...
[ "def", "register_namespace_handler", "(", "importer_type", ",", "namespace_handler", ")", ":", "_namespace_handlers", "[", "importer_type", "]", "=", "namespace_handler" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/__init__.py#L2173-L2188
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
utils/vim-lldb/python-vim-lldb/lldb_controller.py
python
returnCompleteCommand
(a, l, p)
Returns a "\n"-separated string with possible completion results for command a with length l and cursor at p.
Returns a "\n"-separated string with possible completion results for command a with length l and cursor at p.
[ "Returns", "a", "\\", "n", "-", "separated", "string", "with", "possible", "completion", "results", "for", "command", "a", "with", "length", "l", "and", "cursor", "at", "p", "." ]
def returnCompleteCommand(a, l, p): """ Returns a "\n"-separated string with possible completion results for command a with length l and cursor at p. """ separator = "\n" results = ctrl.completeCommand(a, l, p) vim.command('return "%s%s"' % (separator.join(results), separator))
[ "def", "returnCompleteCommand", "(", "a", ",", "l", ",", "p", ")", ":", "separator", "=", "\"\\n\"", "results", "=", "ctrl", ".", "completeCommand", "(", "a", ",", "l", ",", "p", ")", "vim", ".", "command", "(", "'return \"%s%s\"'", "%", "(", "separato...
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/utils/vim-lldb/python-vim-lldb/lldb_controller.py#L390-L396
fengbingchun/NN_Test
d6305825d5273e4569ccd1eda9ffa2a9c72e18d2
src/tiny-dnn/third_party/gemmlowp/meta/generators/gemm_MxNxK.py
python
GenerateGemm
(emitter, output_type, aligned, rows, cols, leftovers)
Build one gemm function for given row, col, and depth leftovers.
Build one gemm function for given row, col, and depth leftovers.
[ "Build", "one", "gemm", "function", "for", "given", "row", "col", "and", "depth", "leftovers", "." ]
def GenerateGemm(emitter, output_type, aligned, rows, cols, leftovers): """Build one gemm function for given row, col, and depth leftovers.""" emitter.EmitFunctionBeginA( BuildName(output_type, aligned, rows, cols, leftovers), GetStridedGemmParameters(output_type), 'void') emitter.EmitAssert('m %% 3 ...
[ "def", "GenerateGemm", "(", "emitter", ",", "output_type", ",", "aligned", ",", "rows", ",", "cols", ",", "leftovers", ")", ":", "emitter", ".", "EmitFunctionBeginA", "(", "BuildName", "(", "output_type", ",", "aligned", ",", "rows", ",", "cols", ",", "lef...
https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/gemmlowp/meta/generators/gemm_MxNxK.py#L210-L235
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Window.GetClientRect
(*args, **kwargs)
return _core_.Window_GetClientRect(*args, **kwargs)
GetClientRect(self) -> Rect Get the client area position and size as a `wx.Rect` object.
GetClientRect(self) -> Rect
[ "GetClientRect", "(", "self", ")", "-", ">", "Rect" ]
def GetClientRect(*args, **kwargs): """ GetClientRect(self) -> Rect Get the client area position and size as a `wx.Rect` object. """ return _core_.Window_GetClientRect(*args, **kwargs)
[ "def", "GetClientRect", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_GetClientRect", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L9555-L9561
DLR-SC/tigl
d1c5901e948e33d10b1f9659ff3e22c4717b455f
thirdparty/nsiqcppstyle/nsiqcppstyle_rulemanager.py
python
RollbackImporter.__init__
(self)
Creates an instance and installs as the global importer
Creates an instance and installs as the global importer
[ "Creates", "an", "instance", "and", "installs", "as", "the", "global", "importer" ]
def __init__(self): "Creates an instance and installs as the global importer" self.previousModules = sys.modules.copy() self.realImport = __builtins__["__import__"] __builtins__["__import__"] = self._import self.newModules = {}
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "previousModules", "=", "sys", ".", "modules", ".", "copy", "(", ")", "self", ".", "realImport", "=", "__builtins__", "[", "\"__import__\"", "]", "__builtins__", "[", "\"__import__\"", "]", "=", "self"...
https://github.com/DLR-SC/tigl/blob/d1c5901e948e33d10b1f9659ff3e22c4717b455f/thirdparty/nsiqcppstyle/nsiqcppstyle_rulemanager.py#L238-L243
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/protobuf/python/google/protobuf/descriptor_database.py
python
_ExtractSymbols
(desc_proto, package)
Pulls out all the symbols from a descriptor proto. Args: desc_proto: The proto to extract symbols from. package: The package containing the descriptor type. Yields: The fully qualified name found in the descriptor.
Pulls out all the symbols from a descriptor proto.
[ "Pulls", "out", "all", "the", "symbols", "from", "a", "descriptor", "proto", "." ]
def _ExtractSymbols(desc_proto, package): """Pulls out all the symbols from a descriptor proto. Args: desc_proto: The proto to extract symbols from. package: The package containing the descriptor type. Yields: The fully qualified name found in the descriptor. """ message_name = '.'.join((packag...
[ "def", "_ExtractSymbols", "(", "desc_proto", ",", "package", ")", ":", "message_name", "=", "'.'", ".", "join", "(", "(", "package", ",", "desc_proto", ".", "name", ")", ")", "yield", "message_name", "for", "nested_type", "in", "desc_proto", ".", "nested_typ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/descriptor_database.py#L103-L120
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py
python
ParserElement.__add__
(self, other)
return And([self, other])
Implementation of + operator - returns :class:`And`. Adding strings to a ParserElement converts them to :class:`Literal`s by default. Example:: greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello...
[]
def __add__(self, other): """ Implementation of + operator - returns :class:`And`. Adding strings to a ParserElement converts them to :class:`Literal`s by default. Example:: greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" ...
[ "def", "__add__", "(", "self", ",", "other", ")", ":", "if", "other", "is", "Ellipsis", ":", "return", "_PendingSkip", "(", "self", ")", "if", "isinstance", "(", "other", ",", "basestring", ")", ":", "other", "=", "self", ".", "_literalStringClass", "(",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py#L4275-L4347
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/_config/config.py
python
_build_option_description
(k: str)
return s
Builds a formatted description of a registered option and prints it
Builds a formatted description of a registered option and prints it
[ "Builds", "a", "formatted", "description", "of", "a", "registered", "option", "and", "prints", "it" ]
def _build_option_description(k: str) -> str: """Builds a formatted description of a registered option and prints it""" o = _get_registered_option(k) d = _get_deprecated_option(k) s = f"{k} " if o.doc: s += "\n".join(o.doc.strip().split("\n")) else: s += "No description availab...
[ "def", "_build_option_description", "(", "k", ":", "str", ")", "->", "str", ":", "o", "=", "_get_registered_option", "(", "k", ")", "d", "=", "_get_deprecated_option", "(", "k", ")", "s", "=", "f\"{k} \"", "if", "o", ".", "doc", ":", "s", "+=", "\"\\n\...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/_config/config.py#L645-L666
InsightSoftwareConsortium/ITK
87acfce9a93d928311c38bc371b666b515b9f19d
Modules/ThirdParty/pygccxml/src/pygccxml/utils/utils.py
python
cxx_standard.__init__
(self, cflags)
Class constructor that parses the XML generator's command line Args: cflags (str): cflags command line arguments passed to the XML generator
Class constructor that parses the XML generator's command line
[ "Class", "constructor", "that", "parses", "the", "XML", "generator", "s", "command", "line" ]
def __init__(self, cflags): """Class constructor that parses the XML generator's command line Args: cflags (str): cflags command line arguments passed to the XML generator """ super(cxx_standard, self).__init__() self._stdcxx = None self._is_...
[ "def", "__init__", "(", "self", ",", "cflags", ")", ":", "super", "(", "cxx_standard", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "_stdcxx", "=", "None", "self", ".", "_is_implicit", "=", "False", "for", "key", "in", "cxx_standard", ".",...
https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/utils/utils.py#L306-L329
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/idlelib/run.py
python
exit
()
Exit subprocess, possibly after first deleting sys.exitfunc If config-main.cfg/.def 'General' 'delete-exitfunc' is True, then any sys.exitfunc will be removed before exiting. (VPython support)
Exit subprocess, possibly after first deleting sys.exitfunc
[ "Exit", "subprocess", "possibly", "after", "first", "deleting", "sys", ".", "exitfunc" ]
def exit(): """Exit subprocess, possibly after first deleting sys.exitfunc If config-main.cfg/.def 'General' 'delete-exitfunc' is True, then any sys.exitfunc will be removed before exiting. (VPython support) """ if no_exitfunc: try: del sys.exitfunc except AttributeErr...
[ "def", "exit", "(", ")", ":", "if", "no_exitfunc", ":", "try", ":", "del", "sys", ".", "exitfunc", "except", "AttributeError", ":", "pass", "capture_warnings", "(", "False", ")", "sys", ".", "exit", "(", "0", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/run.py#L229-L242
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBCommandReturnObject.PutOutput
(self, *args)
return _lldb.SBCommandReturnObject_PutOutput(self, *args)
PutOutput(self, FILE fh) -> size_t
PutOutput(self, FILE fh) -> size_t
[ "PutOutput", "(", "self", "FILE", "fh", ")", "-", ">", "size_t" ]
def PutOutput(self, *args): """PutOutput(self, FILE fh) -> size_t""" return _lldb.SBCommandReturnObject_PutOutput(self, *args)
[ "def", "PutOutput", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBCommandReturnObject_PutOutput", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L2322-L2324
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/callback.py
python
Speedometer.__call__
(self, param)
Callback to Show speed.
Callback to Show speed.
[ "Callback", "to", "Show", "speed", "." ]
def __call__(self, param): """Callback to Show speed.""" count = param.nbatch if self.last_count > count: self.init = False self.last_count = count if self.init: if count % self.frequent == 0: speed = self.frequent * self.batch_size / (tim...
[ "def", "__call__", "(", "self", ",", "param", ")", ":", "count", "=", "param", ".", "nbatch", "if", "self", ".", "last_count", ">", "count", ":", "self", ".", "init", "=", "False", "self", ".", "last_count", "=", "count", "if", "self", ".", "init", ...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/callback.py#L150-L173
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextLine.GetRange
(*args, **kwargs)
return _richtext.RichTextLine_GetRange(*args, **kwargs)
GetRange(self) -> RichTextRange
GetRange(self) -> RichTextRange
[ "GetRange", "(", "self", ")", "-", ">", "RichTextRange" ]
def GetRange(*args, **kwargs): """GetRange(self) -> RichTextRange""" return _richtext.RichTextLine_GetRange(*args, **kwargs)
[ "def", "GetRange", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextLine_GetRange", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1911-L1913
smilehao/xlua-framework
a03801538be2b0e92d39332d445b22caca1ef61f
ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/python_message.py
python
_IsPresent
(item)
Given a (FieldDescriptor, value) tuple from _fields, return true if the value should be included in the list returned by ListFields().
Given a (FieldDescriptor, value) tuple from _fields, return true if the value should be included in the list returned by ListFields().
[ "Given", "a", "(", "FieldDescriptor", "value", ")", "tuple", "from", "_fields", "return", "true", "if", "the", "value", "should", "be", "included", "in", "the", "list", "returned", "by", "ListFields", "()", "." ]
def _IsPresent(item): """Given a (FieldDescriptor, value) tuple from _fields, return true if the value should be included in the list returned by ListFields().""" if item[0].label == _FieldDescriptor.LABEL_REPEATED: return bool(item[1]) elif item[0].cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE: return ...
[ "def", "_IsPresent", "(", "item", ")", ":", "if", "item", "[", "0", "]", ".", "label", "==", "_FieldDescriptor", ".", "LABEL_REPEATED", ":", "return", "bool", "(", "item", "[", "1", "]", ")", "elif", "item", "[", "0", "]", ".", "cpp_type", "==", "_...
https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/python_message.py#L562-L571
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/numbers.py
python
Integral.__rrshift__
(self, other)
other >> self
other >> self
[ "other", ">>", "self" ]
def __rrshift__(self, other): """other >> self""" raise NotImplementedError
[ "def", "__rrshift__", "(", "self", ",", "other", ")", ":", "raise", "NotImplementedError" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/numbers.py#L336-L338
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/models/ModelParser.py
python
ModelParser.getChannelsList
(self, obj)
return channel_instance_name_list
Return list of telemetry channels
Return list of telemetry channels
[ "Return", "list", "of", "telemetry", "channels" ]
def getChannelsList(self, obj): """ Return list of telemetry channels """ channel_instance_name_list = [] for channel in obj.get_channels(): i = channel.get_ids() n = channel.get_name() t = channel.get_type() ti = None i...
[ "def", "getChannelsList", "(", "self", ",", "obj", ")", ":", "channel_instance_name_list", "=", "[", "]", "for", "channel", "in", "obj", ".", "get_channels", "(", ")", ":", "i", "=", "channel", ".", "get_ids", "(", ")", "n", "=", "channel", ".", "get_n...
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/models/ModelParser.py#L383-L404
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plotting_canvas_presenter.py
python
PlottingCanvasPresenter.set_axis_title
(self, ax_num, title)
Sets the title for a specified axis in the figure
Sets the title for a specified axis in the figure
[ "Sets", "the", "title", "for", "a", "specified", "axis", "in", "the", "figure" ]
def set_axis_title(self, ax_num, title): """Sets the title for a specified axis in the figure""" self._view.set_title(ax_num, title)
[ "def", "set_axis_title", "(", "self", ",", "ax_num", ",", "title", ")", ":", "self", ".", "_view", ".", "set_title", "(", "ax_num", ",", "title", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plotting_canvas_presenter.py#L111-L113
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/sans/algorithm_detail/xml_shapes.py
python
finite_cylinder
(centre, radius, height, axis, shape_id='shape')
return '<cylinder id="' + str(shape_id) + '">' + \ '<centre-of-bottom-base x="' + str(centre[0]) + '" y="' + str(centre[1]) + '" z="' + str(centre[2]) + \ '" />' + \ '<axis x="' + str(axis[0]) + '" y="' + str(axis[1]) + '" z="' + str(axis[2]) + '" />' + \ '<radius val="' + st...
Generates xml code for an infintely long cylinder :param centre: a tuple for a point on the axis :param radius: cylinder radius :param height: cylinder height :param axis: cylinder orientation :param shape_id: a string to refer to the shape by :return the xml string
Generates xml code for an infintely long cylinder :param centre: a tuple for a point on the axis :param radius: cylinder radius :param height: cylinder height :param axis: cylinder orientation :param shape_id: a string to refer to the shape by :return the xml string
[ "Generates", "xml", "code", "for", "an", "infintely", "long", "cylinder", ":", "param", "centre", ":", "a", "tuple", "for", "a", "point", "on", "the", "axis", ":", "param", "radius", ":", "cylinder", "radius", ":", "param", "height", ":", "cylinder", "he...
def finite_cylinder(centre, radius, height, axis, shape_id='shape'): """ Generates xml code for an infintely long cylinder :param centre: a tuple for a point on the axis :param radius: cylinder radius :param height: cylinder height :param axis: cylinder orientation :p...
[ "def", "finite_cylinder", "(", "centre", ",", "radius", ",", "height", ",", "axis", ",", "shape_id", "=", "'shape'", ")", ":", "return", "'<cylinder id=\"'", "+", "str", "(", "shape_id", ")", "+", "'\">'", "+", "'<centre-of-bottom-base x=\"'", "+", "str", "(...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/algorithm_detail/xml_shapes.py#L53-L67
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/code_coverage/process_coverage.py
python
CleanPathNames
(dir)
Clean the pathnames of the HTML generated by genhtml. This method is required only for code coverage on Win32. Due to a known issue with reading from CIFS shares mounted on Linux, genhtml appends a ^M to every file name it reads from the Windows share, causing corrupt filenames in genhtml's output folder. A...
Clean the pathnames of the HTML generated by genhtml.
[ "Clean", "the", "pathnames", "of", "the", "HTML", "generated", "by", "genhtml", "." ]
def CleanPathNames(dir): """Clean the pathnames of the HTML generated by genhtml. This method is required only for code coverage on Win32. Due to a known issue with reading from CIFS shares mounted on Linux, genhtml appends a ^M to every file name it reads from the Windows share, causing corrupt filenames in ...
[ "def", "CleanPathNames", "(", "dir", ")", ":", "# Stip off the ^M characters that get appended to the file name", "for", "dirpath", ",", "dirname", ",", "filenames", "in", "os", ".", "walk", "(", "dir", ")", ":", "for", "file", "in", "filenames", ":", "file_clean"...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/code_coverage/process_coverage.py#L38-L57
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ctypes/__init__.py
python
create_string_buffer
(init, size=None)
create_string_buffer(aBytes) -> character array create_string_buffer(anInteger) -> character array create_string_buffer(aBytes, anInteger) -> character array
create_string_buffer(aBytes) -> character array create_string_buffer(anInteger) -> character array create_string_buffer(aBytes, anInteger) -> character array
[ "create_string_buffer", "(", "aBytes", ")", "-", ">", "character", "array", "create_string_buffer", "(", "anInteger", ")", "-", ">", "character", "array", "create_string_buffer", "(", "aBytes", "anInteger", ")", "-", ">", "character", "array" ]
def create_string_buffer(init, size=None): """create_string_buffer(aBytes) -> character array create_string_buffer(anInteger) -> character array create_string_buffer(aBytes, anInteger) -> character array """ if isinstance(init, bytes): if size is None: size = len(init)+1 ...
[ "def", "create_string_buffer", "(", "init", ",", "size", "=", "None", ")", ":", "if", "isinstance", "(", "init", ",", "bytes", ")", ":", "if", "size", "is", "None", ":", "size", "=", "len", "(", "init", ")", "+", "1", "buftype", "=", "c_char", "*",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ctypes/__init__.py#L47-L63
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/engine/training_generator_v1.py
python
model_iteration
(model, data, steps_per_epoch=None, epochs=1, verbose=1, callbacks=None, validation_data=None, validation_steps=None, validation_freq=1, cla...
return results
Loop function for arrays of data with modes TRAIN/TEST/PREDICT. Args: model: Keras Model instance. data: Either a tuple of NumPy/Tensor inputs (i.e. `(x,)` or `(x, y)` or `(x, y, sample_weights)`) or a generator or `keras.utils.data_utils.Sequence` object or Eager Iterator or Dataset. ...
Loop function for arrays of data with modes TRAIN/TEST/PREDICT.
[ "Loop", "function", "for", "arrays", "of", "data", "with", "modes", "TRAIN", "/", "TEST", "/", "PREDICT", "." ]
def model_iteration(model, data, steps_per_epoch=None, epochs=1, verbose=1, callbacks=None, validation_data=None, validation_steps=None, validation_freq=1, ...
[ "def", "model_iteration", "(", "model", ",", "data", ",", "steps_per_epoch", "=", "None", ",", "epochs", "=", "1", ",", "verbose", "=", "1", ",", "callbacks", "=", "None", ",", "validation_data", "=", "None", ",", "validation_steps", "=", "None", ",", "v...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/training_generator_v1.py#L39-L336
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/ir_utils.py
python
restore_copy_var_names
(blocks, save_copies, typemap)
restores variable names of user variables after applying copy propagation
restores variable names of user variables after applying copy propagation
[ "restores", "variable", "names", "of", "user", "variables", "after", "applying", "copy", "propagation" ]
def restore_copy_var_names(blocks, save_copies, typemap): """ restores variable names of user variables after applying copy propagation """ rename_dict = {} for (a, b) in save_copies: # a is string name, b is variable # if a is user variable and b is generated temporary and b is not ...
[ "def", "restore_copy_var_names", "(", "blocks", ",", "save_copies", ",", "typemap", ")", ":", "rename_dict", "=", "{", "}", "for", "(", "a", ",", "b", ")", "in", "save_copies", ":", "# a is string name, b is variable", "# if a is user variable and b is generated tempo...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/ir_utils.py#L1381-L1397
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/update/particle_filter.py
python
FilterUpdater.__eq__
(self, other)
return super().__eq__(other) and self._filters == other._filters
Return whether two objects are equivalent.
Return whether two objects are equivalent.
[ "Return", "whether", "two", "objects", "are", "equivalent", "." ]
def __eq__(self, other): """Return whether two objects are equivalent.""" return super().__eq__(other) and self._filters == other._filters
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "return", "super", "(", ")", ".", "__eq__", "(", "other", ")", "and", "self", ".", "_filters", "==", "other", ".", "_filters" ]
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/update/particle_filter.py#L96-L98
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/signal/windows/windows.py
python
nuttall
(M, sym=True)
return general_cosine(M, [0.3635819, 0.4891775, 0.1365995, 0.0106411], sym)
Return a minimum 4-term Blackman-Harris window according to Nuttall. This variation is called "Nuttall4c" by Heinzel. [2]_ Parameters ---------- M : int Number of points in the output window. If zero or less, an empty array is returned. sym : bool, optional When True (defau...
Return a minimum 4-term Blackman-Harris window according to Nuttall.
[ "Return", "a", "minimum", "4", "-", "term", "Blackman", "-", "Harris", "window", "according", "to", "Nuttall", "." ]
def nuttall(M, sym=True): """Return a minimum 4-term Blackman-Harris window according to Nuttall. This variation is called "Nuttall4c" by Heinzel. [2]_ Parameters ---------- M : int Number of points in the output window. If zero or less, an empty array is returned. sym : bool, ...
[ "def", "nuttall", "(", "M", ",", "sym", "=", "True", ")", ":", "return", "general_cosine", "(", "M", ",", "[", "0.3635819", ",", "0.4891775", ",", "0.1365995", ",", "0.0106411", "]", ",", "sym", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/windows/windows.py#L442-L498
RLBot/RLBot
34332b12cf158b3ef8dbf174ae67c53683368a9d
src/main/python/rlbot/utils/game_state_util.py
python
CarState.convert_to_flat
(self, builder)
return DesiredCarState.DesiredCarStateEnd(builder)
In this conversion, we always want to return a valid flatbuffer pointer even if all the contents are blank because sometimes we need to put empty car states into the car list to make the indices line up.
In this conversion, we always want to return a valid flatbuffer pointer even if all the contents are blank because sometimes we need to put empty car states into the car list to make the indices line up.
[ "In", "this", "conversion", "we", "always", "want", "to", "return", "a", "valid", "flatbuffer", "pointer", "even", "if", "all", "the", "contents", "are", "blank", "because", "sometimes", "we", "need", "to", "put", "empty", "car", "states", "into", "the", "...
def convert_to_flat(self, builder): """ In this conversion, we always want to return a valid flatbuffer pointer even if all the contents are blank because sometimes we need to put empty car states into the car list to make the indices line up. """ physics_offset = None if...
[ "def", "convert_to_flat", "(", "self", ",", "builder", ")", ":", "physics_offset", "=", "None", "if", "self", ".", "physics", "is", "None", "else", "self", ".", "physics", ".", "convert_to_flat", "(", "builder", ")", "DesiredCarState", ".", "DesiredCarStateSta...
https://github.com/RLBot/RLBot/blob/34332b12cf158b3ef8dbf174ae67c53683368a9d/src/main/python/rlbot/utils/game_state_util.py#L109-L126
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/bintrees/bintrees/treemixin.py
python
TreeMixin.symmetric_difference
(self, tree)
return self.__class__( ((key, self.get(key)) for key in rkeys) )
x.symmetric_difference(t1) -> Tree with keys in either T and t1 but not both
x.symmetric_difference(t1) -> Tree with keys in either T and t1 but not both
[ "x", ".", "symmetric_difference", "(", "t1", ")", "-", ">", "Tree", "with", "keys", "in", "either", "T", "and", "t1", "but", "not", "both" ]
def symmetric_difference(self, tree): """ x.symmetric_difference(t1) -> Tree with keys in either T and t1 but not both """ thiskeys = frozenset(self.keys()) rkeys = thiskeys.symmetric_difference(frozenset(tree.keys())) return self.__class__( ((key, self.get(key)) for key...
[ "def", "symmetric_difference", "(", "self", ",", "tree", ")", ":", "thiskeys", "=", "frozenset", "(", "self", ".", "keys", "(", ")", ")", "rkeys", "=", "thiskeys", ".", "symmetric_difference", "(", "frozenset", "(", "tree", ".", "keys", "(", ")", ")", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/bintrees/bintrees/treemixin.py#L616-L622
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PropertyGridManager.SelectProperty
(*args, **kwargs)
return _propgrid.PropertyGridManager_SelectProperty(*args, **kwargs)
SelectProperty(self, PGPropArg id, bool focus=False) -> bool
SelectProperty(self, PGPropArg id, bool focus=False) -> bool
[ "SelectProperty", "(", "self", "PGPropArg", "id", "bool", "focus", "=", "False", ")", "-", ">", "bool" ]
def SelectProperty(*args, **kwargs): """SelectProperty(self, PGPropArg id, bool focus=False) -> bool""" return _propgrid.PropertyGridManager_SelectProperty(*args, **kwargs)
[ "def", "SelectProperty", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGridManager_SelectProperty", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L3562-L3564
p4lang/behavioral-model
81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9
tools/cpplint.py
python
CheckVlogArguments
(filename, clean_lines, linenum, error)
Checks that VLOG() is only used for defining a logging level. For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and VLOG(FATAL) are not. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to ...
Checks that VLOG() is only used for defining a logging level.
[ "Checks", "that", "VLOG", "()", "is", "only", "used", "for", "defining", "a", "logging", "level", "." ]
def CheckVlogArguments(filename, clean_lines, linenum, error): """Checks that VLOG() is only used for defining a logging level. For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and VLOG(FATAL) are not. Args: filename: The name of the current file. clean_lines: A CleansedLines i...
[ "def", "CheckVlogArguments", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "Search", "(", "r'\\bVLOG\\((INFO|ERROR|WARNING|DFATAL|FATAL)\\)'", ",", "line", ")", ...
https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/cpplint.py#L2636-L2652
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/robotsim.py
python
GeneralizedIKSolver.solve
(self)
return _robotsim.GeneralizedIKSolver_solve(self)
solve(GeneralizedIKSolver self) -> PyObject * Tries to find a configuration that satifies all simultaneous objectives up to the desired tolerance. Returns: res,iters (pair of bool, int): res indicates whether x converged, and iters is the number of iterations used.
solve(GeneralizedIKSolver self) -> PyObject *
[ "solve", "(", "GeneralizedIKSolver", "self", ")", "-", ">", "PyObject", "*" ]
def solve(self): """ solve(GeneralizedIKSolver self) -> PyObject * Tries to find a configuration that satifies all simultaneous objectives up to the desired tolerance. Returns: res,iters (pair of bool, int): res indicates whether x converged, and iters is the number...
[ "def", "solve", "(", "self", ")", ":", "return", "_robotsim", ".", "GeneralizedIKSolver_solve", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L7074-L7087
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/feature_column/feature_column.py
python
_SharedEmbeddingColumn._get_dense_tensor_internal
(self, inputs, weight_collections=None, trainable=None)
Private method that follows the signature of _get_dense_tensor.
Private method that follows the signature of _get_dense_tensor.
[ "Private", "method", "that", "follows", "the", "signature", "of", "_get_dense_tensor", "." ]
def _get_dense_tensor_internal(self, inputs, weight_collections=None, trainable=None): """Private method that follows the signature of _get_dense_tensor.""" # This method is called from a variable_scope with name ...
[ "def", "_get_dense_tensor_internal", "(", "self", ",", "inputs", ",", "weight_collections", "=", "None", ",", "trainable", "=", "None", ")", ":", "# This method is called from a variable_scope with name _var_scope_name,", "# which is shared among all shared embeddings. Open a name_...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/feature_column/feature_column.py#L2640-L2708
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/cccc.py
python
Isotxs._read_file_ID
(self)
Reads the file identification block. This block is always present in the ISOTXS format and contains a label and file version number.
Reads the file identification block. This block is always present in the ISOTXS format and contains a label and file version number.
[ "Reads", "the", "file", "identification", "block", ".", "This", "block", "is", "always", "present", "in", "the", "ISOTXS", "format", "and", "contains", "a", "label", "and", "file", "version", "number", "." ]
def _read_file_ID(self): """Reads the file identification block. This block is always present in the ISOTXS format and contains a label and file version number. """ # Get first record from file fileID = self.get_fortran_record() # Read data from file identification reco...
[ "def", "_read_file_ID", "(", "self", ")", ":", "# Get first record from file", "fileID", "=", "self", ".", "get_fortran_record", "(", ")", "# Read data from file identification record", "self", ".", "label", "=", "fileID", ".", "get_string", "(", "24", ")", "[", "...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/cccc.py#L121-L131
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
xmlDoc.isID
(self, elem, attr)
return ret
Determine whether an attribute is of type ID. In case we have DTD(s) then this is done if DTD loading has been requested. In the case of HTML documents parsed with the HTML parser, then ID detection is done systematically.
Determine whether an attribute is of type ID. In case we have DTD(s) then this is done if DTD loading has been requested. In the case of HTML documents parsed with the HTML parser, then ID detection is done systematically.
[ "Determine", "whether", "an", "attribute", "is", "of", "type", "ID", ".", "In", "case", "we", "have", "DTD", "(", "s", ")", "then", "this", "is", "done", "if", "DTD", "loading", "has", "been", "requested", ".", "In", "the", "case", "of", "HTML", "doc...
def isID(self, elem, attr): """Determine whether an attribute is of type ID. In case we have DTD(s) then this is done if DTD loading has been requested. In the case of HTML documents parsed with the HTML parser, then ID detection is done systematically. """ if elem is None...
[ "def", "isID", "(", "self", ",", "elem", ",", "attr", ")", ":", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else", ":", "elem__o", "=", "elem", ".", "_o", "if", "attr", "is", "None", ":", "attr__o", "=", "None", "else", ":", "attr__...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L3816-L3826
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/lib/pretty.py
python
PrettyPrinter.break_
(self)
Explicitly insert a newline into the output, maintaining correct indentation.
Explicitly insert a newline into the output, maintaining correct indentation.
[ "Explicitly", "insert", "a", "newline", "into", "the", "output", "maintaining", "correct", "indentation", "." ]
def break_(self): """ Explicitly insert a newline into the output, maintaining correct indentation. """ group = self.group_queue.deq() if group: self._break_one_group(group) self.flush() self.output.write(self.newline) self.output.write(' ' * s...
[ "def", "break_", "(", "self", ")", ":", "group", "=", "self", ".", "group_queue", ".", "deq", "(", ")", "if", "group", ":", "self", ".", "_break_one_group", "(", "group", ")", "self", ".", "flush", "(", ")", "self", ".", "output", ".", "write", "("...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/lib/pretty.py#L250-L261
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/ndimage/filters.py
python
minimum_filter1d
(input, size, axis=-1, output=None, mode="reflect", cval=0.0, origin=0)
return return_value
Calculate a one-dimensional minimum filter along the given axis. The lines of the array along the given axis are filtered with a minimum filter of given size. Parameters ---------- %(input)s size : int length along which to calculate 1D minimum %(axis)s %(output)s %(mode)s ...
Calculate a one-dimensional minimum filter along the given axis.
[ "Calculate", "a", "one", "-", "dimensional", "minimum", "filter", "along", "the", "given", "axis", "." ]
def minimum_filter1d(input, size, axis=-1, output=None, mode="reflect", cval=0.0, origin=0): """Calculate a one-dimensional minimum filter along the given axis. The lines of the array along the given axis are filtered with a minimum filter of given size. Parameters ---------- ...
[ "def", "minimum_filter1d", "(", "input", ",", "size", ",", "axis", "=", "-", "1", ",", "output", "=", "None", ",", "mode", "=", "\"reflect\"", ",", "cval", "=", "0.0", ",", "origin", "=", "0", ")", ":", "input", "=", "numpy", ".", "asarray", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/ndimage/filters.py#L835-L876
physercoe/starquant
c00cad64d1de2da05081b3dc320ef264c6295e08
source/engine/strategy_engine.py
python
StrategyEngine.load_strategy_class
(self, reload: bool = False)
Load strategy class from source code.
Load strategy class from source code.
[ "Load", "strategy", "class", "from", "source", "code", "." ]
def load_strategy_class(self, reload: bool = False): """ Load strategy class from source code. """ # app_path = Path(__file__).parent.parent # path1 = app_path.joinpath("cta_strategy", "strategies") # self.load_strategy_class_from_folder( # path1, "vnpy.app.ct...
[ "def", "load_strategy_class", "(", "self", ",", "reload", ":", "bool", "=", "False", ")", ":", "# app_path = Path(__file__).parent.parent", "# path1 = app_path.joinpath(\"cta_strategy\", \"strategies\")", "# self.load_strategy_class_from_folder(", "# path1, \"vnpy.app.cta_strategy....
https://github.com/physercoe/starquant/blob/c00cad64d1de2da05081b3dc320ef264c6295e08/source/engine/strategy_engine.py#L618-L628
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
lldb/third_party/Python/module/pexpect-4.6/pexpect/pxssh.py
python
pxssh.try_read_prompt
(self, timeout_multiplier)
return prompt
This facilitates using communication timeouts to perform synchronization as quickly as possible, while supporting high latency connections with a tunable worst case performance. Fast connections should be read almost immediately. Worst case performance for this method is timeout_multipli...
This facilitates using communication timeouts to perform synchronization as quickly as possible, while supporting high latency connections with a tunable worst case performance. Fast connections should be read almost immediately. Worst case performance for this method is timeout_multipli...
[ "This", "facilitates", "using", "communication", "timeouts", "to", "perform", "synchronization", "as", "quickly", "as", "possible", "while", "supporting", "high", "latency", "connections", "with", "a", "tunable", "worst", "case", "performance", ".", "Fast", "connect...
def try_read_prompt(self, timeout_multiplier): '''This facilitates using communication timeouts to perform synchronization as quickly as possible, while supporting high latency connections with a tunable worst case performance. Fast connections should be read almost immediately. Worst ca...
[ "def", "try_read_prompt", "(", "self", ",", "timeout_multiplier", ")", ":", "# maximum time allowed to read the first response", "first_char_timeout", "=", "timeout_multiplier", "*", "0.5", "# maximum time allowed between subsequent characters", "inter_char_timeout", "=", "timeout_...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/third_party/Python/module/pexpect-4.6/pexpect/pxssh.py#L183-L213
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/cpplint.py
python
_AddFilters
(filters)
Adds more filter overrides. Unlike _SetFilters, this function does not reset the current list of filters available. Args: filters: A string of comma-separated filters (eg "whitespace/indent"). Each filter should start with + or -; else we die.
Adds more filter overrides.
[ "Adds", "more", "filter", "overrides", "." ]
def _AddFilters(filters): """Adds more filter overrides. Unlike _SetFilters, this function does not reset the current list of filters available. Args: filters: A string of comma-separated filters (eg "whitespace/indent"). Each filter should start with + or -; else we die. """ _cpplint_sta...
[ "def", "_AddFilters", "(", "filters", ")", ":", "_cpplint_state", ".", "AddFilters", "(", "filters", ")" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/cpplint.py#L1479-L1489
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
SplashScreen.GetTimeout
(*args, **kwargs)
return _windows_.SplashScreen_GetTimeout(*args, **kwargs)
GetTimeout(self) -> int
GetTimeout(self) -> int
[ "GetTimeout", "(", "self", ")", "-", ">", "int" ]
def GetTimeout(*args, **kwargs): """GetTimeout(self) -> int""" return _windows_.SplashScreen_GetTimeout(*args, **kwargs)
[ "def", "GetTimeout", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "SplashScreen_GetTimeout", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L1153-L1155
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/libdeps/libdeps/graph.py
python
LibdepsGraph.get_deptype
(self, deptype)
return self._deptypes[deptype]
Convert graphs deptypes from json string to dict, and return requested value.
Convert graphs deptypes from json string to dict, and return requested value.
[ "Convert", "graphs", "deptypes", "from", "json", "string", "to", "dict", "and", "return", "requested", "value", "." ]
def get_deptype(self, deptype): """Convert graphs deptypes from json string to dict, and return requested value.""" if not self._deptypes: self._deptypes = json.loads(self.graph.get('deptypes', "{}")) if self.graph['graph_schema_version'] == 1: # get and set the ...
[ "def", "get_deptype", "(", "self", ",", "deptype", ")", ":", "if", "not", "self", ".", "_deptypes", ":", "self", ".", "_deptypes", "=", "json", ".", "loads", "(", "self", ".", "graph", ".", "get", "(", "'deptypes'", ",", "\"{}\"", ")", ")", "if", "...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/libdeps/libdeps/graph.py#L108-L120
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPML_DIGEST_VALUES.fromBytes
(buffer)
return TpmBuffer(buffer).createObj(TPML_DIGEST_VALUES)
Returns new TPML_DIGEST_VALUES object constructed from its marshaled representation in the given byte buffer
Returns new TPML_DIGEST_VALUES object constructed from its marshaled representation in the given byte buffer
[ "Returns", "new", "TPML_DIGEST_VALUES", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "byte", "buffer" ]
def fromBytes(buffer): """ Returns new TPML_DIGEST_VALUES object constructed from its marshaled representation in the given byte buffer """ return TpmBuffer(buffer).createObj(TPML_DIGEST_VALUES)
[ "def", "fromBytes", "(", "buffer", ")", ":", "return", "TpmBuffer", "(", "buffer", ")", ".", "createObj", "(", "TPML_DIGEST_VALUES", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L4655-L4659
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/dashboard/controllers/_version.py
python
APIVersion.from_mime_type
(cls, mime_type: str)
return cls.from_string(cls.__MIME_TYPE_REGEX.match(mime_type).group(1))
>>> APIVersion.from_mime_type('application/vnd.ceph.api.v1.0+json') APIVersion(major=1, minor=0)
>>> APIVersion.from_mime_type('application/vnd.ceph.api.v1.0+json') APIVersion(major=1, minor=0)
[ ">>>", "APIVersion", ".", "from_mime_type", "(", "application", "/", "vnd", ".", "ceph", ".", "api", ".", "v1", ".", "0", "+", "json", ")", "APIVersion", "(", "major", "=", "1", "minor", "=", "0", ")" ]
def from_mime_type(cls, mime_type: str) -> 'APIVersion': """ >>> APIVersion.from_mime_type('application/vnd.ceph.api.v1.0+json') APIVersion(major=1, minor=0) """ return cls.from_string(cls.__MIME_TYPE_REGEX.match(mime_type).group(1))
[ "def", "from_mime_type", "(", "cls", ",", "mime_type", ":", "str", ")", "->", "'APIVersion'", ":", "return", "cls", ".", "from_string", "(", "cls", ".", "__MIME_TYPE_REGEX", ".", "match", "(", "mime_type", ")", ".", "group", "(", "1", ")", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/dashboard/controllers/_version.py#L35-L41
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
wrap/gtwrap/pybind_wrapper.py
python
PybindWrapper.wrap_variable
(self, namespace, module_var, variable, prefix='\n' + ' ' * 8)
return '{prefix}{module_var}.attr("{variable_name}") = {namespace}{variable_value};'.format( prefix=prefix, module_var=module_var, variable_name=variable.name, namespace=namespace, variable_value=variable_value)
Wrap a variable that's not part of a class (i.e. global)
Wrap a variable that's not part of a class (i.e. global)
[ "Wrap", "a", "variable", "that", "s", "not", "part", "of", "a", "class", "(", "i", ".", "e", ".", "global", ")" ]
def wrap_variable(self, namespace, module_var, variable, prefix='\n' + ' ' * 8): """ Wrap a variable that's not part of a class (i.e. global) """ variable_value = "" if variable.default is Non...
[ "def", "wrap_variable", "(", "self", ",", "namespace", ",", "module_var", ",", "variable", ",", "prefix", "=", "'\\n'", "+", "' '", "*", "8", ")", ":", "variable_value", "=", "\"\"", "if", "variable", ".", "default", "is", "None", ":", "variable_value", ...
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/wrap/gtwrap/pybind_wrapper.py#L268-L287
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.WriteLinkForArch
(self, ninja_file, spec, config_name, config, link_deps, arch=None)
return linked_binary
Write out a link step. Fills out target.binary.
Write out a link step. Fills out target.binary.
[ "Write", "out", "a", "link", "step", ".", "Fills", "out", "target", ".", "binary", "." ]
def WriteLinkForArch(self, ninja_file, spec, config_name, config, link_deps, arch=None): """Write out a link step. Fills out target.binary. """ command = { 'executable': 'link', 'loadable_module': 'solink_module', 'shared_library': 'solink', }[spec['type']] ...
[ "def", "WriteLinkForArch", "(", "self", ",", "ninja_file", ",", "spec", ",", "config_name", ",", "config", ",", "link_deps", ",", "arch", "=", "None", ")", ":", "command", "=", "{", "'executable'", ":", "'link'", ",", "'loadable_module'", ":", "'solink_modul...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py#L1088-L1261
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/messages.py
python
_MessageClass.__new__
(cls, name, bases, dct)
return _DefinitionClass.__new__(cls, name, bases, dct)
Create new Message class instance. The __new__ method of the _MessageClass type is overridden so as to allow the translation of Field instances to slots.
Create new Message class instance.
[ "Create", "new", "Message", "class", "instance", "." ]
def __new__(cls, name, bases, dct): """Create new Message class instance. The __new__ method of the _MessageClass type is overridden so as to allow the translation of Field instances to slots. """ by_number = {} by_name = {} variant_map = {} if bases != (object,): # Can only def...
[ "def", "__new__", "(", "cls", ",", "name", ",", "bases", ",", "dct", ")", ":", "by_number", "=", "{", "}", "by_name", "=", "{", "}", "variant_map", "=", "{", "}", "if", "bases", "!=", "(", "object", ",", ")", ":", "# Can only define one level of sub-cl...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/messages.py#L606-L669
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/lib/npyio.py
python
seek_gzip_factory
(f)
return f
Use this factory to produce the class so that we can do a lazy import on gzip.
Use this factory to produce the class so that we can do a lazy import on gzip.
[ "Use", "this", "factory", "to", "produce", "the", "class", "so", "that", "we", "can", "do", "a", "lazy", "import", "on", "gzip", "." ]
def seek_gzip_factory(f): """Use this factory to produce the class so that we can do a lazy import on gzip. """ import gzip class GzipFile(gzip.GzipFile): def seek(self, offset, whence=0): # figure out new position (we can only seek forwards) if whence == 1: ...
[ "def", "seek_gzip_factory", "(", "f", ")", ":", "import", "gzip", "class", "GzipFile", "(", "gzip", ".", "GzipFile", ")", ":", "def", "seek", "(", "self", ",", "offset", ",", "whence", "=", "0", ")", ":", "# figure out new position (we can only seek forwards)"...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/npyio.py#L32-L76
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py
python
_WasGypIncludeFileModified
(params, files)
return False
Returns true if one of the files in |files| is in the set of included files.
Returns true if one of the files in |files| is in the set of included files.
[ "Returns", "true", "if", "one", "of", "the", "files", "in", "|files|", "is", "in", "the", "set", "of", "included", "files", "." ]
def _WasGypIncludeFileModified(params, files): """Returns true if one of the files in |files| is in the set of included files.""" if params['options'].includes: for include in params['options'].includes: if _ToGypPath(os.path.normpath(include)) in files: print('Include file modified, assuming al...
[ "def", "_WasGypIncludeFileModified", "(", "params", ",", "files", ")", ":", "if", "params", "[", "'options'", "]", ".", "includes", ":", "for", "include", "in", "params", "[", "'options'", "]", ".", "includes", ":", "if", "_ToGypPath", "(", "os", ".", "p...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py#L555-L563
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/altgraph/altgraph/Graph.py
python
Graph.out_edges
(self, node)
return None
Returns a list of the outgoing edges
Returns a list of the outgoing edges
[ "Returns", "a", "list", "of", "the", "outgoing", "edges" ]
def out_edges(self, node): """ Returns a list of the outgoing edges """ try: return list(self.nodes[node][1]) except KeyError: raise GraphError('Invalid node %s' % node) return None
[ "def", "out_edges", "(", "self", ",", "node", ")", ":", "try", ":", "return", "list", "(", "self", ".", "nodes", "[", "node", "]", "[", "1", "]", ")", "except", "KeyError", ":", "raise", "GraphError", "(", "'Invalid node %s'", "%", "node", ")", "retu...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/altgraph/altgraph/Graph.py#L337-L346
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/dataview.py
python
DataViewTreeStore.SetItemText
(*args, **kwargs)
return _dataview.DataViewTreeStore_SetItemText(*args, **kwargs)
SetItemText(self, DataViewItem item, String text)
SetItemText(self, DataViewItem item, String text)
[ "SetItemText", "(", "self", "DataViewItem", "item", "String", "text", ")" ]
def SetItemText(*args, **kwargs): """SetItemText(self, DataViewItem item, String text)""" return _dataview.DataViewTreeStore_SetItemText(*args, **kwargs)
[ "def", "SetItemText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewTreeStore_SetItemText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L2411-L2413
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/clustering_ops.py
python
_InitializeClustersOpFactory.__init__
(self, inputs, num_clusters, initial_clusters, distance_metric, random_seed, kmeans_plus_plus_num_retries, kmc2_chain_length, cluster_centers, cluster_centers_updated, cluster_centers_initialized)
Creates an op factory. Args: inputs: See KMeans constructor. num_clusters: An integer Tensor providing the number of clusters. initial_clusters: See KMeans constructor. distance_metric: See KMeans constructor. random_seed: See KMeans constructor. kmeans_plus_plus_num_retries: Se...
Creates an op factory.
[ "Creates", "an", "op", "factory", "." ]
def __init__(self, inputs, num_clusters, initial_clusters, distance_metric, random_seed, kmeans_plus_plus_num_retries, kmc2_chain_length, cluster_centers, cluster_centers_updated, cluster_centers_initialized): """Creates an op factory. Args: inputs: See KMeans...
[ "def", "__init__", "(", "self", ",", "inputs", ",", "num_clusters", ",", "initial_clusters", ",", "distance_metric", ",", "random_seed", ",", "kmeans_plus_plus_num_retries", ",", "kmc2_chain_length", ",", "cluster_centers", ",", "cluster_centers_updated", ",", "cluster_...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/clustering_ops.py#L561-L598
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/numpy/utils_const.py
python
_check_shape
(shape)
return shape
check the shape param to match the numpy style
check the shape param to match the numpy style
[ "check", "the", "shape", "param", "to", "match", "the", "numpy", "style" ]
def _check_shape(shape): """check the shape param to match the numpy style""" if not isinstance(shape, (int, tuple, list, typing.Tuple, typing.List)): raise TypeError(f"only int, tuple and list are allowed for shape, but got {type(shape)}") if isinstance(shape, int): shape = (shape,) if ...
[ "def", "_check_shape", "(", "shape", ")", ":", "if", "not", "isinstance", "(", "shape", ",", "(", "int", ",", "tuple", ",", "list", ",", "typing", ".", "Tuple", ",", "typing", ".", "List", ")", ")", ":", "raise", "TypeError", "(", "f\"only int, tuple a...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/utils_const.py#L37-L50
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/gettext.py
python
c2py
(plural)
Gets a C expression as used in PO files for plural forms and returns a Python function that implements an equivalent expression.
Gets a C expression as used in PO files for plural forms and returns a Python function that implements an equivalent expression.
[ "Gets", "a", "C", "expression", "as", "used", "in", "PO", "files", "for", "plural", "forms", "and", "returns", "a", "Python", "function", "that", "implements", "an", "equivalent", "expression", "." ]
def c2py(plural): """Gets a C expression as used in PO files for plural forms and returns a Python function that implements an equivalent expression. """ if len(plural) > 1000: raise ValueError('plural form expression is too long') try: result, nexttok = _parse(_tokenize(plural)) ...
[ "def", "c2py", "(", "plural", ")", ":", "if", "len", "(", "plural", ")", ">", "1000", ":", "raise", "ValueError", "(", "'plural form expression is too long'", ")", "try", ":", "result", ",", "nexttok", "=", "_parse", "(", "_tokenize", "(", "plural", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/gettext.py#L175-L208
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/robotsim.py
python
Simulator.enableContactFeedbackAll
(self)
return _robotsim.Simulator_enableContactFeedbackAll(self)
enableContactFeedbackAll(Simulator self) Call this to enable contact feedback between all pairs of objects. Contact feedback has a small overhead so you may want to do this selectively.
enableContactFeedbackAll(Simulator self)
[ "enableContactFeedbackAll", "(", "Simulator", "self", ")" ]
def enableContactFeedbackAll(self): """ enableContactFeedbackAll(Simulator self) Call this to enable contact feedback between all pairs of objects. Contact feedback has a small overhead so you may want to do this selectively. """ return _robotsim.Simulator_enableCon...
[ "def", "enableContactFeedbackAll", "(", "self", ")", ":", "return", "_robotsim", ".", "Simulator_enableContactFeedbackAll", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L8368-L8378
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usdImaging/usdviewq/selectionDataModel.py
python
SelectionDataModel.removeUnpopulatedPrims
(self)
Remove all prim paths whose corresponding prims do not currently exist on the stage. It is the application's responsibility to call this method while it is processing changes to the stage, *before* querying this object for selections. Because this is a synchronization operation rather ...
Remove all prim paths whose corresponding prims do not currently exist on the stage. It is the application's responsibility to call this method while it is processing changes to the stage, *before* querying this object for selections. Because this is a synchronization operation rather ...
[ "Remove", "all", "prim", "paths", "whose", "corresponding", "prims", "do", "not", "currently", "exist", "on", "the", "stage", ".", "It", "is", "the", "application", "s", "responsibility", "to", "call", "this", "method", "while", "it", "is", "processing", "ch...
def removeUnpopulatedPrims(self): """Remove all prim paths whose corresponding prims do not currently exist on the stage. It is the application's responsibility to call this method while it is processing changes to the stage, *before* querying this object for selections. Because this i...
[ "def", "removeUnpopulatedPrims", "(", "self", ")", ":", "stage", "=", "self", ".", "_rootDataModel", ".", "stage", "self", ".", "_primSelection", ".", "removeMatchingPaths", "(", "lambda", "path", ":", "not", "stage", ".", "GetPrimAtPath", "(", "path", ")", ...
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/selectionDataModel.py#L781-L791
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py
python
DataFeeder.__init__
( self, x, y, n_classes, batch_size=None, shuffle=True, random_state=None, epochs=None)
Initializes a DataFeeder instance. Args: x: Feature Nd numpy matrix of shape `[n_samples, n_features, ...]`. y: Target vector, either floats for regression or class id for classification. If matrix, will consider as a sequence of targets. Can be `None` for unsupervised setting. n_...
Initializes a DataFeeder instance.
[ "Initializes", "a", "DataFeeder", "instance", "." ]
def __init__( self, x, y, n_classes, batch_size=None, shuffle=True, random_state=None, epochs=None): """Initializes a DataFeeder instance. Args: x: Feature Nd numpy matrix of shape `[n_samples, n_features, ...]`. y: Target vector, either floats for regression or class id for cla...
[ "def", "__init__", "(", "self", ",", "x", ",", "y", ",", "n_classes", ",", "batch_size", "=", "None", ",", "shuffle", "=", "True", ",", "random_state", "=", "None", ",", "epochs", "=", "None", ")", ":", "self", ".", "_x", "=", "check_array", "(", "...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py#L220-L280
ApolloAuto/apollo
463fb82f9e979d02dcb25044e60931293ab2dba0
tools/bootstrap.py
python
get_native_cuda_compute_capabilities
(environ_cp)
return output
Get native cuda compute capabilities. Args: environ_cp: copy of the os.environ. Returns: string of native cuda compute capabilities, separated by comma.
Get native cuda compute capabilities.
[ "Get", "native", "cuda", "compute", "capabilities", "." ]
def get_native_cuda_compute_capabilities(environ_cp): """Get native cuda compute capabilities. Args: environ_cp: copy of the os.environ. Returns: string of native cuda compute capabilities, separated by comma. """ device_query_bin = os.path.join( environ_cp.get('CUDA_TOOLKIT_PA...
[ "def", "get_native_cuda_compute_capabilities", "(", "environ_cp", ")", ":", "device_query_bin", "=", "os", ".", "path", ".", "join", "(", "environ_cp", ".", "get", "(", "'CUDA_TOOLKIT_PATH'", ")", ",", "'extras/demo_suite/deviceQuery'", ")", "if", "os", ".", "path...
https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/tools/bootstrap.py#L708-L730
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py
python
normalize_line_endings
(lines, newline)
return [line.rstrip('\n\r') + newline for line in lines]
Return fixed line endings. All lines will be modified to use the most common line ending.
Return fixed line endings.
[ "Return", "fixed", "line", "endings", "." ]
def normalize_line_endings(lines, newline): """Return fixed line endings. All lines will be modified to use the most common line ending. """ return [line.rstrip('\n\r') + newline for line in lines]
[ "def", "normalize_line_endings", "(", "lines", ",", "newline", ")", ":", "return", "[", "line", ".", "rstrip", "(", "'\\n\\r'", ")", "+", "newline", "for", "line", "in", "lines", "]" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py#L2786-L2792
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mhlib.py
python
Folder.getlast
(self)
return self.last
Return the last message number.
Return the last message number.
[ "Return", "the", "last", "message", "number", "." ]
def getlast(self): """Return the last message number.""" if not hasattr(self, 'last'): self.listmessages() # Set self.last return self.last
[ "def", "getlast", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'last'", ")", ":", "self", ".", "listmessages", "(", ")", "# Set self.last", "return", "self", ".", "last" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mhlib.py#L649-L653
apple/swift-llbuild
25333daca549aed69004c9b3d4c6b69d3f32d1d0
bindings/python/llbuild.py
python
BuildEngine.task_discovered_dependency
(self, task, key)
\ task_discovered_dependency(task, key) Inform the engine of an input dependency that was discovered by the task during its execution, a la compiler generated dependency files. This call may only be made after a task has received all of its inputs; inputs discovered prior to that point should simply be requested as n...
\ task_discovered_dependency(task, key)
[ "\\", "task_discovered_dependency", "(", "task", "key", ")" ]
def task_discovered_dependency(self, task, key): """\ task_discovered_dependency(task, key) Inform the engine of an input dependency that was discovered by the task during its execution, a la compiler generated dependency files. This call may only be made after a task has received all of its inputs; inputs di...
[ "def", "task_discovered_dependency", "(", "self", ",", "task", ",", "key", ")", ":", "key", "=", "_Data", "(", "key", ")", "libllbuild", ".", "llb_buildengine_task_must_follow", "(", "self", ".", "_engine", ",", "task", ".", "_task", ",", "key", ".", "key"...
https://github.com/apple/swift-llbuild/blob/25333daca549aed69004c9b3d4c6b69d3f32d1d0/bindings/python/llbuild.py#L274-L300
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
samples/pySketch/pySketch.py
python
DrawingFrame._buildStoredState
(self)
return info
Remember the current state of the document, to allow for undo. We make a copy of the document's contents, so that we can return to the previous contents if the user does something and then wants to undo the operation. Returns an object representing the current documen...
Remember the current state of the document, to allow for undo.
[ "Remember", "the", "current", "state", "of", "the", "document", "to", "allow", "for", "undo", "." ]
def _buildStoredState(self): """ Remember the current state of the document, to allow for undo. We make a copy of the document's contents, so that we can return to the previous contents if the user does something and then wants to undo the operation. Returns a...
[ "def", "_buildStoredState", "(", "self", ")", ":", "savedContents", "=", "[", "]", "for", "obj", "in", "self", ".", "contents", ":", "savedContents", ".", "append", "(", "[", "obj", ".", "__class__", ",", "obj", ".", "getData", "(", ")", "]", ")", "s...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/pySketch/pySketch.py#L1402-L1423
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
DateTime.GetCentury
(*args, **kwargs)
return _misc_.DateTime_GetCentury(*args, **kwargs)
GetCentury(int year=Inv_Year) -> int
GetCentury(int year=Inv_Year) -> int
[ "GetCentury", "(", "int", "year", "=", "Inv_Year", ")", "-", ">", "int" ]
def GetCentury(*args, **kwargs): """GetCentury(int year=Inv_Year) -> int""" return _misc_.DateTime_GetCentury(*args, **kwargs)
[ "def", "GetCentury", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_GetCentury", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L3707-L3709
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/generateParkingAreaRerouters.py
python
get_options
(cmd_args=None)
return options
Argument Parser.
Argument Parser.
[ "Argument", "Parser", "." ]
def get_options(cmd_args=None): """ Argument Parser. """ parser = sumolib.options.ArgumentParser( prog='generateParkingAreaRerouters.py', usage='%(prog)s [options]', description='Generate parking area rerouters from the parking area definition.') parser.add_argument( '-a', '--parking...
[ "def", "get_options", "(", "cmd_args", "=", "None", ")", ":", "parser", "=", "sumolib", ".", "options", ".", "ArgumentParser", "(", "prog", "=", "'generateParkingAreaRerouters.py'", ",", "usage", "=", "'%(prog)s [options]'", ",", "description", "=", "'Generate par...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/generateParkingAreaRerouters.py#L45-L110
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/functional/nn.py
python
pixel_shuffle
(inp: Tensor, upscale_factor: int)
return outvar
Rearranges elements in a tensor of shape (*, C x r^2, H, W) to a tensor of shape (*, C, H x r, W x r), where r is an upscale factor, where * is zero or more batch dimensions. :param inp: input tensor. :param upscale_factor: upscale factor of pixel_shuffle. :return: output tensor.
Rearranges elements in a tensor of shape (*, C x r^2, H, W) to a tensor of shape (*, C, H x r, W x r), where r is an upscale factor, where * is zero or more batch dimensions.
[ "Rearranges", "elements", "in", "a", "tensor", "of", "shape", "(", "*", "C", "x", "r^2", "H", "W", ")", "to", "a", "tensor", "of", "shape", "(", "*", "C", "H", "x", "r", "W", "x", "r", ")", "where", "r", "is", "an", "upscale", "factor", "where"...
def pixel_shuffle(inp: Tensor, upscale_factor: int) -> Tensor: """ Rearranges elements in a tensor of shape (*, C x r^2, H, W) to a tensor of shape (*, C, H x r, W x r), where r is an upscale factor, where * is zero or more batch dimensions. :param inp: input tensor. :param upscale_factor: upsc...
[ "def", "pixel_shuffle", "(", "inp", ":", "Tensor", ",", "upscale_factor", ":", "int", ")", "->", "Tensor", ":", "assert", "upscale_factor", ">", "0", ",", "\"upscale_factor should larger than 0\"", "assert", "inp", ".", "ndim", ">=", "3", ",", "\"the input dimen...
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/nn.py#L1812-L1859
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextPlainText.Copy
(*args, **kwargs)
return _richtext.RichTextPlainText_Copy(*args, **kwargs)
Copy(self, RichTextPlainText obj)
Copy(self, RichTextPlainText obj)
[ "Copy", "(", "self", "RichTextPlainText", "obj", ")" ]
def Copy(*args, **kwargs): """Copy(self, RichTextPlainText obj)""" return _richtext.RichTextPlainText_Copy(*args, **kwargs)
[ "def", "Copy", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextPlainText_Copy", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2104-L2106
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/tlslite/TLSRecordLayer.py
python
TLSRecordLayer.getpeername
(self)
return self.sock.getpeername()
Return the remote address to which the socket is connected (socket emulation).
Return the remote address to which the socket is connected (socket emulation).
[ "Return", "the", "remote", "address", "to", "which", "the", "socket", "is", "connected", "(", "socket", "emulation", ")", "." ]
def getpeername(self): """Return the remote address to which the socket is connected (socket emulation).""" return self.sock.getpeername()
[ "def", "getpeername", "(", "self", ")", ":", "return", "self", ".", "sock", ".", "getpeername", "(", ")" ]
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/tlslite/TLSRecordLayer.py#L407-L410
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
graph/library/graph.py
python
Graph.__init__
(self, graph_dict=None)
initialize a graph object if no dictionary or none is given, an empty dictionary will be used :param graph_dict: initial graph setup
initialize a graph object if no dictionary or none is given, an empty dictionary will be used :param graph_dict: initial graph setup
[ "initialize", "a", "graph", "object", "if", "no", "dictionary", "or", "none", "is", "given", "an", "empty", "dictionary", "will", "be", "used", ":", "param", "graph_dict", ":", "initial", "graph", "setup" ]
def __init__(self, graph_dict=None): """ initialize a graph object if no dictionary or none is given, an empty dictionary will be used :param graph_dict: initial graph setup """ if not graph_dict: graph_dict = {} self._graph_dict = graph_di...
[ "def", "__init__", "(", "self", ",", "graph_dict", "=", "None", ")", ":", "if", "not", "graph_dict", ":", "graph_dict", "=", "{", "}", "self", ".", "_graph_dict", "=", "graph_dict" ]
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/graph/library/graph.py#L7-L15
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/series.py
python
Series.argsort
(self, axis=0, kind='quicksort', order=None)
Overrides ndarray.argsort. Argsorts the value, omitting NA/null values, and places the result in the same locations as the non-NA values. Parameters ---------- axis : int Has no effect but is accepted for compatibility with numpy. kind : {'mergesort', 'quicksort', 'h...
Overrides ndarray.argsort. Argsorts the value, omitting NA/null values, and places the result in the same locations as the non-NA values.
[ "Overrides", "ndarray", ".", "argsort", ".", "Argsorts", "the", "value", "omitting", "NA", "/", "null", "values", "and", "places", "the", "result", "in", "the", "same", "locations", "as", "the", "non", "-", "NA", "values", "." ]
def argsort(self, axis=0, kind='quicksort', order=None): """ Overrides ndarray.argsort. Argsorts the value, omitting NA/null values, and places the result in the same locations as the non-NA values. Parameters ---------- axis : int Has no effect but is accept...
[ "def", "argsort", "(", "self", ",", "axis", "=", "0", ",", "kind", "=", "'quicksort'", ",", "order", "=", "None", ")", ":", "values", "=", "self", ".", "_values", "mask", "=", "isna", "(", "values", ")", "if", "mask", ".", "any", "(", ")", ":", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/series.py#L2988-L3024
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/MSVSVersion.py
python
VisualStudioVersion.UsesVcxproj
(self)
return self.uses_vcxproj
Returns true if this version uses a vcxproj file.
Returns true if this version uses a vcxproj file.
[ "Returns", "true", "if", "this", "version", "uses", "a", "vcxproj", "file", "." ]
def UsesVcxproj(self): """Returns true if this version uses a vcxproj file.""" return self.uses_vcxproj
[ "def", "UsesVcxproj", "(", "self", ")", ":", "return", "self", ".", "uses_vcxproj" ]
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/MSVSVersion.py#L50-L52
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/requests/requests/cookies.py
python
RequestsCookieJar.list_paths
(self)
return paths
Utility method to list all the paths in the jar.
Utility method to list all the paths in the jar.
[ "Utility", "method", "to", "list", "all", "the", "paths", "in", "the", "jar", "." ]
def list_paths(self): """Utility method to list all the paths in the jar.""" paths = [] for cookie in iter(self): if cookie.path not in paths: paths.append(cookie.path) return paths
[ "def", "list_paths", "(", "self", ")", ":", "paths", "=", "[", "]", "for", "cookie", "in", "iter", "(", "self", ")", ":", "if", "cookie", ".", "path", "not", "in", "paths", ":", "paths", ".", "append", "(", "cookie", ".", "path", ")", "return", "...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/cookies.py#L243-L249
apache/kudu
90895ce76590f10730ad7aac3613b69d89ff5422
src/kudu/scripts/assign-location.py
python
get_location
(fpath, rule, uid, relaxed)
return location
Return location for the specified identifier 'uid'. To do that, use the specified location mapping rules and the information stored in the sequencer's state file. * Obtain advisory lock for the state file (using additional .lock file) * If the sequencer's state file exists: 1. Open the state file in read...
Return location for the specified identifier 'uid'. To do that, use the specified location mapping rules and the information stored in the sequencer's state file.
[ "Return", "location", "for", "the", "specified", "identifier", "uid", ".", "To", "do", "that", "use", "the", "specified", "location", "mapping", "rules", "and", "the", "information", "stored", "in", "the", "sequencer", "s", "state", "file", "." ]
def get_location(fpath, rule, uid, relaxed): """ Return location for the specified identifier 'uid'. To do that, use the specified location mapping rules and the information stored in the sequencer's state file. * Obtain advisory lock for the state file (using additional .lock file) * If the sequencer's st...
[ "def", "get_location", "(", "fpath", ",", "rule", ",", "uid", ",", "relaxed", ")", ":", "lock_file", "=", "acquire_advisory_lock", "(", "fpath", ")", "state_file", "=", "None", "try", ":", "state_file", "=", "open", "(", "fpath", ")", "except", "IOError", ...
https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/src/kudu/scripts/assign-location.py#L126-L213
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/asyncio/base_events.py
python
BaseEventLoop.sendfile
(self, transport, file, offset=0, count=None, *, fallback=True)
return await self._sendfile_fallback(transport, file, offset, count)
Send a file to transport. Return the total number of bytes which were sent. The method uses high-performance os.sendfile if available. file must be a regular file object opened in binary mode. offset tells from where to start reading the file. If specified, count is the total...
Send a file to transport.
[ "Send", "a", "file", "to", "transport", "." ]
async def sendfile(self, transport, file, offset=0, count=None, *, fallback=True): """Send a file to transport. Return the total number of bytes which were sent. The method uses high-performance os.sendfile if available. file must be a regular file object opened...
[ "async", "def", "sendfile", "(", "self", ",", "transport", ",", "file", ",", "offset", "=", "0", ",", "count", "=", "None", ",", "*", ",", "fallback", "=", "True", ")", ":", "if", "transport", ".", "is_closing", "(", ")", ":", "raise", "RuntimeError"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/base_events.py#L1024-L1069
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.append
(self, value)
Appends an item to the list. Similar to list.append().
Appends an item to the list. Similar to list.append().
[ "Appends", "an", "item", "to", "the", "list", ".", "Similar", "to", "list", ".", "append", "()", "." ]
def append(self, value): """Appends an item to the list. Similar to list.append().""" self._type_checker.CheckValue(value) self._values.append(value) if not self._message_listener.dirty: self._message_listener.Modified()
[ "def", "append", "(", "self", ",", "value", ")", ":", "self", ".", "_type_checker", ".", "CheckValue", "(", "value", ")", "self", ".", "_values", ".", "append", "(", "value", ")", "if", "not", "self", ".", "_message_listener", ".", "dirty", ":", "self"...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/internal/containers.py#L104-L109
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/dataview.py
python
DataViewTreeStore.InsertContainer
(*args, **kwargs)
return _dataview.DataViewTreeStore_InsertContainer(*args, **kwargs)
InsertContainer(self, DataViewItem parent, DataViewItem previous, String text, Icon icon=wxNullIcon, Icon expanded=wxNullIcon, wxClientData data=None) -> DataViewItem
InsertContainer(self, DataViewItem parent, DataViewItem previous, String text, Icon icon=wxNullIcon, Icon expanded=wxNullIcon, wxClientData data=None) -> DataViewItem
[ "InsertContainer", "(", "self", "DataViewItem", "parent", "DataViewItem", "previous", "String", "text", "Icon", "icon", "=", "wxNullIcon", "Icon", "expanded", "=", "wxNullIcon", "wxClientData", "data", "=", "None", ")", "-", ">", "DataViewItem" ]
def InsertContainer(*args, **kwargs): """ InsertContainer(self, DataViewItem parent, DataViewItem previous, String text, Icon icon=wxNullIcon, Icon expanded=wxNullIcon, wxClientData data=None) -> DataViewItem """ return _dataview.DataViewTreeStore_InsertContaine...
[ "def", "InsertContainer", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewTreeStore_InsertContainer", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L2396-L2402