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
plaidml/plaidml
f3c6681db21460e5fdc11ae651d6d7b6c27f8262
plaidml/edsl/__init__.py
python
Contraction.sum
(self, rhs)
return self
Performs a `summation` reduction within a contraction. Example: >>> i, j = TensorIndexes(2) >>> A = Placeholder(DType.FLOAT32, [3, 3]) >>> R = Contraction().sum(A[i, j]).build()
Performs a `summation` reduction within a contraction.
[ "Performs", "a", "summation", "reduction", "within", "a", "contraction", "." ]
def sum(self, rhs): """Performs a `summation` reduction within a contraction. Example: >>> i, j = TensorIndexes(2) >>> A = Placeholder(DType.FLOAT32, [3, 3]) >>> R = Contraction().sum(A[i, j]).build() """ self.__agg_op = lib.PLAIDML_AGG_OP_SUM ...
[ "def", "sum", "(", "self", ",", "rhs", ")", ":", "self", ".", "__agg_op", "=", "lib", ".", "PLAIDML_AGG_OP_SUM", "self", ".", "__rhs", "=", "rhs", "return", "self" ]
https://github.com/plaidml/plaidml/blob/f3c6681db21460e5fdc11ae651d6d7b6c27f8262/plaidml/edsl/__init__.py#L372-L382
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/internals/managers.py
python
BlockManager.get
(self, item, fastpath=True)
Return values for selected item (ndarray or BlockManager).
Return values for selected item (ndarray or BlockManager).
[ "Return", "values", "for", "selected", "item", "(", "ndarray", "or", "BlockManager", ")", "." ]
def get(self, item, fastpath=True): """ Return values for selected item (ndarray or BlockManager). """ if self.items.is_unique: if not isna(item): loc = self.items.get_loc(item) else: indexer = np.arange(len(self.items))[isna(self....
[ "def", "get", "(", "self", ",", "item", ",", "fastpath", "=", "True", ")", ":", "if", "self", ".", "items", ".", "is_unique", ":", "if", "not", "isna", "(", "item", ")", ":", "loc", "=", "self", ".", "items", ".", "get_loc", "(", "item", ")", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/internals/managers.py#L934-L961
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
resources/osm_importer/osm_objects.py
python
OSMMultipolygon.process
(disableMultipolygonBuildings)
Process all the multipolygon (mainly assure that they are closed).
Process all the multipolygon (mainly assure that they are closed).
[ "Process", "all", "the", "multipolygon", "(", "mainly", "assure", "that", "they", "are", "closed", ")", "." ]
def process(disableMultipolygonBuildings): """Process all the multipolygon (mainly assure that they are closed).""" OSMMultipolygon.disableMultipolygonBuildings = disableMultipolygonBuildings for multipolygon in OSMMultipolygon.multipolygonList: if not multipolygon.ref[0] == multipol...
[ "def", "process", "(", "disableMultipolygonBuildings", ")", ":", "OSMMultipolygon", ".", "disableMultipolygonBuildings", "=", "disableMultipolygonBuildings", "for", "multipolygon", "in", "OSMMultipolygon", ".", "multipolygonList", ":", "if", "not", "multipolygon", ".", "r...
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/resources/osm_importer/osm_objects.py#L223-L228
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Window.SetAcceleratorTable
(*args, **kwargs)
return _core_.Window_SetAcceleratorTable(*args, **kwargs)
SetAcceleratorTable(self, AcceleratorTable accel) Sets the accelerator table for this window.
SetAcceleratorTable(self, AcceleratorTable accel)
[ "SetAcceleratorTable", "(", "self", "AcceleratorTable", "accel", ")" ]
def SetAcceleratorTable(*args, **kwargs): """ SetAcceleratorTable(self, AcceleratorTable accel) Sets the accelerator table for this window. """ return _core_.Window_SetAcceleratorTable(*args, **kwargs)
[ "def", "SetAcceleratorTable", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_SetAcceleratorTable", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L10510-L10516
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
relaxNgValidCtxt.relaxNGValidateDoc
(self, doc)
return ret
Validate a document tree in memory.
Validate a document tree in memory.
[ "Validate", "a", "document", "tree", "in", "memory", "." ]
def relaxNGValidateDoc(self, doc): """Validate a document tree in memory. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlRelaxNGValidateDoc(self._o, doc__o) return ret
[ "def", "relaxNGValidateDoc", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlRelaxNGValidateDoc", "(", "self", ".", "_o", ",", ...
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L6249-L6254
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/parallel/algo_parameter_config.py
python
_AlgoParameterConfig.get_tensor_slice_align_size
(self)
return self._config_handle.get_tensor_slice_align_size()
Get the tensor slice align size. Returns: The size.
Get the tensor slice align size.
[ "Get", "the", "tensor", "slice", "align", "size", "." ]
def get_tensor_slice_align_size(self): """ Get the tensor slice align size. Returns: The size. """ self.check_config_handle() return self._config_handle.get_tensor_slice_align_size()
[ "def", "get_tensor_slice_align_size", "(", "self", ")", ":", "self", ".", "check_config_handle", "(", ")", "return", "self", ".", "_config_handle", ".", "get_tensor_slice_align_size", "(", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/parallel/algo_parameter_config.py#L126-L134
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/lambda-code/SanitizationLambda/sanitization_lambda.py
python
Sanitizer.__validate_image
(self, key, content_type, file_path)
Validates image is within the allowed parameters defined in the settings.
Validates image is within the allowed parameters defined in the settings.
[ "Validates", "image", "is", "within", "the", "allowed", "parameters", "defined", "in", "the", "settings", "." ]
def __validate_image(self, key, content_type, file_path): ''' Validates image is within the allowed parameters defined in the settings. ''' if content_type == constants.MIME_TYPE_IMAGE_JPEG: self.__remove_metadata(file_path) if not self.__validate_file_size(file_path): s...
[ "def", "__validate_image", "(", "self", ",", "key", ",", "content_type", ",", "file_path", ")", ":", "if", "content_type", "==", "constants", ".", "MIME_TYPE_IMAGE_JPEG", ":", "self", ".", "__remove_metadata", "(", "file_path", ")", "if", "not", "self", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/lambda-code/SanitizationLambda/sanitization_lambda.py#L168-L190
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/probability/distribution/distribution.py
python
Distribution._set_prob
(self)
Set probability function based on the availability of `_prob` and `_log_likehood`.
Set probability function based on the availability of `_prob` and `_log_likehood`.
[ "Set", "probability", "function", "based", "on", "the", "availability", "of", "_prob", "and", "_log_likehood", "." ]
def _set_prob(self): """ Set probability function based on the availability of `_prob` and `_log_likehood`. """ if hasattr(self, '_prob'): self._call_prob = self._prob elif hasattr(self, '_log_prob'): self._call_prob = self._calc_prob_from_log_prob ...
[ "def", "_set_prob", "(", "self", ")", ":", "if", "hasattr", "(", "self", ",", "'_prob'", ")", ":", "self", ".", "_call_prob", "=", "self", ".", "_prob", "elif", "hasattr", "(", "self", ",", "'_log_prob'", ")", ":", "self", ".", "_call_prob", "=", "se...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/distribution.py#L245-L254
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/namespace_range.py
python
_key_for_namespace
(namespace, app)
Return the __namespace__ key for a namespace. Args: namespace: The namespace whose key is requested. app: The id of the application that the key belongs to. Returns: A db.Key representing the namespace.
Return the __namespace__ key for a namespace.
[ "Return", "the", "__namespace__", "key", "for", "a", "namespace", "." ]
def _key_for_namespace(namespace, app): """Return the __namespace__ key for a namespace. Args: namespace: The namespace whose key is requested. app: The id of the application that the key belongs to. Returns: A db.Key representing the namespace. """ if namespace: return db.Key.from_path(meta...
[ "def", "_key_for_namespace", "(", "namespace", ",", "app", ")", ":", "if", "namespace", ":", "return", "db", ".", "Key", ".", "from_path", "(", "metadata", ".", "Namespace", ".", "KIND_NAME", ",", "namespace", ",", "_app", "=", "app", ")", "else", ":", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/namespace_range.py#L150-L167
fifengine/fifengine
4b62c42e85bec19893cef8e63e6855927cff2c47
engine/python/fife/extensions/serializers/xml_loader_tools.py
python
reverse_root_subfile
(masterfile, subfile)
return root_subfile(masterfile, subfile)
does inverse operation to root_subfile. E.g. E.g. if masterfile is ./../foo/bar.xml and subfile is ../foo2/subfoo.xml, returned path ./../foo2/subfoo.xml Usually this function is used to convert saved paths into engine relative paths NOTE: masterfile is expected to be *file*, not directory. subfile can be either
does inverse operation to root_subfile. E.g. E.g. if masterfile is ./../foo/bar.xml and subfile is ../foo2/subfoo.xml, returned path ./../foo2/subfoo.xml Usually this function is used to convert saved paths into engine relative paths NOTE: masterfile is expected to be *file*, not directory. subfile can be either
[ "does", "inverse", "operation", "to", "root_subfile", ".", "E", ".", "g", ".", "E", ".", "g", ".", "if", "masterfile", "is", ".", "/", "..", "/", "foo", "/", "bar", ".", "xml", "and", "subfile", "is", "..", "/", "foo2", "/", "subfoo", ".", "xml",...
def reverse_root_subfile(masterfile, subfile): """ does inverse operation to root_subfile. E.g. E.g. if masterfile is ./../foo/bar.xml and subfile is ../foo2/subfoo.xml, returned path ./../foo2/subfoo.xml Usually this function is used to convert saved paths into engine relative paths NOTE: masterfile is expected...
[ "def", "reverse_root_subfile", "(", "masterfile", ",", "subfile", ")", ":", "s", "=", "'/'", "masterfile", "=", "norm_path", "(", "os", ".", "path", ".", "abspath", "(", "masterfile", ")", ")", ".", "split", "(", "s", ")", "[", ":", "-", "1", "]", ...
https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/serializers/xml_loader_tools.py#L99-L112
ros-planning/moveit
ee48dc5cedc981d0869352aa3db0b41469c2735c
moveit_commander/src/moveit_commander/move_group.py
python
MoveGroupCommander.set_trajectory_constraints
(self, value)
Specify the trajectory constraints to be used (setting from database is not implemented yet)
Specify the trajectory constraints to be used (setting from database is not implemented yet)
[ "Specify", "the", "trajectory", "constraints", "to", "be", "used", "(", "setting", "from", "database", "is", "not", "implemented", "yet", ")" ]
def set_trajectory_constraints(self, value): """ Specify the trajectory constraints to be used (setting from database is not implemented yet)""" if value is None: self.clear_trajectory_constraints() else: if type(value) is TrajectoryConstraints: self._g.se...
[ "def", "set_trajectory_constraints", "(", "self", ",", "value", ")", ":", "if", "value", "is", "None", ":", "self", ".", "clear_trajectory_constraints", "(", ")", "else", ":", "if", "type", "(", "value", ")", "is", "TrajectoryConstraints", ":", "self", ".", ...
https://github.com/ros-planning/moveit/blob/ee48dc5cedc981d0869352aa3db0b41469c2735c/moveit_commander/src/moveit_commander/move_group.py#L506-L518
stitchEm/stitchEm
0f399501d41ab77933677f2907f41f80ceb704d7
lib/bindings/samples/server/glfw.py
python
get_window_attrib
(window, attrib)
return _glfw.glfwGetWindowAttrib(window, attrib)
Returns an attribute of the specified window. Wrapper for: int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
Returns an attribute of the specified window.
[ "Returns", "an", "attribute", "of", "the", "specified", "window", "." ]
def get_window_attrib(window, attrib): """ Returns an attribute of the specified window. Wrapper for: int glfwGetWindowAttrib(GLFWwindow* window, int attrib); """ return _glfw.glfwGetWindowAttrib(window, attrib)
[ "def", "get_window_attrib", "(", "window", ",", "attrib", ")", ":", "return", "_glfw", ".", "glfwGetWindowAttrib", "(", "window", ",", "attrib", ")" ]
https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/glfw.py#L1169-L1176
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.GetMsvsToolchainEnv
(self, additional_settings=None)
return self.msvs_settings.GetVSMacroEnv( "$!PRODUCT_DIR", config=self.config_name )
Returns the variables Visual Studio would set for build steps.
Returns the variables Visual Studio would set for build steps.
[ "Returns", "the", "variables", "Visual", "Studio", "would", "set", "for", "build", "steps", "." ]
def GetMsvsToolchainEnv(self, additional_settings=None): """Returns the variables Visual Studio would set for build steps.""" return self.msvs_settings.GetVSMacroEnv( "$!PRODUCT_DIR", config=self.config_name )
[ "def", "GetMsvsToolchainEnv", "(", "self", ",", "additional_settings", "=", "None", ")", ":", "return", "self", ".", "msvs_settings", ".", "GetVSMacroEnv", "(", "\"$!PRODUCT_DIR\"", ",", "config", "=", "self", ".", "config_name", ")" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py#L1686-L1690
nodejs/nan
8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62
cpplint.py
python
UpdateIncludeState
(filename, include_dict, io=codecs)
return True
Fill up the include_dict with new includes found from the file. Args: filename: the name of the header to read. include_dict: a dictionary in which the headers are inserted. io: The io factory to use to read the file. Provided for testability. Returns: True if a header was successfully added. Fals...
Fill up the include_dict with new includes found from the file.
[ "Fill", "up", "the", "include_dict", "with", "new", "includes", "found", "from", "the", "file", "." ]
def UpdateIncludeState(filename, include_dict, io=codecs): """Fill up the include_dict with new includes found from the file. Args: filename: the name of the header to read. include_dict: a dictionary in which the headers are inserted. io: The io factory to use to read the file. Provided for testabilit...
[ "def", "UpdateIncludeState", "(", "filename", ",", "include_dict", ",", "io", "=", "codecs", ")", ":", "headerfile", "=", "None", "try", ":", "headerfile", "=", "io", ".", "open", "(", "filename", ",", "'r'", ",", "'utf8'", ",", "'replace'", ")", "except...
https://github.com/nodejs/nan/blob/8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62/cpplint.py#L5756-L5780
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/dirichlet_multinomial.py
python
DirichletMultinomial.prob
(self, counts, name="prob")
return super(DirichletMultinomial, self).prob(counts, name=name)
`P[counts]`, computed for every batch member. For each batch of counts `[c_1,...,c_k]`, `P[counts]` is the probability that after sampling `sum_j c_j` draws from this Dirichlet Multinomial distribution, the number of draws falling in class `j` is `c_j`. Note that different sequences of draws can resul...
`P[counts]`, computed for every batch member.
[ "P", "[", "counts", "]", "computed", "for", "every", "batch", "member", "." ]
def prob(self, counts, name="prob"): """`P[counts]`, computed for every batch member. For each batch of counts `[c_1,...,c_k]`, `P[counts]` is the probability that after sampling `sum_j c_j` draws from this Dirichlet Multinomial distribution, the number of draws falling in class `j` is `c_j`. Note tha...
[ "def", "prob", "(", "self", ",", "counts", ",", "name", "=", "\"prob\"", ")", ":", "return", "super", "(", "DirichletMultinomial", ",", "self", ")", ".", "prob", "(", "counts", ",", "name", "=", "name", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/dirichlet_multinomial.py#L341-L361
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/bench/cssmin.py
python
remove_unnecessary_semicolons
(css)
return re.sub(r";+\}", "}", css)
Remove unnecessary semicolons.
Remove unnecessary semicolons.
[ "Remove", "unnecessary", "semicolons", "." ]
def remove_unnecessary_semicolons(css): """Remove unnecessary semicolons.""" return re.sub(r";+\}", "}", css)
[ "def", "remove_unnecessary_semicolons", "(", "css", ")", ":", "return", "re", ".", "sub", "(", "r\";+\\}\"", ",", "\"}\"", ",", "css", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/bench/cssmin.py#L114-L117
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/imaplib.py
python
IMAP4.getquotaroot
(self, mailbox)
return typ, [quotaroot, quota]
Get the list of quota roots for the named mailbox. (typ, [[QUOTAROOT responses...], [QUOTA responses]]) = <instance>.getquotaroot(mailbox)
Get the list of quota roots for the named mailbox.
[ "Get", "the", "list", "of", "quota", "roots", "for", "the", "named", "mailbox", "." ]
def getquotaroot(self, mailbox): """Get the list of quota roots for the named mailbox. (typ, [[QUOTAROOT responses...], [QUOTA responses]]) = <instance>.getquotaroot(mailbox) """ typ, dat = self._simple_command('GETQUOTAROOT', mailbox) typ, quota = self._untagged_response(typ, d...
[ "def", "getquotaroot", "(", "self", ",", "mailbox", ")", ":", "typ", ",", "dat", "=", "self", ".", "_simple_command", "(", "'GETQUOTAROOT'", ",", "mailbox", ")", "typ", ",", "quota", "=", "self", ".", "_untagged_response", "(", "typ", ",", "dat", ",", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/imaplib.py#L475-L483
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/widgets/fitpropertybrowser/interactive_tool.py
python
FitInteractiveTool.button_press_callback
(self, event)
This is called when a mouse button is pressed inside the canvas :param event: An event object with information on the current mouse position
This is called when a mouse button is pressed inside the canvas :param event: An event object with information on the current mouse position
[ "This", "is", "called", "when", "a", "mouse", "button", "is", "pressed", "inside", "the", "canvas", ":", "param", "event", ":", "An", "event", "object", "with", "information", "on", "the", "current", "mouse", "position" ]
def button_press_callback(self, event): """ This is called when a mouse button is pressed inside the canvas :param event: An event object with information on the current mouse position """ self.mouse_state.button_press_callback(event)
[ "def", "button_press_callback", "(", "self", ",", "event", ")", ":", "self", ".", "mouse_state", ".", "button_press_callback", "(", "event", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/fitpropertybrowser/interactive_tool.py#L112-L117
GoSSIP-SJTU/Armariris
ad5d868482956b2194a77b39c8d543c7c2318200
tools/clang/tools/scan-build-py/libscanbuild/runner.py
python
report_failure
(opts)
return { 'error_output': opts['error_output'], 'exit_code': opts['exit_code'] }
Create report when analyzer failed. The major report is the preprocessor output. The output filename generated randomly. The compiler output also captured into '.stderr.txt' file. And some more execution context also saved into '.info.txt' file.
Create report when analyzer failed.
[ "Create", "report", "when", "analyzer", "failed", "." ]
def report_failure(opts): """ Create report when analyzer failed. The major report is the preprocessor output. The output filename generated randomly. The compiler output also captured into '.stderr.txt' file. And some more execution context also saved into '.info.txt' file. """ def extension(opts...
[ "def", "report_failure", "(", "opts", ")", ":", "def", "extension", "(", "opts", ")", ":", "\"\"\" Generate preprocessor file extension. \"\"\"", "mapping", "=", "{", "'objective-c++'", ":", "'.mii'", ",", "'objective-c'", ":", "'.mi'", ",", "'c++'", ":", "'.ii'",...
https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/tools/clang/tools/scan-build-py/libscanbuild/runner.py#L104-L151
facebook/proxygen
a9ca025af207787815cb01eee1971cd572c7a81e
build/fbcode_builder/getdeps/copytree.py
python
find_eden_root
(dirpath)
If the specified directory is inside an EdenFS checkout, returns the canonical absolute path to the root of that checkout. Returns None if the specified directory is not in an EdenFS checkout.
If the specified directory is inside an EdenFS checkout, returns the canonical absolute path to the root of that checkout.
[ "If", "the", "specified", "directory", "is", "inside", "an", "EdenFS", "checkout", "returns", "the", "canonical", "absolute", "path", "to", "the", "root", "of", "that", "checkout", "." ]
def find_eden_root(dirpath): """If the specified directory is inside an EdenFS checkout, returns the canonical absolute path to the root of that checkout. Returns None if the specified directory is not in an EdenFS checkout. """ if is_windows(): repo_type, repo_root = containing_repo_type(d...
[ "def", "find_eden_root", "(", "dirpath", ")", ":", "if", "is_windows", "(", ")", ":", "repo_type", ",", "repo_root", "=", "containing_repo_type", "(", "dirpath", ")", "if", "repo_root", "is", "not", "None", ":", "if", "os", ".", "path", ".", "exists", "(...
https://github.com/facebook/proxygen/blob/a9ca025af207787815cb01eee1971cd572c7a81e/build/fbcode_builder/getdeps/copytree.py#L29-L45
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.MergeFrom
(self, other)
Appends the contents of another repeated field of the same type to this one. We do not check the types of the individual fields.
Appends the contents of another repeated field of the same type to this one. We do not check the types of the individual fields.
[ "Appends", "the", "contents", "of", "another", "repeated", "field", "of", "the", "same", "type", "to", "this", "one", ".", "We", "do", "not", "check", "the", "types", "of", "the", "individual", "fields", "." ]
def MergeFrom(self, other): """Appends the contents of another repeated field of the same type to this one. We do not check the types of the individual fields. """ self._values.extend(other._values) self._message_listener.Modified()
[ "def", "MergeFrom", "(", "self", ",", "other", ")", ":", "self", ".", "_values", ".", "extend", "(", "other", ".", "_values", ")", "self", ".", "_message_listener", ".", "Modified", "(", ")" ]
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/containers.py#L280-L285
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/key_binding/bindings/scroll.py
python
scroll_half_page_up
(event)
Same as ControlB, but only scroll half a page.
Same as ControlB, but only scroll half a page.
[ "Same", "as", "ControlB", "but", "only", "scroll", "half", "a", "page", "." ]
def scroll_half_page_up(event): """ Same as ControlB, but only scroll half a page. """ scroll_backward(event, half=True)
[ "def", "scroll_half_page_up", "(", "event", ")", ":", "scroll_backward", "(", "event", ",", "half", "=", "True", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/key_binding/bindings/scroll.py#L98-L102
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/client.py
python
BaseClient.waiter_names
(self)
return [xform_name(name) for name in model.waiter_names]
Returns a list of all available waiters.
Returns a list of all available waiters.
[ "Returns", "a", "list", "of", "all", "available", "waiters", "." ]
def waiter_names(self): """Returns a list of all available waiters.""" config = self._get_waiter_config() if not config: return [] model = waiter.WaiterModel(config) # Waiter configs is a dict, we just want the waiter names # which are the keys in the dict. ...
[ "def", "waiter_names", "(", "self", ")", ":", "config", "=", "self", ".", "_get_waiter_config", "(", ")", "if", "not", "config", ":", "return", "[", "]", "model", "=", "waiter", ".", "WaiterModel", "(", "config", ")", "# Waiter configs is a dict, we just want ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/client.py#L800-L808
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_grad/grad_array_ops.py
python
_tile_shape
(multiples, shapex)
return tuple(ret)
Calculate [1,2], [3, 4] -> [1,3,2,4].
Calculate [1,2], [3, 4] -> [1,3,2,4].
[ "Calculate", "[", "1", "2", "]", "[", "3", "4", "]", "-", ">", "[", "1", "3", "2", "4", "]", "." ]
def _tile_shape(multiples, shapex): """Calculate [1,2], [3, 4] -> [1,3,2,4].""" len_muli = len(multiples) rank = len(shapex) len_cmp = len_muli - rank max_len = max(len_muli, rank) i = 0 j = 0 ret = [] while (i < max_len) and (j < max_len): if len_cmp == 0: ret.ap...
[ "def", "_tile_shape", "(", "multiples", ",", "shapex", ")", ":", "len_muli", "=", "len", "(", "multiples", ")", "rank", "=", "len", "(", "shapex", ")", "len_cmp", "=", "len_muli", "-", "rank", "max_len", "=", "max", "(", "len_muli", ",", "rank", ")", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_array_ops.py#L229-L254
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/tkwidgets/Valuator.py
python
Valuator.setEntryFormat
(self)
Change the number of significant digits in entry
Change the number of significant digits in entry
[ "Change", "the", "number", "of", "significant", "digits", "in", "entry" ]
def setEntryFormat(self): """ Change the number of significant digits in entry """ # Create new format string self.entryFormat = "%." + "%df" % self['numDigits'] # Update entry to reflect new format self.setEntry(self.get()) # Pass info down to valuator to...
[ "def", "setEntryFormat", "(", "self", ")", ":", "# Create new format string", "self", ".", "entryFormat", "=", "\"%.\"", "+", "\"%df\"", "%", "self", "[", "'numDigits'", "]", "# Update entry to reflect new format", "self", ".", "setEntry", "(", "self", ".", "get",...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/tkwidgets/Valuator.py#L213-L222
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/email/__init__.py
python
message_from_string
(s, *args, **kws)
return Parser(*args, **kws).parsestr(s)
Parse a string into a Message object model. Optional _class and strict are passed to the Parser constructor.
Parse a string into a Message object model.
[ "Parse", "a", "string", "into", "a", "Message", "object", "model", "." ]
def message_from_string(s, *args, **kws): """Parse a string into a Message object model. Optional _class and strict are passed to the Parser constructor. """ from email.parser import Parser return Parser(*args, **kws).parsestr(s)
[ "def", "message_from_string", "(", "s", ",", "*", "args", ",", "*", "*", "kws", ")", ":", "from", "email", ".", "parser", "import", "Parser", "return", "Parser", "(", "*", "args", ",", "*", "*", "kws", ")", ".", "parsestr", "(", "s", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/__init__.py#L32-L38
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/imaplib.py
python
IMAP4.setannotation
(self, *args)
return self._untagged_response(typ, dat, 'ANNOTATION')
(typ, [data]) = <instance>.setannotation(mailbox[, entry, attribute]+) Set ANNOTATIONs.
(typ, [data]) = <instance>.setannotation(mailbox[, entry, attribute]+) Set ANNOTATIONs.
[ "(", "typ", "[", "data", "]", ")", "=", "<instance", ">", ".", "setannotation", "(", "mailbox", "[", "entry", "attribute", "]", "+", ")", "Set", "ANNOTATIONs", "." ]
def setannotation(self, *args): """(typ, [data]) = <instance>.setannotation(mailbox[, entry, attribute]+) Set ANNOTATIONs.""" typ, dat = self._simple_command('SETANNOTATION', *args) return self._untagged_response(typ, dat, 'ANNOTATION')
[ "def", "setannotation", "(", "self", ",", "*", "args", ")", ":", "typ", ",", "dat", "=", "self", ".", "_simple_command", "(", "'SETANNOTATION'", ",", "*", "args", ")", "return", "self", ".", "_untagged_response", "(", "typ", ",", "dat", ",", "'ANNOTATION...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/imaplib.py#L778-L783
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/quopri.py
python
unhex
(s)
return bits
Get the integer value of a hexadecimal number.
Get the integer value of a hexadecimal number.
[ "Get", "the", "integer", "value", "of", "a", "hexadecimal", "number", "." ]
def unhex(s): """Get the integer value of a hexadecimal number.""" bits = 0 for c in s: if '0' <= c <= '9': i = ord('0') elif 'a' <= c <= 'f': i = ord('a')-10 elif 'A' <= c <= 'F': i = ord('A')-10 else: break bits = bits...
[ "def", "unhex", "(", "s", ")", ":", "bits", "=", "0", "for", "c", "in", "s", ":", "if", "'0'", "<=", "c", "<=", "'9'", ":", "i", "=", "ord", "(", "'0'", ")", "elif", "'a'", "<=", "c", "<=", "'f'", ":", "i", "=", "ord", "(", "'a'", ")", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/quopri.py#L175-L188
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/client/session.py
python
InteractiveSession.__init__
(self, target='', graph=None, config=None)
Creates a new interactive TensorFlow session. If no `graph` argument is specified when constructing the session, the default graph will be launched in the session. If you are using more than one graph (created with `tf.Graph()` in the same process, you will have to use different sessions for each graph...
Creates a new interactive TensorFlow session.
[ "Creates", "a", "new", "interactive", "TensorFlow", "session", "." ]
def __init__(self, target='', graph=None, config=None): """Creates a new interactive TensorFlow session. If no `graph` argument is specified when constructing the session, the default graph will be launched in the session. If you are using more than one graph (created with `tf.Graph()` in the same ...
[ "def", "__init__", "(", "self", ",", "target", "=", "''", ",", "graph", "=", "None", ",", "config", "=", "None", ")", ":", "if", "not", "config", ":", "config", "=", "config_pb2", ".", "ConfigProto", "(", ")", "# Interactive sessions always place pruned grap...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/client/session.py#L1225-L1255
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/figlet.py
python
newbanner
(fontdir, msg)
return f.getline(),font
Returns msg converted to a random ascii art font from the given fontdir.
Returns msg converted to a random ascii art font from the given fontdir.
[ "Returns", "msg", "converted", "to", "a", "random", "ascii", "art", "font", "from", "the", "given", "fontdir", "." ]
def newbanner(fontdir, msg): """ Returns msg converted to a random ascii art font from the given fontdir. """ try: font = get_randfont(fontdir) if not font: return "", "" f = Fig(font) f.addline(msg) except: return "", "" return f.getline(...
[ "def", "newbanner", "(", "fontdir", ",", "msg", ")", ":", "try", ":", "font", "=", "get_randfont", "(", "fontdir", ")", "if", "not", "font", ":", "return", "\"\"", ",", "\"\"", "f", "=", "Fig", "(", "font", ")", "f", ".", "addline", "(", "msg", "...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/figlet.py#L11-L25
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/input.py
python
ParallelState.LoadTargetBuildFileCallback
(self, result)
Handle the results of running LoadTargetBuildFile in another process.
Handle the results of running LoadTargetBuildFile in another process.
[ "Handle", "the", "results", "of", "running", "LoadTargetBuildFile", "in", "another", "process", "." ]
def LoadTargetBuildFileCallback(self, result): """Handle the results of running LoadTargetBuildFile in another process. """ self.condition.acquire() if not result: self.error = True self.condition.notify() self.condition.release() return (build_file_path0, data0, aux_data0, d...
[ "def", "LoadTargetBuildFileCallback", "(", "self", ",", "result", ")", ":", "self", ".", "condition", ".", "acquire", "(", ")", "if", "not", "result", ":", "self", ".", "error", "=", "True", "self", ".", "condition", ".", "notify", "(", ")", "self", "....
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/input.py#L534-L555
moderngl/moderngl
32fe79927e02b0fa893b3603d677bdae39771e14
moderngl/context.py
python
Context.patch_vertices
(self)
return self.mglo.patch_vertices
int: The number of vertices that will be used to make up a single patch primitive.
int: The number of vertices that will be used to make up a single patch primitive.
[ "int", ":", "The", "number", "of", "vertices", "that", "will", "be", "used", "to", "make", "up", "a", "single", "patch", "primitive", "." ]
def patch_vertices(self) -> int: ''' int: The number of vertices that will be used to make up a single patch primitive. ''' return self.mglo.patch_vertices
[ "def", "patch_vertices", "(", "self", ")", "->", "int", ":", "return", "self", ".", "mglo", ".", "patch_vertices" ]
https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/context.py#L730-L736
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/linear_optimizer/python/ops/sharded_mutable_dense_hashtable.py
python
ShardedMutableDenseHashTable.lookup
(self, keys, name=None)
return result
Looks up `keys` in a table, outputs the corresponding values.
Looks up `keys` in a table, outputs the corresponding values.
[ "Looks", "up", "keys", "in", "a", "table", "outputs", "the", "corresponding", "values", "." ]
def lookup(self, keys, name=None): """Looks up `keys` in a table, outputs the corresponding values.""" if keys.dtype.base_dtype != self._key_dtype: raise TypeError('Signature mismatch. Keys must be dtype %s, got %s.' % (self._key_dtype, keys.dtype)) self._check_keys(keys) num...
[ "def", "lookup", "(", "self", ",", "keys", ",", "name", "=", "None", ")", ":", "if", "keys", ".", "dtype", ".", "base_dtype", "!=", "self", ".", "_key_dtype", ":", "raise", "TypeError", "(", "'Signature mismatch. Keys must be dtype %s, got %s.'", "%", "(", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/linear_optimizer/python/ops/sharded_mutable_dense_hashtable.py#L125-L152
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/algorithms.py
python
unique
(values)
return uniques
Hash table-based unique. Uniques are returned in order of appearance. This does NOT sort. Significantly faster than numpy.unique for long enough sequences. Includes NA values. Parameters ---------- values : 1d array-like Returns ------- numpy.ndarray or ExtensionArray The...
Hash table-based unique. Uniques are returned in order of appearance. This does NOT sort.
[ "Hash", "table", "-", "based", "unique", ".", "Uniques", "are", "returned", "in", "order", "of", "appearance", ".", "This", "does", "NOT", "sort", "." ]
def unique(values): """ Hash table-based unique. Uniques are returned in order of appearance. This does NOT sort. Significantly faster than numpy.unique for long enough sequences. Includes NA values. Parameters ---------- values : 1d array-like Returns ------- numpy.ndarra...
[ "def", "unique", "(", "values", ")", ":", "values", "=", "_ensure_arraylike", "(", "values", ")", "if", "is_extension_array_dtype", "(", "values", ")", ":", "# Dispatch to extension dtype's unique.", "return", "values", ".", "unique", "(", ")", "original", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/algorithms.py#L328-L433
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/clang_format.py
python
ClangFormat.lint
(self, file_name)
return self._lint(file_name, print_diff=True)
Check the specified file has the correct format
Check the specified file has the correct format
[ "Check", "the", "specified", "file", "has", "the", "correct", "format" ]
def lint(self, file_name): """Check the specified file has the correct format """ return self._lint(file_name, print_diff=True)
[ "def", "lint", "(", "self", ",", "file_name", ")", ":", "return", "self", ".", "_lint", "(", "file_name", ",", "print_diff", "=", "True", ")" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/clang_format.py#L255-L258
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/SolidMechanicsApplication/python_scripts/json_settings_utility.py
python
JsonSettingsUtility.TransferMatchingSettingsToDestination
(origin_settings, destination_settings)
Transfer matching settings from origin to destination. If there is any name/value in the origin settings matching with the destination settings, then the setting value is assigned to the destination, and deleted from the origin.
Transfer matching settings from origin to destination.
[ "Transfer", "matching", "settings", "from", "origin", "to", "destination", "." ]
def TransferMatchingSettingsToDestination(origin_settings, destination_settings): """Transfer matching settings from origin to destination. If there is any name/value in the origin settings matching with the destination settings, then the setting value is assigned to the destination, and delete...
[ "def", "TransferMatchingSettingsToDestination", "(", "origin_settings", ",", "destination_settings", ")", ":", "#print(\"start\",origin_settings.PrettyPrintJsonString())", "for", "name", ",", "destination_value", "in", "destination_settings", ".", "items", "(", ")", ":", "if"...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/SolidMechanicsApplication/python_scripts/json_settings_utility.py#L47-L76
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
xmlNode.setSpacePreserve
(self, val)
Set (or reset) the space preserving behaviour of a node, i.e. the value of the xml:space attribute.
Set (or reset) the space preserving behaviour of a node, i.e. the value of the xml:space attribute.
[ "Set", "(", "or", "reset", ")", "the", "space", "preserving", "behaviour", "of", "a", "node", "i", ".", "e", ".", "the", "value", "of", "the", "xml", ":", "space", "attribute", "." ]
def setSpacePreserve(self, val): """Set (or reset) the space preserving behaviour of a node, i.e. the value of the xml:space attribute. """ libxml2mod.xmlNodeSetSpacePreserve(self._o, val)
[ "def", "setSpacePreserve", "(", "self", ",", "val", ")", ":", "libxml2mod", ".", "xmlNodeSetSpacePreserve", "(", "self", ".", "_o", ",", "val", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L3588-L3591
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/stringold.py
python
atol
(*args)
atol(s [,base]) -> long Return the long integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x or 0X for hexadecimal. I...
atol(s [,base]) -> long
[ "atol", "(", "s", "[", "base", "]", ")", "-", ">", "long" ]
def atol(*args): """atol(s [,base]) -> long Return the long integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x o...
[ "def", "atol", "(", "*", "args", ")", ":", "try", ":", "s", "=", "args", "[", "0", "]", "except", "IndexError", ":", "raise", "TypeError", "(", "'function requires at least 1 argument: %d given'", "%", "len", "(", "args", ")", ")", "# Don't catch type error re...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/stringold.py#L237-L261
SmingHub/Sming
cde389ed030905694983121a32f9028976b57194
Sming/Components/Storage/Tools/hwconfig/editor.py
python
get_id
(obj)
return obj.name
Get string identifier for a device or partition object.
Get string identifier for a device or partition object.
[ "Get", "string", "identifier", "for", "a", "device", "or", "partition", "object", "." ]
def get_id(obj): """Get string identifier for a device or partition object.""" if isinstance(obj, partition.Entry): if obj.is_unused(): return obj.device.name + '/' + str(obj.address) return obj.name
[ "def", "get_id", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "partition", ".", "Entry", ")", ":", "if", "obj", ".", "is_unused", "(", ")", ":", "return", "obj", ".", "device", ".", "name", "+", "'/'", "+", "str", "(", "obj", ".", ...
https://github.com/SmingHub/Sming/blob/cde389ed030905694983121a32f9028976b57194/Sming/Components/Storage/Tools/hwconfig/editor.py#L105-L110
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/call.py
python
ICall.Finish
(self)
Ends the call.
Ends the call.
[ "Ends", "the", "call", "." ]
def Finish(self): '''Ends the call. ''' self._Property('STATUS', 'FINISHED')
[ "def", "Finish", "(", "self", ")", ":", "self", ".", "_Property", "(", "'STATUS'", ",", "'FINISHED'", ")" ]
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/call.py#L68-L71
fengbingchun/NN_Test
d6305825d5273e4569ccd1eda9ffa2a9c72e18d2
src/tiny-dnn/third_party/gemmlowp/meta/generators/meta_arm_64.py
python
Main
()
Generate the single threaded meta gemm library.
Generate the single threaded meta gemm library.
[ "Generate", "the", "single", "threaded", "meta", "gemm", "library", "." ]
def Main(): """Generate the single threaded meta gemm library.""" cc = cc_emitter.CCEmitter() meta_arm_common.GenerateHeader(cc, 'gemmlowp_meta_single_thread_gemm_arm64', 'GEMMLOWP_NEON_64') cc.EmitNamespaceBegin('gemmlowp') cc.EmitNamespaceBegin('meta') cc.EmitNamespaceBeg...
[ "def", "Main", "(", ")", ":", "cc", "=", "cc_emitter", ".", "CCEmitter", "(", ")", "meta_arm_common", ".", "GenerateHeader", "(", "cc", ",", "'gemmlowp_meta_single_thread_gemm_arm64'", ",", "'GEMMLOWP_NEON_64'", ")", "cc", ".", "EmitNamespaceBegin", "(", "'gemmlow...
https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/gemmlowp/meta/generators/meta_arm_64.py#L8-L27
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TBPGraph.EndNI
(self)
return _snap.TBPGraph_EndNI(self)
EndNI(TBPGraph self) -> TBPGraph::TNodeI Parameters: self: TBPGraph const *
EndNI(TBPGraph self) -> TBPGraph::TNodeI
[ "EndNI", "(", "TBPGraph", "self", ")", "-", ">", "TBPGraph", "::", "TNodeI" ]
def EndNI(self): """ EndNI(TBPGraph self) -> TBPGraph::TNodeI Parameters: self: TBPGraph const * """ return _snap.TBPGraph_EndNI(self)
[ "def", "EndNI", "(", "self", ")", ":", "return", "_snap", ".", "TBPGraph_EndNI", "(", "self", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L5011-L5019
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Tool/msvs.py
python
_generateGUID
(slnfile, name, namespace=external_makefile_guid)
return '{' + str(solution).upper() + '}'
Generates a GUID for the sln file to use. The uuid5 function is used to combine an existing namespace uuid - the one VS uses for C projects (external_makedile_guid) - and a combination of the solution file name (slnfile) and the project name (name). We just need uniqueness/repeatability. Returns ...
Generates a GUID for the sln file to use.
[ "Generates", "a", "GUID", "for", "the", "sln", "file", "to", "use", "." ]
def _generateGUID(slnfile, name, namespace=external_makefile_guid): """Generates a GUID for the sln file to use. The uuid5 function is used to combine an existing namespace uuid - the one VS uses for C projects (external_makedile_guid) - and a combination of the solution file name (slnfile) and the ...
[ "def", "_generateGUID", "(", "slnfile", ",", "name", ",", "namespace", "=", "external_makefile_guid", ")", ":", "# Normalize the slnfile path to a Windows path (\\ separators) so", "# the generated file has a consistent GUID even if we generate", "# it on a non-Windows platform.", "sln...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/msvs.py#L109-L125
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/beta.py
python
Beta._check_x
(self, x)
return control_flow_ops.with_dependencies(dependencies, x)
Check x for proper shape, values, then return tensor version.
Check x for proper shape, values, then return tensor version.
[ "Check", "x", "for", "proper", "shape", "values", "then", "return", "tensor", "version", "." ]
def _check_x(self, x): """Check x for proper shape, values, then return tensor version.""" x = ops.convert_to_tensor(x, name="x_before_deps") dependencies = [ check_ops.assert_positive(x), check_ops.assert_less(x, constant_op.constant( 1, self.dtype))] if self.validate_args else ...
[ "def", "_check_x", "(", "self", ",", "x", ")", ":", "x", "=", "ops", ".", "convert_to_tensor", "(", "x", ",", "name", "=", "\"x_before_deps\"", ")", "dependencies", "=", "[", "check_ops", ".", "assert_positive", "(", "x", ")", ",", "check_ops", ".", "a...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/beta.py#L398-L405
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/dataclasses.py
python
fields
(class_or_instance)
return tuple(f for f in fields.values() if f._field_type is _FIELD)
Return a tuple describing the fields of this dataclass. Accepts a dataclass or an instance of one. Tuple elements are of type Field.
Return a tuple describing the fields of this dataclass.
[ "Return", "a", "tuple", "describing", "the", "fields", "of", "this", "dataclass", "." ]
def fields(class_or_instance): """Return a tuple describing the fields of this dataclass. Accepts a dataclass or an instance of one. Tuple elements are of type Field. """ # Might it be worth caching this, per class? try: fields = getattr(class_or_instance, _FIELDS) except Attribute...
[ "def", "fields", "(", "class_or_instance", ")", ":", "# Might it be worth caching this, per class?", "try", ":", "fields", "=", "getattr", "(", "class_or_instance", ",", "_FIELDS", ")", "except", "AttributeError", ":", "raise", "TypeError", "(", "'must be called with a ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/dataclasses.py#L1013-L1028
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/input.py
python
DependencyGraphNode.DependenciesToLinkAgainst
(self, targets)
return self._LinkDependenciesInternal(targets, True)
Returns a list of dependency targets that are linked into this target.
Returns a list of dependency targets that are linked into this target.
[ "Returns", "a", "list", "of", "dependency", "targets", "that", "are", "linked", "into", "this", "target", "." ]
def DependenciesToLinkAgainst(self, targets): """ Returns a list of dependency targets that are linked into this target. """ return self._LinkDependenciesInternal(targets, True)
[ "def", "DependenciesToLinkAgainst", "(", "self", ",", "targets", ")", ":", "return", "self", ".", "_LinkDependenciesInternal", "(", "targets", ",", "True", ")" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/input.py#L1786-L1790
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/clinic/clinic.py
python
create_regex
(before, after, word=True, whole_line=True)
return re.compile(pattern)
Create an re object for matching marker lines.
Create an re object for matching marker lines.
[ "Create", "an", "re", "object", "for", "matching", "marker", "lines", "." ]
def create_regex(before, after, word=True, whole_line=True): """Create an re object for matching marker lines.""" group_re = r"\w+" if word else ".+" pattern = r'{}({}){}' if whole_line: pattern = '^' + pattern + '$' pattern = pattern.format(re.escape(before), group_re, re.escape(after)) ...
[ "def", "create_regex", "(", "before", ",", "after", ",", "word", "=", "True", ",", "whole_line", "=", "True", ")", ":", "group_re", "=", "r\"\\w+\"", "if", "word", "else", "\".+\"", "pattern", "=", "r'{}({}){}'", "if", "whole_line", ":", "pattern", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/clinic/clinic.py#L1270-L1277
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/tools/optimize_for_inference_lib.py
python
fold_batch_norms
(input_graph_def)
return result_graph_def
Removes batch normalization ops by folding them into convolutions. Batch normalization during training has multiple dynamic parameters that are updated, but once the graph is finalized these become constants. That means there's an opportunity to reduce the computations down to a scale and addition, rather than...
Removes batch normalization ops by folding them into convolutions.
[ "Removes", "batch", "normalization", "ops", "by", "folding", "them", "into", "convolutions", "." ]
def fold_batch_norms(input_graph_def): """Removes batch normalization ops by folding them into convolutions. Batch normalization during training has multiple dynamic parameters that are updated, but once the graph is finalized these become constants. That means there's an opportunity to reduce the computations...
[ "def", "fold_batch_norms", "(", "input_graph_def", ")", ":", "input_node_map", "=", "{", "}", "for", "node", "in", "input_graph_def", ".", "node", ":", "if", "node", ".", "name", "not", "in", "input_node_map", ".", "keys", "(", ")", ":", "input_node_map", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/tools/optimize_for_inference_lib.py#L169-L338
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mock-1.0.0/mock.py
python
_patch_object
( target, attribute, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs )
return _patch( getter, attribute, new, spec, create, spec_set, autospec, new_callable, kwargs )
patch.object(target, attribute, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs) patch the named member (`attribute`) on an object (`target`) with a mock object. `patch.object` can be used as a decorator, class decorator or a context man...
patch.object(target, attribute, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs)
[ "patch", ".", "object", "(", "target", "attribute", "new", "=", "DEFAULT", "spec", "=", "None", "create", "=", "False", "spec_set", "=", "None", "autospec", "=", "None", "new_callable", "=", "None", "**", "kwargs", ")" ]
def _patch_object( target, attribute, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs ): """ patch.object(target, attribute, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwarg...
[ "def", "_patch_object", "(", "target", ",", "attribute", ",", "new", "=", "DEFAULT", ",", "spec", "=", "None", ",", "create", "=", "False", ",", "spec_set", "=", "None", ",", "autospec", "=", "None", ",", "new_callable", "=", "None", ",", "*", "*", "...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mock-1.0.0/mock.py#L1407-L1432
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/pipes.py
python
Template.open_r
(self, file)
return os.popen(cmd, 'r')
t.open_r(file) and t.open_w(file) implement t.open(file, 'r') and t.open(file, 'w') respectively.
t.open_r(file) and t.open_w(file) implement t.open(file, 'r') and t.open(file, 'w') respectively.
[ "t", ".", "open_r", "(", "file", ")", "and", "t", ".", "open_w", "(", "file", ")", "implement", "t", ".", "open", "(", "file", "r", ")", "and", "t", ".", "open", "(", "file", "w", ")", "respectively", "." ]
def open_r(self, file): """t.open_r(file) and t.open_w(file) implement t.open(file, 'r') and t.open(file, 'w') respectively.""" if not self.steps: return open(file, 'r') if self.steps[-1][1] == SINK: raise ValueError, \ 'Template.open_r: pipeline...
[ "def", "open_r", "(", "self", ",", "file", ")", ":", "if", "not", "self", ".", "steps", ":", "return", "open", "(", "file", ",", "'r'", ")", "if", "self", ".", "steps", "[", "-", "1", "]", "[", "1", "]", "==", "SINK", ":", "raise", "ValueError"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/pipes.py#L162-L171
envoyproxy/envoy-wasm
ab5d9381fdf92a1efa0b87cff80036b5b3e81198
tools/code_format/check_format.py
python
FormatChecker.checkFormatReturnTraceOnError
(self, file_path)
Run checkFormat and return the traceback of any exception.
Run checkFormat and return the traceback of any exception.
[ "Run", "checkFormat", "and", "return", "the", "traceback", "of", "any", "exception", "." ]
def checkFormatReturnTraceOnError(self, file_path): """Run checkFormat and return the traceback of any exception.""" try: return self.checkFormat(file_path) except: return traceback.format_exc().split("\n")
[ "def", "checkFormatReturnTraceOnError", "(", "self", ",", "file_path", ")", ":", "try", ":", "return", "self", ".", "checkFormat", "(", "file_path", ")", "except", ":", "return", "traceback", ".", "format_exc", "(", ")", ".", "split", "(", "\"\\n\"", ")" ]
https://github.com/envoyproxy/envoy-wasm/blob/ab5d9381fdf92a1efa0b87cff80036b5b3e81198/tools/code_format/check_format.py#L943-L948
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/math/autodiff/geometry_ad.py
python
sphere_point_distance
(c,r,x)
return math_ad.distance(c,x)-r
Autodiff function D(c,r,x) giving the distance from a sphere with center c and radius r to a point x
Autodiff function D(c,r,x) giving the distance from a sphere with center c and radius r to a point x
[ "Autodiff", "function", "D", "(", "c", "r", "x", ")", "giving", "the", "distance", "from", "a", "sphere", "with", "center", "c", "and", "radius", "r", "to", "a", "point", "x" ]
def sphere_point_distance(c,r,x): """Autodiff function D(c,r,x) giving the distance from a sphere with center c and radius r to a point x""" return math_ad.distance(c,x)-r
[ "def", "sphere_point_distance", "(", "c", ",", "r", ",", "x", ")", ":", "return", "math_ad", ".", "distance", "(", "c", ",", "x", ")", "-", "r" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/autodiff/geometry_ad.py#L148-L151
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/connectionpool.py
python
HTTPConnectionPool.urlopen
( self, method, url, body=None, headers=None, retries=None, redirect=True, assert_same_host=True, timeout=_Default, pool_timeout=None, release_conn=None, chunked=False, body_pos=None, **response_kw )
return response
Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method provided by :class:`.RequestMethods`, such ...
Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details.
[ "Get", "a", "connection", "from", "the", "pool", "and", "perform", "an", "HTTP", "request", ".", "This", "is", "the", "lowest", "level", "call", "for", "making", "a", "request", "so", "you", "ll", "need", "to", "specify", "all", "the", "raw", "details", ...
def urlopen( self, method, url, body=None, headers=None, retries=None, redirect=True, assert_same_host=True, timeout=_Default, pool_timeout=None, release_conn=None, chunked=False, body_pos=None, **response_kw...
[ "def", "urlopen", "(", "self", ",", "method", ",", "url", ",", "body", "=", "None", ",", "headers", "=", "None", ",", "retries", "=", "None", ",", "redirect", "=", "True", ",", "assert_same_host", "=", "True", ",", "timeout", "=", "_Default", ",", "p...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/connectionpool.py#L494-L849
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/utils/pyparsing.py
python
ParserElement.parseWithTabs
(self)
return self
Overrides default behavior to expand <TAB>s to spaces before parsing the input string. Must be called before parseString when the input grammar contains elements that match <TAB> characters.
Overrides default behavior to expand <TAB>s to spaces before parsing the input string. Must be called before parseString when the input grammar contains elements that match <TAB> characters.
[ "Overrides", "default", "behavior", "to", "expand", "<TAB", ">", "s", "to", "spaces", "before", "parsing", "the", "input", "string", ".", "Must", "be", "called", "before", "parseString", "when", "the", "input", "grammar", "contains", "elements", "that", "match...
def parseWithTabs(self): """Overrides default behavior to expand <TAB>s to spaces before parsing the input string. Must be called before parseString when the input grammar contains elements that match <TAB> characters.""" self.keepTabs = True return self
[ "def", "parseWithTabs", "(", "self", ")", ":", "self", ".", "keepTabs", "=", "True", "return", "self" ]
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/utils/pyparsing.py#L1102-L1107
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/common/checkout/diff_parser.py
python
git_diff_to_svn_diff
(line)
return line
Converts a git formatted diff line to a svn formatted line. Args: line: A string representing a line of the diff.
Converts a git formatted diff line to a svn formatted line.
[ "Converts", "a", "git", "formatted", "diff", "line", "to", "a", "svn", "formatted", "line", "." ]
def git_diff_to_svn_diff(line): """Converts a git formatted diff line to a svn formatted line. Args: line: A string representing a line of the diff. """ # FIXME: This list should be a class member on DiffParser. # These regexp patterns should be compiled once instead of every time. conver...
[ "def", "git_diff_to_svn_diff", "(", "line", ")", ":", "# FIXME: This list should be a class member on DiffParser.", "# These regexp patterns should be compiled once instead of every time.", "conversion_patterns", "=", "(", "(", "\"^diff --git \\w/(.+) \\w/(?P<FilePath>.+)\"", ",", "lambd...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/common/checkout/diff_parser.py#L51-L69
toggl-open-source/toggldesktop
91865205885531cc8fd9e8d613dad49d625d56e7
third_party/jsoncpp/devtools/licenseupdater.py
python
update_license_in_source_directories
( source_dirs, dry_run, show_diff )
Updates license text in C++ source files found in directory source_dirs. Parameters: source_dirs: list of directory to scan for C++ sources. Directories are scanned recursively. dry_run: if True, just print the path of the file that would be updated, but don't change it...
Updates license text in C++ source files found in directory source_dirs. Parameters: source_dirs: list of directory to scan for C++ sources. Directories are scanned recursively. dry_run: if True, just print the path of the file that would be updated, but don't change it...
[ "Updates", "license", "text", "in", "C", "++", "source", "files", "found", "in", "directory", "source_dirs", ".", "Parameters", ":", "source_dirs", ":", "list", "of", "directory", "to", "scan", "for", "C", "++", "sources", ".", "Directories", "are", "scanned...
def update_license_in_source_directories( source_dirs, dry_run, show_diff ): """Updates license text in C++ source files found in directory source_dirs. Parameters: source_dirs: list of directory to scan for C++ sources. Directories are scanned recursively. dry_run: if True, just ...
[ "def", "update_license_in_source_directories", "(", "source_dirs", ",", "dry_run", ",", "show_diff", ")", ":", "from", "devtools", "import", "antglob", "prune_dirs", "=", "antglob", ".", "prune_dirs", "+", "'scons-local* ./build* ./libs ./dist'", "for", "source_dir", "i...
https://github.com/toggl-open-source/toggldesktop/blob/91865205885531cc8fd9e8d613dad49d625d56e7/third_party/jsoncpp/devtools/licenseupdater.py#L45-L62
linyouhappy/kongkongxiyou
7a69b2913eb29f4be77f9a62fb90cdd72c4160f1
cocosjs/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py
python
TokenGroup.get_tokens
(tu, extent)
Helper method to return all tokens in an extent. This functionality is needed multiple places in this module. We define it here because it seems like a logical place.
Helper method to return all tokens in an extent.
[ "Helper", "method", "to", "return", "all", "tokens", "in", "an", "extent", "." ]
def get_tokens(tu, extent): """Helper method to return all tokens in an extent. This functionality is needed multiple places in this module. We define it here because it seems like a logical place. """ tokens_memory = POINTER(Token)() tokens_count = c_uint() con...
[ "def", "get_tokens", "(", "tu", ",", "extent", ")", ":", "tokens_memory", "=", "POINTER", "(", "Token", ")", "(", ")", "tokens_count", "=", "c_uint", "(", ")", "conf", ".", "lib", ".", "clang_tokenize", "(", "tu", ",", "extent", ",", "byref", "(", "t...
https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L406-L436
funnyzhou/Adaptive_Feeding
9c78182331d8c0ea28de47226e805776c638d46f
lib/fast_rcnn/config.py
python
cfg_from_file
(filename)
Load a config file and merge it into the default options.
Load a config file and merge it into the default options.
[ "Load", "a", "config", "file", "and", "merge", "it", "into", "the", "default", "options", "." ]
def cfg_from_file(filename): """Load a config file and merge it into the default options.""" import yaml with open(filename, 'r') as f: yaml_cfg = edict(yaml.load(f)) _merge_a_into_b(yaml_cfg, __C)
[ "def", "cfg_from_file", "(", "filename", ")", ":", "import", "yaml", "with", "open", "(", "filename", ",", "'r'", ")", "as", "f", ":", "yaml_cfg", "=", "edict", "(", "yaml", ".", "load", "(", "f", ")", ")", "_merge_a_into_b", "(", "yaml_cfg", ",", "_...
https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/fast_rcnn/config.py#L266-L272
lighttransport/nanort
74063967336311f54ede5dffdfa242123825033b
deps/cpplint.py
python
IsOutOfLineMethodDefinition
(clean_lines, linenum)
return False
Check if current line contains an out-of-line method definition. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains an out-of-line method definition.
Check if current line contains an out-of-line method definition.
[ "Check", "if", "current", "line", "contains", "an", "out", "-", "of", "-", "line", "method", "definition", "." ]
def IsOutOfLineMethodDefinition(clean_lines, linenum): """Check if current line contains an out-of-line method definition. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains an out-of-line method definition...
[ "def", "IsOutOfLineMethodDefinition", "(", "clean_lines", ",", "linenum", ")", ":", "# Scan back a few lines for start of current function", "for", "i", "in", "xrange", "(", "linenum", ",", "max", "(", "-", "1", ",", "linenum", "-", "10", ")", ",", "-", "1", "...
https://github.com/lighttransport/nanort/blob/74063967336311f54ede5dffdfa242123825033b/deps/cpplint.py#L5022-L5035
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/io/transforms.py
python
mean
(filename)
return cntk_py.reader_mean(filename)
Mean transform that can be used to pass to `map_features` for data augmentation. Args: filename (str): file that stores the mean values for each pixel in OpenCV matrix XML format Returns: dict: A dictionary-like object describing the mean transform
Mean transform that can be used to pass to `map_features` for data augmentation.
[ "Mean", "transform", "that", "can", "be", "used", "to", "pass", "to", "map_features", "for", "data", "augmentation", "." ]
def mean(filename): ''' Mean transform that can be used to pass to `map_features` for data augmentation. Args: filename (str): file that stores the mean values for each pixel in OpenCV matrix XML format Returns: dict: A dictionary-like object describing the mean transf...
[ "def", "mean", "(", "filename", ")", ":", "return", "cntk_py", ".", "reader_mean", "(", "filename", ")" ]
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/io/transforms.py#L98-L110
l4ka/pistachio
8be66aa9b85a774ad1b71dbd3a79c5c745a96273
contrib/cml2/cml.py
python
ConfigSymbol.is_derived
(self)
return self.prompt is None
Is this a derived symbol?
Is this a derived symbol?
[ "Is", "this", "a", "derived", "symbol?" ]
def is_derived(self): "Is this a derived symbol?" return self.prompt is None
[ "def", "is_derived", "(", "self", ")", ":", "return", "self", ".", "prompt", "is", "None" ]
https://github.com/l4ka/pistachio/blob/8be66aa9b85a774ad1b71dbd3a79c5c745a96273/contrib/cml2/cml.py#L144-L146
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/todo_check.py
python
TodoChecker.check_all_files
(self, base_dir: str)
Check all files under the base directory for TODO references. :param base_dir: Base directory to start searching.
Check all files under the base directory for TODO references.
[ "Check", "all", "files", "under", "the", "base", "directory", "for", "TODO", "references", "." ]
def check_all_files(self, base_dir: str) -> None: """ Check all files under the base directory for TODO references. :param base_dir: Base directory to start searching. """ walk_fs(base_dir, self.check_file)
[ "def", "check_all_files", "(", "self", ",", "base_dir", ":", "str", ")", "->", "None", ":", "walk_fs", "(", "base_dir", ",", "self", ".", "check_file", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/todo_check.py#L102-L108
strasdat/Sophus
36b08885e094fda63e92ad89d65be380c288265a
sympy/sophus/se2.py
python
Se2.__init__
(self, so2, t)
internally represented by a unit complex number z and a translation 2-vector
internally represented by a unit complex number z and a translation 2-vector
[ "internally", "represented", "by", "a", "unit", "complex", "number", "z", "and", "a", "translation", "2", "-", "vector" ]
def __init__(self, so2, t): """ internally represented by a unit complex number z and a translation 2-vector """ self.so2 = so2 self.t = t
[ "def", "__init__", "(", "self", ",", "so2", ",", "t", ")", ":", "self", ".", "so2", "=", "so2", "self", ".", "t", "=", "t" ]
https://github.com/strasdat/Sophus/blob/36b08885e094fda63e92ad89d65be380c288265a/sympy/sophus/se2.py#L11-L15
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/module/module.py
python
Module.output_names
(self)
return self._output_names
A list of names for the outputs of this module.
A list of names for the outputs of this module.
[ "A", "list", "of", "names", "for", "the", "outputs", "of", "this", "module", "." ]
def output_names(self): """A list of names for the outputs of this module.""" return self._output_names
[ "def", "output_names", "(", "self", ")", ":", "return", "self", ".", "_output_names" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/module/module.py#L205-L207
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fsspec/spec.py
python
AbstractFileSystem.checksum
(self, path)
return int(tokenize(self.info(path)), 16)
Unique value for current version of file If the checksum is the same from one moment to another, the contents are guaranteed to be the same. If the checksum changes, the contents *might* have changed. This should normally be overridden; default will probably capture creation/mo...
Unique value for current version of file
[ "Unique", "value", "for", "current", "version", "of", "file" ]
def checksum(self, path): """Unique value for current version of file If the checksum is the same from one moment to another, the contents are guaranteed to be the same. If the checksum changes, the contents *might* have changed. This should normally be overridden; default will...
[ "def", "checksum", "(", "self", ",", "path", ")", ":", "return", "int", "(", "tokenize", "(", "self", ".", "info", "(", "path", ")", ")", ",", "16", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fsspec/spec.py#L554-L565
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/tpu/tensor_tracer.py
python
TensorTracer.trace_tpu
(self, graph, tensor_fetches, op_fetches=None, num_replicas=None, num_replicas_per_host=None, num_hosts=None)
return tensor_fetches
Traces the tensors generated by TPU Ops in a TF graph. Args: graph: the graph of Ops executed on the TPU. tensor_fetches: a (list,tuple,or a single object) of tensor fetches returned by model_fn given to session.run. Function must be provided with as least one tensor to fetch. op_...
Traces the tensors generated by TPU Ops in a TF graph.
[ "Traces", "the", "tensors", "generated", "by", "TPU", "Ops", "in", "a", "TF", "graph", "." ]
def trace_tpu(self, graph, tensor_fetches, op_fetches=None, num_replicas=None, num_replicas_per_host=None, num_hosts=None): """Traces the tensors generated by TPU Ops in a TF graph. Args: graph: the graph of Ops executed on t...
[ "def", "trace_tpu", "(", "self", ",", "graph", ",", "tensor_fetches", ",", "op_fetches", "=", "None", ",", "num_replicas", "=", "None", ",", "num_replicas_per_host", "=", "None", ",", "num_hosts", "=", "None", ")", ":", "if", "isinstance", "(", "graph", ",...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/tensor_tracer.py#L2056-L2116
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/grit/grit/format/policy_templates/writers/doc_writer.py
python
GetWriter
(config)
return DocWriter(['*'], config)
Factory method for creating DocWriter objects. See the constructor of TemplateWriter for description of arguments.
Factory method for creating DocWriter objects. See the constructor of TemplateWriter for description of arguments.
[ "Factory", "method", "for", "creating", "DocWriter", "objects", ".", "See", "the", "constructor", "of", "TemplateWriter", "for", "description", "of", "arguments", "." ]
def GetWriter(config): '''Factory method for creating DocWriter objects. See the constructor of TemplateWriter for description of arguments. ''' return DocWriter(['*'], config)
[ "def", "GetWriter", "(", "config", ")", ":", "return", "DocWriter", "(", "[", "'*'", "]", ",", "config", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/format/policy_templates/writers/doc_writer.py#L13-L18
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/special/basic.py
python
kvp
(v, z, n=1)
Compute nth derivative of real-order modified Bessel function Kv(z) Kv(z) is the modified Bessel function of the second kind. Derivative is calculated with respect to `z`. Parameters ---------- v : array_like of float Order of Bessel function z : array_like of complex Argument ...
Compute nth derivative of real-order modified Bessel function Kv(z)
[ "Compute", "nth", "derivative", "of", "real", "-", "order", "modified", "Bessel", "function", "Kv", "(", "z", ")" ]
def kvp(v, z, n=1): """Compute nth derivative of real-order modified Bessel function Kv(z) Kv(z) is the modified Bessel function of the second kind. Derivative is calculated with respect to `z`. Parameters ---------- v : array_like of float Order of Bessel function z : array_like o...
[ "def", "kvp", "(", "v", ",", "z", ",", "n", "=", "1", ")", ":", "n", "=", "_nonneg_int_or_fail", "(", "n", ",", "'n'", ")", "if", "n", "==", "0", ":", "return", "kv", "(", "v", ",", "z", ")", "else", ":", "return", "(", "-", "1", ")", "**...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/special/basic.py#L500-L552
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiToolBarItem.GetProportion
(*args, **kwargs)
return _aui.AuiToolBarItem_GetProportion(*args, **kwargs)
GetProportion(self) -> int
GetProportion(self) -> int
[ "GetProportion", "(", "self", ")", "-", ">", "int" ]
def GetProportion(*args, **kwargs): """GetProportion(self) -> int""" return _aui.AuiToolBarItem_GetProportion(*args, **kwargs)
[ "def", "GetProportion", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiToolBarItem_GetProportion", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L1837-L1839
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/external/bazel_tools/tools/j2objc/j2objc_wrapper.py
python
_ParseArgs
(j2objc_args)
return (source_files, flags)
Separate arguments passed to J2ObjC into source files and J2ObjC flags. Args: j2objc_args: A list of args to pass to J2ObjC transpiler. Returns: A tuple containing source files and J2ObjC flags
Separate arguments passed to J2ObjC into source files and J2ObjC flags.
[ "Separate", "arguments", "passed", "to", "J2ObjC", "into", "source", "files", "and", "J2ObjC", "flags", "." ]
def _ParseArgs(j2objc_args): """Separate arguments passed to J2ObjC into source files and J2ObjC flags. Args: j2objc_args: A list of args to pass to J2ObjC transpiler. Returns: A tuple containing source files and J2ObjC flags """ source_files = [] flags = [] is_next_flag_value = False for j2obj...
[ "def", "_ParseArgs", "(", "j2objc_args", ")", ":", "source_files", "=", "[", "]", "flags", "=", "[", "]", "is_next_flag_value", "=", "False", "for", "j2objc_arg", "in", "j2objc_args", ":", "if", "j2objc_arg", ".", "startswith", "(", "'-'", ")", ":", "flags...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/external/bazel_tools/tools/j2objc/j2objc_wrapper.py#L180-L200
Slicer/SlicerGitSVNArchive
65e92bb16c2b32ea47a1a66bee71f238891ee1ca
Utilities/Scripts/SlicerWizard/Utilities.py
python
buildProcessArgs
(*args, **kwargs)
return result + ["%s" % a for a in args if a is not None]
Build |CLI| arguments from Python-like arguments. :param prefix: Prefix for named options. :type prefix: :class:`str` :param args: Positional arguments. :type args: :class:`~collections.Sequence` :param kwargs: Named options. :type kwargs: :class:`dict` :return: Converted argument list. :rtype: :class...
Build |CLI| arguments from Python-like arguments.
[ "Build", "|CLI|", "arguments", "from", "Python", "-", "like", "arguments", "." ]
def buildProcessArgs(*args, **kwargs): """Build |CLI| arguments from Python-like arguments. :param prefix: Prefix for named options. :type prefix: :class:`str` :param args: Positional arguments. :type args: :class:`~collections.Sequence` :param kwargs: Named options. :type kwargs: :class:`dict` :retur...
[ "def", "buildProcessArgs", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "result", "=", "[", "]", "for", "k", ",", "v", "in", "kwargs", ".", "items", "(", ")", ":", "if", "v", "is", "None", "or", "v", "is", "False", ":", "continue", "res...
https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Utilities/Scripts/SlicerWizard/Utilities.py#L253-L295
facebookresearch/ELF
1f790173095cd910976d9f651b80beb872ec5d12
rlpytorch/model_interface.py
python
ModelInterface.__getitem__
(self, key)
return self.models[key]
Get an item associated with ``key`` from ``self.models``
Get an item associated with ``key`` from ``self.models``
[ "Get", "an", "item", "associated", "with", "key", "from", "self", ".", "models" ]
def __getitem__(self, key): ''' Get an item associated with ``key`` from ``self.models``''' return self.models[key]
[ "def", "__getitem__", "(", "self", ",", "key", ")", ":", "return", "self", ".", "models", "[", "key", "]" ]
https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/rlpytorch/model_interface.py#L173-L175
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
PrintData.SetPaperId
(*args, **kwargs)
return _windows_.PrintData_SetPaperId(*args, **kwargs)
SetPaperId(self, int sizeId)
SetPaperId(self, int sizeId)
[ "SetPaperId", "(", "self", "int", "sizeId", ")" ]
def SetPaperId(*args, **kwargs): """SetPaperId(self, int sizeId)""" return _windows_.PrintData_SetPaperId(*args, **kwargs)
[ "def", "SetPaperId", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PrintData_SetPaperId", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L4803-L4805
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextCtrl.AddStyledText
(*args, **kwargs)
return _stc.StyledTextCtrl_AddStyledText(*args, **kwargs)
AddStyledText(self, wxMemoryBuffer data) Add array of cells to document.
AddStyledText(self, wxMemoryBuffer data)
[ "AddStyledText", "(", "self", "wxMemoryBuffer", "data", ")" ]
def AddStyledText(*args, **kwargs): """ AddStyledText(self, wxMemoryBuffer data) Add array of cells to document. """ return _stc.StyledTextCtrl_AddStyledText(*args, **kwargs)
[ "def", "AddStyledText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_AddStyledText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L2043-L2049
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythplugins/mythgame/mythgame/scripts/giantbomb/giantbomb_api.py
python
gamedbQueries.supportedJobs
(self, context, *inputArgs)
return False
Validate that the job category is supported by the Universal Metadata Format item format return True is supported return False if not supported
Validate that the job category is supported by the Universal Metadata Format item format return True is supported return False if not supported
[ "Validate", "that", "the", "job", "category", "is", "supported", "by", "the", "Universal", "Metadata", "Format", "item", "format", "return", "True", "is", "supported", "return", "False", "if", "not", "supported" ]
def supportedJobs(self, context, *inputArgs): '''Validate that the job category is supported by the Universal Metadata Format item format return True is supported return False if not supported ''' if type([]) == type(inputArgs[0]): tmpCopy = inputArgs[0] ...
[ "def", "supportedJobs", "(", "self", ",", "context", ",", "*", "inputArgs", ")", ":", "if", "type", "(", "[", "]", ")", "==", "type", "(", "inputArgs", "[", "0", "]", ")", ":", "tmpCopy", "=", "inputArgs", "[", "0", "]", "else", ":", "tmpCopy", "...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythplugins/mythgame/mythgame/scripts/giantbomb/giantbomb_api.py#L364-L377
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
xmlNs.newDocNodeEatName
(self, doc, name, content)
return __tmp
Creation of a new node element within a document. @ns and @content are optional (None). NOTE: @content is supposed to be a piece of XML CDATA, so it allow entities references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNo...
Creation of a new node element within a document.
[ "Creation", "of", "a", "new", "node", "element", "within", "a", "document", "." ]
def newDocNodeEatName(self, doc, name, content): """Creation of a new node element within a document. @ns and @content are optional (None). NOTE: @content is supposed to be a piece of XML CDATA, so it allow entities references, but XML special chars need to be escaped first by usin...
[ "def", "newDocNodeEatName", "(", "self", ",", "doc", ",", "name", ",", "content", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlNewDocNodeEatName", "(",...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L5138-L5150
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBTarget.GetTargetFromEvent
(*args)
return _lldb.SBTarget_GetTargetFromEvent(*args)
GetTargetFromEvent(SBEvent event) -> SBTarget
GetTargetFromEvent(SBEvent event) -> SBTarget
[ "GetTargetFromEvent", "(", "SBEvent", "event", ")", "-", ">", "SBTarget" ]
def GetTargetFromEvent(*args): """GetTargetFromEvent(SBEvent event) -> SBTarget""" return _lldb.SBTarget_GetTargetFromEvent(*args)
[ "def", "GetTargetFromEvent", "(", "*", "args", ")", ":", "return", "_lldb", ".", "SBTarget_GetTargetFromEvent", "(", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L8574-L8576
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/parallel_for/pfor.py
python
PFor.op_is_inside_loop
(self, op)
return op._id in self._pfor_op_ids
True if op was created inside the pfor loop body.
True if op was created inside the pfor loop body.
[ "True", "if", "op", "was", "created", "inside", "the", "pfor", "loop", "body", "." ]
def op_is_inside_loop(self, op): """True if op was created inside the pfor loop body.""" assert isinstance(op, ops.Operation) # Note that we use self._pfor_op_ids for the check and not self._pfor_ops # since it appears there tensorflow API could return different python # objects representing the sam...
[ "def", "op_is_inside_loop", "(", "self", ",", "op", ")", ":", "assert", "isinstance", "(", "op", ",", "ops", ".", "Operation", ")", "# Note that we use self._pfor_op_ids for the check and not self._pfor_ops", "# since it appears there tensorflow API could return different python"...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/parallel_for/pfor.py#L1318-L1324
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/closure_linter/closure_linter/indentation.py
python
TokenInfo.__init__
(self, token, is_block=False)
Initializes a TokenInfo object. Args: token: The token is_block: Whether the token represents a block indentation.
Initializes a TokenInfo object.
[ "Initializes", "a", "TokenInfo", "object", "." ]
def __init__(self, token, is_block=False): """Initializes a TokenInfo object. Args: token: The token is_block: Whether the token represents a block indentation. """ self.token = token self.overridden_by = None self.is_permanent_override = False self.is_block = is_block self....
[ "def", "__init__", "(", "self", ",", "token", ",", "is_block", "=", "False", ")", ":", "self", ".", "token", "=", "token", "self", ".", "overridden_by", "=", "None", "self", ".", "is_permanent_override", "=", "False", "self", ".", "is_block", "=", "is_bl...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/indentation.py#L81-L94
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
build/android/pylib/cmd_helper.py
python
GetCmdStatusAndOutputWithTimeoutAndRetries
(args, timeout, retries)
return timeout_retry.Run(GetCmdStatusAndOutput, timeout, retries, [args])
Executes a subprocess with a timeout and retries. Args: args: List of arguments to the program, the program to execute is the first element. timeout: the timeout in seconds. retries: the number of retries. Returns: The 2-tuple (exit code, output).
Executes a subprocess with a timeout and retries.
[ "Executes", "a", "subprocess", "with", "a", "timeout", "and", "retries", "." ]
def GetCmdStatusAndOutputWithTimeoutAndRetries(args, timeout, retries): """Executes a subprocess with a timeout and retries. Args: args: List of arguments to the program, the program to execute is the first element. timeout: the timeout in seconds. retries: the number of retries. Returns: ...
[ "def", "GetCmdStatusAndOutputWithTimeoutAndRetries", "(", "args", ",", "timeout", ",", "retries", ")", ":", "return", "timeout_retry", ".", "Run", "(", "GetCmdStatusAndOutput", ",", "timeout", ",", "retries", ",", "[", "args", "]", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/cmd_helper.py#L108-L120
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/framework/common_shapes.py
python
unchanged_shape_with_rank
(rank)
return _ShapeFunction
Returns a shape function for ops that constrain the rank of their input. Args: rank: The exact rank of the input and output. Returns: A shape function for ops that output a tensor of the same size as their input, with a particular rank.
Returns a shape function for ops that constrain the rank of their input.
[ "Returns", "a", "shape", "function", "for", "ops", "that", "constrain", "the", "rank", "of", "their", "input", "." ]
def unchanged_shape_with_rank(rank): """Returns a shape function for ops that constrain the rank of their input. Args: rank: The exact rank of the input and output. Returns: A shape function for ops that output a tensor of the same size as their input, with a particular rank. """ def _ShapeFunc...
[ "def", "unchanged_shape_with_rank", "(", "rank", ")", ":", "def", "_ShapeFunction", "(", "op", ")", ":", "return", "[", "op", ".", "inputs", "[", "0", "]", ".", "get_shape", "(", ")", ".", "with_rank", "(", "rank", ")", "]", "return", "_ShapeFunction" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/common_shapes.py#L33-L47
15172658790/Blog
46e5036f5fbcad535af2255dc0e095cebcd8d710
数学类/计算方法/code/第4章 非线性方程求根/iteration.py
python
secant
(y:sympy.core,x0:float,x1:float,epsilon:float =0.00001,maxtime:int=50)
弦截法, 使用newton 差商计算,每次只需计算一次f(x) secant method for finding a zeropoint of a func y is the func , x0 is the init x val, epsilon is the accurrency
弦截法, 使用newton 差商计算,每次只需计算一次f(x) secant method for finding a zeropoint of a func y is the func , x0 is the init x val, epsilon is the accurrency
[ "弦截法", "使用newton", "差商计算", "每次只需计算一次f", "(", "x", ")", "secant", "method", "for", "finding", "a", "zeropoint", "of", "a", "func", "y", "is", "the", "func", "x0", "is", "the", "init", "x", "val", "epsilon", "is", "the", "accurrency" ]
def secant(y:sympy.core,x0:float,x1:float,epsilon:float =0.00001,maxtime:int=50) ->(list,list): ''' 弦截法, 使用newton 差商计算,每次只需计算一次f(x) secant method for finding a zeropoint of a func y is the func , x0 is the init x val, epsilon is the accurrency ''' if epsilon <0:epsilon = -epsilon...
[ "def", "secant", "(", "y", ":", "sympy", ".", "core", ",", "x0", ":", "float", ",", "x1", ":", "float", ",", "epsilon", ":", "float", "=", "0.00001", ",", "maxtime", ":", "int", "=", "50", ")", "->", "(", "list", ",", "list", ")", ":", "if", ...
https://github.com/15172658790/Blog/blob/46e5036f5fbcad535af2255dc0e095cebcd8d710/数学类/计算方法/code/第4章 非线性方程求根/iteration.py#L33-L60
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/json_util.py
python
JsonProperty.get_value_for_datastore
(self, model_instance)
return datastore_types.Text(json.dumps( json_value, sort_keys=True, cls=JsonEncoder))
Gets value for datastore. Args: model_instance: instance of the model class. Returns: datastore-compatible value.
Gets value for datastore.
[ "Gets", "value", "for", "datastore", "." ]
def get_value_for_datastore(self, model_instance): """Gets value for datastore. Args: model_instance: instance of the model class. Returns: datastore-compatible value. """ value = super(JsonProperty, self).get_value_for_datastore(model_instance) if not value: return None ...
[ "def", "get_value_for_datastore", "(", "self", ",", "model_instance", ")", ":", "value", "=", "super", "(", "JsonProperty", ",", "self", ")", ".", "get_value_for_datastore", "(", "model_instance", ")", "if", "not", "value", ":", "return", "None", "json_value", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/json_util.py#L170-L188
LiXizhi/NPLRuntime
a42720e5fe9a6960e0a9ce40bbbcd809192906be
Client/trunk/externals/assimp-4.0.0/port/PyAssimp/scripts/fixed_pipeline_3d_viewer.py
python
GLRenderer.apply_material
(self, mat)
Apply an OpenGL, using one OpenGL display list per material to cache the operation.
Apply an OpenGL, using one OpenGL display list per material to cache the operation.
[ "Apply", "an", "OpenGL", "using", "one", "OpenGL", "display", "list", "per", "material", "to", "cache", "the", "operation", "." ]
def apply_material(self, mat): """ Apply an OpenGL, using one OpenGL display list per material to cache the operation. """ if not hasattr(mat, "gl_mat"): # evaluate once the mat properties, and cache the values in a glDisplayList. diffuse = numpy.array(mat.properties.get("d...
[ "def", "apply_material", "(", "self", ",", "mat", ")", ":", "if", "not", "hasattr", "(", "mat", ",", "\"gl_mat\"", ")", ":", "# evaluate once the mat properties, and cache the values in a glDisplayList.", "diffuse", "=", "numpy", ".", "array", "(", "mat", ".", "pr...
https://github.com/LiXizhi/NPLRuntime/blob/a42720e5fe9a6960e0a9ce40bbbcd809192906be/Client/trunk/externals/assimp-4.0.0/port/PyAssimp/scripts/fixed_pipeline_3d_viewer.py#L201-L228
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/pexpect/pexpect.py
python
spawn.expect_exact
(self, pattern_list, timeout=-1, searchwindowsize=-1)
return self.expect_loop(searcher_string(pattern_list), timeout, searchwindowsize)
This is similar to expect(), but uses plain string matching instead of compiled regular expressions in 'pattern_list'. The 'pattern_list' may be a string; a list or other sequence of strings; or TIMEOUT and EOF. This call might be faster than expect() for two reasons: string sea...
This is similar to expect(), but uses plain string matching instead of compiled regular expressions in 'pattern_list'. The 'pattern_list' may be a string; a list or other sequence of strings; or TIMEOUT and EOF.
[ "This", "is", "similar", "to", "expect", "()", "but", "uses", "plain", "string", "matching", "instead", "of", "compiled", "regular", "expressions", "in", "pattern_list", ".", "The", "pattern_list", "may", "be", "a", "string", ";", "a", "list", "or", "other",...
def expect_exact(self, pattern_list, timeout=-1, searchwindowsize=-1): """This is similar to expect(), but uses plain string matching instead of compiled regular expressions in 'pattern_list'. The 'pattern_list' may be a string; a list or other sequence of strings; or TIMEOUT and EOF. ...
[ "def", "expect_exact", "(", "self", ",", "pattern_list", ",", "timeout", "=", "-", "1", ",", "searchwindowsize", "=", "-", "1", ")", ":", "if", "(", "type", "(", "pattern_list", ")", "in", "types", ".", "StringTypes", "or", "pattern_list", "in", "(", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/pexpect/pexpect.py#L1403-L1421
cornell-zhang/heterocl
6d9e4b4acc2ee2707b2d25b27298c0335bccedfd
python/heterocl/debug.py
python
hcl_excepthook
(etype, value, tb)
Customized excepthook If the exception is a HeteroCL exception, only the traceback that related to user's program will be listed. All HeteroCL internal traceback will be hidden.
Customized excepthook
[ "Customized", "excepthook" ]
def hcl_excepthook(etype, value, tb): """Customized excepthook If the exception is a HeteroCL exception, only the traceback that related to user's program will be listed. All HeteroCL internal traceback will be hidden. """ if issubclass(etype, HCLError): extracted_tb = traceback.extract...
[ "def", "hcl_excepthook", "(", "etype", ",", "value", ",", "tb", ")", ":", "if", "issubclass", "(", "etype", ",", "HCLError", ")", ":", "extracted_tb", "=", "traceback", ".", "extract_tb", "(", "tb", ")", "frame_stack", "=", "[", "]", "for", "e_tb", "in...
https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/debug.py#L58-L77
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/ma/mrecords.py
python
MaskedRecords.__reduce__
(self)
return (_mrreconstruct, (self.__class__, self._baseclass, (0,), 'b',), self.__getstate__())
Return a 3-tuple for pickling a MaskedArray.
Return a 3-tuple for pickling a MaskedArray.
[ "Return", "a", "3", "-", "tuple", "for", "pickling", "a", "MaskedArray", "." ]
def __reduce__(self): """ Return a 3-tuple for pickling a MaskedArray. """ return (_mrreconstruct, (self.__class__, self._baseclass, (0,), 'b',), self.__getstate__())
[ "def", "__reduce__", "(", "self", ")", ":", "return", "(", "_mrreconstruct", ",", "(", "self", ".", "__class__", ",", "self", ".", "_baseclass", ",", "(", "0", ",", ")", ",", "'b'", ",", ")", ",", "self", ".", "__getstate__", "(", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/mrecords.py#L484-L491
GrammaTech/gtirb
415dd72e1e3c475004d013723c16cdcb29c0826e
python/gtirb/block.py
python
Block.references
(self)
Get all the symbols that refer to this block.
Get all the symbols that refer to this block.
[ "Get", "all", "the", "symbols", "that", "refer", "to", "this", "block", "." ]
def references(self) -> typing.Iterator["Symbol"]: """Get all the symbols that refer to this block.""" raise NotImplementedError
[ "def", "references", "(", "self", ")", "->", "typing", ".", "Iterator", "[", "\"Symbol\"", "]", ":", "raise", "NotImplementedError" ]
https://github.com/GrammaTech/gtirb/blob/415dd72e1e3c475004d013723c16cdcb29c0826e/python/gtirb/block.py#L24-L27
InsightSoftwareConsortium/ITK
87acfce9a93d928311c38bc371b666b515b9f19d
Modules/ThirdParty/pygccxml/src/pygccxml/declarations/variable.py
python
variable_t.byte_offset
(self)
return self._byte_offset
integer, offset of the field from the beginning of class.
integer, offset of the field from the beginning of class.
[ "integer", "offset", "of", "the", "field", "from", "the", "beginning", "of", "class", "." ]
def byte_offset(self): """integer, offset of the field from the beginning of class.""" return self._byte_offset
[ "def", "byte_offset", "(", "self", ")", ":", "return", "self", ".", "_byte_offset" ]
https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/variable.py#L88-L90
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/setuptools/dist.py
python
Distribution.has_contents_for
(self, package)
Return true if 'exclude_package(package)' would do something
Return true if 'exclude_package(package)' would do something
[ "Return", "true", "if", "exclude_package", "(", "package", ")", "would", "do", "something" ]
def has_contents_for(self, package): """Return true if 'exclude_package(package)' would do something""" pfx = package + '.' for p in self.iter_distribution_names(): if p == package or p.startswith(pfx): return True
[ "def", "has_contents_for", "(", "self", ",", "package", ")", ":", "pfx", "=", "package", "+", "'.'", "for", "p", "in", "self", ".", "iter_distribution_names", "(", ")", ":", "if", "p", "==", "package", "or", "p", ".", "startswith", "(", "pfx", ")", "...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/dist.py#L922-L929
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/config/configobj.py
python
ConfigObj._set_configspec_value
(self, configspec, section)
Used to recursively set configspec values.
Used to recursively set configspec values.
[ "Used", "to", "recursively", "set", "configspec", "values", "." ]
def _set_configspec_value(self, configspec, section): """Used to recursively set configspec values.""" if '__many__' in configspec.sections: section.configspec['__many__'] = configspec['__many__'] if len(configspec.sections) > 1: # FIXME: can we supply any useful ...
[ "def", "_set_configspec_value", "(", "self", ",", "configspec", ",", "section", ")", ":", "if", "'__many__'", "in", "configspec", ".", "sections", ":", "section", ".", "configspec", "[", "'__many__'", "]", "=", "configspec", "[", "'__many__'", "]", "if", "le...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/config/configobj.py#L1796-L1824
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-uhd/apps/uhd_siggen_base.py
python
USRPSiggen.set_samp_rate
(self, samp_rate)
return True
When sampling rate is updated, also update the signal sources.
When sampling rate is updated, also update the signal sources.
[ "When", "sampling", "rate", "is", "updated", "also", "update", "the", "signal", "sources", "." ]
def set_samp_rate(self, samp_rate): """ When sampling rate is updated, also update the signal sources. """ self.vprint("Setting sampling rate to: {rate} Msps".format( rate=samp_rate / 1e6)) self.usrp.set_samp_rate(samp_rate) samp_rate = self.usrp.get_samp_rate...
[ "def", "set_samp_rate", "(", "self", ",", "samp_rate", ")", ":", "self", ".", "vprint", "(", "\"Setting sampling rate to: {rate} Msps\"", ".", "format", "(", "rate", "=", "samp_rate", "/", "1e6", ")", ")", "self", ".", "usrp", ".", "set_samp_rate", "(", "sam...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-uhd/apps/uhd_siggen_base.py#L131-L152
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/telemetry/core/bitmap.py
python
Bitmap.pixels
(self)
return self._pixels
Flat pixel array of the bitmap.
Flat pixel array of the bitmap.
[ "Flat", "pixel", "array", "of", "the", "bitmap", "." ]
def pixels(self): """Flat pixel array of the bitmap.""" if self._crop_box: self._pixels = self._PrepareTools().CropPixels() _, _, self._width, self._height = self._crop_box self._crop_box = None if type(self._pixels) is not bytearray: self._pixels = bytearray(self._pixels) return...
[ "def", "pixels", "(", "self", ")", ":", "if", "self", ".", "_crop_box", ":", "self", ".", "_pixels", "=", "self", ".", "_PrepareTools", "(", ")", ".", "CropPixels", "(", ")", "_", ",", "_", ",", "self", ".", "_width", ",", "self", ".", "_height", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/bitmap.py#L216-L224
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
KeyboardState.__init__
(self, *args, **kwargs)
__init__(self, bool controlDown=False, bool shiftDown=False, bool altDown=False, bool metaDown=False) -> KeyboardState wx.KeyboardState stores the state of the keyboard modifier keys
__init__(self, bool controlDown=False, bool shiftDown=False, bool altDown=False, bool metaDown=False) -> KeyboardState
[ "__init__", "(", "self", "bool", "controlDown", "=", "False", "bool", "shiftDown", "=", "False", "bool", "altDown", "=", "False", "bool", "metaDown", "=", "False", ")", "-", ">", "KeyboardState" ]
def __init__(self, *args, **kwargs): """ __init__(self, bool controlDown=False, bool shiftDown=False, bool altDown=False, bool metaDown=False) -> KeyboardState wx.KeyboardState stores the state of the keyboard modifier keys """ _core_.KeyboardState_swiginit(self,_c...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_core_", ".", "KeyboardState_swiginit", "(", "self", ",", "_core_", ".", "new_KeyboardState", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L4287-L4294
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/html.py
python
HtmlTag.GetBeginPos
(*args, **kwargs)
return _html.HtmlTag_GetBeginPos(*args, **kwargs)
GetBeginPos(self) -> int
GetBeginPos(self) -> int
[ "GetBeginPos", "(", "self", ")", "-", ">", "int" ]
def GetBeginPos(*args, **kwargs): """GetBeginPos(self) -> int""" return _html.HtmlTag_GetBeginPos(*args, **kwargs)
[ "def", "GetBeginPos", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlTag_GetBeginPos", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L161-L163
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/model/collide.py
python
WorldCollider.rayCastRobot
(self,robot,s,d)
return self.rayCast(s,d,rindices)
Finds the first collision between a ray and a robot. Args: robot (RobotModel or int): the robot s (list of 3 floats): the ray source d (list of 3 floats): the ray direction Returns: tuple: The (object,point) pair or None if no collision is found.
Finds the first collision between a ray and a robot.
[ "Finds", "the", "first", "collision", "between", "a", "ray", "and", "a", "robot", "." ]
def rayCastRobot(self,robot,s,d): """Finds the first collision between a ray and a robot. Args: robot (RobotModel or int): the robot s (list of 3 floats): the ray source d (list of 3 floats): the ray direction Returns: tuple: The (object,point) p...
[ "def", "rayCastRobot", "(", "self", ",", "robot", ",", "s", ",", "d", ")", ":", "if", "isinstance", "(", "robot", ",", "RobotModel", ")", ":", "try", ":", "robot", "=", "[", "r", "for", "r", "in", "xrange", "(", "self", ".", "world", ".", "numRob...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/collide.py#L656-L673
liulei01/DRBox
b5c76e033c555c9009590ab384e1f7bd3c66c237
python/caffe/pycaffe.py
python
_Net_get_id_name
(func, field)
return get_id_name
Generic property that maps func to the layer names into an OrderedDict. Used for top_names and bottom_names. Parameters ---------- func: function id -> [id] field: implementation field name (cache) Returns ------ A one-parameter function that can be set as a property.
Generic property that maps func to the layer names into an OrderedDict.
[ "Generic", "property", "that", "maps", "func", "to", "the", "layer", "names", "into", "an", "OrderedDict", "." ]
def _Net_get_id_name(func, field): """ Generic property that maps func to the layer names into an OrderedDict. Used for top_names and bottom_names. Parameters ---------- func: function id -> [id] field: implementation field name (cache) Returns ------ A one-parameter function ...
[ "def", "_Net_get_id_name", "(", "func", ",", "field", ")", ":", "@", "property", "def", "get_id_name", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "field", ")", ":", "id_to_name", "=", "list", "(", "self", ".", "blobs", ")", "res...
https://github.com/liulei01/DRBox/blob/b5c76e033c555c9009590ab384e1f7bd3c66c237/python/caffe/pycaffe.py#L295-L319
peterljq/OpenMMD
795d4dd660cf7e537ceb599fdb038c5388b33390
3D Pose Baseline to VMD/src/data_utils.py
python
create_2d_data
( actions, data_dir, rcams )
return train_set, test_set, data_mean, data_std, dim_to_ignore, dim_to_use
Creates 2d poses by projecting 3d poses with the corresponding camera parameters. Also normalizes the 2d poses Args actions: list of strings. Actions to load data_dir: string. Directory where the data can be loaded from rcams: dictionary with camera parameters Returns train_set: dictionary with p...
Creates 2d poses by projecting 3d poses with the corresponding camera parameters. Also normalizes the 2d poses
[ "Creates", "2d", "poses", "by", "projecting", "3d", "poses", "with", "the", "corresponding", "camera", "parameters", ".", "Also", "normalizes", "the", "2d", "poses" ]
def create_2d_data( actions, data_dir, rcams ): """ Creates 2d poses by projecting 3d poses with the corresponding camera parameters. Also normalizes the 2d poses Args actions: list of strings. Actions to load data_dir: string. Directory where the data can be loaded from rcams: dictionary with came...
[ "def", "create_2d_data", "(", "actions", ",", "data_dir", ",", "rcams", ")", ":", "# Load 3d data", "train_set", "=", "load_data", "(", "data_dir", ",", "TRAIN_SUBJECTS", ",", "actions", ",", "dim", "=", "3", ")", "test_set", "=", "load_data", "(", "data_dir...
https://github.com/peterljq/OpenMMD/blob/795d4dd660cf7e537ceb599fdb038c5388b33390/3D Pose Baseline to VMD/src/data_utils.py#L393-L426
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Menu.type
(self, index)
return self.tk.call(self._w, 'type', index)
Return the type of the menu item at INDEX.
Return the type of the menu item at INDEX.
[ "Return", "the", "type", "of", "the", "menu", "item", "at", "INDEX", "." ]
def type(self, index): """Return the type of the menu item at INDEX.""" return self.tk.call(self._w, 'type', index)
[ "def", "type", "(", "self", ",", "index", ")", ":", "return", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'type'", ",", "index", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2743-L2745
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/psutil/psutil/__init__.py
python
Process.get_memory_maps
(self, grouped=True)
Return process's mapped memory regions as a list of nameduples whose fields are variable depending on the platform. If 'grouped' is True the mapped regions with the same 'path' are grouped together and the different memory fields are summed. If 'grouped' is False every mapped region is...
Return process's mapped memory regions as a list of nameduples whose fields are variable depending on the platform.
[ "Return", "process", "s", "mapped", "memory", "regions", "as", "a", "list", "of", "nameduples", "whose", "fields", "are", "variable", "depending", "on", "the", "platform", "." ]
def get_memory_maps(self, grouped=True): """Return process's mapped memory regions as a list of nameduples whose fields are variable depending on the platform. If 'grouped' is True the mapped regions with the same 'path' are grouped together and the different memory fields are summed. ...
[ "def", "get_memory_maps", "(", "self", ",", "grouped", "=", "True", ")", ":", "it", "=", "self", ".", "_platform_impl", ".", "get_memory_maps", "(", ")", "if", "grouped", ":", "d", "=", "{", "}", "for", "tupl", "in", "it", ":", "path", "=", "tupl", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/psutil/psutil/__init__.py#L659-L684