nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/hsadrv/devicearray.py | python | DeviceNDArray.reshape | (self, *newshape, **kws) | Reshape the array without changing its contents, similarly to
:meth:`numpy.ndarray.reshape`. Example::
d_arr = d_arr.reshape(20, 50, order='F') | Reshape the array without changing its contents, similarly to
:meth:`numpy.ndarray.reshape`. Example:: | [
"Reshape",
"the",
"array",
"without",
"changing",
"its",
"contents",
"similarly",
"to",
":",
"meth",
":",
"numpy",
".",
"ndarray",
".",
"reshape",
".",
"Example",
"::"
] | def reshape(self, *newshape, **kws):
"""
Reshape the array without changing its contents, similarly to
:meth:`numpy.ndarray.reshape`. Example::
d_arr = d_arr.reshape(20, 50, order='F')
"""
if len(newshape) == 1 and isinstance(newshape[0], (tuple, list)):
... | [
"def",
"reshape",
"(",
"self",
",",
"*",
"newshape",
",",
"*",
"*",
"kws",
")",
":",
"if",
"len",
"(",
"newshape",
")",
"==",
"1",
"and",
"isinstance",
"(",
"newshape",
"[",
"0",
"]",
",",
"(",
"tuple",
",",
"list",
")",
")",
":",
"newshape",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/hsadrv/devicearray.py#L268-L290 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | python | PBXProject.RootGroupsTakeOverOnlyChildren | (self, recurse=False) | Calls TakeOverOnlyChild for all groups in the main group. | Calls TakeOverOnlyChild for all groups in the main group. | [
"Calls",
"TakeOverOnlyChild",
"for",
"all",
"groups",
"in",
"the",
"main",
"group",
"."
] | def RootGroupsTakeOverOnlyChildren(self, recurse=False):
"""Calls TakeOverOnlyChild for all groups in the main group."""
for group in self._properties["mainGroup"]._properties["children"]:
if isinstance(group, PBXGroup):
group.TakeOverOnlyChild(recurse) | [
"def",
"RootGroupsTakeOverOnlyChildren",
"(",
"self",
",",
"recurse",
"=",
"False",
")",
":",
"for",
"group",
"in",
"self",
".",
"_properties",
"[",
"\"mainGroup\"",
"]",
".",
"_properties",
"[",
"\"children\"",
"]",
":",
"if",
"isinstance",
"(",
"group",
",... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py#L2886-L2891 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Source/bindings/scripts/v8_utilities.py | python | ExposureSet.issubset | (self, other) | return self_set.issubset(other_set) | Returns true if |self|'s exposure set is a subset of
|other|'s exposure set. This function doesn't care about
RuntimeEnabled. | Returns true if |self|'s exposure set is a subset of
|other|'s exposure set. This function doesn't care about
RuntimeEnabled. | [
"Returns",
"true",
"if",
"|self|",
"s",
"exposure",
"set",
"is",
"a",
"subset",
"of",
"|other|",
"s",
"exposure",
"set",
".",
"This",
"function",
"doesn",
"t",
"care",
"about",
"RuntimeEnabled",
"."
] | def issubset(self, other):
"""Returns true if |self|'s exposure set is a subset of
|other|'s exposure set. This function doesn't care about
RuntimeEnabled."""
self_set = self._extended(set(e.exposed for e in self.exposures))
other_set = self._extended(set(e.exposed for e in other... | [
"def",
"issubset",
"(",
"self",
",",
"other",
")",
":",
"self_set",
"=",
"self",
".",
"_extended",
"(",
"set",
"(",
"e",
".",
"exposed",
"for",
"e",
"in",
"self",
".",
"exposures",
")",
")",
"other_set",
"=",
"self",
".",
"_extended",
"(",
"set",
"... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Source/bindings/scripts/v8_utilities.py#L267-L273 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py | python | CheckpointSaver.__init__ | (self,
checkpoint_dir,
save_secs=None,
save_steps=None,
saver=None,
checkpoint_basename="model.ckpt",
scaffold=None) | Initialize CheckpointSaver monitor.
Args:
checkpoint_dir: `str`, base directory for the checkpoint files.
save_secs: `int`, save every N secs.
save_steps: `int`, save every N steps.
saver: `Saver` object, used for saving.
checkpoint_basename: `str`, base name for the checkpoint files.... | Initialize CheckpointSaver monitor. | [
"Initialize",
"CheckpointSaver",
"monitor",
"."
] | def __init__(self,
checkpoint_dir,
save_secs=None,
save_steps=None,
saver=None,
checkpoint_basename="model.ckpt",
scaffold=None):
"""Initialize CheckpointSaver monitor.
Args:
checkpoint_dir: `str`, base directory fo... | [
"def",
"__init__",
"(",
"self",
",",
"checkpoint_dir",
",",
"save_secs",
"=",
"None",
",",
"save_steps",
"=",
"None",
",",
"saver",
"=",
"None",
",",
"checkpoint_basename",
"=",
"\"model.ckpt\"",
",",
"scaffold",
"=",
"None",
")",
":",
"logging",
".",
"inf... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py#L938-L974 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/py3compat.py | python | get_meth_func | (obj) | Return method function object | Return method function object | [
"Return",
"method",
"function",
"object"
] | def get_meth_func(obj):
"""Return method function object"""
if PY2:
# Python 2
return obj.im_func
else:
# Python 3
return obj.__func__ | [
"def",
"get_meth_func",
"(",
"obj",
")",
":",
"if",
"PY2",
":",
"# Python 2",
"return",
"obj",
".",
"im_func",
"else",
":",
"# Python 3",
"return",
"obj",
".",
"__func__"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/py3compat.py#L178-L185 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Text.mark_unset | (self, *markNames) | Delete all marks in MARKNAMES. | Delete all marks in MARKNAMES. | [
"Delete",
"all",
"marks",
"in",
"MARKNAMES",
"."
] | def mark_unset(self, *markNames):
"""Delete all marks in MARKNAMES."""
self.tk.call((self._w, 'mark', 'unset') + markNames) | [
"def",
"mark_unset",
"(",
"self",
",",
"*",
"markNames",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"(",
"self",
".",
"_w",
",",
"'mark'",
",",
"'unset'",
")",
"+",
"markNames",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3061-L3063 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/asyncio/sslproto.py | python | SSLProtocol.connection_lost | (self, exc) | Called when the low-level connection is lost or closed.
The argument is an exception object or None (the latter
meaning a regular EOF is received or the connection was
aborted or closed). | Called when the low-level connection is lost or closed. | [
"Called",
"when",
"the",
"low",
"-",
"level",
"connection",
"is",
"lost",
"or",
"closed",
"."
] | def connection_lost(self, exc):
"""Called when the low-level connection is lost or closed.
The argument is an exception object or None (the latter
meaning a regular EOF is received or the connection was
aborted or closed).
"""
if self._session_established:
se... | [
"def",
"connection_lost",
"(",
"self",
",",
"exc",
")",
":",
"if",
"self",
".",
"_session_established",
":",
"self",
".",
"_session_established",
"=",
"False",
"self",
".",
"_loop",
".",
"call_soon",
"(",
"self",
".",
"_app_protocol",
".",
"connection_lost",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/sslproto.py#L484-L506 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.IndicatorSetUnder | (*args, **kwargs) | return _stc.StyledTextCtrl_IndicatorSetUnder(*args, **kwargs) | IndicatorSetUnder(self, int indic, bool under)
Set an indicator to draw under text or over(default). | IndicatorSetUnder(self, int indic, bool under) | [
"IndicatorSetUnder",
"(",
"self",
"int",
"indic",
"bool",
"under",
")"
] | def IndicatorSetUnder(*args, **kwargs):
"""
IndicatorSetUnder(self, int indic, bool under)
Set an indicator to draw under text or over(default).
"""
return _stc.StyledTextCtrl_IndicatorSetUnder(*args, **kwargs) | [
"def",
"IndicatorSetUnder",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_IndicatorSetUnder",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L2897-L2903 | |
BVLC/caffe | 9b891540183ddc834a02b2bd81b31afae71b2153 | python/caffe/coord_map.py | python | crop_params | (fn) | return (axis, offset) | Extract the crop layer parameters with defaults. | Extract the crop layer parameters with defaults. | [
"Extract",
"the",
"crop",
"layer",
"parameters",
"with",
"defaults",
"."
] | def crop_params(fn):
"""
Extract the crop layer parameters with defaults.
"""
params = fn.params.get('crop_param', fn.params)
axis = params.get('axis', 2) # default to spatial crop for N, C, H, W
offset = np.array(params.get('offset', 0), ndmin=1)
return (axis, offset) | [
"def",
"crop_params",
"(",
"fn",
")",
":",
"params",
"=",
"fn",
".",
"params",
".",
"get",
"(",
"'crop_param'",
",",
"fn",
".",
"params",
")",
"axis",
"=",
"params",
".",
"get",
"(",
"'axis'",
",",
"2",
")",
"# default to spatial crop for N, C, H, W",
"o... | https://github.com/BVLC/caffe/blob/9b891540183ddc834a02b2bd81b31afae71b2153/python/caffe/coord_map.py#L40-L47 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | TypeHandler.WriteCmdSizeTest | (self, func, file) | Writes the size test for a command. | Writes the size test for a command. | [
"Writes",
"the",
"size",
"test",
"for",
"a",
"command",
"."
] | def WriteCmdSizeTest(self, func, file):
"""Writes the size test for a command."""
file.Write(" EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);\n") | [
"def",
"WriteCmdSizeTest",
"(",
"self",
",",
"func",
",",
"file",
")",
":",
"file",
".",
"Write",
"(",
"\" EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);\\n\"",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L1945-L1947 | ||
hszhao/PSPNet | cf7e5a99ba37e46118026e96be5821a9bc63bde0 | scripts/cpp_lint.py | python | CheckEmptyBlockBody | (filename, clean_lines, linenum, error) | Look for empty loop/conditional body with only a single semicolon.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Look for empty loop/conditional body with only a single semicolon. | [
"Look",
"for",
"empty",
"loop",
"/",
"conditional",
"body",
"with",
"only",
"a",
"single",
"semicolon",
"."
] | def CheckEmptyBlockBody(filename, clean_lines, linenum, error):
"""Look for empty loop/conditional body with only a single semicolon.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The functio... | [
"def",
"CheckEmptyBlockBody",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"# Search for loop keywords at the beginning of the line. Because only",
"# whitespaces are allowed before the keywords, this will also ignore most",
"# do-while-loops, since those... | https://github.com/hszhao/PSPNet/blob/cf7e5a99ba37e46118026e96be5821a9bc63bde0/scripts/cpp_lint.py#L3243-L3275 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/stats/mstats_basic.py | python | ttest_ind | (a, b, axis=0, equal_var=True) | return Ttest_indResult(t, probs.squeeze()) | Calculates the T-test for the means of TWO INDEPENDENT samples of scores.
Parameters
----------
a, b : array_like
The arrays must have the same shape, except in the dimension
corresponding to `axis` (the first, by default).
axis : int or None, optional
Axis along which to comput... | Calculates the T-test for the means of TWO INDEPENDENT samples of scores. | [
"Calculates",
"the",
"T",
"-",
"test",
"for",
"the",
"means",
"of",
"TWO",
"INDEPENDENT",
"samples",
"of",
"scores",
"."
] | def ttest_ind(a, b, axis=0, equal_var=True):
"""
Calculates the T-test for the means of TWO INDEPENDENT samples of scores.
Parameters
----------
a, b : array_like
The arrays must have the same shape, except in the dimension
corresponding to `axis` (the first, by default).
axis :... | [
"def",
"ttest_ind",
"(",
"a",
",",
"b",
",",
"axis",
"=",
"0",
",",
"equal_var",
"=",
"True",
")",
":",
"a",
",",
"b",
",",
"axis",
"=",
"_chk2_asarray",
"(",
"a",
",",
"b",
",",
"axis",
")",
"if",
"a",
".",
"size",
"==",
"0",
"or",
"b",
".... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/mstats_basic.py#L1018-L1079 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | PyControl.DoSetSize | (*args, **kwargs) | return _controls_.PyControl_DoSetSize(*args, **kwargs) | DoSetSize(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) | DoSetSize(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) | [
"DoSetSize",
"(",
"self",
"int",
"x",
"int",
"y",
"int",
"width",
"int",
"height",
"int",
"sizeFlags",
"=",
"SIZE_AUTO",
")"
] | def DoSetSize(*args, **kwargs):
"""DoSetSize(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)"""
return _controls_.PyControl_DoSetSize(*args, **kwargs) | [
"def",
"DoSetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"PyControl_DoSetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L5846-L5848 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/generator/make.py | python | WriteAutoRegenerationRule | (params, root_makefile, makefile_name,
build_files) | Write the target to regenerate the Makefile. | Write the target to regenerate the Makefile. | [
"Write",
"the",
"target",
"to",
"regenerate",
"the",
"Makefile",
"."
] | def WriteAutoRegenerationRule(params, root_makefile, makefile_name,
build_files):
"""Write the target to regenerate the Makefile."""
options = params['options']
build_files_args = [gyp.common.RelativePath(filename, options.toplevel_dir)
for filename in params['b... | [
"def",
"WriteAutoRegenerationRule",
"(",
"params",
",",
"root_makefile",
",",
"makefile_name",
",",
"build_files",
")",
":",
"options",
"=",
"params",
"[",
"'options'",
"]",
"build_files_args",
"=",
"[",
"gyp",
".",
"common",
".",
"RelativePath",
"(",
"filename"... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/generator/make.py#L1962-L1984 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/ma/extras.py | python | issequence | (seq) | return isinstance(seq, (ndarray, tuple, list)) | Is seq a sequence (ndarray, list or tuple)? | Is seq a sequence (ndarray, list or tuple)? | [
"Is",
"seq",
"a",
"sequence",
"(",
"ndarray",
"list",
"or",
"tuple",
")",
"?"
] | def issequence(seq):
"""
Is seq a sequence (ndarray, list or tuple)?
"""
return isinstance(seq, (ndarray, tuple, list)) | [
"def",
"issequence",
"(",
"seq",
")",
":",
"return",
"isinstance",
"(",
"seq",
",",
"(",
"ndarray",
",",
"tuple",
",",
"list",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/extras.py#L45-L50 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/extras/codelite.py | python | vsnode.get_waf | (self) | return '%s/%s' % (self.ctx.srcnode.abspath(), getattr(self.ctx, 'waf_command', 'waf')) | Override in subclasses... | Override in subclasses... | [
"Override",
"in",
"subclasses",
"..."
] | def get_waf(self):
"""
Override in subclasses...
"""
return '%s/%s' % (self.ctx.srcnode.abspath(), getattr(self.ctx, 'waf_command', 'waf')) | [
"def",
"get_waf",
"(",
"self",
")",
":",
"return",
"'%s/%s'",
"%",
"(",
"self",
".",
"ctx",
".",
"srcnode",
".",
"abspath",
"(",
")",
",",
"getattr",
"(",
"self",
".",
"ctx",
",",
"'waf_command'",
",",
"'waf'",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/extras/codelite.py#L402-L406 | |
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | com/win32com/server/register.py | python | GetUnregisterServerKeys | (clsid, progID=None, verProgID=None, customKeys=None) | return ret | Given a server, return a list of of ("key", root), which are keys recursively
and uncondtionally deleted at unregister or uninstall time. | Given a server, return a list of of ("key", root), which are keys recursively
and uncondtionally deleted at unregister or uninstall time. | [
"Given",
"a",
"server",
"return",
"a",
"list",
"of",
"of",
"(",
"key",
"root",
")",
"which",
"are",
"keys",
"recursively",
"and",
"uncondtionally",
"deleted",
"at",
"unregister",
"or",
"uninstall",
"time",
"."
] | def GetUnregisterServerKeys(clsid, progID=None, verProgID=None, customKeys=None):
"""Given a server, return a list of of ("key", root), which are keys recursively
and uncondtionally deleted at unregister or uninstall time.
"""
# remove the main CLSID registration
ret = [("CLSID\\%s" % str(clsid), wi... | [
"def",
"GetUnregisterServerKeys",
"(",
"clsid",
",",
"progID",
"=",
"None",
",",
"verProgID",
"=",
"None",
",",
"customKeys",
"=",
"None",
")",
":",
"# remove the main CLSID registration",
"ret",
"=",
"[",
"(",
"\"CLSID\\\\%s\"",
"%",
"str",
"(",
"clsid",
")",... | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32com/server/register.py#L337-L357 | |
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/jedi/jedi/api_classes.py | python | CallDef.call_name | (self) | return unicode(self._executable.name) | The name (e.g. 'isinstance') as a string. | The name (e.g. 'isinstance') as a string. | [
"The",
"name",
"(",
"e",
".",
"g",
".",
"isinstance",
")",
"as",
"a",
"string",
"."
] | def call_name(self):
""" The name (e.g. 'isinstance') as a string. """
return unicode(self._executable.name) | [
"def",
"call_name",
"(",
"self",
")",
":",
"return",
"unicode",
"(",
"self",
".",
"_executable",
".",
"name",
")"
] | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/jedi/jedi/api_classes.py#L622-L624 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/collective_all_reduce_strategy.py | python | CollectiveAllReduceExtended._use_merge_call | (self) | return True | XLA is not supported for multi-worker strategy. | XLA is not supported for multi-worker strategy. | [
"XLA",
"is",
"not",
"supported",
"for",
"multi",
"-",
"worker",
"strategy",
"."
] | def _use_merge_call(self):
"""XLA is not supported for multi-worker strategy."""
return True | [
"def",
"_use_merge_call",
"(",
"self",
")",
":",
"return",
"True"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/collective_all_reduce_strategy.py#L335-L337 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/easy_install.py | python | CommandSpec.from_param | (cls, param) | return cls.from_string(param) | Construct a CommandSpec from a parameter to build_scripts, which may
be None. | Construct a CommandSpec from a parameter to build_scripts, which may
be None. | [
"Construct",
"a",
"CommandSpec",
"from",
"a",
"parameter",
"to",
"build_scripts",
"which",
"may",
"be",
"None",
"."
] | def from_param(cls, param):
"""
Construct a CommandSpec from a parameter to build_scripts, which may
be None.
"""
if isinstance(param, cls):
return param
if isinstance(param, list):
return cls(param)
if param is None:
return cls... | [
"def",
"from_param",
"(",
"cls",
",",
"param",
")",
":",
"if",
"isinstance",
"(",
"param",
",",
"cls",
")",
":",
"return",
"param",
"if",
"isinstance",
"(",
"param",
",",
"list",
")",
":",
"return",
"cls",
"(",
"param",
")",
"if",
"param",
"is",
"N... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/easy_install.py#L1999-L2011 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/sparse_ops.py | python | sparse_to_indicator | (sp_input, vocab_size, name=None) | Converts a `SparseTensor` of ids into a dense bool indicator tensor.
The last dimension of `sp_input.indices` is discarded and replaced with
the values of `sp_input`. If `sp_input.dense_shape = [D0, D1, ..., Dn, K]`,
then `output.shape = [D0, D1, ..., Dn, vocab_size]`, where
output[d_0, d_1, ..., d_n, sp... | Converts a `SparseTensor` of ids into a dense bool indicator tensor. | [
"Converts",
"a",
"SparseTensor",
"of",
"ids",
"into",
"a",
"dense",
"bool",
"indicator",
"tensor",
"."
] | def sparse_to_indicator(sp_input, vocab_size, name=None):
"""Converts a `SparseTensor` of ids into a dense bool indicator tensor.
The last dimension of `sp_input.indices` is discarded and replaced with
the values of `sp_input`. If `sp_input.dense_shape = [D0, D1, ..., Dn, K]`,
then `output.shape = [D0, D1, ..... | [
"def",
"sparse_to_indicator",
"(",
"sp_input",
",",
"vocab_size",
",",
"name",
"=",
"None",
")",
":",
"sp_input",
"=",
"_convert_to_sparse_tensor",
"(",
"sp_input",
")",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"SparseToIndicator\"",
",",
"[",
"sp... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/sparse_ops.py#L979-L1038 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/groupby/groupby.py | python | GroupBy.size | (self) | return self._reindex_output(result, fill_value=0) | Compute group sizes.
Returns
-------
Series
Number of rows in each group. | Compute group sizes. | [
"Compute",
"group",
"sizes",
"."
] | def size(self):
"""
Compute group sizes.
Returns
-------
Series
Number of rows in each group.
"""
result = self.grouper.size()
if isinstance(self.obj, Series):
result.name = self.obj.name
return self._reindex_output(result... | [
"def",
"size",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"grouper",
".",
"size",
"(",
")",
"if",
"isinstance",
"(",
"self",
".",
"obj",
",",
"Series",
")",
":",
"result",
".",
"name",
"=",
"self",
".",
"obj",
".",
"name",
"return",
"self... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/groupby/groupby.py#L1320-L1333 | |
intel/ros_object_analytics | eb0208edbb6da67e5d5c4092fd2964a2c8d9838e | object_analytics_visualization/scripts/image_publisher.py | python | SynchronizedSubscriber._draw_measures | (self, cv_image) | Draw measure result on the left up | Draw measure result on the left up | [
"Draw",
"measure",
"result",
"on",
"the",
"left",
"up"
] | def _draw_measures(self, cv_image):
"""Draw measure result on the left up"""
text = "\n".join(" ".join((str(m) for m in self._measures)))
for idx, m in enumerate(self._measures):
cv2.putText(cv_image, str(m), (2, 15+idx*15), ObjectItem.FONT,
ObjectItem.FONT_SI... | [
"def",
"_draw_measures",
"(",
"self",
",",
"cv_image",
")",
":",
"text",
"=",
"\"\\n\"",
".",
"join",
"(",
"\" \"",
".",
"join",
"(",
"(",
"str",
"(",
"m",
")",
"for",
"m",
"in",
"self",
".",
"_measures",
")",
")",
")",
"for",
"idx",
",",
"m",
... | https://github.com/intel/ros_object_analytics/blob/eb0208edbb6da67e5d5c4092fd2964a2c8d9838e/object_analytics_visualization/scripts/image_publisher.py#L198-L203 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/platform.py | python | python_version | () | return _sys_version()[1] | Returns the Python version as string 'major.minor.patchlevel'
Note that unlike the Python sys.version, the returned value
will always include the patchlevel (it defaults to 0). | Returns the Python version as string 'major.minor.patchlevel' | [
"Returns",
"the",
"Python",
"version",
"as",
"string",
"major",
".",
"minor",
".",
"patchlevel"
] | def python_version():
""" Returns the Python version as string 'major.minor.patchlevel'
Note that unlike the Python sys.version, the returned value
will always include the patchlevel (it defaults to 0).
"""
return _sys_version()[1] | [
"def",
"python_version",
"(",
")",
":",
"return",
"_sys_version",
"(",
")",
"[",
"1",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/platform.py#L1266-L1274 | |
weichengkuo/DeepBox | c4f8c065b6a51cf296540cc453a44f0519aaacc9 | caffe-fast-rcnn/scripts/cpp_lint.py | python | CheckStyle | (filename, clean_lines, linenum, file_extension, nesting_state,
error) | Checks rules from the 'C++ style rules' section of cppguide.html.
Most of these rules are hard to test (naming, comment style), but we
do what we can. In particular we check for 2-space indents, line lengths,
tab usage, spaces inside code, etc.
Args:
filename: The name of the current file.
clean_line... | Checks rules from the 'C++ style rules' section of cppguide.html. | [
"Checks",
"rules",
"from",
"the",
"C",
"++",
"style",
"rules",
"section",
"of",
"cppguide",
".",
"html",
"."
] | def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
error):
"""Checks rules from the 'C++ style rules' section of cppguide.html.
Most of these rules are hard to test (naming, comment style), but we
do what we can. In particular we check for 2-space indents, line lengths,... | [
"def",
"CheckStyle",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"file_extension",
",",
"nesting_state",
",",
"error",
")",
":",
"# Don't use \"elided\" lines here, otherwise we can't check commented lines.",
"# Don't want to use \"raw\" either, because we don't want ... | https://github.com/weichengkuo/DeepBox/blob/c4f8c065b6a51cf296540cc453a44f0519aaacc9/caffe-fast-rcnn/scripts/cpp_lint.py#L3459-L3563 | ||
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/generator.py | python | NativeClass.static_methods_clean | (self) | return ret | clean list of static methods (without the ones that should be skipped) | clean list of static methods (without the ones that should be skipped) | [
"clean",
"list",
"of",
"static",
"methods",
"(",
"without",
"the",
"ones",
"that",
"should",
"be",
"skipped",
")"
] | def static_methods_clean(self):
'''
clean list of static methods (without the ones that should be skipped)
'''
ret = []
for name, impl in self.static_methods.iteritems():
should_skip = self.generator.should_skip(self.class_name, name)
if not should_skip:
... | [
"def",
"static_methods_clean",
"(",
"self",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"name",
",",
"impl",
"in",
"self",
".",
"static_methods",
".",
"iteritems",
"(",
")",
":",
"should_skip",
"=",
"self",
".",
"generator",
".",
"should_skip",
"(",
"self",
... | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/generator.py#L769-L778 | |
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/universe_generation/galaxy.py | python | enforce_max_distance | (positions, adjacency_grid) | Adds extra positions between groups of positions to guarantee
that no groups of positions are separated from all other groups
of positions by more than universe_tables.MAX_STARLANE_LENGTH
Find all groups of positions, where every member is within
MAX_STARLANE_LENGTH of at least one other member of the ... | Adds extra positions between groups of positions to guarantee
that no groups of positions are separated from all other groups
of positions by more than universe_tables.MAX_STARLANE_LENGTH | [
"Adds",
"extra",
"positions",
"between",
"groups",
"of",
"positions",
"to",
"guarantee",
"that",
"no",
"groups",
"of",
"positions",
"are",
"separated",
"from",
"all",
"other",
"groups",
"of",
"positions",
"by",
"more",
"than",
"universe_tables",
".",
"MAX_STARLA... | def enforce_max_distance(positions, adjacency_grid):
"""
Adds extra positions between groups of positions to guarantee
that no groups of positions are separated from all other groups
of positions by more than universe_tables.MAX_STARLANE_LENGTH
Find all groups of positions, where every member is wi... | [
"def",
"enforce_max_distance",
"(",
"positions",
",",
"adjacency_grid",
")",
":",
"# Find all clusters",
"clusterer",
"=",
"Clusterer",
"(",
"positions",
",",
"adjacency_grid",
")",
"if",
"len",
"(",
"clusterer",
")",
"==",
"1",
":",
"print",
"(",
"\"All systems... | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/universe_generation/galaxy.py#L329-L393 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintsmolecule.py | python | LibmintsMolecule.__init__ | (self) | Initialize Molecule object from string in psi4 format | Initialize Molecule object from string in psi4 format | [
"Initialize",
"Molecule",
"object",
"from",
"string",
"in",
"psi4",
"format"
] | def __init__(self):
"""Initialize Molecule object from string in psi4 format"""
# <<< Basic Molecule Information >>>
# Molecule (or fragment) name
self.PYname = 'default'
# Molecule comment
self.PYcomment = ''
# Molecule origin
self.PYprovenance = []
... | [
"def",
"__init__",
"(",
"self",
")",
":",
"# <<< Basic Molecule Information >>>",
"# Molecule (or fragment) name",
"self",
".",
"PYname",
"=",
"'default'",
"# Molecule comment",
"self",
".",
"PYcomment",
"=",
"''",
"# Molecule origin",
"self",
".",
"PYprovenance",
"=",
... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintsmolecule.py#L83-L163 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/dockart.py | python | ModernDockArt.DrawPaneButton | (self, dc, window, button, button_state, rect, pane) | Draws a pane button in the pane caption area.
:param `dc`: a :class:`DC` device context;
:param `window`: an instance of :class:`Window`;
:param integer `button`: the button to be drawn;
:param integer `button_state`: the pane button state;
:param Rect `rect`: the pane caption r... | Draws a pane button in the pane caption area. | [
"Draws",
"a",
"pane",
"button",
"in",
"the",
"pane",
"caption",
"area",
"."
] | def DrawPaneButton(self, dc, window, button, button_state, rect, pane):
"""
Draws a pane button in the pane caption area.
:param `dc`: a :class:`DC` device context;
:param `window`: an instance of :class:`Window`;
:param integer `button`: the button to be drawn;
:param i... | [
"def",
"DrawPaneButton",
"(",
"self",
",",
"dc",
",",
"window",
",",
"button",
",",
"button_state",
",",
"rect",
",",
"pane",
")",
":",
"if",
"self",
".",
"usingTheme",
":",
"hTheme",
"=",
"self",
".",
"hTheme1",
"# Get the real button position (compensating f... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/dockart.py#L1101-L1186 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/distribute_coordinator.py | python | _WorkerContext.__init__ | (self,
strategy,
cluster_spec,
task_type,
task_id,
session_config=None,
rpc_layer="grpc",
worker_barrier=None) | Initialize the worker context object.
Args:
strategy: a `DistributionStrategy` object.
cluster_spec: a ClusterSpec object. It can be empty or None in the local
training case.
task_type: a string indicating the role of the corresponding task, such as
"worker" or "ps". It can be Non... | Initialize the worker context object. | [
"Initialize",
"the",
"worker",
"context",
"object",
"."
] | def __init__(self,
strategy,
cluster_spec,
task_type,
task_id,
session_config=None,
rpc_layer="grpc",
worker_barrier=None):
"""Initialize the worker context object.
Args:
strategy: a `DistributionStra... | [
"def",
"__init__",
"(",
"self",
",",
"strategy",
",",
"cluster_spec",
",",
"task_type",
",",
"task_id",
",",
"session_config",
"=",
"None",
",",
"rpc_layer",
"=",
"\"grpc\"",
",",
"worker_barrier",
"=",
"None",
")",
":",
"self",
".",
"_strategy",
"=",
"str... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/distribute_coordinator.py#L112-L146 | ||
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.data | (self) | return self.dispatcher._checkResultString(
Indigo._lib.indigoData(self.id)
) | Data s-group method returns data
Returns:
str: s-group data | Data s-group method returns data | [
"Data",
"s",
"-",
"group",
"method",
"returns",
"data"
] | def data(self):
"""Data s-group method returns data
Returns:
str: s-group data
"""
self.dispatcher._setSessionId()
return self.dispatcher._checkResultString(
Indigo._lib.indigoData(self.id)
) | [
"def",
"data",
"(",
"self",
")",
":",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"return",
"self",
".",
"dispatcher",
".",
"_checkResultString",
"(",
"Indigo",
".",
"_lib",
".",
"indigoData",
"(",
"self",
".",
"id",
")",
")"
] | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L1554-L1563 | |
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/internal/well_known_types.py | python | Timestamp.GetCurrentTime | (self) | Get the current UTC into Timestamp. | Get the current UTC into Timestamp. | [
"Get",
"the",
"current",
"UTC",
"into",
"Timestamp",
"."
] | def GetCurrentTime(self):
"""Get the current UTC into Timestamp."""
self.FromDatetime(datetime.utcnow()) | [
"def",
"GetCurrentTime",
"(",
"self",
")",
":",
"self",
".",
"FromDatetime",
"(",
"datetime",
".",
"utcnow",
"(",
")",
")"
] | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/internal/well_known_types.py#L184-L186 | ||
google/nucleus | 68d3947fafba1337f294c0668a6e1c7f3f1273e3 | nucleus/io/tfrecord.py | python | read_tfrecords | (path, proto=None, max_records=None, compression_type=None) | Yields the parsed records in a TFRecord file path.
Note that path can be sharded filespec (path@N) in which case this function
will read each shard in order; i.e. shard 0 will read each entry in order,
then shard 1, ...
Args:
path: String. A path to a TFRecord file containing protos.
proto: A proto cl... | Yields the parsed records in a TFRecord file path. | [
"Yields",
"the",
"parsed",
"records",
"in",
"a",
"TFRecord",
"file",
"path",
"."
] | def read_tfrecords(path, proto=None, max_records=None, compression_type=None):
"""Yields the parsed records in a TFRecord file path.
Note that path can be sharded filespec (path@N) in which case this function
will read each shard in order; i.e. shard 0 will read each entry in order,
then shard 1, ...
Args:
... | [
"def",
"read_tfrecords",
"(",
"path",
",",
"proto",
"=",
"None",
",",
"max_records",
"=",
"None",
",",
"compression_type",
"=",
"None",
")",
":",
"if",
"sharded_file_utils",
".",
"is_sharded_file_spec",
"(",
"path",
")",
":",
"paths",
"=",
"sharded_file_utils"... | https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/io/tfrecord.py#L56-L87 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/uuid.py | python | UUID.__init__ | (self, hex=None, bytes=None, bytes_le=None, fields=None,
int=None, version=None,
*, is_safe=SafeUUID.unknown) | r"""Create a UUID from either a string of 32 hexadecimal digits,
a string of 16 bytes as the 'bytes' argument, a string of 16 bytes
in little-endian order as the 'bytes_le' argument, a tuple of six
integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version,
8-bit clock_seq_hi_var... | r"""Create a UUID from either a string of 32 hexadecimal digits,
a string of 16 bytes as the 'bytes' argument, a string of 16 bytes
in little-endian order as the 'bytes_le' argument, a tuple of six
integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version,
8-bit clock_seq_hi_var... | [
"r",
"Create",
"a",
"UUID",
"from",
"either",
"a",
"string",
"of",
"32",
"hexadecimal",
"digits",
"a",
"string",
"of",
"16",
"bytes",
"as",
"the",
"bytes",
"argument",
"a",
"string",
"of",
"16",
"bytes",
"in",
"little",
"-",
"endian",
"order",
"as",
"t... | def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None,
int=None, version=None,
*, is_safe=SafeUUID.unknown):
r"""Create a UUID from either a string of 32 hexadecimal digits,
a string of 16 bytes as the 'bytes' argument, a string of 16 bytes
... | [
"def",
"__init__",
"(",
"self",
",",
"hex",
"=",
"None",
",",
"bytes",
"=",
"None",
",",
"bytes_le",
"=",
"None",
",",
"fields",
"=",
"None",
",",
"int",
"=",
"None",
",",
"version",
"=",
"None",
",",
"*",
",",
"is_safe",
"=",
"SafeUUID",
".",
"u... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/uuid.py#L121-L205 | ||
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/mox.py | python | Mox.__init__ | (self) | Initialize a new Mox. | Initialize a new Mox. | [
"Initialize",
"a",
"new",
"Mox",
"."
] | def __init__(self):
"""Initialize a new Mox."""
self._mock_objects = []
self.stubs = stubout.StubOutForTesting() | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"_mock_objects",
"=",
"[",
"]",
"self",
".",
"stubs",
"=",
"stubout",
".",
"StubOutForTesting",
"(",
")"
] | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/mox.py#L158-L162 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/__init__.py | python | _comp_method_SERIES | (cls, op, special) | return wrapper | Wrapper function for Series arithmetic operations, to avoid
code duplication. | Wrapper function for Series arithmetic operations, to avoid
code duplication. | [
"Wrapper",
"function",
"for",
"Series",
"arithmetic",
"operations",
"to",
"avoid",
"code",
"duplication",
"."
] | def _comp_method_SERIES(cls, op, special):
"""
Wrapper function for Series arithmetic operations, to avoid
code duplication.
"""
op_name = _get_op_name(op, special)
@unpack_zerodim_and_defer(op_name)
def wrapper(self, other):
res_name = get_op_result_name(self, other)
if i... | [
"def",
"_comp_method_SERIES",
"(",
"cls",
",",
"op",
",",
"special",
")",
":",
"op_name",
"=",
"_get_op_name",
"(",
"op",
",",
"special",
")",
"@",
"unpack_zerodim_and_defer",
"(",
"op_name",
")",
"def",
"wrapper",
"(",
"self",
",",
"other",
")",
":",
"r... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/__init__.py#L511-L534 | |
manutdzou/KITTI_SSD | 5b620c2f291d36a0fe14489214f22a992f173f44 | scripts/cpp_lint.py | python | _NamespaceInfo.CheckEnd | (self, filename, clean_lines, linenum, error) | Check end of namespace comments. | Check end of namespace comments. | [
"Check",
"end",
"of",
"namespace",
"comments",
"."
] | def CheckEnd(self, filename, clean_lines, linenum, error):
"""Check end of namespace comments."""
line = clean_lines.raw_lines[linenum]
# Check how many lines is enclosed in this namespace. Don't issue
# warning for missing namespace comments if there aren't enough
# lines. However, do apply chec... | [
"def",
"CheckEnd",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"raw_lines",
"[",
"linenum",
"]",
"# Check how many lines is enclosed in this namespace. Don't issue",
"# warning for missing n... | https://github.com/manutdzou/KITTI_SSD/blob/5b620c2f291d36a0fe14489214f22a992f173f44/scripts/cpp_lint.py#L1860-L1903 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/framework/python/ops/variables.py | python | get_variables_by_name | (given_name, scope=None) | return get_variables(scope=scope, suffix=suffix) | Gets the list of variables that were given that name.
Args:
given_name: name given to the variable without any scope.
scope: an optional scope for filtering the variables to return.
Returns:
a copied list of variables with the given name and scope. | Gets the list of variables that were given that name. | [
"Gets",
"the",
"list",
"of",
"variables",
"that",
"were",
"given",
"that",
"name",
"."
] | def get_variables_by_name(given_name, scope=None):
"""Gets the list of variables that were given that name.
Args:
given_name: name given to the variable without any scope.
scope: an optional scope for filtering the variables to return.
Returns:
a copied list of variables with the given name and scop... | [
"def",
"get_variables_by_name",
"(",
"given_name",
",",
"scope",
"=",
"None",
")",
":",
"suffix",
"=",
"'/'",
"+",
"given_name",
"+",
"':|^'",
"+",
"given_name",
"+",
"':'",
"return",
"get_variables",
"(",
"scope",
"=",
"scope",
",",
"suffix",
"=",
"suffix... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/framework/python/ops/variables.py#L386-L397 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/urlhandler/protocol_socket.py | python | Serial.in_waiting | (self) | return len(lr) | Return the number of bytes currently in the input buffer. | Return the number of bytes currently in the input buffer. | [
"Return",
"the",
"number",
"of",
"bytes",
"currently",
"in",
"the",
"input",
"buffer",
"."
] | def in_waiting(self):
"""Return the number of bytes currently in the input buffer."""
if not self.is_open:
raise portNotOpenError
# Poll the socket to see if it is ready for reading.
# If ready, at least one byte will be to read.
lr, lw, lx = select.select([self._sock... | [
"def",
"in_waiting",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_open",
":",
"raise",
"portNotOpenError",
"# Poll the socket to see if it is ready for reading.",
"# If ready, at least one byte will be to read.",
"lr",
",",
"lw",
",",
"lx",
"=",
"select",
".",
... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/urlhandler/protocol_socket.py#L134-L141 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/classifier/boosted_trees_classifier.py | python | BoostedTreesClassifier.__str__ | (self) | return self.__repr__() | Return a string description of the model to the ``print`` method.
Returns
-------
out : string
A description of the model. | Return a string description of the model to the ``print`` method. | [
"Return",
"a",
"string",
"description",
"of",
"the",
"model",
"to",
"the",
"print",
"method",
"."
] | def __str__(self):
"""
Return a string description of the model to the ``print`` method.
Returns
-------
out : string
A description of the model.
"""
return self.__repr__() | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"self",
".",
"__repr__",
"(",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/classifier/boosted_trees_classifier.py#L71-L80 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/queue.py | python | Queue.qsize | (self) | Return the approximate size of the queue (not reliable!). | Return the approximate size of the queue (not reliable!). | [
"Return",
"the",
"approximate",
"size",
"of",
"the",
"queue",
"(",
"not",
"reliable!",
")",
"."
] | def qsize(self):
'''Return the approximate size of the queue (not reliable!).'''
with self.mutex:
return self._qsize() | [
"def",
"qsize",
"(",
"self",
")",
":",
"with",
"self",
".",
"mutex",
":",
"return",
"self",
".",
"_qsize",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/queue.py#L91-L94 | ||
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/plugins/db_manager/db_plugins/oracle/connector.py | python | OracleDBConnector.getSqlDictionary | (self) | return sql_dict | Returns the dictionary for SQL dialog. | Returns the dictionary for SQL dialog. | [
"Returns",
"the",
"dictionary",
"for",
"SQL",
"dialog",
"."
] | def getSqlDictionary(self):
"""Returns the dictionary for SQL dialog."""
from .sql_dictionary import getSqlDictionary
sql_dict = getSqlDictionary()
# get schemas, tables and field names
items = []
# First look into the cache if available
if self.hasCache():
... | [
"def",
"getSqlDictionary",
"(",
"self",
")",
":",
"from",
".",
"sql_dictionary",
"import",
"getSqlDictionary",
"sql_dict",
"=",
"getSqlDictionary",
"(",
")",
"# get schemas, tables and field names",
"items",
"=",
"[",
"]",
"# First look into the cache if available",
"if",... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/db_manager/db_plugins/oracle/connector.py#L1684-L1742 | |
microsoft/DirectXShaderCompiler | 8348ff8d9e0287610ba05d3a828e10af981a1c05 | utils/hct/CodeTags.py | python | Test.verify | (self) | return '==================== Verify failed!\n--- Before:%s+++ After:%s=== Expected:%s====================\n' % (
self.before, self.after, self.expected
) | Returns nothing if passed, or failure message if failed. | Returns nothing if passed, or failure message if failed. | [
"Returns",
"nothing",
"if",
"passed",
"or",
"failure",
"message",
"if",
"failed",
"."
] | def verify(self):
"Returns nothing if passed, or failure message if failed."
if self.after == self.expected:
return
return '==================== Verify failed!\n--- Before:%s+++ After:%s=== Expected:%s====================\n' % (
self.before, self.after, self.expected
... | [
"def",
"verify",
"(",
"self",
")",
":",
"if",
"self",
".",
"after",
"==",
"self",
".",
"expected",
":",
"return",
"return",
"'==================== Verify failed!\\n--- Before:%s+++ After:%s=== Expected:%s====================\\n'",
"%",
"(",
"self",
".",
"before",
",",
... | https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/utils/hct/CodeTags.py#L263-L269 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_distutils/ccompiler.py | python | CCompiler._fix_object_args | (self, objects, output_dir) | return (objects, output_dir) | Typecheck and fix up some arguments supplied to various methods.
Specifically: ensure that 'objects' is a list; if output_dir is
None, replace with self.output_dir. Return fixed versions of
'objects' and 'output_dir'. | Typecheck and fix up some arguments supplied to various methods.
Specifically: ensure that 'objects' is a list; if output_dir is
None, replace with self.output_dir. Return fixed versions of
'objects' and 'output_dir'. | [
"Typecheck",
"and",
"fix",
"up",
"some",
"arguments",
"supplied",
"to",
"various",
"methods",
".",
"Specifically",
":",
"ensure",
"that",
"objects",
"is",
"a",
"list",
";",
"if",
"output_dir",
"is",
"None",
"replace",
"with",
"self",
".",
"output_dir",
".",
... | def _fix_object_args(self, objects, output_dir):
"""Typecheck and fix up some arguments supplied to various methods.
Specifically: ensure that 'objects' is a list; if output_dir is
None, replace with self.output_dir. Return fixed versions of
'objects' and 'output_dir'.
"""
... | [
"def",
"_fix_object_args",
"(",
"self",
",",
"objects",
",",
"output_dir",
")",
":",
"if",
"not",
"isinstance",
"(",
"objects",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"raise",
"TypeError",
"(",
"\"'objects' must be a list or tuple of strings\"",
")",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/ccompiler.py#L410-L425 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/ir_utils.py | python | guard | (func, *args, **kwargs) | Run a function with given set of arguments, and guard against
any GuardException raised by the function by returning None,
or the expected return results if no such exception was raised. | Run a function with given set of arguments, and guard against
any GuardException raised by the function by returning None,
or the expected return results if no such exception was raised. | [
"Run",
"a",
"function",
"with",
"given",
"set",
"of",
"arguments",
"and",
"guard",
"against",
"any",
"GuardException",
"raised",
"by",
"the",
"function",
"by",
"returning",
"None",
"or",
"the",
"expected",
"return",
"results",
"if",
"no",
"such",
"exception",
... | def guard(func, *args, **kwargs):
"""
Run a function with given set of arguments, and guard against
any GuardException raised by the function by returning None,
or the expected return results if no such exception was raised.
"""
try:
return func(*args, **kwargs)
except GuardException... | [
"def",
"guard",
"(",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"return",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"except",
"GuardException",
":",
"return",
"None"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/ir_utils.py#L1430-L1439 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgi.py | python | FieldStorage.getlist | (self, key) | Return list of received values. | Return list of received values. | [
"Return",
"list",
"of",
"received",
"values",
"."
] | def getlist(self, key):
""" Return list of received values."""
if key in self:
value = self[key]
if isinstance(value, list):
return [x.value for x in value]
else:
return [value.value]
else:
return [] | [
"def",
"getlist",
"(",
"self",
",",
"key",
")",
":",
"if",
"key",
"in",
"self",
":",
"value",
"=",
"self",
"[",
"key",
"]",
"if",
"isinstance",
"(",
"value",
",",
"list",
")",
":",
"return",
"[",
"x",
".",
"value",
"for",
"x",
"in",
"value",
"]... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgi.py#L570-L579 | ||
meganz/sdk | 00ace479a434b2d5c329cfe4f7178392fcfd1cdb | examples/python/crud_example.py | python | AppListener.onRequestTemporaryError | (self, api, request, error) | Called upon a temprary error of the API operation. To be continued
(involving further callbacks).
:param api: Reference to the API object.
:param request: Reference to the request this operation belongs to.
:param eror: Error information. | Called upon a temprary error of the API operation. To be continued
(involving further callbacks). | [
"Called",
"upon",
"a",
"temprary",
"error",
"of",
"the",
"API",
"operation",
".",
"To",
"be",
"continued",
"(",
"involving",
"further",
"callbacks",
")",
"."
] | def onRequestTemporaryError(self, api, request, error):
"""
Called upon a temprary error of the API operation. To be continued
(involving further callbacks).
:param api: Reference to the API object.
:param request: Reference to the request this operation belongs to.
:par... | [
"def",
"onRequestTemporaryError",
"(",
"self",
",",
"api",
",",
"request",
",",
"error",
")",
":",
"logging",
".",
"info",
"(",
"'Request temporary error ({}); Error: {}'",
".",
"format",
"(",
"request",
",",
"error",
")",
")"
] | https://github.com/meganz/sdk/blob/00ace479a434b2d5c329cfe4f7178392fcfd1cdb/examples/python/crud_example.py#L105-L115 | ||
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | plugins/wb.admin/backend/wb_server_control.py | python | ServerControlWMI.get_status | (self, verbose=1) | return result | Returned value is one of running, stopping, starting, stopped, unknown | Returned value is one of running, stopping, starting, stopped, unknown | [
"Returned",
"value",
"is",
"one",
"of",
"running",
"stopping",
"starting",
"stopped",
"unknown"
] | def get_status(self, verbose=1):
"Returned value is one of running, stopping, starting, stopped, unknown"
service = self.profile.wmi_service_name
action = "status"
if verbose > 1:
self.info("Checking service status of instance %s..." % service)
result = self.wmi.wmiSe... | [
"def",
"get_status",
"(",
"self",
",",
"verbose",
"=",
"1",
")",
":",
"service",
"=",
"self",
".",
"profile",
".",
"wmi_service_name",
"action",
"=",
"\"status\"",
"if",
"verbose",
">",
"1",
":",
"self",
".",
"info",
"(",
"\"Checking service status of instan... | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/plugins/wb.admin/backend/wb_server_control.py#L876-L891 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py | python | Context.abs | (self, a) | return a.__abs__(context=self) | Returns the absolute value of the operand.
If the operand is negative, the result is the same as using the minus
operation on the operand. Otherwise, the result is the same as using
the plus operation on the operand.
>>> ExtendedContext.abs(Decimal('2.1'))
Decimal('2.1')
... | Returns the absolute value of the operand. | [
"Returns",
"the",
"absolute",
"value",
"of",
"the",
"operand",
"."
] | def abs(self, a):
"""Returns the absolute value of the operand.
If the operand is negative, the result is the same as using the minus
operation on the operand. Otherwise, the result is the same as using
the plus operation on the operand.
>>> ExtendedContext.abs(Decimal('2.1'))... | [
"def",
"abs",
"(",
"self",
",",
"a",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"__abs__",
"(",
"context",
"=",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py#L4129-L4148 | |
commaai/openpilot | 4416c21b1e738ab7d04147c5ae52b5135e0cdb40 | pyextra/acados_template/acados_ocp.py | python | AcadosOcpCost.Zl_e | (self) | return self.__Zl_e | :math:`Z_l^e` - diagonal of Hessian wrt lower slack at terminal shooting node (N).
Default: :code:`np.array([])`. | :math:`Z_l^e` - diagonal of Hessian wrt lower slack at terminal shooting node (N).
Default: :code:`np.array([])`. | [
":",
"math",
":",
"Z_l^e",
"-",
"diagonal",
"of",
"Hessian",
"wrt",
"lower",
"slack",
"at",
"terminal",
"shooting",
"node",
"(",
"N",
")",
".",
"Default",
":",
":",
"code",
":",
"np",
".",
"array",
"(",
"[]",
")",
"."
] | def Zl_e(self):
""":math:`Z_l^e` - diagonal of Hessian wrt lower slack at terminal shooting node (N).
Default: :code:`np.array([])`.
"""
return self.__Zl_e | [
"def",
"Zl_e",
"(",
"self",
")",
":",
"return",
"self",
".",
"__Zl_e"
] | https://github.com/commaai/openpilot/blob/4416c21b1e738ab7d04147c5ae52b5135e0cdb40/pyextra/acados_template/acados_ocp.py#L855-L859 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/code.py | python | InteractiveConsole.__init__ | (self, locals=None, filename="<console>") | Constructor.
The optional locals argument will be passed to the
InteractiveInterpreter base class.
The optional filename argument should specify the (file)name
of the input stream; it will show up in tracebacks. | Constructor. | [
"Constructor",
"."
] | def __init__(self, locals=None, filename="<console>"):
"""Constructor.
The optional locals argument will be passed to the
InteractiveInterpreter base class.
The optional filename argument should specify the (file)name
of the input stream; it will show up in tracebacks.
... | [
"def",
"__init__",
"(",
"self",
",",
"locals",
"=",
"None",
",",
"filename",
"=",
"\"<console>\"",
")",
":",
"InteractiveInterpreter",
".",
"__init__",
"(",
"self",
",",
"locals",
")",
"self",
".",
"filename",
"=",
"filename",
"self",
".",
"resetbuffer",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/code.py#L170-L182 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | StaticLine.__init__ | (self, *args, **kwargs) | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LI_HORIZONTAL,
String name=StaticLineNameStr) -> StaticLine | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LI_HORIZONTAL,
String name=StaticLineNameStr) -> StaticLine | [
"__init__",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"-",
"1",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"LI_HORIZONTAL",
"String",
"name",
"=",
"StaticLineNameStr",
")",
"-",
">",
"StaticLine... | def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LI_HORIZONTAL,
String name=StaticLineNameStr) -> StaticLine
"""
_controls_.StaticLine_swiginit(self,_controls_.new_Sta... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_controls_",
".",
"StaticLine_swiginit",
"(",
"self",
",",
"_controls_",
".",
"new_StaticLine",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
".",
"_... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L909-L916 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py | python | matmul_shape_inference | (a, b, c, transpose_a, transpose_b, adjoint_a,
adjoint_b) | return c_handle | Helper function for matmul to set the result matrix's handle data. | Helper function for matmul to set the result matrix's handle data. | [
"Helper",
"function",
"for",
"matmul",
"to",
"set",
"the",
"result",
"matrix",
"s",
"handle",
"data",
"."
] | def matmul_shape_inference(a, b, c, transpose_a, transpose_b, adjoint_a,
adjoint_b):
"""Helper function for matmul to set the result matrix's handle data."""
c_handle = getattr(c, "_handle_data", None)
a_shape_and_type = get_shape_and_type(a)
b_shape_and_type = get_shape_and_type(b)
... | [
"def",
"matmul_shape_inference",
"(",
"a",
",",
"b",
",",
"c",
",",
"transpose_a",
",",
"transpose_b",
",",
"adjoint_a",
",",
"adjoint_b",
")",
":",
"c_handle",
"=",
"getattr",
"(",
"c",
",",
"\"_handle_data\"",
",",
"None",
")",
"a_shape_and_type",
"=",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py#L115-L138 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/req/req_uninstall.py | python | UninstallPathSet._allowed_to_proceed | (self, verbose) | return ask('Proceed (y/n)? ', ('y', 'n')) == 'y' | Display which files would be deleted and prompt for confirmation | Display which files would be deleted and prompt for confirmation | [
"Display",
"which",
"files",
"would",
"be",
"deleted",
"and",
"prompt",
"for",
"confirmation"
] | def _allowed_to_proceed(self, verbose):
"""Display which files would be deleted and prompt for confirmation
"""
def _display(msg, paths):
if not paths:
return
logger.info(msg)
with indent_log():
for path in sorted(compact(path... | [
"def",
"_allowed_to_proceed",
"(",
"self",
",",
"verbose",
")",
":",
"def",
"_display",
"(",
"msg",
",",
"paths",
")",
":",
"if",
"not",
"paths",
":",
"return",
"logger",
".",
"info",
"(",
"msg",
")",
"with",
"indent_log",
"(",
")",
":",
"for",
"path... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/req/req_uninstall.py#L368-L395 | |
LLNL/Caliper | 60e06980fc65057e1da01296e6eebbbed30f59c8 | src/mpi/services/mpiwrap/wrap.py | python | sub | (out, scope, args, children) | {{sub <string> <regexp> <substitution>}}
Replaces value of <string> with all instances of <regexp> replaced with <substitution>. | {{sub <string> <regexp> <substitution>}}
Replaces value of <string> with all instances of <regexp> replaced with <substitution>. | [
"{{",
"sub",
"<string",
">",
"<regexp",
">",
"<substitution",
">",
"}}",
"Replaces",
"value",
"of",
"<string",
">",
"with",
"all",
"instances",
"of",
"<regexp",
">",
"replaced",
"with",
"<substitution",
">",
"."
] | def sub(out, scope, args, children):
"""{{sub <string> <regexp> <substitution>}}
Replaces value of <string> with all instances of <regexp> replaced with <substitution>.
"""
len(args) == 3 or syntax_error("'sub' macro takes exactly 4 arguments.")
string, regex, substitution = args
if isinstanc... | [
"def",
"sub",
"(",
"out",
",",
"scope",
",",
"args",
",",
"children",
")",
":",
"len",
"(",
"args",
")",
"==",
"3",
"or",
"syntax_error",
"(",
"\"'sub' macro takes exactly 4 arguments.\"",
")",
"string",
",",
"regex",
",",
"substitution",
"=",
"args",
"if"... | https://github.com/LLNL/Caliper/blob/60e06980fc65057e1da01296e6eebbbed30f59c8/src/mpi/services/mpiwrap/wrap.py#L1054-L1065 | ||
p4lang/PI | 38d87e81253feff9fff0660d662c885be78fb719 | tools/cpplint.py | python | _SetOutputFormat | (output_format) | Sets the module's output format. | Sets the module's output format. | [
"Sets",
"the",
"module",
"s",
"output",
"format",
"."
] | def _SetOutputFormat(output_format):
"""Sets the module's output format."""
_cpplint_state.SetOutputFormat(output_format) | [
"def",
"_SetOutputFormat",
"(",
"output_format",
")",
":",
"_cpplint_state",
".",
"SetOutputFormat",
"(",
"output_format",
")"
] | https://github.com/p4lang/PI/blob/38d87e81253feff9fff0660d662c885be78fb719/tools/cpplint.py#L1421-L1423 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/concurrent/futures/process.py | python | _add_call_item_to_queue | (pending_work_items,
work_ids,
call_queue) | Fills call_queue with _WorkItems from pending_work_items.
This function never blocks.
Args:
pending_work_items: A dict mapping work ids to _WorkItems e.g.
{5: <_WorkItem...>, 6: <_WorkItem...>, ...}
work_ids: A queue.Queue of work ids e.g. Queue([5, 6, ...]). Work ids
a... | Fills call_queue with _WorkItems from pending_work_items. | [
"Fills",
"call_queue",
"with",
"_WorkItems",
"from",
"pending_work_items",
"."
] | def _add_call_item_to_queue(pending_work_items,
work_ids,
call_queue):
"""Fills call_queue with _WorkItems from pending_work_items.
This function never blocks.
Args:
pending_work_items: A dict mapping work ids to _WorkItems e.g.
{... | [
"def",
"_add_call_item_to_queue",
"(",
"pending_work_items",
",",
"work_ids",
",",
"call_queue",
")",
":",
"while",
"True",
":",
"if",
"call_queue",
".",
"full",
"(",
")",
":",
"return",
"try",
":",
"work_id",
"=",
"work_ids",
".",
"get",
"(",
"block",
"="... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/concurrent/futures/process.py#L137-L172 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/framework/constant_op.py | python | constant | (value, dtype=None, shape=None, name="Const") | return const_tensor | Creates a constant tensor.
The resulting tensor is populated with values of type `dtype`, as
specified by arguments `value` and (optionally) `shape` (see examples
below).
The argument `value` can be a constant value, or a list of values of type
`dtype`. If `value` is a list, then the length of the list... | Creates a constant tensor. | [
"Creates",
"a",
"constant",
"tensor",
"."
] | def constant(value, dtype=None, shape=None, name="Const"):
"""Creates a constant tensor.
The resulting tensor is populated with values of type `dtype`, as
specified by arguments `value` and (optionally) `shape` (see examples
below).
The argument `value` can be a constant value, or a list of values of ty... | [
"def",
"constant",
"(",
"value",
",",
"dtype",
"=",
"None",
",",
"shape",
"=",
"None",
",",
"name",
"=",
"\"Const\"",
")",
":",
"g",
"=",
"ops",
".",
"get_default_graph",
"(",
")",
"tensor_value",
"=",
"attr_value_pb2",
".",
"AttrValue",
"(",
")",
"ten... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/constant_op.py#L117-L168 | |
leosac/leosac | 932a2a90bd2e75483d46b24fdbc8f02e0809d731 | python/leosacpy/wsclient.py | python | LowLevelWSClient.send_raw | (self, obj: Union[str, dict]) | Send something to leosac.
Note: Prefer using send() instead
The behavior differ based on the type of `obj`.
+ str: send as is.
+ dict: serialize to json and send.
:param obj: | Send something to leosac.
Note: Prefer using send() instead
The behavior differ based on the type of `obj`.
+ str: send as is.
+ dict: serialize to json and send.
:param obj: | [
"Send",
"something",
"to",
"leosac",
".",
"Note",
":",
"Prefer",
"using",
"send",
"()",
"instead",
"The",
"behavior",
"differ",
"based",
"on",
"the",
"type",
"of",
"obj",
".",
"+",
"str",
":",
"send",
"as",
"is",
".",
"+",
"dict",
":",
"serialize",
"... | async def send_raw(self, obj: Union[str, dict]):
"""
Send something to leosac.
Note: Prefer using send() instead
The behavior differ based on the type of `obj`.
+ str: send as is.
+ dict: serialize to json and send.
:param obj:
... | [
"async",
"def",
"send_raw",
"(",
"self",
",",
"obj",
":",
"Union",
"[",
"str",
",",
"dict",
"]",
")",
":",
"assert",
"self",
".",
"ws",
"payload",
"=",
"obj",
"if",
"isinstance",
"(",
"obj",
",",
"str",
")",
"else",
"json",
".",
"dumps",
"(",
"ob... | https://github.com/leosac/leosac/blob/932a2a90bd2e75483d46b24fdbc8f02e0809d731/python/leosacpy/wsclient.py#L192-L207 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/shutil.py | python | register_archive_format | (name, function, extra_args=None, description='') | Registers an archive format.
name is the name of the format. function is the callable that will be
used to create archives. If provided, extra_args is a sequence of
(name, value) tuples that will be passed as arguments to the callable.
description can be provided to describe the format, and will be ret... | Registers an archive format. | [
"Registers",
"an",
"archive",
"format",
"."
] | def register_archive_format(name, function, extra_args=None, description=''):
"""Registers an archive format.
name is the name of the format. function is the callable that will be
used to create archives. If provided, extra_args is a sequence of
(name, value) tuples that will be passed as arguments to ... | [
"def",
"register_archive_format",
"(",
"name",
",",
"function",
",",
"extra_args",
"=",
"None",
",",
"description",
"=",
"''",
")",
":",
"if",
"extra_args",
"is",
"None",
":",
"extra_args",
"=",
"[",
"]",
"if",
"not",
"isinstance",
"(",
"function",
",",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/shutil.py#L480-L499 | ||
happynear/caffe-windows | 967eedf25009e334b7f6f933bb5e17aaaff5bef6 | python/caffe/coord_map.py | python | conv_params | (fn) | return (axis, np.array(params.get('stride', 1), ndmin=1),
(ks - 1) * dilation + 1,
np.array(params.get('pad', 0), ndmin=1)) | Extract the spatial parameters that determine the coordinate mapping:
kernel size, stride, padding, and dilation.
Implementation detail: Convolution, Deconvolution, and Im2col layers
define these in the convolution_param message, while Pooling has its
own fields in pooling_param. This method deals with... | Extract the spatial parameters that determine the coordinate mapping:
kernel size, stride, padding, and dilation. | [
"Extract",
"the",
"spatial",
"parameters",
"that",
"determine",
"the",
"coordinate",
"mapping",
":",
"kernel",
"size",
"stride",
"padding",
"and",
"dilation",
"."
] | def conv_params(fn):
"""
Extract the spatial parameters that determine the coordinate mapping:
kernel size, stride, padding, and dilation.
Implementation detail: Convolution, Deconvolution, and Im2col layers
define these in the convolution_param message, while Pooling has its
own fields in pool... | [
"def",
"conv_params",
"(",
"fn",
")",
":",
"params",
"=",
"fn",
".",
"params",
".",
"get",
"(",
"'convolution_param'",
",",
"fn",
".",
"params",
")",
"axis",
"=",
"params",
".",
"get",
"(",
"'axis'",
",",
"1",
")",
"ks",
"=",
"np",
".",
"array",
... | https://github.com/happynear/caffe-windows/blob/967eedf25009e334b7f6f933bb5e17aaaff5bef6/python/caffe/coord_map.py#L18-L37 | |
apache/kudu | 90895ce76590f10730ad7aac3613b69d89ff5422 | build-support/mini-cluster/relocate_binaries_for_mini_cluster.py | python | prep_artifact_dirs | (config) | Create any required artifact output directories, if needed. | Create any required artifact output directories, if needed. | [
"Create",
"any",
"required",
"artifact",
"output",
"directories",
"if",
"needed",
"."
] | def prep_artifact_dirs(config):
"""
Create any required artifact output directories, if needed.
"""
if not os.path.exists(config[ARTIFACT_ROOT]):
os.makedirs(config[ARTIFACT_ROOT], mode=0o755)
if not os.path.exists(config[ARTIFACT_BIN_DIR]):
os.makedirs(config[ARTIFACT_BIN_DIR], mode=0o755)
if not ... | [
"def",
"prep_artifact_dirs",
"(",
"config",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"config",
"[",
"ARTIFACT_ROOT",
"]",
")",
":",
"os",
".",
"makedirs",
"(",
"config",
"[",
"ARTIFACT_ROOT",
"]",
",",
"mode",
"=",
"0o755",
")",
... | https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/build-support/mini-cluster/relocate_binaries_for_mini_cluster.py#L269-L279 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Pygments/py3/pygments/filters/__init__.py | python | get_all_filters | () | Return a generator of all filter names. | Return a generator of all filter names. | [
"Return",
"a",
"generator",
"of",
"all",
"filter",
"names",
"."
] | def get_all_filters():
"""Return a generator of all filter names."""
yield from FILTERS
for name, _ in find_plugin_filters():
yield name | [
"def",
"get_all_filters",
"(",
")",
":",
"yield",
"from",
"FILTERS",
"for",
"name",
",",
"_",
"in",
"find_plugin_filters",
"(",
")",
":",
"yield",
"name"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py3/pygments/filters/__init__.py#L45-L49 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/score-of-parentheses.py | python | Solution2.scoreOfParentheses | (self, S) | return stack[0] | :type S: str
:rtype: int | :type S: str
:rtype: int | [
":",
"type",
"S",
":",
"str",
":",
"rtype",
":",
"int"
] | def scoreOfParentheses(self, S):
"""
:type S: str
:rtype: int
"""
stack = [0]
for c in S:
if c == '(':
stack.append(0)
else:
last = stack.pop()
stack[-1] += max(1, 2*last)
return stack[0] | [
"def",
"scoreOfParentheses",
"(",
"self",
",",
"S",
")",
":",
"stack",
"=",
"[",
"0",
"]",
"for",
"c",
"in",
"S",
":",
"if",
"c",
"==",
"'('",
":",
"stack",
".",
"append",
"(",
"0",
")",
"else",
":",
"last",
"=",
"stack",
".",
"pop",
"(",
")"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/score-of-parentheses.py#L25-L37 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/D7YIGPositionCalibration.py | python | D7YIGPositionCalibration._print_parameter_file | (self, wavelength, pixel_offsets, bank_offsets, bank_slopes) | Prints the pixel positions as a Instrument Parameter
File that can be later used by the D7 loader. | Prints the pixel positions as a Instrument Parameter
File that can be later used by the D7 loader. | [
"Prints",
"the",
"pixel",
"positions",
"as",
"a",
"Instrument",
"Parameter",
"File",
"that",
"can",
"be",
"later",
"used",
"by",
"the",
"D7",
"loader",
"."
] | def _print_parameter_file(self, wavelength, pixel_offsets, bank_offsets, bank_slopes):
"""Prints the pixel positions as a Instrument Parameter
File that can be later used by the D7 loader."""
param_file = ET.Element('parameter-file')
param_file.set('instrument', 'D7')
date_today ... | [
"def",
"_print_parameter_file",
"(",
"self",
",",
"wavelength",
",",
"pixel_offsets",
",",
"bank_offsets",
",",
"bank_slopes",
")",
":",
"param_file",
"=",
"ET",
".",
"Element",
"(",
"'parameter-file'",
")",
"param_file",
".",
"set",
"(",
"'instrument'",
",",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/D7YIGPositionCalibration.py#L576-L617 | ||
shichaoy/pop_up_slam | 237dba5448eaeacc588f2339365774f9247bce3c | pop_up_python/python/pop_up_python/pop_up_fun.py | python | python_get_contours | (label_map) | return ground_contour[0:-1:20] | label_map: ground is 0, wall is 1 | label_map: ground is 0, wall is 1 | [
"label_map",
":",
"ground",
"is",
"0",
"wall",
"is",
"1"
] | def python_get_contours(label_map):
'''
label_map: ground is 0, wall is 1
'''
contours=find_contours(label_map, 0) # row ind, col ind y x
final_line_segs=np.array([]);final_extend_segs=np.array([]);final_lines_in_extend_ind=np.array([]);
if contours !=[]:
# there might be several c... | [
"def",
"python_get_contours",
"(",
"label_map",
")",
":",
"contours",
"=",
"find_contours",
"(",
"label_map",
",",
"0",
")",
"# row ind, col ind y x",
"final_line_segs",
"=",
"np",
".",
"array",
"(",
"[",
"]",
")",
"final_extend_segs",
"=",
"np",
".",
"array"... | https://github.com/shichaoy/pop_up_slam/blob/237dba5448eaeacc588f2339365774f9247bce3c/pop_up_python/python/pop_up_python/pop_up_fun.py#L85-L104 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/losses/python/losses/loss_ops.py | python | softmax_cross_entropy | (logits, onehot_labels, weight=1.0,
label_smoothing=0, scope=None) | Creates a cross-entropy loss using tf.nn.softmax_cross_entropy_with_logits.
`weight` acts as a coefficient for the loss. If a scalar is provided,
then the loss is simply scaled by the given value. If `weight` is a
tensor of size [`batch_size`], then the loss weights apply to each
corresponding sample.
If `l... | Creates a cross-entropy loss using tf.nn.softmax_cross_entropy_with_logits. | [
"Creates",
"a",
"cross",
"-",
"entropy",
"loss",
"using",
"tf",
".",
"nn",
".",
"softmax_cross_entropy_with_logits",
"."
] | def softmax_cross_entropy(logits, onehot_labels, weight=1.0,
label_smoothing=0, scope=None):
"""Creates a cross-entropy loss using tf.nn.softmax_cross_entropy_with_logits.
`weight` acts as a coefficient for the loss. If a scalar is provided,
then the loss is simply scaled by the given v... | [
"def",
"softmax_cross_entropy",
"(",
"logits",
",",
"onehot_labels",
",",
"weight",
"=",
"1.0",
",",
"label_smoothing",
"=",
"0",
",",
"scope",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"scope",
",",
"\"softmax_cross_entropy_loss\"",
",",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/losses/python/losses/loss_ops.py#L344-L387 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_style.py | python | NullStyleItem | () | return item | Create a null style item
@return: empty style item that cannot be merged | Create a null style item
@return: empty style item that cannot be merged | [
"Create",
"a",
"null",
"style",
"item",
"@return",
":",
"empty",
"style",
"item",
"that",
"cannot",
"be",
"merged"
] | def NullStyleItem():
"""Create a null style item
@return: empty style item that cannot be merged
"""
item = StyleItem()
item.null = True
return item | [
"def",
"NullStyleItem",
"(",
")",
":",
"item",
"=",
"StyleItem",
"(",
")",
"item",
".",
"null",
"=",
"True",
"return",
"item"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_style.py#L996-L1003 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/gdb/libpython.py | python | PyFrameObjectPtr.get_var_by_name | (self, name) | return None, None | Look for the named local variable, returning a (PyObjectPtr, scope) pair
where scope is a string 'local', 'global', 'builtin'
If not found, return (None, None) | Look for the named local variable, returning a (PyObjectPtr, scope) pair
where scope is a string 'local', 'global', 'builtin' | [
"Look",
"for",
"the",
"named",
"local",
"variable",
"returning",
"a",
"(",
"PyObjectPtr",
"scope",
")",
"pair",
"where",
"scope",
"is",
"a",
"string",
"local",
"global",
"builtin"
] | def get_var_by_name(self, name):
'''
Look for the named local variable, returning a (PyObjectPtr, scope) pair
where scope is a string 'local', 'global', 'builtin'
If not found, return (None, None)
'''
for pyop_name, pyop_value in self.iter_locals():
if name =... | [
"def",
"get_var_by_name",
"(",
"self",
",",
"name",
")",
":",
"for",
"pyop_name",
",",
"pyop_value",
"in",
"self",
".",
"iter_locals",
"(",
")",
":",
"if",
"name",
"==",
"pyop_name",
".",
"proxyval",
"(",
"set",
"(",
")",
")",
":",
"return",
"pyop_valu... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/gdb/libpython.py#L902-L918 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | tools/idl_parser/idl_parser.py | python | IDLParser.p_ExceptionMembersError | (self, p) | ExceptionMembers : error | ExceptionMembers : error | [
"ExceptionMembers",
":",
"error"
] | def p_ExceptionMembersError(self, p):
"""ExceptionMembers : error"""
p[0] = self.BuildError(p, 'ExceptionMembers') | [
"def",
"p_ExceptionMembersError",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"self",
".",
"BuildError",
"(",
"p",
",",
"'ExceptionMembers'",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/tools/idl_parser/idl_parser.py#L343-L345 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/wheel.py | python | Wheel.tags | (self) | return itertools.product(
self.py_version.split('.'),
self.abi.split('.'),
self.platform.split('.'),
) | List tags (py_version, abi, platform) supported by this wheel. | List tags (py_version, abi, platform) supported by this wheel. | [
"List",
"tags",
"(",
"py_version",
"abi",
"platform",
")",
"supported",
"by",
"this",
"wheel",
"."
] | def tags(self):
'''List tags (py_version, abi, platform) supported by this wheel.'''
return itertools.product(
self.py_version.split('.'),
self.abi.split('.'),
self.platform.split('.'),
) | [
"def",
"tags",
"(",
"self",
")",
":",
"return",
"itertools",
".",
"product",
"(",
"self",
".",
"py_version",
".",
"split",
"(",
"'.'",
")",
",",
"self",
".",
"abi",
".",
"split",
"(",
"'.'",
")",
",",
"self",
".",
"platform",
".",
"split",
"(",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/wheel.py#L66-L72 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/clang_format.py | python | get_tar_path | (version, tar_path) | return CLANG_FORMAT_SOURCE_TAR_BASE.substitute(
version=version,
tar_path=tar_path) | Get the path to clang-format in the llvm tarball | Get the path to clang-format in the llvm tarball | [
"Get",
"the",
"path",
"to",
"clang",
"-",
"format",
"in",
"the",
"llvm",
"tarball"
] | def get_tar_path(version, tar_path):
""" Get the path to clang-format in the llvm tarball
"""
return CLANG_FORMAT_SOURCE_TAR_BASE.substitute(
version=version,
tar_path=tar_path) | [
"def",
"get_tar_path",
"(",
"version",
",",
"tar_path",
")",
":",
"return",
"CLANG_FORMAT_SOURCE_TAR_BASE",
".",
"substitute",
"(",
"version",
"=",
"version",
",",
"tar_path",
"=",
"tar_path",
")"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/clang_format.py#L63-L68 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/nn/functional.py | python | margin_ranking_loss | (
input1: Tensor,
input2: Tensor,
target: Tensor,
margin: float = 0,
size_average: Optional[bool] = None,
reduce: Optional[bool] = None,
reduction: str = "mean",
) | return torch.margin_ranking_loss(input1, input2, target, margin, reduction_enum) | r"""margin_ranking_loss(input1, input2, target, margin=0, size_average=None, reduce=None, reduction='mean') -> Tensor
See :class:`~torch.nn.MarginRankingLoss` for details. | r"""margin_ranking_loss(input1, input2, target, margin=0, size_average=None, reduce=None, reduction='mean') -> Tensor | [
"r",
"margin_ranking_loss",
"(",
"input1",
"input2",
"target",
"margin",
"=",
"0",
"size_average",
"=",
"None",
"reduce",
"=",
"None",
"reduction",
"=",
"mean",
")",
"-",
">",
"Tensor"
] | def margin_ranking_loss(
input1: Tensor,
input2: Tensor,
target: Tensor,
margin: float = 0,
size_average: Optional[bool] = None,
reduce: Optional[bool] = None,
reduction: str = "mean",
) -> Tensor:
r"""margin_ranking_loss(input1, input2, target, margin=0, size_average=None, reduce=None, ... | [
"def",
"margin_ranking_loss",
"(",
"input1",
":",
"Tensor",
",",
"input2",
":",
"Tensor",
",",
"target",
":",
"Tensor",
",",
"margin",
":",
"float",
"=",
"0",
",",
"size_average",
":",
"Optional",
"[",
"bool",
"]",
"=",
"None",
",",
"reduce",
":",
"Opt... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/functional.py#L3265-L3301 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/idl/idl/syntax.py | python | ChainedType.__init__ | (self, file_name, line, column) | Construct a Type. | Construct a Type. | [
"Construct",
"a",
"Type",
"."
] | def __init__(self, file_name, line, column):
# type: (unicode, int, int) -> None
"""Construct a Type."""
self.name = None # type: unicode
self.cpp_name = None # type: unicode
super(ChainedType, self).__init__(file_name, line, column) | [
"def",
"__init__",
"(",
"self",
",",
"file_name",
",",
"line",
",",
"column",
")",
":",
"# type: (unicode, int, int) -> None",
"self",
".",
"name",
"=",
"None",
"# type: unicode",
"self",
".",
"cpp_name",
"=",
"None",
"# type: unicode",
"super",
"(",
"ChainedTyp... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/syntax.py#L319-L325 | ||
dmlc/decord | 96b750c7221322391969929e855b942d2fdcd06b | python/decord/audio_reader.py | python | AudioReader.shape | (self) | return (self._num_channels, self._num_samples_per_channel) | Get shape of the entire audio samples.
Returns
-------
(int, int)
The number of channels, and the number of samples in each channel. | Get shape of the entire audio samples. | [
"Get",
"shape",
"of",
"the",
"entire",
"audio",
"samples",
"."
] | def shape(self):
"""Get shape of the entire audio samples.
Returns
-------
(int, int)
The number of channels, and the number of samples in each channel.
"""
return (self._num_channels, self._num_samples_per_channel) | [
"def",
"shape",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"_num_channels",
",",
"self",
".",
"_num_samples_per_channel",
")"
] | https://github.com/dmlc/decord/blob/96b750c7221322391969929e855b942d2fdcd06b/python/decord/audio_reader.py#L116-L125 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/bindings/python/llvm/object.py | python | Section.__init__ | (self, ptr) | Construct a new section instance.
Section instances can currently only be created from an ObjectFile
instance. Therefore, this constructor should not be used outside of
this module. | Construct a new section instance. | [
"Construct",
"a",
"new",
"section",
"instance",
"."
] | def __init__(self, ptr):
"""Construct a new section instance.
Section instances can currently only be created from an ObjectFile
instance. Therefore, this constructor should not be used outside of
this module.
"""
LLVMObject.__init__(self, ptr)
self.expired = Fa... | [
"def",
"__init__",
"(",
"self",
",",
"ptr",
")",
":",
"LLVMObject",
".",
"__init__",
"(",
"self",
",",
"ptr",
")",
"self",
".",
"expired",
"=",
"False"
] | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/bindings/python/llvm/object.py#L181-L190 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Entry.index | (self, index) | return self.tk.getint(self.tk.call(
self._w, 'index', index)) | Return position of cursor. | Return position of cursor. | [
"Return",
"position",
"of",
"cursor",
"."
] | def index(self, index):
"""Return position of cursor."""
return self.tk.getint(self.tk.call(
self._w, 'index', index)) | [
"def",
"index",
"(",
"self",
",",
"index",
")",
":",
"return",
"self",
".",
"tk",
".",
"getint",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'index'",
",",
"index",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L2686-L2689 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge2.py | python | ExodusModel._transform_expression | (self, expression) | return expression | Transform the expression into one that evaluates to 0 when true.
For example, 'x=y' becomes '(x)-(y)'. | Transform the expression into one that evaluates to 0 when true. | [
"Transform",
"the",
"expression",
"into",
"one",
"that",
"evaluates",
"to",
"0",
"when",
"true",
"."
] | def _transform_expression(self, expression):
"""
Transform the expression into one that evaluates to 0 when true.
For example, 'x=y' becomes '(x)-(y)'.
"""
# create transformation dictionary by precedence order
transforms = []
transforms.append(('||', 'min(abs(L... | [
"def",
"_transform_expression",
"(",
"self",
",",
"expression",
")",
":",
"# create transformation dictionary by precedence order",
"transforms",
"=",
"[",
"]",
"transforms",
".",
"append",
"(",
"(",
"'||'",
",",
"'min(abs(L), abs(R))'",
")",
")",
"transforms",
".",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L4420-L4487 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/idna/intranges.py | python | intranges_from_list | (list_) | return tuple(ranges) | Represent a list of integers as a sequence of ranges:
((start_0, end_0), (start_1, end_1), ...), such that the original
integers are exactly those x such that start_i <= x < end_i for some i.
Ranges are encoded as single integers (start << 32 | end), not as tuples. | Represent a list of integers as a sequence of ranges:
((start_0, end_0), (start_1, end_1), ...), such that the original
integers are exactly those x such that start_i <= x < end_i for some i. | [
"Represent",
"a",
"list",
"of",
"integers",
"as",
"a",
"sequence",
"of",
"ranges",
":",
"((",
"start_0",
"end_0",
")",
"(",
"start_1",
"end_1",
")",
"...",
")",
"such",
"that",
"the",
"original",
"integers",
"are",
"exactly",
"those",
"x",
"such",
"that"... | def intranges_from_list(list_):
"""Represent a list of integers as a sequence of ranges:
((start_0, end_0), (start_1, end_1), ...), such that the original
integers are exactly those x such that start_i <= x < end_i for some i.
Ranges are encoded as single integers (start << 32 | end), not as tuples.
... | [
"def",
"intranges_from_list",
"(",
"list_",
")",
":",
"sorted_list",
"=",
"sorted",
"(",
"list_",
")",
"ranges",
"=",
"[",
"]",
"last_write",
"=",
"-",
"1",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"sorted_list",
")",
")",
":",
"if",
"i",
"+",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/idna/intranges.py#L10-L29 | |
amrayn/easyloggingpp | 8489989bb26c6371df103f6cbced3fbee1bc3c2f | tools/cpplint.py | python | _NamespaceInfo.CheckEnd | (self, filename, clean_lines, linenum, error) | Check end of namespace comments. | Check end of namespace comments. | [
"Check",
"end",
"of",
"namespace",
"comments",
"."
] | def CheckEnd(self, filename, clean_lines, linenum, error):
"""Check end of namespace comments."""
line = clean_lines.raw_lines[linenum]
# Check how many lines is enclosed in this namespace. Don't issue
# warning for missing namespace comments if there aren't enough
# lines. However, do apply chec... | [
"def",
"CheckEnd",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"raw_lines",
"[",
"linenum",
"]",
"# Check how many lines is enclosed in this namespace. Don't issue",
"# warning for missing n... | https://github.com/amrayn/easyloggingpp/blob/8489989bb26c6371df103f6cbced3fbee1bc3c2f/tools/cpplint.py#L1733-L1776 | ||
microsoft/onnxruntime | f92e47e95b13a240e37caf7b36577983544f98fc | tools/python/util/get_azcopy.py | python | get_azcopy | (local_azcopy_path="azcopy") | Creates a context manager that returns a path to a particular version of
azcopy (specified in AZCOPY_VERSION). Downloads a temporary copy if needed.
:param local_azcopy_path: Path to a local azcopy to try first.
Example usage:
with get_azcopy() as azcopy_path:
subprocess.run([azcopy_pa... | Creates a context manager that returns a path to a particular version of
azcopy (specified in AZCOPY_VERSION). Downloads a temporary copy if needed. | [
"Creates",
"a",
"context",
"manager",
"that",
"returns",
"a",
"path",
"to",
"a",
"particular",
"version",
"of",
"azcopy",
"(",
"specified",
"in",
"AZCOPY_VERSION",
")",
".",
"Downloads",
"a",
"temporary",
"copy",
"if",
"needed",
"."
] | def get_azcopy(local_azcopy_path="azcopy"):
"""
Creates a context manager that returns a path to a particular version of
azcopy (specified in AZCOPY_VERSION). Downloads a temporary copy if needed.
:param local_azcopy_path: Path to a local azcopy to try first.
Example usage:
with get_azcopy... | [
"def",
"get_azcopy",
"(",
"local_azcopy_path",
"=",
"\"azcopy\"",
")",
":",
"with",
"contextlib",
".",
"ExitStack",
"(",
")",
"as",
"context_stack",
":",
"azcopy_path",
"=",
"shutil",
".",
"which",
"(",
"local_azcopy_path",
")",
"if",
"azcopy_path",
"is",
"Non... | https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/tools/python/util/get_azcopy.py#L50-L84 | ||
fengbingchun/NN_Test | d6305825d5273e4569ccd1eda9ffa2a9c72e18d2 | src/tiny-dnn/third_party/cpplint.py | python | CheckForNonStandardConstructs | (filename, clean_lines, linenum,
nesting_state, error) | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint is one way to ease the
transition to new compilers.
- put storage class first (e.g. "static const" instead of "const stat... | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. | [
"r",
"Logs",
"an",
"error",
"if",
"we",
"see",
"certain",
"non",
"-",
"ANSI",
"constructs",
"ignored",
"by",
"gcc",
"-",
"2",
"."
] | def CheckForNonStandardConstructs(filename, clean_lines, linenum,
nesting_state, error):
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint ... | [
"def",
"CheckForNonStandardConstructs",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Remove comments from the line, but leave in strings for now.",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"i... | https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/cpplint.py#L2888-L3048 | ||
google/tink | 59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14 | python/tink/jwt/_jwt_signature_key_manager.py | python | _JwtPublicKeyVerify.verify_and_decode_with_kid | (
self, compact: str, validator: _jwt_validator.JwtValidator,
kid: Optional[str]) | return _verified_jwt.VerifiedJwt._create(raw_jwt) | Verifies, validates and decodes a signed compact JWT token. | Verifies, validates and decodes a signed compact JWT token. | [
"Verifies",
"validates",
"and",
"decodes",
"a",
"signed",
"compact",
"JWT",
"token",
"."
] | def verify_and_decode_with_kid(
self, compact: str, validator: _jwt_validator.JwtValidator,
kid: Optional[str]) -> _verified_jwt.VerifiedJwt:
"""Verifies, validates and decodes a signed compact JWT token."""
parts = _jwt_format.split_signed_compact(compact)
unsigned_compact, json_header, json_pa... | [
"def",
"verify_and_decode_with_kid",
"(",
"self",
",",
"compact",
":",
"str",
",",
"validator",
":",
"_jwt_validator",
".",
"JwtValidator",
",",
"kid",
":",
"Optional",
"[",
"str",
"]",
")",
"->",
"_verified_jwt",
".",
"VerifiedJwt",
":",
"parts",
"=",
"_jwt... | https://github.com/google/tink/blob/59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14/python/tink/jwt/_jwt_signature_key_manager.py#L111-L127 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/sparse/linalg/dsolve/linsolve.py | python | spsolve | (A, b, permc_spec=None, use_umfpack=True) | return x | Solve the sparse linear system Ax=b, where b may be a vector or a matrix.
Parameters
----------
A : ndarray or sparse matrix
The square matrix A will be converted into CSC or CSR form
b : ndarray or sparse matrix
The matrix or vector representing the right hand side of the equation.
... | Solve the sparse linear system Ax=b, where b may be a vector or a matrix. | [
"Solve",
"the",
"sparse",
"linear",
"system",
"Ax",
"=",
"b",
"where",
"b",
"may",
"be",
"a",
"vector",
"or",
"a",
"matrix",
"."
] | def spsolve(A, b, permc_spec=None, use_umfpack=True):
"""Solve the sparse linear system Ax=b, where b may be a vector or a matrix.
Parameters
----------
A : ndarray or sparse matrix
The square matrix A will be converted into CSC or CSR form
b : ndarray or sparse matrix
The matrix or... | [
"def",
"spsolve",
"(",
"A",
",",
"b",
",",
"permc_spec",
"=",
"None",
",",
"use_umfpack",
"=",
"True",
")",
":",
"if",
"not",
"(",
"isspmatrix_csc",
"(",
"A",
")",
"or",
"isspmatrix_csr",
"(",
"A",
")",
")",
":",
"A",
"=",
"csc_matrix",
"(",
"A",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/sparse/linalg/dsolve/linsolve.py#L83-L225 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/nntplib.py | python | NNTP.newgroups | (self, date, time, file=None) | return self.longcmd('NEWGROUPS ' + date + ' ' + time, file) | Process a NEWGROUPS command. Arguments:
- date: string 'yymmdd' indicating the date
- time: string 'hhmmss' indicating the time
Return:
- resp: server response if successful
- list: list of newsgroup names | Process a NEWGROUPS command. Arguments:
- date: string 'yymmdd' indicating the date
- time: string 'hhmmss' indicating the time
Return:
- resp: server response if successful
- list: list of newsgroup names | [
"Process",
"a",
"NEWGROUPS",
"command",
".",
"Arguments",
":",
"-",
"date",
":",
"string",
"yymmdd",
"indicating",
"the",
"date",
"-",
"time",
":",
"string",
"hhmmss",
"indicating",
"the",
"time",
"Return",
":",
"-",
"resp",
":",
"server",
"response",
"if"... | def newgroups(self, date, time, file=None):
"""Process a NEWGROUPS command. Arguments:
- date: string 'yymmdd' indicating the date
- time: string 'hhmmss' indicating the time
Return:
- resp: server response if successful
- list: list of newsgroup names"""
return... | [
"def",
"newgroups",
"(",
"self",
",",
"date",
",",
"time",
",",
"file",
"=",
"None",
")",
":",
"return",
"self",
".",
"longcmd",
"(",
"'NEWGROUPS '",
"+",
"date",
"+",
"' '",
"+",
"time",
",",
"file",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/nntplib.py#L266-L274 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/background_corrections_presenter.py | python | BackgroundCorrectionsPresenter.handle_end_x_changed | (self) | Handles when a End X table cell is changed. | Handles when a End X table cell is changed. | [
"Handles",
"when",
"a",
"End",
"X",
"table",
"cell",
"is",
"changed",
"."
] | def handle_end_x_changed(self) -> None:
"""Handles when a End X table cell is changed."""
self._handle_start_or_end_x_changed(self._get_new_x_range_when_end_x_changed) | [
"def",
"handle_end_x_changed",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"_handle_start_or_end_x_changed",
"(",
"self",
".",
"_get_new_x_range_when_end_x_changed",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/background_corrections_presenter.py#L101-L103 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/BaseHTTPServer.py | python | BaseHTTPRequestHandler.date_time_string | (self, timestamp=None) | return s | Return the current date and time formatted for a message header. | Return the current date and time formatted for a message header. | [
"Return",
"the",
"current",
"date",
"and",
"time",
"formatted",
"for",
"a",
"message",
"header",
"."
] | def date_time_string(self, timestamp=None):
"""Return the current date and time formatted for a message header."""
if timestamp is None:
timestamp = time.time()
year, month, day, hh, mm, ss, wd, y, z = time.gmtime(timestamp)
s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
... | [
"def",
"date_time_string",
"(",
"self",
",",
"timestamp",
"=",
"None",
")",
":",
"if",
"timestamp",
"is",
"None",
":",
"timestamp",
"=",
"time",
".",
"time",
"(",
")",
"year",
",",
"month",
",",
"day",
",",
"hh",
",",
"mm",
",",
"ss",
",",
"wd",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/BaseHTTPServer.py#L464-L473 | |
KhronosGroup/SPIRV-Tools | 940127a77d3ad795a4a1422fbeaad50c9f19f2ea | utils/generate_grammar_tables.py | python | convert_operand_kind | (operand_tuple) | return 'SPV_OPERAND_TYPE_{}'.format(
re.sub(r'([a-z])([A-Z])', r'\1_\2', kind).upper()) | Returns the corresponding operand type used in spirv-tools for the given
operand kind and quantifier used in the JSON grammar.
Arguments:
- operand_tuple: a tuple of two elements:
- operand kind: used in the JSON grammar
- quantifier: '', '?', or '*'
Returns:
a string of th... | Returns the corresponding operand type used in spirv-tools for the given
operand kind and quantifier used in the JSON grammar. | [
"Returns",
"the",
"corresponding",
"operand",
"type",
"used",
"in",
"spirv",
"-",
"tools",
"for",
"the",
"given",
"operand",
"kind",
"and",
"quantifier",
"used",
"in",
"the",
"JSON",
"grammar",
"."
] | def convert_operand_kind(operand_tuple):
"""Returns the corresponding operand type used in spirv-tools for the given
operand kind and quantifier used in the JSON grammar.
Arguments:
- operand_tuple: a tuple of two elements:
- operand kind: used in the JSON grammar
- quantifier: ''... | [
"def",
"convert_operand_kind",
"(",
"operand_tuple",
")",
":",
"kind",
",",
"quantifier",
"=",
"operand_tuple",
"# The following cases are where we differ between the JSON grammar and",
"# spirv-tools.",
"if",
"kind",
"==",
"'IdResultType'",
":",
"kind",
"=",
"'TypeId'",
"e... | https://github.com/KhronosGroup/SPIRV-Tools/blob/940127a77d3ad795a4a1422fbeaad50c9f19f2ea/utils/generate_grammar_tables.py#L149-L209 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/PRESUBMIT.py | python | _CheckUnwantedDependencies | (input_api, output_api) | return results | Runs checkdeps on #include statements added in this
change. Breaking - rules is an error, breaking ! rules is a
warning. | Runs checkdeps on #include statements added in this
change. Breaking - rules is an error, breaking ! rules is a
warning. | [
"Runs",
"checkdeps",
"on",
"#include",
"statements",
"added",
"in",
"this",
"change",
".",
"Breaking",
"-",
"rules",
"is",
"an",
"error",
"breaking",
"!",
"rules",
"is",
"a",
"warning",
"."
] | def _CheckUnwantedDependencies(input_api, output_api):
"""Runs checkdeps on #include statements added in this
change. Breaking - rules is an error, breaking ! rules is a
warning.
"""
# We need to wait until we have an input_api object and use this
# roundabout construct to import checkdeps because this file... | [
"def",
"_CheckUnwantedDependencies",
"(",
"input_api",
",",
"output_api",
")",
":",
"# We need to wait until we have an input_api object and use this",
"# roundabout construct to import checkdeps because this file is",
"# eval-ed and thus doesn't have __file__.",
"original_sys_path",
"=",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/PRESUBMIT.py#L90-L140 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg/linalg_impl.py | python | _matrix_exp_pade7 | (matrix) | return matrix_u, matrix_v | 7th-order Pade approximant for matrix exponential. | 7th-order Pade approximant for matrix exponential. | [
"7th",
"-",
"order",
"Pade",
"approximant",
"for",
"matrix",
"exponential",
"."
] | def _matrix_exp_pade7(matrix):
"""7th-order Pade approximant for matrix exponential."""
b = [17297280.0, 8648640.0, 1995840.0, 277200.0, 25200.0, 1512.0, 56.0]
b = [constant_op.constant(x, matrix.dtype) for x in b]
ident = linalg_ops.eye(
array_ops.shape(matrix)[-2],
batch_shape=array_ops.shape(matr... | [
"def",
"_matrix_exp_pade7",
"(",
"matrix",
")",
":",
"b",
"=",
"[",
"17297280.0",
",",
"8648640.0",
",",
"1995840.0",
",",
"277200.0",
",",
"25200.0",
",",
"1512.0",
",",
"56.0",
"]",
"b",
"=",
"[",
"constant_op",
".",
"constant",
"(",
"x",
",",
"matri... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg/linalg_impl.py#L163-L177 | |
TGAC/KAT | e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216 | deps/boost/tools/build/src/build/generators.py | python | Generator.convert_multiple_sources_to_consumable_types | (self, project, prop_set, sources) | return result | Converts several files to consumable types. | Converts several files to consumable types. | [
"Converts",
"several",
"files",
"to",
"consumable",
"types",
"."
] | def convert_multiple_sources_to_consumable_types (self, project, prop_set, sources):
""" Converts several files to consumable types.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
assert isinstance(prop_set, pro... | [
"def",
"convert_multiple_sources_to_consumable_types",
"(",
"self",
",",
"project",
",",
"prop_set",
",",
"sources",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",
",",
"ProjectTarget",
... | https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/build/generators.py#L588-L619 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Tool/mwcc.py | python | find_versions | () | return versions | Return a list of MWVersion objects representing installed versions | Return a list of MWVersion objects representing installed versions | [
"Return",
"a",
"list",
"of",
"MWVersion",
"objects",
"representing",
"installed",
"versions"
] | def find_versions():
"""Return a list of MWVersion objects representing installed versions"""
versions = []
### This function finds CodeWarrior by reading from the registry on
### Windows. Some other method needs to be implemented for other
### platforms, maybe something that calls env.WhereIs('mwc... | [
"def",
"find_versions",
"(",
")",
":",
"versions",
"=",
"[",
"]",
"### This function finds CodeWarrior by reading from the registry on",
"### Windows. Some other method needs to be implemented for other",
"### platforms, maybe something that calls env.WhereIs('mwcc')",
"if",
"SCons",
"."... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/mwcc.py#L87-L119 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/data/ops/dataset_ops.py | python | _UnbatchDataset.__init__ | (self, input_dataset, name=None) | See `unbatch()` for more details. | See `unbatch()` for more details. | [
"See",
"unbatch",
"()",
"for",
"more",
"details",
"."
] | def __init__(self, input_dataset, name=None):
"""See `unbatch()` for more details."""
flat_shapes = input_dataset._flat_shapes # pylint: disable=protected-access
if any(s.ndims == 0 for s in flat_shapes):
raise ValueError("Cannot unbatch an input with scalar components.")
known_batch_dim = tensor... | [
"def",
"__init__",
"(",
"self",
",",
"input_dataset",
",",
"name",
"=",
"None",
")",
":",
"flat_shapes",
"=",
"input_dataset",
".",
"_flat_shapes",
"# pylint: disable=protected-access",
"if",
"any",
"(",
"s",
".",
"ndims",
"==",
"0",
"for",
"s",
"in",
"flat_... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/data/ops/dataset_ops.py#L5597-L5619 | ||
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | ValidCtxt.validateRoot | (self, doc) | return ret | Try to validate a the root element basically it does the
following check as described by the XML-1.0 recommendation:
- [ VC: Root Element Type ] it doesn't try to recurse or
apply other check to the element | Try to validate a the root element basically it does the
following check as described by the XML-1.0 recommendation:
- [ VC: Root Element Type ] it doesn't try to recurse or
apply other check to the element | [
"Try",
"to",
"validate",
"a",
"the",
"root",
"element",
"basically",
"it",
"does",
"the",
"following",
"check",
"as",
"described",
"by",
"the",
"XML",
"-",
"1",
".",
"0",
"recommendation",
":",
"-",
"[",
"VC",
":",
"Root",
"Element",
"Type",
"]",
"it",... | def validateRoot(self, doc):
"""Try to validate a the root element basically it does the
following check as described by the XML-1.0 recommendation:
- [ VC: Root Element Type ] it doesn't try to recurse or
apply other check to the element """
if doc is None: doc__o = None
... | [
"def",
"validateRoot",
"(",
"self",
",",
"doc",
")",
":",
"if",
"doc",
"is",
"None",
":",
"doc__o",
"=",
"None",
"else",
":",
"doc__o",
"=",
"doc",
".",
"_o",
"ret",
"=",
"libxml2mod",
".",
"xmlValidateRoot",
"(",
"self",
".",
"_o",
",",
"doc__o",
... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L7191-L7199 | |
IfcOpenShell/IfcOpenShell | 2c2954b11a9c9d581bef03240836d4567e69ad0b | src/ifcopenshell-python/ifcopenshell/ids.py | python | specification.parse | (ids_dict) | return spec | Parse xml specification to python object.
:param ids_dict:
:type ids_dict: dict | Parse xml specification to python object. | [
"Parse",
"xml",
"specification",
"to",
"python",
"object",
"."
] | def parse(ids_dict):
"""Parse xml specification to python object.
:param ids_dict:
:type ids_dict: dict
"""
def parse_rules(dict):
facet_names = list(dict.keys())
facet_properties = [v[0] if isinstance(v, list) else v for v in list(dict.values())]
... | [
"def",
"parse",
"(",
"ids_dict",
")",
":",
"def",
"parse_rules",
"(",
"dict",
")",
":",
"facet_names",
"=",
"list",
"(",
"dict",
".",
"keys",
"(",
")",
")",
"facet_properties",
"=",
"[",
"v",
"[",
"0",
"]",
"if",
"isinstance",
"(",
"v",
",",
"list"... | https://github.com/IfcOpenShell/IfcOpenShell/blob/2c2954b11a9c9d581bef03240836d4567e69ad0b/src/ifcopenshell-python/ifcopenshell/ids.py#L286-L305 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/distutils/core.py | python | setup | (**attrs) | return dist | The gateway to the Distutils: do everything your setup script needs
to do, in a highly flexible and user-driven way. Briefly: create a
Distribution instance; find and parse config files; parse the command
line; run each Distutils command found there, customized by the options
supplied to 'setup()' (as ... | The gateway to the Distutils: do everything your setup script needs
to do, in a highly flexible and user-driven way. Briefly: create a
Distribution instance; find and parse config files; parse the command
line; run each Distutils command found there, customized by the options
supplied to 'setup()' (as ... | [
"The",
"gateway",
"to",
"the",
"Distutils",
":",
"do",
"everything",
"your",
"setup",
"script",
"needs",
"to",
"do",
"in",
"a",
"highly",
"flexible",
"and",
"user",
"-",
"driven",
"way",
".",
"Briefly",
":",
"create",
"a",
"Distribution",
"instance",
";",
... | def setup (**attrs):
"""The gateway to the Distutils: do everything your setup script needs
to do, in a highly flexible and user-driven way. Briefly: create a
Distribution instance; find and parse config files; parse the command
line; run each Distutils command found there, customized by the options
... | [
"def",
"setup",
"(",
"*",
"*",
"attrs",
")",
":",
"global",
"_setup_stop_after",
",",
"_setup_distribution",
"# Determine the distribution class -- either caller-supplied or",
"# our Distribution (see below).",
"klass",
"=",
"attrs",
".",
"get",
"(",
"'distclass'",
")",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/core.py#L57-L165 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome/browser/resources/web_dev_style/js_checker.py | python | JSChecker.ChromeSendCheck | (self, i, line) | return self.RegexCheck(i, line, r"chrome\.send\('[^']+'\s*(, \[\])\)",
'Passing an empty array to chrome.send is unnecessary.') | Checks for a particular misuse of 'chrome.send'. | Checks for a particular misuse of 'chrome.send'. | [
"Checks",
"for",
"a",
"particular",
"misuse",
"of",
"chrome",
".",
"send",
"."
] | def ChromeSendCheck(self, i, line):
"""Checks for a particular misuse of 'chrome.send'."""
return self.RegexCheck(i, line, r"chrome\.send\('[^']+'\s*(, \[\])\)",
'Passing an empty array to chrome.send is unnecessary.') | [
"def",
"ChromeSendCheck",
"(",
"self",
",",
"i",
",",
"line",
")",
":",
"return",
"self",
".",
"RegexCheck",
"(",
"i",
",",
"line",
",",
"r\"chrome\\.send\\('[^']+'\\s*(, \\[\\])\\)\"",
",",
"'Passing an empty array to chrome.send is unnecessary.'",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/browser/resources/web_dev_style/js_checker.py#L39-L42 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/FortranCommon.py | python | add_f95_to_env | (env) | Add Builders and construction variables for f95 to an Environment. | Add Builders and construction variables for f95 to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"f95",
"to",
"an",
"Environment",
"."
] | def add_f95_to_env(env):
"""Add Builders and construction variables for f95 to an Environment."""
try:
F95Suffixes = env['F95FILESUFFIXES']
except KeyError:
F95Suffixes = ['.f95']
#print("Adding %s to f95 suffixes" % F95Suffixes)
try:
F95PPSuffixes = env['F95PPFILESUFFIXES']... | [
"def",
"add_f95_to_env",
"(",
"env",
")",
":",
"try",
":",
"F95Suffixes",
"=",
"env",
"[",
"'F95FILESUFFIXES'",
"]",
"except",
"KeyError",
":",
"F95Suffixes",
"=",
"[",
"'.f95'",
"]",
"#print(\"Adding %s to f95 suffixes\" % F95Suffixes)",
"try",
":",
"F95PPSuffixes"... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/FortranCommon.py#L220-L234 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/nearest-exit-from-entrance-in-maze.py | python | Solution2.nearestExit | (self, maze, entrance) | return -1 | :type maze: List[List[str]]
:type entrance: List[int]
:rtype: int | :type maze: List[List[str]]
:type entrance: List[int]
:rtype: int | [
":",
"type",
"maze",
":",
"List",
"[",
"List",
"[",
"str",
"]]",
":",
"type",
"entrance",
":",
"List",
"[",
"int",
"]",
":",
"rtype",
":",
"int"
] | def nearestExit(self, maze, entrance):
"""
:type maze: List[List[str]]
:type entrance: List[int]
:rtype: int
"""
directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]
visited = ' '
entrance = tuple(entrance)
maze[entrance[0]][entrance[1]] = visited
... | [
"def",
"nearestExit",
"(",
"self",
",",
"maze",
",",
"entrance",
")",
":",
"directions",
"=",
"[",
"(",
"0",
",",
"1",
")",
",",
"(",
"1",
",",
"0",
")",
",",
"(",
"0",
",",
"-",
"1",
")",
",",
"(",
"-",
"1",
",",
"0",
")",
"]",
"visited"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/nearest-exit-from-entrance-in-maze.py#L46-L72 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PropertyGridHitTestResult.GetColumn | (*args, **kwargs) | return _propgrid.PropertyGridHitTestResult_GetColumn(*args, **kwargs) | GetColumn(self) -> int | GetColumn(self) -> int | [
"GetColumn",
"(",
"self",
")",
"-",
">",
"int"
] | def GetColumn(*args, **kwargs):
"""GetColumn(self) -> int"""
return _propgrid.PropertyGridHitTestResult_GetColumn(*args, **kwargs) | [
"def",
"GetColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridHitTestResult_GetColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L893-L895 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.