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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/layers/merge.py | python | maximum | (inputs, **kwargs) | return Maximum(**kwargs)(inputs) | Functional interface to compute maximum (element-wise) list of `inputs`.
This is equivalent to the `tf.keras.layers.Maximum` layer.
For example:
```python
input1 = tf.keras.layers.Input(shape=(16,))
x1 = tf.keras.layers.Dense(8, activation='relu')(input1) #shape=(None, 8)
input2 = tf.keras.layers.Input(s... | Functional interface to compute maximum (element-wise) list of `inputs`. | [
"Functional",
"interface",
"to",
"compute",
"maximum",
"(",
"element",
"-",
"wise",
")",
"list",
"of",
"inputs",
"."
] | def maximum(inputs, **kwargs):
"""Functional interface to compute maximum (element-wise) list of `inputs`.
This is equivalent to the `tf.keras.layers.Maximum` layer.
For example:
```python
input1 = tf.keras.layers.Input(shape=(16,))
x1 = tf.keras.layers.Dense(8, activation='relu')(input1) #shape=(None, 8... | [
"def",
"maximum",
"(",
"inputs",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"Maximum",
"(",
"*",
"*",
"kwargs",
")",
"(",
"inputs",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/layers/merge.py#L868-L896 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/utils/packaging.py | python | get_requires_python | (dist) | return requires_python | Return the "Requires-Python" metadata for a distribution, or None
if not present. | Return the "Requires-Python" metadata for a distribution, or None
if not present. | [
"Return",
"the",
"Requires",
"-",
"Python",
"metadata",
"for",
"a",
"distribution",
"or",
"None",
"if",
"not",
"present",
"."
] | def get_requires_python(dist):
# type: (pkg_resources.Distribution) -> Optional[str]
"""
Return the "Requires-Python" metadata for a distribution, or None
if not present.
"""
pkg_info_dict = get_metadata(dist)
requires_python = pkg_info_dict.get('Requires-Python')
if requires_python is ... | [
"def",
"get_requires_python",
"(",
"dist",
")",
":",
"# type: (pkg_resources.Distribution) -> Optional[str]",
"pkg_info_dict",
"=",
"get_metadata",
"(",
"dist",
")",
"requires_python",
"=",
"pkg_info_dict",
".",
"get",
"(",
"'Requires-Python'",
")",
"if",
"requires_python... | 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/_internal/utils/packaging.py#L70-L84 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/pydoc.py | python | HTMLDoc.bigsection | (self, title, *args) | return self.section(title, *args) | Format a section with a big heading. | Format a section with a big heading. | [
"Format",
"a",
"section",
"with",
"a",
"big",
"heading",
"."
] | def bigsection(self, title, *args):
"""Format a section with a big heading."""
title = '<big><strong>%s</strong></big>' % title
return self.section(title, *args) | [
"def",
"bigsection",
"(",
"self",
",",
"title",
",",
"*",
"args",
")",
":",
"title",
"=",
"'<big><strong>%s</strong></big>'",
"%",
"title",
"return",
"self",
".",
"section",
"(",
"title",
",",
"*",
"args",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/pydoc.py#L467-L470 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/training/input.py | python | _store_sparse_tensors_join | (tensor_list_list, enqueue_many, keep_input) | return (stored_list_list, sparse_info_list) | Store SparseTensors for feeding into batch_join, etc. | Store SparseTensors for feeding into batch_join, etc. | [
"Store",
"SparseTensors",
"for",
"feeding",
"into",
"batch_join",
"etc",
"."
] | def _store_sparse_tensors_join(tensor_list_list, enqueue_many, keep_input):
"""Store SparseTensors for feeding into batch_join, etc."""
(s0, sparse_info_list) = _store_sparse_tensors(
tensor_list_list[0], enqueue_many, keep_input)
stored_list_list = [s0]
for tensor_list in tensor_list_list[1:]:
s, spa... | [
"def",
"_store_sparse_tensors_join",
"(",
"tensor_list_list",
",",
"enqueue_many",
",",
"keep_input",
")",
":",
"(",
"s0",
",",
"sparse_info_list",
")",
"=",
"_store_sparse_tensors",
"(",
"tensor_list_list",
"[",
"0",
"]",
",",
"enqueue_many",
",",
"keep_input",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/input.py#L575-L592 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xmlDoc.htmlSaveFile | (self, filename) | return ret | Dump an HTML document to a file. If @filename is "-" the
stdout file is used. | Dump an HTML document to a file. If | [
"Dump",
"an",
"HTML",
"document",
"to",
"a",
"file",
".",
"If"
] | def htmlSaveFile(self, filename):
"""Dump an HTML document to a file. If @filename is "-" the
stdout file is used. """
ret = libxml2mod.htmlSaveFile(filename, self._o)
return ret | [
"def",
"htmlSaveFile",
"(",
"self",
",",
"filename",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"htmlSaveFile",
"(",
"filename",
",",
"self",
".",
"_o",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L4047-L4051 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py | python | run_script | (dist_spec, script_name) | Locate distribution `dist_spec` and run its `script_name` script | Locate distribution `dist_spec` and run its `script_name` script | [
"Locate",
"distribution",
"dist_spec",
"and",
"run",
"its",
"script_name",
"script"
] | def run_script(dist_spec, script_name):
"""Locate distribution `dist_spec` and run its `script_name` script"""
ns = sys._getframe(1).f_globals
name = ns['__name__']
ns.clear()
ns['__name__'] = name
require(dist_spec)[0].run_script(script_name, ns) | [
"def",
"run_script",
"(",
"dist_spec",
",",
"script_name",
")",
":",
"ns",
"=",
"sys",
".",
"_getframe",
"(",
"1",
")",
".",
"f_globals",
"name",
"=",
"ns",
"[",
"'__name__'",
"]",
"ns",
".",
"clear",
"(",
")",
"ns",
"[",
"'__name__'",
"]",
"=",
"n... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py#L463-L469 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/slim/python/slim/evaluation.py | python | evaluation_loop | (master,
checkpoint_dir,
logdir,
num_evals=1,
eval_op=None,
eval_op_feed_dict=None,
final_op=None,
final_op_feed_dict=None,
summary_op=_USE_DEFAULT,
... | Runs TF-Slim's Evaluation Loop.
Args:
master: The BNS address of the TensorFlow master.
checkpoint_dir: The directory where checkpoints are stored.
logdir: The directory where the TensorFlow summaries are written to.
num_evals: The number of times to run `eval_op`.
eval_op: A operation run `num_e... | Runs TF-Slim's Evaluation Loop. | [
"Runs",
"TF",
"-",
"Slim",
"s",
"Evaluation",
"Loop",
"."
] | def evaluation_loop(master,
checkpoint_dir,
logdir,
num_evals=1,
eval_op=None,
eval_op_feed_dict=None,
final_op=None,
final_op_feed_dict=None,
summary_op=_USE_D... | [
"def",
"evaluation_loop",
"(",
"master",
",",
"checkpoint_dir",
",",
"logdir",
",",
"num_evals",
"=",
"1",
",",
"eval_op",
"=",
"None",
",",
"eval_op_feed_dict",
"=",
"None",
",",
"final_op",
"=",
"None",
",",
"final_op_feed_dict",
"=",
"None",
",",
"summary... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/slim/python/slim/evaluation.py#L244-L339 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/while_v2.py | python | _get_intermediates | (func_graph) | return intermediates | Returns all tensors in `func_graph` that should be accumulated. | Returns all tensors in `func_graph` that should be accumulated. | [
"Returns",
"all",
"tensors",
"in",
"func_graph",
"that",
"should",
"be",
"accumulated",
"."
] | def _get_intermediates(func_graph):
"""Returns all tensors in `func_graph` that should be accumulated."""
# We currently accumulate output tensors of most ops in the function and rely
# on the pruning pass to get rid of the unused accumulators at runtime.
# However, this can bloat the GraphDef and make debuggin... | [
"def",
"_get_intermediates",
"(",
"func_graph",
")",
":",
"# We currently accumulate output tensors of most ops in the function and rely",
"# on the pruning pass to get rid of the unused accumulators at runtime.",
"# However, this can bloat the GraphDef and make debugging harder so we perform",
"#... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/while_v2.py#L502-L542 | |
wujian16/Cornell-MOE | df299d1be882d2af9796d7a68b3f9505cac7a53e | moe/optimal_learning/python/python_version/optimization.py | python | NullOptimizer.__init__ | (self, domain, optimizable, *args, **kwargs) | Construct a NullOptimizer.
:param domain: the domain that this optimizer operates over
:type domain: interfaces.domain_interface.DomainInterface subclass
:param optimizable: object representing the objective function being optimized
:type optimizable: interfaces.optimization_interface.O... | Construct a NullOptimizer. | [
"Construct",
"a",
"NullOptimizer",
"."
] | def __init__(self, domain, optimizable, *args, **kwargs):
"""Construct a NullOptimizer.
:param domain: the domain that this optimizer operates over
:type domain: interfaces.domain_interface.DomainInterface subclass
:param optimizable: object representing the objective function being opt... | [
"def",
"__init__",
"(",
"self",
",",
"domain",
",",
"optimizable",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"domain",
"=",
"domain",
"self",
".",
"objective_function",
"=",
"optimizable"
] | https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/python_version/optimization.py#L375-L385 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg_grad.py | python | _TransposeTridiagonalMatrix | (diags) | return array_ops.stack([superdiag, diag, subdiag], axis=-2) | Transposes a tridiagonal matrix.
Args:
diags: the diagonals of the input matrix in the compact form (see
linalg_ops.tridiagonal_solve).
Returns:
Diagonals of the transposed matrix in the compact form. | Transposes a tridiagonal matrix. | [
"Transposes",
"a",
"tridiagonal",
"matrix",
"."
] | def _TransposeTridiagonalMatrix(diags):
"""Transposes a tridiagonal matrix.
Args:
diags: the diagonals of the input matrix in the compact form (see
linalg_ops.tridiagonal_solve).
Returns:
Diagonals of the transposed matrix in the compact form.
"""
diag = diags[..., 1, :]
if diags.shape.is_... | [
"def",
"_TransposeTridiagonalMatrix",
"(",
"diags",
")",
":",
"diag",
"=",
"diags",
"[",
"...",
",",
"1",
",",
":",
"]",
"if",
"diags",
".",
"shape",
".",
"is_fully_defined",
"(",
")",
":",
"# For fully defined tensor we can concat with a tensor of zeros, which is",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg_grad.py#L527-L555 | |
OAID/Tengine | 66b2c22ad129d25e2fc6de3b22a608bb54dd90db | tools/optimize/nanodet_m-opt.py | python | optimize_add_softmax | (nodes) | return nodes | add additional softmax node in the end of all distance prediction branches
Args:
nodes: the graph.node of ONNX model
Returns:
optimized graph nodes(inplace) | add additional softmax node in the end of all distance prediction branches
Args:
nodes: the graph.node of ONNX model
Returns:
optimized graph nodes(inplace) | [
"add",
"additional",
"softmax",
"node",
"in",
"the",
"end",
"of",
"all",
"distance",
"prediction",
"branches",
"Args",
":",
"nodes",
":",
"the",
"graph",
".",
"node",
"of",
"ONNX",
"model",
"Returns",
":",
"optimized",
"graph",
"nodes",
"(",
"inplace",
")"... | def optimize_add_softmax(nodes):
"""
add additional softmax node in the end of all distance prediction branches
Args:
nodes: the graph.node of ONNX model
Returns:
optimized graph nodes(inplace)
"""
for n in nodes:
if 'Transpose' == n.op_type and "dis_pred_stride_" in n.ou... | [
"def",
"optimize_add_softmax",
"(",
"nodes",
")",
":",
"for",
"n",
"in",
"nodes",
":",
"if",
"'Transpose'",
"==",
"n",
".",
"op_type",
"and",
"\"dis_pred_stride_\"",
"in",
"n",
".",
"output",
"[",
"0",
"]",
":",
"## add additional softmax node",
"_input",
"=... | https://github.com/OAID/Tengine/blob/66b2c22ad129d25e2fc6de3b22a608bb54dd90db/tools/optimize/nanodet_m-opt.py#L125-L140 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/probability/distribution/_utils/custom_ops.py | python | exp_generic | (input_x) | return exp(input_x) | Exp op on Ascend doesn't support int types.
Fix this with casting the type. | Exp op on Ascend doesn't support int types.
Fix this with casting the type. | [
"Exp",
"op",
"on",
"Ascend",
"doesn",
"t",
"support",
"int",
"types",
".",
"Fix",
"this",
"with",
"casting",
"the",
"type",
"."
] | def exp_generic(input_x):
"""
Exp op on Ascend doesn't support int types.
Fix this with casting the type.
"""
exp = P.Exp()
cast = P.Cast()
dtype = P.DType()
checktype = P.IsSubClass()
if not checktype(dtype(input_x), mstype.float_):
input_x = cast(input_x, mstype.float32)
... | [
"def",
"exp_generic",
"(",
"input_x",
")",
":",
"exp",
"=",
"P",
".",
"Exp",
"(",
")",
"cast",
"=",
"P",
".",
"Cast",
"(",
")",
"dtype",
"=",
"P",
".",
"DType",
"(",
")",
"checktype",
"=",
"P",
".",
"IsSubClass",
"(",
")",
"if",
"not",
"checkty... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/_utils/custom_ops.py#L21-L33 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | PlatformInformation.GetOperatingSystemIdName | (*args, **kwargs) | return _misc_.PlatformInformation_GetOperatingSystemIdName(*args, **kwargs) | GetOperatingSystemIdName(self) -> String | GetOperatingSystemIdName(self) -> String | [
"GetOperatingSystemIdName",
"(",
"self",
")",
"-",
">",
"String"
] | def GetOperatingSystemIdName(*args, **kwargs):
"""GetOperatingSystemIdName(self) -> String"""
return _misc_.PlatformInformation_GetOperatingSystemIdName(*args, **kwargs) | [
"def",
"GetOperatingSystemIdName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"PlatformInformation_GetOperatingSystemIdName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L1113-L1115 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | VolumeGrid.setValues | (self, np_array3: Vector) | return _robotsim.VolumeGrid_setValues(self, np_array3) | r"""
Args:
np_array3 (:obj:`3D Numpy array of floats`) | r"""
Args:
np_array3 (:obj:`3D Numpy array of floats`) | [
"r",
"Args",
":",
"np_array3",
"(",
":",
"obj",
":",
"3D",
"Numpy",
"array",
"of",
"floats",
")"
] | def setValues(self, np_array3: Vector) ->None:
r"""
Args:
np_array3 (:obj:`3D Numpy array of floats`)
"""
return _robotsim.VolumeGrid_setValues(self, np_array3) | [
"def",
"setValues",
"(",
"self",
",",
"np_array3",
":",
"Vector",
")",
"->",
"None",
":",
"return",
"_robotsim",
".",
"VolumeGrid_setValues",
"(",
"self",
",",
"np_array3",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L1771-L1776 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | samples/pySketch/pySketch.py | python | DrawingObject.getData | (self) | return [self.position.x, self.position.y,
self.size.width, self.size.height,
self.penColour.Red(),
self.penColour.Green(),
self.penColour.Blue(),
self.fillColour.Red(),
self.fillColour.Green(),
self.fillColou... | Return a copy of the object's internal data.
This is used to save this DrawingObject to disk. | Return a copy of the object's internal data. | [
"Return",
"a",
"copy",
"of",
"the",
"object",
"s",
"internal",
"data",
"."
] | def getData(self):
""" Return a copy of the object's internal data.
This is used to save this DrawingObject to disk.
"""
return [self.position.x, self.position.y,
self.size.width, self.size.height,
self.penColour.Red(),
self.penColour.... | [
"def",
"getData",
"(",
"self",
")",
":",
"return",
"[",
"self",
".",
"position",
".",
"x",
",",
"self",
".",
"position",
".",
"y",
",",
"self",
".",
"size",
".",
"width",
",",
"self",
".",
"size",
".",
"height",
",",
"self",
".",
"penColour",
"."... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/pySketch/pySketch.py#L2209-L2222 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/jar.py | python | JarMaker.finalizeJar | (self, jarPath, chromebasepath, register, doZip=True) | Helper method to write out the chrome registration entries to
jarfile.manifest or chrome.manifest, or both.
The actual file processing is done in updateManifest. | Helper method to write out the chrome registration entries to
jarfile.manifest or chrome.manifest, or both. | [
"Helper",
"method",
"to",
"write",
"out",
"the",
"chrome",
"registration",
"entries",
"to",
"jarfile",
".",
"manifest",
"or",
"chrome",
".",
"manifest",
"or",
"both",
"."
] | def finalizeJar(self, jarPath, chromebasepath, register, doZip=True):
'''Helper method to write out the chrome registration entries to
jarfile.manifest or chrome.manifest, or both.
The actual file processing is done in updateManifest.
'''
# rewrite the manifest, if entries giv... | [
"def",
"finalizeJar",
"(",
"self",
",",
"jarPath",
",",
"chromebasepath",
",",
"register",
",",
"doZip",
"=",
"True",
")",
":",
"# rewrite the manifest, if entries given",
"if",
"not",
"register",
":",
"return",
"chromeManifest",
"=",
"os",
".",
"path",
".",
"... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/jar.py#L153-L193 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/executables.py | python | is_executable | (path) | return get_type(path) != UNKNOWN | Return whether a given file path points to an executable or a library,
where an executable or library is identified by:
- the file extension on OS/2 and WINNT
- the file signature on OS/X and ELF systems (GNU/Linux, Android, BSD,
Solaris)
As this function is intended for use to choose... | Return whether a given file path points to an executable or a library,
where an executable or library is identified by:
- the file extension on OS/2 and WINNT
- the file signature on OS/X and ELF systems (GNU/Linux, Android, BSD,
Solaris) | [
"Return",
"whether",
"a",
"given",
"file",
"path",
"points",
"to",
"an",
"executable",
"or",
"a",
"library",
"where",
"an",
"executable",
"or",
"library",
"is",
"identified",
"by",
":",
"-",
"the",
"file",
"extension",
"on",
"OS",
"/",
"2",
"and",
"WINNT... | def is_executable(path):
'''
Return whether a given file path points to an executable or a library,
where an executable or library is identified by:
- the file extension on OS/2 and WINNT
- the file signature on OS/X and ELF systems (GNU/Linux, Android, BSD,
Solaris)
As this f... | [
"def",
"is_executable",
"(",
"path",
")",
":",
"from",
"buildconfig",
"import",
"substs",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"return",
"False",
"if",
"substs",
"[",
"'OS_ARCH'",
"]",
"==",
"'WINNT'",
":",
"return",
"p... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/executables.py#L57-L78 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/dask_cudf/dask_cudf/_version.py | python | render_git_describe_long | (pieces) | return rendered | TAG-DISTANCE-gHEX[-dirty].
Like 'git describe --tags --dirty --always -long'.
The distance/hash is unconditional.
Exceptions:
1: no tags. HEX[-dirty] (note: no 'g' prefix) | TAG-DISTANCE-gHEX[-dirty]. | [
"TAG",
"-",
"DISTANCE",
"-",
"gHEX",
"[",
"-",
"dirty",
"]",
"."
] | def render_git_describe_long(pieces):
"""TAG-DISTANCE-gHEX[-dirty].
Like 'git describe --tags --dirty --always -long'.
The distance/hash is unconditional.
Exceptions:
1: no tags. HEX[-dirty] (note: no 'g' prefix)
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
... | [
"def",
"render_git_describe_long",
"(",
"pieces",
")",
":",
"if",
"pieces",
"[",
"\"closest-tag\"",
"]",
":",
"rendered",
"=",
"pieces",
"[",
"\"closest-tag\"",
"]",
"rendered",
"+=",
"\"-%d-g%s\"",
"%",
"(",
"pieces",
"[",
"\"distance\"",
"]",
",",
"pieces",
... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/dask_cudf/dask_cudf/_version.py#L456-L473 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | GraphicsRenderer.CreateBrush | (*args, **kwargs) | return _gdi_.GraphicsRenderer_CreateBrush(*args, **kwargs) | CreateBrush(self, Brush brush) -> GraphicsBrush | CreateBrush(self, Brush brush) -> GraphicsBrush | [
"CreateBrush",
"(",
"self",
"Brush",
"brush",
")",
"-",
">",
"GraphicsBrush"
] | def CreateBrush(*args, **kwargs):
"""CreateBrush(self, Brush brush) -> GraphicsBrush"""
return _gdi_.GraphicsRenderer_CreateBrush(*args, **kwargs) | [
"def",
"CreateBrush",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsRenderer_CreateBrush",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L6604-L6606 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/tensor_forest/client/random_forest.py | python | EveryCheckpointPreSaveListener.__init__ | (self, op) | Initializes the object.
Args:
op: An op to run before each checkpoint save. | Initializes the object. | [
"Initializes",
"the",
"object",
"."
] | def __init__(self, op):
"""Initializes the object.
Args:
op: An op to run before each checkpoint save.
"""
self._op = op | [
"def",
"__init__",
"(",
"self",
",",
"op",
")",
":",
"self",
".",
"_op",
"=",
"op"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/tensor_forest/client/random_forest.py#L131-L137 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/ctypeslib.py | python | ndpointer | (dtype=None, ndim=None, shape=None, flags=None) | return klass | Array-checking restype/argtypes.
An ndpointer instance is used to describe an ndarray in restypes
and argtypes specifications. This approach is more flexible than
using, for example, ``POINTER(c_double)``, since several restrictions
can be specified, which are verified upon calling the ctypes function... | Array-checking restype/argtypes. | [
"Array",
"-",
"checking",
"restype",
"/",
"argtypes",
"."
] | def ndpointer(dtype=None, ndim=None, shape=None, flags=None):
"""
Array-checking restype/argtypes.
An ndpointer instance is used to describe an ndarray in restypes
and argtypes specifications. This approach is more flexible than
using, for example, ``POINTER(c_double)``, since several restrictions... | [
"def",
"ndpointer",
"(",
"dtype",
"=",
"None",
",",
"ndim",
"=",
"None",
",",
"shape",
"=",
"None",
",",
"flags",
"=",
"None",
")",
":",
"if",
"dtype",
"is",
"not",
"None",
":",
"dtype",
"=",
"_dtype",
"(",
"dtype",
")",
"num",
"=",
"None",
"if",... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ctypeslib.py#L186-L286 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/requests/requests/sessions.py | python | Session.close | (self) | Closes all adapters and as such the session | Closes all adapters and as such the session | [
"Closes",
"all",
"adapters",
"and",
"as",
"such",
"the",
"session"
] | def close(self):
"""Closes all adapters and as such the session"""
for v in self.adapters.values():
v.close() | [
"def",
"close",
"(",
"self",
")",
":",
"for",
"v",
"in",
"self",
".",
"adapters",
".",
"values",
"(",
")",
":",
"v",
".",
"close",
"(",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/sessions.py#L648-L651 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TNEGraph.GetMxNId | (self) | return _snap.TNEGraph_GetMxNId(self) | GetMxNId(TNEGraph self) -> int
Parameters:
self: TNEGraph const * | GetMxNId(TNEGraph self) -> int | [
"GetMxNId",
"(",
"TNEGraph",
"self",
")",
"-",
">",
"int"
] | def GetMxNId(self):
"""
GetMxNId(TNEGraph self) -> int
Parameters:
self: TNEGraph const *
"""
return _snap.TNEGraph_GetMxNId(self) | [
"def",
"GetMxNId",
"(",
"self",
")",
":",
"return",
"_snap",
".",
"TNEGraph_GetMxNId",
"(",
"self",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L4468-L4476 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiToolBarItem.SetActive | (*args, **kwargs) | return _aui.AuiToolBarItem_SetActive(*args, **kwargs) | SetActive(self, bool b) | SetActive(self, bool b) | [
"SetActive",
"(",
"self",
"bool",
"b",
")"
] | def SetActive(*args, **kwargs):
"""SetActive(self, bool b)"""
return _aui.AuiToolBarItem_SetActive(*args, **kwargs) | [
"def",
"SetActive",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBarItem_SetActive",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1841-L1843 | |
isl-org/Open3D | 79aec3ddde6a571ce2f28e4096477e52ec465244 | python/open3d/ml/tf/python/layers/neighbor_search.py | python | FixedRadiusSearch.call | (self,
points,
queries,
radius,
points_row_splits=None,
queries_row_splits=None,
hash_table_size_factor=1 / 64,
hash_table=None) | return result | This function computes the neighbors within a fixed radius for each query point.
Arguments:
points: The 3D positions of the input points. It can be a RaggedTensor.
*This argument must be given as a positional argument!*
queries: The 3D positions of the query points. It can be a ... | This function computes the neighbors within a fixed radius for each query point. | [
"This",
"function",
"computes",
"the",
"neighbors",
"within",
"a",
"fixed",
"radius",
"for",
"each",
"query",
"point",
"."
] | def call(self,
points,
queries,
radius,
points_row_splits=None,
queries_row_splits=None,
hash_table_size_factor=1 / 64,
hash_table=None):
"""This function computes the neighbors within a fixed radius for each query point.... | [
"def",
"call",
"(",
"self",
",",
"points",
",",
"queries",
",",
"radius",
",",
"points_row_splits",
"=",
"None",
",",
"queries_row_splits",
"=",
"None",
",",
"hash_table_size_factor",
"=",
"1",
"/",
"64",
",",
"hash_table",
"=",
"None",
")",
":",
"if",
"... | https://github.com/isl-org/Open3D/blob/79aec3ddde6a571ce2f28e4096477e52ec465244/python/open3d/ml/tf/python/layers/neighbor_search.py#L82-L168 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/Descriptors/CompoundDescriptors.py | python | CompoundDescriptorCalculator.CalcCompoundDescriptorsForComposition | (self, compos='', composList=None, propDict={}) | return res | calculates all simple descriptors for a given composition
**Arguments**
- compos: a string representation of the composition
- composList: a *composVect*
- propDict: a dictionary containing the properties of the composition
as a whole (e.g. structural variables, etc.)
... | calculates all simple descriptors for a given composition | [
"calculates",
"all",
"simple",
"descriptors",
"for",
"a",
"given",
"composition"
] | def CalcCompoundDescriptorsForComposition(self, compos='', composList=None, propDict={}):
""" calculates all simple descriptors for a given composition
**Arguments**
- compos: a string representation of the composition
- composList: a *composVect*
- propDict: a dictionary containin... | [
"def",
"CalcCompoundDescriptorsForComposition",
"(",
"self",
",",
"compos",
"=",
"''",
",",
"composList",
"=",
"None",
",",
"propDict",
"=",
"{",
"}",
")",
":",
"if",
"composList",
"is",
"None",
":",
"composList",
"=",
"chemutils",
".",
"SplitComposition",
"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Descriptors/CompoundDescriptors.py#L315-L345 | |
genn-team/genn | 75e1eb218cafa228bf36ae4613d1ce26e877b12c | pygenn/genn_groups.py | python | Group.push_var_to_device | (self, var_name) | Wrapper around GeNNModel.push_var_to_device
Args:
var_name -- string with the name of the variable | Wrapper around GeNNModel.push_var_to_device | [
"Wrapper",
"around",
"GeNNModel",
".",
"push_var_to_device"
] | def push_var_to_device(self, var_name):
"""Wrapper around GeNNModel.push_var_to_device
Args:
var_name -- string with the name of the variable
"""
self._model.push_var_to_device(self.name, var_name) | [
"def",
"push_var_to_device",
"(",
"self",
",",
"var_name",
")",
":",
"self",
".",
"_model",
".",
"push_var_to_device",
"(",
"self",
".",
"name",
",",
"var_name",
")"
] | https://github.com/genn-team/genn/blob/75e1eb218cafa228bf36ae4613d1ce26e877b12c/pygenn/genn_groups.py#L98-L104 | ||
Ifsttar/I-Simpa | 2283385f4cac769a92e265edabb9c79cb6c42d03 | currentRelease/ExperimentalScript/md_octave/__init__.py | python | MD_Octave.gettreelabel | (self) | return "MD Octave" | Return core label | Return core label | [
"Return",
"core",
"label"
] | def gettreelabel(self):
"""
Return core label
"""
return "MD Octave" | [
"def",
"gettreelabel",
"(",
"self",
")",
":",
"return",
"\"MD Octave\""
] | https://github.com/Ifsttar/I-Simpa/blob/2283385f4cac769a92e265edabb9c79cb6c42d03/currentRelease/ExperimentalScript/md_octave/__init__.py#L37-L41 | |
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/entrypoints/main.py | python | parse_args | (args: Optional[List[str]] = None) | return parsed_args | DeePMD-Kit commandline options argument parser.
Parameters
----------
args: List[str]
list of command line arguments, main purpose is testing default option None
takes arguments from sys.argv | DeePMD-Kit commandline options argument parser. | [
"DeePMD",
"-",
"Kit",
"commandline",
"options",
"argument",
"parser",
"."
] | def parse_args(args: Optional[List[str]] = None):
"""DeePMD-Kit commandline options argument parser.
Parameters
----------
args: List[str]
list of command line arguments, main purpose is testing default option None
takes arguments from sys.argv
"""
parser = argparse.ArgumentPars... | [
"def",
"parse_args",
"(",
"args",
":",
"Optional",
"[",
"List",
"[",
"str",
"]",
"]",
"=",
"None",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"\"DeePMD-kit: A deep learning package for many-body potential energy\"",
"\" repr... | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/entrypoints/main.py#L46-L415 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TextAttr.GetTextEffects | (*args, **kwargs) | return _controls_.TextAttr_GetTextEffects(*args, **kwargs) | GetTextEffects(self) -> int | GetTextEffects(self) -> int | [
"GetTextEffects",
"(",
"self",
")",
"-",
">",
"int"
] | def GetTextEffects(*args, **kwargs):
"""GetTextEffects(self) -> int"""
return _controls_.TextAttr_GetTextEffects(*args, **kwargs) | [
"def",
"GetTextEffects",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_GetTextEffects",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1756-L1758 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/pkg_resources/_vendor/pyparsing.py | python | ParserElement.copy | ( self ) | return cpy | Make a copy of this C{ParserElement}. Useful for defining different parse actions
for the same parsing pattern, using copies of the original parse element.
Example::
integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
integerK = integer.copy().addParseAction(... | Make a copy of this C{ParserElement}. Useful for defining different parse actions
for the same parsing pattern, using copies of the original parse element.
Example::
integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
integerK = integer.copy().addParseAction(... | [
"Make",
"a",
"copy",
"of",
"this",
"C",
"{",
"ParserElement",
"}",
".",
"Useful",
"for",
"defining",
"different",
"parse",
"actions",
"for",
"the",
"same",
"parsing",
"pattern",
"using",
"copies",
"of",
"the",
"original",
"parse",
"element",
".",
"Example",
... | def copy( self ):
"""
Make a copy of this C{ParserElement}. Useful for defining different parse actions
for the same parsing pattern, using copies of the original parse element.
Example::
integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
int... | [
"def",
"copy",
"(",
"self",
")",
":",
"cpy",
"=",
"copy",
".",
"copy",
"(",
"self",
")",
"cpy",
".",
"parseAction",
"=",
"self",
".",
"parseAction",
"[",
":",
"]",
"cpy",
".",
"ignoreExprs",
"=",
"self",
".",
"ignoreExprs",
"[",
":",
"]",
"if",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/_vendor/pyparsing.py#L1167-L1188 | |
manticoresoftware/manticoresearch | f675d16267543d934ce84074f087d13496ec462c | api/sphinxapi.py | python | SphinxClient.SetFieldWeights | (self, weights) | Bind per-field weights by name; expects (name,field_weight) dictionary as argument. | Bind per-field weights by name; expects (name,field_weight) dictionary as argument. | [
"Bind",
"per",
"-",
"field",
"weights",
"by",
"name",
";",
"expects",
"(",
"name",
"field_weight",
")",
"dictionary",
"as",
"argument",
"."
] | def SetFieldWeights (self, weights):
"""
Bind per-field weights by name; expects (name,field_weight) dictionary as argument.
"""
assert(isinstance(weights,dict))
for key,val in list(weights.items()):
assert(isinstance(key,str))
AssertUInt32 ( val )
self._fieldweights = weights | [
"def",
"SetFieldWeights",
"(",
"self",
",",
"weights",
")",
":",
"assert",
"(",
"isinstance",
"(",
"weights",
",",
"dict",
")",
")",
"for",
"key",
",",
"val",
"in",
"list",
"(",
"weights",
".",
"items",
"(",
")",
")",
":",
"assert",
"(",
"isinstance"... | https://github.com/manticoresoftware/manticoresearch/blob/f675d16267543d934ce84074f087d13496ec462c/api/sphinxapi.py#L394-L402 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/estimators/head.py | python | _MultiLabelHead._metrics | (self, eval_loss, predictions, labels, weights) | return metrics | Returns a dict of metrics keyed by name. | Returns a dict of metrics keyed by name. | [
"Returns",
"a",
"dict",
"of",
"metrics",
"keyed",
"by",
"name",
"."
] | def _metrics(self, eval_loss, predictions, labels, weights):
"""Returns a dict of metrics keyed by name."""
with ops.name_scope("metrics", values=(
[eval_loss, labels, weights] + list(six.itervalues(predictions)))):
classes = predictions[prediction_key.PredictionKey.CLASSES]
probabilities = ... | [
"def",
"_metrics",
"(",
"self",
",",
"eval_loss",
",",
"predictions",
",",
"labels",
",",
"weights",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"\"metrics\"",
",",
"values",
"=",
"(",
"[",
"eval_loss",
",",
"labels",
",",
"weights",
"]",
"+",
"li... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/estimators/head.py#L1384-L1423 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/util/nest.py | python | flatten_up_to | (shallow_tree, input_tree) | return list(_yield_flat_up_to(shallow_tree, input_tree)) | Flattens `input_tree` up to `shallow_tree`.
Any further depth in structure in `input_tree` is retained as elements in the
partially flatten output.
If `shallow_tree` and `input_tree` are not sequences, this returns a
single-element list: `[input_tree]`.
Use Case:
Sometimes we may wish to partially flatt... | Flattens `input_tree` up to `shallow_tree`. | [
"Flattens",
"input_tree",
"up",
"to",
"shallow_tree",
"."
] | def flatten_up_to(shallow_tree, input_tree):
"""Flattens `input_tree` up to `shallow_tree`.
Any further depth in structure in `input_tree` is retained as elements in the
partially flatten output.
If `shallow_tree` and `input_tree` are not sequences, this returns a
single-element list: `[input_tree]`.
Use... | [
"def",
"flatten_up_to",
"(",
"shallow_tree",
",",
"input_tree",
")",
":",
"assert_shallow_structure",
"(",
"shallow_tree",
",",
"input_tree",
")",
"return",
"list",
"(",
"_yield_flat_up_to",
"(",
"shallow_tree",
",",
"input_tree",
")",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/util/nest.py#L460-L530 | |
JoseExposito/touchegg | 1f3fda214358d071c05da4bf17c070c33d67b5eb | cmake/cpplint.py | python | CheckEmptyBlockBody | (filename, clean_lines, linenum, error) | Look for empty loop/conditional body with only a single semicolon.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Look for empty loop/conditional body with only a single semicolon. | [
"Look",
"for",
"empty",
"loop",
"/",
"conditional",
"body",
"with",
"only",
"a",
"single",
"semicolon",
"."
] | def CheckEmptyBlockBody(filename, clean_lines, linenum, error):
"""Look for empty loop/conditional body with only a single semicolon.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The functio... | [
"def",
"CheckEmptyBlockBody",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"# Search for loop keywords at the beginning of the line. Because only",
"# whitespaces are allowed before the keywords, this will also ignore most",
"# do-while-loops, since those... | https://github.com/JoseExposito/touchegg/blob/1f3fda214358d071c05da4bf17c070c33d67b5eb/cmake/cpplint.py#L4002-L4103 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/user_event.py | python | UserEvent.geoip_sub_region | (self) | return self._geoip_sub_region | Gets the geoip_sub_region of this UserEvent. # noqa: E501
:return: The geoip_sub_region of this UserEvent. # noqa: E501
:rtype: str | Gets the geoip_sub_region of this UserEvent. # noqa: E501 | [
"Gets",
"the",
"geoip_sub_region",
"of",
"this",
"UserEvent",
".",
"#",
"noqa",
":",
"E501"
] | def geoip_sub_region(self):
"""Gets the geoip_sub_region of this UserEvent. # noqa: E501
:return: The geoip_sub_region of this UserEvent. # noqa: E501
:rtype: str
"""
return self._geoip_sub_region | [
"def",
"geoip_sub_region",
"(",
"self",
")",
":",
"return",
"self",
".",
"_geoip_sub_region"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/user_event.py#L288-L295 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/style/filereader.py | python | TextFileReader.__init__ | (self, filesystem, processor) | Create an instance.
Arguments:
processor: A ProcessorBase instance. | Create an instance. | [
"Create",
"an",
"instance",
"."
] | def __init__(self, filesystem, processor):
"""Create an instance.
Arguments:
processor: A ProcessorBase instance.
"""
self.filesystem = filesystem
self._processor = processor
self.file_count = 0
self.delete_only_file_count = 0 | [
"def",
"__init__",
"(",
"self",
",",
"filesystem",
",",
"processor",
")",
":",
"self",
".",
"filesystem",
"=",
"filesystem",
"self",
".",
"_processor",
"=",
"processor",
"self",
".",
"file_count",
"=",
"0",
"self",
".",
"delete_only_file_count",
"=",
"0"
] | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/style/filereader.py#L55-L66 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pubsub/utils/topictreeprinter.py | python | TopicTreePrinter.__init__ | (self, extra=None, width=70, indentStep=4,
bulletTopic='\\--', bulletTopicItem='|==', bulletTopicArg='-', fileObj=None) | Topic tree printer will print listeners for each topic only
if printListeners is True. The width will be used to limit
the width of text output, while indentStep is the number of
spaces added each time the text is indented further. The
three bullet parameters define the strings used for ... | Topic tree printer will print listeners for each topic only
if printListeners is True. The width will be used to limit
the width of text output, while indentStep is the number of
spaces added each time the text is indented further. The
three bullet parameters define the strings used for ... | [
"Topic",
"tree",
"printer",
"will",
"print",
"listeners",
"for",
"each",
"topic",
"only",
"if",
"printListeners",
"is",
"True",
".",
"The",
"width",
"will",
"be",
"used",
"to",
"limit",
"the",
"width",
"of",
"text",
"output",
"while",
"indentStep",
"is",
"... | def __init__(self, extra=None, width=70, indentStep=4,
bulletTopic='\\--', bulletTopicItem='|==', bulletTopicArg='-', fileObj=None):
"""Topic tree printer will print listeners for each topic only
if printListeners is True. The width will be used to limit
the width of text output, while i... | [
"def",
"__init__",
"(",
"self",
",",
"extra",
"=",
"None",
",",
"width",
"=",
"70",
",",
"indentStep",
"=",
"4",
",",
"bulletTopic",
"=",
"'\\\\--'",
",",
"bulletTopicItem",
"=",
"'|=='",
",",
"bulletTopicArg",
"=",
"'-'",
",",
"fileObj",
"=",
"None",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/utils/topictreeprinter.py#L46-L76 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PyColourProperty.__init__ | (self, *args, **kwargs) | __init__(self, String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
Colour value=*wxWHITE) -> PyColourProperty | __init__(self, String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
Colour value=*wxWHITE) -> PyColourProperty | [
"__init__",
"(",
"self",
"String",
"label",
"=",
"(",
"*",
"wxPGProperty",
"::",
"sm_wxPG_LABEL",
")",
"String",
"name",
"=",
"(",
"*",
"wxPGProperty",
"::",
"sm_wxPG_LABEL",
")",
"Colour",
"value",
"=",
"*",
"wxWHITE",
")",
"-",
">",
"PyColourProperty"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
Colour value=*wxWHITE) -> PyColourProperty
"""
_propgrid.PyColourProperty_swiginit(self,_propgrid.new_PyColourProperty(*args, **k... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_propgrid",
".",
"PyColourProperty_swiginit",
"(",
"self",
",",
"_propgrid",
".",
"new_PyColourProperty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L4295-L4301 | ||
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | _FunctionState.Count | (self) | Count line in current function body. | Count line in current function body. | [
"Count",
"line",
"in",
"current",
"function",
"body",
"."
] | def Count(self):
"""Count line in current function body."""
if self.in_a_function:
self.lines_in_function += 1 | [
"def",
"Count",
"(",
"self",
")",
":",
"if",
"self",
".",
"in_a_function",
":",
"self",
".",
"lines_in_function",
"+=",
"1"
] | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L695-L698 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/utils.py | python | format_datetime | (dt, usegmt=False) | return _format_timetuple_and_zone(now, zone) | Turn a datetime into a date string as specified in RFC 2822.
If usegmt is True, dt must be an aware datetime with an offset of zero. In
this case 'GMT' will be rendered instead of the normal +0000 required by
RFC2822. This is to support HTTP headers involving date stamps. | Turn a datetime into a date string as specified in RFC 2822. | [
"Turn",
"a",
"datetime",
"into",
"a",
"date",
"string",
"as",
"specified",
"in",
"RFC",
"2822",
"."
] | def format_datetime(dt, usegmt=False):
"""Turn a datetime into a date string as specified in RFC 2822.
If usegmt is True, dt must be an aware datetime with an offset of zero. In
this case 'GMT' will be rendered instead of the normal +0000 required by
RFC2822. This is to support HTTP headers involving... | [
"def",
"format_datetime",
"(",
"dt",
",",
"usegmt",
"=",
"False",
")",
":",
"now",
"=",
"dt",
".",
"timetuple",
"(",
")",
"if",
"usegmt",
":",
"if",
"dt",
".",
"tzinfo",
"is",
"None",
"or",
"dt",
".",
"tzinfo",
"!=",
"datetime",
".",
"timezone",
".... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/utils.py#L155-L171 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiMDIParentFrame.ActivateNext | (*args, **kwargs) | return _aui.AuiMDIParentFrame_ActivateNext(*args, **kwargs) | ActivateNext(self) | ActivateNext(self) | [
"ActivateNext",
"(",
"self",
")"
] | def ActivateNext(*args, **kwargs):
"""ActivateNext(self)"""
return _aui.AuiMDIParentFrame_ActivateNext(*args, **kwargs) | [
"def",
"ActivateNext",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiMDIParentFrame_ActivateNext",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1477-L1479 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | PyApp.IsDisplayAvailable | (*args, **kwargs) | return _core_.PyApp_IsDisplayAvailable(*args, **kwargs) | IsDisplayAvailable() -> bool
Tests if it is possible to create a GUI in the current environment.
This will mean different things on the different platforms.
* On X Windows systems this function will return ``False`` if it is
not able to open a connection to the X server, which ... | IsDisplayAvailable() -> bool | [
"IsDisplayAvailable",
"()",
"-",
">",
"bool"
] | def IsDisplayAvailable(*args, **kwargs):
"""
IsDisplayAvailable() -> bool
Tests if it is possible to create a GUI in the current environment.
This will mean different things on the different platforms.
* On X Windows systems this function will return ``False`` if it is
... | [
"def",
"IsDisplayAvailable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_IsDisplayAvailable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L8218-L8237 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/cuda/__init__.py | python | device_count | () | r"""Returns the number of GPUs available. | r"""Returns the number of GPUs available. | [
"r",
"Returns",
"the",
"number",
"of",
"GPUs",
"available",
"."
] | def device_count() -> int:
r"""Returns the number of GPUs available."""
if is_available():
return torch._C._cuda_getDeviceCount()
else:
return 0 | [
"def",
"device_count",
"(",
")",
"->",
"int",
":",
"if",
"is_available",
"(",
")",
":",
"return",
"torch",
".",
"_C",
".",
"_cuda_getDeviceCount",
"(",
")",
"else",
":",
"return",
"0"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/cuda/__init__.py#L453-L458 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/configHandler.py | python | IdleUserConfParser.RemoveFile | (self) | Removes the user config file from disk if it exists. | Removes the user config file from disk if it exists. | [
"Removes",
"the",
"user",
"config",
"file",
"from",
"disk",
"if",
"it",
"exists",
"."
] | def RemoveFile(self):
"""
Removes the user config file from disk if it exists.
"""
if os.path.exists(self.file):
os.remove(self.file) | [
"def",
"RemoveFile",
"(",
"self",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"file",
")",
":",
"os",
".",
"remove",
"(",
"self",
".",
"file",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/configHandler.py#L127-L132 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/utils/_scipy_sparse_lsqr_backport.py | python | _sym_ortho | (a, b) | return c, s, r | Stable implementation of Givens rotation.
Notes
-----
The routine 'SymOrtho' was added for numerical stability. This is
recommended by S.-C. Choi in [1]_. It removes the unpleasant potential of
``1/eps`` in some important places (see, for example text following
"Compute the next plane rotation... | Stable implementation of Givens rotation. | [
"Stable",
"implementation",
"of",
"Givens",
"rotation",
"."
] | def _sym_ortho(a, b):
"""
Stable implementation of Givens rotation.
Notes
-----
The routine 'SymOrtho' was added for numerical stability. This is
recommended by S.-C. Choi in [1]_. It removes the unpleasant potential of
``1/eps`` in some important places (see, for example text following
... | [
"def",
"_sym_ortho",
"(",
"a",
",",
"b",
")",
":",
"if",
"b",
"==",
"0",
":",
"return",
"np",
".",
"sign",
"(",
"a",
")",
",",
"0",
",",
"abs",
"(",
"a",
")",
"elif",
"a",
"==",
"0",
":",
"return",
"0",
",",
"np",
".",
"sign",
"(",
"b",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/utils/_scipy_sparse_lsqr_backport.py#L63-L95 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | SystemOptions.SetOptionInt | (*args, **kwargs) | return _misc_.SystemOptions_SetOptionInt(*args, **kwargs) | SetOptionInt(String name, int value) | SetOptionInt(String name, int value) | [
"SetOptionInt",
"(",
"String",
"name",
"int",
"value",
")"
] | def SetOptionInt(*args, **kwargs):
"""SetOptionInt(String name, int value)"""
return _misc_.SystemOptions_SetOptionInt(*args, **kwargs) | [
"def",
"SetOptionInt",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"SystemOptions_SetOptionInt",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L226-L228 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/numpy_extension/control_flow.py | python | _flatten | (args, inout_str) | return flat, fmts | Parse the arguments into a flattened list + an additional format array.
The format array stores the structure of the original arguments to help reconstruct the inputs.
Parameters
----------
args : NDArray, Symbol, or (nested) list of Symbol or NDArray
We allow None inside the args.
inout_st... | Parse the arguments into a flattened list + an additional format array.
The format array stores the structure of the original arguments to help reconstruct the inputs. | [
"Parse",
"the",
"arguments",
"into",
"a",
"flattened",
"list",
"+",
"an",
"additional",
"format",
"array",
".",
"The",
"format",
"array",
"stores",
"the",
"structure",
"of",
"the",
"original",
"arguments",
"to",
"help",
"reconstruct",
"the",
"inputs",
"."
] | def _flatten(args, inout_str):
"""Parse the arguments into a flattened list + an additional format array.
The format array stores the structure of the original arguments to help reconstruct the inputs.
Parameters
----------
args : NDArray, Symbol, or (nested) list of Symbol or NDArray
We al... | [
"def",
"_flatten",
"(",
"args",
",",
"inout_str",
")",
":",
"if",
"isinstance",
"(",
"args",
",",
"np_ndarray",
")",
":",
"return",
"[",
"args",
"]",
",",
"int",
"(",
"0",
")",
"if",
"isinstance",
"(",
"args",
",",
"Symbol",
")",
":",
"length",
"="... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/numpy_extension/control_flow.py#L33-L71 | |
kristjankorjus/Replicating-DeepMind | 68539394e792b34a4d6b430a2eb73b8b8f91d8db | sandbox/example3.py | python | OutputLayer.errors | (self, y) | return np.abs(T.mean(self.output-y)) | return the error made in predicting the output value
:type y: theano.tensor.TensorType
:param y: corresponds to a vector that gives for each example the
correct label | return the error made in predicting the output value
:type y: theano.tensor.TensorType
:param y: corresponds to a vector that gives for each example the
correct label | [
"return",
"the",
"error",
"made",
"in",
"predicting",
"the",
"output",
"value",
":",
"type",
"y",
":",
"theano",
".",
"tensor",
".",
"TensorType",
":",
"param",
"y",
":",
"corresponds",
"to",
"a",
"vector",
"that",
"gives",
"for",
"each",
"example",
"the... | def errors(self, y):
""" return the error made in predicting the output value
:type y: theano.tensor.TensorType
:param y: corresponds to a vector that gives for each example the
correct label
"""
# check if y has same dimension of output
if y.ndim != self.output.... | [
"def",
"errors",
"(",
"self",
",",
"y",
")",
":",
"# check if y has same dimension of output",
"if",
"y",
".",
"ndim",
"!=",
"self",
".",
"output",
".",
"ndim",
":",
"raise",
"TypeError",
"(",
"'y should have the same shape as self.output'",
",",
"(",
"'y'",
","... | https://github.com/kristjankorjus/Replicating-DeepMind/blob/68539394e792b34a4d6b430a2eb73b8b8f91d8db/sandbox/example3.py#L75-L86 | |
JumpingYang001/webrtc | c03d6e965e1f54aeadd670e491eabe5fdb8db968 | tools_webrtc/network_emulator/network_emulator.py | python | Cleanup | () | Stops the network emulation by flushing all Dummynet rules.
Notice that this will flush any rules that may have been created previously
before starting the emulation. | Stops the network emulation by flushing all Dummynet rules. | [
"Stops",
"the",
"network",
"emulation",
"by",
"flushing",
"all",
"Dummynet",
"rules",
"."
] | def Cleanup():
"""Stops the network emulation by flushing all Dummynet rules.
Notice that this will flush any rules that may have been created previously
before starting the emulation.
"""
_RunIpfwCommand(['-f', 'flush'], 'Failed to flush Dummynet rules!')
_RunIpfwCommand(['-f', 'pipe', 'flush'], 'Fa... | [
"def",
"Cleanup",
"(",
")",
":",
"_RunIpfwCommand",
"(",
"[",
"'-f'",
",",
"'flush'",
"]",
",",
"'Failed to flush Dummynet rules!'",
")",
"_RunIpfwCommand",
"(",
"[",
"'-f'",
",",
"'pipe'",
",",
"'flush'",
"]",
",",
"'Failed to flush Dummynet pipes!'",
")"
] | https://github.com/JumpingYang001/webrtc/blob/c03d6e965e1f54aeadd670e491eabe5fdb8db968/tools_webrtc/network_emulator/network_emulator.py#L165-L172 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/_exceptions.py | python | SAXException.__str__ | (self) | return self._msg | Create a string representation of the exception. | Create a string representation of the exception. | [
"Create",
"a",
"string",
"representation",
"of",
"the",
"exception",
"."
] | def __str__(self):
"Create a string representation of the exception."
return self._msg | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"self",
".",
"_msg"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/_exceptions.py#L34-L36 | |
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/google/protobuf/descriptor_pool.py | python | DescriptorPool._ConvertMessageDescriptor | (self, desc_proto, package=None, file_desc=None,
scope=None) | return desc | Adds the proto to the pool in the specified package.
Args:
desc_proto: The descriptor_pb2.DescriptorProto protobuf message.
package: The package the proto should be located in.
file_desc: The file containing this message.
scope: Dict mapping short and full symbols to message and enum types.... | Adds the proto to the pool in the specified package. | [
"Adds",
"the",
"proto",
"to",
"the",
"pool",
"in",
"the",
"specified",
"package",
"."
] | def _ConvertMessageDescriptor(self, desc_proto, package=None, file_desc=None,
scope=None):
"""Adds the proto to the pool in the specified package.
Args:
desc_proto: The descriptor_pb2.DescriptorProto protobuf message.
package: The package the proto should be located ... | [
"def",
"_ConvertMessageDescriptor",
"(",
"self",
",",
"desc_proto",
",",
"package",
"=",
"None",
",",
"file_desc",
"=",
"None",
",",
"scope",
"=",
"None",
")",
":",
"if",
"package",
":",
"desc_name",
"=",
"'.'",
".",
"join",
"(",
"(",
"package",
",",
"... | https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/descriptor_pool.py#L324-L399 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/uuid.py | python | _unixdll_getnode | () | return UUID(bytes=_buffer.raw).node | Get the hardware address on Unix using ctypes. | Get the hardware address on Unix using ctypes. | [
"Get",
"the",
"hardware",
"address",
"on",
"Unix",
"using",
"ctypes",
"."
] | def _unixdll_getnode():
"""Get the hardware address on Unix using ctypes."""
_buffer = ctypes.create_string_buffer(16)
_uuid_generate_time(_buffer)
return UUID(bytes=_buffer.raw).node | [
"def",
"_unixdll_getnode",
"(",
")",
":",
"_buffer",
"=",
"ctypes",
".",
"create_string_buffer",
"(",
"16",
")",
"_uuid_generate_time",
"(",
"_buffer",
")",
"return",
"UUID",
"(",
"bytes",
"=",
"_buffer",
".",
"raw",
")",
".",
"node"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/uuid.py#L442-L446 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | python | XCConfigurationList.HasBuildSetting | (self, key) | return 1 | Determines the state of a build setting in all XCBuildConfiguration
child objects.
If all child objects have key in their build settings, and the value is the
same in all child objects, returns 1.
If no child objects have the key in their build settings, returns 0.
If some, but not all, child obj... | Determines the state of a build setting in all XCBuildConfiguration
child objects. | [
"Determines",
"the",
"state",
"of",
"a",
"build",
"setting",
"in",
"all",
"XCBuildConfiguration",
"child",
"objects",
"."
] | def HasBuildSetting(self, key):
"""Determines the state of a build setting in all XCBuildConfiguration
child objects.
If all child objects have key in their build settings, and the value is the
same in all child objects, returns 1.
If no child objects have the key in their build settings, retu... | [
"def",
"HasBuildSetting",
"(",
"self",
",",
"key",
")",
":",
"has",
"=",
"None",
"value",
"=",
"None",
"for",
"configuration",
"in",
"self",
".",
"_properties",
"[",
"\"buildConfigurations\"",
"]",
":",
"configuration_has",
"=",
"configuration",
".",
"HasBuild... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py#L1720-L1752 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd.py | python | _extract_batch_shape | (x, num_event_dims, name='extract_batch_shape') | Extract the batch shape from `x`.
Assuming `x.shape = batch_shape + event_shape`, when `event_shape` has
`num_event_dims` dimensions. This `Op` returns the batch shape `Tensor`.
Args:
x: `Tensor` with rank at least `num_event_dims`. If rank is not high enough
this `Op` will fail.
num_event_dims:... | Extract the batch shape from `x`. | [
"Extract",
"the",
"batch",
"shape",
"from",
"x",
"."
] | def _extract_batch_shape(x, num_event_dims, name='extract_batch_shape'):
"""Extract the batch shape from `x`.
Assuming `x.shape = batch_shape + event_shape`, when `event_shape` has
`num_event_dims` dimensions. This `Op` returns the batch shape `Tensor`.
Args:
x: `Tensor` with rank at least `num_event_dim... | [
"def",
"_extract_batch_shape",
"(",
"x",
",",
"num_event_dims",
",",
"name",
"=",
"'extract_batch_shape'",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"x",
"]",
",",
"name",
")",
":",
"x",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"x",
",",
"n... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd.py#L804-L823 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/asyncio/selector_events.py | python | BaseSelectorEventLoop.remove_writer | (self, fd) | return self._remove_writer(fd) | Remove a writer callback. | Remove a writer callback. | [
"Remove",
"a",
"writer",
"callback",
"."
] | def remove_writer(self, fd):
"""Remove a writer callback."""
self._ensure_fd_no_transport(fd)
return self._remove_writer(fd) | [
"def",
"remove_writer",
"(",
"self",
",",
"fd",
")",
":",
"self",
".",
"_ensure_fd_no_transport",
"(",
"fd",
")",
"return",
"self",
".",
"_remove_writer",
"(",
"fd",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/selector_events.py#L348-L351 | |
argman/EAST | dca414de39a3a4915a019c9a02c1832a31cdd0ca | eval.py | python | get_images | () | return files | find image files in test data path
:return: list of files found | find image files in test data path
:return: list of files found | [
"find",
"image",
"files",
"in",
"test",
"data",
"path",
":",
"return",
":",
"list",
"of",
"files",
"found"
] | def get_images():
'''
find image files in test data path
:return: list of files found
'''
files = []
exts = ['jpg', 'png', 'jpeg', 'JPG']
for parent, dirnames, filenames in os.walk(FLAGS.test_data_path):
for filename in filenames:
for ext in exts:
if filen... | [
"def",
"get_images",
"(",
")",
":",
"files",
"=",
"[",
"]",
"exts",
"=",
"[",
"'jpg'",
",",
"'png'",
",",
"'jpeg'",
",",
"'JPG'",
"]",
"for",
"parent",
",",
"dirnames",
",",
"filenames",
"in",
"os",
".",
"walk",
"(",
"FLAGS",
".",
"test_data_path",
... | https://github.com/argman/EAST/blob/dca414de39a3a4915a019c9a02c1832a31cdd0ca/eval.py#L22-L36 | |
etternagame/etterna | 8775f74ac9c353320128609d4b4150672e9a6d04 | extern/SQLiteCpp/cpplint.py | python | CheckStyle | (filename, clean_lines, linenum, file_extension, nesting_state,
error) | Checks rules from the 'C++ style rules' section of cppguide.html.
Most of these rules are hard to test (naming, comment style), but we
do what we can. In particular we check for 2-space indents, line lengths,
tab usage, spaces inside code, etc.
Args:
filename: The name of the current file.
clean_line... | Checks rules from the 'C++ style rules' section of cppguide.html. | [
"Checks",
"rules",
"from",
"the",
"C",
"++",
"style",
"rules",
"section",
"of",
"cppguide",
".",
"html",
"."
] | def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
error):
"""Checks rules from the 'C++ style rules' section of cppguide.html.
Most of these rules are hard to test (naming, comment style), but we
do what we can. In particular we check for 2-space indents, line lengths,... | [
"def",
"CheckStyle",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"file_extension",
",",
"nesting_state",
",",
"error",
")",
":",
"# Don't use \"elided\" lines here, otherwise we can't check commented lines.",
"# Don't want to use \"raw\" either, because we don't want ... | https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/SQLiteCpp/cpplint.py#L3386-L3492 | ||
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | xmlNode.xpointerNewContext | (self, doc, origin) | return __tmp | Create a new XPointer context | Create a new XPointer context | [
"Create",
"a",
"new",
"XPointer",
"context"
] | def xpointerNewContext(self, doc, origin):
"""Create a new XPointer context """
if doc is None: doc__o = None
else: doc__o = doc._o
if origin is None: origin__o = None
else: origin__o = origin._o
ret = libxml2mod.xmlXPtrNewContext(doc__o, self._o, origin__o)
if re... | [
"def",
"xpointerNewContext",
"(",
"self",
",",
"doc",
",",
"origin",
")",
":",
"if",
"doc",
"is",
"None",
":",
"doc__o",
"=",
"None",
"else",
":",
"doc__o",
"=",
"doc",
".",
"_o",
"if",
"origin",
"is",
"None",
":",
"origin__o",
"=",
"None",
"else",
... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L3865-L3874 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | GridSizeEvent.AltDown | (*args, **kwargs) | return _grid.GridSizeEvent_AltDown(*args, **kwargs) | AltDown(self) -> bool | AltDown(self) -> bool | [
"AltDown",
"(",
"self",
")",
"-",
">",
"bool"
] | def AltDown(*args, **kwargs):
"""AltDown(self) -> bool"""
return _grid.GridSizeEvent_AltDown(*args, **kwargs) | [
"def",
"AltDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridSizeEvent_AltDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L2377-L2379 | |
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/internal/python_message.py | python | _GetFieldByName | (message_descriptor, field_name) | Returns a field descriptor by field name.
Args:
message_descriptor: A Descriptor describing all fields in message.
field_name: The name of the field to retrieve.
Returns:
The field descriptor associated with the field name. | Returns a field descriptor by field name. | [
"Returns",
"a",
"field",
"descriptor",
"by",
"field",
"name",
"."
] | def _GetFieldByName(message_descriptor, field_name):
"""Returns a field descriptor by field name.
Args:
message_descriptor: A Descriptor describing all fields in message.
field_name: The name of the field to retrieve.
Returns:
The field descriptor associated with the field name.
"""
try:
retu... | [
"def",
"_GetFieldByName",
"(",
"message_descriptor",
",",
"field_name",
")",
":",
"try",
":",
"return",
"message_descriptor",
".",
"fields_by_name",
"[",
"field_name",
"]",
"except",
"KeyError",
":",
"raise",
"ValueError",
"(",
"'Protocol message %s has no \"%s\" field.... | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/internal/python_message.py#L542-L555 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | MouseState.SetY | (*args, **kwargs) | return _core_.MouseState_SetY(*args, **kwargs) | SetY(self, int y) | SetY(self, int y) | [
"SetY",
"(",
"self",
"int",
"y",
")"
] | def SetY(*args, **kwargs):
"""SetY(self, int y)"""
return _core_.MouseState_SetY(*args, **kwargs) | [
"def",
"SetY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MouseState_SetY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L4486-L4488 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py | python | Decimal.__rdivmod__ | (self, other, context=None) | return other.__divmod__(self, context=context) | Swaps self/other and returns __divmod__. | Swaps self/other and returns __divmod__. | [
"Swaps",
"self",
"/",
"other",
"and",
"returns",
"__divmod__",
"."
] | def __rdivmod__(self, other, context=None):
"""Swaps self/other and returns __divmod__."""
other = _convert_other(other)
if other is NotImplemented:
return other
return other.__divmod__(self, context=context) | [
"def",
"__rdivmod__",
"(",
"self",
",",
"other",
",",
"context",
"=",
"None",
")",
":",
"other",
"=",
"_convert_other",
"(",
"other",
")",
"if",
"other",
"is",
"NotImplemented",
":",
"return",
"other",
"return",
"other",
".",
"__divmod__",
"(",
"self",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py#L1459-L1464 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/dtypes/base.py | python | ExtensionDtype.na_value | (self) | return np.nan | Default NA value to use for this type.
This is used in e.g. ExtensionArray.take. This should be the
user-facing "boxed" version of the NA value, not the physical NA value
for storage. e.g. for JSONArray, this is an empty dictionary. | Default NA value to use for this type. | [
"Default",
"NA",
"value",
"to",
"use",
"for",
"this",
"type",
"."
] | def na_value(self) -> object:
"""
Default NA value to use for this type.
This is used in e.g. ExtensionArray.take. This should be the
user-facing "boxed" version of the NA value, not the physical NA value
for storage. e.g. for JSONArray, this is an empty dictionary.
"""... | [
"def",
"na_value",
"(",
"self",
")",
"->",
"object",
":",
"return",
"np",
".",
"nan"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/dtypes/base.py#L140-L148 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/interval/FunctionInterval.py | python | PosHprInterval.__init__ | (self, nodePath, pos, hpr, duration = 0.0,
name = None, other = None) | __init__(nodePath, pos, hpr, duration, name) | __init__(nodePath, pos, hpr, duration, name) | [
"__init__",
"(",
"nodePath",
"pos",
"hpr",
"duration",
"name",
")"
] | def __init__(self, nodePath, pos, hpr, duration = 0.0,
name = None, other = None):
"""__init__(nodePath, pos, hpr, duration, name)
"""
# Create function
def posHprFunc(np = nodePath, pos = pos, hpr = hpr, other = other):
if other:
np.setPosHpr... | [
"def",
"__init__",
"(",
"self",
",",
"nodePath",
",",
"pos",
",",
"hpr",
",",
"duration",
"=",
"0.0",
",",
"name",
"=",
"None",
",",
"other",
"=",
"None",
")",
":",
"# Create function",
"def",
"posHprFunc",
"(",
"np",
"=",
"nodePath",
",",
"pos",
"="... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/interval/FunctionInterval.py#L238-L253 | ||
gklz1982/caffe-yolov2 | ebb27029db4ddc0d40e520634633b0fa9cdcc10d | scripts/cpp_lint.py | python | _Filters | () | return _cpplint_state.filters | Returns the module's list of output filters, as a list. | Returns the module's list of output filters, as a list. | [
"Returns",
"the",
"module",
"s",
"list",
"of",
"output",
"filters",
"as",
"a",
"list",
"."
] | def _Filters():
"""Returns the module's list of output filters, as a list."""
return _cpplint_state.filters | [
"def",
"_Filters",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"filters"
] | https://github.com/gklz1982/caffe-yolov2/blob/ebb27029db4ddc0d40e520634633b0fa9cdcc10d/scripts/cpp_lint.py#L792-L794 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/aoc/upgrade_attribute_subprocessor.py | python | AoCUpgradeAttributeSubprocessor.reload_time_upgrade | (converter_group, line, value, operator, team=False) | return patches | Creates a patch for the reload time modify effect (ID: 10).
:param converter_group: Tech/Civ that gets the patch.
:type converter_group: ...dataformat.converter_object.ConverterObjectGroup
:param line: Unit/Building line that has the ability.
:type line: ...dataformat.converter_object.C... | Creates a patch for the reload time modify effect (ID: 10). | [
"Creates",
"a",
"patch",
"for",
"the",
"reload",
"time",
"modify",
"effect",
"(",
"ID",
":",
"10",
")",
"."
] | def reload_time_upgrade(converter_group, line, value, operator, team=False):
"""
Creates a patch for the reload time modify effect (ID: 10).
:param converter_group: Tech/Civ that gets the patch.
:type converter_group: ...dataformat.converter_object.ConverterObjectGroup
:param li... | [
"def",
"reload_time_upgrade",
"(",
"converter_group",
",",
"line",
",",
"value",
",",
"operator",
",",
"team",
"=",
"False",
")",
":",
"head_unit_id",
"=",
"line",
".",
"get_head_unit_id",
"(",
")",
"dataset",
"=",
"line",
".",
"data",
"patches",
"=",
"[",... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/upgrade_attribute_subprocessor.py#L1853-L1951 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/internals/blocks.py | python | Block._slice | (self, slicer) | return self.values[slicer] | return a slice of my values | return a slice of my values | [
"return",
"a",
"slice",
"of",
"my",
"values"
] | def _slice(self, slicer):
""" return a slice of my values """
return self.values[slicer] | [
"def",
"_slice",
"(",
"self",
",",
"slicer",
")",
":",
"return",
"self",
".",
"values",
"[",
"slicer",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/internals/blocks.py#L266-L268 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/google/protobuf/message.py | python | Message.__setstate__ | (self, state) | Support the pickle protocol. | Support the pickle protocol. | [
"Support",
"the",
"pickle",
"protocol",
"."
] | def __setstate__(self, state):
"""Support the pickle protocol."""
self.__init__()
self.ParseFromString(state['serialized']) | [
"def",
"__setstate__",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"__init__",
"(",
")",
"self",
".",
"ParseFromString",
"(",
"state",
"[",
"'serialized'",
"]",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/message.py#L277-L280 | ||
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | scripts/cpp_lint.py | python | GetHeaderGuardCPPVariable | (filename) | return re.sub(r'[-./\s]', '_', file_path_from_root).upper() + '_' | Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file. | Returns the CPP variable that should be used as a header guard. | [
"Returns",
"the",
"CPP",
"variable",
"that",
"should",
"be",
"used",
"as",
"a",
"header",
"guard",
"."
] | def GetHeaderGuardCPPVariable(filename):
"""Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file.
"""
# Restores original filename in case that cpplint is... | [
"def",
"GetHeaderGuardCPPVariable",
"(",
"filename",
")",
":",
"# Restores original filename in case that cpplint is invoked from Emacs's",
"# flymake.",
"filename",
"=",
"re",
".",
"sub",
"(",
"r'_flymake\\.h$'",
",",
"'.h'",
",",
"filename",
")",
"filename",
"=",
"re",
... | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/scripts/cpp_lint.py#L1384-L1405 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/flatnotebook.py | python | PageInfo.SetPosition | (self, value) | Sets the tab position. | Sets the tab position. | [
"Sets",
"the",
"tab",
"position",
"."
] | def SetPosition(self, value):
""" Sets the tab position. """
self._pos = value | [
"def",
"SetPosition",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"_pos",
"=",
"value"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/flatnotebook.py#L924-L927 | ||
zeroc-ice/ice | 6df7df6039674d58fb5ab9a08e46f28591a210f7 | python/python/Ice/__init__.py | python | BatchRequestInterceptor.enqueue | (self, request, queueCount, queueSize) | Invoked when a request is batched. | Invoked when a request is batched. | [
"Invoked",
"when",
"a",
"request",
"is",
"batched",
"."
] | def enqueue(self, request, queueCount, queueSize):
'''Invoked when a request is batched.'''
pass | [
"def",
"enqueue",
"(",
"self",
",",
"request",
",",
"queueCount",
",",
"queueSize",
")",
":",
"pass"
] | https://github.com/zeroc-ice/ice/blob/6df7df6039674d58fb5ab9a08e46f28591a210f7/python/python/Ice/__init__.py#L834-L836 | ||
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/internal/python_message.py | python | _ExtensionDict.__getitem__ | (self, extension_handle) | return result | Returns the current value of the given extension handle. | Returns the current value of the given extension handle. | [
"Returns",
"the",
"current",
"value",
"of",
"the",
"given",
"extension",
"handle",
"."
] | def __getitem__(self, extension_handle):
"""Returns the current value of the given extension handle."""
_VerifyExtensionHandle(self._extended_message, extension_handle)
result = self._extended_message._fields.get(extension_handle)
if result is not None:
return result
if extension_handle.lab... | [
"def",
"__getitem__",
"(",
"self",
",",
"extension_handle",
")",
":",
"_VerifyExtensionHandle",
"(",
"self",
".",
"_extended_message",
",",
"extension_handle",
")",
"result",
"=",
"self",
".",
"_extended_message",
".",
"_fields",
".",
"get",
"(",
"extension_handle... | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/internal/python_message.py#L1453-L1484 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/cookies.py | python | RequestsCookieJar.update | (self, other) | Updates this jar with cookies from another CookieJar or dict-like | Updates this jar with cookies from another CookieJar or dict-like | [
"Updates",
"this",
"jar",
"with",
"cookies",
"from",
"another",
"CookieJar",
"or",
"dict",
"-",
"like"
] | def update(self, other):
"""Updates this jar with cookies from another CookieJar or dict-like"""
if isinstance(other, cookielib.CookieJar):
for cookie in other:
self.set_cookie(copy.copy(cookie))
else:
super(RequestsCookieJar, self).update(other) | [
"def",
"update",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"cookielib",
".",
"CookieJar",
")",
":",
"for",
"cookie",
"in",
"other",
":",
"self",
".",
"set_cookie",
"(",
"copy",
".",
"copy",
"(",
"cookie",
")",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/cookies.py#L348-L354 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/ez_setup.py | python | main | (argv, version=DEFAULT_VERSION) | Install or upgrade setuptools and EasyInstall | Install or upgrade setuptools and EasyInstall | [
"Install",
"or",
"upgrade",
"setuptools",
"and",
"EasyInstall"
] | def main(argv, version=DEFAULT_VERSION):
"""Install or upgrade setuptools and EasyInstall"""
try:
import setuptools
except ImportError:
egg = None
try:
egg = download_setuptools(version, delay=0)
sys.path.insert(0,egg)
from setuptools.command.easy_... | [
"def",
"main",
"(",
"argv",
",",
"version",
"=",
"DEFAULT_VERSION",
")",
":",
"try",
":",
"import",
"setuptools",
"except",
"ImportError",
":",
"egg",
"=",
"None",
"try",
":",
"egg",
"=",
"download_setuptools",
"(",
"version",
",",
"delay",
"=",
"0",
")"... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/ez_setup.py#L223-L262 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/gypfiles/vs_toolchain.py | python | GetVisualStudioVersion | () | return os.environ.get('GYP_MSVS_VERSION', CURRENT_DEFAULT_TOOLCHAIN_VERSION) | Return GYP_MSVS_VERSION of Visual Studio. | Return GYP_MSVS_VERSION of Visual Studio. | [
"Return",
"GYP_MSVS_VERSION",
"of",
"Visual",
"Studio",
"."
] | def GetVisualStudioVersion():
"""Return GYP_MSVS_VERSION of Visual Studio.
"""
return os.environ.get('GYP_MSVS_VERSION', CURRENT_DEFAULT_TOOLCHAIN_VERSION) | [
"def",
"GetVisualStudioVersion",
"(",
")",
":",
"return",
"os",
".",
"environ",
".",
"get",
"(",
"'GYP_MSVS_VERSION'",
",",
"CURRENT_DEFAULT_TOOLCHAIN_VERSION",
")"
] | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/gypfiles/vs_toolchain.py#L110-L113 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/decomposition/dict_learning.py | python | dict_learning | (X, n_components, alpha, max_iter=100, tol=1e-8,
method='lars', n_jobs=1, dict_init=None, code_init=None,
callback=None, verbose=False, random_state=None,
return_n_iter=False) | Solves a dictionary learning matrix factorization problem.
Finds the best dictionary and the corresponding sparse code for
approximating the data matrix X by solving::
(U^*, V^*) = argmin 0.5 || X - U V ||_2^2 + alpha * || U ||_1
(U,V)
with || V_k ||_2 = 1 for ... | Solves a dictionary learning matrix factorization problem. | [
"Solves",
"a",
"dictionary",
"learning",
"matrix",
"factorization",
"problem",
"."
] | def dict_learning(X, n_components, alpha, max_iter=100, tol=1e-8,
method='lars', n_jobs=1, dict_init=None, code_init=None,
callback=None, verbose=False, random_state=None,
return_n_iter=False):
"""Solves a dictionary learning matrix factorization problem.
F... | [
"def",
"dict_learning",
"(",
"X",
",",
"n_components",
",",
"alpha",
",",
"max_iter",
"=",
"100",
",",
"tol",
"=",
"1e-8",
",",
"method",
"=",
"'lars'",
",",
"n_jobs",
"=",
"1",
",",
"dict_init",
"=",
"None",
",",
"code_init",
"=",
"None",
",",
"call... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/decomposition/dict_learning.py#L378-L546 | ||
andre-martins/TurboParser | a87b8e45694c18b826bb3c42e8344bd32928007d | python/tokenizer/universal_word_tokenizer.py | python | UniversalWordTokenizer.tokenize | (self, text, track_positions=False) | Return a tokenized copy of *s*.
:rtype: list of str | Return a tokenized copy of *s*. | [
"Return",
"a",
"tokenized",
"copy",
"of",
"*",
"s",
"*",
"."
] | def tokenize(self, text, track_positions=False):
"""
Return a tokenized copy of *s*.
:rtype: list of str
"""
if track_positions:
from aligned_string import AlignedString
text = AlignedString(text)
sub = substitute_with_positions
else:
... | [
"def",
"tokenize",
"(",
"self",
",",
"text",
",",
"track_positions",
"=",
"False",
")",
":",
"if",
"track_positions",
":",
"from",
"aligned_string",
"import",
"AlignedString",
"text",
"=",
"AlignedString",
"(",
"text",
")",
"sub",
"=",
"substitute_with_positions... | https://github.com/andre-martins/TurboParser/blob/a87b8e45694c18b826bb3c42e8344bd32928007d/python/tokenizer/universal_word_tokenizer.py#L75-L207 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py | python | JIRA.priorities | (self) | return priorities | Get a list of priority Resources from the server. | Get a list of priority Resources from the server. | [
"Get",
"a",
"list",
"of",
"priority",
"Resources",
"from",
"the",
"server",
"."
] | def priorities(self):
"""Get a list of priority Resources from the server."""
r_json = self._get_json('priority')
priorities = [Priority(
self._options, self._session, raw_priority_json) for raw_priority_json in r_json]
return priorities | [
"def",
"priorities",
"(",
"self",
")",
":",
"r_json",
"=",
"self",
".",
"_get_json",
"(",
"'priority'",
")",
"priorities",
"=",
"[",
"Priority",
"(",
"self",
".",
"_options",
",",
"self",
".",
"_session",
",",
"raw_priority_json",
")",
"for",
"raw_priority... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py#L1835-L1840 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TFlt.IsNum | (self, *args) | return _snap.TFlt_IsNum(self, *args) | IsNum(TFlt self, double const & Val) -> bool
Parameters:
Val: double const &
IsNum(TFlt self) -> bool
Parameters:
self: TFlt const * | IsNum(TFlt self, double const & Val) -> bool | [
"IsNum",
"(",
"TFlt",
"self",
"double",
"const",
"&",
"Val",
")",
"-",
">",
"bool"
] | def IsNum(self, *args):
"""
IsNum(TFlt self, double const & Val) -> bool
Parameters:
Val: double const &
IsNum(TFlt self) -> bool
Parameters:
self: TFlt const *
"""
return _snap.TFlt_IsNum(self, *args) | [
"def",
"IsNum",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TFlt_IsNum",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L14498-L14511 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py | python | Dir.walk | (self, func, arg) | Walk this directory tree by calling the specified function
for each directory in the tree.
This behaves like the os.path.walk() function, but for in-memory
Node.FS.Dir objects. The function takes the same arguments as
the functions passed to os.path.walk():
func(arg, d... | Walk this directory tree by calling the specified function
for each directory in the tree. | [
"Walk",
"this",
"directory",
"tree",
"by",
"calling",
"the",
"specified",
"function",
"for",
"each",
"directory",
"in",
"the",
"tree",
"."
] | def walk(self, func, arg):
"""
Walk this directory tree by calling the specified function
for each directory in the tree.
This behaves like the os.path.walk() function, but for in-memory
Node.FS.Dir objects. The function takes the same arguments as
the functions passed ... | [
"def",
"walk",
"(",
"self",
",",
"func",
",",
"arg",
")",
":",
"entries",
"=",
"self",
".",
"entries",
"names",
"=",
"list",
"(",
"entries",
".",
"keys",
"(",
")",
")",
"names",
".",
"remove",
"(",
"'.'",
")",
"names",
".",
"remove",
"(",
"'..'",... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py#L2107-L2131 | ||
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/core/matrix.py | python | __ElementMatrix_str | (self) | return s | Show entries of an ElementMatrix. | Show entries of an ElementMatrix. | [
"Show",
"entries",
"of",
"an",
"ElementMatrix",
"."
] | def __ElementMatrix_str(self):
"""Show entries of an ElementMatrix."""
import pygimli as pg
if self.mat().cols() == 0 and self.mat().rows() == 0:
return 'Empty ElementMatrix\n'
maxRowID = int(np.log10(max(self.rowIDs())))+2
s = '\n ' + ' ' * maxRowID
# print(self.mat())
# print(sel... | [
"def",
"__ElementMatrix_str",
"(",
"self",
")",
":",
"import",
"pygimli",
"as",
"pg",
"if",
"self",
".",
"mat",
"(",
")",
".",
"cols",
"(",
")",
"==",
"0",
"and",
"self",
".",
"mat",
"(",
")",
".",
"rows",
"(",
")",
"==",
"0",
":",
"return",
"'... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/core/matrix.py#L66-L89 | |
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/xcodeproj_file.py | python | XCConfigurationList.HasBuildSetting | (self, key) | return 1 | Determines the state of a build setting in all XCBuildConfiguration
child objects.
If all child objects have key in their build settings, and the value is the
same in all child objects, returns 1.
If no child objects have the key in their build settings, returns 0.
If some, but not all, child obj... | Determines the state of a build setting in all XCBuildConfiguration
child objects. | [
"Determines",
"the",
"state",
"of",
"a",
"build",
"setting",
"in",
"all",
"XCBuildConfiguration",
"child",
"objects",
"."
] | def HasBuildSetting(self, key):
"""Determines the state of a build setting in all XCBuildConfiguration
child objects.
If all child objects have key in their build settings, and the value is the
same in all child objects, returns 1.
If no child objects have the key in their build settings, returns ... | [
"def",
"HasBuildSetting",
"(",
"self",
",",
"key",
")",
":",
"has",
"=",
"None",
"value",
"=",
"None",
"for",
"configuration",
"in",
"self",
".",
"_properties",
"[",
"'buildConfigurations'",
"]",
":",
"configuration_has",
"=",
"configuration",
".",
"HasBuildSe... | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/xcodeproj_file.py#L1617-L1649 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/cgitb.py | python | text | (einfo, context=5) | return head + ''.join(frames) + ''.join(exception) + '''
The above is a description of an error in a Python program. Here is
the original traceback:
%s
''' % ''.join(traceback.format_exception(etype, evalue, etb)) | Return a plain text document describing a given traceback. | Return a plain text document describing a given traceback. | [
"Return",
"a",
"plain",
"text",
"document",
"describing",
"a",
"given",
"traceback",
"."
] | def text(einfo, context=5):
"""Return a plain text document describing a given traceback."""
etype, evalue, etb = einfo
if type(etype) is types.ClassType:
etype = etype.__name__
pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable
date = time.ctime(time.time())
head = "%s\n... | [
"def",
"text",
"(",
"einfo",
",",
"context",
"=",
"5",
")",
":",
"etype",
",",
"evalue",
",",
"etb",
"=",
"einfo",
"if",
"type",
"(",
"etype",
")",
"is",
"types",
".",
"ClassType",
":",
"etype",
"=",
"etype",
".",
"__name__",
"pyver",
"=",
"'Python... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/cgitb.py#L193-L257 | |
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/text_format.py | python | _Printer._TryPrintAsAnyMessage | (self, message) | Serializes if message is a google.protobuf.Any field. | Serializes if message is a google.protobuf.Any field. | [
"Serializes",
"if",
"message",
"is",
"a",
"google",
".",
"protobuf",
".",
"Any",
"field",
"."
] | def _TryPrintAsAnyMessage(self, message):
"""Serializes if message is a google.protobuf.Any field."""
packed_message = _BuildMessageFromTypeName(message.TypeName(),
self.descriptor_pool)
if packed_message:
packed_message.MergeFromString(message.value)
... | [
"def",
"_TryPrintAsAnyMessage",
"(",
"self",
",",
"message",
")",
":",
"packed_message",
"=",
"_BuildMessageFromTypeName",
"(",
"message",
".",
"TypeName",
"(",
")",
",",
"self",
".",
"descriptor_pool",
")",
"if",
"packed_message",
":",
"packed_message",
".",
"M... | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/text_format.py#L287-L298 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/ogl/_drawn.py | python | DrawnShape.Translate | (self, x, y) | Translate the shape by the given amount. | Translate the shape by the given amount. | [
"Translate",
"the",
"shape",
"by",
"the",
"given",
"amount",
"."
] | def Translate(self, x, y):
"""Translate the shape by the given amount."""
for i in range(4):
if self._metafiles[i].IsValid():
self._metafiles[i].Translate(x, y)
self._metafiles[i].CalculateSize(self) | [
"def",
"Translate",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"for",
"i",
"in",
"range",
"(",
"4",
")",
":",
"if",
"self",
".",
"_metafiles",
"[",
"i",
"]",
".",
"IsValid",
"(",
")",
":",
"self",
".",
"_metafiles",
"[",
"i",
"]",
".",
"Trans... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_drawn.py#L675-L680 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBInstruction.EmulateWithFrame | (self, *args) | return _lldb.SBInstruction_EmulateWithFrame(self, *args) | EmulateWithFrame(self, SBFrame frame, uint32_t evaluate_options) -> bool | EmulateWithFrame(self, SBFrame frame, uint32_t evaluate_options) -> bool | [
"EmulateWithFrame",
"(",
"self",
"SBFrame",
"frame",
"uint32_t",
"evaluate_options",
")",
"-",
">",
"bool"
] | def EmulateWithFrame(self, *args):
"""EmulateWithFrame(self, SBFrame frame, uint32_t evaluate_options) -> bool"""
return _lldb.SBInstruction_EmulateWithFrame(self, *args) | [
"def",
"EmulateWithFrame",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBInstruction_EmulateWithFrame",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L5227-L5229 | |
arkenthera/electron-vibrancy | 383153ef9ccb23a6c7517150d6bb0794dff3115e | scripts/cpplint.py | python | NestingState.InnermostClass | (self) | return None | Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise. | Get class info on the top of the stack. | [
"Get",
"class",
"info",
"on",
"the",
"top",
"of",
"the",
"stack",
"."
] | def InnermostClass(self):
"""Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise.
"""
for i in range(len(self.stack), 0, -1):
classinfo = self.stack[i - 1]
if isinstance(classinfo, _ClassInfo):
return classinfo
r... | [
"def",
"InnermostClass",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"stack",
")",
",",
"0",
",",
"-",
"1",
")",
":",
"classinfo",
"=",
"self",
".",
"stack",
"[",
"i",
"-",
"1",
"]",
"if",
"isinstance",
"(",
... | https://github.com/arkenthera/electron-vibrancy/blob/383153ef9ccb23a6c7517150d6bb0794dff3115e/scripts/cpplint.py#L2287-L2297 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/experiment.py | python | Experiment.run_std_server | (self) | Starts a TensorFlow server and joins the serving thread.
Typically used for parameter servers.
Raises:
ValueError: if not enough information is available in the estimator's
config to create a server. | Starts a TensorFlow server and joins the serving thread. | [
"Starts",
"a",
"TensorFlow",
"server",
"and",
"joins",
"the",
"serving",
"thread",
"."
] | def run_std_server(self):
"""Starts a TensorFlow server and joins the serving thread.
Typically used for parameter servers.
Raises:
ValueError: if not enough information is available in the estimator's
config to create a server.
"""
self._start_server().join() | [
"def",
"run_std_server",
"(",
"self",
")",
":",
"self",
".",
"_start_server",
"(",
")",
".",
"join",
"(",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/experiment.py#L613-L622 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/docs/docstring.py | python | LazyLoadedDocstring.__init__ | (self, *args, **kwargs) | The args and kwargs are the same as the underlying document
generation function. These just get proxied to the underlying
function. | The args and kwargs are the same as the underlying document
generation function. These just get proxied to the underlying
function. | [
"The",
"args",
"and",
"kwargs",
"are",
"the",
"same",
"as",
"the",
"underlying",
"document",
"generation",
"function",
".",
"These",
"just",
"get",
"proxied",
"to",
"the",
"underlying",
"function",
"."
] | def __init__(self, *args, **kwargs):
"""
The args and kwargs are the same as the underlying document
generation function. These just get proxied to the underlying
function.
"""
super(LazyLoadedDocstring, self).__init__()
self._gen_args = args
self._gen_kwa... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"LazyLoadedDocstring",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_gen_args",
"=",
"args",
"self",
".",
"_gen_kwargs",
"=",
"kwargs",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/docs/docstring.py#L27-L36 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/s3transfer/manager.py | python | TransferCoordinatorController.wait | (self) | Wait until there are no more inprogress transfers
This will not stop when failures are encountered and not propogate any
of these errors from failed transfers, but it can be interrupted with
a KeyboardInterrupt. | Wait until there are no more inprogress transfers | [
"Wait",
"until",
"there",
"are",
"no",
"more",
"inprogress",
"transfers"
] | def wait(self):
"""Wait until there are no more inprogress transfers
This will not stop when failures are encountered and not propogate any
of these errors from failed transfers, but it can be interrupted with
a KeyboardInterrupt.
"""
try:
transfer_coordinato... | [
"def",
"wait",
"(",
"self",
")",
":",
"try",
":",
"transfer_coordinator",
"=",
"None",
"for",
"transfer_coordinator",
"in",
"self",
".",
"tracked_transfer_coordinators",
":",
"transfer_coordinator",
".",
"result",
"(",
")",
"except",
"KeyboardInterrupt",
":",
"log... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/s3transfer/manager.py#L632-L658 | ||
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/build/lib.linux-x86_64-2.7/mxnet/lr_scheduler.py | python | MultiFactorScheduler.__call__ | (self, num_update) | return self.base_lr | Call to schedule current learning rate
Parameters
----------
num_update: int
the maximal number of updates applied to a weight. | Call to schedule current learning rate | [
"Call",
"to",
"schedule",
"current",
"learning",
"rate"
] | def __call__(self, num_update):
"""
Call to schedule current learning rate
Parameters
----------
num_update: int
the maximal number of updates applied to a weight.
"""
if self.cur_step_ind <= len(self.step)-1:
if num_update > self.step[se... | [
"def",
"__call__",
"(",
"self",
",",
"num_update",
")",
":",
"if",
"self",
".",
"cur_step_ind",
"<=",
"len",
"(",
"self",
".",
"step",
")",
"-",
"1",
":",
"if",
"num_update",
">",
"self",
".",
"step",
"[",
"self",
".",
"cur_step_ind",
"]",
":",
"se... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/lr_scheduler.py#L108-L125 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Modules/Scripted/DICOMLib/DICOMPlugin.py | python | DICOMPlugin.load | (self,loadable) | return True | Accept a DICOMLoadable and perform the operation to convert
the referenced data into MRML nodes
Virtual: should be overridden by the subclass | Accept a DICOMLoadable and perform the operation to convert
the referenced data into MRML nodes
Virtual: should be overridden by the subclass | [
"Accept",
"a",
"DICOMLoadable",
"and",
"perform",
"the",
"operation",
"to",
"convert",
"the",
"referenced",
"data",
"into",
"MRML",
"nodes",
"Virtual",
":",
"should",
"be",
"overridden",
"by",
"the",
"subclass"
] | def load(self,loadable):
"""Accept a DICOMLoadable and perform the operation to convert
the referenced data into MRML nodes
Virtual: should be overridden by the subclass
"""
return True | [
"def",
"load",
"(",
"self",
",",
"loadable",
")",
":",
"return",
"True"
] | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/DICOMLib/DICOMPlugin.py#L127-L132 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TreeCtrl.GetChildrenCount | (*args, **kwargs) | return _controls_.TreeCtrl_GetChildrenCount(*args, **kwargs) | GetChildrenCount(self, TreeItemId item, bool recursively=True) -> size_t | GetChildrenCount(self, TreeItemId item, bool recursively=True) -> size_t | [
"GetChildrenCount",
"(",
"self",
"TreeItemId",
"item",
"bool",
"recursively",
"=",
"True",
")",
"-",
">",
"size_t"
] | def GetChildrenCount(*args, **kwargs):
"""GetChildrenCount(self, TreeItemId item, bool recursively=True) -> size_t"""
return _controls_.TreeCtrl_GetChildrenCount(*args, **kwargs) | [
"def",
"GetChildrenCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeCtrl_GetChildrenCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5355-L5357 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/linalg/_interpolative_backend.py | python | idd_frm | (n, w, x) | return _id.idd_frm(n, w, x) | Transform real vector via a composition of Rokhlin's random transform,
random subselection, and an FFT.
In contrast to :func:`idd_sfrm`, this routine works best when the length of
the transformed vector is the power-of-two integer output by
:func:`idd_frmi`, or when the length is not specified but inst... | Transform real vector via a composition of Rokhlin's random transform,
random subselection, and an FFT. | [
"Transform",
"real",
"vector",
"via",
"a",
"composition",
"of",
"Rokhlin",
"s",
"random",
"transform",
"random",
"subselection",
"and",
"an",
"FFT",
"."
] | def idd_frm(n, w, x):
"""
Transform real vector via a composition of Rokhlin's random transform,
random subselection, and an FFT.
In contrast to :func:`idd_sfrm`, this routine works best when the length of
the transformed vector is the power-of-two integer output by
:func:`idd_frmi`, or when th... | [
"def",
"idd_frm",
"(",
"n",
",",
"w",
",",
"x",
")",
":",
"return",
"_id",
".",
"idd_frm",
"(",
"n",
",",
"w",
",",
"x",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/_interpolative_backend.py#L84-L110 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/ensemble/weight_boosting.py | python | AdaBoostClassifier.staged_predict_proba | (self, X) | Predict class probabilities for X.
The predicted class probabilities of an input sample is computed as
the weighted mean predicted class probabilities of the classifiers
in the ensemble.
This generator method yields the ensemble predicted class probabilities
after each iteratio... | Predict class probabilities for X. | [
"Predict",
"class",
"probabilities",
"for",
"X",
"."
] | def staged_predict_proba(self, X):
"""Predict class probabilities for X.
The predicted class probabilities of an input sample is computed as
the weighted mean predicted class probabilities of the classifiers
in the ensemble.
This generator method yields the ensemble predicted c... | [
"def",
"staged_predict_proba",
"(",
"self",
",",
"X",
")",
":",
"X",
"=",
"self",
".",
"_validate_X_predict",
"(",
"X",
")",
"n_classes",
"=",
"self",
".",
"n_classes_",
"proba",
"=",
"None",
"norm",
"=",
"0.",
"for",
"weight",
",",
"estimator",
"in",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/ensemble/weight_boosting.py#L774-L824 | ||
Yijunmaverick/GenerativeFaceCompletion | f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2 | scripts/cpp_lint.py | python | CheckCStyleCast | (filename, linenum, line, raw_line, cast_type, pattern,
error) | return True | Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
linenum: The number of the line to check.
line: The line of code to check.
raw_line: The raw line of code to check, with comments.
cast_type: The string for the C++ cast to recommend. This is eith... | Checks for a C-style cast by looking for the pattern. | [
"Checks",
"for",
"a",
"C",
"-",
"style",
"cast",
"by",
"looking",
"for",
"the",
"pattern",
"."
] | def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern,
error):
"""Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
linenum: The number of the line to check.
line: The line of code to check.
raw_line: The raw ... | [
"def",
"CheckCStyleCast",
"(",
"filename",
",",
"linenum",
",",
"line",
",",
"raw_line",
",",
"cast_type",
",",
"pattern",
",",
"error",
")",
":",
"match",
"=",
"Search",
"(",
"pattern",
",",
"line",
")",
"if",
"not",
"match",
":",
"return",
"False",
"... | https://github.com/Yijunmaverick/GenerativeFaceCompletion/blob/f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2/scripts/cpp_lint.py#L4247-L4338 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/common/tensor.py | python | Tensor.squeeze | (self, axis=None) | return tensor_operator_registry.get('reshape')()(self, new_shape) | Remove the dimension of shape 1 from the Tensor
Args:
axis (Union[None, int, list(int), tuple(int)], optional): Selects a subset of the entries of
length one in the shape. If an axis is selected with shape entry greater than one,
an error is raised. Default is None.
... | Remove the dimension of shape 1 from the Tensor | [
"Remove",
"the",
"dimension",
"of",
"shape",
"1",
"from",
"the",
"Tensor"
] | def squeeze(self, axis=None):
"""
Remove the dimension of shape 1 from the Tensor
Args:
axis (Union[None, int, list(int), tuple(int)], optional): Selects a subset of the entries of
length one in the shape. If an axis is selected with shape entry greater than one,
... | [
"def",
"squeeze",
"(",
"self",
",",
"axis",
"=",
"None",
")",
":",
"self",
".",
"_init_check",
"(",
")",
"if",
"axis",
"is",
"None",
":",
"return",
"tensor_operator_registry",
".",
"get",
"(",
"'squeeze'",
")",
"(",
"self",
")",
"new_shape",
"=",
"vali... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/common/tensor.py#L905-L955 | |
kevinlin311tw/caffe-cvprw15 | 45c2a1bf0368569c54e0be4edf8d34285cf79e70 | python/caffe/pycaffe.py | python | _Net_set_raw_scale | (self, input_, scale) | Set the scale of raw features s.t. the input blob = input * scale.
While Python represents images in [0, 1], certain Caffe models
like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale
of these models must be 255.
Take
input_: which input to assign this scale factor
scale: scal... | Set the scale of raw features s.t. the input blob = input * scale.
While Python represents images in [0, 1], certain Caffe models
like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale
of these models must be 255. | [
"Set",
"the",
"scale",
"of",
"raw",
"features",
"s",
".",
"t",
".",
"the",
"input",
"blob",
"=",
"input",
"*",
"scale",
".",
"While",
"Python",
"represents",
"images",
"in",
"[",
"0",
"1",
"]",
"certain",
"Caffe",
"models",
"like",
"CaffeNet",
"and",
... | def _Net_set_raw_scale(self, input_, scale):
"""
Set the scale of raw features s.t. the input blob = input * scale.
While Python represents images in [0, 1], certain Caffe models
like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale
of these models must be 255.
Take
input_... | [
"def",
"_Net_set_raw_scale",
"(",
"self",
",",
"input_",
",",
"scale",
")",
":",
"if",
"input_",
"not",
"in",
"self",
".",
"inputs",
":",
"raise",
"Exception",
"(",
"'Input not in {}'",
".",
"format",
"(",
"self",
".",
"inputs",
")",
")",
"self",
".",
... | https://github.com/kevinlin311tw/caffe-cvprw15/blob/45c2a1bf0368569c54e0be4edf8d34285cf79e70/python/caffe/pycaffe.py#L245-L258 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/third_party/jinja2/filters.py | python | do_float | (value, default=0.0) | Convert the value into a floating point number. If the
conversion doesn't work it will return ``0.0``. You can
override this default using the first parameter. | Convert the value into a floating point number. If the
conversion doesn't work it will return ``0.0``. You can
override this default using the first parameter. | [
"Convert",
"the",
"value",
"into",
"a",
"floating",
"point",
"number",
".",
"If",
"the",
"conversion",
"doesn",
"t",
"work",
"it",
"will",
"return",
"0",
".",
"0",
".",
"You",
"can",
"override",
"this",
"default",
"using",
"the",
"first",
"parameter",
".... | def do_float(value, default=0.0):
"""Convert the value into a floating point number. If the
conversion doesn't work it will return ``0.0``. You can
override this default using the first parameter.
"""
try:
return float(value)
except (TypeError, ValueError):
return default | [
"def",
"do_float",
"(",
"value",
",",
"default",
"=",
"0.0",
")",
":",
"try",
":",
"return",
"float",
"(",
"value",
")",
"except",
"(",
"TypeError",
",",
"ValueError",
")",
":",
"return",
"default"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/filters.py#L662-L670 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.