nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | MacroDefinition.instantiate | (self) | return self.definition.clone() | Return an instance of the macro. | Return an instance of the macro. | [
"Return",
"an",
"instance",
"of",
"the",
"macro",
"."
] | def instantiate(self):
"Return an instance of the macro."
return self.definition.clone() | [
"def",
"instantiate",
"(",
"self",
")",
":",
"return",
"self",
".",
"definition",
".",
"clone",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L5222-L5224 | |
CaoWGG/TensorRT-YOLOv4 | 4d7c2edce99e8794a4cb4ea3540d51ce91158a36 | onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py | python | Cursor.walk_preorder | (self) | Depth-first preorder walk over the cursor and its descendants.
Yields cursors. | Depth-first preorder walk over the cursor and its descendants. | [
"Depth",
"-",
"first",
"preorder",
"walk",
"over",
"the",
"cursor",
"and",
"its",
"descendants",
"."
] | def walk_preorder(self):
"""Depth-first preorder walk over the cursor and its descendants.
Yields cursors.
"""
yield self
for child in self.get_children():
for descendant in child.walk_preorder():
yield descendant | [
"def",
"walk_preorder",
"(",
"self",
")",
":",
"yield",
"self",
"for",
"child",
"in",
"self",
".",
"get_children",
"(",
")",
":",
"for",
"descendant",
"in",
"child",
".",
"walk_preorder",
"(",
")",
":",
"yield",
"descendant"
] | https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L1661-L1669 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/boost_1_66_0/tools/build/src/build/generators.py | python | viable_source_types_for_generator | (generator) | return __viable_source_types_cache[generator] | Caches the result of 'viable_source_types_for_generator'. | Caches the result of 'viable_source_types_for_generator'. | [
"Caches",
"the",
"result",
"of",
"viable_source_types_for_generator",
"."
] | def viable_source_types_for_generator (generator):
""" Caches the result of 'viable_source_types_for_generator'.
"""
assert isinstance(generator, Generator)
if generator not in __viable_source_types_cache:
__vstg_cached_generators.append(generator)
__viable_source_types_cache[generator] ... | [
"def",
"viable_source_types_for_generator",
"(",
"generator",
")",
":",
"assert",
"isinstance",
"(",
"generator",
",",
"Generator",
")",
"if",
"generator",
"not",
"in",
"__viable_source_types_cache",
":",
"__vstg_cached_generators",
".",
"append",
"(",
"generator",
")... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/tools/build/src/build/generators.py#L859-L867 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/lite/python/util.py | python | convert_dtype_to_tflite_type | (tf_dtype) | return result | Converts tf.dtype to TFLite proto type.
Args:
tf_dtype: tf.dtype
Raises:
ValueError: Unsupported tf.dtype.
Returns:
types_flag_pb2. | Converts tf.dtype to TFLite proto type. | [
"Converts",
"tf",
".",
"dtype",
"to",
"TFLite",
"proto",
"type",
"."
] | def convert_dtype_to_tflite_type(tf_dtype):
"""Converts tf.dtype to TFLite proto type.
Args:
tf_dtype: tf.dtype
Raises:
ValueError: Unsupported tf.dtype.
Returns:
types_flag_pb2.
"""
result = _MAP_TF_TO_TFLITE_TYPES.get(tf_dtype)
if result is None:
raise ValueError("Unsupported tf.dtype... | [
"def",
"convert_dtype_to_tflite_type",
"(",
"tf_dtype",
")",
":",
"result",
"=",
"_MAP_TF_TO_TFLITE_TYPES",
".",
"get",
"(",
"tf_dtype",
")",
"if",
"result",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Unsupported tf.dtype {0}\"",
".",
"format",
"(",
"tf_dty... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/lite/python/util.py#L50-L65 | |
nucleic/atom | 9f0cb2a8101dd63c354a98ebc7489b2c616dc82a | atom/instance.py | python | Instance.__init__ | (self, kind, args=None, kwargs=None, *, factory=None, optional=None) | Initialize an Instance.
Parameters
----------
kind : type or tuple of types
The allowed type or types for the instance.
args : tuple, optional
If 'factory' is None, then 'kind' is a callable type and
these arguments will be passed to the constructor ... | Initialize an Instance. | [
"Initialize",
"an",
"Instance",
"."
] | def __init__(self, kind, args=None, kwargs=None, *, factory=None, optional=None):
"""Initialize an Instance.
Parameters
----------
kind : type or tuple of types
The allowed type or types for the instance.
args : tuple, optional
If 'factory' is None, then... | [
"def",
"__init__",
"(",
"self",
",",
"kind",
",",
"args",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
"*",
",",
"factory",
"=",
"None",
",",
"optional",
"=",
"None",
")",
":",
"opt",
",",
"kind",
"=",
"is_optional",
"(",
"extract_types",
"(",
"ki... | https://github.com/nucleic/atom/blob/9f0cb2a8101dd63c354a98ebc7489b2c616dc82a/atom/instance.py#L27-L85 | ||
trailofbits/sienna-locomotive | 09bc1a0bea7d7a33089422c62e0d3c715ecb7ce0 | sl2/harness/winshlex.py | python | split | (args: str) | return [argvw[i] for i in range(0, argc.value)] | Converts a string of command-line arguments into a list
via CommandLineToArgvW. | Converts a string of command-line arguments into a list
via CommandLineToArgvW. | [
"Converts",
"a",
"string",
"of",
"command",
"-",
"line",
"arguments",
"into",
"a",
"list",
"via",
"CommandLineToArgvW",
"."
] | def split(args: str):
"""
Converts a string of command-line arguments into a list
via CommandLineToArgvW.
"""
argc = ctypes.c_int(0)
# NOTE(ww): This leaks memory, as we don't call LocalFree.
argvw = _CommandLineToArgvW(args, ctypes.byref(argc))
return [argvw[i] for i in range(0, argc.va... | [
"def",
"split",
"(",
"args",
":",
"str",
")",
":",
"argc",
"=",
"ctypes",
".",
"c_int",
"(",
"0",
")",
"# NOTE(ww): This leaks memory, as we don't call LocalFree.",
"argvw",
"=",
"_CommandLineToArgvW",
"(",
"args",
",",
"ctypes",
".",
"byref",
"(",
"argc",
")"... | https://github.com/trailofbits/sienna-locomotive/blob/09bc1a0bea7d7a33089422c62e0d3c715ecb7ce0/sl2/harness/winshlex.py#L13-L21 | |
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | ext/scintilla/scripts/FileGenerator.py | python | UpdateFileFromLines | (path, lines, lineEndToUse) | Join the lines with the lineEndToUse then update file if the result is different. | Join the lines with the lineEndToUse then update file if the result is different. | [
"Join",
"the",
"lines",
"with",
"the",
"lineEndToUse",
"then",
"update",
"file",
"if",
"the",
"result",
"is",
"different",
"."
] | def UpdateFileFromLines(path, lines, lineEndToUse):
"""Join the lines with the lineEndToUse then update file if the result is different.
"""
contents = lineEndToUse.join(lines) + lineEndToUse
UpdateFile(path, contents) | [
"def",
"UpdateFileFromLines",
"(",
"path",
",",
"lines",
",",
"lineEndToUse",
")",
":",
"contents",
"=",
"lineEndToUse",
".",
"join",
"(",
"lines",
")",
"+",
"lineEndToUse",
"UpdateFile",
"(",
"path",
",",
"contents",
")"
] | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/ext/scintilla/scripts/FileGenerator.py#L179-L183 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/metrics/histograms/extract_histograms.py | python | _ExtractHistogramsFromXmlTree | (tree, enums) | return histograms, have_errors | Extract all <histogram> nodes in the tree into a dictionary. | Extract all <histogram> nodes in the tree into a dictionary. | [
"Extract",
"all",
"<histogram",
">",
"nodes",
"in",
"the",
"tree",
"into",
"a",
"dictionary",
"."
] | def _ExtractHistogramsFromXmlTree(tree, enums):
"""Extract all <histogram> nodes in the tree into a dictionary."""
# Process the histograms. The descriptions can include HTML tags.
histograms = {}
have_errors = False
last_name = None
for histogram in tree.getElementsByTagName('histogram'):
name = histo... | [
"def",
"_ExtractHistogramsFromXmlTree",
"(",
"tree",
",",
"enums",
")",
":",
"# Process the histograms. The descriptions can include HTML tags.",
"histograms",
"=",
"{",
"}",
"have_errors",
"=",
"False",
"last_name",
"=",
"None",
"for",
"histogram",
"in",
"tree",
".",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/metrics/histograms/extract_histograms.py#L233-L291 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/operator/_discrete_operator.py | python | DiscreteOperator.to_sparse | (self) | return _csr_matrix(
(mels, numbers, sections1),
shape=(self.hilbert.n_states, self.hilbert.n_states),
) | r"""Returns the sparse matrix representation of the operator. Note that,
in general, the size of the matrix is exponential in the number of quantum
numbers, and this operation should thus only be performed for
low-dimensional Hilbert spaces or sufficiently sparse operators.
This method ... | r"""Returns the sparse matrix representation of the operator. Note that,
in general, the size of the matrix is exponential in the number of quantum
numbers, and this operation should thus only be performed for
low-dimensional Hilbert spaces or sufficiently sparse operators. | [
"r",
"Returns",
"the",
"sparse",
"matrix",
"representation",
"of",
"the",
"operator",
".",
"Note",
"that",
"in",
"general",
"the",
"size",
"of",
"the",
"matrix",
"is",
"exponential",
"in",
"the",
"number",
"of",
"quantum",
"numbers",
"and",
"this",
"operatio... | def to_sparse(self) -> _csr_matrix:
r"""Returns the sparse matrix representation of the operator. Note that,
in general, the size of the matrix is exponential in the number of quantum
numbers, and this operation should thus only be performed for
low-dimensional Hilbert spaces or sufficie... | [
"def",
"to_sparse",
"(",
"self",
")",
"->",
"_csr_matrix",
":",
"concrete_op",
"=",
"self",
".",
"collect",
"(",
")",
"hilb",
"=",
"self",
".",
"hilbert",
"x",
"=",
"hilb",
".",
"all_states",
"(",
")",
"sections",
"=",
"np",
".",
"empty",
"(",
"x",
... | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/operator/_discrete_operator.py#L144-L175 | |
google/flatbuffers | b3006913369e0a7550795e477011ac5bebb93497 | python/flatbuffers/flexbuffers.py | python | Builder.Bool | (self, value) | Encodes boolean value.
Args:
value: A boolean value. | Encodes boolean value. | [
"Encodes",
"boolean",
"value",
"."
] | def Bool(self, value):
"""Encodes boolean value.
Args:
value: A boolean value.
"""
self._stack.append(Value.Bool(value)) | [
"def",
"Bool",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"_stack",
".",
"append",
"(",
"Value",
".",
"Bool",
"(",
"value",
")",
")"
] | https://github.com/google/flatbuffers/blob/b3006913369e0a7550795e477011ac5bebb93497/python/flatbuffers/flexbuffers.py#L1222-L1228 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/image_ops.py | python | crop_to_bounding_box | (image, offset_height, offset_width, target_height,
target_width) | return cropped | Crops an image to a specified bounding box.
This op cuts a rectangular part out of `image`. The top-left corner of the
returned image is at `offset_height, offset_width` in `image`, and its
lower-right corner is at
`offset_height + target_height, offset_width + target_width`.
Args:
image: 3-D tensor wit... | Crops an image to a specified bounding box. | [
"Crops",
"an",
"image",
"to",
"a",
"specified",
"bounding",
"box",
"."
] | def crop_to_bounding_box(image, offset_height, offset_width, target_height,
target_width):
"""Crops an image to a specified bounding box.
This op cuts a rectangular part out of `image`. The top-left corner of the
returned image is at `offset_height, offset_width` in `image`, and its
lo... | [
"def",
"crop_to_bounding_box",
"(",
"image",
",",
"offset_height",
",",
"offset_width",
",",
"target_height",
",",
"target_width",
")",
":",
"image",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"image",
",",
"name",
"=",
"'image'",
")",
"assert_ops",
"=",
"[",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/image_ops.py#L568-L624 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/callbacks.py | python | CallbackList.on_predict_batch_end | (self, batch, logs=None) | Calls the `on_predict_batch_end` methods of its callbacks.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Metric results for this batch. | Calls the `on_predict_batch_end` methods of its callbacks. | [
"Calls",
"the",
"on_predict_batch_end",
"methods",
"of",
"its",
"callbacks",
"."
] | def on_predict_batch_end(self, batch, logs=None):
"""Calls the `on_predict_batch_end` methods of its callbacks.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Metric results for this batch.
"""
self._call_batch_hook(ModeKeys.PREDICT, 'end', batch, logs=l... | [
"def",
"on_predict_batch_end",
"(",
"self",
",",
"batch",
",",
"logs",
"=",
"None",
")",
":",
"self",
".",
"_call_batch_hook",
"(",
"ModeKeys",
".",
"PREDICT",
",",
"'end'",
",",
"batch",
",",
"logs",
"=",
"logs",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/callbacks.py#L349-L356 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/_decision_tree.py | python | Node.to_dict | (self) | return out | Return the node as a dictionary.
Returns
-------
dict: All the attributes of this node as a dictionary (minus the left
and right). | Return the node as a dictionary. | [
"Return",
"the",
"node",
"as",
"a",
"dictionary",
"."
] | def to_dict(self):
"""
Return the node as a dictionary.
Returns
-------
dict: All the attributes of this node as a dictionary (minus the left
and right).
"""
out = {}
for key in self.__dict__.keys():
if key not in ["left", "right... | [
"def",
"to_dict",
"(",
"self",
")",
":",
"out",
"=",
"{",
"}",
"for",
"key",
"in",
"self",
".",
"__dict__",
".",
"keys",
"(",
")",
":",
"if",
"key",
"not",
"in",
"[",
"\"left\"",
",",
"\"right\"",
",",
"\"missing\"",
",",
"\"parent\"",
"]",
":",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/_decision_tree.py#L134-L147 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | clang/docs/tools/dump_ast_matchers.py | python | extract_result_types | (comment) | Extracts a list of result types from the given comment.
We allow annotations in the comment of the matcher to specify what
nodes a matcher can match on. Those comments have the form:
Usable as: Any Matcher | (Matcher<T1>[, Matcher<t2>[, ...]])
Returns ['*'] in case of 'Any Matcher', or ['T1', 'T... | Extracts a list of result types from the given comment. | [
"Extracts",
"a",
"list",
"of",
"result",
"types",
"from",
"the",
"given",
"comment",
"."
] | def extract_result_types(comment):
"""Extracts a list of result types from the given comment.
We allow annotations in the comment of the matcher to specify what
nodes a matcher can match on. Those comments have the form:
Usable as: Any Matcher | (Matcher<T1>[, Matcher<t2>[, ...]])
Returns ['*'... | [
"def",
"extract_result_types",
"(",
"comment",
")",
":",
"result_types",
"=",
"[",
"]",
"m",
"=",
"re",
".",
"search",
"(",
"r'Usable as: Any Matcher[\\s\\n]*$'",
",",
"comment",
",",
"re",
".",
"S",
")",
"if",
"m",
":",
"return",
"[",
"'*'",
"]",
"while... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/docs/tools/dump_ast_matchers.py#L60-L83 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/synxml.py | python | SyntaxSpecList.startElement | (self, name, attrs) | Parse all syntaxspec elements in the list | Parse all syntaxspec elements in the list | [
"Parse",
"all",
"syntaxspec",
"elements",
"in",
"the",
"list"
] | def startElement(self, name, attrs):
"""Parse all syntaxspec elements in the list"""
if name == EXML_SYNTAXSPEC:
lid = attrs.get(EXML_VALUE, '')
assert len(lid), "Style Id not specified"
if lid.isdigit():
style_id = int(lid)
else:
... | [
"def",
"startElement",
"(",
"self",
",",
"name",
",",
"attrs",
")",
":",
"if",
"name",
"==",
"EXML_SYNTAXSPEC",
":",
"lid",
"=",
"attrs",
".",
"get",
"(",
"EXML_VALUE",
",",
"''",
")",
"assert",
"len",
"(",
"lid",
")",
",",
"\"Style Id not specified\"",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/synxml.py#L681-L698 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/nntplib.py | python | NNTP.help | (self, file=None) | return self.longcmd('HELP',file) | Process a HELP command. Returns:
- resp: server response if successful
- list: list of strings | Process a HELP command. Returns:
- resp: server response if successful
- list: list of strings | [
"Process",
"a",
"HELP",
"command",
".",
"Returns",
":",
"-",
"resp",
":",
"server",
"response",
"if",
"successful",
"-",
"list",
":",
"list",
"of",
"strings"
] | def help(self, file=None):
"""Process a HELP command. Returns:
- resp: server response if successful
- list: list of strings"""
return self.longcmd('HELP',file) | [
"def",
"help",
"(",
"self",
",",
"file",
"=",
"None",
")",
":",
"return",
"self",
".",
"longcmd",
"(",
"'HELP'",
",",
"file",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/nntplib.py#L361-L366 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/column/string.py | python | StringMethods.rfind | (
self, sub: str, start: int = 0, end: int = None
) | return self._return_or_inplace(result_col) | Return highest indexes in each strings in the Series/Index
where the substring is fully contained between ``[start:end]``.
Return -1 on failure. Equivalent to standard `str.rfind()
<https://docs.python.org/3/library/stdtypes.html#str.rfind>`_.
Parameters
----------
sub :... | Return highest indexes in each strings in the Series/Index
where the substring is fully contained between ``[start:end]``.
Return -1 on failure. Equivalent to standard `str.rfind()
<https://docs.python.org/3/library/stdtypes.html#str.rfind>`_. | [
"Return",
"highest",
"indexes",
"in",
"each",
"strings",
"in",
"the",
"Series",
"/",
"Index",
"where",
"the",
"substring",
"is",
"fully",
"contained",
"between",
"[",
"start",
":",
"end",
"]",
".",
"Return",
"-",
"1",
"on",
"failure",
".",
"Equivalent",
... | def rfind(
self, sub: str, start: int = 0, end: int = None
) -> SeriesOrIndex:
"""
Return highest indexes in each strings in the Series/Index
where the substring is fully contained between ``[start:end]``.
Return -1 on failure. Equivalent to standard `str.rfind()
<htt... | [
"def",
"rfind",
"(",
"self",
",",
"sub",
":",
"str",
",",
"start",
":",
"int",
"=",
"0",
",",
"end",
":",
"int",
"=",
"None",
")",
"->",
"SeriesOrIndex",
":",
"if",
"not",
"isinstance",
"(",
"sub",
",",
"str",
")",
":",
"raise",
"TypeError",
"(",... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/column/string.py#L3744-L3803 | |
ycm-core/ycmd | fc0fb7e5e15176cc5a2a30c80956335988c6b59a | ycmd/completers/cs/cs_completer.py | python | CsharpSolutionCompleter._GetCompletions | ( self, request_data ) | return completions if completions is not None else [] | Ask server for completions | Ask server for completions | [
"Ask",
"server",
"for",
"completions"
] | def _GetCompletions( self, request_data ):
""" Ask server for completions """
parameters = self._DefaultParameters( request_data )
parameters[ 'WantSnippet' ] = False
parameters[ 'WantKind' ] = True
parameters[ 'WantReturnType' ] = False
parameters[ 'WantDocumentationForEveryCompletionResult' ] ... | [
"def",
"_GetCompletions",
"(",
"self",
",",
"request_data",
")",
":",
"parameters",
"=",
"self",
".",
"_DefaultParameters",
"(",
"request_data",
")",
"parameters",
"[",
"'WantSnippet'",
"]",
"=",
"False",
"parameters",
"[",
"'WantKind'",
"]",
"=",
"True",
"par... | https://github.com/ycm-core/ycmd/blob/fc0fb7e5e15176cc5a2a30c80956335988c6b59a/ycmd/completers/cs/cs_completer.py#L534-L542 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/matlib.py | python | randn | (*args) | return asmatrix(np.random.randn(*args)) | Return a random matrix with data from the "standard normal" distribution.
`randn` generates a matrix filled with random floats sampled from a
univariate "normal" (Gaussian) distribution of mean 0 and variance 1.
Parameters
----------
\\*args : Arguments
Shape of the output.
If give... | Return a random matrix with data from the "standard normal" distribution. | [
"Return",
"a",
"random",
"matrix",
"with",
"data",
"from",
"the",
"standard",
"normal",
"distribution",
"."
] | def randn(*args):
"""
Return a random matrix with data from the "standard normal" distribution.
`randn` generates a matrix filled with random floats sampled from a
univariate "normal" (Gaussian) distribution of mean 0 and variance 1.
Parameters
----------
\\*args : Arguments
Shape ... | [
"def",
"randn",
"(",
"*",
"args",
")",
":",
"if",
"isinstance",
"(",
"args",
"[",
"0",
"]",
",",
"tuple",
")",
":",
"args",
"=",
"args",
"[",
"0",
"]",
"return",
"asmatrix",
"(",
"np",
".",
"random",
".",
"randn",
"(",
"*",
"args",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/matlib.py#L265-L313 | |
nsnam/ns-3-dev-git | efdb2e21f45c0a87a60b47c547b68fa140a7b686 | src/visualizer/visualizer/core.py | python | Node.set_label | (self, label) | !
Set a label for the node.
@param self: class object.
@param label: label to set
@return: an exception if invalid parameter. | !
Set a label for the node. | [
"!",
"Set",
"a",
"label",
"for",
"the",
"node",
"."
] | def set_label(self, label):
"""!
Set a label for the node.
@param self: class object.
@param label: label to set
@return: an exception if invalid parameter.
"""
assert isinstance(label, basestring)
self._label = label
self._update_appearance() | [
"def",
"set_label",
"(",
"self",
",",
"label",
")",
":",
"assert",
"isinstance",
"(",
"label",
",",
"basestring",
")",
"self",
".",
"_label",
"=",
"label",
"self",
".",
"_update_appearance",
"(",
")"
] | https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/src/visualizer/visualizer/core.py#L196-L207 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | cmake/std/trilinosprhelpers/sysinfo/SysInfo.py | python | SysInfo.meminfo | (self) | return self._meminfo | Returns a dict containing information about the memory available on the system.
On first run we generate the value and cache it for later use.
Returns:
dict: { 'mem_kb': <system memory in kb>, 'mem_gb': <system memory in gb> } | Returns a dict containing information about the memory available on the system. | [
"Returns",
"a",
"dict",
"containing",
"information",
"about",
"the",
"memory",
"available",
"on",
"the",
"system",
"."
] | def meminfo(self):
"""
Returns a dict containing information about the memory available on the system.
On first run we generate the value and cache it for later use.
Returns:
dict: { 'mem_kb': <system memory in kb>, 'mem_gb': <system memory in gb> }
"""
if s... | [
"def",
"meminfo",
"(",
"self",
")",
":",
"if",
"self",
".",
"_meminfo",
"is",
"None",
":",
"self",
".",
"_get_meminfo",
"(",
")",
"return",
"self",
".",
"_meminfo"
] | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/cmake/std/trilinosprhelpers/sysinfo/SysInfo.py#L105-L116 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchStructure.py | python | placeAlongEdge | (p1,p2,horizontal=False) | return pl | placeAlongEdge(p1,p2,[horizontal]): returns a Placement positioned at p1, with Z axis oriented towards p2.
If horizontal is True, then the X axis is oriented towards p2, not the Z axis | placeAlongEdge(p1,p2,[horizontal]): returns a Placement positioned at p1, with Z axis oriented towards p2.
If horizontal is True, then the X axis is oriented towards p2, not the Z axis | [
"placeAlongEdge",
"(",
"p1",
"p2",
"[",
"horizontal",
"]",
")",
":",
"returns",
"a",
"Placement",
"positioned",
"at",
"p1",
"with",
"Z",
"axis",
"oriented",
"towards",
"p2",
".",
"If",
"horizontal",
"is",
"True",
"then",
"the",
"X",
"axis",
"is",
"orient... | def placeAlongEdge(p1,p2,horizontal=False):
"""placeAlongEdge(p1,p2,[horizontal]): returns a Placement positioned at p1, with Z axis oriented towards p2.
If horizontal is True, then the X axis is oriented towards p2, not the Z axis"""
pl = FreeCAD.Placement()
pl.Base = p1
up = FreeCAD.Vector(0,0,1... | [
"def",
"placeAlongEdge",
"(",
"p1",
",",
"p2",
",",
"horizontal",
"=",
"False",
")",
":",
"pl",
"=",
"FreeCAD",
".",
"Placement",
"(",
")",
"pl",
".",
"Base",
"=",
"p1",
"up",
"=",
"FreeCAD",
".",
"Vector",
"(",
"0",
",",
"0",
",",
"1",
")",
"i... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchStructure.py#L166-L185 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/idl/idl/errors.py | python | ParserContext.add_chained_struct_not_found_error | (self, location, struct_name) | Add an error about a chained_struct not found. | Add an error about a chained_struct not found. | [
"Add",
"an",
"error",
"about",
"a",
"chained_struct",
"not",
"found",
"."
] | def add_chained_struct_not_found_error(self, location, struct_name):
# type: (common.SourceLocation, unicode) -> None
# pylint: disable=invalid-name
"""Add an error about a chained_struct not found."""
self._add_error(location, ERROR_ID_CHAINED_STRUCT_NOT_FOUND,
(... | [
"def",
"add_chained_struct_not_found_error",
"(",
"self",
",",
"location",
",",
"struct_name",
")",
":",
"# type: (common.SourceLocation, unicode) -> None",
"# pylint: disable=invalid-name",
"self",
".",
"_add_error",
"(",
"location",
",",
"ERROR_ID_CHAINED_STRUCT_NOT_FOUND",
"... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/errors.py#L486-L491 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_presenter.py | python | BasicFittingPresenter.handle_started | (self) | Handle when fitting has started. | Handle when fitting has started. | [
"Handle",
"when",
"fitting",
"has",
"started",
"."
] | def handle_started(self) -> None:
"""Handle when fitting has started."""
self.disable_editing_notifier.notify_subscribers()
self.thread_success = True | [
"def",
"handle_started",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"disable_editing_notifier",
".",
"notify_subscribers",
"(",
")",
"self",
".",
"thread_success",
"=",
"True"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_presenter.py#L166-L169 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/mindrecord/tools/mnist_to_mr.py | python | MnistToMR._transform_train | (self) | return ret | Execute transformation from Mnist train part to MindRecord.
Returns:
MSRStatus, whether successfully written into MindRecord. | Execute transformation from Mnist train part to MindRecord. | [
"Execute",
"transformation",
"from",
"Mnist",
"train",
"part",
"to",
"MindRecord",
"."
] | def _transform_train(self):
"""
Execute transformation from Mnist train part to MindRecord.
Returns:
MSRStatus, whether successfully written into MindRecord.
"""
t0_total = time.time()
logger.info("transformed MindRecord schema is: {}".format(self.mnist_sche... | [
"def",
"_transform_train",
"(",
"self",
")",
":",
"t0_total",
"=",
"time",
".",
"time",
"(",
")",
"logger",
".",
"info",
"(",
"\"transformed MindRecord schema is: {}\"",
".",
"format",
"(",
"self",
".",
"mnist_schema_json",
")",
")",
"# set the header size",
"se... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/mindrecord/tools/mnist_to_mr.py#L126-L172 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/framemanager.py | python | AuiPaneInfo.HasGripperTop | (self) | return self.HasFlag(self.optionGripperTop) | Returns ``True`` if the pane displays a gripper at the top. | Returns ``True`` if the pane displays a gripper at the top. | [
"Returns",
"True",
"if",
"the",
"pane",
"displays",
"a",
"gripper",
"at",
"the",
"top",
"."
] | def HasGripperTop(self):
""" Returns ``True`` if the pane displays a gripper at the top. """
return self.HasFlag(self.optionGripperTop) | [
"def",
"HasGripperTop",
"(",
"self",
")",
":",
"return",
"self",
".",
"HasFlag",
"(",
"self",
".",
"optionGripperTop",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L854-L857 | |
limbo018/DREAMPlace | 146c3b9fd003d1acd52c96d9fd02e3f0a05154e4 | dreamplace/BasicPlace.py | python | PlaceDataCollection.bin_center_y_padded | (self, placedb, padding, num_bins_y) | return bin_center_y | @brief compute array of bin center vertical coordinates with padding
@param placedb placement database
@param padding number of bins padding to boundary of placement region | [] | def bin_center_y_padded(self, placedb, padding, num_bins_y):
"""
@brief compute array of bin center vertical coordinates with padding
@param placedb placement database
@param padding number of bins padding to boundary of placement region
"""
bin_size_y = (placedb.yh - pla... | [
"def",
"bin_center_y_padded",
"(",
"self",
",",
"placedb",
",",
"padding",
",",
"num_bins_y",
")",
":",
"bin_size_y",
"=",
"(",
"placedb",
".",
"yh",
"-",
"placedb",
".",
"yl",
")",
"/",
"num_bins_y",
"yl",
"=",
"placedb",
".",
"yl",
"-",
"padding",
"*... | https://github.com/limbo018/DREAMPlace/blob/146c3b9fd003d1acd52c96d9fd02e3f0a05154e4/dreamplace/BasicPlace.py#L214-L225 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/layers/python/layers/feature_column.py | python | bucketized_column | (source_column, boundaries) | return _BucketizedColumn(source_column, boundaries) | Creates a _BucketizedColumn.
Args:
source_column: A _RealValuedColumn defining dense column.
boundaries: A list of floats specifying the boundaries. It has to be sorted.
Returns:
A _BucketizedColumn.
Raises:
ValueError: if 'boundaries' is empty or not sorted. | Creates a _BucketizedColumn. | [
"Creates",
"a",
"_BucketizedColumn",
"."
] | def bucketized_column(source_column, boundaries):
"""Creates a _BucketizedColumn.
Args:
source_column: A _RealValuedColumn defining dense column.
boundaries: A list of floats specifying the boundaries. It has to be sorted.
Returns:
A _BucketizedColumn.
Raises:
ValueError: if 'boundaries' is e... | [
"def",
"bucketized_column",
"(",
"source_column",
",",
"boundaries",
")",
":",
"return",
"_BucketizedColumn",
"(",
"source_column",
",",
"boundaries",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/layers/python/layers/feature_column.py#L1460-L1473 | |
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/pypack/modulegraph/pkg_resources.py | python | IResourceProvider.get_resource_stream | (manager, resource_name) | Return a readable file-like object for `resource_name`
`manager` must be an ``IResourceManager`` | Return a readable file-like object for `resource_name` | [
"Return",
"a",
"readable",
"file",
"-",
"like",
"object",
"for",
"resource_name"
] | def get_resource_stream(manager, resource_name):
"""Return a readable file-like object for `resource_name`
`manager` must be an ``IResourceManager``""" | [
"def",
"get_resource_stream",
"(",
"manager",
",",
"resource_name",
")",
":"
] | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/modulegraph/pkg_resources.py#L279-L282 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap.py | python | _ImportLockContext.__exit__ | (self, exc_type, exc_value, exc_traceback) | Release the import lock regardless of any raised exceptions. | Release the import lock regardless of any raised exceptions. | [
"Release",
"the",
"import",
"lock",
"regardless",
"of",
"any",
"raised",
"exceptions",
"."
] | def __exit__(self, exc_type, exc_value, exc_traceback):
"""Release the import lock regardless of any raised exceptions."""
_imp.release_lock() | [
"def",
"__exit__",
"(",
"self",
",",
"exc_type",
",",
"exc_value",
",",
"exc_traceback",
")",
":",
"_imp",
".",
"release_lock",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap.py#L859-L861 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/cpplint.py | python | CheckSectionSpacing | (filename, clean_lines, class_info, linenum, error) | Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
class_info: A _ClassInfo objects.
linenum: The number ... | Checks for additional blank line issues related to sections. | [
"Checks",
"for",
"additional",
"blank",
"line",
"issues",
"related",
"to",
"sections",
"."
] | def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):
"""Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance co... | [
"def",
"CheckSectionSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"class_info",
",",
"linenum",
",",
"error",
")",
":",
"# Skip checks if the class is small, where small means 25 lines or less.",
"# 25 lines seems like a good cutoff since that's the usual height of",
"# termina... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/cpplint.py#L4182-L4234 | ||
sailing-pmls/bosen | 06cb58902d011fbea5f9428f10ce30e621492204 | style_script/cpplint.py | python | IsOutOfLineMethodDefinition | (clean_lines, linenum) | return False | Check if current line contains an out-of-line method definition.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains an out-of-line method definition. | Check if current line contains an out-of-line method definition. | [
"Check",
"if",
"current",
"line",
"contains",
"an",
"out",
"-",
"of",
"-",
"line",
"method",
"definition",
"."
] | def IsOutOfLineMethodDefinition(clean_lines, linenum):
"""Check if current line contains an out-of-line method definition.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains an out-of-line method definition... | [
"def",
"IsOutOfLineMethodDefinition",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"# Scan back a few lines for start of current function",
"for",
"i",
"in",
"xrange",
"(",
"linenum",
",",
"max",
"(",
"-",
"1",
",",
"linenum",
"-",
"10",
")",
",",
"-",
"1",
"... | https://github.com/sailing-pmls/bosen/blob/06cb58902d011fbea5f9428f10ce30e621492204/style_script/cpplint.py#L5022-L5035 | |
alexgkendall/caffe-segnet | 344c113bf1832886f1cbe9f33ffe28a3beeaf412 | tools/extra/parse_log.py | python | parse_line_for_net_output | (regex_obj, row, row_dict_list,
line, iteration, seconds, learning_rate) | return row_dict_list, row | Parse a single line for training or test output
Returns a a tuple with (row_dict_list, row)
row: may be either a new row or an augmented version of the current row
row_dict_list: may be either the current row_dict_list or an augmented
version of the current row_dict_list | Parse a single line for training or test output | [
"Parse",
"a",
"single",
"line",
"for",
"training",
"or",
"test",
"output"
] | def parse_line_for_net_output(regex_obj, row, row_dict_list,
line, iteration, seconds, learning_rate):
"""Parse a single line for training or test output
Returns a a tuple with (row_dict_list, row)
row: may be either a new row or an augmented version of the current row
row... | [
"def",
"parse_line_for_net_output",
"(",
"regex_obj",
",",
"row",
",",
"row_dict_list",
",",
"line",
",",
"iteration",
",",
"seconds",
",",
"learning_rate",
")",
":",
"output_match",
"=",
"regex_obj",
".",
"search",
"(",
"line",
")",
"if",
"output_match",
":",... | https://github.com/alexgkendall/caffe-segnet/blob/344c113bf1832886f1cbe9f33ffe28a3beeaf412/tools/extra/parse_log.py#L77-L116 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Text.image_names | (self) | return self.tk.call(self._w, "image", "names") | Return all names of embedded images in this widget. | Return all names of embedded images in this widget. | [
"Return",
"all",
"names",
"of",
"embedded",
"images",
"in",
"this",
"widget",
"."
] | def image_names(self):
"""Return all names of embedded images in this widget."""
return self.tk.call(self._w, "image", "names") | [
"def",
"image_names",
"(",
"self",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"image\"",
",",
"\"names\"",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L3039-L3041 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/xmlrpc/server.py | python | SimpleXMLRPCDispatcher.system_methodHelp | (self, method_name) | system.methodHelp('add') => "Adds two integers together"
Returns a string containing documentation for the specified method. | system.methodHelp('add') => "Adds two integers together" | [
"system",
".",
"methodHelp",
"(",
"add",
")",
"=",
">",
"Adds",
"two",
"integers",
"together"
] | def system_methodHelp(self, method_name):
"""system.methodHelp('add') => "Adds two integers together"
Returns a string containing documentation for the specified method."""
method = None
if method_name in self.funcs:
method = self.funcs[method_name]
elif self.instan... | [
"def",
"system_methodHelp",
"(",
"self",
",",
"method_name",
")",
":",
"method",
"=",
"None",
"if",
"method_name",
"in",
"self",
".",
"funcs",
":",
"method",
"=",
"self",
".",
"funcs",
"[",
"method_name",
"]",
"elif",
"self",
".",
"instance",
"is",
"not"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xmlrpc/server.py#L316-L345 | ||
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/flock_tool.py | python | FlockTool._CommandifyName | (self, name_string) | return name_string.title().replace('-', '') | Transforms a tool name like copy-info-plist to CopyInfoPlist | Transforms a tool name like copy-info-plist to CopyInfoPlist | [
"Transforms",
"a",
"tool",
"name",
"like",
"copy",
"-",
"info",
"-",
"plist",
"to",
"CopyInfoPlist"
] | def _CommandifyName(self, name_string):
"""Transforms a tool name like copy-info-plist to CopyInfoPlist"""
return name_string.title().replace('-', '') | [
"def",
"_CommandifyName",
"(",
"self",
",",
"name_string",
")",
":",
"return",
"name_string",
".",
"title",
"(",
")",
".",
"replace",
"(",
"'-'",
",",
"''",
")"
] | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/flock_tool.py#L31-L33 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.AppendTextRaw | (*args, **kwargs) | return _stc.StyledTextCtrl_AppendTextRaw(*args, **kwargs) | AppendTextRaw(self, char text, int length=-1)
Append a string to the end of the document without changing the
selection. The text should be utf-8 encoded on unicode builds of
wxPython, or can be any 8-bit text in ansi builds. | AppendTextRaw(self, char text, int length=-1) | [
"AppendTextRaw",
"(",
"self",
"char",
"text",
"int",
"length",
"=",
"-",
"1",
")"
] | def AppendTextRaw(*args, **kwargs):
"""
AppendTextRaw(self, char text, int length=-1)
Append a string to the end of the document without changing the
selection. The text should be utf-8 encoded on unicode builds of
wxPython, or can be any 8-bit text in ansi builds.
"""
... | [
"def",
"AppendTextRaw",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_AppendTextRaw",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L6768-L6776 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | mlir/lib/Bindings/Python/mlir/dialects/__init__.py | python | equally_sized_accessor | (elements, n_variadic, n_preceding_simple,
n_preceding_variadic) | return start, elements_per_group | Returns a starting position and a number of elements per variadic group
assuming equally-sized groups and the given numbers of preceding groups.
elements: a sequential container.
n_variadic: the number of variadic groups in the container.
n_preceding_simple: the number of non-variadic groups preceding th... | Returns a starting position and a number of elements per variadic group
assuming equally-sized groups and the given numbers of preceding groups. | [
"Returns",
"a",
"starting",
"position",
"and",
"a",
"number",
"of",
"elements",
"per",
"variadic",
"group",
"assuming",
"equally",
"-",
"sized",
"groups",
"and",
"the",
"given",
"numbers",
"of",
"preceding",
"groups",
"."
] | def equally_sized_accessor(elements, n_variadic, n_preceding_simple,
n_preceding_variadic):
"""
Returns a starting position and a number of elements per variadic group
assuming equally-sized groups and the given numbers of preceding groups.
elements: a sequential container.
n_v... | [
"def",
"equally_sized_accessor",
"(",
"elements",
",",
"n_variadic",
",",
"n_preceding_simple",
",",
"n_preceding_variadic",
")",
":",
"total_variadic_length",
"=",
"len",
"(",
"elements",
")",
"-",
"n_variadic",
"+",
"1",
"# This should be enforced by the C++-side trait ... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/mlir/lib/Bindings/Python/mlir/dialects/__init__.py#L84-L104 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/futures/__init__.py | python | Future.set_exception | (self, result: T) | r"""
Set an exception for this ``Future``, which will mark this ``Future`` as
completed with an error and trigger all attached callbacks. Note that
when calling wait()/value() on this ``Future``, the exception set here
will be raised inline.
Args:
result (BaseExcepti... | r"""
Set an exception for this ``Future``, which will mark this ``Future`` as
completed with an error and trigger all attached callbacks. Note that
when calling wait()/value() on this ``Future``, the exception set here
will be raised inline. | [
"r",
"Set",
"an",
"exception",
"for",
"this",
"Future",
"which",
"will",
"mark",
"this",
"Future",
"as",
"completed",
"with",
"an",
"error",
"and",
"trigger",
"all",
"attached",
"callbacks",
".",
"Note",
"that",
"when",
"calling",
"wait",
"()",
"/",
"value... | def set_exception(self, result: T) -> None:
r"""
Set an exception for this ``Future``, which will mark this ``Future`` as
completed with an error and trigger all attached callbacks. Note that
when calling wait()/value() on this ``Future``, the exception set here
will be raised in... | [
"def",
"set_exception",
"(",
"self",
",",
"result",
":",
"T",
")",
"->",
"None",
":",
"assert",
"isinstance",
"(",
"result",
",",
"Exception",
")",
",",
"f\"{result} is of type {type(result)}, not an Exception.\"",
"def",
"raise_error",
"(",
"fut_result",
")",
":"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/futures/__init__.py#L239-L263 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Finder/Finder_Basics.py | python | Finder_Basics_Events.sort | (self, _object, _attributes={}, **_arguments) | sort: (NOT AVAILABLE YET) Return the specified object(s) in a sorted list
Required argument: a list of finder objects to sort
Keyword argument by: the property to sort the items by (name, index, date, etc.)
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: the sorted... | sort: (NOT AVAILABLE YET) Return the specified object(s) in a sorted list
Required argument: a list of finder objects to sort
Keyword argument by: the property to sort the items by (name, index, date, etc.)
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: the sorted... | [
"sort",
":",
"(",
"NOT",
"AVAILABLE",
"YET",
")",
"Return",
"the",
"specified",
"object",
"(",
"s",
")",
"in",
"a",
"sorted",
"list",
"Required",
"argument",
":",
"a",
"list",
"of",
"finder",
"objects",
"to",
"sort",
"Keyword",
"argument",
"by",
":",
"... | def sort(self, _object, _attributes={}, **_arguments):
"""sort: (NOT AVAILABLE YET) Return the specified object(s) in a sorted list
Required argument: a list of finder objects to sort
Keyword argument by: the property to sort the items by (name, index, date, etc.)
Keyword argument _attri... | [
"def",
"sort",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'DATA'",
"_subcode",
"=",
"'SORT'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_argmap_sort",
")... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Finder/Finder_Basics.py#L38-L58 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/pydoc.py | python | TextDoc.docmodule | (self, object, name=None, mod=None) | return result | Produce text documentation for a given module object. | Produce text documentation for a given module object. | [
"Produce",
"text",
"documentation",
"for",
"a",
"given",
"module",
"object",
"."
] | def docmodule(self, object, name=None, mod=None):
"""Produce text documentation for a given module object."""
name = object.__name__ # ignore the passed-in name
synop, desc = splitdoc(getdoc(object))
result = self.section('NAME', name + (synop and ' - ' + synop))
try:
... | [
"def",
"docmodule",
"(",
"self",
",",
"object",
",",
"name",
"=",
"None",
",",
"mod",
"=",
"None",
")",
":",
"name",
"=",
"object",
".",
"__name__",
"# ignore the passed-in name",
"synop",
",",
"desc",
"=",
"splitdoc",
"(",
"getdoc",
"(",
"object",
")",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/pydoc.py#L1031-L1129 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py | python | AppleScript_Suite_Events._b3_ | (self, _object, _attributes={}, **_arguments) | \xb3: Greater than or equal to
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | \xb3: Greater than or equal to
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | [
"\\",
"xb3",
":",
"Greater",
"than",
"or",
"equal",
"to",
"Required",
"argument",
":",
"an",
"AE",
"object",
"reference",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary",
"Returns",
":",
"anything"
] | def _b3_(self, _object, _attributes={}, **_arguments):
"""\xb3: Greater than or equal to
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything
"""
_code = 'ascr'
_subcode = '>= '
if _arg... | [
"def",
"_b3_",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'ascr'",
"_subcode",
"=",
"'>= '",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args expected'",
"_ar... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py#L700-L719 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pickle.py | python | Unpickler.load | (self) | Read a pickled object representation from the open file.
Return the reconstituted object hierarchy specified in the file. | Read a pickled object representation from the open file. | [
"Read",
"a",
"pickled",
"object",
"representation",
"from",
"the",
"open",
"file",
"."
] | def load(self):
"""Read a pickled object representation from the open file.
Return the reconstituted object hierarchy specified in the file.
"""
self.mark = object() # any new unique object
self.stack = []
self.append = self.stack.append
read = self.read
... | [
"def",
"load",
"(",
"self",
")",
":",
"self",
".",
"mark",
"=",
"object",
"(",
")",
"# any new unique object",
"self",
".",
"stack",
"=",
"[",
"]",
"self",
".",
"append",
"=",
"self",
".",
"stack",
".",
"append",
"read",
"=",
"self",
".",
"read",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pickle.py#L845-L860 | ||
visionworkbench/visionworkbench | eff1ee8f0efd70565292031d12c4b960db80f48f | src/vw/tools/extract_modis_images.py | python | prune_datasets | (datasets) | return outputs | Remove duplicate datasets and undesired datasets. | Remove duplicate datasets and undesired datasets. | [
"Remove",
"duplicate",
"datasets",
"and",
"undesired",
"datasets",
"."
] | def prune_datasets(datasets):
'''Remove duplicate datasets and undesired datasets.'''
outputs = []
for d in datasets:
name = d[0]
size = d[1]
# Check if the name is on the desired channel list
found = False
for c in DESIRED_CHANNELS:
if c in name:
... | [
"def",
"prune_datasets",
"(",
"datasets",
")",
":",
"outputs",
"=",
"[",
"]",
"for",
"d",
"in",
"datasets",
":",
"name",
"=",
"d",
"[",
"0",
"]",
"size",
"=",
"d",
"[",
"1",
"]",
"# Check if the name is on the desired channel list",
"found",
"=",
"False",
... | https://github.com/visionworkbench/visionworkbench/blob/eff1ee8f0efd70565292031d12c4b960db80f48f/src/vw/tools/extract_modis_images.py#L80-L111 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/swf/layer2.py | python | ActivityWorker.fail | (self, task_token=None, details=None, reason=None) | return self._swf.respond_activity_task_failed(task_token, details,
reason) | RespondActivityTaskFailed. | RespondActivityTaskFailed. | [
"RespondActivityTaskFailed",
"."
] | def fail(self, task_token=None, details=None, reason=None):
"""RespondActivityTaskFailed."""
if task_token is None:
task_token = self.last_tasktoken
return self._swf.respond_activity_task_failed(task_token, details,
reason) | [
"def",
"fail",
"(",
"self",
",",
"task_token",
"=",
"None",
",",
"details",
"=",
"None",
",",
"reason",
"=",
"None",
")",
":",
"if",
"task_token",
"is",
"None",
":",
"task_token",
"=",
"self",
".",
"last_tasktoken",
"return",
"self",
".",
"_swf",
".",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/swf/layer2.py#L179-L184 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/android.py | python | update_device_file_timestamp | (remote_file_path, device_id, as_root = False) | Updates the contents of the remote file with the current local time. Optionally, this
command can be run as super user, or 'as_root', which is disabled by default. | Updates the contents of the remote file with the current local time. Optionally, this
command can be run as super user, or 'as_root', which is disabled by default. | [
"Updates",
"the",
"contents",
"of",
"the",
"remote",
"file",
"with",
"the",
"current",
"local",
"time",
".",
"Optionally",
"this",
"command",
"can",
"be",
"run",
"as",
"super",
"user",
"or",
"as_root",
"which",
"is",
"disabled",
"by",
"default",
"."
] | def update_device_file_timestamp(remote_file_path, device_id, as_root = False):
'''
Updates the contents of the remote file with the current local time. Optionally, this
command can be run as super user, or 'as_root', which is disabled by default.
'''
adb_command = [ 'shell' ]
if as_root:
... | [
"def",
"update_device_file_timestamp",
"(",
"remote_file_path",
",",
"device_id",
",",
"as_root",
"=",
"False",
")",
":",
"adb_command",
"=",
"[",
"'shell'",
"]",
"if",
"as_root",
":",
"adb_command",
".",
"extend",
"(",
"[",
"'su'",
",",
"'-c'",
"]",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/android.py#L2386-L2398 | ||
xhzdeng/crpn | a5aef0f80dbe486103123f740c634fb01e6cc9a1 | lib/roi_data_layer/roidb.py | python | add_bbox_regression_targets | (roidb) | return means.ravel(), stds.ravel() | Add information needed to train bounding-box regressors. | Add information needed to train bounding-box regressors. | [
"Add",
"information",
"needed",
"to",
"train",
"bounding",
"-",
"box",
"regressors",
"."
] | def add_bbox_regression_targets(roidb):
"""Add information needed to train bounding-box regressors."""
assert len(roidb) > 0
assert 'max_classes' in roidb[0], 'Did you call prepare_roidb first?'
num_images = len(roidb)
# Infer number of classes from the number of columns in gt_overlaps
num_clas... | [
"def",
"add_bbox_regression_targets",
"(",
"roidb",
")",
":",
"assert",
"len",
"(",
"roidb",
")",
">",
"0",
"assert",
"'max_classes'",
"in",
"roidb",
"[",
"0",
"]",
",",
"'Did you call prepare_roidb first?'",
"num_images",
"=",
"len",
"(",
"roidb",
")",
"# Inf... | https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/lib/roi_data_layer/roidb.py#L46-L110 | |
facebook/watchman | 0917460c71b000b96be9b9575d77f06f2f6053bb | build/fbcode_builder/getdeps/cache.py | python | ArtifactCache.download_to_file | (self, name, dest_file_name) | return False | If `name` exists in the cache, download it and place it
in the specified `dest_file_name` location on the filesystem.
If a transient issue was encountered a TransientFailure shall
be raised.
If `name` doesn't exist in the cache `False` shall be returned.
If `dest_file_name` was s... | If `name` exists in the cache, download it and place it
in the specified `dest_file_name` location on the filesystem.
If a transient issue was encountered a TransientFailure shall
be raised.
If `name` doesn't exist in the cache `False` shall be returned.
If `dest_file_name` was s... | [
"If",
"name",
"exists",
"in",
"the",
"cache",
"download",
"it",
"and",
"place",
"it",
"in",
"the",
"specified",
"dest_file_name",
"location",
"on",
"the",
"filesystem",
".",
"If",
"a",
"transient",
"issue",
"was",
"encountered",
"a",
"TransientFailure",
"shall... | def download_to_file(self, name, dest_file_name):
"""If `name` exists in the cache, download it and place it
in the specified `dest_file_name` location on the filesystem.
If a transient issue was encountered a TransientFailure shall
be raised.
If `name` doesn't exist in the cache... | [
"def",
"download_to_file",
"(",
"self",
",",
"name",
",",
"dest_file_name",
")",
":",
"return",
"False"
] | https://github.com/facebook/watchman/blob/0917460c71b000b96be9b9575d77f06f2f6053bb/build/fbcode_builder/getdeps/cache.py#L13-L22 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/utilities/pythonlibs/audio/training/train_classifier.py | python | KeywordSpotter.init_hidden | (self) | Clear any hidden state | Clear any hidden state | [
"Clear",
"any",
"hidden",
"state"
] | def init_hidden(self):
""" Clear any hidden state """
pass | [
"def",
"init_hidden",
"(",
"self",
")",
":",
"pass"
] | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/utilities/pythonlibs/audio/training/train_classifier.py#L106-L108 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/jinja2/utils.py | python | LRUCache.__getitem__ | (self, key) | Get an item from the cache. Moves the item up so that it has the
highest priority then.
Raise a `KeyError` if it does not exist. | Get an item from the cache. Moves the item up so that it has the
highest priority then. | [
"Get",
"an",
"item",
"from",
"the",
"cache",
".",
"Moves",
"the",
"item",
"up",
"so",
"that",
"it",
"has",
"the",
"highest",
"priority",
"then",
"."
] | def __getitem__(self, key):
"""Get an item from the cache. Moves the item up so that it has the
highest priority then.
Raise a `KeyError` if it does not exist.
"""
self._wlock.acquire()
try:
rv = self._mapping[key]
if self._queue[-1] != key:
... | [
"def",
"__getitem__",
"(",
"self",
",",
"key",
")",
":",
"self",
".",
"_wlock",
".",
"acquire",
"(",
")",
"try",
":",
"rv",
"=",
"self",
".",
"_mapping",
"[",
"key",
"]",
"if",
"self",
".",
"_queue",
"[",
"-",
"1",
"]",
"!=",
"key",
":",
"try",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/utils.py#L380-L400 | ||
mitsuba-renderer/mitsuba2 | 4e7628c6eed365904ca2ba536b795d1b03410344 | src/python/python/autodiff.py | python | Optimizer.disable_gradients | (self) | Temporarily disable the generation of gradients. | Temporarily disable the generation of gradients. | [
"Temporarily",
"disable",
"the",
"generation",
"of",
"gradients",
"."
] | def disable_gradients(self):
"""Temporarily disable the generation of gradients."""
for _, p in self.params.items():
ek.set_requires_gradient(p, False)
try:
yield
finally:
for _, p in self.params.items():
ek.set_requires_gradient(p, Tru... | [
"def",
"disable_gradients",
"(",
"self",
")",
":",
"for",
"_",
",",
"p",
"in",
"self",
".",
"params",
".",
"items",
"(",
")",
":",
"ek",
".",
"set_requires_gradient",
"(",
"p",
",",
"False",
")",
"try",
":",
"yield",
"finally",
":",
"for",
"_",
","... | https://github.com/mitsuba-renderer/mitsuba2/blob/4e7628c6eed365904ca2ba536b795d1b03410344/src/python/python/autodiff.py#L229-L237 | ||
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/xs/data_source.py | python | ENDFDataSource.reaction | (self, nuc, rx, nuc_i = None) | return self.rxcache[nuc, rx, nuc_i] | Get reaction data.
Parameters
----------
nuc : int or str
Nuclide containing the reaction.
rx : int or str
Desired reaction
nuc_i : int or str
Nuclide containing the reaction. Defaults to nuc.
group_bounds : tuple
Low and h... | Get reaction data. | [
"Get",
"reaction",
"data",
"."
] | def reaction(self, nuc, rx, nuc_i = None):
"""Get reaction data.
Parameters
----------
nuc : int or str
Nuclide containing the reaction.
rx : int or str
Desired reaction
nuc_i : int or str
Nuclide containing the reaction. Defaults to n... | [
"def",
"reaction",
"(",
"self",
",",
"nuc",
",",
"rx",
",",
"nuc_i",
"=",
"None",
")",
":",
"if",
"nuc_i",
"is",
"None",
":",
"nuc_i",
"=",
"nuc",
"nuc",
"=",
"nucname",
".",
"id",
"(",
"nuc",
")",
"rx",
"=",
"rxname",
".",
"mt",
"(",
"rx",
"... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/xs/data_source.py#L795-L821 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/serve/serve_utils.py | python | DatetimeToIsoFormat | (timestamp) | return timestamp.isoformat() | Return a string representing the date and time in ISO 8601 format.
Args:
timestamp: datetime.datetime object with time zone info.
Returns:
a string representing the date and time in ISO 8601 with time zone info. | Return a string representing the date and time in ISO 8601 format. | [
"Return",
"a",
"string",
"representing",
"the",
"date",
"and",
"time",
"in",
"ISO",
"8601",
"format",
"."
] | def DatetimeToIsoFormat(timestamp):
"""Return a string representing the date and time in ISO 8601 format.
Args:
timestamp: datetime.datetime object with time zone info.
Returns:
a string representing the date and time in ISO 8601 with time zone info.
"""
assert isinstance(timestamp, datetime.datetime... | [
"def",
"DatetimeToIsoFormat",
"(",
"timestamp",
")",
":",
"assert",
"isinstance",
"(",
"timestamp",
",",
"datetime",
".",
"datetime",
")",
"return",
"timestamp",
".",
"isoformat",
"(",
")"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/serve_utils.py#L44-L53 | |
microsoft/clang | 86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5 | bindings/python/clang/cindex.py | python | Index.create | (excludeDecls=False) | return Index(conf.lib.clang_createIndex(excludeDecls, 0)) | Create a new Index.
Parameters:
excludeDecls -- Exclude local declarations from translation units. | Create a new Index.
Parameters:
excludeDecls -- Exclude local declarations from translation units. | [
"Create",
"a",
"new",
"Index",
".",
"Parameters",
":",
"excludeDecls",
"--",
"Exclude",
"local",
"declarations",
"from",
"translation",
"units",
"."
] | def create(excludeDecls=False):
"""
Create a new Index.
Parameters:
excludeDecls -- Exclude local declarations from translation units.
"""
return Index(conf.lib.clang_createIndex(excludeDecls, 0)) | [
"def",
"create",
"(",
"excludeDecls",
"=",
"False",
")",
":",
"return",
"Index",
"(",
"conf",
".",
"lib",
".",
"clang_createIndex",
"(",
"excludeDecls",
",",
"0",
")",
")"
] | https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/bindings/python/clang/cindex.py#L2672-L2678 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatToolbarItem.GetCustomControl | (self) | return self._customCtrl | Returns the associated custom control. | Returns the associated custom control. | [
"Returns",
"the",
"associated",
"custom",
"control",
"."
] | def GetCustomControl(self):
""" Returns the associated custom control. """
return self._customCtrl | [
"def",
"GetCustomControl",
"(",
"self",
")",
":",
"return",
"self",
".",
"_customCtrl"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L4684-L4687 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISLoadAndProcess.py | python | ReflectometryISISLoadAndProcess._getInputWorkspaces | (self, runs, isTrans) | return workspaces | Convert the given run numbers into real workspace names. Uses workspaces from
the ADS if they exist, or loads them otherwise. | Convert the given run numbers into real workspace names. Uses workspaces from
the ADS if they exist, or loads them otherwise. | [
"Convert",
"the",
"given",
"run",
"numbers",
"into",
"real",
"workspace",
"names",
".",
"Uses",
"workspaces",
"from",
"the",
"ADS",
"if",
"they",
"exist",
"or",
"loads",
"them",
"otherwise",
"."
] | def _getInputWorkspaces(self, runs, isTrans):
"""Convert the given run numbers into real workspace names. Uses workspaces from
the ADS if they exist, or loads them otherwise."""
workspaces = list()
for run in runs:
ws = self._getRunFromADSOrNone(run, isTrans)
if n... | [
"def",
"_getInputWorkspaces",
"(",
"self",
",",
"runs",
",",
"isTrans",
")",
":",
"workspaces",
"=",
"list",
"(",
")",
"for",
"run",
"in",
"runs",
":",
"ws",
"=",
"self",
".",
"_getRunFromADSOrNone",
"(",
"run",
",",
"isTrans",
")",
"if",
"not",
"ws",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISLoadAndProcess.py#L207-L218 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/optimizer/qgt/qgt_jacobian_pytree_logic.py | python | stack_jacobian | (centered_oks: PyTree) | return jax.tree_map(
lambda x: jnp.concatenate([x.real, x.imag], axis=0), centered_oks
) | Return the real and imaginary parts of ΔOⱼₖ stacked along the sample axis
Re[S] = Re[(ΔOᵣ + i ΔOᵢ)ᴴ(ΔOᵣ + i ΔOᵢ)] = ΔOᵣᵀ ΔOᵣ + ΔOᵢᵀ ΔOᵢ = [ΔOᵣ ΔOᵢ]ᵀ [ΔOᵣ ΔOᵢ] | Return the real and imaginary parts of ΔOⱼₖ stacked along the sample axis
Re[S] = Re[(ΔOᵣ + i ΔOᵢ)ᴴ(ΔOᵣ + i ΔOᵢ)] = ΔOᵣᵀ ΔOᵣ + ΔOᵢᵀ ΔOᵢ = [ΔOᵣ ΔOᵢ]ᵀ [ΔOᵣ ΔOᵢ] | [
"Return",
"the",
"real",
"and",
"imaginary",
"parts",
"of",
"ΔOⱼₖ",
"stacked",
"along",
"the",
"sample",
"axis",
"Re",
"[",
"S",
"]",
"=",
"Re",
"[",
"(",
"ΔOᵣ",
"+",
"i",
"ΔOᵢ",
")",
"ᴴ",
"(",
"ΔOᵣ",
"+",
"i",
"ΔOᵢ",
")",
"]",
"=",
"ΔOᵣᵀ",
"ΔO... | def stack_jacobian(centered_oks: PyTree) -> PyTree:
"""
Return the real and imaginary parts of ΔOⱼₖ stacked along the sample axis
Re[S] = Re[(ΔOᵣ + i ΔOᵢ)ᴴ(ΔOᵣ + i ΔOᵢ)] = ΔOᵣᵀ ΔOᵣ + ΔOᵢᵀ ΔOᵢ = [ΔOᵣ ΔOᵢ]ᵀ [ΔOᵣ ΔOᵢ]
"""
return jax.tree_map(
lambda x: jnp.concatenate([x.real, x.imag], axis=0),... | [
"def",
"stack_jacobian",
"(",
"centered_oks",
":",
"PyTree",
")",
"->",
"PyTree",
":",
"return",
"jax",
".",
"tree_map",
"(",
"lambda",
"x",
":",
"jnp",
".",
"concatenate",
"(",
"[",
"x",
".",
"real",
",",
"x",
".",
"imag",
"]",
",",
"axis",
"=",
"... | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/optimizer/qgt/qgt_jacobian_pytree_logic.py#L132-L139 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Standard_Suite.py | python | Standard_Suite_Events.count | (self, _object, _attributes={}, **_arguments) | count: return the number of elements of a particular class within an object
Required argument: the object whose elements are to be counted
Keyword argument each: the class of the elements to be counted. Keyword 'each' is optional in AppleScript
Keyword argument _attributes: AppleEvent attribute ... | count: return the number of elements of a particular class within an object
Required argument: the object whose elements are to be counted
Keyword argument each: the class of the elements to be counted. Keyword 'each' is optional in AppleScript
Keyword argument _attributes: AppleEvent attribute ... | [
"count",
":",
"return",
"the",
"number",
"of",
"elements",
"of",
"a",
"particular",
"class",
"within",
"an",
"object",
"Required",
"argument",
":",
"the",
"object",
"whose",
"elements",
"are",
"to",
"be",
"counted",
"Keyword",
"argument",
"each",
":",
"the",... | def count(self, _object, _attributes={}, **_arguments):
"""count: return the number of elements of a particular class within an object
Required argument: the object whose elements are to be counted
Keyword argument each: the class of the elements to be counted. Keyword 'each' is optional in Appl... | [
"def",
"count",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'core'",
"_subcode",
"=",
"'cnte'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_argmap_count",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Standard_Suite.py#L48-L68 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/framework/errors.py | python | OutOfRangeError.__init__ | (self, node_def, op, message) | Creates an `OutOfRangeError`. | Creates an `OutOfRangeError`. | [
"Creates",
"an",
"OutOfRangeError",
"."
] | def __init__(self, node_def, op, message):
"""Creates an `OutOfRangeError`."""
super(OutOfRangeError, self).__init__(node_def, op, message,
OUT_OF_RANGE) | [
"def",
"__init__",
"(",
"self",
",",
"node_def",
",",
"op",
",",
"message",
")",
":",
"super",
"(",
"OutOfRangeError",
",",
"self",
")",
".",
"__init__",
"(",
"node_def",
",",
"op",
",",
"message",
",",
"OUT_OF_RANGE",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/errors.py#L345-L348 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/training/supervisor.py | python | SVSummaryThread.__init__ | (self, sv, sess) | Create a SVSummaryThread.
Args:
sv: A `Supervisor`.
sess: A `Session`. | Create a SVSummaryThread. | [
"Create",
"a",
"SVSummaryThread",
"."
] | def __init__(self, sv, sess):
"""Create a SVSummaryThread.
Args:
sv: A `Supervisor`.
sess: A `Session`.
"""
super(SVSummaryThread, self).__init__(sv.coord, sv.save_summaries_secs)
self._sv = sv
self._sess = sess | [
"def",
"__init__",
"(",
"self",
",",
"sv",
",",
"sess",
")",
":",
"super",
"(",
"SVSummaryThread",
",",
"self",
")",
".",
"__init__",
"(",
"sv",
".",
"coord",
",",
"sv",
".",
"save_summaries_secs",
")",
"self",
".",
"_sv",
"=",
"sv",
"self",
".",
"... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/training/supervisor.py#L947-L956 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/EasyDialogs.py | python | _interact | () | Make sure the application is in the foreground | Make sure the application is in the foreground | [
"Make",
"sure",
"the",
"application",
"is",
"in",
"the",
"foreground"
] | def _interact():
"""Make sure the application is in the foreground"""
AE.AEInteractWithUser(50000000) | [
"def",
"_interact",
"(",
")",
":",
"AE",
".",
"AEInteractWithUser",
"(",
"50000000",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/EasyDialogs.py#L54-L56 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py3/jinja2/filters.py | python | do_unique | (
environment: "Environment",
value: "t.Iterable[V]",
case_sensitive: bool = False,
attribute: t.Optional[t.Union[str, int]] = None,
) | Returns a list of unique items from the given iterable.
.. sourcecode:: jinja
{{ ['foo', 'bar', 'foobar', 'FooBar']|unique|list }}
-> ['foo', 'bar', 'foobar']
The unique items are yielded in the same order as their first occurrence in
the iterable passed to the filter.
:param cas... | Returns a list of unique items from the given iterable. | [
"Returns",
"a",
"list",
"of",
"unique",
"items",
"from",
"the",
"given",
"iterable",
"."
] | def do_unique(
environment: "Environment",
value: "t.Iterable[V]",
case_sensitive: bool = False,
attribute: t.Optional[t.Union[str, int]] = None,
) -> "t.Iterator[V]":
"""Returns a list of unique items from the given iterable.
.. sourcecode:: jinja
{{ ['foo', 'bar', 'foobar', 'FooBar']... | [
"def",
"do_unique",
"(",
"environment",
":",
"\"Environment\"",
",",
"value",
":",
"\"t.Iterable[V]\"",
",",
"case_sensitive",
":",
"bool",
"=",
"False",
",",
"attribute",
":",
"t",
".",
"Optional",
"[",
"t",
".",
"Union",
"[",
"str",
",",
"int",
"]",
"]... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/filters.py#L436-L465 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PropertyGridIterator_OneStep | (*args, **kwargs) | return _propgrid.PropertyGridIterator_OneStep(*args, **kwargs) | PropertyGridIterator_OneStep( state, int flags=PG_ITERATE_DEFAULT, PGProperty property=None,
int dir=1) -> PGProperty | PropertyGridIterator_OneStep( state, int flags=PG_ITERATE_DEFAULT, PGProperty property=None,
int dir=1) -> PGProperty | [
"PropertyGridIterator_OneStep",
"(",
"state",
"int",
"flags",
"=",
"PG_ITERATE_DEFAULT",
"PGProperty",
"property",
"=",
"None",
"int",
"dir",
"=",
"1",
")",
"-",
">",
"PGProperty"
] | def PropertyGridIterator_OneStep(*args, **kwargs):
"""
PropertyGridIterator_OneStep( state, int flags=PG_ITERATE_DEFAULT, PGProperty property=None,
int dir=1) -> PGProperty
"""
return _propgrid.PropertyGridIterator_OneStep(*args, **kwargs) | [
"def",
"PropertyGridIterator_OneStep",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridIterator_OneStep",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L994-L999 | |
qt/qtbase | 81b9ee66b8e40ed145185fe46b7c91929688cafd | util/locale_database/qlocalexml2cpp.py | python | StringData.__store | (self, s, bits) | Add string s to known data.
Seeks to avoid duplication, where possible.
For example, short-forms may be prefixes of long-forms. | Add string s to known data. | [
"Add",
"string",
"s",
"to",
"known",
"data",
"."
] | def __store(self, s, bits):
"""Add string s to known data.
Seeks to avoid duplication, where possible.
For example, short-forms may be prefixes of long-forms.
"""
if not s:
return StringDataToken(0, 0, bits)
ucs2 = unicode2hex(s)
try:
inde... | [
"def",
"__store",
"(",
"self",
",",
"s",
",",
"bits",
")",
":",
"if",
"not",
"s",
":",
"return",
"StringDataToken",
"(",
"0",
",",
"0",
",",
"bits",
")",
"ucs2",
"=",
"unicode2hex",
"(",
"s",
")",
"try",
":",
"index",
"=",
"self",
".",
"text",
... | https://github.com/qt/qtbase/blob/81b9ee66b8e40ed145185fe46b7c91929688cafd/util/locale_database/qlocalexml2cpp.py#L99-L127 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | NumericPropertyValidator.__init__ | (self, *args, **kwargs) | __init__(self, int numericType, int base=10) -> NumericPropertyValidator | __init__(self, int numericType, int base=10) -> NumericPropertyValidator | [
"__init__",
"(",
"self",
"int",
"numericType",
"int",
"base",
"=",
"10",
")",
"-",
">",
"NumericPropertyValidator"
] | def __init__(self, *args, **kwargs):
"""__init__(self, int numericType, int base=10) -> NumericPropertyValidator"""
_propgrid.NumericPropertyValidator_swiginit(self,_propgrid.new_NumericPropertyValidator(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_propgrid",
".",
"NumericPropertyValidator_swiginit",
"(",
"self",
",",
"_propgrid",
".",
"new_NumericPropertyValidator",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L2883-L2885 | ||
QMCPACK/qmcpack | d0948ab455e38364458740cc8e2239600a14c5cd | utils/afqmctools/afqmctools/analysis/average.py | python | estimate_error_eig | (gamma, gamma_err, fock, fock_err, nsamp=20, cutoff=1e-14) | return numpy.std(eigs_tot, axis=0, ddof=1) | Bootstrap estimate of error in eigenvalues. | Bootstrap estimate of error in eigenvalues. | [
"Bootstrap",
"estimate",
"of",
"error",
"in",
"eigenvalues",
"."
] | def estimate_error_eig(gamma, gamma_err, fock, fock_err, nsamp=20, cutoff=1e-14):
"""Bootstrap estimate of error in eigenvalues."""
eigs_tot = numpy.zeros((nsamp, gamma.shape[-1]))
# TODO FIX THIS
for s in range(nsamp):
gamma_p = gen_sample_matrix(gamma, gamma_err)
fock_p = gen_sample_ma... | [
"def",
"estimate_error_eig",
"(",
"gamma",
",",
"gamma_err",
",",
"fock",
",",
"fock_err",
",",
"nsamp",
"=",
"20",
",",
"cutoff",
"=",
"1e-14",
")",
":",
"eigs_tot",
"=",
"numpy",
".",
"zeros",
"(",
"(",
"nsamp",
",",
"gamma",
".",
"shape",
"[",
"-"... | https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/utils/afqmctools/afqmctools/analysis/average.py#L565-L574 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | mlir/utils/spirv/gen_spirv_dialect.py | python | get_string_between_nested | (base, start, end) | return '', split[0] | Extracts a substring with a nested start and end from a string.
Arguments:
- base: string to extract from.
- start: string to use as the start of the substring.
- end: string to use as the end of the substring.
Returns:
- The substring if found
- The part of the base after end of the substring... | Extracts a substring with a nested start and end from a string. | [
"Extracts",
"a",
"substring",
"with",
"a",
"nested",
"start",
"and",
"end",
"from",
"a",
"string",
"."
] | def get_string_between_nested(base, start, end):
"""Extracts a substring with a nested start and end from a string.
Arguments:
- base: string to extract from.
- start: string to use as the start of the substring.
- end: string to use as the end of the substring.
Returns:
- The substring if found... | [
"def",
"get_string_between_nested",
"(",
"base",
",",
"start",
",",
"end",
")",
":",
"split",
"=",
"base",
".",
"split",
"(",
"start",
",",
"1",
")",
"if",
"len",
"(",
"split",
")",
"==",
"2",
":",
"# Handle nesting delimiters",
"rest",
"=",
"split",
"... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/mlir/utils/spirv/gen_spirv_dialect.py#L829-L864 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | examples/python/gdbremote.py | python | RegisterInfo.byte_size | (self) | return self.bit_size() / 8 | Get the size in bytes of the register. | Get the size in bytes of the register. | [
"Get",
"the",
"size",
"in",
"bytes",
"of",
"the",
"register",
"."
] | def byte_size(self):
'''Get the size in bytes of the register.'''
return self.bit_size() / 8 | [
"def",
"byte_size",
"(",
"self",
")",
":",
"return",
"self",
".",
"bit_size",
"(",
")",
"/",
"8"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/examples/python/gdbremote.py#L361-L363 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | ScrollWinEvent.SetOrientation | (*args, **kwargs) | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) | SetOrientation(self, int orient) | SetOrientation(self, int orient) | [
"SetOrientation",
"(",
"self",
"int",
"orient",
")"
] | def SetOrientation(*args, **kwargs):
"""SetOrientation(self, int orient)"""
return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) | [
"def",
"SetOrientation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ScrollWinEvent_SetOrientation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L5493-L5495 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Pack.pack_info | (self) | return d | Return information about the packing options
for this widget. | Return information about the packing options
for this widget. | [
"Return",
"information",
"about",
"the",
"packing",
"options",
"for",
"this",
"widget",
"."
] | def pack_info(self):
"""Return information about the packing options
for this widget."""
d = _splitdict(self.tk, self.tk.call('pack', 'info', self._w))
if 'in' in d:
d['in'] = self.nametowidget(d['in'])
return d | [
"def",
"pack_info",
"(",
"self",
")",
":",
"d",
"=",
"_splitdict",
"(",
"self",
".",
"tk",
",",
"self",
".",
"tk",
".",
"call",
"(",
"'pack'",
",",
"'info'",
",",
"self",
".",
"_w",
")",
")",
"if",
"'in'",
"in",
"d",
":",
"d",
"[",
"'in'",
"]... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L1957-L1963 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/ordered_dict.py | python | OrderedDict.iteritems | (self) | od.iteritems -> an iterator over the (key, value) items in od | od.iteritems -> an iterator over the (key, value) items in od | [
"od",
".",
"iteritems",
"-",
">",
"an",
"iterator",
"over",
"the",
"(",
"key",
"value",
")",
"items",
"in",
"od"
] | def iteritems(self):
'od.iteritems -> an iterator over the (key, value) items in od'
for k in self:
yield (k, self[k]) | [
"def",
"iteritems",
"(",
"self",
")",
":",
"for",
"k",
"in",
"self",
":",
"yield",
"(",
"k",
",",
"self",
"[",
"k",
"]",
")"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/ordered_dict.py#L164-L167 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/external/eigen_archive/debug/gdb/printers.py | python | EigenMatrixPrinter.__init__ | (self, variety, val) | Extract all the necessary information | Extract all the necessary information | [
"Extract",
"all",
"the",
"necessary",
"information"
] | def __init__(self, variety, val):
"Extract all the necessary information"
# Save the variety (presumably "Matrix" or "Array") for later usage
self.variety = variety
# The gdb extension does not support value template arguments - need to extract them by hand
type = val.type
if type.code == gdb.TYPE_COD... | [
"def",
"__init__",
"(",
"self",
",",
"variety",
",",
"val",
")",
":",
"# Save the variety (presumably \"Matrix\" or \"Array\") for later usage",
"self",
".",
"variety",
"=",
"variety",
"# The gdb extension does not support value template arguments - need to extract them by hand",
"... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/eigen_archive/debug/gdb/printers.py#L37-L78 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/plugins/PyShell/PyShell/__init__.py | python | EdPyShell.__SetShellTheme | (self, style) | Set the color scheme used by the shell
@param style: style sheet name (string) | Set the color scheme used by the shell
@param style: style sheet name (string) | [
"Set",
"the",
"color",
"scheme",
"used",
"by",
"the",
"shell",
"@param",
"style",
":",
"style",
"sheet",
"name",
"(",
"string",
")"
] | def __SetShellTheme(self, style):
"""Set the color scheme used by the shell
@param style: style sheet name (string)
"""
self._shell_style = style
Profile_Set(PYSHELL_STYLE, style)
self.UpdateAllStyles(style) | [
"def",
"__SetShellTheme",
"(",
"self",
",",
"style",
")",
":",
"self",
".",
"_shell_style",
"=",
"style",
"Profile_Set",
"(",
"PYSHELL_STYLE",
",",
"style",
")",
"self",
".",
"UpdateAllStyles",
"(",
"style",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/PyShell/PyShell/__init__.py#L159-L166 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/spectral_ops.py | python | _infer_fft_length_for_irfft | (input_tensor, fft_rank) | return _ops.convert_to_tensor(fft_length, _dtypes.int32) | Infers the `fft_length` argument for a `rank` IRFFT from `input_tensor`. | Infers the `fft_length` argument for a `rank` IRFFT from `input_tensor`. | [
"Infers",
"the",
"fft_length",
"argument",
"for",
"a",
"rank",
"IRFFT",
"from",
"input_tensor",
"."
] | def _infer_fft_length_for_irfft(input_tensor, fft_rank):
"""Infers the `fft_length` argument for a `rank` IRFFT from `input_tensor`."""
# A TensorShape for the inner fft_rank dimensions.
fft_shape = input_tensor.get_shape()[-fft_rank:]
# If any dim is unknown, fall back to tensor-based math.
if not fft_shape... | [
"def",
"_infer_fft_length_for_irfft",
"(",
"input_tensor",
",",
"fft_rank",
")",
":",
"# A TensorShape for the inner fft_rank dimensions.",
"fft_shape",
"=",
"input_tensor",
".",
"get_shape",
"(",
")",
"[",
"-",
"fft_rank",
":",
"]",
"# If any dim is unknown, fall back to t... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/spectral_ops.py#L56-L71 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Sizer.ShowItems | (*args, **kwargs) | return _core_.Sizer_ShowItems(*args, **kwargs) | ShowItems(self, bool show)
Recursively call `wx.SizerItem.Show` on all sizer items. | ShowItems(self, bool show) | [
"ShowItems",
"(",
"self",
"bool",
"show",
")"
] | def ShowItems(*args, **kwargs):
"""
ShowItems(self, bool show)
Recursively call `wx.SizerItem.Show` on all sizer items.
"""
return _core_.Sizer_ShowItems(*args, **kwargs) | [
"def",
"ShowItems",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Sizer_ShowItems",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L14995-L15001 | |
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/llvm/utils/lint/cpp_lint.py | python | VerifyIncludes | (filename, lines) | return lint | Makes sure the #includes are in proper order and no disallows files are
#included.
Args:
filename: the file under consideration as string
lines: contents of the file as string array | Makes sure the #includes are in proper order and no disallows files are
#included. | [
"Makes",
"sure",
"the",
"#includes",
"are",
"in",
"proper",
"order",
"and",
"no",
"disallows",
"files",
"are",
"#included",
"."
] | def VerifyIncludes(filename, lines):
"""Makes sure the #includes are in proper order and no disallows files are
#included.
Args:
filename: the file under consideration as string
lines: contents of the file as string array
"""
lint = []
include_gtest_re = re.compile(r'^#include "gtest/(.*)"')
inc... | [
"def",
"VerifyIncludes",
"(",
"filename",
",",
"lines",
")",
":",
"lint",
"=",
"[",
"]",
"include_gtest_re",
"=",
"re",
".",
"compile",
"(",
"r'^#include \"gtest/(.*)\"'",
")",
"include_llvm_re",
"=",
"re",
".",
"compile",
"(",
"r'^#include \"llvm/(.*)\"'",
")",... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/llvm/utils/lint/cpp_lint.py#L14-L71 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/DiamondAttenuationCorrection/FitTransReadUB.py | python | calcDspacing | (a, b, c, alp, bet, gam, h, k, l) | return d | %CALCDSPACING for general unit cell: a,b,c,alp,bet,gam returns d-spacing for
%reflection h,k,l
% | %CALCDSPACING for general unit cell: a,b,c,alp,bet,gam returns d-spacing for
%reflection h,k,l
% | [
"%CALCDSPACING",
"for",
"general",
"unit",
"cell",
":",
"a",
"b",
"c",
"alp",
"bet",
"gam",
"returns",
"d",
"-",
"spacing",
"for",
"%reflection",
"h",
"k",
"l",
"%"
] | def calcDspacing(a, b, c, alp, bet, gam, h, k, l):
'''
%CALCDSPACING for general unit cell: a,b,c,alp,bet,gam returns d-spacing for
%reflection h,k,l
%
'''
ca = np.cos(np.radians(alp))
cb = np.cos(np.radians(bet))
cg = np.cos(np.radians(gam))
sa = np.sin(np.radians(alp))
sb = np.... | [
"def",
"calcDspacing",
"(",
"a",
",",
"b",
",",
"c",
",",
"alp",
",",
"bet",
",",
"gam",
",",
"h",
",",
"k",
",",
"l",
")",
":",
"ca",
"=",
"np",
".",
"cos",
"(",
"np",
".",
"radians",
"(",
"alp",
")",
")",
"cb",
"=",
"np",
".",
"cos",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/DiamondAttenuationCorrection/FitTransReadUB.py#L55-L74 | |
Project-OSRM/osrm-backend | f2e284623e25b5570dd2a5e6985abcb3790fd348 | third_party/flatbuffers/python/flatbuffers/table.py | python | Table.VectorLen | (self, off) | return ret | VectorLen retrieves the length of the vector whose offset is stored
at "off" in this object. | VectorLen retrieves the length of the vector whose offset is stored
at "off" in this object. | [
"VectorLen",
"retrieves",
"the",
"length",
"of",
"the",
"vector",
"whose",
"offset",
"is",
"stored",
"at",
"off",
"in",
"this",
"object",
"."
] | def VectorLen(self, off):
"""VectorLen retrieves the length of the vector whose offset is stored
at "off" in this object."""
N.enforce_number(off, N.UOffsetTFlags)
off += self.Pos
off += encode.Get(N.UOffsetTFlags.packer_type, self.Bytes, off)
ret = encode.Get(N.UOffs... | [
"def",
"VectorLen",
"(",
"self",
",",
"off",
")",
":",
"N",
".",
"enforce_number",
"(",
"off",
",",
"N",
".",
"UOffsetTFlags",
")",
"off",
"+=",
"self",
".",
"Pos",
"off",
"+=",
"encode",
".",
"Get",
"(",
"N",
".",
"UOffsetTFlags",
".",
"packer_type"... | https://github.com/Project-OSRM/osrm-backend/blob/f2e284623e25b5570dd2a5e6985abcb3790fd348/third_party/flatbuffers/python/flatbuffers/table.py#L56-L64 | |
Constellation/iv | 64c3a9c7c517063f29d90d449180ea8f6f4d946f | tools/cpplint.py | python | _FunctionState.End | (self) | Stop analyzing function body. | Stop analyzing function body. | [
"Stop",
"analyzing",
"function",
"body",
"."
] | def End(self):
"""Stop analyzing function body."""
self.in_a_function = False | [
"def",
"End",
"(",
"self",
")",
":",
"self",
".",
"in_a_function",
"=",
"False"
] | https://github.com/Constellation/iv/blob/64c3a9c7c517063f29d90d449180ea8f6f4d946f/tools/cpplint.py#L849-L851 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | PageSetupDialogData.GetEnableOrientation | (*args, **kwargs) | return _windows_.PageSetupDialogData_GetEnableOrientation(*args, **kwargs) | GetEnableOrientation(self) -> bool | GetEnableOrientation(self) -> bool | [
"GetEnableOrientation",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetEnableOrientation(*args, **kwargs):
"""GetEnableOrientation(self) -> bool"""
return _windows_.PageSetupDialogData_GetEnableOrientation(*args, **kwargs) | [
"def",
"GetEnableOrientation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PageSetupDialogData_GetEnableOrientation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L4894-L4896 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/wheel.py | python | Wheel.install_as_egg | (self, destination_eggdir) | Install wheel as an egg directory. | Install wheel as an egg directory. | [
"Install",
"wheel",
"as",
"an",
"egg",
"directory",
"."
] | def install_as_egg(self, destination_eggdir):
'''Install wheel as an egg directory.'''
with zipfile.ZipFile(self.filename) as zf:
self._install_as_egg(destination_eggdir, zf) | [
"def",
"install_as_egg",
"(",
"self",
",",
"destination_eggdir",
")",
":",
"with",
"zipfile",
".",
"ZipFile",
"(",
"self",
".",
"filename",
")",
"as",
"zf",
":",
"self",
".",
"_install_as_egg",
"(",
"destination_eggdir",
",",
"zf",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/wheel.py#L92-L95 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/io/arff/arffread.py | python | tokenize_attribute | (iterable, attribute) | return name, type, next_item | Parse a raw string in header (eg starts by @attribute).
Given a raw string attribute, try to get the name and type of the
attribute. Constraints:
* The first line must start with @attribute (case insensitive, and
space like characters before @attribute are allowed)
* Works also if the attribute ... | Parse a raw string in header (eg starts by @attribute). | [
"Parse",
"a",
"raw",
"string",
"in",
"header",
"(",
"eg",
"starts",
"by",
"@attribute",
")",
"."
] | def tokenize_attribute(iterable, attribute):
"""Parse a raw string in header (eg starts by @attribute).
Given a raw string attribute, try to get the name and type of the
attribute. Constraints:
* The first line must start with @attribute (case insensitive, and
space like characters before @attri... | [
"def",
"tokenize_attribute",
"(",
"iterable",
",",
"attribute",
")",
":",
"sattr",
"=",
"attribute",
".",
"strip",
"(",
")",
"mattr",
"=",
"r_attribute",
".",
"match",
"(",
"sattr",
")",
"if",
"mattr",
":",
"# atrv is everything after @attribute",
"atrv",
"=",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/io/arff/arffread.py#L223-L285 | |
yue/yue | 619d62c191b13c51c01be451dc48917c34a5aefc | building/tools/cpplint.py | python | FileInfo.BaseName | (self) | return self.Split()[1] | File base name - text after the final slash, before the final period. | File base name - text after the final slash, before the final period. | [
"File",
"base",
"name",
"-",
"text",
"after",
"the",
"final",
"slash",
"before",
"the",
"final",
"period",
"."
] | def BaseName(self):
"""File base name - text after the final slash, before the final period."""
return self.Split()[1] | [
"def",
"BaseName",
"(",
"self",
")",
":",
"return",
"self",
".",
"Split",
"(",
")",
"[",
"1",
"]"
] | https://github.com/yue/yue/blob/619d62c191b13c51c01be451dc48917c34a5aefc/building/tools/cpplint.py#L1165-L1167 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/plotconfigdialog/curvestabwidget/presenter.py | python | CurvesTabWidgetPresenter.get_selected_ax | (self) | Get selected axes object from name in combo box.
If not found return None. | Get selected axes object from name in combo box.
If not found return None. | [
"Get",
"selected",
"axes",
"object",
"from",
"name",
"in",
"combo",
"box",
".",
"If",
"not",
"found",
"return",
"None",
"."
] | def get_selected_ax(self):
"""
Get selected axes object from name in combo box.
If not found return None.
"""
try:
return self.axes_names_dict[self.view.get_selected_ax_name()]
except KeyError:
return None | [
"def",
"get_selected_ax",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"axes_names_dict",
"[",
"self",
".",
"view",
".",
"get_selected_ax_name",
"(",
")",
"]",
"except",
"KeyError",
":",
"return",
"None"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/plotconfigdialog/curvestabwidget/presenter.py#L89-L97 | ||
google/iree | 1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76 | integrations/tensorflow/iree-dialects/python/iree/compiler/dialects/iree_pydm/importer/util.py | python | Intrinsic.emit_immediate | (self, stage: ImportStage) | Emits this object as an immediate value.
On failure, abort with error. | Emits this object as an immediate value. | [
"Emits",
"this",
"object",
"as",
"an",
"immediate",
"value",
"."
] | def emit_immediate(self, stage: ImportStage) -> ir.Value:
"""Emits this object as an immediate value.
On failure, abort with error.
"""
stage.ic.abort(
f"the compiler intrinsic {self} can not be serialized as a value") | [
"def",
"emit_immediate",
"(",
"self",
",",
"stage",
":",
"ImportStage",
")",
"->",
"ir",
".",
"Value",
":",
"stage",
".",
"ic",
".",
"abort",
"(",
"f\"the compiler intrinsic {self} can not be serialized as a value\"",
")"
] | https://github.com/google/iree/blob/1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76/integrations/tensorflow/iree-dialects/python/iree/compiler/dialects/iree_pydm/importer/util.py#L231-L237 | ||
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | tools/buildgen/plugins/check_attrs.py | python | mako_plugin | (dictionary) | The exported plugin code for check_attr.
This validates that filegroups, libs, and target can have only valid
attributes. This is mainly for preventing build.yaml from having
unnecessary and misleading attributes accidentally. | The exported plugin code for check_attr. | [
"The",
"exported",
"plugin",
"code",
"for",
"check_attr",
"."
] | def mako_plugin(dictionary):
"""The exported plugin code for check_attr.
This validates that filegroups, libs, and target can have only valid
attributes. This is mainly for preventing build.yaml from having
unnecessary and misleading attributes accidentally.
"""
errors = []
for filegroup in dictio... | [
"def",
"mako_plugin",
"(",
"dictionary",
")",
":",
"errors",
"=",
"[",
"]",
"for",
"filegroup",
"in",
"dictionary",
".",
"get",
"(",
"'filegroups'",
",",
"{",
"}",
")",
":",
"check_attributes",
"(",
"filegroup",
",",
"'filegroup'",
",",
"errors",
")",
"f... | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/tools/buildgen/plugins/check_attrs.py#L113-L129 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/pyfakefs/pyfakefs/fake_filesystem.py | python | CopyModule | (old) | return new | Recompiles and creates new module object. | Recompiles and creates new module object. | [
"Recompiles",
"and",
"creates",
"new",
"module",
"object",
"."
] | def CopyModule(old):
"""Recompiles and creates new module object."""
saved = sys.modules.pop(old.__name__, None)
new = __import__(old.__name__)
sys.modules[old.__name__] = saved
return new | [
"def",
"CopyModule",
"(",
"old",
")",
":",
"saved",
"=",
"sys",
".",
"modules",
".",
"pop",
"(",
"old",
".",
"__name__",
",",
"None",
")",
"new",
"=",
"__import__",
"(",
"old",
".",
"__name__",
")",
"sys",
".",
"modules",
"[",
"old",
".",
"__name__... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyfakefs/pyfakefs/fake_filesystem.py#L144-L149 | |
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | lib/pycocotools/coco.py | python | COCO.loadAnns | (self, ids=[]) | Load anns with the specified ids.
:param ids (int array) : integer ids specifying anns
:return: anns (object array) : loaded ann objects | Load anns with the specified ids.
:param ids (int array) : integer ids specifying anns
:return: anns (object array) : loaded ann objects | [
"Load",
"anns",
"with",
"the",
"specified",
"ids",
".",
":",
"param",
"ids",
"(",
"int",
"array",
")",
":",
"integer",
"ids",
"specifying",
"anns",
":",
"return",
":",
"anns",
"(",
"object",
"array",
")",
":",
"loaded",
"ann",
"objects"
] | def loadAnns(self, ids=[]):
"""
Load anns with the specified ids.
:param ids (int array) : integer ids specifying anns
:return: anns (object array) : loaded ann objects
"""
if type(ids) == list:
return [self.anns[id] for id in ids]
elif type(ids)... | [
"def",
"loadAnns",
"(",
"self",
",",
"ids",
"=",
"[",
"]",
")",
":",
"if",
"type",
"(",
"ids",
")",
"==",
"list",
":",
"return",
"[",
"self",
".",
"anns",
"[",
"id",
"]",
"for",
"id",
"in",
"ids",
"]",
"elif",
"type",
"(",
"ids",
")",
"==",
... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/pycocotools/coco.py#L202-L211 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/function.py | python | class_method_to_instance_method | (original_function, instance) | return wrapped_instance_func | Constructs a new `Function` with `self` bound. | Constructs a new `Function` with `self` bound. | [
"Constructs",
"a",
"new",
"Function",
"with",
"self",
"bound",
"."
] | def class_method_to_instance_method(original_function, instance):
"""Constructs a new `Function` with `self` bound."""
weak_instance = weakref.ref(instance)
# Note: while we could bind to a weakref proxy instead, that causes the
# bound method to be unhashable.
bound_method = types_lib.MethodType(
orig... | [
"def",
"class_method_to_instance_method",
"(",
"original_function",
",",
"instance",
")",
":",
"weak_instance",
"=",
"weakref",
".",
"ref",
"(",
"instance",
")",
"# Note: while we could bind to a weakref proxy instead, that causes the",
"# bound method to be unhashable.",
"bound_... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/function.py#L3265-L3319 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exodus2.in.py | python | collectLocalNodeToLocalElems | (
exodusHandle,
connectivity,
localNodeToLocalElems) | This function generates a list of lists to go from local node id
to local elem id.
Usage:
exodusHandle = exodus("file.g", "r")
connectivity = [] ## If this is not empty it will assume it is already filled.
localNodeToLocalElems = []
collectLocalNodeToLocalElems(exodusHandle, connec... | This function generates a list of lists to go from local node id
to local elem id. | [
"This",
"function",
"generates",
"a",
"list",
"of",
"lists",
"to",
"go",
"from",
"local",
"node",
"id",
"to",
"local",
"elem",
"id",
"."
] | def collectLocalNodeToLocalElems(
exodusHandle,
connectivity,
localNodeToLocalElems):
"""
This function generates a list of lists to go from local node id
to local elem id.
Usage:
exodusHandle = exodus("file.g", "r")
connectivity = [] ## If this is not empty i... | [
"def",
"collectLocalNodeToLocalElems",
"(",
"exodusHandle",
",",
"connectivity",
",",
"localNodeToLocalElems",
")",
":",
"if",
"not",
"isinstance",
"(",
"connectivity",
",",
"list",
")",
":",
"raise",
"Exception",
"(",
"\"ERROR: connectivity is not a list in call to colle... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus2.in.py#L4752-L4790 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/command/sdist.py | python | sdist.get_file_list | (self) | Figure out the list of files to include in the source
distribution, and put it in 'self.filelist'. This might involve
reading the manifest template (and writing the manifest), or just
reading the manifest, or just using the default file set -- it all
depends on the user's options. | Figure out the list of files to include in the source
distribution, and put it in 'self.filelist'. This might involve
reading the manifest template (and writing the manifest), or just
reading the manifest, or just using the default file set -- it all
depends on the user's options. | [
"Figure",
"out",
"the",
"list",
"of",
"files",
"to",
"include",
"in",
"the",
"source",
"distribution",
"and",
"put",
"it",
"in",
"self",
".",
"filelist",
".",
"This",
"might",
"involve",
"reading",
"the",
"manifest",
"template",
"(",
"and",
"writing",
"the... | def get_file_list(self):
"""Figure out the list of files to include in the source
distribution, and put it in 'self.filelist'. This might involve
reading the manifest template (and writing the manifest), or just
reading the manifest, or just using the default file set -- it all
... | [
"def",
"get_file_list",
"(",
"self",
")",
":",
"# new behavior when using a template:",
"# the file list is recalculated every time because",
"# even if MANIFEST.in or setup.py are not changed",
"# the user might have added some files in the tree that",
"# need to be included.",
"#",
"# Thi... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/command/sdist.py#L170-L208 | ||
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/ops/__init__.py | python | reduce_prod | (x, axis=None, keepdims=True, name='') | return reduce_prod(x, axis, keepdims, name) | Computes the min of the input tensor's elements across the specified axis.
Example:
>>> # create 3x2x2 matrix in a sequence of length 1 in a batch of one sample
>>> data = np.array([[[5,1], [20,2]],[[30,1], [40,2]],[[55,1], [60,2]]], dtype=np.float32)
>>> C.reduce_prod(data, 0).eval().roun... | Computes the min of the input tensor's elements across the specified axis. | [
"Computes",
"the",
"min",
"of",
"the",
"input",
"tensor",
"s",
"elements",
"across",
"the",
"specified",
"axis",
"."
] | def reduce_prod(x, axis=None, keepdims=True, name=''):
'''
Computes the min of the input tensor's elements across the specified axis.
Example:
>>> # create 3x2x2 matrix in a sequence of length 1 in a batch of one sample
>>> data = np.array([[[5,1], [20,2]],[[30,1], [40,2]],[[55,1], [60,2]]]... | [
"def",
"reduce_prod",
"(",
"x",
",",
"axis",
"=",
"None",
",",
"keepdims",
"=",
"True",
",",
"name",
"=",
"''",
")",
":",
"from",
"cntk",
".",
"cntk_py",
"import",
"reduce_prod",
"x",
"=",
"sanitize_input",
"(",
"x",
")",
"axis",
"=",
"sanitize_multi_a... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/ops/__init__.py#L3194-L3234 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/distutils/core.py | python | setup | (**attrs) | return dist | The gateway to the Distutils: do everything your setup script needs
to do, in a highly flexible and user-driven way. Briefly: create a
Distribution instance; find and parse config files; parse the command
line; run each Distutils command found there, customized by the options
supplied to 'setup()' (as ... | The gateway to the Distutils: do everything your setup script needs
to do, in a highly flexible and user-driven way. Briefly: create a
Distribution instance; find and parse config files; parse the command
line; run each Distutils command found there, customized by the options
supplied to 'setup()' (as ... | [
"The",
"gateway",
"to",
"the",
"Distutils",
":",
"do",
"everything",
"your",
"setup",
"script",
"needs",
"to",
"do",
"in",
"a",
"highly",
"flexible",
"and",
"user",
"-",
"driven",
"way",
".",
"Briefly",
":",
"create",
"a",
"Distribution",
"instance",
";",
... | def setup (**attrs):
"""The gateway to the Distutils: do everything your setup script needs
to do, in a highly flexible and user-driven way. Briefly: create a
Distribution instance; find and parse config files; parse the command
line; run each Distutils command found there, customized by the options
... | [
"def",
"setup",
"(",
"*",
"*",
"attrs",
")",
":",
"global",
"_setup_stop_after",
",",
"_setup_distribution",
"# Determine the distribution class -- either caller-supplied or",
"# our Distribution (see below).",
"klass",
"=",
"attrs",
".",
"get",
"(",
"'distclass'",
")",
"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/distutils/core.py#L62-L171 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib.py | python | toBytes | (url) | return url | toBytes(u"URL") --> 'URL'. | toBytes(u"URL") --> 'URL'. | [
"toBytes",
"(",
"u",
"URL",
")",
"--",
">",
"URL",
"."
] | def toBytes(url):
"""toBytes(u"URL") --> 'URL'."""
# Most URL schemes require ASCII. If that changes, the conversion
# can be relaxed
if _is_unicode(url):
try:
url = url.encode("ASCII")
except UnicodeError:
raise UnicodeError("URL " + repr(url) +
... | [
"def",
"toBytes",
"(",
"url",
")",
":",
"# Most URL schemes require ASCII. If that changes, the conversion",
"# can be relaxed",
"if",
"_is_unicode",
"(",
"url",
")",
":",
"try",
":",
"url",
"=",
"url",
".",
"encode",
"(",
"\"ASCII\"",
")",
"except",
"UnicodeError",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib.py#L1043-L1053 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TCh.IsAlpha | (*args) | return _snap.TCh_IsAlpha(*args) | IsAlpha(char const & Ch) -> bool
Parameters:
Ch: char const & | IsAlpha(char const & Ch) -> bool | [
"IsAlpha",
"(",
"char",
"const",
"&",
"Ch",
")",
"-",
">",
"bool"
] | def IsAlpha(*args):
"""
IsAlpha(char const & Ch) -> bool
Parameters:
Ch: char const &
"""
return _snap.TCh_IsAlpha(*args) | [
"def",
"IsAlpha",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TCh_IsAlpha",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L12485-L12493 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | clang/bindings/python/clang/cindex.py | python | Cursor.get_template_argument_unsigned_value | (self, num) | return conf.lib.clang_Cursor_getTemplateArgumentUnsignedValue(self, num) | Returns the value of the indicated arg as an unsigned 64b integer. | Returns the value of the indicated arg as an unsigned 64b integer. | [
"Returns",
"the",
"value",
"of",
"the",
"indicated",
"arg",
"as",
"an",
"unsigned",
"64b",
"integer",
"."
] | def get_template_argument_unsigned_value(self, num):
"""Returns the value of the indicated arg as an unsigned 64b integer."""
return conf.lib.clang_Cursor_getTemplateArgumentUnsignedValue(self, num) | [
"def",
"get_template_argument_unsigned_value",
"(",
"self",
",",
"num",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_Cursor_getTemplateArgumentUnsignedValue",
"(",
"self",
",",
"num",
")"
] | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/bindings/python/clang/cindex.py#L1820-L1822 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/ObjectsFem.py | python | makeConstantVacuumPermittivity | (
doc,
name="ConstantVacuumPermittivity"
) | return obj | makeConstantVacuumPermittivity(document, [name]):
makes a Fem ConstantVacuumPermittivity object | makeConstantVacuumPermittivity(document, [name]):
makes a Fem ConstantVacuumPermittivity object | [
"makeConstantVacuumPermittivity",
"(",
"document",
"[",
"name",
"]",
")",
":",
"makes",
"a",
"Fem",
"ConstantVacuumPermittivity",
"object"
] | def makeConstantVacuumPermittivity(
doc,
name="ConstantVacuumPermittivity"
):
"""makeConstantVacuumPermittivity(document, [name]):
makes a Fem ConstantVacuumPermittivity object"""
obj = doc.addObject("Fem::ConstraintPython", name)
from femobjects import constant_vacuumpermittivity
constant_v... | [
"def",
"makeConstantVacuumPermittivity",
"(",
"doc",
",",
"name",
"=",
"\"ConstantVacuumPermittivity\"",
")",
":",
"obj",
"=",
"doc",
".",
"addObject",
"(",
"\"Fem::ConstraintPython\"",
",",
"name",
")",
"from",
"femobjects",
"import",
"constant_vacuumpermittivity",
"... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/ObjectsFem.py#L60-L72 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/ndlstm/python/lstm1d.py | python | ndlstm_base_dynamic | (inputs, noutput, scope=None, reverse=False) | Run an LSTM, either forward or backward.
This is a 1D LSTM implementation using dynamic_rnn and
the TensorFlow LSTM op.
Args:
inputs: input sequence (length, batch_size, ninput)
noutput: depth of output
scope: optional scope name
reverse: run LSTM in reverse
Returns:
Output sequence (leng... | Run an LSTM, either forward or backward. | [
"Run",
"an",
"LSTM",
"either",
"forward",
"or",
"backward",
"."
] | def ndlstm_base_dynamic(inputs, noutput, scope=None, reverse=False):
"""Run an LSTM, either forward or backward.
This is a 1D LSTM implementation using dynamic_rnn and
the TensorFlow LSTM op.
Args:
inputs: input sequence (length, batch_size, ninput)
noutput: depth of output
scope: optional scope n... | [
"def",
"ndlstm_base_dynamic",
"(",
"inputs",
",",
"noutput",
",",
"scope",
"=",
"None",
",",
"reverse",
"=",
"False",
")",
":",
"with",
"variable_scope",
".",
"variable_scope",
"(",
"scope",
",",
"\"SeqLstm\"",
",",
"[",
"inputs",
"]",
")",
":",
"# TODO(tm... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/ndlstm/python/lstm1d.py#L72-L102 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/tooltip.py | python | TooltipBase.showtip | (self) | display the tooltip | display the tooltip | [
"display",
"the",
"tooltip"
] | def showtip(self):
"""display the tooltip"""
if self.tipwindow:
return
self.tipwindow = tw = Toplevel(self.anchor_widget)
# show no border on the top level window
tw.wm_overrideredirect(1)
try:
# This command is only needed and available on Tk >= 8... | [
"def",
"showtip",
"(",
"self",
")",
":",
"if",
"self",
".",
"tipwindow",
":",
"return",
"self",
".",
"tipwindow",
"=",
"tw",
"=",
"Toplevel",
"(",
"self",
".",
"anchor_widget",
")",
"# show no border on the top level window",
"tw",
".",
"wm_overrideredirect",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/tooltip.py#L26-L45 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/make.py | python | EscapeShellArgument | (s) | return "'" + s.replace("'", "'\\''") + "'" | Quotes an argument so that it will be interpreted literally by a POSIX
shell. Taken from
http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python | Quotes an argument so that it will be interpreted literally by a POSIX
shell. Taken from
http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python | [
"Quotes",
"an",
"argument",
"so",
"that",
"it",
"will",
"be",
"interpreted",
"literally",
"by",
"a",
"POSIX",
"shell",
".",
"Taken",
"from",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"35817",
"/",
"whats",
"-",
"the",
"-",
... | def EscapeShellArgument(s):
"""Quotes an argument so that it will be interpreted literally by a POSIX
shell. Taken from
http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python
"""
return "'" + s.replace("'", "'\\''") + "'" | [
"def",
"EscapeShellArgument",
"(",
"s",
")",
":",
"return",
"\"'\"",
"+",
"s",
".",
"replace",
"(",
"\"'\"",
",",
"\"'\\\\''\"",
")",
"+",
"\"'\""
] | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/make.py#L627-L632 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.