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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/misc/matplottools.py | python | get_resultshape_connections | (net, id_connection, dispacement) | return shape.copy(), angles_perb | Return resultshape coords for this edge. | Return resultshape coords for this edge. | [
"Return",
"resultshape",
"coords",
"for",
"this",
"edge",
"."
] | def get_resultshape_connections(net, id_connection, dispacement):
"""
Return resultshape coords for this edge.
"""
print 'get_resultshape', 'connections', 'id_connection', id_connection, 'dispacement', dispacement
x0 = net.edges.shapes[net.lanes.ids_edge[net.connections.ids_fromlane[id_connection]]]... | [
"def",
"get_resultshape_connections",
"(",
"net",
",",
"id_connection",
",",
"dispacement",
")",
":",
"print",
"'get_resultshape'",
",",
"'connections'",
",",
"'id_connection'",
",",
"id_connection",
",",
"'dispacement'",
",",
"dispacement",
"x0",
"=",
"net",
".",
... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/misc/matplottools.py#L775-L794 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Window.GetTextExtent | (*args, **kwargs) | return _core_.Window_GetTextExtent(*args, **kwargs) | GetTextExtent(String string) -> (width, height)
Get the width and height of the text using the current font. | GetTextExtent(String string) -> (width, height) | [
"GetTextExtent",
"(",
"String",
"string",
")",
"-",
">",
"(",
"width",
"height",
")"
] | def GetTextExtent(*args, **kwargs):
"""
GetTextExtent(String string) -> (width, height)
Get the width and height of the text using the current font.
"""
return _core_.Window_GetTextExtent(*args, **kwargs) | [
"def",
"GetTextExtent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetTextExtent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L11030-L11036 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/ObjectsFem.py | python | makeMeshGmsh | (
doc,
name="MeshGmsh"
) | return obj | makeMeshGmsh(document, [name]):
makes a Gmsh FEM mesh object | makeMeshGmsh(document, [name]):
makes a Gmsh FEM mesh object | [
"makeMeshGmsh",
"(",
"document",
"[",
"name",
"]",
")",
":",
"makes",
"a",
"Gmsh",
"FEM",
"mesh",
"object"
] | def makeMeshGmsh(
doc,
name="MeshGmsh"
):
"""makeMeshGmsh(document, [name]):
makes a Gmsh FEM mesh object"""
obj = doc.addObject("Fem::FemMeshObjectPython", name)
from femobjects import mesh_gmsh
mesh_gmsh.MeshGmsh(obj)
if FreeCAD.GuiUp:
from femviewprovider import view_mesh_gmsh... | [
"def",
"makeMeshGmsh",
"(",
"doc",
",",
"name",
"=",
"\"MeshGmsh\"",
")",
":",
"obj",
"=",
"doc",
".",
"addObject",
"(",
"\"Fem::FemMeshObjectPython\"",
",",
"name",
")",
"from",
"femobjects",
"import",
"mesh_gmsh",
"mesh_gmsh",
".",
"MeshGmsh",
"(",
"obj",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/ObjectsFem.py#L515-L527 | |
weichengkuo/DeepBox | c4f8c065b6a51cf296540cc453a44f0519aaacc9 | caffe-fast-rcnn/scripts/cpp_lint.py | python | FileInfo.BaseName | (self) | return self.Split()[1] | File base name - text after the final slash, before the final period. | File base name - text after the final slash, before the final period. | [
"File",
"base",
"name",
"-",
"text",
"after",
"the",
"final",
"slash",
"before",
"the",
"final",
"period",
"."
] | def BaseName(self):
"""File base name - text after the final slash, before the final period."""
return self.Split()[1] | [
"def",
"BaseName",
"(",
"self",
")",
":",
"return",
"self",
".",
"Split",
"(",
")",
"[",
"1",
"]"
] | https://github.com/weichengkuo/DeepBox/blob/c4f8c065b6a51cf296540cc453a44f0519aaacc9/caffe-fast-rcnn/scripts/cpp_lint.py#L944-L946 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/pymock/mock.py | python | _patch_dict.__enter__ | (self) | Patch the dict. | Patch the dict. | [
"Patch",
"the",
"dict",
"."
] | def __enter__(self):
"""Patch the dict."""
self._patch_dict() | [
"def",
"__enter__",
"(",
"self",
")",
":",
"self",
".",
"_patch_dict",
"(",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/pymock/mock.py#L1636-L1638 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/dufunc.py | python | DUFunc._install_type | (self, typingctx=None) | Constructs and installs a typing class for a DUFunc object in the
input typing context. If no typing context is given, then
_install_type() installs into the typing context of the
dispatcher object (should be same default context used by
jit() and njit()). | Constructs and installs a typing class for a DUFunc object in the
input typing context. If no typing context is given, then
_install_type() installs into the typing context of the
dispatcher object (should be same default context used by
jit() and njit()). | [
"Constructs",
"and",
"installs",
"a",
"typing",
"class",
"for",
"a",
"DUFunc",
"object",
"in",
"the",
"input",
"typing",
"context",
".",
"If",
"no",
"typing",
"context",
"is",
"given",
"then",
"_install_type",
"()",
"installs",
"into",
"the",
"typing",
"cont... | def _install_type(self, typingctx=None):
"""Constructs and installs a typing class for a DUFunc object in the
input typing context. If no typing context is given, then
_install_type() installs into the typing context of the
dispatcher object (should be same default context used by
... | [
"def",
"_install_type",
"(",
"self",
",",
"typingctx",
"=",
"None",
")",
":",
"if",
"typingctx",
"is",
"None",
":",
"typingctx",
"=",
"self",
".",
"_dispatcher",
".",
"targetdescr",
".",
"typing_context",
"_ty_cls",
"=",
"type",
"(",
"'DUFuncTyping_'",
"+",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/dufunc.py#L219-L231 | ||
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/MSVSVersion.py | python | VisualStudioVersion.Description | (self) | return self.description | Get the full description of the version. | Get the full description of the version. | [
"Get",
"the",
"full",
"description",
"of",
"the",
"version",
"."
] | def Description(self):
"""Get the full description of the version."""
return self.description | [
"def",
"Description",
"(",
"self",
")",
":",
"return",
"self",
".",
"description"
] | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/MSVSVersion.py#L35-L37 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typeconv/castgraph.py | python | TypeGraph.__init__ | (self, callback=None) | Args
----
- callback: callable or None
It is called for each new casting rule with
(from_type, to_type, castrel). | Args
----
- callback: callable or None
It is called for each new casting rule with
(from_type, to_type, castrel). | [
"Args",
"----",
"-",
"callback",
":",
"callable",
"or",
"None",
"It",
"is",
"called",
"for",
"each",
"new",
"casting",
"rule",
"with",
"(",
"from_type",
"to_type",
"castrel",
")",
"."
] | def __init__(self, callback=None):
"""
Args
----
- callback: callable or None
It is called for each new casting rule with
(from_type, to_type, castrel).
"""
assert callback is None or callable(callback)
self._forwards = defaultdict(CastSet)... | [
"def",
"__init__",
"(",
"self",
",",
"callback",
"=",
"None",
")",
":",
"assert",
"callback",
"is",
"None",
"or",
"callable",
"(",
"callback",
")",
"self",
".",
"_forwards",
"=",
"defaultdict",
"(",
"CastSet",
")",
"self",
".",
"_backwards",
"=",
"defaul... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typeconv/castgraph.py#L78-L89 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/blocks.py | python | ObjectBlock._replace_single | (
self,
to_replace,
value,
inplace=False,
filter=None,
regex=False,
convert=True,
mask=None,
) | return block | Replace elements by the given value.
Parameters
----------
to_replace : object or pattern
Scalar to replace or regular expression to match.
value : object
Replacement object.
inplace : bool, default False
Perform inplace modification.
... | Replace elements by the given value. | [
"Replace",
"elements",
"by",
"the",
"given",
"value",
"."
] | def _replace_single(
self,
to_replace,
value,
inplace=False,
filter=None,
regex=False,
convert=True,
mask=None,
):
"""
Replace elements by the given value.
Parameters
----------
to_replace : object or pattern
... | [
"def",
"_replace_single",
"(",
"self",
",",
"to_replace",
",",
"value",
",",
"inplace",
"=",
"False",
",",
"filter",
"=",
"None",
",",
"regex",
"=",
"False",
",",
"convert",
"=",
"True",
",",
"mask",
"=",
"None",
",",
")",
":",
"inplace",
"=",
"valid... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/blocks.py#L2734-L2842 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/rnn/python/ops/lstm_ops.py | python | _lstm_fused_cell | (x,
cs_prev,
h_prev,
w,
b,
wci=None,
wcf=None,
wco=None,
forget_bias=None,
cell_clip=None,
use_peephole=None,
... | return _lstm_ops_so.lstm_fused_cell(x=x,
cs_prev=cs_prev,
h_prev=h_prev,
w=w,
wci=wci,
wco=wco,
... | r"""Computes the LSTM cell forward propagation for 1 time step.
This implementation uses 1 weight matrix and 1 bias vector, there is no
diagonal peephole connection.
This kernel op implements the following mathematical equations:
```python
xh = [x, h_prev]
[i, f, ci, o] = xh * w + b
f = f + forget_bias... | r"""Computes the LSTM cell forward propagation for 1 time step. | [
"r",
"Computes",
"the",
"LSTM",
"cell",
"forward",
"propagation",
"for",
"1",
"time",
"step",
"."
] | def _lstm_fused_cell(x,
cs_prev,
h_prev,
w,
b,
wci=None,
wcf=None,
wco=None,
forget_bias=None,
cell_clip=None,
... | [
"def",
"_lstm_fused_cell",
"(",
"x",
",",
"cs_prev",
",",
"h_prev",
",",
"w",
",",
"b",
",",
"wci",
"=",
"None",
",",
"wcf",
"=",
"None",
",",
"wco",
"=",
"None",
",",
"forget_bias",
"=",
"None",
",",
"cell_clip",
"=",
"None",
",",
"use_peephole",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/rnn/python/ops/lstm_ops.py#L39-L122 | |
kungfu-origin/kungfu | 90c84b2b590855654cb9a6395ed050e0f7763512 | core/deps/SQLiteCpp-2.3.0/cpplint.py | python | CheckForHeaderGuard | (filename, lines, error) | Checks that the file contains a header guard.
Logs an error if no #ifndef header guard is present. For other
headers, checks that the full pathname is used.
Args:
filename: The name of the C++ header file.
lines: An array of strings, each representing a line of the file.
error: The function to call... | Checks that the file contains a header guard. | [
"Checks",
"that",
"the",
"file",
"contains",
"a",
"header",
"guard",
"."
] | def CheckForHeaderGuard(filename, lines, error):
"""Checks that the file contains a header guard.
Logs an error if no #ifndef header guard is present. For other
headers, checks that the full pathname is used.
Args:
filename: The name of the C++ header file.
lines: An array of strings, each representi... | [
"def",
"CheckForHeaderGuard",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"cppvar",
"=",
"GetHeaderGuardCPPVariable",
"(",
"filename",
")",
"ifndef",
"=",
"None",
"ifndef_linenum",
"=",
"0",
"define",
"=",
"None",
"endif",
"=",
"None",
"endif_linenu... | https://github.com/kungfu-origin/kungfu/blob/90c84b2b590855654cb9a6395ed050e0f7763512/core/deps/SQLiteCpp-2.3.0/cpplint.py#L1437-L1509 | ||
yue/yue | 619d62c191b13c51c01be451dc48917c34a5aefc | building/tools/cpplint.py | python | CheckCasts | (filename, clean_lines, linenum, error) | Various cast related checks.
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. | Various cast related checks. | [
"Various",
"cast",
"related",
"checks",
"."
] | def CheckCasts(filename, clean_lines, linenum, error):
"""Various cast related checks.
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.
"""
line =... | [
"def",
"CheckCasts",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Check to see if they're using an conversion function cast.",
"# I just try to capture the most common basic t... | https://github.com/yue/yue/blob/619d62c191b13c51c01be451dc48917c34a5aefc/building/tools/cpplint.py#L5136-L5252 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PyFlagsProperty._SetSelf | (*args, **kwargs) | return _propgrid.PyFlagsProperty__SetSelf(*args, **kwargs) | _SetSelf(self, PyObject self) | _SetSelf(self, PyObject self) | [
"_SetSelf",
"(",
"self",
"PyObject",
"self",
")"
] | def _SetSelf(*args, **kwargs):
"""_SetSelf(self, PyObject self)"""
return _propgrid.PyFlagsProperty__SetSelf(*args, **kwargs) | [
"def",
"_SetSelf",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PyFlagsProperty__SetSelf",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L4246-L4248 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/graph_editor/util.py | python | find_corresponding_elem | (target, dst_graph, dst_scope="", src_scope="") | Find corresponding op/tensor in a different graph.
Args:
target: A `tf.Tensor` or a `tf.Operation` belonging to the original graph.
dst_graph: The graph in which the corresponding graph element must be found.
dst_scope: A scope which is prepended to the name to look for.
src_scope: A scope which is r... | Find corresponding op/tensor in a different graph. | [
"Find",
"corresponding",
"op",
"/",
"tensor",
"in",
"a",
"different",
"graph",
"."
] | def find_corresponding_elem(target, dst_graph, dst_scope="", src_scope=""):
"""Find corresponding op/tensor in a different graph.
Args:
target: A `tf.Tensor` or a `tf.Operation` belonging to the original graph.
dst_graph: The graph in which the corresponding graph element must be found.
dst_scope: A sc... | [
"def",
"find_corresponding_elem",
"(",
"target",
",",
"dst_graph",
",",
"dst_scope",
"=",
"\"\"",
",",
"src_scope",
"=",
"\"\"",
")",
":",
"src_name",
"=",
"target",
".",
"name",
"if",
"src_scope",
":",
"src_scope",
"=",
"scope_finalize",
"(",
"src_scope",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/graph_editor/util.py#L506-L539 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/stats/morestats.py | python | binom_test | (x, n=None, p=0.5, alternative='two-sided') | return min(1.0, pval) | Perform a test that the probability of success is p.
This is an exact, two-sided test of the null hypothesis
that the probability of success in a Bernoulli experiment
is `p`.
Parameters
----------
x : integer or array_like
the number of successes, or if x has length 2, it is the
... | Perform a test that the probability of success is p. | [
"Perform",
"a",
"test",
"that",
"the",
"probability",
"of",
"success",
"is",
"p",
"."
] | def binom_test(x, n=None, p=0.5, alternative='two-sided'):
"""
Perform a test that the probability of success is p.
This is an exact, two-sided test of the null hypothesis
that the probability of success in a Bernoulli experiment
is `p`.
Parameters
----------
x : integer or array_like
... | [
"def",
"binom_test",
"(",
"x",
",",
"n",
"=",
"None",
",",
"p",
"=",
"0.5",
",",
"alternative",
"=",
"'two-sided'",
")",
":",
"x",
"=",
"atleast_1d",
"(",
"x",
")",
".",
"astype",
"(",
"np",
".",
"integer",
")",
"if",
"len",
"(",
"x",
")",
"=="... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/morestats.py#L1991-L2068 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/dataset/cifar.py | python | test10 | (cycle=False) | return reader_creator(
paddle.dataset.common.download(CIFAR10_URL, 'cifar', CIFAR10_MD5),
'test_batch',
cycle=cycle) | CIFAR-10 test set creator.
It returns a reader creator, each sample in the reader is image pixels in
[0, 1] and label in [0, 9].
:param cycle: whether to cycle through the dataset
:type cycle: bool
:return: Test reader creator.
:rtype: callable | CIFAR-10 test set creator. | [
"CIFAR",
"-",
"10",
"test",
"set",
"creator",
"."
] | def test10(cycle=False):
"""
CIFAR-10 test set creator.
It returns a reader creator, each sample in the reader is image pixels in
[0, 1] and label in [0, 9].
:param cycle: whether to cycle through the dataset
:type cycle: bool
:return: Test reader creator.
:rtype: callable
"""
... | [
"def",
"test10",
"(",
"cycle",
"=",
"False",
")",
":",
"return",
"reader_creator",
"(",
"paddle",
".",
"dataset",
".",
"common",
".",
"download",
"(",
"CIFAR10_URL",
",",
"'cifar'",
",",
"CIFAR10_MD5",
")",
",",
"'test_batch'",
",",
"cycle",
"=",
"cycle",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/dataset/cifar.py#L143-L158 | |
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/snapshot.py | python | Snapshot.__init__ | (self, f, mode, buffer_size=10) | Snapshot constructor given file name and R/W mode.
Args:
file (string): snapshot file name.
mode (boolean): True for write, False for read
buffer_size (int): Buffer size (in MB), default is 10 | Snapshot constructor given file name and R/W mode. | [
"Snapshot",
"constructor",
"given",
"file",
"name",
"and",
"R",
"/",
"W",
"mode",
"."
] | def __init__(self, f, mode, buffer_size=10):
'''Snapshot constructor given file name and R/W mode.
Args:
file (string): snapshot file name.
mode (boolean): True for write, False for read
buffer_size (int): Buffer size (in MB), default is 10
'''
self.s... | [
"def",
"__init__",
"(",
"self",
",",
"f",
",",
"mode",
",",
"buffer_size",
"=",
"10",
")",
":",
"self",
".",
"snapshot",
"=",
"singa",
".",
"Snapshot",
"(",
"f",
".",
"encode",
"(",
")",
",",
"mode",
",",
"buffer_size",
")"
] | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/snapshot.py#L47-L55 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_functional_ops.py | python | _replace_ragged_with_flat_values | (value, nested_splits_lists) | Replace RaggedTensors with their flat_values, and record their splits.
Returns a copy of `value`, with any nested `RaggedTensor`s replaced by their
`flat_values` tensor. Looks inside lists, tuples, and dicts.
Appends each `RaggedTensor`'s `nested_splits` to `nested_splits_lists`.
Args:
value: The value ... | Replace RaggedTensors with their flat_values, and record their splits. | [
"Replace",
"RaggedTensors",
"with",
"their",
"flat_values",
"and",
"record",
"their",
"splits",
"."
] | def _replace_ragged_with_flat_values(value, nested_splits_lists):
"""Replace RaggedTensors with their flat_values, and record their splits.
Returns a copy of `value`, with any nested `RaggedTensor`s replaced by their
`flat_values` tensor. Looks inside lists, tuples, and dicts.
Appends each `RaggedTensor`'s `... | [
"def",
"_replace_ragged_with_flat_values",
"(",
"value",
",",
"nested_splits_lists",
")",
":",
"# Base case",
"if",
"ragged_tensor",
".",
"is_ragged",
"(",
"value",
")",
":",
"value",
"=",
"ragged_tensor",
".",
"convert_to_tensor_or_ragged_tensor",
"(",
"value",
")",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_functional_ops.py#L97-L130 | ||
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/serialcli.py | python | Serial.close | (self) | Close port | Close port | [
"Close",
"port"
] | def close(self):
"""Close port"""
if self.is_open:
if self._port_handle:
try:
self._port_handle.Close()
except System.IO.Ports.InvalidOperationException:
# ignore errors. can happen for unplugged USB serial devices
... | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_open",
":",
"if",
"self",
".",
"_port_handle",
":",
"try",
":",
"self",
".",
"_port_handle",
".",
"Close",
"(",
")",
"except",
"System",
".",
"IO",
".",
"Ports",
".",
"InvalidOperationExcept... | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/serialcli.py#L131-L141 | ||
leanprover/lean | 72a965986fa5aeae54062e98efb3140b2c4e79fd | src/cmake/Modules/cpplint.py | python | _BlockInfo.CheckEnd | (self, filename, clean_lines, linenum, error) | Run checks that applies to text after the closing brace.
This is mostly used for checking end of namespace comments.
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... | Run checks that applies to text after the closing brace. | [
"Run",
"checks",
"that",
"applies",
"to",
"text",
"after",
"the",
"closing",
"brace",
"."
] | def CheckEnd(self, filename, clean_lines, linenum, error):
"""Run checks that applies to text after the closing brace.
This is mostly used for checking end of namespace comments.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
line... | [
"def",
"CheckEnd",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"pass"
] | https://github.com/leanprover/lean/blob/72a965986fa5aeae54062e98efb3140b2c4e79fd/src/cmake/Modules/cpplint.py#L1451-L1462 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/google/protobuf/descriptor.py | python | Descriptor.EnumValueName | (self, enum, value) | return self.enum_types_by_name[enum].values_by_number[value].name | Returns the string name of an enum value.
This is just a small helper method to simplify a common operation.
Args:
enum: string name of the Enum.
value: int, value of the enum.
Returns:
string name of the enum value.
Raises:
KeyError if either the Enum doesn't exist or the va... | Returns the string name of an enum value. | [
"Returns",
"the",
"string",
"name",
"of",
"an",
"enum",
"value",
"."
] | def EnumValueName(self, enum, value):
"""Returns the string name of an enum value.
This is just a small helper method to simplify a common operation.
Args:
enum: string name of the Enum.
value: int, value of the enum.
Returns:
string name of the enum value.
Raises:
KeyErr... | [
"def",
"EnumValueName",
"(",
"self",
",",
"enum",
",",
"value",
")",
":",
"return",
"self",
".",
"enum_types_by_name",
"[",
"enum",
"]",
".",
"values_by_number",
"[",
"value",
"]",
".",
"name"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/descriptor.py#L272-L288 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBExpressionOptions.GetREPLMode | (self) | return _lldb.SBExpressionOptions_GetREPLMode(self) | GetREPLMode(SBExpressionOptions self) -> bool | GetREPLMode(SBExpressionOptions self) -> bool | [
"GetREPLMode",
"(",
"SBExpressionOptions",
"self",
")",
"-",
">",
"bool"
] | def GetREPLMode(self):
"""GetREPLMode(SBExpressionOptions self) -> bool"""
return _lldb.SBExpressionOptions_GetREPLMode(self) | [
"def",
"GetREPLMode",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBExpressionOptions_GetREPLMode",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L5060-L5062 | |
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/containers.py | python | RepeatedCompositeFieldContainer.add | (self, **kwargs) | return new_element | Adds a new element at the end of the list and returns it. Keyword
arguments may be used to initialize the element. | Adds a new element at the end of the list and returns it. Keyword
arguments may be used to initialize the element. | [
"Adds",
"a",
"new",
"element",
"at",
"the",
"end",
"of",
"the",
"list",
"and",
"returns",
"it",
".",
"Keyword",
"arguments",
"may",
"be",
"used",
"to",
"initialize",
"the",
"element",
"."
] | def add(self, **kwargs):
"""Adds a new element at the end of the list and returns it. Keyword
arguments may be used to initialize the element.
"""
new_element = self._message_descriptor._concrete_class(**kwargs)
new_element._SetListener(self._message_listener)
self._values.append(new_element)
... | [
"def",
"add",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"new_element",
"=",
"self",
".",
"_message_descriptor",
".",
"_concrete_class",
"(",
"*",
"*",
"kwargs",
")",
"new_element",
".",
"_SetListener",
"(",
"self",
".",
"_message_listener",
")",
"sel... | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/containers.py#L207-L216 | |
danxuhk/ContinuousCRF-CNN | 2b6dcaf179620f118b225ed12c890414ca828e21 | 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/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/python/caffe/coord_map.py#L18-L37 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | FileCtrl.GetFilterIndex | (*args, **kwargs) | return _controls_.FileCtrl_GetFilterIndex(*args, **kwargs) | GetFilterIndex(self) -> int | GetFilterIndex(self) -> int | [
"GetFilterIndex",
"(",
"self",
")",
"-",
">",
"int"
] | def GetFilterIndex(*args, **kwargs):
"""GetFilterIndex(self) -> int"""
return _controls_.FileCtrl_GetFilterIndex(*args, **kwargs) | [
"def",
"GetFilterIndex",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"FileCtrl_GetFilterIndex",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L7644-L7646 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/math_grad.py | python | _BesselI1Grad | (op, grad) | Compute gradient of bessel_i1(x) with respect to its argument. | Compute gradient of bessel_i1(x) with respect to its argument. | [
"Compute",
"gradient",
"of",
"bessel_i1",
"(",
"x",
")",
"with",
"respect",
"to",
"its",
"argument",
"."
] | def _BesselI1Grad(op, grad):
"""Compute gradient of bessel_i1(x) with respect to its argument."""
x = op.inputs[0]
y = op.outputs[0]
with ops.control_dependencies([grad]):
# For x = 0, the correct gradient is 1.0.
# However, the main branch gives NaN because of the division by x, so
# we impute the ... | [
"def",
"_BesselI1Grad",
"(",
"op",
",",
"grad",
")",
":",
"x",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"y",
"=",
"op",
".",
"outputs",
"[",
"0",
"]",
"with",
"ops",
".",
"control_dependencies",
"(",
"[",
"grad",
"]",
")",
":",
"# For x = 0, the co... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_grad.py#L947-L960 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/volumes/fs/volume.py | python | VolumeClient.volume_exception_to_retval | (self, ve) | return ve.to_tuple() | return a tuple representation from a volume exception | return a tuple representation from a volume exception | [
"return",
"a",
"tuple",
"representation",
"from",
"a",
"volume",
"exception"
] | def volume_exception_to_retval(self, ve):
"""
return a tuple representation from a volume exception
"""
return ve.to_tuple() | [
"def",
"volume_exception_to_retval",
"(",
"self",
",",
"ve",
")",
":",
"return",
"ve",
".",
"to_tuple",
"(",
")"
] | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/volumes/fs/volume.py#L86-L90 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/debug/wrappers/framework.py | python | BaseDebugWrapperSession.on_session_init | (self, request) | Callback invoked during construction of the debug-wrapper session.
This is a blocking callback.
The invocation happens right before the constructor ends.
Args:
request: (`OnSessionInitRequest`) callback request carrying information
such as the session being wrapped.
Returns:
An in... | Callback invoked during construction of the debug-wrapper session. | [
"Callback",
"invoked",
"during",
"construction",
"of",
"the",
"debug",
"-",
"wrapper",
"session",
"."
] | def on_session_init(self, request):
"""Callback invoked during construction of the debug-wrapper session.
This is a blocking callback.
The invocation happens right before the constructor ends.
Args:
request: (`OnSessionInitRequest`) callback request carrying information
such as the sessi... | [
"def",
"on_session_init",
"(",
"self",
",",
"request",
")",
":"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/wrappers/framework.py#L623-L635 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/base/ViewerBase.py | python | ViewerBase.preferencesWidget | (self) | return self.currentWidget().preferencesWidget() | Return the preference widget.
We only need one widget, so we just use the current tab
since they should all be the same. | Return the preference widget.
We only need one widget, so we just use the current tab
since they should all be the same. | [
"Return",
"the",
"preference",
"widget",
".",
"We",
"only",
"need",
"one",
"widget",
"so",
"we",
"just",
"use",
"the",
"current",
"tab",
"since",
"they",
"should",
"all",
"be",
"the",
"same",
"."
] | def preferencesWidget(self):
"""
Return the preference widget.
We only need one widget, so we just use the current tab
since they should all be the same.
"""
return self.currentWidget().preferencesWidget() | [
"def",
"preferencesWidget",
"(",
"self",
")",
":",
"return",
"self",
".",
"currentWidget",
"(",
")",
".",
"preferencesWidget",
"(",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/base/ViewerBase.py#L85-L91 | |
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | plugins/wb.admin/backend/wb_admin_perfschema_instrumentation_be.py | python | PSInstrumentGroup.update_parents_state | (self, attr) | Updates the parent's states based on the children
status on a line of the hierarchy tree. | Updates the parent's states based on the children
status on a line of the hierarchy tree. | [
"Updates",
"the",
"parent",
"s",
"states",
"based",
"on",
"the",
"children",
"status",
"on",
"a",
"line",
"of",
"the",
"hierarchy",
"tree",
"."
] | def update_parents_state(self, attr):
"""
Updates the parent's states based on the children
status on a line of the hierarchy tree.
"""
parent = self.parent
while parent:
parent.set_state_from_children(attr)
parent = parent.parent | [
"def",
"update_parents_state",
"(",
"self",
",",
"attr",
")",
":",
"parent",
"=",
"self",
".",
"parent",
"while",
"parent",
":",
"parent",
".",
"set_state_from_children",
"(",
"attr",
")",
"parent",
"=",
"parent",
".",
"parent"
] | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/plugins/wb.admin/backend/wb_admin_perfschema_instrumentation_be.py#L75-L84 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | DateTime.IsEqualTo | (*args, **kwargs) | return _misc_.DateTime_IsEqualTo(*args, **kwargs) | IsEqualTo(self, DateTime datetime) -> bool | IsEqualTo(self, DateTime datetime) -> bool | [
"IsEqualTo",
"(",
"self",
"DateTime",
"datetime",
")",
"-",
">",
"bool"
] | def IsEqualTo(*args, **kwargs):
"""IsEqualTo(self, DateTime datetime) -> bool"""
return _misc_.DateTime_IsEqualTo(*args, **kwargs) | [
"def",
"IsEqualTo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_IsEqualTo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L4025-L4027 | |
emsec/hal | 58d15b895723b8527302b740582613b82cb9aa80 | tools/skywater_to_liberty.py | python | convert_gate_type_to_liberty | (path) | return gate_type_string | Generate a string that represents a cell type in liberty format. Take the information from the description.json
and any .lib.json file in the cell folder.
:param path: The path to the cell folder.
:return: The string | Generate a string that represents a cell type in liberty format. Take the information from the description.json
and any .lib.json file in the cell folder. | [
"Generate",
"a",
"string",
"that",
"represents",
"a",
"cell",
"type",
"in",
"liberty",
"format",
".",
"Take",
"the",
"information",
"from",
"the",
"description",
".",
"json",
"and",
"any",
".",
"lib",
".",
"json",
"file",
"in",
"the",
"cell",
"folder",
"... | def convert_gate_type_to_liberty(path):
"""
Generate a string that represents a cell type in liberty format. Take the information from the description.json
and any .lib.json file in the cell folder.
:param path: The path to the cell folder.
:return: The string
"""
global library_name
ga... | [
"def",
"convert_gate_type_to_liberty",
"(",
"path",
")",
":",
"global",
"library_name",
"gate_type_string",
"=",
"\"\"",
"# Open any .lib.json file",
"lib_json_data",
"=",
"None",
"for",
"file",
"in",
"os",
".",
"scandir",
"(",
"path",
")",
":",
"if",
"file",
".... | https://github.com/emsec/hal/blob/58d15b895723b8527302b740582613b82cb9aa80/tools/skywater_to_liberty.py#L101-L157 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/Descriptors/Parser.py | python | SUM | (strArg, composList, atomDict) | return accum | *Calculator Method*
calculates the sum of a descriptor across a composition
**Arguments**
- strArg: the arguments in string form
- compos: the composition vector
- atomDict: the atomic dictionary
**Returns**
a float | *Calculator Method* | [
"*",
"Calculator",
"Method",
"*"
] | def SUM(strArg, composList, atomDict):
""" *Calculator Method*
calculates the sum of a descriptor across a composition
**Arguments**
- strArg: the arguments in string form
- compos: the composition vector
- atomDict: the atomic dictionary
**Returns**
a float
"""
accum =... | [
"def",
"SUM",
"(",
"strArg",
",",
"composList",
",",
"atomDict",
")",
":",
"accum",
"=",
"0.0",
"for",
"atom",
",",
"num",
"in",
"composList",
":",
"tStr",
"=",
"strArg",
".",
"replace",
"(",
"'DEADBEEF'",
",",
"atom",
")",
"accum",
"=",
"accum",
"+"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Descriptors/Parser.py#L96-L118 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Interface/ui/sans_isis/sans_data_processor_gui.py | python | SANSDataProcessorGui.set_out_default_user_file | (self) | Load a default user file, called on view set-up | Load a default user file, called on view set-up | [
"Load",
"a",
"default",
"user",
"file",
"called",
"on",
"view",
"set",
"-",
"up"
] | def set_out_default_user_file(self):
"""
Load a default user file, called on view set-up
"""
if self.get_user_file_path() != "":
self._call_settings_listeners(lambda listener: listener.on_user_file_load()) | [
"def",
"set_out_default_user_file",
"(",
"self",
")",
":",
"if",
"self",
".",
"get_user_file_path",
"(",
")",
"!=",
"\"\"",
":",
"self",
".",
"_call_settings_listeners",
"(",
"lambda",
"listener",
":",
"listener",
".",
"on_user_file_load",
"(",
")",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Interface/ui/sans_isis/sans_data_processor_gui.py#L594-L599 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/memory_inspector/memory_inspector/data/file_storage.py | python | Storage.ListArchives | (self) | return sorted(
[name for name in os.listdir(self._root)
if os.path.isdir(os.path.join(self._root, name))]) | Lists archives. Each of them is a sub-folder inside the |root_path|. | Lists archives. Each of them is a sub-folder inside the |root_path|. | [
"Lists",
"archives",
".",
"Each",
"of",
"them",
"is",
"a",
"sub",
"-",
"folder",
"inside",
"the",
"|root_path|",
"."
] | def ListArchives(self):
"""Lists archives. Each of them is a sub-folder inside the |root_path|."""
return sorted(
[name for name in os.listdir(self._root)
if os.path.isdir(os.path.join(self._root, name))]) | [
"def",
"ListArchives",
"(",
"self",
")",
":",
"return",
"sorted",
"(",
"[",
"name",
"for",
"name",
"in",
"os",
".",
"listdir",
"(",
"self",
".",
"_root",
")",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/memory_inspector/memory_inspector/data/file_storage.py#L57-L61 | |
Illumina/hap.py | 84011695b2ff2406c16a335106db6831fb67fdfe | src/python/Tools/__init__.py | python | mkdir_p | (path) | mkdir -p path | mkdir -p path | [
"mkdir",
"-",
"p",
"path"
] | def mkdir_p(path):
""" mkdir -p path """
try:
os.makedirs(os.path.abspath(path))
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
if not os.path.isdir(path):
raise Exception("Failed to cre... | [
"def",
"mkdir_p",
"(",
"path",
")",
":",
"try",
":",
"os",
".",
"makedirs",
"(",
"os",
".",
"path",
".",
"abspath",
"(",
"path",
")",
")",
"except",
"OSError",
"as",
"exc",
":",
"# Python >2.5",
"if",
"exc",
".",
"errno",
"==",
"errno",
".",
"EEXIS... | https://github.com/Illumina/hap.py/blob/84011695b2ff2406c16a335106db6831fb67fdfe/src/python/Tools/__init__.py#L162-L172 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/cr/cr/base/host.py | python | Host.SearchPath | (cls, name) | return result | Searches the PATH for an executable.
Args:
name: the name of the binary to search for.
Returns:
the set of executables found, or an empty list if none. | Searches the PATH for an executable. | [
"Searches",
"the",
"PATH",
"for",
"an",
"executable",
"."
] | def SearchPath(cls, name):
"""Searches the PATH for an executable.
Args:
name: the name of the binary to search for.
Returns:
the set of executables found, or an empty list if none.
"""
result = []
extensions = ['']
extensions.extend(os.environ.get('PATHEXT', '').split(os.pathse... | [
"def",
"SearchPath",
"(",
"cls",
",",
"name",
")",
":",
"result",
"=",
"[",
"]",
"extensions",
"=",
"[",
"''",
"]",
"extensions",
".",
"extend",
"(",
"os",
".",
"environ",
".",
"get",
"(",
"'PATHEXT'",
",",
"''",
")",
".",
"split",
"(",
"os",
"."... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/cr/cr/base/host.py#L164-L181 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/tree.py | python | TreeItem.OnDoubleClick | (self) | Called on a double-click on the item. | Called on a double-click on the item. | [
"Called",
"on",
"a",
"double",
"-",
"click",
"on",
"the",
"item",
"."
] | def OnDoubleClick(self):
"""Called on a double-click on the item.""" | [
"def",
"OnDoubleClick",
"(",
"self",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/tree.py#L387-L388 | ||
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/common.py | python | FindQualifiedTargets | (target, qualified_list) | return [t for t in qualified_list if ParseQualifiedTarget(t)[1] == target] | Given a list of qualified targets, return the qualified targets for the
specified |target|. | Given a list of qualified targets, return the qualified targets for the
specified |target|. | [
"Given",
"a",
"list",
"of",
"qualified",
"targets",
"return",
"the",
"qualified",
"targets",
"for",
"the",
"specified",
"|target|",
"."
] | def FindQualifiedTargets(target, qualified_list):
"""
Given a list of qualified targets, return the qualified targets for the
specified |target|.
"""
return [t for t in qualified_list if ParseQualifiedTarget(t)[1] == target] | [
"def",
"FindQualifiedTargets",
"(",
"target",
",",
"qualified_list",
")",
":",
"return",
"[",
"t",
"for",
"t",
"in",
"qualified_list",
"if",
"ParseQualifiedTarget",
"(",
"t",
")",
"[",
"1",
"]",
"==",
"target",
"]"
] | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/common.py#L48-L53 | |
xiaolonw/caffe-video_triplet | c39ea1ad6e937ccf7deba4510b7e555165abf05f | scripts/cpp_lint.py | python | _NestingState.InnermostClass | (self) | return None | Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise. | Get class info on the top of the stack. | [
"Get",
"class",
"info",
"on",
"the",
"top",
"of",
"the",
"stack",
"."
] | def InnermostClass(self):
"""Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise.
"""
for i in range(len(self.stack), 0, -1):
classinfo = self.stack[i - 1]
if isinstance(classinfo, _ClassInfo):
return classinfo
r... | [
"def",
"InnermostClass",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"stack",
")",
",",
"0",
",",
"-",
"1",
")",
":",
"classinfo",
"=",
"self",
".",
"stack",
"[",
"i",
"-",
"1",
"]",
"if",
"isinstance",
"(",
... | https://github.com/xiaolonw/caffe-video_triplet/blob/c39ea1ad6e937ccf7deba4510b7e555165abf05f/scripts/cpp_lint.py#L2160-L2170 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/plugins/grassprovider/ext/v_net.py | python | incorporatePoints | (alg, parameters, context, feedback, pointLayerName='points', networkLayerName='input') | incorporate points with lines to form a GRASS network | incorporate points with lines to form a GRASS network | [
"incorporate",
"points",
"with",
"lines",
"to",
"form",
"a",
"GRASS",
"network"
] | def incorporatePoints(alg, parameters, context, feedback, pointLayerName='points', networkLayerName='input'):
"""
incorporate points with lines to form a GRASS network
"""
# Grab the point layer and delete this parameter
pointLayer = alg.parameterAsVectorLayer(parameters, pointLayerName, context)
... | [
"def",
"incorporatePoints",
"(",
"alg",
",",
"parameters",
",",
"context",
",",
"feedback",
",",
"pointLayerName",
"=",
"'points'",
",",
"networkLayerName",
"=",
"'input'",
")",
":",
"# Grab the point layer and delete this parameter",
"pointLayer",
"=",
"alg",
".",
... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/grassprovider/ext/v_net.py#L33-L75 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py | python | IMetadataProvider.get_metadata_lines | (name) | Yield named metadata resource as list of non-blank non-comment lines
Leading and trailing whitespace is stripped from each line, and lines
with ``#`` as the first non-blank character are omitted. | Yield named metadata resource as list of non-blank non-comment lines | [
"Yield",
"named",
"metadata",
"resource",
"as",
"list",
"of",
"non",
"-",
"blank",
"non",
"-",
"comment",
"lines"
] | def get_metadata_lines(name):
"""Yield named metadata resource as list of non-blank non-comment lines
Leading and trailing whitespace is stripped from each line, and lines
with ``#`` as the first non-blank character are omitted.""" | [
"def",
"get_metadata_lines",
"(",
"name",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py#L510-L514 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/Custom_AccessControl.py | python | _get_role_mapping | (role_mapping_metadata, problems) | return {
'Effect': effect,
'AbstractRole': abstract_role_list
} | Constructs a role mapping from resource metadata.
Args:
role_mapping_metadata - The resource metadata.
{
"AbstractRole": [ "<resource-group-name>.<abstract-role-name>", ... ], # required list or single string
"Effect": "<allow-or-deny>", ... | Constructs a role mapping from resource metadata. | [
"Constructs",
"a",
"role",
"mapping",
"from",
"resource",
"metadata",
"."
] | def _get_role_mapping(role_mapping_metadata, problems):
"""Constructs a role mapping from resource metadata.
Args:
role_mapping_metadata - The resource metadata.
{
"AbstractRole": [ "<resource-group-name>.<abstract-role-name>", ... ], # required list or single string
... | [
"def",
"_get_role_mapping",
"(",
"role_mapping_metadata",
",",
"problems",
")",
":",
"# Validate the mapping is a dict with the required properties",
"# and only supported properties.",
"if",
"not",
"isinstance",
"(",
"role_mapping_metadata",
",",
"dict",
")",
":",
"problems",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/Custom_AccessControl.py#L808-L852 | |
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/rfc2217.py | python | Serial.rfc2217_send_subnegotiation | (self, option, value=b'') | Subnegotiation of RFC2217 parameters. | Subnegotiation of RFC2217 parameters. | [
"Subnegotiation",
"of",
"RFC2217",
"parameters",
"."
] | def rfc2217_send_subnegotiation(self, option, value=b''):
"""Subnegotiation of RFC2217 parameters."""
value = value.replace(IAC, IAC_DOUBLED)
self._internal_raw_write(IAC + SB + COM_PORT_OPTION + option + value + IAC + SE) | [
"def",
"rfc2217_send_subnegotiation",
"(",
"self",
",",
"option",
",",
"value",
"=",
"b''",
")",
":",
"value",
"=",
"value",
".",
"replace",
"(",
"IAC",
",",
"IAC_DOUBLED",
")",
"self",
".",
"_internal_raw_write",
"(",
"IAC",
"+",
"SB",
"+",
"COM_PORT_OPTI... | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/rfc2217.py#L858-L861 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetComputedDefines | (self, config) | return defines | Returns the set of defines that are injected to the defines list based
on other VS settings. | Returns the set of defines that are injected to the defines list based
on other VS settings. | [
"Returns",
"the",
"set",
"of",
"defines",
"that",
"are",
"injected",
"to",
"the",
"defines",
"list",
"based",
"on",
"other",
"VS",
"settings",
"."
] | def GetComputedDefines(self, config):
"""Returns the set of defines that are injected to the defines list based
on other VS settings."""
config = self._RealConfig(config)
defines = []
if self._ConfigAttrib(['CharacterSet'], config) == '1':
defines.extend(('_UNICODE', 'UNICODE'))
if self._C... | [
"def",
"GetComputedDefines",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_RealConfig",
"(",
"config",
")",
"defines",
"=",
"[",
"]",
"if",
"self",
".",
"_ConfigAttrib",
"(",
"[",
"'CharacterSet'",
"]",
",",
"config",
")",
"==",
"... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py#L254-L265 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/keras/_impl/keras/estimator.py | python | _create_ordered_io | (keras_model, estimator_io_dict, is_input=True) | return tensors | Create a list of tensors from IO dictionary based on Keras IO order.
Args:
keras_model: an instance of compiled keras model.
estimator_io_dict: features or labels dictionary from model_fn.
is_input: True if dictionary is for inputs.
Returns:
a list of tensors based on Keras IO order.
Raises:
... | Create a list of tensors from IO dictionary based on Keras IO order. | [
"Create",
"a",
"list",
"of",
"tensors",
"from",
"IO",
"dictionary",
"based",
"on",
"Keras",
"IO",
"order",
"."
] | def _create_ordered_io(keras_model, estimator_io_dict, is_input=True):
"""Create a list of tensors from IO dictionary based on Keras IO order.
Args:
keras_model: an instance of compiled keras model.
estimator_io_dict: features or labels dictionary from model_fn.
is_input: True if dictionary is for inpu... | [
"def",
"_create_ordered_io",
"(",
"keras_model",
",",
"estimator_io_dict",
",",
"is_input",
"=",
"True",
")",
":",
"if",
"is_input",
":",
"keras_io_names",
"=",
"keras_model",
".",
"input_names",
"else",
":",
"keras_io_names",
"=",
"keras_model",
".",
"output_name... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/estimator.py#L38-L67 | |
lmb-freiburg/ogn | 974f72ef4bf840d6f6693d22d1843a79223e77ce | python/caffe/pycaffe.py | python | _Net_params | (self) | return self._params_dict | An OrderedDict (bottom to top, i.e., input to output) of network
parameters indexed by name; each is a list of multiple blobs (e.g.,
weights and biases) | An OrderedDict (bottom to top, i.e., input to output) of network
parameters indexed by name; each is a list of multiple blobs (e.g.,
weights and biases) | [
"An",
"OrderedDict",
"(",
"bottom",
"to",
"top",
"i",
".",
"e",
".",
"input",
"to",
"output",
")",
"of",
"network",
"parameters",
"indexed",
"by",
"name",
";",
"each",
"is",
"a",
"list",
"of",
"multiple",
"blobs",
"(",
"e",
".",
"g",
".",
"weights",
... | def _Net_params(self):
"""
An OrderedDict (bottom to top, i.e., input to output) of network
parameters indexed by name; each is a list of multiple blobs (e.g.,
weights and biases)
"""
if not hasattr(self, '_params_dict'):
self._params_dict = OrderedDict([(name, lr.blobs)
... | [
"def",
"_Net_params",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_params_dict'",
")",
":",
"self",
".",
"_params_dict",
"=",
"OrderedDict",
"(",
"[",
"(",
"name",
",",
"lr",
".",
"blobs",
")",
"for",
"name",
",",
"lr",
"in",
... | https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/python/caffe/pycaffe.py#L58-L69 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/tool/postprocess_interface.py | python | PostProcessor.Process | (self, rctext, rcpath, grdnode) | Processes the data in rctext and grdnode.
Args:
rctext: string containing the contents of the RC file being processed.
rcpath: the path used to access the file.
grdtext: the root node of the grd xml data generated by
the rc2grd tool.
Return:
The root node of the processed GRD tree... | Processes the data in rctext and grdnode.
Args:
rctext: string containing the contents of the RC file being processed.
rcpath: the path used to access the file.
grdtext: the root node of the grd xml data generated by
the rc2grd tool. | [
"Processes",
"the",
"data",
"in",
"rctext",
"and",
"grdnode",
".",
"Args",
":",
"rctext",
":",
"string",
"containing",
"the",
"contents",
"of",
"the",
"RC",
"file",
"being",
"processed",
".",
"rcpath",
":",
"the",
"path",
"used",
"to",
"access",
"the",
"... | def Process(self, rctext, rcpath, grdnode):
''' Processes the data in rctext and grdnode.
Args:
rctext: string containing the contents of the RC file being processed.
rcpath: the path used to access the file.
grdtext: the root node of the grd xml data generated by
the rc2grd tool.
R... | [
"def",
"Process",
"(",
"self",
",",
"rctext",
",",
"rcpath",
",",
"grdnode",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/tool/postprocess_interface.py#L18-L29 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/optparse.py | python | HelpFormatter.format_option_strings | (self, option) | return ", ".join(opts) | Return a comma-separated list of option strings & metavariables. | Return a comma-separated list of option strings & metavariables. | [
"Return",
"a",
"comma",
"-",
"separated",
"list",
"of",
"option",
"strings",
"&",
"metavariables",
"."
] | def format_option_strings(self, option):
"""Return a comma-separated list of option strings & metavariables."""
if option.takes_value():
metavar = option.metavar or option.dest.upper()
short_opts = [self._short_opt_fmt % (sopt, metavar)
for sopt in optio... | [
"def",
"format_option_strings",
"(",
"self",
",",
"option",
")",
":",
"if",
"option",
".",
"takes_value",
"(",
")",
":",
"metavar",
"=",
"option",
".",
"metavar",
"or",
"option",
".",
"dest",
".",
"upper",
"(",
")",
"short_opts",
"=",
"[",
"self",
".",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/optparse.py#L342-L359 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/transforms.py | python | _legalize_withs_cfg | (withs, cfg, blocks) | Verify the CFG of the with-context(s). | Verify the CFG of the with-context(s). | [
"Verify",
"the",
"CFG",
"of",
"the",
"with",
"-",
"context",
"(",
"s",
")",
"."
] | def _legalize_withs_cfg(withs, cfg, blocks):
"""Verify the CFG of the with-context(s).
"""
doms = cfg.dominators()
postdoms = cfg.post_dominators()
# Verify that the with-context has no side-exits
for s, e in withs:
loc = blocks[s].loc
if s not in doms[e]:
# Not sure... | [
"def",
"_legalize_withs_cfg",
"(",
"withs",
",",
"cfg",
",",
"blocks",
")",
":",
"doms",
"=",
"cfg",
".",
"dominators",
"(",
")",
"postdoms",
"=",
"cfg",
".",
"post_dominators",
"(",
")",
"# Verify that the with-context has no side-exits",
"for",
"s",
",",
"e"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/transforms.py#L477-L496 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/hsadrv/driver.py | python | Driver.implicit_sync | (self) | Implicit synchronization for all asynchronous streams
across all devices. | Implicit synchronization for all asynchronous streams
across all devices. | [
"Implicit",
"synchronization",
"for",
"all",
"asynchronous",
"streams",
"across",
"all",
"devices",
"."
] | def implicit_sync(self):
"""
Implicit synchronization for all asynchronous streams
across all devices.
"""
_logger.info("implicit sync")
for st in self._active_streams:
st.synchronize() | [
"def",
"implicit_sync",
"(",
"self",
")",
":",
"_logger",
".",
"info",
"(",
"\"implicit sync\"",
")",
"for",
"st",
"in",
"self",
".",
"_active_streams",
":",
"st",
".",
"synchronize",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/hsadrv/driver.py#L347-L354 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/stats/morestats.py | python | ppcc_max | (x, brack=(0.0, 1.0), dist='tukeylambda') | return optimize.brent(tempfunc, brack=brack, args=(osm_uniform, osr, dist.ppf)) | Calculate the shape parameter that maximizes the PPCC
The probability plot correlation coefficient (PPCC) plot can be used to
determine the optimal shape parameter for a one-parameter family of
distributions. ppcc_max returns the shape parameter that would maximize the
probability plot correlation coe... | Calculate the shape parameter that maximizes the PPCC | [
"Calculate",
"the",
"shape",
"parameter",
"that",
"maximizes",
"the",
"PPCC"
] | def ppcc_max(x, brack=(0.0, 1.0), dist='tukeylambda'):
"""
Calculate the shape parameter that maximizes the PPCC
The probability plot correlation coefficient (PPCC) plot can be used to
determine the optimal shape parameter for a one-parameter family of
distributions. ppcc_max returns the shape par... | [
"def",
"ppcc_max",
"(",
"x",
",",
"brack",
"=",
"(",
"0.0",
",",
"1.0",
")",
",",
"dist",
"=",
"'tukeylambda'",
")",
":",
"dist",
"=",
"_parse_dist_kw",
"(",
"dist",
")",
"osm_uniform",
"=",
"_calc_uniform_order_statistic_medians",
"(",
"len",
"(",
"x",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/morestats.py#L630-L718 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | VarVScrollHelper.ScrollToRow | (*args, **kwargs) | return _windows_.VarVScrollHelper_ScrollToRow(*args, **kwargs) | ScrollToRow(self, size_t row) -> bool | ScrollToRow(self, size_t row) -> bool | [
"ScrollToRow",
"(",
"self",
"size_t",
"row",
")",
"-",
">",
"bool"
] | def ScrollToRow(*args, **kwargs):
"""ScrollToRow(self, size_t row) -> bool"""
return _windows_.VarVScrollHelper_ScrollToRow(*args, **kwargs) | [
"def",
"ScrollToRow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"VarVScrollHelper_ScrollToRow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L2277-L2279 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | GridSizer.SetHGap | (*args, **kwargs) | return _core_.GridSizer_SetHGap(*args, **kwargs) | SetHGap(self, int gap)
Sets the horizontal gap (in pixels) between cells in the sizer | SetHGap(self, int gap) | [
"SetHGap",
"(",
"self",
"int",
"gap",
")"
] | def SetHGap(*args, **kwargs):
"""
SetHGap(self, int gap)
Sets the horizontal gap (in pixels) between cells in the sizer
"""
return _core_.GridSizer_SetHGap(*args, **kwargs) | [
"def",
"SetHGap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"GridSizer_SetHGap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L15229-L15235 | |
cksystemsgroup/scal | fa2208a97a77d65f4e90f85fef3404c27c1f2ac2 | tools/cpplint.py | python | ProcessFileData | (filename, file_extension, lines, error,
extra_check_functions=[]) | Performs lint checks and reports any errors to the given error function.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
lines: An array of strings, each representing a line of the file, with the
last element being emp... | Performs lint checks and reports any errors to the given error function. | [
"Performs",
"lint",
"checks",
"and",
"reports",
"any",
"errors",
"to",
"the",
"given",
"error",
"function",
"."
] | def ProcessFileData(filename, file_extension, lines, error,
extra_check_functions=[]):
"""Performs lint checks and reports any errors to the given error function.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
... | [
"def",
"ProcessFileData",
"(",
"filename",
",",
"file_extension",
",",
"lines",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"lines",
"=",
"(",
"[",
"'// marker so line numbers and indices both start at 1'",
"]",
"+",
"lines",
"+",
"[",
"... | https://github.com/cksystemsgroup/scal/blob/fa2208a97a77d65f4e90f85fef3404c27c1f2ac2/tools/cpplint.py#L5997-L6046 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/data/ops/dataset_ops.py | python | RepeatDataset.__init__ | (self, input_dataset, count, name=None) | See `Dataset.repeat()` for details. | See `Dataset.repeat()` for details. | [
"See",
"Dataset",
".",
"repeat",
"()",
"for",
"details",
"."
] | def __init__(self, input_dataset, count, name=None):
"""See `Dataset.repeat()` for details."""
self._input_dataset = input_dataset
if count is None:
self._count = constant_op.constant(-1, dtype=dtypes.int64, name="count")
else:
self._count = ops.convert_to_tensor(
count, dtype=dtyp... | [
"def",
"__init__",
"(",
"self",
",",
"input_dataset",
",",
"count",
",",
"name",
"=",
"None",
")",
":",
"self",
".",
"_input_dataset",
"=",
"input_dataset",
"if",
"count",
"is",
"None",
":",
"self",
".",
"_count",
"=",
"constant_op",
".",
"constant",
"("... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/data/ops/dataset_ops.py#L4708-L4721 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/compiler/pyassem.py | python | Block.pruneNext | (self) | Remove bogus edge for unconditional transfers
Each block has a next edge that accounts for implicit control
transfers, e.g. from a JUMP_IF_FALSE to the block that will be
executed if the test is true.
These edges must remain for the current assembler code to
work. If they are r... | Remove bogus edge for unconditional transfers | [
"Remove",
"bogus",
"edge",
"for",
"unconditional",
"transfers"
] | def pruneNext(self):
"""Remove bogus edge for unconditional transfers
Each block has a next edge that accounts for implicit control
transfers, e.g. from a JUMP_IF_FALSE to the block that will be
executed if the test is true.
These edges must remain for the current assembler cod... | [
"def",
"pruneNext",
"(",
"self",
")",
":",
"try",
":",
"op",
",",
"arg",
"=",
"self",
".",
"insts",
"[",
"-",
"1",
"]",
"except",
"(",
"IndexError",
",",
"ValueError",
")",
":",
"return",
"if",
"op",
"in",
"self",
".",
"_uncond_transfer",
":",
"sel... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/compiler/pyassem.py#L264-L283 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/imputils.py | python | impl_ret_new_ref | (ctx, builder, retty, ret) | return ret | The implementation returns a new reference. | The implementation returns a new reference. | [
"The",
"implementation",
"returns",
"a",
"new",
"reference",
"."
] | def impl_ret_new_ref(ctx, builder, retty, ret):
"""
The implementation returns a new reference.
"""
return ret | [
"def",
"impl_ret_new_ref",
"(",
"ctx",
",",
"builder",
",",
"retty",
",",
"ret",
")",
":",
"return",
"ret"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/imputils.py#L422-L426 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/ConfigParser.py | python | RawConfigParser.has_option | (self, section, option) | Check for the existence of a given option in a given section. | Check for the existence of a given option in a given section. | [
"Check",
"for",
"the",
"existence",
"of",
"a",
"given",
"option",
"in",
"a",
"given",
"section",
"."
] | def has_option(self, section, option):
"""Check for the existence of a given option in a given section."""
if not section or section == DEFAULTSECT:
option = self.optionxform(option)
return option in self._defaults
elif section not in self._sections:
return Fa... | [
"def",
"has_option",
"(",
"self",
",",
"section",
",",
"option",
")",
":",
"if",
"not",
"section",
"or",
"section",
"==",
"DEFAULTSECT",
":",
"option",
"=",
"self",
".",
"optionxform",
"(",
"option",
")",
"return",
"option",
"in",
"self",
".",
"_defaults... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/ConfigParser.py#L357-L367 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Configuration/AlCa/python/autoAlca.py | python | buildList | (pdList, matrix) | return stringList | Takes a list of primary datasets (PDs) and the AlCaRecoMatrix (a dictinary) and returns a string with all the AlCaRecos for the selected PDs separated by the '+' character without duplicates. | Takes a list of primary datasets (PDs) and the AlCaRecoMatrix (a dictinary) and returns a string with all the AlCaRecos for the selected PDs separated by the '+' character without duplicates. | [
"Takes",
"a",
"list",
"of",
"primary",
"datasets",
"(",
"PDs",
")",
"and",
"the",
"AlCaRecoMatrix",
"(",
"a",
"dictinary",
")",
"and",
"returns",
"a",
"string",
"with",
"all",
"the",
"AlCaRecos",
"for",
"the",
"selected",
"PDs",
"separated",
"by",
"the",
... | def buildList(pdList, matrix):
"""Takes a list of primary datasets (PDs) and the AlCaRecoMatrix (a dictinary) and returns a string with all the AlCaRecos for the selected PDs separated by the '+' character without duplicates."""
alCaRecoList = []
for pd in pdList:
alCaRecoList.extend(matrix[pd].spli... | [
"def",
"buildList",
"(",
"pdList",
",",
"matrix",
")",
":",
"alCaRecoList",
"=",
"[",
"]",
"for",
"pd",
"in",
"pdList",
":",
"alCaRecoList",
".",
"extend",
"(",
"matrix",
"[",
"pd",
"]",
".",
"split",
"(",
"\"+\"",
")",
")",
"# remove duplicates converti... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Configuration/AlCa/python/autoAlca.py#L105-L118 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/timeseries/python/timeseries/state_space_models/filtering_postprocessor.py | python | StateInterpolatingAnomalyDetector.process_filtering_step | (self, current_times, current_values,
predicted_state, filtered_state, outputs) | return (interpolated_state, outputs) | Fall back on `predicted_state` for anomalies.
Args:
current_times: A [batch size] integer Tensor of times.
current_values: A [batch size x num features] Tensor of values filtering
is being performed on.
predicted_state: A (possibly nested) list of Tensors indicating model
stat... | Fall back on `predicted_state` for anomalies. | [
"Fall",
"back",
"on",
"predicted_state",
"for",
"anomalies",
"."
] | def process_filtering_step(self, current_times, current_values,
predicted_state, filtered_state, outputs):
"""Fall back on `predicted_state` for anomalies.
Args:
current_times: A [batch size] integer Tensor of times.
current_values: A [batch size x num features] Tensor ... | [
"def",
"process_filtering_step",
"(",
"self",
",",
"current_times",
",",
"current_values",
",",
"predicted_state",
",",
"filtered_state",
",",
"outputs",
")",
":",
"anomaly_log_likelihood",
"=",
"self",
".",
"_anomaly_log_likelihood",
"(",
"current_times",
"=",
"curre... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/timeseries/python/timeseries/state_space_models/filtering_postprocessor.py#L201-L263 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/message.py | python | Message.set_default_type | (self, ctype) | Set the `default' content type.
ctype should be either "text/plain" or "message/rfc822", although this
is not enforced. The default content type is not stored in the
Content-Type header. | Set the `default' content type. | [
"Set",
"the",
"default",
"content",
"type",
"."
] | def set_default_type(self, ctype):
"""Set the `default' content type.
ctype should be either "text/plain" or "message/rfc822", although this
is not enforced. The default content type is not stored in the
Content-Type header.
"""
self._default_type = ctype | [
"def",
"set_default_type",
"(",
"self",
",",
"ctype",
")",
":",
"self",
".",
"_default_type",
"=",
"ctype"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/message.py#L483-L490 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/oldnumeric/ma.py | python | _MaskedPrintOption.__init__ | (self, display) | Create the masked print option object. | Create the masked print option object. | [
"Create",
"the",
"masked",
"print",
"option",
"object",
"."
] | def __init__ (self, display):
"Create the masked print option object."
self.set_display(display)
self._enabled = 1 | [
"def",
"__init__",
"(",
"self",
",",
"display",
")",
":",
"self",
".",
"set_display",
"(",
"display",
")",
"self",
".",
"_enabled",
"=",
"1"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/oldnumeric/ma.py#L48-L51 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/quoprimime.py | python | decode | (encoded, eol=NL) | return decoded | Decode a quoted-printable string.
Lines are separated with eol, which defaults to \\n. | Decode a quoted-printable string. | [
"Decode",
"a",
"quoted",
"-",
"printable",
"string",
"."
] | def decode(encoded, eol=NL):
"""Decode a quoted-printable string.
Lines are separated with eol, which defaults to \\n.
"""
if not encoded:
return encoded
# BAW: see comment in encode() above. Again, we're building up the
# decoded string with string concatenation, which could be done m... | [
"def",
"decode",
"(",
"encoded",
",",
"eol",
"=",
"NL",
")",
":",
"if",
"not",
"encoded",
":",
"return",
"encoded",
"# BAW: see comment in encode() above. Again, we're building up the",
"# decoded string with string concatenation, which could be done much more",
"# efficiently."... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/quoprimime.py#L268-L312 | |
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | util/minorview/view.py | python | BlobView.add_control_bar | (self, controlbar) | Add a BlobController to this view | Add a BlobController to this view | [
"Add",
"a",
"BlobController",
"to",
"this",
"view"
] | def add_control_bar(self, controlbar):
"""Add a BlobController to this view"""
self.controlbar = controlbar | [
"def",
"add_control_bar",
"(",
"self",
",",
"controlbar",
")",
":",
"self",
".",
"controlbar",
"=",
"controlbar"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/util/minorview/view.py#L93-L95 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/terminal/pt_inputhooks/osx.py | python | _NSApp | () | return msg(C('NSApplication'), n('sharedApplication')) | Return the global NSApplication instance (NSApp) | Return the global NSApplication instance (NSApp) | [
"Return",
"the",
"global",
"NSApplication",
"instance",
"(",
"NSApp",
")"
] | def _NSApp():
"""Return the global NSApplication instance (NSApp)"""
return msg(C('NSApplication'), n('sharedApplication')) | [
"def",
"_NSApp",
"(",
")",
":",
"return",
"msg",
"(",
"C",
"(",
"'NSApplication'",
")",
",",
"n",
"(",
"'sharedApplication'",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/terminal/pt_inputhooks/osx.py#L78-L80 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/_linalg_utils.py | python | matmul | (A: Optional[Tensor], B: Tensor) | return torch.matmul(A, B) | Multiply two matrices.
If A is None, return B. A can be sparse or dense. B is always
dense. | Multiply two matrices. | [
"Multiply",
"two",
"matrices",
"."
] | def matmul(A: Optional[Tensor], B: Tensor) -> Tensor:
"""Multiply two matrices.
If A is None, return B. A can be sparse or dense. B is always
dense.
"""
if A is None:
return B
if is_sparse(A):
return torch.sparse.mm(A, B)
return torch.matmul(A, B) | [
"def",
"matmul",
"(",
"A",
":",
"Optional",
"[",
"Tensor",
"]",
",",
"B",
":",
"Tensor",
")",
"->",
"Tensor",
":",
"if",
"A",
"is",
"None",
":",
"return",
"B",
"if",
"is_sparse",
"(",
"A",
")",
":",
"return",
"torch",
".",
"sparse",
".",
"mm",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/_linalg_utils.py#L32-L42 | |
s9xie/DSN | 065e49898d239f5c96be558616b2556eabc50351 | scripts/cpp_lint.py | python | CheckForCopyright | (filename, lines, error) | Logs an error if no Copyright message appears at the top of the file. | Logs an error if no Copyright message appears at the top of the file. | [
"Logs",
"an",
"error",
"if",
"no",
"Copyright",
"message",
"appears",
"at",
"the",
"top",
"of",
"the",
"file",
"."
] | def CheckForCopyright(filename, lines, error):
"""Logs an error if no Copyright message appears at the top of the file."""
# We'll say it should occur by line 10. Don't forget there's a
# dummy line at the front.
for line in xrange(1, min(len(lines), 11)):
if re.search(r'Copyright', lines[line], re.I): bre... | [
"def",
"CheckForCopyright",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# We'll say it should occur by line 10. Don't forget there's a",
"# dummy line at the front.",
"for",
"line",
"in",
"xrange",
"(",
"1",
",",
"min",
"(",
"len",
"(",
"lines",
")",
","... | https://github.com/s9xie/DSN/blob/065e49898d239f5c96be558616b2556eabc50351/scripts/cpp_lint.py#L1367-L1377 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/xrc.py | python | EmptyXmlResource | (*args, **kwargs) | return val | EmptyXmlResource(int flags=XRC_USE_LOCALE, String domain=wxEmptyString) -> XmlResource | EmptyXmlResource(int flags=XRC_USE_LOCALE, String domain=wxEmptyString) -> XmlResource | [
"EmptyXmlResource",
"(",
"int",
"flags",
"=",
"XRC_USE_LOCALE",
"String",
"domain",
"=",
"wxEmptyString",
")",
"-",
">",
"XmlResource"
] | def EmptyXmlResource(*args, **kwargs):
"""EmptyXmlResource(int flags=XRC_USE_LOCALE, String domain=wxEmptyString) -> XmlResource"""
val = _xrc.new_EmptyXmlResource(*args, **kwargs)
val.InitAllHandlers()
return val | [
"def",
"EmptyXmlResource",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_xrc",
".",
"new_EmptyXmlResource",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"val",
".",
"InitAllHandlers",
"(",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/xrc.py#L244-L248 | |
AngoraFuzzer/Angora | 80e81c8590077bc0ac069dbd367da8ce405ff618 | llvm_mode/dfsan_rt/sanitizer_common/scripts/cpplint.py | python | _SetFilters | (filters) | Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Sets the module's error-message filters. | [
"Sets",
"the",
"module",
"s",
"error",
"-",
"message",
"filters",
"."
] | def _SetFilters(filters):
"""Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint... | [
"def",
"_SetFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"SetFilters",
"(",
"filters",
")"
] | https://github.com/AngoraFuzzer/Angora/blob/80e81c8590077bc0ac069dbd367da8ce405ff618/llvm_mode/dfsan_rt/sanitizer_common/scripts/cpplint.py#L661-L671 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/line-reflection.py | python | Solution2.isReflected | (self, points) | return True | :type points: List[List[int]]
:rtype: bool | :type points: List[List[int]]
:rtype: bool | [
":",
"type",
"points",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"rtype",
":",
"bool"
] | def isReflected(self, points):
"""
:type points: List[List[int]]
:rtype: bool
"""
if not points:
return True
points.sort()
# Space: O(n)
points[len(points)/2:] = sorted(points[len(points)/2:], \
lambda x,... | [
"def",
"isReflected",
"(",
"self",
",",
"points",
")",
":",
"if",
"not",
"points",
":",
"return",
"True",
"points",
".",
"sort",
"(",
")",
"# Space: O(n)",
"points",
"[",
"len",
"(",
"points",
")",
"/",
"2",
":",
"]",
"=",
"sorted",
"(",
"points",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/line-reflection.py#L33-L54 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/third_party/pyserial/serial/serialposix.py | python | PosixSerial.outWaiting | (self) | return struct.unpack('I',s)[0] | Return the number of characters currently in the output buffer. | Return the number of characters currently in the output buffer. | [
"Return",
"the",
"number",
"of",
"characters",
"currently",
"in",
"the",
"output",
"buffer",
"."
] | def outWaiting(self):
"""Return the number of characters currently in the output buffer."""
#~ s = fcntl.ioctl(self.fd, TERMIOS.FIONREAD, TIOCM_zero_str)
s = fcntl.ioctl(self.fd, TIOCOUTQ, TIOCM_zero_str)
return struct.unpack('I',s)[0] | [
"def",
"outWaiting",
"(",
"self",
")",
":",
"#~ s = fcntl.ioctl(self.fd, TERMIOS.FIONREAD, TIOCM_zero_str)",
"s",
"=",
"fcntl",
".",
"ioctl",
"(",
"self",
".",
"fd",
",",
"TIOCOUTQ",
",",
"TIOCM_zero_str",
")",
"return",
"struct",
".",
"unpack",
"(",
"'I'",
",",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/pyserial/serial/serialposix.py#L592-L596 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/mac_tool.py | python | MacTool._MergePlist | (self, merged_plist, plist) | Merge |plist| into |merged_plist|. | Merge |plist| into |merged_plist|. | [
"Merge",
"|plist|",
"into",
"|merged_plist|",
"."
] | def _MergePlist(self, merged_plist, plist):
"""Merge |plist| into |merged_plist|."""
for key, value in plist.items():
if isinstance(value, dict):
merged_value = merged_plist.get(key, {})
if isinstance(merged_value, dict):
self._MergePlist(merged_value, value)
merged_pli... | [
"def",
"_MergePlist",
"(",
"self",
",",
"merged_plist",
",",
"plist",
")",
":",
"for",
"key",
",",
"value",
"in",
"plist",
".",
"items",
"(",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"merged_value",
"=",
"merged_plist",
".",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/mac_tool.py#L524-L535 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/request.py | python | RequestMethods.request_encode_url | (self, method, url, fields=None, headers=None, **urlopen_kw) | return self.urlopen(method, url, **extra_kw) | Make a request using :meth:`urlopen` with the ``fields`` encoded in
the url. This is useful for request methods like GET, HEAD, DELETE, etc. | Make a request using :meth:`urlopen` with the ``fields`` encoded in
the url. This is useful for request methods like GET, HEAD, DELETE, etc. | [
"Make",
"a",
"request",
"using",
":",
"meth",
":",
"urlopen",
"with",
"the",
"fields",
"encoded",
"in",
"the",
"url",
".",
"This",
"is",
"useful",
"for",
"request",
"methods",
"like",
"GET",
"HEAD",
"DELETE",
"etc",
"."
] | def request_encode_url(self, method, url, fields=None, headers=None, **urlopen_kw):
"""
Make a request using :meth:`urlopen` with the ``fields`` encoded in
the url. This is useful for request methods like GET, HEAD, DELETE, etc.
"""
if headers is None:
headers = self.... | [
"def",
"request_encode_url",
"(",
"self",
",",
"method",
",",
"url",
",",
"fields",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"*",
"*",
"urlopen_kw",
")",
":",
"if",
"headers",
"is",
"None",
":",
"headers",
"=",
"self",
".",
"headers",
"extra_kw",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/request.py#L82-L96 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/platformsettings.py | python | _WindowsPlatformSettings._netsh_set_dns | (self, iface_name, addr) | Modify DNS information on the primary interface. | Modify DNS information on the primary interface. | [
"Modify",
"DNS",
"information",
"on",
"the",
"primary",
"interface",
"."
] | def _netsh_set_dns(self, iface_name, addr):
"""Modify DNS information on the primary interface."""
output = self._check_output('netsh', 'interface', 'ip', 'set', 'dns',
iface_name, 'static', addr) | [
"def",
"_netsh_set_dns",
"(",
"self",
",",
"iface_name",
",",
"addr",
")",
":",
"output",
"=",
"self",
".",
"_check_output",
"(",
"'netsh'",
",",
"'interface'",
",",
"'ip'",
",",
"'set'",
",",
"'dns'",
",",
"iface_name",
",",
"'static'",
",",
"addr",
")"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/platformsettings.py#L694-L697 | ||
liudong1983/mybus | 9e2ad1413992c952eb5ffbae143ed8f4b73f8605 | bus_manager/business/hbase/THBaseService.py | python | Client.deleteMultiple | (self, table, deletes) | return self.recv_deleteMultiple() | Bulk commit a List of TDeletes to the table.
This returns a list of TDeletes that were not
executed. So if everything succeeds you'll
receive an empty list.
Parameters:
- table: the table to delete from
- deletes: list of TDeletes to delete | Bulk commit a List of TDeletes to the table. | [
"Bulk",
"commit",
"a",
"List",
"of",
"TDeletes",
"to",
"the",
"table",
"."
] | def deleteMultiple(self, table, deletes):
"""
Bulk commit a List of TDeletes to the table.
This returns a list of TDeletes that were not
executed. So if everything succeeds you'll
receive an empty list.
Parameters:
- table: the table to delete from
- deletes: list of TDeletes to dele... | [
"def",
"deleteMultiple",
"(",
"self",
",",
"table",
",",
"deletes",
")",
":",
"self",
".",
"send_deleteMultiple",
"(",
"table",
",",
"deletes",
")",
"return",
"self",
".",
"recv_deleteMultiple",
"(",
")"
] | https://github.com/liudong1983/mybus/blob/9e2ad1413992c952eb5ffbae143ed8f4b73f8605/bus_manager/business/hbase/THBaseService.py#L490-L503 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/webapp2/webapp2.py | python | Response.out | (self) | return self | A reference to the Response instance itself, for compatibility with
webapp only: webapp uses `Response.out.write()`, so we point `out` to
`self` and it will use `Response.write()`. | A reference to the Response instance itself, for compatibility with
webapp only: webapp uses `Response.out.write()`, so we point `out` to
`self` and it will use `Response.write()`. | [
"A",
"reference",
"to",
"the",
"Response",
"instance",
"itself",
"for",
"compatibility",
"with",
"webapp",
"only",
":",
"webapp",
"uses",
"Response",
".",
"out",
".",
"write",
"()",
"so",
"we",
"point",
"out",
"to",
"self",
"and",
"it",
"will",
"use",
"R... | def out(self):
"""A reference to the Response instance itself, for compatibility with
webapp only: webapp uses `Response.out.write()`, so we point `out` to
`self` and it will use `Response.write()`.
"""
return self | [
"def",
"out",
"(",
"self",
")",
":",
"return",
"self"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2.py#L365-L370 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Misc.mainloop | (self, n=0) | Call the mainloop of Tk. | Call the mainloop of Tk. | [
"Call",
"the",
"mainloop",
"of",
"Tk",
"."
] | def mainloop(self, n=0):
"""Call the mainloop of Tk."""
self.tk.mainloop(n) | [
"def",
"mainloop",
"(",
"self",
",",
"n",
"=",
"0",
")",
":",
"self",
".",
"tk",
".",
"mainloop",
"(",
"n",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L1066-L1068 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/plugins/mapmatching/wxgui.py | python | WxGui.on_match_pt | (self, event=None) | Match selected traces with GPS points to the public transport network. A public transport network must be previously built. | Match selected traces with GPS points to the public transport network. A public transport network must be previously built. | [
"Match",
"selected",
"traces",
"with",
"GPS",
"points",
"to",
"the",
"public",
"transport",
"network",
".",
"A",
"public",
"transport",
"network",
"must",
"be",
"previously",
"built",
"."
] | def on_match_pt(self, event=None):
"""
Match selected traces with GPS points to the public transport network. A public transport network must be previously built.
"""
# self.prepare_results()
if not self.is_matchprocess('ptmatcher'):
self._matchprocess = mapmatching.... | [
"def",
"on_match_pt",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"# self.prepare_results()",
"if",
"not",
"self",
".",
"is_matchprocess",
"(",
"'ptmatcher'",
")",
":",
"self",
".",
"_matchprocess",
"=",
"mapmatching",
".",
"PTMatcher",
"(",
"'ptmatcher'... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/plugins/mapmatching/wxgui.py#L1173-L1196 | ||
lmb-freiburg/flownet2 | b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc | scripts/cpp_lint.py | python | CheckForNonConstReference | (filename, clean_lines, linenum,
nesting_state, error) | Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A... | Check for non-const references. | [
"Check",
"for",
"non",
"-",
"const",
"references",
"."
] | def CheckForNonConstReference(filename, clean_lines, linenum,
nesting_state, error):
"""Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean... | [
"def",
"CheckForNonConstReference",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Do nothing if there is no '&' on current line.",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"'&'",
"n... | https://github.com/lmb-freiburg/flownet2/blob/b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc/scripts/cpp_lint.py#L4134-L4244 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/trajectory.py | python | Trajectory.concat | (self,
suffix: 'Trajectory',
relative: bool = False,
jumpPolicy: str = 'strict'
) | return self.constructor()(times,milestones) | Returns a new trajectory with another trajectory
concatenated onto self.
Args:
suffix (Trajectory): the suffix trajectory
relative (bool): If True, then the suffix's time domain is shifted
so that self.times[-1] is added on before concatenation.
jump... | Returns a new trajectory with another trajectory
concatenated onto self. | [
"Returns",
"a",
"new",
"trajectory",
"with",
"another",
"trajectory",
"concatenated",
"onto",
"self",
"."
] | def concat(self,
suffix: 'Trajectory',
relative: bool = False,
jumpPolicy: str = 'strict'
) -> 'Trajectory':
"""Returns a new trajectory with another trajectory
concatenated onto self.
Args:
suffix (Trajectory): the suffix trajectory
... | [
"def",
"concat",
"(",
"self",
",",
"suffix",
":",
"'Trajectory'",
",",
"relative",
":",
"bool",
"=",
"False",
",",
"jumpPolicy",
":",
"str",
"=",
"'strict'",
")",
"->",
"'Trajectory'",
":",
"if",
"self",
".",
"__class__",
"is",
"not",
"suffix",
".",
"_... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/trajectory.py#L230-L276 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/metric/metrics.py | python | Accuracy.compute | (self, pred, label, *args) | return paddle.cast(correct, dtype='float32') | Compute the top-k (maximum value in `topk`) indices.
Args:
pred (Tensor): The predicted value is a Tensor with dtype
float32 or float64. Shape is [batch_size, d0, ..., dN].
label (Tensor): The ground truth value is Tensor with dtype
int64. Shape is [batch... | Compute the top-k (maximum value in `topk`) indices. | [
"Compute",
"the",
"top",
"-",
"k",
"(",
"maximum",
"value",
"in",
"topk",
")",
"indices",
"."
] | def compute(self, pred, label, *args):
"""
Compute the top-k (maximum value in `topk`) indices.
Args:
pred (Tensor): The predicted value is a Tensor with dtype
float32 or float64. Shape is [batch_size, d0, ..., dN].
label (Tensor): The ground truth value ... | [
"def",
"compute",
"(",
"self",
",",
"pred",
",",
"label",
",",
"*",
"args",
")",
":",
"pred",
"=",
"paddle",
".",
"argsort",
"(",
"pred",
",",
"descending",
"=",
"True",
")",
"pred",
"=",
"paddle",
".",
"slice",
"(",
"pred",
",",
"axes",
"=",
"["... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/metric/metrics.py#L244-L271 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/fixer_util.py | python | is_import | (node) | return node.type in (syms.import_name, syms.import_from) | Returns true if the node is an import statement. | Returns true if the node is an import statement. | [
"Returns",
"true",
"if",
"the",
"node",
"is",
"an",
"import",
"statement",
"."
] | def is_import(node):
"""Returns true if the node is an import statement."""
return node.type in (syms.import_name, syms.import_from) | [
"def",
"is_import",
"(",
"node",
")",
":",
"return",
"node",
".",
"type",
"in",
"(",
"syms",
".",
"import_name",
",",
"syms",
".",
"import_from",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/fixer_util.py#L311-L313 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/rnn/python/ops/core_rnn_cell.py | python | EmbeddingWrapper.call | (self, inputs, state) | Run the cell on embedded inputs. | Run the cell on embedded inputs. | [
"Run",
"the",
"cell",
"on",
"embedded",
"inputs",
"."
] | def call(self, inputs, state):
"""Run the cell on embedded inputs."""
with ops.device("/cpu:0"):
if self._initializer:
initializer = self._initializer
elif vs.get_variable_scope().initializer:
initializer = vs.get_variable_scope().initializer
else:
# Default initializer... | [
"def",
"call",
"(",
"self",
",",
"inputs",
",",
"state",
")",
":",
"with",
"ops",
".",
"device",
"(",
"\"/cpu:0\"",
")",
":",
"if",
"self",
".",
"_initializer",
":",
"initializer",
"=",
"self",
".",
"_initializer",
"elif",
"vs",
".",
"get_variable_scope"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/rnn/python/ops/core_rnn_cell.py#L94-L118 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/framework/meta_graph.py | python | stripped_op_list_for_graph | (graph_def) | return op_def_pb2.OpList(op=[registered_ops[op] for op in sorted(used_ops)
if op in registered_ops]) | Collect the stripped OpDefs for ops used by a graph.
This function computes the `stripped_op_list` field of `MetaGraphDef` and
similar protos. The result can be communicated from the producer to the
consumer, which can then use the C++ function
`RemoveNewDefaultAttrsFromGraphDef` to improve forwards compatibi... | Collect the stripped OpDefs for ops used by a graph. | [
"Collect",
"the",
"stripped",
"OpDefs",
"for",
"ops",
"used",
"by",
"a",
"graph",
"."
] | def stripped_op_list_for_graph(graph_def):
"""Collect the stripped OpDefs for ops used by a graph.
This function computes the `stripped_op_list` field of `MetaGraphDef` and
similar protos. The result can be communicated from the producer to the
consumer, which can then use the C++ function
`RemoveNewDefault... | [
"def",
"stripped_op_list_for_graph",
"(",
"graph_def",
")",
":",
"# This is the Python equivalent of StrippedOpListForGraph in C++.",
"# Unfortunately, since the Python op registry can differ from that in C++, we",
"# can't remove the duplication using swig (at least naively).",
"# TODO(irving): S... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/meta_graph.py#L165-L200 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/training/server_lib.py | python | Server.__init__ | (self,
server_or_cluster_def,
job_name=None,
task_index=None,
protocol=None,
config=None,
start=True) | Creates a new server with the given definition.
The `job_name`, `task_index`, and `protocol` arguments are optional, and
override any information provided in `server_or_cluster_def`.
Args:
server_or_cluster_def: A `tf.train.ServerDef` or
`tf.train.ClusterDef` protocol buffer, or a
`t... | Creates a new server with the given definition. | [
"Creates",
"a",
"new",
"server",
"with",
"the",
"given",
"definition",
"."
] | def __init__(self,
server_or_cluster_def,
job_name=None,
task_index=None,
protocol=None,
config=None,
start=True):
"""Creates a new server with the given definition.
The `job_name`, `task_index`, and `protocol` arguments ... | [
"def",
"__init__",
"(",
"self",
",",
"server_or_cluster_def",
",",
"job_name",
"=",
"None",
",",
"task_index",
"=",
"None",
",",
"protocol",
"=",
"None",
",",
"config",
"=",
"None",
",",
"start",
"=",
"True",
")",
":",
"self",
".",
"_server_def",
"=",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/server_lib.py#L106-L147 | ||
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/MSVS/MSVSSettings.py | python | _AddTool | (tool) | Adds a tool to the four dictionaries used to process settings.
This only defines the tool. Each setting also needs to be added.
Args:
tool: The _Tool object to be added. | Adds a tool to the four dictionaries used to process settings. | [
"Adds",
"a",
"tool",
"to",
"the",
"four",
"dictionaries",
"used",
"to",
"process",
"settings",
"."
] | def _AddTool(tool):
"""Adds a tool to the four dictionaries used to process settings.
This only defines the tool. Each setting also needs to be added.
Args:
tool: The _Tool object to be added.
"""
_msvs_validators[tool.msvs_name] = {}
_msbuild_validators[tool.msbuild_name] = {}
_msvs_to_msbuild_con... | [
"def",
"_AddTool",
"(",
"tool",
")",
":",
"_msvs_validators",
"[",
"tool",
".",
"msvs_name",
"]",
"=",
"{",
"}",
"_msbuild_validators",
"[",
"tool",
".",
"msbuild_name",
"]",
"=",
"{",
"}",
"_msvs_to_msbuild_converters",
"[",
"tool",
".",
"msvs_name",
"]",
... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/MSVS/MSVSSettings.py#L53-L64 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/package_index.py | python | ContentChecker.is_valid | (self) | return True | Check the hash. Return False if validation fails. | Check the hash. Return False if validation fails. | [
"Check",
"the",
"hash",
".",
"Return",
"False",
"if",
"validation",
"fails",
"."
] | def is_valid(self):
"""
Check the hash. Return False if validation fails.
"""
return True | [
"def",
"is_valid",
"(",
"self",
")",
":",
"return",
"True"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/package_index.py#L214-L218 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Source/bindings/scripts/compute_global_objects.py | python | idl_files_to_interface_name_global_names | (idl_files) | Yields pairs (interface_name, global_names) found in IDL files. | Yields pairs (interface_name, global_names) found in IDL files. | [
"Yields",
"pairs",
"(",
"interface_name",
"global_names",
")",
"found",
"in",
"IDL",
"files",
"."
] | def idl_files_to_interface_name_global_names(idl_files):
"""Yields pairs (interface_name, global_names) found in IDL files."""
for idl_filename in idl_files:
interface_name = idl_filename_to_interface_name(idl_filename)
global_names = idl_file_to_global_names(idl_filename)
if global_name... | [
"def",
"idl_files_to_interface_name_global_names",
"(",
"idl_files",
")",
":",
"for",
"idl_filename",
"in",
"idl_files",
":",
"interface_name",
"=",
"idl_filename_to_interface_name",
"(",
"idl_filename",
")",
"global_names",
"=",
"idl_file_to_global_names",
"(",
"idl_filena... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Source/bindings/scripts/compute_global_objects.py#L80-L86 | ||
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/internal/containers.py | python | BaseContainer.__getitem__ | (self, key) | return self._values[key] | Retrieves item by the specified key. | Retrieves item by the specified key. | [
"Retrieves",
"item",
"by",
"the",
"specified",
"key",
"."
] | def __getitem__(self, key):
"""Retrieves item by the specified key."""
return self._values[key] | [
"def",
"__getitem__",
"(",
"self",
",",
"key",
")",
":",
"return",
"self",
".",
"_values",
"[",
"key",
"]"
] | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/internal/containers.py#L202-L204 | |
chromium/crashpad | be4fb6a412e894d6817df815d8b1889c191f0f8c | build/ios/convert_gn_xcodeproj.py | python | LoadXcodeProjectAsJSON | (project_dir) | return check_output([
'plutil', '-convert', 'json', '-o', '-',
os.path.join(project_dir, 'project.pbxproj')]) | Return Xcode project at |path| as a JSON string. | Return Xcode project at |path| as a JSON string. | [
"Return",
"Xcode",
"project",
"at",
"|path|",
"as",
"a",
"JSON",
"string",
"."
] | def LoadXcodeProjectAsJSON(project_dir):
"""Return Xcode project at |path| as a JSON string."""
return check_output([
'plutil', '-convert', 'json', '-o', '-',
os.path.join(project_dir, 'project.pbxproj')]) | [
"def",
"LoadXcodeProjectAsJSON",
"(",
"project_dir",
")",
":",
"return",
"check_output",
"(",
"[",
"'plutil'",
",",
"'-convert'",
",",
"'json'",
",",
"'-o'",
",",
"'-'",
",",
"os",
".",
"path",
".",
"join",
"(",
"project_dir",
",",
"'project.pbxproj'",
")",
... | https://github.com/chromium/crashpad/blob/be4fb6a412e894d6817df815d8b1889c191f0f8c/build/ios/convert_gn_xcodeproj.py#L85-L89 | |
timi-liuliang/echo | 40a5a24d430eee4118314459ab7e03afcb3b8719 | thirdparty/protobuf/python/google/protobuf/internal/decoder.py | python | _SkipFixed64 | (buffer, pos, end) | return pos | Skip a fixed64 value. Returns the new position. | Skip a fixed64 value. Returns the new position. | [
"Skip",
"a",
"fixed64",
"value",
".",
"Returns",
"the",
"new",
"position",
"."
] | def _SkipFixed64(buffer, pos, end):
"""Skip a fixed64 value. Returns the new position."""
pos += 8
if pos > end:
raise _DecodeError('Truncated message.')
return pos | [
"def",
"_SkipFixed64",
"(",
"buffer",
",",
"pos",
",",
"end",
")",
":",
"pos",
"+=",
"8",
"if",
"pos",
">",
"end",
":",
"raise",
"_DecodeError",
"(",
"'Truncated message.'",
")",
"return",
"pos"
] | https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/internal/decoder.py#L754-L760 | |
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | .git-keywords/update-all-keywords.py | python | main | (args) | Main program.
Arguments:
args: command line arguments | Main program. | [
"Main",
"program",
"."
] | def main(args):
"""Main program.
Arguments:
args: command line arguments
"""
# Check if git is available.
checkfor(['git', '--version'])
# Check if .git exists
if not os.access('.git', os.F_OK):
print('No .git directory found!')
sys.exit(1)
# Get all files that a... | [
"def",
"main",
"(",
"args",
")",
":",
"# Check if git is available.",
"checkfor",
"(",
"[",
"'git'",
",",
"'--version'",
"]",
")",
"# Check if .git exists",
"if",
"not",
"os",
".",
"access",
"(",
"'.git'",
",",
"os",
".",
"F_OK",
")",
":",
"print",
"(",
... | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/.git-keywords/update-all-keywords.py#L22-L53 | ||
GoSSIP-SJTU/Armariris | ad5d868482956b2194a77b39c8d543c7c2318200 | tools/clang/docs/tools/dump_ast_matchers.py | python | unify_arguments | (args) | return args | Gets rid of anything the user doesn't care about in the argument list. | Gets rid of anything the user doesn't care about in the argument list. | [
"Gets",
"rid",
"of",
"anything",
"the",
"user",
"doesn",
"t",
"care",
"about",
"in",
"the",
"argument",
"list",
"."
] | def unify_arguments(args):
"""Gets rid of anything the user doesn't care about in the argument list."""
args = re.sub(r'internal::', r'', args)
args = re.sub(r'const\s+(.*)&', r'\1 ', args)
args = re.sub(r'&', r' ', args)
args = re.sub(r'(^|\s)M\d?(\s)', r'\1Matcher<*>\2', args)
return args | [
"def",
"unify_arguments",
"(",
"args",
")",
":",
"args",
"=",
"re",
".",
"sub",
"(",
"r'internal::'",
",",
"r''",
",",
"args",
")",
"args",
"=",
"re",
".",
"sub",
"(",
"r'const\\s+(.*)&'",
",",
"r'\\1 '",
",",
"args",
")",
"args",
"=",
"re",
".",
"... | https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/tools/clang/docs/tools/dump_ast_matchers.py#L95-L101 | |
matplotlib/basemap | 1b80b3cee5dd688f32c652e780367ec6c93c4480 | packages/basemap_data/setup.py | python | get_content | (name, splitlines=False) | return content | Return the file contents with project root as root folder. | Return the file contents with project root as root folder. | [
"Return",
"the",
"file",
"contents",
"with",
"project",
"root",
"as",
"root",
"folder",
"."
] | def get_content(name, splitlines=False):
"""Return the file contents with project root as root folder."""
here = os.path.abspath(os.path.dirname(__file__))
path = os.path.join(here, name)
with io.open(path, "r", encoding="utf-8") as fd:
content = fd.read()
if splitlines:
content = [... | [
"def",
"get_content",
"(",
"name",
",",
"splitlines",
"=",
"False",
")",
":",
"here",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",
")",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"he... | https://github.com/matplotlib/basemap/blob/1b80b3cee5dd688f32c652e780367ec6c93c4480/packages/basemap_data/setup.py#L13-L22 | |
PlatformLab/RAMCloud | b1866af19124325a6dfd8cbc267e2e3ef1f965d1 | cpplint.py | python | PrintCategories | () | Prints a list of all the error-categories used by error messages.
These are the categories used to filter messages via --filter. | Prints a list of all the error-categories used by error messages. | [
"Prints",
"a",
"list",
"of",
"all",
"the",
"error",
"-",
"categories",
"used",
"by",
"error",
"messages",
"."
] | def PrintCategories():
"""Prints a list of all the error-categories used by error messages.
These are the categories used to filter messages via --filter.
"""
sys.stderr.write(_ERROR_CATEGORIES)
sys.exit(0) | [
"def",
"PrintCategories",
"(",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"_ERROR_CATEGORIES",
")",
"sys",
".",
"exit",
"(",
"0",
")"
] | https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/cpplint.py#L3018-L3024 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/elasticache/layer1.py | python | ElastiCacheConnection.delete_cache_parameter_group | (self, cache_parameter_group_name) | return self._make_request(
action='DeleteCacheParameterGroup',
verb='POST',
path='/', params=params) | The DeleteCacheParameterGroup operation deletes the specified
cache parameter group. You cannot delete a cache parameter
group if it is associated with any cache clusters.
:type cache_parameter_group_name: string
:param cache_parameter_group_name:
The name of the cache parameter... | The DeleteCacheParameterGroup operation deletes the specified
cache parameter group. You cannot delete a cache parameter
group if it is associated with any cache clusters. | [
"The",
"DeleteCacheParameterGroup",
"operation",
"deletes",
"the",
"specified",
"cache",
"parameter",
"group",
".",
"You",
"cannot",
"delete",
"a",
"cache",
"parameter",
"group",
"if",
"it",
"is",
"associated",
"with",
"any",
"cache",
"clusters",
"."
] | def delete_cache_parameter_group(self, cache_parameter_group_name):
"""
The DeleteCacheParameterGroup operation deletes the specified
cache parameter group. You cannot delete a cache parameter
group if it is associated with any cache clusters.
:type cache_parameter_group_name: s... | [
"def",
"delete_cache_parameter_group",
"(",
"self",
",",
"cache_parameter_group_name",
")",
":",
"params",
"=",
"{",
"'CacheParameterGroupName'",
":",
"cache_parameter_group_name",
",",
"}",
"return",
"self",
".",
"_make_request",
"(",
"action",
"=",
"'DeleteCacheParame... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/elasticache/layer1.py#L461-L481 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/distributed/DistributedSmoothNode.py | python | DistributedSmoothNode.suggestResync | (self, avId, timestampA, timestampB,
serverTimeSec, serverTimeUSec, uncertainty) | This message is sent from one client to another when the other
client receives a timestamp from this client that is so far
out of date as to suggest that one or both clients needs to
resynchronize their clock information. | This message is sent from one client to another when the other
client receives a timestamp from this client that is so far
out of date as to suggest that one or both clients needs to
resynchronize their clock information. | [
"This",
"message",
"is",
"sent",
"from",
"one",
"client",
"to",
"another",
"when",
"the",
"other",
"client",
"receives",
"a",
"timestamp",
"from",
"this",
"client",
"that",
"is",
"so",
"far",
"out",
"of",
"date",
"as",
"to",
"suggest",
"that",
"one",
"or... | def suggestResync(self, avId, timestampA, timestampB,
serverTimeSec, serverTimeUSec, uncertainty):
"""
This message is sent from one client to another when the other
client receives a timestamp from this client that is so far
out of date as to suggest that one or bo... | [
"def",
"suggestResync",
"(",
"self",
",",
"avId",
",",
"timestampA",
",",
"timestampB",
",",
"serverTimeSec",
",",
"serverTimeUSec",
",",
"uncertainty",
")",
":",
"serverTime",
"=",
"float",
"(",
"serverTimeSec",
")",
"+",
"float",
"(",
"serverTimeUSec",
")",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/distributed/DistributedSmoothNode.py#L448-L475 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py | python | Categorical.shape | (self) | return tuple([len(self._codes)]) | Shape of the Categorical.
For internal compatibility with numpy arrays.
Returns
-------
shape : tuple | Shape of the Categorical. | [
"Shape",
"of",
"the",
"Categorical",
"."
] | def shape(self):
"""
Shape of the Categorical.
For internal compatibility with numpy arrays.
Returns
-------
shape : tuple
"""
return tuple([len(self._codes)]) | [
"def",
"shape",
"(",
"self",
")",
":",
"return",
"tuple",
"(",
"[",
"len",
"(",
"self",
".",
"_codes",
")",
"]",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py#L1220-L1231 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/nn_ops.py | python | _get_strides_and_dilation_rate | (num_spatial_dims, strides, dilation_rate) | return strides, dilation_rate | Helper function for verifying strides and dilation_rate arguments.
This is used by `convolution` and `pool`.
Args:
num_spatial_dims: int
strides: Optional. List of N ints >= 1. Defaults to `[1]*N`. If any value
of strides is > 1, then all values of dilation_rate must be 1.
dilation_rate: Opti... | Helper function for verifying strides and dilation_rate arguments. | [
"Helper",
"function",
"for",
"verifying",
"strides",
"and",
"dilation_rate",
"arguments",
"."
] | def _get_strides_and_dilation_rate(num_spatial_dims, strides, dilation_rate):
"""Helper function for verifying strides and dilation_rate arguments.
This is used by `convolution` and `pool`.
Args:
num_spatial_dims: int
strides: Optional. List of N ints >= 1. Defaults to `[1]*N`. If any value
of ... | [
"def",
"_get_strides_and_dilation_rate",
"(",
"num_spatial_dims",
",",
"strides",
",",
"dilation_rate",
")",
":",
"if",
"dilation_rate",
"is",
"None",
":",
"dilation_rate",
"=",
"[",
"1",
"]",
"*",
"num_spatial_dims",
"elif",
"len",
"(",
"dilation_rate",
")",
"!... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/nn_ops.py#L950-L994 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.