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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/imports.py | python | MempadHandler.get_cherrytree_xml | (self, file_descriptor) | return self.dom.toxml() | Returns a CherryTree string Containing the Mempad Nodes | Returns a CherryTree string Containing the Mempad Nodes | [
"Returns",
"a",
"CherryTree",
"string",
"Containing",
"the",
"Mempad",
"Nodes"
] | def get_cherrytree_xml(self, file_descriptor):
"""Returns a CherryTree string Containing the Mempad Nodes"""
self.dom = xml.dom.minidom.Document()
self.nodes_list = [self.dom.createElement(cons.APP_NAME)]
self.dom.appendChild(self.nodes_list[0])
self.parse_binary_bytes(file_descr... | [
"def",
"get_cherrytree_xml",
"(",
"self",
",",
"file_descriptor",
")",
":",
"self",
".",
"dom",
"=",
"xml",
".",
"dom",
".",
"minidom",
".",
"Document",
"(",
")",
"self",
".",
"nodes_list",
"=",
"[",
"self",
".",
"dom",
".",
"createElement",
"(",
"cons... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/imports.py#L2257-L2263 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/utils/pyparsing.py | python | downcaseTokens | (s, l, t) | return [str(tt).lower() for tt in t] | Helper parse action to convert tokens to lower case. | Helper parse action to convert tokens to lower case. | [
"Helper",
"parse",
"action",
"to",
"convert",
"tokens",
"to",
"lower",
"case",
"."
] | def downcaseTokens(s, l, t):
"""Helper parse action to convert tokens to lower case."""
return [str(tt).lower() for tt in t] | [
"def",
"downcaseTokens",
"(",
"s",
",",
"l",
",",
"t",
")",
":",
"return",
"[",
"str",
"(",
"tt",
")",
".",
"lower",
"(",
")",
"for",
"tt",
"in",
"t",
"]"
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/utils/pyparsing.py#L3128-L3130 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/clang/tools/scan-build-py/libscanbuild/report.py | python | comment | (name, opts=dict()) | return '<!-- {0}{1} -->{2}'.format(name, attributes, os.linesep) | Utility function to format meta information as comment. | Utility function to format meta information as comment. | [
"Utility",
"function",
"to",
"format",
"meta",
"information",
"as",
"comment",
"."
] | def comment(name, opts=dict()):
""" Utility function to format meta information as comment. """
attributes = ''
for key, value in opts.items():
attributes += ' {0}="{1}"'.format(key, value)
return '<!-- {0}{1} -->{2}'.format(name, attributes, os.linesep) | [
"def",
"comment",
"(",
"name",
",",
"opts",
"=",
"dict",
"(",
")",
")",
":",
"attributes",
"=",
"''",
"for",
"key",
",",
"value",
"in",
"opts",
".",
"items",
"(",
")",
":",
"attributes",
"+=",
"' {0}=\"{1}\"'",
".",
"format",
"(",
"key",
",",
"valu... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/tools/scan-build-py/libscanbuild/report.py#L504-L511 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | TextAttrDimension.SetValueMM | (*args, **kwargs) | return _richtext.TextAttrDimension_SetValueMM(*args, **kwargs) | SetValueMM(self, float value) | SetValueMM(self, float value) | [
"SetValueMM",
"(",
"self",
"float",
"value",
")"
] | def SetValueMM(*args, **kwargs):
"""SetValueMM(self, float value)"""
return _richtext.TextAttrDimension_SetValueMM(*args, **kwargs) | [
"def",
"SetValueMM",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"TextAttrDimension_SetValueMM",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L156-L158 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/BaseHTTPServer.py | python | BaseHTTPRequestHandler.send_header | (self, keyword, value) | Send a MIME header. | Send a MIME header. | [
"Send",
"a",
"MIME",
"header",
"."
] | def send_header(self, keyword, value):
"""Send a MIME header."""
if self.request_version != 'HTTP/0.9':
self.wfile.write("%s: %s\r\n" % (keyword, value))
if keyword.lower() == 'connection':
if value.lower() == 'close':
self.close_connection = 1
... | [
"def",
"send_header",
"(",
"self",
",",
"keyword",
",",
"value",
")",
":",
"if",
"self",
".",
"request_version",
"!=",
"'HTTP/0.9'",
":",
"self",
".",
"wfile",
".",
"write",
"(",
"\"%s: %s\\r\\n\"",
"%",
"(",
"keyword",
",",
"value",
")",
")",
"if",
"k... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/BaseHTTPServer.py#L398-L407 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Grid.grid_forget | (self) | Unmap this widget. | Unmap this widget. | [
"Unmap",
"this",
"widget",
"."
] | def grid_forget(self):
"""Unmap this widget."""
self.tk.call('grid', 'forget', self._w) | [
"def",
"grid_forget",
"(",
"self",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"'grid'",
",",
"'forget'",
",",
"self",
".",
"_w",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L2230-L2232 | ||
acado/acado | b4e28f3131f79cadfd1a001e9fff061f361d3a0f | misc/cpplint.py | python | CheckForBadCharacters | (filename, lines, error) | Logs an error for each line containing bad characters.
Two kinds of bad characters:
1. Unicode replacement characters: These indicate that either the file
contained invalid UTF-8 (likely) or Unicode replacement characters (which
it shouldn't). Note that it's possible for this to throw off line
numbering if... | Logs an error for each line containing bad characters. | [
"Logs",
"an",
"error",
"for",
"each",
"line",
"containing",
"bad",
"characters",
"."
] | def CheckForBadCharacters(filename, lines, error):
"""Logs an error for each line containing bad characters.
Two kinds of bad characters:
1. Unicode replacement characters: These indicate that either the file
contained invalid UTF-8 (likely) or Unicode replacement characters (which
it shouldn't). Note that... | [
"def",
"CheckForBadCharacters",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"for",
"linenum",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
"if",
"u'\\ufffd'",
"in",
"line",
":",
"error",
"(",
"filename",
",",
"linenum",
",",
"'reada... | https://github.com/acado/acado/blob/b4e28f3131f79cadfd1a001e9fff061f361d3a0f/misc/cpplint.py#L1476-L1498 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge2.py | python | ExodusModel.rotate_element_blocks | (self,
element_block_ids,
axis,
angle_in_degrees,
check_for_merged_nodes=True,
adjust_displacement_field='auto') | Rotate all nodes in the given element blocks by the given amount.
By default, if a displacement field exists, this will also rotate the
displacement field.
The rotation axis includes the origin and points in the direction of
the 'axis' parameter.
Example:
>>> model.rot... | Rotate all nodes in the given element blocks by the given amount. | [
"Rotate",
"all",
"nodes",
"in",
"the",
"given",
"element",
"blocks",
"by",
"the",
"given",
"amount",
"."
] | def rotate_element_blocks(self,
element_block_ids,
axis,
angle_in_degrees,
check_for_merged_nodes=True,
adjust_displacement_field='auto'):
"""
Rotate all ... | [
"def",
"rotate_element_blocks",
"(",
"self",
",",
"element_block_ids",
",",
"axis",
",",
"angle_in_degrees",
",",
"check_for_merged_nodes",
"=",
"True",
",",
"adjust_displacement_field",
"=",
"'auto'",
")",
":",
"element_block_ids",
"=",
"self",
".",
"_format_element_... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L3786-L3815 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/pimp.py | python | PimpPackage.filterExpectedSkips | (self, names) | return newnames | Return a list that contains only unpexpected skips | Return a list that contains only unpexpected skips | [
"Return",
"a",
"list",
"that",
"contains",
"only",
"unpexpected",
"skips"
] | def filterExpectedSkips(self, names):
"""Return a list that contains only unpexpected skips"""
if not self._db.preferences.isUserInstall():
return names
expected_skips = self._dict.get('User-install-skips')
if not expected_skips:
return names
newnames = []... | [
"def",
"filterExpectedSkips",
"(",
"self",
",",
"names",
")",
":",
"if",
"not",
"self",
".",
"_db",
".",
"preferences",
".",
"isUserInstall",
"(",
")",
":",
"return",
"names",
"expected_skips",
"=",
"self",
".",
"_dict",
".",
"get",
"(",
"'User-install-ski... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/pimp.py#L775-L789 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py | python | ConvertToMSBuildSettings | (msvs_settings, stderr=sys.stderr) | return msbuild_settings | Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+).
Args:
msvs_settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages.
Returns:
A dictionary of MSBui... | Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+). | [
"Converts",
"MSVS",
"settings",
"(",
"VS2008",
"and",
"earlier",
")",
"to",
"MSBuild",
"settings",
"(",
"VS2010",
"+",
")",
"."
] | def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
"""Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+).
Args:
msvs_settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream ... | [
"def",
"ConvertToMSBuildSettings",
"(",
"msvs_settings",
",",
"stderr",
"=",
"sys",
".",
"stderr",
")",
":",
"msbuild_settings",
"=",
"{",
"}",
"for",
"msvs_tool_name",
",",
"msvs_tool_settings",
"in",
"msvs_settings",
".",
"iteritems",
"(",
")",
":",
"if",
"m... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py#L442-L477 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | AboutDialogInfo.SetLicense | (*args, **kwargs) | return _misc_.AboutDialogInfo_SetLicense(*args, **kwargs) | SetLicense(self, String licence)
This is the same as `SetLicence`. | SetLicense(self, String licence) | [
"SetLicense",
"(",
"self",
"String",
"licence",
")"
] | def SetLicense(*args, **kwargs):
"""
SetLicense(self, String licence)
This is the same as `SetLicence`.
"""
return _misc_.AboutDialogInfo_SetLicense(*args, **kwargs) | [
"def",
"SetLicense",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"AboutDialogInfo_SetLicense",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L6708-L6714 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/core/fromnumeric.py | python | argmin | (a, axis=None, out=None) | return _wrapfunc(a, 'argmin', axis=axis, out=out) | Returns the indices of the minimum values along an axis.
Parameters
----------
a : array_like
Input array.
axis : int, optional
By default, the index is into the flattened array, otherwise
along the specified axis.
out : array, optional
If provided, the result will b... | Returns the indices of the minimum values along an axis. | [
"Returns",
"the",
"indices",
"of",
"the",
"minimum",
"values",
"along",
"an",
"axis",
"."
] | def argmin(a, axis=None, out=None):
"""
Returns the indices of the minimum values along an axis.
Parameters
----------
a : array_like
Input array.
axis : int, optional
By default, the index is into the flattened array, otherwise
along the specified axis.
out : array,... | [
"def",
"argmin",
"(",
"a",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
")",
":",
"return",
"_wrapfunc",
"(",
"a",
",",
"'argmin'",
",",
"axis",
"=",
"axis",
",",
"out",
"=",
"out",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/fromnumeric.py#L1111-L1172 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/nntplib.py | python | _NNTPBase.article | (self, message_spec=None, *, file=None) | return self._artcmd(cmd, file) | Process an ARTICLE command. Argument:
- message_spec: article number or message id
- file: filename string or file object to store the article in
Returns:
- resp: server response if successful
- ArticleInfo: (article number, message id, list of article lines) | Process an ARTICLE command. Argument:
- message_spec: article number or message id
- file: filename string or file object to store the article in
Returns:
- resp: server response if successful
- ArticleInfo: (article number, message id, list of article lines) | [
"Process",
"an",
"ARTICLE",
"command",
".",
"Argument",
":",
"-",
"message_spec",
":",
"article",
"number",
"or",
"message",
"id",
"-",
"file",
":",
"filename",
"string",
"or",
"file",
"object",
"to",
"store",
"the",
"article",
"in",
"Returns",
":",
"-",
... | def article(self, message_spec=None, *, file=None):
"""Process an ARTICLE command. Argument:
- message_spec: article number or message id
- file: filename string or file object to store the article in
Returns:
- resp: server response if successful
- ArticleInfo: (article... | [
"def",
"article",
"(",
"self",
",",
"message_spec",
"=",
"None",
",",
"*",
",",
"file",
"=",
"None",
")",
":",
"if",
"message_spec",
"is",
"not",
"None",
":",
"cmd",
"=",
"'ARTICLE {0}'",
".",
"format",
"(",
"message_spec",
")",
"else",
":",
"cmd",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/nntplib.py#L758-L770 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/interactiveshell.py | python | InteractiveShell.enable_pylab | (self, gui=None, import_all=True, welcome_message=False) | return gui, backend, clobbered | Activate pylab support at runtime.
This turns on support for matplotlib, preloads into the interactive
namespace all of numpy and pylab, and configures IPython to correctly
interact with the GUI event loop. The GUI backend to be used can be
optionally selected with the optional ``gui``... | Activate pylab support at runtime. | [
"Activate",
"pylab",
"support",
"at",
"runtime",
"."
] | def enable_pylab(self, gui=None, import_all=True, welcome_message=False):
"""Activate pylab support at runtime.
This turns on support for matplotlib, preloads into the interactive
namespace all of numpy and pylab, and configures IPython to correctly
interact with the GUI event loop. Th... | [
"def",
"enable_pylab",
"(",
"self",
",",
"gui",
"=",
"None",
",",
"import_all",
"=",
"True",
",",
"welcome_message",
"=",
"False",
")",
":",
"from",
"IPython",
".",
"core",
".",
"pylabtools",
"import",
"import_pylab",
"gui",
",",
"backend",
"=",
"self",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/interactiveshell.py#L2977-L3019 | |
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/xcode_emulation.py | python | GetMacBundleResources | (product_dir, xcode_settings, resources) | Yields (output, resource) pairs for every resource in |resources|.
Only call this for mac bundle targets.
Args:
product_dir: Path to the directory containing the output bundle,
relative to the build directory.
xcode_settings: The XcodeSettings of the current target.
resources: A list of... | Yields (output, resource) pairs for every resource in |resources|.
Only call this for mac bundle targets. | [
"Yields",
"(",
"output",
"resource",
")",
"pairs",
"for",
"every",
"resource",
"in",
"|resources|",
".",
"Only",
"call",
"this",
"for",
"mac",
"bundle",
"targets",
"."
] | def GetMacBundleResources(product_dir, xcode_settings, resources):
"""Yields (output, resource) pairs for every resource in |resources|.
Only call this for mac bundle targets.
Args:
product_dir: Path to the directory containing the output bundle,
relative to the build directory.
xcode_setti... | [
"def",
"GetMacBundleResources",
"(",
"product_dir",
",",
"xcode_settings",
",",
"resources",
")",
":",
"dest",
"=",
"os",
".",
"path",
".",
"join",
"(",
"product_dir",
",",
"xcode_settings",
".",
"GetBundleResourceFolder",
"(",
")",
")",
"for",
"res",
"in",
... | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/xcode_emulation.py#L808-L842 | ||
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/environment.py | python | get_spontaneous_environment | (*args) | return env | Return a new spontaneous environment. A spontaneous environment is an
unnamed and unaccessible (in theory) environment that is used for
templates generated from a string and not from the file system. | Return a new spontaneous environment. A spontaneous environment is an
unnamed and unaccessible (in theory) environment that is used for
templates generated from a string and not from the file system. | [
"Return",
"a",
"new",
"spontaneous",
"environment",
".",
"A",
"spontaneous",
"environment",
"is",
"an",
"unnamed",
"and",
"unaccessible",
"(",
"in",
"theory",
")",
"environment",
"that",
"is",
"used",
"for",
"templates",
"generated",
"from",
"a",
"string",
"an... | def get_spontaneous_environment(*args):
"""Return a new spontaneous environment. A spontaneous environment is an
unnamed and unaccessible (in theory) environment that is used for
templates generated from a string and not from the file system.
"""
try:
env = _spontaneous_environments.get(arg... | [
"def",
"get_spontaneous_environment",
"(",
"*",
"args",
")",
":",
"try",
":",
"env",
"=",
"_spontaneous_environments",
".",
"get",
"(",
"args",
")",
"except",
"TypeError",
":",
"return",
"Environment",
"(",
"*",
"args",
")",
"if",
"env",
"is",
"not",
"None... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/environment.py#L44-L57 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/array_ops.py | python | size | (input, name=None) | Returns the size of a tensor.
This operation returns an integer representing the number of elements in
`input`.
For example:
```python
# 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]]
size(t) ==> 12
```
Args:
input: A `Tensor` or `SparseTensor`.
name: A name for the operation (opti... | Returns the size of a tensor. | [
"Returns",
"the",
"size",
"of",
"a",
"tensor",
"."
] | def size(input, name=None):
"""Returns the size of a tensor.
This operation returns an integer representing the number of elements in
`input`.
For example:
```python
# 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]]
size(t) ==> 12
```
Args:
input: A `Tensor` or `SparseTensor`.
nam... | [
"def",
"size",
"(",
"input",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"input",
"]",
",",
"name",
",",
"\"Size\"",
")",
"as",
"name",
":",
"if",
"isinstance",
"(",
"input",
",",
"ops",
".",
"SparseTensor",
")",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/array_ops.py#L134-L159 | ||
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | lib/datasets/ds_utils.py | python | unique_boxes | (boxes, scale=1.0) | return np.sort(index) | Return indices of unique boxes. | Return indices of unique boxes. | [
"Return",
"indices",
"of",
"unique",
"boxes",
"."
] | def unique_boxes(boxes, scale=1.0):
"""Return indices of unique boxes."""
v = np.array([1, 1e3, 1e6, 1e9])
hashes = np.round(boxes * scale).dot(v)
_, index = np.unique(hashes, return_index=True)
return np.sort(index) | [
"def",
"unique_boxes",
"(",
"boxes",
",",
"scale",
"=",
"1.0",
")",
":",
"v",
"=",
"np",
".",
"array",
"(",
"[",
"1",
",",
"1e3",
",",
"1e6",
",",
"1e9",
"]",
")",
"hashes",
"=",
"np",
".",
"round",
"(",
"boxes",
"*",
"scale",
")",
".",
"dot"... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/datasets/ds_utils.py#L9-L14 | |
scribusproject/scribus | 41ec7c775a060912cf251682a8b1437f753f80f4 | doc/scridoc.py | python | order | () | return ' order by 1' | dummy sql clausule | dummy sql clausule | [
"dummy",
"sql",
"clausule"
] | def order():
""" dummy sql clausule """
return ' order by 1' | [
"def",
"order",
"(",
")",
":",
"return",
"' order by 1'"
] | https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/doc/scridoc.py#L149-L151 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/feature_column/feature_column.py | python | categorical_column_with_vocabulary_list | (
key, vocabulary_list, dtype=None, default_value=-1, num_oov_buckets=0) | return _VocabularyListCategoricalColumn(
key=key, vocabulary_list=tuple(vocabulary_list), dtype=dtype,
default_value=default_value, num_oov_buckets=num_oov_buckets) | A `_CategoricalColumn` with in-memory vocabulary.
Use this when your inputs are in string or integer format, and you have an
in-memory vocabulary mapping each value to an integer ID. By default,
out-of-vocabulary values are ignored. Use either (but not both) of
`num_oov_buckets` and `default_value` to specify ... | A `_CategoricalColumn` with in-memory vocabulary. | [
"A",
"_CategoricalColumn",
"with",
"in",
"-",
"memory",
"vocabulary",
"."
] | def categorical_column_with_vocabulary_list(
key, vocabulary_list, dtype=None, default_value=-1, num_oov_buckets=0):
"""A `_CategoricalColumn` with in-memory vocabulary.
Use this when your inputs are in string or integer format, and you have an
in-memory vocabulary mapping each value to an integer ID. By def... | [
"def",
"categorical_column_with_vocabulary_list",
"(",
"key",
",",
"vocabulary_list",
",",
"dtype",
"=",
"None",
",",
"default_value",
"=",
"-",
"1",
",",
"num_oov_buckets",
"=",
"0",
")",
":",
"if",
"(",
"vocabulary_list",
"is",
"None",
")",
"or",
"(",
"len... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/feature_column/feature_column.py#L884-L991 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | bindings/pyroot/pythonizations/python/ROOT/_pythonization/__init__.py | python | _get_class_name | (fqn) | Parses and returns the class name in `fqn`.
Example: if `fqn` is "NS1::NS2::C", "C" is returned.
Args:
fqn (string): fully-qualified class name.
Returns:
string: class name in `fqn`. | Parses and returns the class name in `fqn`.
Example: if `fqn` is "NS1::NS2::C", "C" is returned. | [
"Parses",
"and",
"returns",
"the",
"class",
"name",
"in",
"fqn",
".",
"Example",
":",
"if",
"fqn",
"is",
"NS1",
"::",
"NS2",
"::",
"C",
"C",
"is",
"returned",
"."
] | def _get_class_name(fqn):
'''
Parses and returns the class name in `fqn`.
Example: if `fqn` is "NS1::NS2::C", "C" is returned.
Args:
fqn (string): fully-qualified class name.
Returns:
string: class name in `fqn`.
'''
pos = _find_namespace_end(fqn)
if pos < 0: # no name... | [
"def",
"_get_class_name",
"(",
"fqn",
")",
":",
"pos",
"=",
"_find_namespace_end",
"(",
"fqn",
")",
"if",
"pos",
"<",
"0",
":",
"# no namespace found",
"return",
"fqn",
"else",
":",
"return",
"fqn",
"[",
"pos",
"+",
"2",
":",
"]"
] | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/pyroot/pythonizations/python/ROOT/_pythonization/__init__.py#L298-L314 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/rnn.py | python | bidirectional_dynamic_rnn | (cell_fw, cell_bw, inputs, sequence_length=None,
initial_state_fw=None, initial_state_bw=None,
dtype=None, parallel_iterations=None,
swap_memory=False, time_major=False, scope=None) | return (outputs, output_states) | Creates a dynamic version of bidirectional recurrent neural network.
Takes input and builds independent forward and backward RNNs. The input_size
of forward and backward cell must match. The initial state for both directions
is zero by default (but can be set optionally) and no intermediate states are
ever ret... | Creates a dynamic version of bidirectional recurrent neural network. | [
"Creates",
"a",
"dynamic",
"version",
"of",
"bidirectional",
"recurrent",
"neural",
"network",
"."
] | def bidirectional_dynamic_rnn(cell_fw, cell_bw, inputs, sequence_length=None,
initial_state_fw=None, initial_state_bw=None,
dtype=None, parallel_iterations=None,
swap_memory=False, time_major=False, scope=None):
"""Creates a dyn... | [
"def",
"bidirectional_dynamic_rnn",
"(",
"cell_fw",
",",
"cell_bw",
",",
"inputs",
",",
"sequence_length",
"=",
"None",
",",
"initial_state_fw",
"=",
"None",
",",
"initial_state_bw",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"parallel_iterations",
"=",
"None"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/rnn.py#L311-L437 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Web/Python/paraview/web/helper.py | python | Pipeline.removeNode | (self, id) | Remove a node from the pipeline tree. | Remove a node from the pipeline tree. | [
"Remove",
"a",
"node",
"from",
"the",
"pipeline",
"tree",
"."
] | def removeNode(self, id):
"""
Remove a node from the pipeline tree.
"""
nid = str(id)
pid = self.parent_ids[nid]
if pid:
del self.parent_ids[nid]
self.children_ids[pid].remove(nid) | [
"def",
"removeNode",
"(",
"self",
",",
"id",
")",
":",
"nid",
"=",
"str",
"(",
"id",
")",
"pid",
"=",
"self",
".",
"parent_ids",
"[",
"nid",
"]",
"if",
"pid",
":",
"del",
"self",
".",
"parent_ids",
"[",
"nid",
"]",
"self",
".",
"children_ids",
"[... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Web/Python/paraview/web/helper.py#L64-L72 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/cubecolourdialog.py | python | CubeColourDialog.OnOk | (self, event) | Handles the Ok ``wx.EVT_BUTTON`` event for :class:`CubeColourDialog`.
:param `event`: a :class:`CommandEvent` event to be processed. | Handles the Ok ``wx.EVT_BUTTON`` event for :class:`CubeColourDialog`. | [
"Handles",
"the",
"Ok",
"wx",
".",
"EVT_BUTTON",
"event",
"for",
":",
"class",
":",
"CubeColourDialog",
"."
] | def OnOk(self, event):
"""
Handles the Ok ``wx.EVT_BUTTON`` event for :class:`CubeColourDialog`.
:param `event`: a :class:`CommandEvent` event to be processed.
"""
self.EndModal(wx.ID_OK) | [
"def",
"OnOk",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"EndModal",
"(",
"wx",
".",
"ID_OK",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/cubecolourdialog.py#L3341-L3348 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/shell.py | python | files | (base, wildcard='[!.]*', recursive=1, prune=('.git', '.svn', 'CVS')) | Determine a filelist | Determine a filelist | [
"Determine",
"a",
"filelist"
] | def files(base, wildcard='[!.]*', recursive=1, prune=('.git', '.svn', 'CVS')):
""" Determine a filelist """
for dirpath, dirnames, filenames in walk(native(base)):
for item in prune:
if item in dirnames:
dirnames.remove(item)
filenames.sort()
for name in _fnm... | [
"def",
"files",
"(",
"base",
",",
"wildcard",
"=",
"'[!.]*'",
",",
"recursive",
"=",
"1",
",",
"prune",
"=",
"(",
"'.git'",
",",
"'.svn'",
",",
"'CVS'",
")",
")",
":",
"for",
"dirpath",
",",
"dirnames",
",",
"filenames",
"in",
"walk",
"(",
"native",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/shell.py#L275-L298 | ||
yun-liu/RCF | 91bfb054ad04187dbbe21e539e165ad9bd3ff00b | python/caffe/draw.py | python | get_pydot_graph | (caffe_net, rankdir, label_edges=True, phase=None) | return pydot_graph | Create a data structure which represents the `caffe_net`.
Parameters
----------
caffe_net : object
rankdir : {'LR', 'TB', 'BT'}
Direction of graph layout.
label_edges : boolean, optional
Label the edges (default is True).
phase : {caffe_pb2.Phase.TRAIN, caffe_pb2.Phase.TEST, Non... | Create a data structure which represents the `caffe_net`. | [
"Create",
"a",
"data",
"structure",
"which",
"represents",
"the",
"caffe_net",
"."
] | def get_pydot_graph(caffe_net, rankdir, label_edges=True, phase=None):
"""Create a data structure which represents the `caffe_net`.
Parameters
----------
caffe_net : object
rankdir : {'LR', 'TB', 'BT'}
Direction of graph layout.
label_edges : boolean, optional
Label the edges (d... | [
"def",
"get_pydot_graph",
"(",
"caffe_net",
",",
"rankdir",
",",
"label_edges",
"=",
"True",
",",
"phase",
"=",
"None",
")",
":",
"pydot_graph",
"=",
"pydot",
".",
"Dot",
"(",
"caffe_net",
".",
"name",
"if",
"caffe_net",
".",
"name",
"else",
"'Net'",
","... | https://github.com/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/python/caffe/draw.py#L130-L202 | |
sailing-pmls/bosen | 06cb58902d011fbea5f9428f10ce30e621492204 | style_script/cpplint.py | python | IsErrorSuppressedByNolint | (category, linenum) | return (linenum in _error_suppressions.get(category, set()) or
linenum in _error_suppressions.get(None, set())) | Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the current line number.
Returns:
bool, True iff the error... | Returns true if the specified error category is suppressed on this line. | [
"Returns",
"true",
"if",
"the",
"specified",
"error",
"category",
"is",
"suppressed",
"on",
"this",
"line",
"."
] | def IsErrorSuppressedByNolint(category, linenum):
"""Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the curre... | [
"def",
"IsErrorSuppressedByNolint",
"(",
"category",
",",
"linenum",
")",
":",
"return",
"(",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"category",
",",
"set",
"(",
")",
")",
"or",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"None... | https://github.com/sailing-pmls/bosen/blob/06cb58902d011fbea5f9428f10ce30e621492204/style_script/cpplint.py#L541-L554 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/CallTips.py | python | CallTips.get_entity | (self, expression) | Return the object corresponding to expression evaluated
in a namespace spanning sys.modules and __main.dict__. | Return the object corresponding to expression evaluated
in a namespace spanning sys.modules and __main.dict__. | [
"Return",
"the",
"object",
"corresponding",
"to",
"expression",
"evaluated",
"in",
"a",
"namespace",
"spanning",
"sys",
".",
"modules",
"and",
"__main",
".",
"dict__",
"."
] | def get_entity(self, expression):
"""Return the object corresponding to expression evaluated
in a namespace spanning sys.modules and __main.dict__.
"""
if expression:
namespace = sys.modules.copy()
namespace.update(__main__.__dict__)
try:
... | [
"def",
"get_entity",
"(",
"self",
",",
"expression",
")",
":",
"if",
"expression",
":",
"namespace",
"=",
"sys",
".",
"modules",
".",
"copy",
"(",
")",
"namespace",
".",
"update",
"(",
"__main__",
".",
"__dict__",
")",
"try",
":",
"return",
"eval",
"("... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/CallTips.py#L108-L120 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/screen.py | python | screen.scroll_screen_rows | (self, rs, re) | Enable scrolling from row {start} to row {end}. | Enable scrolling from row {start} to row {end}. | [
"Enable",
"scrolling",
"from",
"row",
"{",
"start",
"}",
"to",
"row",
"{",
"end",
"}",
"."
] | def scroll_screen_rows(self, rs, re): # <ESC>[{start};{end}r
"""Enable scrolling from row {start} to row {end}."""
self.scroll_row_start = rs
self.scroll_row_end = re
self.scroll_constrain() | [
"def",
"scroll_screen_rows",
"(",
"self",
",",
"rs",
",",
"re",
")",
":",
"# <ESC>[{start};{end}r",
"self",
".",
"scroll_row_start",
"=",
"rs",
"self",
".",
"scroll_row_end",
"=",
"re",
"self",
".",
"scroll_constrain",
"(",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/screen.py#L272-L277 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HtmlHelpController.AddBook | (*args, **kwargs) | return _html.HtmlHelpController_AddBook(*args, **kwargs) | AddBook(self, String book, int show_wait_msg=False) -> bool | AddBook(self, String book, int show_wait_msg=False) -> bool | [
"AddBook",
"(",
"self",
"String",
"book",
"int",
"show_wait_msg",
"=",
"False",
")",
"-",
">",
"bool"
] | def AddBook(*args, **kwargs):
"""AddBook(self, String book, int show_wait_msg=False) -> bool"""
return _html.HtmlHelpController_AddBook(*args, **kwargs) | [
"def",
"AddBook",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlHelpController_AddBook",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L1966-L1968 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PyArrayStringProperty._SetSelf | (*args, **kwargs) | return _propgrid.PyArrayStringProperty__SetSelf(*args, **kwargs) | _SetSelf(self, PyObject self) | _SetSelf(self, PyObject self) | [
"_SetSelf",
"(",
"self",
"PyObject",
"self",
")"
] | def _SetSelf(*args, **kwargs):
"""_SetSelf(self, PyObject self)"""
return _propgrid.PyArrayStringProperty__SetSelf(*args, **kwargs) | [
"def",
"_SetSelf",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PyArrayStringProperty__SetSelf",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L3942-L3944 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | MDArray.GetCoordinateVariables | (self, *args) | return _gdal.MDArray_GetCoordinateVariables(self, *args) | r"""GetCoordinateVariables(MDArray self) | r"""GetCoordinateVariables(MDArray self) | [
"r",
"GetCoordinateVariables",
"(",
"MDArray",
"self",
")"
] | def GetCoordinateVariables(self, *args):
r"""GetCoordinateVariables(MDArray self)"""
return _gdal.MDArray_GetCoordinateVariables(self, *args) | [
"def",
"GetCoordinateVariables",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_gdal",
".",
"MDArray_GetCoordinateVariables",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L2711-L2713 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/keras/_impl/keras/backend.py | python | equal | (x, y) | return math_ops.equal(x, y) | Element-wise equality between two tensors.
Arguments:
x: Tensor or variable.
y: Tensor or variable.
Returns:
A bool tensor. | Element-wise equality between two tensors. | [
"Element",
"-",
"wise",
"equality",
"between",
"two",
"tensors",
"."
] | def equal(x, y):
"""Element-wise equality between two tensors.
Arguments:
x: Tensor or variable.
y: Tensor or variable.
Returns:
A bool tensor.
"""
return math_ops.equal(x, y) | [
"def",
"equal",
"(",
"x",
",",
"y",
")",
":",
"return",
"math_ops",
".",
"equal",
"(",
"x",
",",
"y",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/backend.py#L1708-L1718 | |
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | bert/run_classifier.py | python | ColaProcessor.get_test_examples | (self, data_dir) | return self._create_examples(
self._read_tsv(os.path.join(data_dir, "test.tsv")), "test") | See base class. | See base class. | [
"See",
"base",
"class",
"."
] | def get_test_examples(self, data_dir):
"""See base class."""
return self._create_examples(
self._read_tsv(os.path.join(data_dir, "test.tsv")), "test") | [
"def",
"get_test_examples",
"(",
"self",
",",
"data_dir",
")",
":",
"return",
"self",
".",
"_create_examples",
"(",
"self",
".",
"_read_tsv",
"(",
"os",
".",
"path",
".",
"join",
"(",
"data_dir",
",",
"\"test.tsv\"",
")",
")",
",",
"\"test\"",
")"
] | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert/run_classifier.py#L349-L352 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM2B_SENSITIVE_CREATE.fromTpm | (buf) | return buf.createObj(TPM2B_SENSITIVE_CREATE) | Returns new TPM2B_SENSITIVE_CREATE object constructed from its
marshaled representation in the given TpmBuffer buffer | Returns new TPM2B_SENSITIVE_CREATE object constructed from its
marshaled representation in the given TpmBuffer buffer | [
"Returns",
"new",
"TPM2B_SENSITIVE_CREATE",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"TpmBuffer",
"buffer"
] | def fromTpm(buf):
""" Returns new TPM2B_SENSITIVE_CREATE object constructed from its
marshaled representation in the given TpmBuffer buffer
"""
return buf.createObj(TPM2B_SENSITIVE_CREATE) | [
"def",
"fromTpm",
"(",
"buf",
")",
":",
"return",
"buf",
".",
"createObj",
"(",
"TPM2B_SENSITIVE_CREATE",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L6170-L6174 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | PhysicsTools/PythonAnalysis/python/readProv.py | python | filereader.startswith | (self,line) | return False | Checks if the first word of the line starts with any of the aList elements | Checks if the first word of the line starts with any of the aList elements | [
"Checks",
"if",
"the",
"first",
"word",
"of",
"the",
"line",
"starts",
"with",
"any",
"of",
"the",
"aList",
"elements"
] | def startswith(self,line):
"Checks if the first word of the line starts with any of the aList elements"
for item in self.aList:
if line.startswith(item):
return True
return False | [
"def",
"startswith",
"(",
"self",
",",
"line",
")",
":",
"for",
"item",
"in",
"self",
".",
"aList",
":",
"if",
"line",
".",
"startswith",
"(",
"item",
")",
":",
"return",
"True",
"return",
"False"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/PythonAnalysis/python/readProv.py#L14-L19 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/sysconfig.py | python | get_python_lib | (plat_specific=0, standard_lib=0, prefix=None) | Return the directory containing the Python library (standard or
site additions).
If 'plat_specific' is true, return the directory containing
platform-specific modules, i.e. any module from a non-pure-Python
module distribution; otherwise, return the platform-shared library
directory. If 'standard_... | Return the directory containing the Python library (standard or
site additions). | [
"Return",
"the",
"directory",
"containing",
"the",
"Python",
"library",
"(",
"standard",
"or",
"site",
"additions",
")",
"."
] | def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
"""Return the directory containing the Python library (standard or
site additions).
If 'plat_specific' is true, return the directory containing
platform-specific modules, i.e. any module from a non-pure-Python
module distribution; ot... | [
"def",
"get_python_lib",
"(",
"plat_specific",
"=",
"0",
",",
"standard_lib",
"=",
"0",
",",
"prefix",
"=",
"None",
")",
":",
"if",
"prefix",
"is",
"None",
":",
"prefix",
"=",
"plat_specific",
"and",
"EXEC_PREFIX",
"or",
"PREFIX",
"if",
"os",
".",
"name"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/sysconfig.py#L106-L149 | ||
physercoe/starquant | c00cad64d1de2da05081b3dc320ef264c6295e08 | source/engine/strategy_engine.py | python | StrategyEngine.get_strategy_parameters | (self, strategy_name) | return strategy.get_parameters() | Get parameters of a strategy. | Get parameters of a strategy. | [
"Get",
"parameters",
"of",
"a",
"strategy",
"."
] | def get_strategy_parameters(self, strategy_name):
"""
Get parameters of a strategy.
"""
strategy = self.strategies[strategy_name]
return strategy.get_parameters() | [
"def",
"get_strategy_parameters",
"(",
"self",
",",
"strategy_name",
")",
":",
"strategy",
"=",
"self",
".",
"strategies",
"[",
"strategy_name",
"]",
"return",
"strategy",
".",
"get_parameters",
"(",
")"
] | https://github.com/physercoe/starquant/blob/c00cad64d1de2da05081b3dc320ef264c6295e08/source/engine/strategy_engine.py#L700-L705 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | external/tools/build/v2/build/property_set.py | python | PropertySet.get_properties | (self, feature) | return result | Returns all contained properties associated with 'feature | Returns all contained properties associated with 'feature | [
"Returns",
"all",
"contained",
"properties",
"associated",
"with",
"feature"
] | def get_properties(self, feature):
"""Returns all contained properties associated with 'feature'"""
if not isinstance(feature, b2.build.feature.Feature):
feature = b2.build.feature.get(feature)
result = []
for p in self.all_:
if p.feature() == feature:
... | [
"def",
"get_properties",
"(",
"self",
",",
"feature",
")",
":",
"if",
"not",
"isinstance",
"(",
"feature",
",",
"b2",
".",
"build",
".",
"feature",
".",
"Feature",
")",
":",
"feature",
"=",
"b2",
".",
"build",
".",
"feature",
".",
"get",
"(",
"featur... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/property_set.py#L435-L445 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/multiprocessing/sharedctypes.py | python | RawValue | (typecode_or_type, *args) | return obj | Returns a ctypes object allocated from shared memory | Returns a ctypes object allocated from shared memory | [
"Returns",
"a",
"ctypes",
"object",
"allocated",
"from",
"shared",
"memory"
] | def RawValue(typecode_or_type, *args):
'''
Returns a ctypes object allocated from shared memory
'''
type_ = typecode_to_type.get(typecode_or_type, typecode_or_type)
obj = _new_value(type_)
ctypes.memset(ctypes.addressof(obj), 0, ctypes.sizeof(obj))
obj.__init__(*args)
return obj | [
"def",
"RawValue",
"(",
"typecode_or_type",
",",
"*",
"args",
")",
":",
"type_",
"=",
"typecode_to_type",
".",
"get",
"(",
"typecode_or_type",
",",
"typecode_or_type",
")",
"obj",
"=",
"_new_value",
"(",
"type_",
")",
"ctypes",
".",
"memset",
"(",
"ctypes",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/multiprocessing/sharedctypes.py#L44-L52 | |
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | src/visualizer/visualizer/ipython_view.py | python | ConsoleView._showReturned | (self, text) | !
Show returned text from last command and print new prompt.
@param text: Text to show.
@return none | !
Show returned text from last command and print new prompt. | [
"!",
"Show",
"returned",
"text",
"from",
"last",
"command",
"and",
"print",
"new",
"prompt",
"."
] | def _showReturned(self, text):
"""!
Show returned text from last command and print new prompt.
@param text: Text to show.
@return none
"""
iter = self.text_buffer.get_iter_at_mark(self.line_start)
iter.forward_to_line_end()
self.text_buffer.apply_tag_by_name(
'notouch',
... | [
"def",
"_showReturned",
"(",
"self",
",",
"text",
")",
":",
"iter",
"=",
"self",
".",
"text_buffer",
".",
"get_iter_at_mark",
"(",
"self",
".",
"line_start",
")",
"iter",
".",
"forward_to_line_end",
"(",
")",
"self",
".",
"text_buffer",
".",
"apply_tag_by_na... | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/src/visualizer/visualizer/ipython_view.py#L490-L512 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/_linprog_util.py | python | _postsolve | (x, c, A_ub=None, b_ub=None, A_eq=None, b_eq=None, bounds=None,
complete=False, undo=[], tol=1e-8) | return x, fun, slack, con, lb, ub | Given solution x to presolved, standard form linear program x, add
fixed variables back into the problem and undo the variable substitutions
to get solution to original linear program. Also, calculate the objective
function value, slack in original upper bound constraints, and residuals
in original equa... | Given solution x to presolved, standard form linear program x, add
fixed variables back into the problem and undo the variable substitutions
to get solution to original linear program. Also, calculate the objective
function value, slack in original upper bound constraints, and residuals
in original equa... | [
"Given",
"solution",
"x",
"to",
"presolved",
"standard",
"form",
"linear",
"program",
"x",
"add",
"fixed",
"variables",
"back",
"into",
"the",
"problem",
"and",
"undo",
"the",
"variable",
"substitutions",
"to",
"get",
"solution",
"to",
"original",
"linear",
"p... | def _postsolve(x, c, A_ub=None, b_ub=None, A_eq=None, b_eq=None, bounds=None,
complete=False, undo=[], tol=1e-8):
"""
Given solution x to presolved, standard form linear program x, add
fixed variables back into the problem and undo the variable substitutions
to get solution to original li... | [
"def",
"_postsolve",
"(",
"x",
",",
"c",
",",
"A_ub",
"=",
"None",
",",
"b_ub",
"=",
"None",
",",
"A_eq",
"=",
"None",
",",
"b_eq",
"=",
"None",
",",
"bounds",
"=",
"None",
",",
"complete",
"=",
"False",
",",
"undo",
"=",
"[",
"]",
",",
"tol",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/_linprog_util.py#L1031-L1139 | |
ElvishArtisan/rivendell | 153d9f73acb9735f3ce94c10b5dca069dec66fcf | apis/pypad/api/pypad.py | python | Update.shouldBeProcessed | (self,section) | return result | Reads the Log Selection and SendNullUpdate parameters of the
config and returns a boolean to indicate whether or not this
update should be processed (boolean).
Takes one argument:
section - The '[<section>]' of the INI configuration from which
to take t... | Reads the Log Selection and SendNullUpdate parameters of the
config and returns a boolean to indicate whether or not this
update should be processed (boolean). | [
"Reads",
"the",
"Log",
"Selection",
"and",
"SendNullUpdate",
"parameters",
"of",
"the",
"config",
"and",
"returns",
"a",
"boolean",
"to",
"indicate",
"whether",
"or",
"not",
"this",
"update",
"should",
"be",
"processed",
"(",
"boolean",
")",
"."
] | def shouldBeProcessed(self,section):
"""
Reads the Log Selection and SendNullUpdate parameters of the
config and returns a boolean to indicate whether or not this
update should be processed (boolean).
Takes one argument:
section - The '[<section>]' of the... | [
"def",
"shouldBeProcessed",
"(",
"self",
",",
"section",
")",
":",
"result",
"=",
"True",
"if",
"self",
".",
"__config",
".",
"has_section",
"(",
"section",
")",
":",
"if",
"self",
".",
"__config",
".",
"has_option",
"(",
"section",
",",
"'ProcessNullUpdat... | https://github.com/ElvishArtisan/rivendell/blob/153d9f73acb9735f3ce94c10b5dca069dec66fcf/apis/pypad/api/pypad.py#L707-L756 | |
facebookresearch/House3D | e616837a99c2a209212d5556bdbb3dda75298ca9 | House3D/core.py | python | Environment.show | (self, img=None, close=False, renderMapLoc=None, storeImage=None, display=True, renderSegment=False) | return img | When RenderMapLoc is not None, it should be a tuple of reals, the location of robot | When RenderMapLoc is not None, it should be a tuple of reals, the location of robot | [
"When",
"RenderMapLoc",
"is",
"not",
"None",
"it",
"should",
"be",
"a",
"tuple",
"of",
"reals",
"the",
"location",
"of",
"robot"
] | def show(self, img=None, close=False, renderMapLoc=None, storeImage=None, display=True, renderSegment=False):
"""
When RenderMapLoc is not None, it should be a tuple of reals, the location of robot
"""
if close:
if self.viewer is not None:
self.viewer.close()
... | [
"def",
"show",
"(",
"self",
",",
"img",
"=",
"None",
",",
"close",
"=",
"False",
",",
"renderMapLoc",
"=",
"None",
",",
"storeImage",
"=",
"None",
",",
"display",
"=",
"True",
",",
"renderSegment",
"=",
"False",
")",
":",
"if",
"close",
":",
"if",
... | https://github.com/facebookresearch/House3D/blob/e616837a99c2a209212d5556bdbb3dda75298ca9/House3D/core.py#L266-L301 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/msvc.py | python | EnvironmentInfo.OSLibpath | (self) | return libpath | Microsoft Windows SDK Libraries Paths | Microsoft Windows SDK Libraries Paths | [
"Microsoft",
"Windows",
"SDK",
"Libraries",
"Paths"
] | def OSLibpath(self):
"""
Microsoft Windows SDK Libraries Paths
"""
ref = os.path.join(self.si.WindowsSdkDir, 'References')
libpath = []
if self.vc_ver <= 9.0:
libpath += self.OSLibraries
if self.vc_ver >= 11.0:
libpath += [os.path.join(re... | [
"def",
"OSLibpath",
"(",
"self",
")",
":",
"ref",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"si",
".",
"WindowsSdkDir",
",",
"'References'",
")",
"libpath",
"=",
"[",
"]",
"if",
"self",
".",
"vc_ver",
"<=",
"9.0",
":",
"libpath",
"+=",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/msvc.py#L972-L1014 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/utils/shimmodule.py | python | ShimModule.__spec__ | (self) | return __import__(self._mirror).__spec__ | Don't produce __spec__ until requested | Don't produce __spec__ until requested | [
"Don",
"t",
"produce",
"__spec__",
"until",
"requested"
] | def __spec__(self):
"""Don't produce __spec__ until requested"""
return __import__(self._mirror).__spec__ | [
"def",
"__spec__",
"(",
"self",
")",
":",
"return",
"__import__",
"(",
"self",
".",
"_mirror",
")",
".",
"__spec__"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/utils/shimmodule.py#L70-L72 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py | python | pyparsing_common.stripHTMLTags | (s, l, tokens) | return pyparsing_common._html_stripper.transformString(tokens[0]) | Parse action to remove HTML tags from web page HTML source
Example::
# strip HTML links from normal text
text = '<td>More info at the <a href="https://github.com/pyparsing/pyparsing/wiki">pyparsing</a> wiki page</td>'
td, td_end = makeHTMLTags("TD")
table... | Parse action to remove HTML tags from web page HTML source | [
"Parse",
"action",
"to",
"remove",
"HTML",
"tags",
"from",
"web",
"page",
"HTML",
"source"
] | def stripHTMLTags(s, l, tokens):
"""Parse action to remove HTML tags from web page HTML source
Example::
# strip HTML links from normal text
text = '<td>More info at the <a href="https://github.com/pyparsing/pyparsing/wiki">pyparsing</a> wiki page</td>'
td, t... | [
"def",
"stripHTMLTags",
"(",
"s",
",",
"l",
",",
"tokens",
")",
":",
"return",
"pyparsing_common",
".",
"_html_stripper",
".",
"transformString",
"(",
"tokens",
"[",
"0",
"]",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py#L13329-L13359 | |
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/functional/elemwise.py | python | round | (x) | return _elwise(x, mode=Elemwise.Mode.ROUND) | r"""Element-wise `rounding to int`. | r"""Element-wise `rounding to int`. | [
"r",
"Element",
"-",
"wise",
"rounding",
"to",
"int",
"."
] | def round(x):
r"""Element-wise `rounding to int`."""
return _elwise(x, mode=Elemwise.Mode.ROUND) | [
"def",
"round",
"(",
"x",
")",
":",
"return",
"_elwise",
"(",
"x",
",",
"mode",
"=",
"Elemwise",
".",
"Mode",
".",
"ROUND",
")"
] | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/elemwise.py#L287-L289 | |
bh107/bohrium | 5b83e7117285fefc7779ed0e9acb0f8e74c7e068 | bridge/npbackend/bohrium/blas.py | python | trmm | (a, b, alpha=1.0) | return b | B := alpha * A * B | B := alpha * A * B | [
"B",
":",
"=",
"alpha",
"*",
"A",
"*",
"B"
] | def trmm(a, b, alpha=1.0):
""" B := alpha * A * B """
""" Notes: A is unit upper triangular matrix """
__blas("blas_trmm", a, b, alpha)
return b | [
"def",
"trmm",
"(",
"a",
",",
"b",
",",
"alpha",
"=",
"1.0",
")",
":",
"\"\"\" Notes: A is unit upper triangular matrix \"\"\"",
"__blas",
"(",
"\"blas_trmm\"",
",",
"a",
",",
"b",
",",
"alpha",
")",
"return",
"b"
] | https://github.com/bh107/bohrium/blob/5b83e7117285fefc7779ed0e9acb0f8e74c7e068/bridge/npbackend/bohrium/blas.py#L96-L100 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/math_ops.py | python | angle | (input, name=None) | r"""Returns the element-wise argument of a complex (or real) tensor.
Given a tensor `input`, this operation returns a tensor of type `float` that
is the argument of each element in `input` considered as a complex number.
The elements in `input` are considered to be complex numbers of the form
\\(a + bj\\), wh... | r"""Returns the element-wise argument of a complex (or real) tensor. | [
"r",
"Returns",
"the",
"element",
"-",
"wise",
"argument",
"of",
"a",
"complex",
"(",
"or",
"real",
")",
"tensor",
"."
] | def angle(input, name=None):
r"""Returns the element-wise argument of a complex (or real) tensor.
Given a tensor `input`, this operation returns a tensor of type `float` that
is the argument of each element in `input` considered as a complex number.
The elements in `input` are considered to be complex numbers... | [
"def",
"angle",
"(",
"input",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"Angle\"",
",",
"[",
"input",
"]",
")",
"as",
"name",
":",
"if",
"input",
".",
"dtype",
".",
"is_complex",
":",
"return",
"gen_m... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/math_ops.py#L650-L682 | ||
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | lib/colvars/Install.py | python | get_lammps_machine_flags | (machine) | return machine_flags | Parse Makefile.machine from LAMMPS, return dictionary of compiler flags | Parse Makefile.machine from LAMMPS, return dictionary of compiler flags | [
"Parse",
"Makefile",
".",
"machine",
"from",
"LAMMPS",
"return",
"dictionary",
"of",
"compiler",
"flags"
] | def get_lammps_machine_flags(machine):
"""Parse Makefile.machine from LAMMPS, return dictionary of compiler flags"""
if not os.path.exists("../../src/MAKE/MACHINES/Makefile.%s" % machine):
sys.exit("ERROR: Cannot locate src/MAKE/MACHINES/Makefile.%s" % machine)
lines = open("../../src/MAKE/MACHINES/Makefile.%... | [
"def",
"get_lammps_machine_flags",
"(",
"machine",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"\"../../src/MAKE/MACHINES/Makefile.%s\"",
"%",
"machine",
")",
":",
"sys",
".",
"exit",
"(",
"\"ERROR: Cannot locate src/MAKE/MACHINES/Makefile.%s\"",
"%"... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/lib/colvars/Install.py#L57-L75 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/dataview.py | python | DataViewTreeStoreNode.GetItem | (*args, **kwargs) | return _dataview.DataViewTreeStoreNode_GetItem(*args, **kwargs) | GetItem(self) -> DataViewItem | GetItem(self) -> DataViewItem | [
"GetItem",
"(",
"self",
")",
"-",
">",
"DataViewItem"
] | def GetItem(*args, **kwargs):
"""GetItem(self) -> DataViewItem"""
return _dataview.DataViewTreeStoreNode_GetItem(*args, **kwargs) | [
"def",
"GetItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewTreeStoreNode_GetItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L2251-L2253 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py | python | _CrossedColumn.key | (self) | return "{}".format(self) | Returns a string which will be used as a key when we do sorting. | Returns a string which will be used as a key when we do sorting. | [
"Returns",
"a",
"string",
"which",
"will",
"be",
"used",
"as",
"a",
"key",
"when",
"we",
"do",
"sorting",
"."
] | def key(self):
"""Returns a string which will be used as a key when we do sorting."""
return "{}".format(self) | [
"def",
"key",
"(",
"self",
")",
":",
"return",
"\"{}\"",
".",
"format",
"(",
"self",
")"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py#L1251-L1253 | |
GoSSIP-SJTU/Armariris | ad5d868482956b2194a77b39c8d543c7c2318200 | tools/clang/bindings/python/clang/cindex.py | python | TokenKind.register | (value, name) | Register a new TokenKind enumeration.
This should only be called at module load time by code within this
package. | Register a new TokenKind enumeration. | [
"Register",
"a",
"new",
"TokenKind",
"enumeration",
"."
] | def register(value, name):
"""Register a new TokenKind enumeration.
This should only be called at module load time by code within this
package.
"""
if value in TokenKind._value_map:
raise ValueError('TokenKind already registered: %d' % value)
kind = TokenKin... | [
"def",
"register",
"(",
"value",
",",
"name",
")",
":",
"if",
"value",
"in",
"TokenKind",
".",
"_value_map",
":",
"raise",
"ValueError",
"(",
"'TokenKind already registered: %d'",
"%",
"value",
")",
"kind",
"=",
"TokenKind",
"(",
"value",
",",
"name",
")",
... | https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/tools/clang/bindings/python/clang/cindex.py#L502-L513 | ||
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | _NestingState.InnermostClass | (self) | return None | Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise. | Get class info on the top of the stack. | [
"Get",
"class",
"info",
"on",
"the",
"top",
"of",
"the",
"stack",
"."
] | def InnermostClass(self):
"""Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise.
"""
for i in range(len(self.stack), 0, -1):
classinfo = self.stack[i - 1]
if isinstance(classinfo, _ClassInfo):
return classinfo
r... | [
"def",
"InnermostClass",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"stack",
")",
",",
"0",
",",
"-",
"1",
")",
":",
"classinfo",
"=",
"self",
".",
"stack",
"[",
"i",
"-",
"1",
"]",
"if",
"isinstance",
"(",
... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L1720-L1730 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/errors_impl.py | python | PermissionDeniedError.__init__ | (self, node_def, op, message) | Creates a `PermissionDeniedError`. | Creates a `PermissionDeniedError`. | [
"Creates",
"a",
"PermissionDeniedError",
"."
] | def __init__(self, node_def, op, message):
"""Creates a `PermissionDeniedError`."""
super(PermissionDeniedError, self).__init__(node_def, op, message,
PERMISSION_DENIED) | [
"def",
"__init__",
"(",
"self",
",",
"node_def",
",",
"op",
",",
"message",
")",
":",
"super",
"(",
"PermissionDeniedError",
",",
"self",
")",
".",
"__init__",
"(",
"node_def",
",",
"op",
",",
"message",
",",
"PERMISSION_DENIED",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/errors_impl.py#L270-L273 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/jinja2/utils.py | python | LRUCache.values | (self) | return [x[1] for x in self.items()] | Return a list of all values. | Return a list of all values. | [
"Return",
"a",
"list",
"of",
"all",
"values",
"."
] | def values(self):
"""Return a list of all values."""
return [x[1] for x in self.items()] | [
"def",
"values",
"(",
"self",
")",
":",
"return",
"[",
"x",
"[",
"1",
"]",
"for",
"x",
"in",
"self",
".",
"items",
"(",
")",
"]"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/utils.py#L454-L456 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/protobuf/python/google/protobuf/descriptor.py | python | MethodDescriptor.__init__ | (self, name, full_name, index, containing_service,
input_type, output_type, options=None) | The arguments are as described in the description of MethodDescriptor
attributes above.
Note that containing_service may be None, and may be set later if necessary. | The arguments are as described in the description of MethodDescriptor
attributes above. | [
"The",
"arguments",
"are",
"as",
"described",
"in",
"the",
"description",
"of",
"MethodDescriptor",
"attributes",
"above",
"."
] | def __init__(self, name, full_name, index, containing_service,
input_type, output_type, options=None):
"""The arguments are as described in the description of MethodDescriptor
attributes above.
Note that containing_service may be None, and may be set later if necessary.
"""
super(Met... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"full_name",
",",
"index",
",",
"containing_service",
",",
"input_type",
",",
"output_type",
",",
"options",
"=",
"None",
")",
":",
"super",
"(",
"MethodDescriptor",
",",
"self",
")",
".",
"__init__",
"(",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/descriptor.py#L757-L770 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/Runtime/common/time/timezoneinfo-gen.py | python | info | (sMsg) | Outputs an informational message to stderr. | Outputs an informational message to stderr. | [
"Outputs",
"an",
"informational",
"message",
"to",
"stderr",
"."
] | def info(sMsg):
"""
Outputs an informational message to stderr.
"""
print('info: ' + sMsg, file=sys.stderr); | [
"def",
"info",
"(",
"sMsg",
")",
":",
"print",
"(",
"'info: '",
"+",
"sMsg",
",",
"file",
"=",
"sys",
".",
"stderr",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Runtime/common/time/timezoneinfo-gen.py#L76-L80 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/utils/parallelizer.py | python | Parallelizer.__call__ | (self, *args, **kwargs) | return r | Emulate calling |self| with |args| and |kwargs|.
Note that this call is asynchronous. Call pFinish on the return value to
block until the call finishes.
Returns:
A Parallelizer wrapping the ReraiserThreadGroup running the call in
parallel.
Raises:
AttributeError if the wrapped object... | Emulate calling |self| with |args| and |kwargs|. | [
"Emulate",
"calling",
"|self|",
"with",
"|args|",
"and",
"|kwargs|",
"."
] | def __call__(self, *args, **kwargs):
"""Emulate calling |self| with |args| and |kwargs|.
Note that this call is asynchronous. Call pFinish on the return value to
block until the call finishes.
Returns:
A Parallelizer wrapping the ReraiserThreadGroup running the call in
parallel.
Raises... | [
"def",
"__call__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"pGet",
"(",
"None",
")",
"for",
"o",
"in",
"self",
".",
"_objs",
":",
"if",
"not",
"callable",
"(",
"o",
")",
":",
"raise",
"AttributeError",
"(",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/utils/parallelizer.py#L97-L122 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/context.py | python | gpu | (device_id=0) | return Context('gpu', device_id) | Returns a GPU context.
This function is a short cut for Context('gpu', device_id).
The K GPUs on a node are typically numbered as 0,...,K-1.
Examples
----------
>>> cpu_array = mx.nd.ones((2, 3))
>>> cpu_array.context
cpu(0)
>>> with mx.gpu(1):
... gpu_array = mx.nd.ones((2, 3)... | Returns a GPU context. | [
"Returns",
"a",
"GPU",
"context",
"."
] | def gpu(device_id=0):
"""Returns a GPU context.
This function is a short cut for Context('gpu', device_id).
The K GPUs on a node are typically numbered as 0,...,K-1.
Examples
----------
>>> cpu_array = mx.nd.ones((2, 3))
>>> cpu_array.context
cpu(0)
>>> with mx.gpu(1):
... ... | [
"def",
"gpu",
"(",
"device_id",
"=",
"0",
")",
":",
"return",
"Context",
"(",
"'gpu'",
",",
"device_id",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/context.py#L230-L259 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/internal/python_message.py | python | _Listener.__init__ | (self, parent_message) | Args:
parent_message: The message whose _Modified() method we should call when
we receive Modified() messages. | Args:
parent_message: The message whose _Modified() method we should call when
we receive Modified() messages. | [
"Args",
":",
"parent_message",
":",
"The",
"message",
"whose",
"_Modified",
"()",
"method",
"we",
"should",
"call",
"when",
"we",
"receive",
"Modified",
"()",
"messages",
"."
] | def __init__(self, parent_message):
"""Args:
parent_message: The message whose _Modified() method we should call when
we receive Modified() messages.
"""
# This listener establishes a back reference from a child (contained) object
# to its parent (containing) object. We make this a weak r... | [
"def",
"__init__",
"(",
"self",
",",
"parent_message",
")",
":",
"# This listener establishes a back reference from a child (contained) object",
"# to its parent (containing) object. We make this a weak reference to avoid",
"# creating cyclic garbage when the client finishes with the 'parent' o... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/python_message.py#L1379-L1396 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fsspec/core.py | python | get_fs_token_paths | (
urlpath, mode="rb", num=1, name_function=None, storage_options=None, protocol=None
) | return fs, fs._fs_token, paths | Filesystem, deterministic token, and paths from a urlpath and options.
Parameters
----------
urlpath: string or iterable
Absolute or relative filepath, URL (may include protocols like
``s3://``), or globstring pointing to data.
mode: str, optional
Mode in which to open files.
... | Filesystem, deterministic token, and paths from a urlpath and options. | [
"Filesystem",
"deterministic",
"token",
"and",
"paths",
"from",
"a",
"urlpath",
"and",
"options",
"."
] | def get_fs_token_paths(
urlpath, mode="rb", num=1, name_function=None, storage_options=None, protocol=None
):
"""Filesystem, deterministic token, and paths from a urlpath and options.
Parameters
----------
urlpath: string or iterable
Absolute or relative filepath, URL (may include protocols... | [
"def",
"get_fs_token_paths",
"(",
"urlpath",
",",
"mode",
"=",
"\"rb\"",
",",
"num",
"=",
"1",
",",
"name_function",
"=",
"None",
",",
"storage_options",
"=",
"None",
",",
"protocol",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"urlpath",
",",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fsspec/core.py#L418-L485 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/tools/gyp/pylib/gyp/SCons.py | python | TargetBase.write_target | (self, fp, src_dir='', pre='') | Writes the lines necessary to build this target. | Writes the lines necessary to build this target. | [
"Writes",
"the",
"lines",
"necessary",
"to",
"build",
"this",
"target",
"."
] | def write_target(self, fp, src_dir='', pre=''):
"""
Writes the lines necessary to build this target.
"""
fp.write('\n' + pre)
fp.write('_outputs = %s\n' % self.builder_call())
fp.write('target_files.extend(_outputs)\n') | [
"def",
"write_target",
"(",
"self",
",",
"fp",
",",
"src_dir",
"=",
"''",
",",
"pre",
"=",
"''",
")",
":",
"fp",
".",
"write",
"(",
"'\\n'",
"+",
"pre",
")",
"fp",
".",
"write",
"(",
"'_outputs = %s\\n'",
"%",
"self",
".",
"builder_call",
"(",
")",... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/SCons.py#L74-L80 | ||
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/frameworks/modelling.py | python | PetroModelling.response | (self, model) | return ret | Use transformation to get p(m) and compute response f(p). | Use transformation to get p(m) and compute response f(p). | [
"Use",
"transformation",
"to",
"get",
"p",
"(",
"m",
")",
"and",
"compute",
"response",
"f",
"(",
"p",
")",
"."
] | def response(self, model):
"""Use transformation to get p(m) and compute response f(p)."""
tModel = self._petroTrans.fwd(model)
ret = self._f.response(tModel)
return ret | [
"def",
"response",
"(",
"self",
",",
"model",
")",
":",
"tModel",
"=",
"self",
".",
"_petroTrans",
".",
"fwd",
"(",
"model",
")",
"ret",
"=",
"self",
".",
"_f",
".",
"response",
"(",
"tModel",
")",
"return",
"ret"
] | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/frameworks/modelling.py#L694-L698 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py | python | Cursor.objc_type_encoding | (self) | return self._objc_type_encoding | Return the Objective-C type encoding as a str. | Return the Objective-C type encoding as a str. | [
"Return",
"the",
"Objective",
"-",
"C",
"type",
"encoding",
"as",
"a",
"str",
"."
] | def objc_type_encoding(self):
"""Return the Objective-C type encoding as a str."""
if not hasattr(self, '_objc_type_encoding'):
self._objc_type_encoding = \
conf.lib.clang_getDeclObjCTypeEncoding(self)
return self._objc_type_encoding | [
"def",
"objc_type_encoding",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_objc_type_encoding'",
")",
":",
"self",
".",
"_objc_type_encoding",
"=",
"conf",
".",
"lib",
".",
"clang_getDeclObjCTypeEncoding",
"(",
"self",
")",
"return",
"sel... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py#L1587-L1593 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/statistics.py | python | NormalDist.__add__ | (x1, x2) | return NormalDist(x1._mu + x2, x1._sigma) | Add a constant or another NormalDist instance.
If *other* is a constant, translate mu by the constant,
leaving sigma unchanged.
If *other* is a NormalDist, add both the means and the variances.
Mathematically, this works only if the two distributions are
independent or if they ... | Add a constant or another NormalDist instance. | [
"Add",
"a",
"constant",
"or",
"another",
"NormalDist",
"instance",
"."
] | def __add__(x1, x2):
"""Add a constant or another NormalDist instance.
If *other* is a constant, translate mu by the constant,
leaving sigma unchanged.
If *other* is a NormalDist, add both the means and the variances.
Mathematically, this works only if the two distributions are... | [
"def",
"__add__",
"(",
"x1",
",",
"x2",
")",
":",
"if",
"isinstance",
"(",
"x2",
",",
"NormalDist",
")",
":",
"return",
"NormalDist",
"(",
"x1",
".",
"_mu",
"+",
"x2",
".",
"_mu",
",",
"hypot",
"(",
"x1",
".",
"_sigma",
",",
"x2",
".",
"_sigma",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/statistics.py#L1049-L1061 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/inputsplitter.py | python | InputSplitter.check_complete | (self, source) | Return whether a block of code is ready to execute, or should be continued
This is a non-stateful API, and will reset the state of this InputSplitter.
Parameters
----------
source : string
Python input code, which can be multiline.
Returns
... | Return whether a block of code is ready to execute, or should be continued
This is a non-stateful API, and will reset the state of this InputSplitter.
Parameters
----------
source : string
Python input code, which can be multiline.
Returns
... | [
"Return",
"whether",
"a",
"block",
"of",
"code",
"is",
"ready",
"to",
"execute",
"or",
"should",
"be",
"continued",
"This",
"is",
"a",
"non",
"-",
"stateful",
"API",
"and",
"will",
"reset",
"the",
"state",
"of",
"this",
"InputSplitter",
".",
"Parameters",
... | def check_complete(self, source):
"""Return whether a block of code is ready to execute, or should be continued
This is a non-stateful API, and will reset the state of this InputSplitter.
Parameters
----------
source : string
Python input code, which c... | [
"def",
"check_complete",
"(",
"self",
",",
"source",
")",
":",
"self",
".",
"reset",
"(",
")",
"try",
":",
"self",
".",
"push",
"(",
"source",
")",
"except",
"SyntaxError",
":",
"# Transformers in IPythonInputSplitter can raise SyntaxError,",
"# which push() will no... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/inputsplitter.py#L239-L273 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | GridCellAttrProvider.SetRowAttr | (*args, **kwargs) | return _grid.GridCellAttrProvider_SetRowAttr(*args, **kwargs) | SetRowAttr(self, GridCellAttr attr, int row) | SetRowAttr(self, GridCellAttr attr, int row) | [
"SetRowAttr",
"(",
"self",
"GridCellAttr",
"attr",
"int",
"row",
")"
] | def SetRowAttr(*args, **kwargs):
"""SetRowAttr(self, GridCellAttr attr, int row)"""
return _grid.GridCellAttrProvider_SetRowAttr(*args, **kwargs) | [
"def",
"SetRowAttr",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridCellAttrProvider_SetRowAttr",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L694-L696 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/postgres_manager_wrap.py | python | PostgresManagerWrap.Query | (db, query, parameters=None) | return results | Submits the query to the database and returns tuples.
Args:
db: The database being queried.
query: SQL SELECT statement.
parameters: sequence of parameters to populate placeholders in SQL
statement.
Returns:
Results as list of lists (rows of fields). | Submits the query to the database and returns tuples. | [
"Submits",
"the",
"query",
"to",
"the",
"database",
"and",
"returns",
"tuples",
"."
] | def Query(db, query, parameters=None):
"""Submits the query to the database and returns tuples.
Args:
db: The database being queried.
query: SQL SELECT statement.
parameters: sequence of parameters to populate placeholders in SQL
statement.
Returns:
Results as list... | [
"def",
"Query",
"(",
"db",
",",
"query",
",",
"parameters",
"=",
"None",
")",
":",
"db_con",
"=",
"postgres_manager",
".",
"PostgresConnection",
"(",
"db",
",",
"PostgresManagerWrap",
".",
"DB_USER",
",",
"PostgresManagerWrap",
".",
"DB_HOST",
",",
"PostgresMa... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/postgres_manager_wrap.py#L43-L64 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/crywaflib/msvs.py | python | vsnode_target.__init__ | (self, ctx, tg) | A project is more or less equivalent to a file/folder | A project is more or less equivalent to a file/folder | [
"A",
"project",
"is",
"more",
"or",
"less",
"equivalent",
"to",
"a",
"file",
"/",
"folder"
] | def __init__(self, ctx, tg):
"""
A project is more or less equivalent to a file/folder
"""
base = getattr(ctx, 'projects_dir', None) or tg.path
node = base.make_node(quote(tg.name) + ctx.project_extension) # the project file as a Node
vsnode_alias.__init__(self, ctx, node, quote(tg.name))
self.tg = tg... | [
"def",
"__init__",
"(",
"self",
",",
"ctx",
",",
"tg",
")",
":",
"base",
"=",
"getattr",
"(",
"ctx",
",",
"'projects_dir'",
",",
"None",
")",
"or",
"tg",
".",
"path",
"node",
"=",
"base",
".",
"make_node",
"(",
"quote",
"(",
"tg",
".",
"name",
")... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/msvs.py#L1305-L1318 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/examples/fix_cvs_files.py | python | is_kb_sticky | (filename) | return 0 | This checks if 'cvs status' reports '-kb' for Sticky options. If the
Sticky Option status is '-ks' then this returns 1. If the status is
'Unknown' then it returns 1. Otherwise 0 is returned. | This checks if 'cvs status' reports '-kb' for Sticky options. If the
Sticky Option status is '-ks' then this returns 1. If the status is
'Unknown' then it returns 1. Otherwise 0 is returned. | [
"This",
"checks",
"if",
"cvs",
"status",
"reports",
"-",
"kb",
"for",
"Sticky",
"options",
".",
"If",
"the",
"Sticky",
"Option",
"status",
"is",
"-",
"ks",
"then",
"this",
"returns",
"1",
".",
"If",
"the",
"status",
"is",
"Unknown",
"then",
"it",
"retu... | def is_kb_sticky(filename):
"""This checks if 'cvs status' reports '-kb' for Sticky options. If the
Sticky Option status is '-ks' then this returns 1. If the status is
'Unknown' then it returns 1. Otherwise 0 is returned. """
try:
s = pexpect.spawn('cvs status %s' % filename)
... | [
"def",
"is_kb_sticky",
"(",
"filename",
")",
":",
"try",
":",
"s",
"=",
"pexpect",
".",
"spawn",
"(",
"'cvs status %s'",
"%",
"filename",
")",
"i",
"=",
"s",
".",
"expect",
"(",
"[",
"'Sticky Options:\\s*(.*)\\r\\n'",
",",
"'Status: Unknown'",
"]",
")",
"i... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/examples/fix_cvs_files.py#L41-L60 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListItem.Attributes | (self) | return self._attr | Returns the associated attributes if they exist, or create a new :class:`UltimateListItemAttr`
structure and associate it with this item. | Returns the associated attributes if they exist, or create a new :class:`UltimateListItemAttr`
structure and associate it with this item. | [
"Returns",
"the",
"associated",
"attributes",
"if",
"they",
"exist",
"or",
"create",
"a",
"new",
":",
"class",
":",
"UltimateListItemAttr",
"structure",
"and",
"associate",
"it",
"with",
"this",
"item",
"."
] | def Attributes(self):
"""
Returns the associated attributes if they exist, or create a new :class:`UltimateListItemAttr`
structure and associate it with this item.
"""
if not self._attr:
self._attr = UltimateListItemAttr()
return self._attr | [
"def",
"Attributes",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_attr",
":",
"self",
".",
"_attr",
"=",
"UltimateListItemAttr",
"(",
")",
"return",
"self",
".",
"_attr"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L1825-L1834 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | ExodusModel._convert_side_set_to_triangle_block | (self,
side_set_ids,
new_element_block_id='auto') | Create a new 'tri3' element block composed of the given side set.
The side set must contain faces of three dimensional elements. | Create a new 'tri3' element block composed of the given side set. | [
"Create",
"a",
"new",
"tri3",
"element",
"block",
"composed",
"of",
"the",
"given",
"side",
"set",
"."
] | def _convert_side_set_to_triangle_block(self,
side_set_ids,
new_element_block_id='auto'):
"""
Create a new 'tri3' element block composed of the given side set.
The side set must contain faces of three dimens... | [
"def",
"_convert_side_set_to_triangle_block",
"(",
"self",
",",
"side_set_ids",
",",
"new_element_block_id",
"=",
"'auto'",
")",
":",
"side_set_ids",
"=",
"self",
".",
"_format_side_set_id_list",
"(",
"side_set_ids",
")",
"if",
"new_element_block_id",
"==",
"'auto'",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L1393-L1462 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/dep_util.py | python | newer_pairwise_group | (sources_groups, targets) | return n_sources, n_targets | Walk both arguments in parallel, testing if each source group is newer
than its corresponding target. Returns a pair of lists (sources_groups,
targets) where sources is newer than target, according to the semantics
of 'newer_group()'. | Walk both arguments in parallel, testing if each source group is newer
than its corresponding target. Returns a pair of lists (sources_groups,
targets) where sources is newer than target, according to the semantics
of 'newer_group()'. | [
"Walk",
"both",
"arguments",
"in",
"parallel",
"testing",
"if",
"each",
"source",
"group",
"is",
"newer",
"than",
"its",
"corresponding",
"target",
".",
"Returns",
"a",
"pair",
"of",
"lists",
"(",
"sources_groups",
"targets",
")",
"where",
"sources",
"is",
"... | def newer_pairwise_group(sources_groups, targets):
"""Walk both arguments in parallel, testing if each source group is newer
than its corresponding target. Returns a pair of lists (sources_groups,
targets) where sources is newer than target, according to the semantics
of 'newer_group()'.
"""
if ... | [
"def",
"newer_pairwise_group",
"(",
"sources_groups",
",",
"targets",
")",
":",
"if",
"len",
"(",
"sources_groups",
")",
"!=",
"len",
"(",
"targets",
")",
":",
"raise",
"ValueError",
"(",
"\"'sources_group' and 'targets' must be the same length\"",
")",
"# build a pai... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/dep_util.py#L7-L25 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | native_client_sdk/src/build_tools/manifest_util.py | python | Bundle.GetArchive | (self, host_os_name) | return None | Retrieve the archive for the given host os.
Args:
host_os_name: name of host os whose archive must be retrieved.
Return:
An Archive instance or None if it doesn't exist. | Retrieve the archive for the given host os. | [
"Retrieve",
"the",
"archive",
"for",
"the",
"given",
"host",
"os",
"."
] | def GetArchive(self, host_os_name):
"""Retrieve the archive for the given host os.
Args:
host_os_name: name of host os whose archive must be retrieved.
Return:
An Archive instance or None if it doesn't exist."""
for archive in self[ARCHIVES_KEY]:
if archive.host_os == host_os_name or ... | [
"def",
"GetArchive",
"(",
"self",
",",
"host_os_name",
")",
":",
"for",
"archive",
"in",
"self",
"[",
"ARCHIVES_KEY",
"]",
":",
"if",
"archive",
".",
"host_os",
"==",
"host_os_name",
"or",
"archive",
".",
"host_os",
"==",
"'all'",
":",
"return",
"archive",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/native_client_sdk/src/build_tools/manifest_util.py#L311-L321 | |
GrammaTech/gtirb | 415dd72e1e3c475004d013723c16cdcb29c0826e | python/gtirb/section.py | python | Section.size | (self) | return None | Get the size of this section, if known.
The address is calculated from the :class:`ByteInterval` objects in
this section. More specifically, if the address of all byte intervals
in this section are fixed, then it will return the difference between
the lowest and highest address among th... | Get the size of this section, if known. | [
"Get",
"the",
"size",
"of",
"this",
"section",
"if",
"known",
"."
] | def size(self) -> typing.Optional[int]:
"""Get the size of this section, if known.
The address is calculated from the :class:`ByteInterval` objects in
this section. More specifically, if the address of all byte intervals
in this section are fixed, then it will return the difference betw... | [
"def",
"size",
"(",
"self",
")",
"->",
"typing",
".",
"Optional",
"[",
"int",
"]",
":",
"if",
"0",
"<",
"len",
"(",
"self",
".",
"_interval_index",
")",
"==",
"len",
"(",
"self",
".",
"byte_intervals",
")",
":",
"return",
"self",
".",
"_interval_inde... | https://github.com/GrammaTech/gtirb/blob/415dd72e1e3c475004d013723c16cdcb29c0826e/python/gtirb/section.py#L242-L257 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/core/defchararray.py | python | chararray.isalpha | (self) | return isalpha(self) | Returns true for each element if all characters in the string
are alphabetic and there is at least one character, false
otherwise.
See also
--------
char.isalpha | Returns true for each element if all characters in the string
are alphabetic and there is at least one character, false
otherwise. | [
"Returns",
"true",
"for",
"each",
"element",
"if",
"all",
"characters",
"in",
"the",
"string",
"are",
"alphabetic",
"and",
"there",
"is",
"at",
"least",
"one",
"character",
"false",
"otherwise",
"."
] | def isalpha(self):
"""
Returns true for each element if all characters in the string
are alphabetic and there is at least one character, false
otherwise.
See also
--------
char.isalpha
"""
return isalpha(self) | [
"def",
"isalpha",
"(",
"self",
")",
":",
"return",
"isalpha",
"(",
"self",
")"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/core/defchararray.py#L2162-L2173 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py | python | Tag.decompose | (self) | Recursively destroys the contents of this tree. | Recursively destroys the contents of this tree. | [
"Recursively",
"destroys",
"the",
"contents",
"of",
"this",
"tree",
"."
] | def decompose(self):
"""Recursively destroys the contents of this tree."""
self.extract()
if len(self.contents) == 0:
return
current = self.contents[0]
while current is not None:
next = current.next
if isinstance(current, Tag):
... | [
"def",
"decompose",
"(",
"self",
")",
":",
"self",
".",
"extract",
"(",
")",
"if",
"len",
"(",
"self",
".",
"contents",
")",
"==",
"0",
":",
"return",
"current",
"=",
"self",
".",
"contents",
"[",
"0",
"]",
"while",
"current",
"is",
"not",
"None",
... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py#L778-L793 | ||
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | src/lib/mixer/MultirotorMixer/mixer_multirotor.py | python | airmode_rpy | (m_sp, P, u_min, u_max) | return (u, u_prime_yaw) | Mix roll, pitch, yaw and thrust.
Desaturation behavior: full airmode for roll/pitch/yaw:
thrust is increased/decreased as much as required to meet demanded the roll/pitch/yaw. | Mix roll, pitch, yaw and thrust. | [
"Mix",
"roll",
"pitch",
"yaw",
"and",
"thrust",
"."
] | def airmode_rpy(m_sp, P, u_min, u_max):
"""
Mix roll, pitch, yaw and thrust.
Desaturation behavior: full airmode for roll/pitch/yaw:
thrust is increased/decreased as much as required to meet demanded the roll/pitch/yaw.
"""
# Mix with yaw
u = P * m_sp
# Use thrust to unsaturate the out... | [
"def",
"airmode_rpy",
"(",
"m_sp",
",",
"P",
",",
"u_min",
",",
"u_max",
")",
":",
"# Mix with yaw",
"u",
"=",
"P",
"*",
"m_sp",
"# Use thrust to unsaturate the outputs if needed",
"u_T",
"=",
"P",
"[",
":",
",",
"3",
"]",
"u_prime",
"=",
"minimize_sat",
"... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/src/lib/mixer/MultirotorMixer/mixer_multirotor.py#L124-L143 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/layers/python/layers/feature_column_ops.py | python | _create_joint_embedding_lookup | (columns_to_tensors,
embedding_lookup_arguments,
num_outputs,
trainable,
weight_collections) | Creates an embedding lookup for all columns sharing a single weight. | Creates an embedding lookup for all columns sharing a single weight. | [
"Creates",
"an",
"embedding",
"lookup",
"for",
"all",
"columns",
"sharing",
"a",
"single",
"weight",
"."
] | def _create_joint_embedding_lookup(columns_to_tensors,
embedding_lookup_arguments,
num_outputs,
trainable,
weight_collections):
"""Creates an embedding lookup for all columns sha... | [
"def",
"_create_joint_embedding_lookup",
"(",
"columns_to_tensors",
",",
"embedding_lookup_arguments",
",",
"num_outputs",
",",
"trainable",
",",
"weight_collections",
")",
":",
"for",
"arg",
"in",
"embedding_lookup_arguments",
":",
"assert",
"arg",
".",
"weight_tensor",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/layers/python/layers/feature_column_ops.py#L346-L392 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/locators.py | python | AggregatingLocator.__init__ | (self, *locators, **kwargs) | Initialise an instance.
:param locators: The list of locators to search.
:param kwargs: Passed to the superclass constructor,
except for:
* merge - if False (the default), the first successful
search from any of the locators is retu... | Initialise an instance. | [
"Initialise",
"an",
"instance",
"."
] | def __init__(self, *locators, **kwargs):
"""
Initialise an instance.
:param locators: The list of locators to search.
:param kwargs: Passed to the superclass constructor,
except for:
* merge - if False (the default), the first successful
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"locators",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"merge",
"=",
"kwargs",
".",
"pop",
"(",
"'merge'",
",",
"False",
")",
"self",
".",
"locators",
"=",
"locators",
"super",
"(",
"AggregatingLocator",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/locators.py#L970-L984 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/logging/config.py | python | _create_formatters | (cp) | return formatters | Create and return formatters | Create and return formatters | [
"Create",
"and",
"return",
"formatters"
] | def _create_formatters(cp):
"""Create and return formatters"""
flist = cp["formatters"]["keys"]
if not len(flist):
return {}
flist = flist.split(",")
flist = _strip_spaces(flist)
formatters = {}
for form in flist:
sectname = "formatter_%s" % form
fs = cp.get(sectname,... | [
"def",
"_create_formatters",
"(",
"cp",
")",
":",
"flist",
"=",
"cp",
"[",
"\"formatters\"",
"]",
"[",
"\"keys\"",
"]",
"if",
"not",
"len",
"(",
"flist",
")",
":",
"return",
"{",
"}",
"flist",
"=",
"flist",
".",
"split",
"(",
"\",\"",
")",
"flist",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/logging/config.py#L102-L121 | |
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/tools/clang/docs/tools/dump_ast_matchers.py | python | act_on_decl | (declaration, comment, allowed_types) | Parse the matcher out of the given declaration and comment.
If 'allowed_types' is set, it contains a list of node types the matcher
can match on, as extracted from the static type asserts in the matcher
definition. | Parse the matcher out of the given declaration and comment. | [
"Parse",
"the",
"matcher",
"out",
"of",
"the",
"given",
"declaration",
"and",
"comment",
"."
] | def act_on_decl(declaration, comment, allowed_types):
"""Parse the matcher out of the given declaration and comment.
If 'allowed_types' is set, it contains a list of node types the matcher
can match on, as extracted from the static type asserts in the matcher
definition.
"""
if declaration.strip()... | [
"def",
"act_on_decl",
"(",
"declaration",
",",
"comment",
",",
"allowed_types",
")",
":",
"if",
"declaration",
".",
"strip",
"(",
")",
":",
"# Node matchers are defined by writing:",
"# VariadicDynCastAllOfMatcher<ResultType, ArgumentType> name;",
"m",
"=",
"re",
".",
... | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/docs/tools/dump_ast_matchers.py#L134-L320 | ||
malja/zroya | 41830133a54528e9cd9ef43d9637a576ac849c11 | setup.py | python | UploadCommand.status | (s) | Prints things in bold. | Prints things in bold. | [
"Prints",
"things",
"in",
"bold",
"."
] | def status(s):
"""Prints things in bold."""
print('\033[1m{0}\033[0m'.format(s)) | [
"def",
"status",
"(",
"s",
")",
":",
"print",
"(",
"'\\033[1m{0}\\033[0m'",
".",
"format",
"(",
"s",
")",
")"
] | https://github.com/malja/zroya/blob/41830133a54528e9cd9ef43d9637a576ac849c11/setup.py#L111-L113 | ||
facebookarchive/LogDevice | ce7726050edc49a1e15d9160e81c890736b779e2 | build/fbcode_builder/getdeps/builder.py | python | BuilderBase.run_tests | (
self, install_dirs, schedule_type, owner, test_filter, retry, no_testpilot
) | Execute any tests that we know how to run. If they fail,
raise an exception. | Execute any tests that we know how to run. If they fail,
raise an exception. | [
"Execute",
"any",
"tests",
"that",
"we",
"know",
"how",
"to",
"run",
".",
"If",
"they",
"fail",
"raise",
"an",
"exception",
"."
] | def run_tests(
self, install_dirs, schedule_type, owner, test_filter, retry, no_testpilot
):
"""Execute any tests that we know how to run. If they fail,
raise an exception."""
pass | [
"def",
"run_tests",
"(",
"self",
",",
"install_dirs",
",",
"schedule_type",
",",
"owner",
",",
"test_filter",
",",
"retry",
",",
"no_testpilot",
")",
":",
"pass"
] | https://github.com/facebookarchive/LogDevice/blob/ce7726050edc49a1e15d9160e81c890736b779e2/build/fbcode_builder/getdeps/builder.py#L103-L108 | ||
codilime/veles | e65de5a7c268129acffcdb03034efd8d256d025c | python/veles/data/bindata.py | python | BinData.__getitem__ | (self, idx) | When the index is an int, returns a single element as an int.
Negative indices are supported and access elements from the
end of the array (as usual for Python sequences).
When the index is a slice object, returns a subrange of elements
as a BinData instance of the same width. Slicing ... | When the index is an int, returns a single element as an int.
Negative indices are supported and access elements from the
end of the array (as usual for Python sequences). | [
"When",
"the",
"index",
"is",
"an",
"int",
"returns",
"a",
"single",
"element",
"as",
"an",
"int",
".",
"Negative",
"indices",
"are",
"supported",
"and",
"access",
"elements",
"from",
"the",
"end",
"of",
"the",
"array",
"(",
"as",
"usual",
"for",
"Python... | def __getitem__(self, idx):
"""
When the index is an int, returns a single element as an int.
Negative indices are supported and access elements from the
end of the array (as usual for Python sequences).
When the index is a slice object, returns a subrange of elements
as... | [
"def",
"__getitem__",
"(",
"self",
",",
"idx",
")",
":",
"ope",
"=",
"self",
".",
"octets_per_element",
"(",
")",
"if",
"isinstance",
"(",
"idx",
",",
"slice",
")",
":",
"start",
",",
"stop",
",",
"stride",
"=",
"idx",
".",
"indices",
"(",
"len",
"... | https://github.com/codilime/veles/blob/e65de5a7c268129acffcdb03034efd8d256d025c/python/veles/data/bindata.py#L142-L173 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py | python | Metrowerks_Shell_Suite_Events.Get_Segments | (self, _no_object=None, _attributes={}, **_arguments) | Get Segments: Returns a description of each segment in the project.
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: undocumented, typecode 'Seg ' | Get Segments: Returns a description of each segment in the project.
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: undocumented, typecode 'Seg ' | [
"Get",
"Segments",
":",
"Returns",
"a",
"description",
"of",
"each",
"segment",
"in",
"the",
"project",
".",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary",
"Returns",
":",
"undocumented",
"typecode",
"Seg"
] | def Get_Segments(self, _no_object=None, _attributes={}, **_arguments):
"""Get Segments: Returns a description of each segment in the project.
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: undocumented, typecode 'Seg '
"""
_code = 'MMPR'
_subcode =... | [
"def",
"Get_Segments",
"(",
"self",
",",
"_no_object",
"=",
"None",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'MMPR'",
"_subcode",
"=",
"'GSeg'",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No opti... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py#L277-L295 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py | python | Image.getprojection | (self) | return [i8(c) for c in x], [i8(c) for c in y] | Get projection to x and y axes
:returns: Two sequences, indicating where there are non-zero
pixels along the X-axis and the Y-axis, respectively. | Get projection to x and y axes | [
"Get",
"projection",
"to",
"x",
"and",
"y",
"axes"
] | def getprojection(self):
"""
Get projection to x and y axes
:returns: Two sequences, indicating where there are non-zero
pixels along the X-axis and the Y-axis, respectively.
"""
self.load()
x, y = self.im.getprojection()
return [i8(c) for c in x], [... | [
"def",
"getprojection",
"(",
"self",
")",
":",
"self",
".",
"load",
"(",
")",
"x",
",",
"y",
"=",
"self",
".",
"im",
".",
"getprojection",
"(",
")",
"return",
"[",
"i8",
"(",
"c",
")",
"for",
"c",
"in",
"x",
"]",
",",
"[",
"i8",
"(",
"c",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py#L1345-L1355 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/crywaflib/compile_rules_win_x64_android_arm64.py | python | load_profile_win_x64_android_arm64_settings | (conf) | Setup all compiler and linker settings shared over all win_x64_arm_linux_androideabi_4_8 configurations for
the 'profile' configuration | Setup all compiler and linker settings shared over all win_x64_arm_linux_androideabi_4_8 configurations for
the 'profile' configuration | [
"Setup",
"all",
"compiler",
"and",
"linker",
"settings",
"shared",
"over",
"all",
"win_x64_arm_linux_androideabi_4_8",
"configurations",
"for",
"the",
"profile",
"configuration"
] | def load_profile_win_x64_android_arm64_settings(conf):
"""Setup all compiler and linker settings shared over all win_x64_arm_linux_androideabi_4_8 configurations for
the 'profile' configuration
"""
v = conf.env
conf.load_win_x64_android_arm64_common_settings()
# Load addional shared settings
conf.load_profile_c... | [
"def",
"load_profile_win_x64_android_arm64_settings",
"(",
"conf",
")",
":",
"v",
"=",
"conf",
".",
"env",
"conf",
".",
"load_win_x64_android_arm64_common_settings",
"(",
")",
"# Load addional shared settings",
"conf",
".",
"load_profile_cryengine_settings",
"(",
")",
"co... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/compile_rules_win_x64_android_arm64.py#L549-L562 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/sparse/linalg/isolve/lsqr.py | python | lsqr | (A, b, damp=0.0, atol=1e-8, btol=1e-8, conlim=1e8,
iter_lim=None, show=False, calc_var=False, x0=None) | return x, istop, itn, r1norm, r2norm, anorm, acond, arnorm, xnorm, var | Find the least-squares solution to a large, sparse, linear system
of equations.
The function solves ``Ax = b`` or ``min ||b - Ax||^2`` or
``min ||Ax - b||^2 + d^2 ||x||^2``.
The matrix A may be square or rectangular (over-determined or
under-determined), and may have any rank.
::
1. ... | Find the least-squares solution to a large, sparse, linear system
of equations. | [
"Find",
"the",
"least",
"-",
"squares",
"solution",
"to",
"a",
"large",
"sparse",
"linear",
"system",
"of",
"equations",
"."
] | def lsqr(A, b, damp=0.0, atol=1e-8, btol=1e-8, conlim=1e8,
iter_lim=None, show=False, calc_var=False, x0=None):
"""Find the least-squares solution to a large, sparse, linear system
of equations.
The function solves ``Ax = b`` or ``min ||b - Ax||^2`` or
``min ||Ax - b||^2 + d^2 ||x||^2``.
... | [
"def",
"lsqr",
"(",
"A",
",",
"b",
",",
"damp",
"=",
"0.0",
",",
"atol",
"=",
"1e-8",
",",
"btol",
"=",
"1e-8",
",",
"conlim",
"=",
"1e8",
",",
"iter_lim",
"=",
"None",
",",
"show",
"=",
"False",
",",
"calc_var",
"=",
"False",
",",
"x0",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/sparse/linalg/isolve/lsqr.py#L98-L568 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | 3rdparty/protobuf-3.0.0/python/google/protobuf/descriptor_database.py | python | DescriptorDatabase.Add | (self, file_desc_proto) | Adds the FileDescriptorProto and its types to this database.
Args:
file_desc_proto: The FileDescriptorProto to add.
Raises:
DescriptorDatabaseException: if an attempt is made to add a proto
with the same name but different definition than an exisiting
proto in the database. | Adds the FileDescriptorProto and its types to this database. | [
"Adds",
"the",
"FileDescriptorProto",
"and",
"its",
"types",
"to",
"this",
"database",
"."
] | def Add(self, file_desc_proto):
"""Adds the FileDescriptorProto and its types to this database.
Args:
file_desc_proto: The FileDescriptorProto to add.
Raises:
DescriptorDatabaseException: if an attempt is made to add a proto
with the same name but different definition than an exisiting
... | [
"def",
"Add",
"(",
"self",
",",
"file_desc_proto",
")",
":",
"proto_name",
"=",
"file_desc_proto",
".",
"name",
"if",
"proto_name",
"not",
"in",
"self",
".",
"_file_desc_protos_by_file",
":",
"self",
".",
"_file_desc_protos_by_file",
"[",
"proto_name",
"]",
"=",... | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/descriptor_database.py#L51-L78 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/_extends/parse/standard_method.py | python | min | (x, axis=None, keepdims=False, initial=None, where=True) | return compile_utils.reduce_(x, P.ReduceMin(keepdims), cmp_fn=F.minimum,
axis=axis, keepdims=keepdims, initial=initial, where=where) | Returns the minimum of a tensor or minimum along an axis.
Args:
a (Tensor): Input data.
axis (None or int or tuple of ints, optional): defaults to None. Axis or
axes along which to operate. By default, flattened input is used. If
this is a tuple of ints, the minimum is selec... | Returns the minimum of a tensor or minimum along an axis. | [
"Returns",
"the",
"minimum",
"of",
"a",
"tensor",
"or",
"minimum",
"along",
"an",
"axis",
"."
] | def min(x, axis=None, keepdims=False, initial=None, where=True): # pylint: disable=redefined-builtin
"""
Returns the minimum of a tensor or minimum along an axis.
Args:
a (Tensor): Input data.
axis (None or int or tuple of ints, optional): defaults to None. Axis or
axes along wh... | [
"def",
"min",
"(",
"x",
",",
"axis",
"=",
"None",
",",
"keepdims",
"=",
"False",
",",
"initial",
"=",
"None",
",",
"where",
"=",
"True",
")",
":",
"# pylint: disable=redefined-builtin",
"return",
"compile_utils",
".",
"reduce_",
"(",
"x",
",",
"P",
".",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parse/standard_method.py#L637-L679 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distro.py | python | LinuxDistribution.lsb_release_info | (self) | return self._lsb_release_info | Return a dictionary containing key-value pairs for the information
items from the lsb_release command data source of the OS
distribution.
For details, see :func:`distro.lsb_release_info`. | Return a dictionary containing key-value pairs for the information
items from the lsb_release command data source of the OS
distribution. | [
"Return",
"a",
"dictionary",
"containing",
"key",
"-",
"value",
"pairs",
"for",
"the",
"information",
"items",
"from",
"the",
"lsb_release",
"command",
"data",
"source",
"of",
"the",
"OS",
"distribution",
"."
] | def lsb_release_info(self):
"""
Return a dictionary containing key-value pairs for the information
items from the lsb_release command data source of the OS
distribution.
For details, see :func:`distro.lsb_release_info`.
"""
return self._lsb_release_info | [
"def",
"lsb_release_info",
"(",
"self",
")",
":",
"return",
"self",
".",
"_lsb_release_info"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distro.py#L858-L866 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/ndarray/sparse.py | python | zeros | (stype, shape, ctx=None, dtype=None, **kwargs) | return _internal._zeros(shape=shape, ctx=ctx, dtype=dtype, out=out, **kwargs) | Return a new array of given shape and type, filled with zeros.
Parameters
----------
stype: string
The storage type of the empty array, such as 'row_sparse', 'csr', etc
shape : int or tuple of int
The shape of the empty array
ctx : Context, optional
An optional device contex... | Return a new array of given shape and type, filled with zeros. | [
"Return",
"a",
"new",
"array",
"of",
"given",
"shape",
"and",
"type",
"filled",
"with",
"zeros",
"."
] | def zeros(stype, shape, ctx=None, dtype=None, **kwargs):
"""Return a new array of given shape and type, filled with zeros.
Parameters
----------
stype: string
The storage type of the empty array, such as 'row_sparse', 'csr', etc
shape : int or tuple of int
The shape of the empty arr... | [
"def",
"zeros",
"(",
"stype",
",",
"shape",
",",
"ctx",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable= no-member, protected-access",
"if",
"stype",
"==",
"'default'",
":",
"return",
"_zeros_ndarray",
"(",
"shap... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/sparse.py#L1507-L1543 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py | python | TurtleScreenBase._bgcolor | (self, color=None) | Set canvas' backgroundcolor if color is not None,
else return backgroundcolor. | Set canvas' backgroundcolor if color is not None,
else return backgroundcolor. | [
"Set",
"canvas",
"backgroundcolor",
"if",
"color",
"is",
"not",
"None",
"else",
"return",
"backgroundcolor",
"."
] | def _bgcolor(self, color=None):
"""Set canvas' backgroundcolor if color is not None,
else return backgroundcolor."""
if color is not None:
self.cv.config(bg = color)
self._update()
else:
return self.cv.cget("bg") | [
"def",
"_bgcolor",
"(",
"self",
",",
"color",
"=",
"None",
")",
":",
"if",
"color",
"is",
"not",
"None",
":",
"self",
".",
"cv",
".",
"config",
"(",
"bg",
"=",
"color",
")",
"self",
".",
"_update",
"(",
")",
"else",
":",
"return",
"self",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py#L578-L585 | ||
Rid7/Table-OCR | 26814d4d4d3a2cd9f6b0155d66dd475927a23d11 | PSE/dataset/augment.py | python | DataAugment.vertical_flip | (self, im: np.ndarray, text_polys: np.ndarray) | return flip_im, flip_text_polys | 对图片和文本框进行竖直翻转
:param im: 图片
:param text_polys: 文本框
:return: 竖直翻转之后的图片和文本框 | 对图片和文本框进行竖直翻转
:param im: 图片
:param text_polys: 文本框
:return: 竖直翻转之后的图片和文本框 | [
"对图片和文本框进行竖直翻转",
":",
"param",
"im",
":",
"图片",
":",
"param",
"text_polys",
":",
"文本框",
":",
"return",
":",
"竖直翻转之后的图片和文本框"
] | def vertical_flip(self, im: np.ndarray, text_polys: np.ndarray) -> tuple:
"""
对图片和文本框进行竖直翻转
:param im: 图片
:param text_polys: 文本框
:return: 竖直翻转之后的图片和文本框
"""
flip_text_polys = text_polys.copy()
flip_im = cv2.flip(im, 0)
h, w, _ = flip_im.shape
... | [
"def",
"vertical_flip",
"(",
"self",
",",
"im",
":",
"np",
".",
"ndarray",
",",
"text_polys",
":",
"np",
".",
"ndarray",
")",
"->",
"tuple",
":",
"flip_text_polys",
"=",
"text_polys",
".",
"copy",
"(",
")",
"flip_im",
"=",
"cv2",
".",
"flip",
"(",
"i... | https://github.com/Rid7/Table-OCR/blob/26814d4d4d3a2cd9f6b0155d66dd475927a23d11/PSE/dataset/augment.py#L314-L325 | |
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | python/lammps/core.py | python | lammps.extract_fix | (self,fid,fstyle,ftype,nrow=0,ncol=0) | Retrieve data from a LAMMPS fix
This is a wrapper around the :cpp:func:`lammps_extract_fix`
function of the C-library interface.
This function returns ``None`` if either the fix id is not
recognized, or an invalid combination of :ref:`fstyle <py_style_constants>`
and :ref:`ftype <py_type_constants>... | Retrieve data from a LAMMPS fix | [
"Retrieve",
"data",
"from",
"a",
"LAMMPS",
"fix"
] | def extract_fix(self,fid,fstyle,ftype,nrow=0,ncol=0):
"""Retrieve data from a LAMMPS fix
This is a wrapper around the :cpp:func:`lammps_extract_fix`
function of the C-library interface.
This function returns ``None`` if either the fix id is not
recognized, or an invalid combination of :ref:`fstyle ... | [
"def",
"extract_fix",
"(",
"self",
",",
"fid",
",",
"fstyle",
",",
"ftype",
",",
"nrow",
"=",
"0",
",",
"ncol",
"=",
"0",
")",
":",
"if",
"fid",
":",
"fid",
"=",
"fid",
".",
"encode",
"(",
")",
"else",
":",
"return",
"None",
"if",
"fstyle",
"==... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/python/lammps/core.py#L985-L1063 | ||
HANDS-FREE/handsfree | 3766907a44d46828cc9de462c1126ceeb8e14061 | handsfree_tutorials/script/2_base_control/linear_move.py | python | LinearMove.__get_robot_pos | (self) | return geometry_msgs.msg.Point(*trans) | to get current position(x,y,z) of robot
:return: A geometry_msgs.msg.Point type store robot's position (x,y,z) | to get current position(x,y,z) of robot
:return: A geometry_msgs.msg.Point type store robot's position (x,y,z) | [
"to",
"get",
"current",
"position",
"(",
"x",
"y",
"z",
")",
"of",
"robot",
":",
"return",
":",
"A",
"geometry_msgs",
".",
"msg",
".",
"Point",
"type",
"store",
"robot",
"s",
"position",
"(",
"x",
"y",
"z",
")"
] | def __get_robot_pos(self):
"""
to get current position(x,y,z) of robot
:return: A geometry_msgs.msg.Point type store robot's position (x,y,z)
"""
try:
(trans, rot) = self.tf_listener.lookupTransform(self.frame_odom,
... | [
"def",
"__get_robot_pos",
"(",
"self",
")",
":",
"try",
":",
"(",
"trans",
",",
"rot",
")",
"=",
"self",
".",
"tf_listener",
".",
"lookupTransform",
"(",
"self",
".",
"frame_odom",
",",
"self",
".",
"frame_base",
",",
"rospy",
".",
"Time",
"(",
"0",
... | https://github.com/HANDS-FREE/handsfree/blob/3766907a44d46828cc9de462c1126ceeb8e14061/handsfree_tutorials/script/2_base_control/linear_move.py#L75-L87 | |
continental/ecal | 204dab80a24fe01abca62541133b311bf0c09608 | lang/python/core/ecal/core/service.py | python | Server.destroy | (self) | return ecal_core.server_destroy(self.shandle) | destroy server | destroy server | [
"destroy",
"server"
] | def destroy(self):
""" destroy server
"""
return ecal_core.server_destroy(self.shandle) | [
"def",
"destroy",
"(",
"self",
")",
":",
"return",
"ecal_core",
".",
"server_destroy",
"(",
"self",
".",
"shandle",
")"
] | https://github.com/continental/ecal/blob/204dab80a24fe01abca62541133b311bf0c09608/lang/python/core/ecal/core/service.py#L38-L41 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.