nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/tools/ci_build/builds/check_system_libs.py | python | extract_system_builds | (filepath) | return lib_names, system_build_files | Extract the 'name' argument of all rules with a system_build_file argument. | Extract the 'name' argument of all rules with a system_build_file argument. | [
"Extract",
"the",
"name",
"argument",
"of",
"all",
"rules",
"with",
"a",
"system_build_file",
"argument",
"."
] | def extract_system_builds(filepath):
"""Extract the 'name' argument of all rules with a system_build_file argument."""
lib_names = []
system_build_files = []
current_name = None
with open(filepath, 'r') as f:
for line in f:
line = line.strip()
if line.startswith('name = '):
current_nam... | [
"def",
"extract_system_builds",
"(",
"filepath",
")",
":",
"lib_names",
"=",
"[",
"]",
"system_build_files",
"=",
"[",
"]",
"current_name",
"=",
"None",
"with",
"open",
"(",
"filepath",
",",
"'r'",
")",
"as",
"f",
":",
"for",
"line",
"in",
"f",
":",
"l... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/tools/ci_build/builds/check_system_libs.py#L56-L72 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/experimental/ops/readers.py | python | make_batched_features_dataset_v2 | (file_pattern,
batch_size,
features,
reader=core_readers.TFRecordDataset,
label_key=None,
reader_args=None,
... | return dataset | Returns a `Dataset` of feature dictionaries from `Example` protos.
If label_key argument is provided, returns a `Dataset` of tuple
comprising of feature dictionaries and label.
Example:
```
serialized_examples = [
features {
feature { key: "age" value { int64_list { value: [ 0 ] } } }
featu... | Returns a `Dataset` of feature dictionaries from `Example` protos. | [
"Returns",
"a",
"Dataset",
"of",
"feature",
"dictionaries",
"from",
"Example",
"protos",
"."
] | def make_batched_features_dataset_v2(file_pattern,
batch_size,
features,
reader=core_readers.TFRecordDataset,
label_key=None,
reader_ar... | [
"def",
"make_batched_features_dataset_v2",
"(",
"file_pattern",
",",
"batch_size",
",",
"features",
",",
"reader",
"=",
"core_readers",
".",
"TFRecordDataset",
",",
"label_key",
"=",
"None",
",",
"reader_args",
"=",
"None",
",",
"num_epochs",
"=",
"None",
",",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/experimental/ops/readers.py#L750-L922 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3num.py | python | Numeral.__mul__ | (self, other) | return Numeral(Z3_algebraic_mul(self.ctx_ref(), self.ast, _to_numeral(other, self.ctx).ast), self.ctx) | Return the numeral `self * other`.
>>> Numeral(2) * 3
6 | Return the numeral `self * other`.
>>> Numeral(2) * 3
6 | [
"Return",
"the",
"numeral",
"self",
"*",
"other",
".",
">>>",
"Numeral",
"(",
"2",
")",
"*",
"3",
"6"
] | def __mul__(self, other):
""" Return the numeral `self * other`.
>>> Numeral(2) * 3
6
"""
return Numeral(Z3_algebraic_mul(self.ctx_ref(), self.ast, _to_numeral(other, self.ctx).ast), self.ctx) | [
"def",
"__mul__",
"(",
"self",
",",
"other",
")",
":",
"return",
"Numeral",
"(",
"Z3_algebraic_mul",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
",",
"_to_numeral",
"(",
"other",
",",
"self",
".",
"ctx",
")",
".",
"ast",
")",
",... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3num.py#L328-L333 | |
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/Node.py | python | Node.make_node | (self, lst) | return cur | Returns or creates a Node object corresponding to the input path without considering the filesystem.
:param lst: relative path
:type lst: string or list of string
:rtype: :py:class:´waflib.Node.Node´ | Returns or creates a Node object corresponding to the input path without considering the filesystem. | [
"Returns",
"or",
"creates",
"a",
"Node",
"object",
"corresponding",
"to",
"the",
"input",
"path",
"without",
"considering",
"the",
"filesystem",
"."
] | def make_node(self, lst):
"""
Returns or creates a Node object corresponding to the input path without considering the filesystem.
:param lst: relative path
:type lst: string or list of string
:rtype: :py:class:´waflib.Node.Node´
"""
if isinstance(lst, str):
lst = [x for x in Utils.split_path(lst) if ... | [
"def",
"make_node",
"(",
"self",
",",
"lst",
")",
":",
"if",
"isinstance",
"(",
"lst",
",",
"str",
")",
":",
"lst",
"=",
"[",
"x",
"for",
"x",
"in",
"Utils",
".",
"split_path",
"(",
"lst",
")",
"if",
"x",
"and",
"x",
"!=",
"'.'",
"]",
"cur",
... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Node.py#L424-L450 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/util.py | python | change_root | (new_root, pathname) | Return 'pathname' with 'new_root' prepended. If 'pathname' is
relative, this is equivalent to "os.path.join(new_root,pathname)".
Otherwise, it requires making 'pathname' relative and then joining the
two, which is tricky on DOS/Windows and Mac OS. | Return 'pathname' with 'new_root' prepended. If 'pathname' is
relative, this is equivalent to "os.path.join(new_root,pathname)".
Otherwise, it requires making 'pathname' relative and then joining the
two, which is tricky on DOS/Windows and Mac OS. | [
"Return",
"pathname",
"with",
"new_root",
"prepended",
".",
"If",
"pathname",
"is",
"relative",
"this",
"is",
"equivalent",
"to",
"os",
".",
"path",
".",
"join",
"(",
"new_root",
"pathname",
")",
".",
"Otherwise",
"it",
"requires",
"making",
"pathname",
"rel... | def change_root (new_root, pathname):
"""Return 'pathname' with 'new_root' prepended. If 'pathname' is
relative, this is equivalent to "os.path.join(new_root,pathname)".
Otherwise, it requires making 'pathname' relative and then joining the
two, which is tricky on DOS/Windows and Mac OS.
"""
if... | [
"def",
"change_root",
"(",
"new_root",
",",
"pathname",
")",
":",
"if",
"os",
".",
"name",
"==",
"'posix'",
":",
"if",
"not",
"os",
".",
"path",
".",
"isabs",
"(",
"pathname",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"new_root",
","... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/util.py#L138-L164 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/integrate/_bvp.py | python | estimate_bc_jac | (bc, ya, yb, p, bc0=None) | return dbc_dya, dbc_dyb, dbc_dp | Estimate derivatives of boundary conditions with forward differences.
Returns
-------
dbc_dya : ndarray, shape (n + k, n)
Derivatives with respect to ya. An element (i, j) corresponds to
d bc_i / d ya_j.
dbc_dyb : ndarray, shape (n + k, n)
Derivatives with respect to yb. An elem... | Estimate derivatives of boundary conditions with forward differences. | [
"Estimate",
"derivatives",
"of",
"boundary",
"conditions",
"with",
"forward",
"differences",
"."
] | def estimate_bc_jac(bc, ya, yb, p, bc0=None):
"""Estimate derivatives of boundary conditions with forward differences.
Returns
-------
dbc_dya : ndarray, shape (n + k, n)
Derivatives with respect to ya. An element (i, j) corresponds to
d bc_i / d ya_j.
dbc_dyb : ndarray, shape (n + ... | [
"def",
"estimate_bc_jac",
"(",
"bc",
",",
"ya",
",",
"yb",
",",
"p",
",",
"bc0",
"=",
"None",
")",
":",
"n",
"=",
"ya",
".",
"shape",
"[",
"0",
"]",
"k",
"=",
"p",
".",
"shape",
"[",
"0",
"]",
"if",
"bc0",
"is",
"None",
":",
"bc0",
"=",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/integrate/_bvp.py#L60-L116 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HelpControllerBase.DisplayBlock | (*args, **kwargs) | return _html.HelpControllerBase_DisplayBlock(*args, **kwargs) | DisplayBlock(self, long blockNo) -> bool | DisplayBlock(self, long blockNo) -> bool | [
"DisplayBlock",
"(",
"self",
"long",
"blockNo",
")",
"-",
">",
"bool"
] | def DisplayBlock(*args, **kwargs):
"""DisplayBlock(self, long blockNo) -> bool"""
return _html.HelpControllerBase_DisplayBlock(*args, **kwargs) | [
"def",
"DisplayBlock",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HelpControllerBase_DisplayBlock",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L1895-L1897 | |
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/service_reflection.py | python | _ServiceStubBuilder.BuildServiceStub | (self, cls) | Constructs the stub class.
Args:
cls: The class that will be constructed. | Constructs the stub class. | [
"Constructs",
"the",
"stub",
"class",
"."
] | def BuildServiceStub(self, cls):
"""Constructs the stub class.
Args:
cls: The class that will be constructed.
"""
def _ServiceStubInit(stub, rpc_channel):
stub.rpc_channel = rpc_channel
self.cls = cls
cls.__init__ = _ServiceStubInit
for method in self.descriptor.methods:
... | [
"def",
"BuildServiceStub",
"(",
"self",
",",
"cls",
")",
":",
"def",
"_ServiceStubInit",
"(",
"stub",
",",
"rpc_channel",
")",
":",
"stub",
".",
"rpc_channel",
"=",
"rpc_channel",
"self",
".",
"cls",
"=",
"cls",
"cls",
".",
"__init__",
"=",
"_ServiceStubIn... | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/service_reflection.py#L251-L263 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/handler.py | python | ContentHandler.processingInstruction | (self, target, data) | Receive notification of a processing instruction.
The Parser will invoke this method once for each processing
instruction found: note that processing instructions may occur
before or after the main document element.
A SAX parser should never report an XML declaration (XML 1.0,
... | Receive notification of a processing instruction. | [
"Receive",
"notification",
"of",
"a",
"processing",
"instruction",
"."
] | def processingInstruction(self, target, data):
"""Receive notification of a processing instruction.
The Parser will invoke this method once for each processing
instruction found: note that processing instructions may occur
before or after the main document element.
A SAX parser... | [
"def",
"processingInstruction",
"(",
"self",
",",
"target",
",",
"data",
")",
":"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/handler.py#L182-L191 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/jedi/jedi/evaluate/compiled/subprocess/functions.py | python | _test_raise_error | (evaluator, exception_type) | Raise an error to simulate certain problems for unit tests. | Raise an error to simulate certain problems for unit tests. | [
"Raise",
"an",
"error",
"to",
"simulate",
"certain",
"problems",
"for",
"unit",
"tests",
"."
] | def _test_raise_error(evaluator, exception_type):
"""
Raise an error to simulate certain problems for unit tests.
"""
raise exception_type | [
"def",
"_test_raise_error",
"(",
"evaluator",
",",
"exception_type",
")",
":",
"raise",
"exception_type"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/evaluate/compiled/subprocess/functions.py#L81-L85 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/linalg/_solvers.py | python | solve_sylvester | (a, b, q) | return np.dot(np.dot(u, y), v.conj().transpose()) | Computes a solution (X) to the Sylvester equation :math:`AX + XB = Q`.
Parameters
----------
a : (M, M) array_like
Leading matrix of the Sylvester equation
b : (N, N) array_like
Trailing matrix of the Sylvester equation
q : (M, N) array_like
Right-hand side
Returns
... | Computes a solution (X) to the Sylvester equation :math:`AX + XB = Q`. | [
"Computes",
"a",
"solution",
"(",
"X",
")",
"to",
"the",
"Sylvester",
"equation",
":",
"math",
":",
"AX",
"+",
"XB",
"=",
"Q",
"."
] | def solve_sylvester(a, b, q):
"""
Computes a solution (X) to the Sylvester equation :math:`AX + XB = Q`.
Parameters
----------
a : (M, M) array_like
Leading matrix of the Sylvester equation
b : (N, N) array_like
Trailing matrix of the Sylvester equation
q : (M, N) array_like... | [
"def",
"solve_sylvester",
"(",
"a",
",",
"b",
",",
"q",
")",
":",
"# Compute the Schur decomp form of a",
"r",
",",
"u",
"=",
"schur",
"(",
"a",
",",
"output",
"=",
"'real'",
")",
"# Compute the Schur decomp of b",
"s",
",",
"v",
"=",
"schur",
"(",
"b",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/_solvers.py#L32-L107 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/difflib.py | python | SequenceMatcher.set_seq1 | (self, a) | Set the first sequence to be compared.
The second sequence to be compared is not changed.
>>> s = SequenceMatcher(None, "abcd", "bcde")
>>> s.ratio()
0.75
>>> s.set_seq1("bcde")
>>> s.ratio()
1.0
>>>
SequenceMatcher computes and caches detailed ... | Set the first sequence to be compared. | [
"Set",
"the",
"first",
"sequence",
"to",
"be",
"compared",
"."
] | def set_seq1(self, a):
"""Set the first sequence to be compared.
The second sequence to be compared is not changed.
>>> s = SequenceMatcher(None, "abcd", "bcde")
>>> s.ratio()
0.75
>>> s.set_seq1("bcde")
>>> s.ratio()
1.0
>>>
SequenceMat... | [
"def",
"set_seq1",
"(",
"self",
",",
"a",
")",
":",
"if",
"a",
"is",
"self",
".",
"a",
":",
"return",
"self",
".",
"a",
"=",
"a",
"self",
".",
"matching_blocks",
"=",
"self",
".",
"opcodes",
"=",
"None"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/difflib.py#L227-L251 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py | python | factorize_from_iterable | (values) | return codes, categories | Factorize an input `values` into `categories` and `codes`. Preserves
categorical dtype in `categories`.
*This is an internal function*
Parameters
----------
values : list-like
Returns
-------
codes : ndarray
categories : Index
If `values` has a categorical dtype, then `cat... | Factorize an input `values` into `categories` and `codes`. Preserves
categorical dtype in `categories`. | [
"Factorize",
"an",
"input",
"values",
"into",
"categories",
"and",
"codes",
".",
"Preserves",
"categorical",
"dtype",
"in",
"categories",
"."
] | def factorize_from_iterable(values):
"""
Factorize an input `values` into `categories` and `codes`. Preserves
categorical dtype in `categories`.
*This is an internal function*
Parameters
----------
values : list-like
Returns
-------
codes : ndarray
categories : Index
... | [
"def",
"factorize_from_iterable",
"(",
"values",
")",
":",
"if",
"not",
"is_list_like",
"(",
"values",
")",
":",
"raise",
"TypeError",
"(",
"\"Input must be list-like\"",
")",
"if",
"is_categorical_dtype",
"(",
"values",
")",
":",
"values",
"=",
"extract_array",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py#L2648-L2683 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | SampleTransform | (*args) | return _robotsim.SampleTransform(*args) | SampleTransform(IKObjective obj)
SampleTransform(GeneralizedIKObjective obj)
Returns a transformation (R,t) from link relative to link2, sampled at random
from the space of transforms that satisfies the objective obj. | SampleTransform(IKObjective obj)
SampleTransform(GeneralizedIKObjective obj) | [
"SampleTransform",
"(",
"IKObjective",
"obj",
")",
"SampleTransform",
"(",
"GeneralizedIKObjective",
"obj",
")"
] | def SampleTransform(*args):
"""
SampleTransform(IKObjective obj)
SampleTransform(GeneralizedIKObjective obj)
Returns a transformation (R,t) from link relative to link2, sampled at random
from the space of transforms that satisfies the objective obj.
"""
return _robotsim.SampleTransform... | [
"def",
"SampleTransform",
"(",
"*",
"args",
")",
":",
"return",
"_robotsim",
".",
"SampleTransform",
"(",
"*",
"args",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L7127-L7138 | |
chatopera/clause | dee31153d5ffdef33deedb6bff03e7806c296968 | var/assets/clients/gen-py/clause/Serving.py | python | Iface.getDictWords | (self, request) | Parameters:
- request | Parameters:
- request | [
"Parameters",
":",
"-",
"request"
] | def getDictWords(self, request):
"""
Parameters:
- request
"""
pass | [
"def",
"getDictWords",
"(",
"self",
",",
"request",
")",
":",
"pass"
] | https://github.com/chatopera/clause/blob/dee31153d5ffdef33deedb6bff03e7806c296968/var/assets/clients/gen-py/clause/Serving.py#L140-L146 | ||
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/config/ccsession.py | python | ModuleCCSession.check_command_without_recvmsg | (self, msg, env) | Parse the given message to see if there is a command or a
configuration update. Calls the corresponding handler
functions if present. Responds on the channel if the
handler returns a message. | Parse the given message to see if there is a command or a
configuration update. Calls the corresponding handler
functions if present. Responds on the channel if the
handler returns a message. | [
"Parse",
"the",
"given",
"message",
"to",
"see",
"if",
"there",
"is",
"a",
"command",
"or",
"a",
"configuration",
"update",
".",
"Calls",
"the",
"corresponding",
"handler",
"functions",
"if",
"present",
".",
"Responds",
"on",
"the",
"channel",
"if",
"the",
... | def check_command_without_recvmsg(self, msg, env):
"""Parse the given message to see if there is a command or a
configuration update. Calls the corresponding handler
functions if present. Responds on the channel if the
handler returns a message."""
if msg is None:
... | [
"def",
"check_command_without_recvmsg",
"(",
"self",
",",
"msg",
",",
"env",
")",
":",
"if",
"msg",
"is",
"None",
":",
"return",
"if",
"CC_PAYLOAD_NOTIFICATION",
"in",
"msg",
":",
"group_s",
"=",
"env",
"[",
"CC_HEADER_GROUP",
"]",
".",
"split",
"(",
"'/'"... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/config/ccsession.py#L295-L366 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py | python | ProcessTableWidget.set_k_shift_index | (self, row_number, k_index) | return | Set k-shift index to a row
:param row_number:
:param k_index:
:return: | Set k-shift index to a row
:param row_number:
:param k_index:
:return: | [
"Set",
"k",
"-",
"shift",
"index",
"to",
"a",
"row",
":",
"param",
"row_number",
":",
":",
"param",
"k_index",
":",
":",
"return",
":"
] | def set_k_shift_index(self, row_number, k_index):
""" Set k-shift index to a row
:param row_number:
:param k_index:
:return:
"""
assert isinstance(k_index, int)
self.update_cell_value(row_number, self._colIndexKIndex, k_index)
return | [
"def",
"set_k_shift_index",
"(",
"self",
",",
"row_number",
",",
"k_index",
")",
":",
"assert",
"isinstance",
"(",
"k_index",
",",
"int",
")",
"self",
".",
"update_cell_value",
"(",
"row_number",
",",
"self",
".",
"_colIndexKIndex",
",",
"k_index",
")",
"ret... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py#L954-L964 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/integrate/quadpack.py | python | quad | (func, a, b, args=(), full_output=0, epsabs=1.49e-8, epsrel=1.49e-8,
limit=50, points=None, weight=None, wvar=None, wopts=None, maxp1=50,
limlst=50) | Compute a definite integral.
Integrate func from `a` to `b` (possibly infinite interval) using a
technique from the Fortran library QUADPACK.
Parameters
----------
func : {function, scipy.LowLevelCallable}
A Python function or method to integrate. If `func` takes many
arguments, i... | Compute a definite integral. | [
"Compute",
"a",
"definite",
"integral",
"."
] | def quad(func, a, b, args=(), full_output=0, epsabs=1.49e-8, epsrel=1.49e-8,
limit=50, points=None, weight=None, wvar=None, wopts=None, maxp1=50,
limlst=50):
"""
Compute a definite integral.
Integrate func from `a` to `b` (possibly infinite interval) using a
technique from the Fortran... | [
"def",
"quad",
"(",
"func",
",",
"a",
",",
"b",
",",
"args",
"=",
"(",
")",
",",
"full_output",
"=",
"0",
",",
"epsabs",
"=",
"1.49e-8",
",",
"epsrel",
"=",
"1.49e-8",
",",
"limit",
"=",
"50",
",",
"points",
"=",
"None",
",",
"weight",
"=",
"No... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/integrate/quadpack.py#L44-L427 | ||
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | llvm/utils/benchmark/tools/gbench/util.py | python | check_input_file | (filename) | return ftype | Classify the file named by 'filename' and return the classification.
If the file is classified as 'IT_Invalid' print an error message and exit
the program. | Classify the file named by 'filename' and return the classification.
If the file is classified as 'IT_Invalid' print an error message and exit
the program. | [
"Classify",
"the",
"file",
"named",
"by",
"filename",
"and",
"return",
"the",
"classification",
".",
"If",
"the",
"file",
"is",
"classified",
"as",
"IT_Invalid",
"print",
"an",
"error",
"message",
"and",
"exit",
"the",
"program",
"."
] | def check_input_file(filename):
"""
Classify the file named by 'filename' and return the classification.
If the file is classified as 'IT_Invalid' print an error message and exit
the program.
"""
ftype, msg = classify_input_file(filename)
if ftype == IT_Invalid:
print("Invalid input ... | [
"def",
"check_input_file",
"(",
"filename",
")",
":",
"ftype",
",",
"msg",
"=",
"classify_input_file",
"(",
"filename",
")",
"if",
"ftype",
"==",
"IT_Invalid",
":",
"print",
"(",
"\"Invalid input file: %s\"",
"%",
"msg",
")",
"sys",
".",
"exit",
"(",
"1",
... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/llvm/utils/benchmark/tools/gbench/util.py#L75-L85 | |
alibaba/MNN | c4d9566171d589c3ded23aa18ffb197016995a12 | 3rd_party/flatbuffers/conanfile.py | python | FlatbuffersConan.configure_cmake | (self) | return cmake | Create CMake instance and execute configure step | Create CMake instance and execute configure step | [
"Create",
"CMake",
"instance",
"and",
"execute",
"configure",
"step"
] | def configure_cmake(self):
"""Create CMake instance and execute configure step
"""
cmake = CMake(self)
cmake.definitions["FLATBUFFERS_BUILD_TESTS"] = False
cmake.definitions["FLATBUFFERS_BUILD_SHAREDLIB"] = self.options.shared
cmake.definitions["FLATBUFFERS_BUILD_FLATLIB"... | [
"def",
"configure_cmake",
"(",
"self",
")",
":",
"cmake",
"=",
"CMake",
"(",
"self",
")",
"cmake",
".",
"definitions",
"[",
"\"FLATBUFFERS_BUILD_TESTS\"",
"]",
"=",
"False",
"cmake",
".",
"definitions",
"[",
"\"FLATBUFFERS_BUILD_SHAREDLIB\"",
"]",
"=",
"self",
... | https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/3rd_party/flatbuffers/conanfile.py#L38-L46 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | samples/culling/portal_culling.py | python | Game.toggle_xray_mode | (self) | Toggle X-ray mode on and off. This is useful for seeing the
effectiveness of the portal culling. | Toggle X-ray mode on and off. This is useful for seeing the
effectiveness of the portal culling. | [
"Toggle",
"X",
"-",
"ray",
"mode",
"on",
"and",
"off",
".",
"This",
"is",
"useful",
"for",
"seeing",
"the",
"effectiveness",
"of",
"the",
"portal",
"culling",
"."
] | def toggle_xray_mode(self):
"""Toggle X-ray mode on and off. This is useful for seeing the
effectiveness of the portal culling."""
self.xray_mode = not self.xray_mode
if self.xray_mode:
self.level_model.setColorScale((1, 1, 1, 0.5))
self.level_model.setTransparenc... | [
"def",
"toggle_xray_mode",
"(",
"self",
")",
":",
"self",
".",
"xray_mode",
"=",
"not",
"self",
".",
"xray_mode",
"if",
"self",
".",
"xray_mode",
":",
"self",
".",
"level_model",
".",
"setColorScale",
"(",
"(",
"1",
",",
"1",
",",
"1",
",",
"0.5",
")... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/culling/portal_culling.py#L151-L160 | ||
zerotier/libzt | 41eb9aebc80a5f1c816fa26a06cefde9de906676 | src/bindings/python/sockets.py | python | socket.makefile | (mode="r", buffering=None, *, encoding=None, errors=None, newline=None) | libzt does not support this (yet) | libzt does not support this (yet) | [
"libzt",
"does",
"not",
"support",
"this",
"(",
"yet",
")"
] | def makefile(mode="r", buffering=None, *, encoding=None, errors=None, newline=None):
"""libzt does not support this (yet)"""
raise NotImplementedError("libzt does not support this (yet?)") | [
"def",
"makefile",
"(",
"mode",
"=",
"\"r\"",
",",
"buffering",
"=",
"None",
",",
"*",
",",
"encoding",
"=",
"None",
",",
"errors",
"=",
"None",
",",
"newline",
"=",
"None",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"libzt does not support this (yet?)... | https://github.com/zerotier/libzt/blob/41eb9aebc80a5f1c816fa26a06cefde9de906676/src/bindings/python/sockets.py#L328-L330 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/smtplib.py | python | SMTP.ehlo_or_helo_if_needed | (self) | Call self.ehlo() and/or self.helo() if needed.
If there has been no previous EHLO or HELO command this session, this
method tries ESMTP EHLO first.
This method may raise the following exceptions:
SMTPHeloError The server didn't reply properly to
... | Call self.ehlo() and/or self.helo() if needed. | [
"Call",
"self",
".",
"ehlo",
"()",
"and",
"/",
"or",
"self",
".",
"helo",
"()",
"if",
"needed",
"."
] | def ehlo_or_helo_if_needed(self):
"""Call self.ehlo() and/or self.helo() if needed.
If there has been no previous EHLO or HELO command this session, this
method tries ESMTP EHLO first.
This method may raise the following exceptions:
SMTPHeloError The server didn't ... | [
"def",
"ehlo_or_helo_if_needed",
"(",
"self",
")",
":",
"if",
"self",
".",
"helo_resp",
"is",
"None",
"and",
"self",
".",
"ehlo_resp",
"is",
"None",
":",
"if",
"not",
"(",
"200",
"<=",
"self",
".",
"ehlo",
"(",
")",
"[",
"0",
"]",
"<=",
"299",
")",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/smtplib.py#L522-L537 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html.py | python | HtmlCell.GetPosY | (*args, **kwargs) | return _html.HtmlCell_GetPosY(*args, **kwargs) | GetPosY(self) -> int | GetPosY(self) -> int | [
"GetPosY",
"(",
"self",
")",
"-",
">",
"int"
] | def GetPosY(*args, **kwargs):
"""GetPosY(self) -> int"""
return _html.HtmlCell_GetPosY(*args, **kwargs) | [
"def",
"GetPosY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlCell_GetPosY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L614-L616 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | Widget.wantsRedraw | (self) | return _robotsim.Widget_wantsRedraw(self) | r""" | r""" | [
"r"
] | def wantsRedraw(self) ->bool:
r"""
"""
return _robotsim.Widget_wantsRedraw(self) | [
"def",
"wantsRedraw",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"_robotsim",
".",
"Widget_wantsRedraw",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L3360-L3363 | |
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/mox.py | python | Mox.CreateMock | (self, class_to_mock) | return new_mock | Create a new mock object.
Args:
# class_to_mock: the class to be mocked
class_to_mock: class
Returns:
MockObject that can be used as the class_to_mock would be. | Create a new mock object. | [
"Create",
"a",
"new",
"mock",
"object",
"."
] | def CreateMock(self, class_to_mock):
"""Create a new mock object.
Args:
# class_to_mock: the class to be mocked
class_to_mock: class
Returns:
MockObject that can be used as the class_to_mock would be.
"""
new_mock = MockObject(class_to_mock)
self._mock_objects.append(new_moc... | [
"def",
"CreateMock",
"(",
"self",
",",
"class_to_mock",
")",
":",
"new_mock",
"=",
"MockObject",
"(",
"class_to_mock",
")",
"self",
".",
"_mock_objects",
".",
"append",
"(",
"new_mock",
")",
"return",
"new_mock"
] | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/mox.py#L164-L177 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py | python | Session.merge_environment_settings | (self, url, proxies, stream, verify, cert) | return {'verify': verify, 'proxies': proxies, 'stream': stream,
'cert': cert} | Check the environment and merge it with some settings.
:rtype: dict | Check the environment and merge it with some settings. | [
"Check",
"the",
"environment",
"and",
"merge",
"it",
"with",
"some",
"settings",
"."
] | def merge_environment_settings(self, url, proxies, stream, verify, cert):
"""
Check the environment and merge it with some settings.
:rtype: dict
"""
# Gather clues from the surrounding environment.
if self.trust_env:
# Set environment's proxies.
... | [
"def",
"merge_environment_settings",
"(",
"self",
",",
"url",
",",
"proxies",
",",
"stream",
",",
"verify",
",",
"cert",
")",
":",
"# Gather clues from the surrounding environment.",
"if",
"self",
".",
"trust_env",
":",
"# Set environment's proxies.",
"no_proxy",
"=",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py#L687-L714 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/pot/openvino/tools/pot/utils/launcher.py | python | IELauncher.set_model | (self, model, output_names=None, md_shapes=None) | Set/reset model to instance of engine class
:param model: CompressedModel instance for inference | Set/reset model to instance of engine class
:param model: CompressedModel instance for inference | [
"Set",
"/",
"reset",
"model",
"to",
"instance",
"of",
"engine",
"class",
":",
"param",
"model",
":",
"CompressedModel",
"instance",
"for",
"inference"
] | def set_model(self, model, output_names=None, md_shapes=None):
""" Set/reset model to instance of engine class
:param model: CompressedModel instance for inference
"""
if model.is_cascade:
raise Exception('Cascade models are not supported in current launcher')
# sav... | [
"def",
"set_model",
"(",
"self",
",",
"model",
",",
"output_names",
"=",
"None",
",",
"md_shapes",
"=",
"None",
")",
":",
"if",
"model",
".",
"is_cascade",
":",
"raise",
"Exception",
"(",
"'Cascade models are not supported in current launcher'",
")",
"# save model... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/pot/openvino/tools/pot/utils/launcher.py#L27-L53 | ||
ucb-bar/esp-llvm | 8aec2ae754fd66d4e73b9b777a9f20c4583a0f03 | examples/Kaleidoscope/MCJIT/lazy/genk-timing.py | python | KScriptGenerator.updateFunctionCallMap | (self, caller, callee) | Maintains a map of functions that are called from other functions | Maintains a map of functions that are called from other functions | [
"Maintains",
"a",
"map",
"of",
"functions",
"that",
"are",
"called",
"from",
"other",
"functions"
] | def updateFunctionCallMap(self, caller, callee):
"""Maintains a map of functions that are called from other functions"""
if not caller in self.calledFunctionTable:
self.calledFunctionTable[caller] = []
if not callee in self.calledFunctionTable[caller]:
self.calledFunction... | [
"def",
"updateFunctionCallMap",
"(",
"self",
",",
"caller",
",",
"callee",
")",
":",
"if",
"not",
"caller",
"in",
"self",
".",
"calledFunctionTable",
":",
"self",
".",
"calledFunctionTable",
"[",
"caller",
"]",
"=",
"[",
"]",
"if",
"not",
"callee",
"in",
... | https://github.com/ucb-bar/esp-llvm/blob/8aec2ae754fd66d4e73b9b777a9f20c4583a0f03/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py#L56-L64 | ||
jiangxiluning/FOTS.PyTorch | b1851c170b4f1ad18406766352cb5171648ce603 | FOTS/model/modules/roi_rotate.py | python | ROIRotate.__init__ | (self, height=8) | :param height: heigth of feature map after affine transformation | [] | def __init__(self, height=8):
'''
:param height: heigth of feature map after affine transformation
'''
super().__init__()
self.height = height | [
"def",
"__init__",
"(",
"self",
",",
"height",
"=",
"8",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
")",
"self",
".",
"height",
"=",
"height"
] | https://github.com/jiangxiluning/FOTS.PyTorch/blob/b1851c170b4f1ad18406766352cb5171648ce603/FOTS/model/modules/roi_rotate.py#L11-L18 | |||
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/mox.py | python | MockObject.__eq__ | (self, rhs) | return (isinstance(rhs, MockObject) and
self._class_to_mock == rhs._class_to_mock and
self._replay_mode == rhs._replay_mode and
self._expected_calls_queue == rhs._expected_calls_queue) | Provide custom logic to compare objects. | Provide custom logic to compare objects. | [
"Provide",
"custom",
"logic",
"to",
"compare",
"objects",
"."
] | def __eq__(self, rhs):
"""Provide custom logic to compare objects."""
return (isinstance(rhs, MockObject) and
self._class_to_mock == rhs._class_to_mock and
self._replay_mode == rhs._replay_mode and
self._expected_calls_queue == rhs._expected_calls_queue) | [
"def",
"__eq__",
"(",
"self",
",",
"rhs",
")",
":",
"return",
"(",
"isinstance",
"(",
"rhs",
",",
"MockObject",
")",
"and",
"self",
".",
"_class_to_mock",
"==",
"rhs",
".",
"_class_to_mock",
"and",
"self",
".",
"_replay_mode",
"==",
"rhs",
".",
"_replay_... | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/mox.py#L419-L425 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/joblib/joblib/_deprecated_format_stack.py | python | uniq_stable | (elems) | return unique | uniq_stable(elems) -> list
Return from an iterable, a list of all the unique elements in the input,
but maintaining the order in which they first appear.
A naive solution to this problem which just makes a dictionary with the
elements as keys fails to respect the stability condition, since
diction... | uniq_stable(elems) -> list | [
"uniq_stable",
"(",
"elems",
")",
"-",
">",
"list"
] | def uniq_stable(elems):
"""uniq_stable(elems) -> list
Return from an iterable, a list of all the unique elements in the input,
but maintaining the order in which they first appear.
A naive solution to this problem which just makes a dictionary with the
elements as keys fails to respect the stabili... | [
"def",
"uniq_stable",
"(",
"elems",
")",
":",
"unique",
"=",
"[",
"]",
"unique_set",
"=",
"set",
"(",
")",
"for",
"nn",
"in",
"elems",
":",
"if",
"nn",
"not",
"in",
"unique_set",
":",
"unique",
".",
"append",
"(",
"nn",
")",
"unique_set",
".",
"add... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/_deprecated_format_stack.py#L72-L90 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py | python | MaskedArray.__str__ | (self) | return str(res) | String representation. | String representation. | [
"String",
"representation",
"."
] | def __str__(self):
"""String representation.
"""
if masked_print_option.enabled():
f = masked_print_option
if self is masked:
return str(f)
m = self._mask
if m is nomask:
res = self._data
else:
... | [
"def",
"__str__",
"(",
"self",
")",
":",
"if",
"masked_print_option",
".",
"enabled",
"(",
")",
":",
"f",
"=",
"masked_print_option",
"if",
"self",
"is",
"masked",
":",
"return",
"str",
"(",
"f",
")",
"m",
"=",
"self",
".",
"_mask",
"if",
"m",
"is",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L3567-L3603 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/engine/compile_utils.py | python | get_custom_object_name | (obj) | Returns the name to use for a custom loss or metric callable.
Args:
obj: Custom loss of metric callable
Returns:
Name to use, or `None` if the object was not recognized. | Returns the name to use for a custom loss or metric callable. | [
"Returns",
"the",
"name",
"to",
"use",
"for",
"a",
"custom",
"loss",
"or",
"metric",
"callable",
"."
] | def get_custom_object_name(obj):
"""Returns the name to use for a custom loss or metric callable.
Args:
obj: Custom loss of metric callable
Returns:
Name to use, or `None` if the object was not recognized.
"""
if hasattr(obj, 'name'): # Accept `Loss` instance as `Metric`.
return obj.name
elif... | [
"def",
"get_custom_object_name",
"(",
"obj",
")",
":",
"if",
"hasattr",
"(",
"obj",
",",
"'name'",
")",
":",
"# Accept `Loss` instance as `Metric`.",
"return",
"obj",
".",
"name",
"elif",
"hasattr",
"(",
"obj",
",",
"'__name__'",
")",
":",
"# Function.",
"retu... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/compile_utils.py#L710-L726 | ||
CanalTP/navitia | cb84ce9859070187e708818b058e6a7e0b7f891b | source/jormungandr/jormungandr/utils.py | python | date_to_timestamp | (date) | return int(calendar.timegm(date.utctimetuple())) | convert a datetime objet to a posix timestamp (number of seconds from 1970/1/1) | convert a datetime objet to a posix timestamp (number of seconds from 1970/1/1) | [
"convert",
"a",
"datetime",
"objet",
"to",
"a",
"posix",
"timestamp",
"(",
"number",
"of",
"seconds",
"from",
"1970",
"/",
"1",
"/",
"1",
")"
] | def date_to_timestamp(date):
"""
convert a datetime objet to a posix timestamp (number of seconds from 1970/1/1)
"""
return int(calendar.timegm(date.utctimetuple())) | [
"def",
"date_to_timestamp",
"(",
"date",
")",
":",
"return",
"int",
"(",
"calendar",
".",
"timegm",
"(",
"date",
".",
"utctimetuple",
"(",
")",
")",
")"
] | https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/jormungandr/jormungandr/utils.py#L149-L153 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/elastic/rendezvous/etcd_rendezvous_backend.py | python | EtcdRendezvousBackend.set_state | (
self, state: bytes, token: Optional[Token] = None
) | return tmp | See base class. | See base class. | [
"See",
"base",
"class",
"."
] | def set_state(
self, state: bytes, token: Optional[Token] = None
) -> Optional[Tuple[bytes, Token, bool]]:
"""See base class."""
base64_state = b64encode(state).decode()
kwargs = {}
def get_state():
result = self.get_state()
if result is not None:
... | [
"def",
"set_state",
"(",
"self",
",",
"state",
":",
"bytes",
",",
"token",
":",
"Optional",
"[",
"Token",
"]",
"=",
"None",
")",
"->",
"Optional",
"[",
"Tuple",
"[",
"bytes",
",",
"Token",
",",
"bool",
"]",
"]",
":",
"base64_state",
"=",
"b64encode",... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/elastic/rendezvous/etcd_rendezvous_backend.py#L88-L129 | |
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Conv.py | python | TransposedConv.free_term | (self) | return Blob.Blob(self._internal.get_free_term()) | Gets the free term. The blob size is filter_count. | Gets the free term. The blob size is filter_count. | [
"Gets",
"the",
"free",
"term",
".",
"The",
"blob",
"size",
"is",
"filter_count",
"."
] | def free_term(self):
"""Gets the free term. The blob size is filter_count.
"""
return Blob.Blob(self._internal.get_free_term()) | [
"def",
"free_term",
"(",
"self",
")",
":",
"return",
"Blob",
".",
"Blob",
"(",
"self",
".",
"_internal",
".",
"get_free_term",
"(",
")",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Conv.py#L785-L788 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/importers/CNTK/lib/cntk_layers.py | python | BaseLayer.process | (self, ellLayers) | Appends the ELL equivalent of the current layer to ellLayers.
Derived classes must override this. | Appends the ELL equivalent of the current layer to ellLayers.
Derived classes must override this. | [
"Appends",
"the",
"ELL",
"equivalent",
"of",
"the",
"current",
"layer",
"to",
"ellLayers",
".",
"Derived",
"classes",
"must",
"override",
"this",
"."
] | def process(self, ellLayers):
"""Appends the ELL equivalent of the current layer to ellLayers.
Derived classes must override this.
"""
raise NotImplementedError(
"Error: subclasses must override this method") | [
"def",
"process",
"(",
"self",
",",
"ellLayers",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"Error: subclasses must override this method\"",
")"
] | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/CNTK/lib/cntk_layers.py#L80-L86 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/packaging/specifiers.py | python | BaseSpecifier.__ne__ | (self, other) | Returns a boolean representing whether or not the two Specifier like
objects are not equal. | Returns a boolean representing whether or not the two Specifier like
objects are not equal. | [
"Returns",
"a",
"boolean",
"representing",
"whether",
"or",
"not",
"the",
"two",
"Specifier",
"like",
"objects",
"are",
"not",
"equal",
"."
] | def __ne__(self, other):
"""
Returns a boolean representing whether or not the two Specifier like
objects are not equal.
""" | [
"def",
"__ne__",
"(",
"self",
",",
"other",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/packaging/specifiers.py#L43-L47 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/transforms.py | python | loop_lifting | (func_ir, typingctx, targetctx, flags, locals) | return main, loops | Loop lifting transformation.
Given a interpreter `func_ir` returns a 2 tuple of
`(toplevel_interp, [loop0_interp, loop1_interp, ....])` | Loop lifting transformation. | [
"Loop",
"lifting",
"transformation",
"."
] | def loop_lifting(func_ir, typingctx, targetctx, flags, locals):
"""
Loop lifting transformation.
Given a interpreter `func_ir` returns a 2 tuple of
`(toplevel_interp, [loop0_interp, loop1_interp, ....])`
"""
blocks = func_ir.blocks.copy()
cfg = compute_cfg_from_blocks(blocks)
loopinfos ... | [
"def",
"loop_lifting",
"(",
"func_ir",
",",
"typingctx",
",",
"targetctx",
",",
"flags",
",",
"locals",
")",
":",
"blocks",
"=",
"func_ir",
".",
"blocks",
".",
"copy",
"(",
")",
"cfg",
"=",
"compute_cfg_from_blocks",
"(",
"blocks",
")",
"loopinfos",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/transforms.py#L214-L237 | |
stellar-deprecated/stellard | 67eabb2217bdfa9a6ea317f62338fb6bca458c90 | src/protobuf/python/google/protobuf/descriptor_pool.py | python | DescriptorPool._ConvertEnumDescriptor | (self, enum_proto, package=None, file_desc=None,
containing_type=None, scope=None) | return desc | Make a protobuf EnumDescriptor given an EnumDescriptorProto protobuf.
Args:
enum_proto: The descriptor_pb2.EnumDescriptorProto protobuf message.
package: Optional package name for the new message EnumDescriptor.
file_desc: The file containing the enum descriptor.
containing_type: The type c... | Make a protobuf EnumDescriptor given an EnumDescriptorProto protobuf. | [
"Make",
"a",
"protobuf",
"EnumDescriptor",
"given",
"an",
"EnumDescriptorProto",
"protobuf",
"."
] | def _ConvertEnumDescriptor(self, enum_proto, package=None, file_desc=None,
containing_type=None, scope=None):
"""Make a protobuf EnumDescriptor given an EnumDescriptorProto protobuf.
Args:
enum_proto: The descriptor_pb2.EnumDescriptorProto protobuf message.
package: Opt... | [
"def",
"_ConvertEnumDescriptor",
"(",
"self",
",",
"enum_proto",
",",
"package",
"=",
"None",
",",
"file_desc",
"=",
"None",
",",
"containing_type",
"=",
"None",
",",
"scope",
"=",
"None",
")",
":",
"if",
"package",
":",
"enum_name",
"=",
"'.'",
".",
"jo... | https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/descriptor_pool.py#L296-L333 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/excel/_openpyxl.py | python | _OpenpyxlWriter._convert_to_border | (cls, border_dict) | return Border(**border_kwargs) | Convert ``border_dict`` to an openpyxl v2 Border object.
Parameters
----------
border_dict : dict
A dict with zero or more of the following keys (or their synonyms).
'left'
'right'
'top'
'bottom'
'diagon... | Convert ``border_dict`` to an openpyxl v2 Border object. | [
"Convert",
"border_dict",
"to",
"an",
"openpyxl",
"v2",
"Border",
"object",
"."
] | def _convert_to_border(cls, border_dict):
"""
Convert ``border_dict`` to an openpyxl v2 Border object.
Parameters
----------
border_dict : dict
A dict with zero or more of the following keys (or their synonyms).
'left'
'right'
... | [
"def",
"_convert_to_border",
"(",
"cls",
",",
"border_dict",
")",
":",
"from",
"openpyxl",
".",
"styles",
"import",
"Border",
"_border_key_map",
"=",
"{",
"\"diagonalup\"",
":",
"\"diagonalUp\"",
",",
"\"diagonaldown\"",
":",
"\"diagonalDown\"",
"}",
"border_kwargs"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/excel/_openpyxl.py#L308-L347 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/tools/quantization/quantize_graph.py | python | GraphRewriter.remove_redundant_quantization | (self, old_graph) | return self.output_graph | Removes unneeded pairs of quantize/dequantize ops from the graph.
This is a bit of a tricky function, because it's attempting to spot the
pattern of dequantizing from eight-bit up to float, and then immediately
quantizing back down to eight bits again, that's introduced by previous
passes that do 'key-... | Removes unneeded pairs of quantize/dequantize ops from the graph. | [
"Removes",
"unneeded",
"pairs",
"of",
"quantize",
"/",
"dequantize",
"ops",
"from",
"the",
"graph",
"."
] | def remove_redundant_quantization(self, old_graph):
"""Removes unneeded pairs of quantize/dequantize ops from the graph.
This is a bit of a tricky function, because it's attempting to spot the
pattern of dequantizing from eight-bit up to float, and then immediately
quantizing back down to eight bits ag... | [
"def",
"remove_redundant_quantization",
"(",
"self",
",",
"old_graph",
")",
":",
"old_nodes_map",
"=",
"self",
".",
"create_nodes_map",
"(",
"old_graph",
")",
"self",
".",
"output_graph",
"=",
"graph_pb2",
".",
"GraphDef",
"(",
")",
"inputs_to_rename",
"=",
"{",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/tools/quantization/quantize_graph.py#L1070-L1170 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/importers/darknet/darknet_to_ell.py | python | get_pooling_layer | (layer, poolingType) | return ell.neural.PoolingLayer(layerParameters, poolingParameters, poolingType) | Returns ELL pooling layer from Darknet pooling layer | Returns ELL pooling layer from Darknet pooling layer | [
"Returns",
"ELL",
"pooling",
"layer",
"from",
"Darknet",
"pooling",
"layer"
] | def get_pooling_layer(layer, poolingType):
"""Returns ELL pooling layer from Darknet pooling layer"""
# Create the ELL pooling layer
layerParameters = create_layer_parameters(
layer['inputShape'], layer['inputPadding'], layer['inputPaddingScheme'],
layer['outputShape'], layer['outputPadding... | [
"def",
"get_pooling_layer",
"(",
"layer",
",",
"poolingType",
")",
":",
"# Create the ELL pooling layer",
"layerParameters",
"=",
"create_layer_parameters",
"(",
"layer",
"[",
"'inputShape'",
"]",
",",
"layer",
"[",
"'inputPadding'",
"]",
",",
"layer",
"[",
"'inputP... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/darknet/darknet_to_ell.py#L401-L410 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/BASISCrystalDiffraction.py | python | BASISCrystalDiffraction._calculate_wavelength_band | (self) | Select the wavelength band examining the logs of the first sample | Select the wavelength band examining the logs of the first sample | [
"Select",
"the",
"wavelength",
"band",
"examining",
"the",
"logs",
"of",
"the",
"first",
"sample"
] | def _calculate_wavelength_band(self):
"""
Select the wavelength band examining the logs of the first sample
"""
runs = self.getProperty('RunNumbers').value
run = self._run_list(runs)[0]
_t_w = self._load_single_run(run, '_t_w')
wavelength = np.mean(_t_w.getRun().g... | [
"def",
"_calculate_wavelength_band",
"(",
"self",
")",
":",
"runs",
"=",
"self",
".",
"getProperty",
"(",
"'RunNumbers'",
")",
".",
"value",
"run",
"=",
"self",
".",
"_run_list",
"(",
"runs",
")",
"[",
"0",
"]",
"_t_w",
"=",
"self",
".",
"_load_single_ru... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/BASISCrystalDiffraction.py#L582-L594 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | DC._DrawRectangleList | (*args, **kwargs) | return _gdi_.DC__DrawRectangleList(*args, **kwargs) | _DrawRectangleList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject | _DrawRectangleList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject | [
"_DrawRectangleList",
"(",
"self",
"PyObject",
"pyCoords",
"PyObject",
"pyPens",
"PyObject",
"pyBrushes",
")",
"-",
">",
"PyObject"
] | def _DrawRectangleList(*args, **kwargs):
"""_DrawRectangleList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
return _gdi_.DC__DrawRectangleList(*args, **kwargs) | [
"def",
"_DrawRectangleList",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC__DrawRectangleList",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L4745-L4747 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/logging/__init__.py | python | set_trace_level | (value) | Specifies global logging verbosity level.
Args:
value (:class:`~cntk.logging.TraceLevel`): required verbosity level. | Specifies global logging verbosity level. | [
"Specifies",
"global",
"logging",
"verbosity",
"level",
"."
] | def set_trace_level(value):
'''
Specifies global logging verbosity level.
Args:
value (:class:`~cntk.logging.TraceLevel`): required verbosity level.
'''
if isinstance(value, TraceLevel):
cntk_py.set_trace_level(value.value)
else:
cntk_py.set_trace_level(value) | [
"def",
"set_trace_level",
"(",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"TraceLevel",
")",
":",
"cntk_py",
".",
"set_trace_level",
"(",
"value",
".",
"value",
")",
"else",
":",
"cntk_py",
".",
"set_trace_level",
"(",
"value",
")"
] | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/logging/__init__.py#L32-L42 | ||
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/mfg/games/crowd_modelling.py | python | MFGCrowdModellingState.state_to_str | (self, x, t, player_id=pyspiel.PlayerId.DEFAULT_PLAYER_ID) | A string that uniquely identify a triplet x, t, player_id. | A string that uniquely identify a triplet x, t, player_id. | [
"A",
"string",
"that",
"uniquely",
"identify",
"a",
"triplet",
"x",
"t",
"player_id",
"."
] | def state_to_str(self, x, t, player_id=pyspiel.PlayerId.DEFAULT_PLAYER_ID):
"""A string that uniquely identify a triplet x, t, player_id."""
if self._is_chance_init:
return "initial"
if player_id == pyspiel.PlayerId.DEFAULT_PLAYER_ID:
return str((x, t))
if player_id == pyspiel.PlayerId.MEAN_... | [
"def",
"state_to_str",
"(",
"self",
",",
"x",
",",
"t",
",",
"player_id",
"=",
"pyspiel",
".",
"PlayerId",
".",
"DEFAULT_PLAYER_ID",
")",
":",
"if",
"self",
".",
"_is_chance_init",
":",
"return",
"\"initial\"",
"if",
"player_id",
"==",
"pyspiel",
".",
"Pla... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/mfg/games/crowd_modelling.py#L131-L142 | ||
yyzybb537/libgo | 4af17b7c67643c4d54aa354dcc77963ea07847d0 | third_party/boost.context/tools/build/src/util/path.py | python | glob | (dirs, patterns) | return result | Returns the list of files matching the given pattern in the
specified directory. Both directories and patterns are
supplied as portable paths. Each pattern should be non-absolute
path, and can't contain "." or ".." elements. Each slash separated
element of pattern can contain the following special char... | Returns the list of files matching the given pattern in the
specified directory. Both directories and patterns are
supplied as portable paths. Each pattern should be non-absolute
path, and can't contain "." or ".." elements. Each slash separated
element of pattern can contain the following special char... | [
"Returns",
"the",
"list",
"of",
"files",
"matching",
"the",
"given",
"pattern",
"in",
"the",
"specified",
"directory",
".",
"Both",
"directories",
"and",
"patterns",
"are",
"supplied",
"as",
"portable",
"paths",
".",
"Each",
"pattern",
"should",
"be",
"non",
... | def glob (dirs, patterns):
""" Returns the list of files matching the given pattern in the
specified directory. Both directories and patterns are
supplied as portable paths. Each pattern should be non-absolute
path, and can't contain "." or ".." elements. Each slash separated
element of pattern can... | [
"def",
"glob",
"(",
"dirs",
",",
"patterns",
")",
":",
"# {",
"# local result ;",
"# if $(patterns:D)",
"# {",
"# # When a pattern has a directory element, we first glob for",
"# # directory, and then glob for file name is the found directories.",
... | https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/util/path.py#L260-L338 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/styles/style_transformation.py | python | get_opposite_color | (colorname: Optional[str]) | Take a color name in either 'ansi...' format or 6 digit RGB, return the
color of opposite luminosity (same hue/saturation).
This is used for turning color schemes that work on a light background
usable on a dark background. | Take a color name in either 'ansi...' format or 6 digit RGB, return the
color of opposite luminosity (same hue/saturation). | [
"Take",
"a",
"color",
"name",
"in",
"either",
"ansi",
"...",
"format",
"or",
"6",
"digit",
"RGB",
"return",
"the",
"color",
"of",
"opposite",
"luminosity",
"(",
"same",
"hue",
"/",
"saturation",
")",
"."
] | def get_opposite_color(colorname: Optional[str]) -> Optional[str]:
"""
Take a color name in either 'ansi...' format or 6 digit RGB, return the
color of opposite luminosity (same hue/saturation).
This is used for turning color schemes that work on a light background
usable on a dark background.
... | [
"def",
"get_opposite_color",
"(",
"colorname",
":",
"Optional",
"[",
"str",
"]",
")",
"->",
"Optional",
"[",
"str",
"]",
":",
"if",
"colorname",
"is",
"None",
":",
"# Because color/bgcolor can be None in `Attrs`.",
"return",
"None",
"# Special values.",
"if",
"col... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/styles/style_transformation.py#L341-L375 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/backend.py | python | moving_average_update | (x, value, momentum) | return moving_averages.assign_moving_average(
x, value, momentum, zero_debias=False) | Compute the moving average of a variable.
Arguments:
x: A Variable.
value: A tensor with the same shape as `variable`.
momentum: The moving average momentum.
Returns:
An Operation to update the variable. | Compute the moving average of a variable. | [
"Compute",
"the",
"moving",
"average",
"of",
"a",
"variable",
"."
] | def moving_average_update(x, value, momentum):
"""Compute the moving average of a variable.
Arguments:
x: A Variable.
value: A tensor with the same shape as `variable`.
momentum: The moving average momentum.
Returns:
An Operation to update the variable.
"""
return moving_averages.ass... | [
"def",
"moving_average_update",
"(",
"x",
",",
"value",
",",
"momentum",
")",
":",
"return",
"moving_averages",
".",
"assign_moving_average",
"(",
"x",
",",
"value",
",",
"momentum",
",",
"zero_debias",
"=",
"False",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/backend.py#L1047-L1059 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | IKSolver.getTolerance | (self) | return _robotsim.IKSolver_getTolerance(self) | getTolerance(IKSolver self) -> double
Gets the constraint solve tolerance. | getTolerance(IKSolver self) -> double | [
"getTolerance",
"(",
"IKSolver",
"self",
")",
"-",
">",
"double"
] | def getTolerance(self):
"""
getTolerance(IKSolver self) -> double
Gets the constraint solve tolerance.
"""
return _robotsim.IKSolver_getTolerance(self) | [
"def",
"getTolerance",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"IKSolver_getTolerance",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L6667-L6676 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/inspect.py | python | getgeneratorstate | (generator) | return GEN_SUSPENDED | Get current state of a generator-iterator.
Possible states are:
GEN_CREATED: Waiting to start execution.
GEN_RUNNING: Currently being executed by the interpreter.
GEN_SUSPENDED: Currently suspended at a yield expression.
GEN_CLOSED: Execution has completed. | Get current state of a generator-iterator. | [
"Get",
"current",
"state",
"of",
"a",
"generator",
"-",
"iterator",
"."
] | def getgeneratorstate(generator):
"""Get current state of a generator-iterator.
Possible states are:
GEN_CREATED: Waiting to start execution.
GEN_RUNNING: Currently being executed by the interpreter.
GEN_SUSPENDED: Currently suspended at a yield expression.
GEN_CLOSED: Execution has com... | [
"def",
"getgeneratorstate",
"(",
"generator",
")",
":",
"if",
"generator",
".",
"gi_running",
":",
"return",
"GEN_RUNNING",
"if",
"generator",
".",
"gi_frame",
"is",
"None",
":",
"return",
"GEN_CLOSED",
"if",
"generator",
".",
"gi_frame",
".",
"f_lasti",
"==",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/inspect.py#L1619-L1634 | |
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_utils.py | python | BlockingConnection.url | (self) | return self.conn and self.conn.connected_address | The address for this connection. | The address for this connection. | [
"The",
"address",
"for",
"this",
"connection",
"."
] | def url(self) -> str:
"""
The address for this connection.
"""
return self.conn and self.conn.connected_address | [
"def",
"url",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"conn",
"and",
"self",
".",
"conn",
".",
"connected_address"
] | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_utils.py#L480-L484 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Tools/python.py | python | check_python_headers | (conf, features='pyembed pyext') | Check for headers and libraries necessary to extend or embed python by using the module *distutils*.
On success the environment variables xxx_PYEXT and xxx_PYEMBED are added:
* PYEXT: for compiling python extensions
* PYEMBED: for embedding a python interpreter | Check for headers and libraries necessary to extend or embed python by using the module *distutils*.
On success the environment variables xxx_PYEXT and xxx_PYEMBED are added: | [
"Check",
"for",
"headers",
"and",
"libraries",
"necessary",
"to",
"extend",
"or",
"embed",
"python",
"by",
"using",
"the",
"module",
"*",
"distutils",
"*",
".",
"On",
"success",
"the",
"environment",
"variables",
"xxx_PYEXT",
"and",
"xxx_PYEMBED",
"are",
"adde... | def check_python_headers(conf, features='pyembed pyext'):
"""
Check for headers and libraries necessary to extend or embed python by using the module *distutils*.
On success the environment variables xxx_PYEXT and xxx_PYEMBED are added:
* PYEXT: for compiling python extensions
* PYEMBED: for embedding a python in... | [
"def",
"check_python_headers",
"(",
"conf",
",",
"features",
"=",
"'pyembed pyext'",
")",
":",
"features",
"=",
"Utils",
".",
"to_list",
"(",
"features",
")",
"assert",
"(",
"'pyembed'",
"in",
"features",
")",
"or",
"(",
"'pyext'",
"in",
"features",
")",
"... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/python.py#L292-L458 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Misc._substitute | (self, *args) | return (e,) | Internal function. | Internal function. | [
"Internal",
"function",
"."
] | def _substitute(self, *args):
"""Internal function."""
if len(args) != len(self._subst_format): return args
getboolean = self.tk.getboolean
getint = int
def getint_event(s):
"""Tk changed behavior in 8.4.2, returning "??" rather more often."""
try:
... | [
"def",
"_substitute",
"(",
"self",
",",
"*",
"args",
")",
":",
"if",
"len",
"(",
"args",
")",
"!=",
"len",
"(",
"self",
".",
"_subst_format",
")",
":",
"return",
"args",
"getboolean",
"=",
"self",
".",
"tk",
".",
"getboolean",
"getint",
"=",
"int",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L1174-L1230 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | third_party/Python/module/pexpect-4.6/pexpect/screen.py | python | screen.__init__ | (self, r=24, c=80, encoding='latin-1', encoding_errors='replace') | This initializes a blank screen of the given dimensions. | This initializes a blank screen of the given dimensions. | [
"This",
"initializes",
"a",
"blank",
"screen",
"of",
"the",
"given",
"dimensions",
"."
] | def __init__(self, r=24, c=80, encoding='latin-1', encoding_errors='replace'):
'''This initializes a blank screen of the given dimensions.'''
self.rows = r
self.cols = c
self.encoding = encoding
self.encoding_errors = encoding_errors
if encoding is not None:
... | [
"def",
"__init__",
"(",
"self",
",",
"r",
"=",
"24",
",",
"c",
"=",
"80",
",",
"encoding",
"=",
"'latin-1'",
",",
"encoding_errors",
"=",
"'replace'",
")",
":",
"self",
".",
"rows",
"=",
"r",
"self",
".",
"cols",
"=",
"c",
"self",
".",
"encoding",
... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L85-L102 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_edge.py | python | EdgeDomain.adaptTraveltime | (self, edgeID, time, begin=None, end=None) | adaptTraveltime(string, double, double, double) -> None
Adapt the travel time value (in s) used for (re-)routing for the given edge.
When setting begin time and end time (in seconds), the changes only
apply to that time range. Otherwise they apply all the time | adaptTraveltime(string, double, double, double) -> None | [
"adaptTraveltime",
"(",
"string",
"double",
"double",
"double",
")",
"-",
">",
"None"
] | def adaptTraveltime(self, edgeID, time, begin=None, end=None):
"""adaptTraveltime(string, double, double, double) -> None
Adapt the travel time value (in s) used for (re-)routing for the given edge.
When setting begin time and end time (in seconds), the changes only
apply to that time ... | [
"def",
"adaptTraveltime",
"(",
"self",
",",
"edgeID",
",",
"time",
",",
"begin",
"=",
"None",
",",
"end",
"=",
"None",
")",
":",
"if",
"begin",
"is",
"None",
"and",
"end",
"is",
"None",
":",
"self",
".",
"_setCmd",
"(",
"tc",
".",
"VAR_EDGE_TRAVELTIM... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_edge.py#L189-L202 | ||
tensorflow/io | 92b44e180674a8af0e12e405530f7343e3e693e4 | tensorflow_io/python/experimental/filesystem_ops.py | python | set_configuration | (scheme, key, value, name=None) | return core_ops.io_file_system_set_configuration(
scheme, key=key, value=value, name=name
) | Set configuration of the file system.
Args:
scheme: File system scheme.
key: The name of the configuration option.
value: The value of the configuration option.
name: A name for the operation (optional).
Returns:
None. | Set configuration of the file system. | [
"Set",
"configuration",
"of",
"the",
"file",
"system",
"."
] | def set_configuration(scheme, key, value, name=None):
"""
Set configuration of the file system.
Args:
scheme: File system scheme.
key: The name of the configuration option.
value: The value of the configuration option.
name: A name for the operation (optional).
Returns:
N... | [
"def",
"set_configuration",
"(",
"scheme",
",",
"key",
",",
"value",
",",
"name",
"=",
"None",
")",
":",
"return",
"core_ops",
".",
"io_file_system_set_configuration",
"(",
"scheme",
",",
"key",
"=",
"key",
",",
"value",
"=",
"value",
",",
"name",
"=",
"... | https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/experimental/filesystem_ops.py#L20-L36 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/reflection.py | python | MakeClass | (descriptor) | return symbol_database.Default().GetPrototype(descriptor) | Construct a class object for a protobuf described by descriptor.
DEPRECATED: use MessageFactory.GetPrototype() instead.
Args:
descriptor: A descriptor.Descriptor object describing the protobuf.
Returns:
The Message class object described by the descriptor. | Construct a class object for a protobuf described by descriptor. | [
"Construct",
"a",
"class",
"object",
"for",
"a",
"protobuf",
"described",
"by",
"descriptor",
"."
] | def MakeClass(descriptor):
"""Construct a class object for a protobuf described by descriptor.
DEPRECATED: use MessageFactory.GetPrototype() instead.
Args:
descriptor: A descriptor.Descriptor object describing the protobuf.
Returns:
The Message class object described by the descriptor.
"""
# Origi... | [
"def",
"MakeClass",
"(",
"descriptor",
")",
":",
"# Original implementation leads to duplicate message classes, which won't play",
"# well with extensions. Message factory info is also missing.",
"# Redirect to message_factory.",
"return",
"symbol_database",
".",
"Default",
"(",
")",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/reflection.py#L82-L95 | |
wujian16/Cornell-MOE | df299d1be882d2af9796d7a68b3f9505cac7a53e | moe/optimal_learning/python/cpp_wrappers/optimization.py | python | NewtonOptimizer.optimize | (self, **kwargs) | C++ does not expose this endpoint. | C++ does not expose this endpoint. | [
"C",
"++",
"does",
"not",
"expose",
"this",
"endpoint",
"."
] | def optimize(self, **kwargs):
"""C++ does not expose this endpoint."""
raise NotImplementedError("C++ wrapper currently does not support optimization member functions.") | [
"def",
"optimize",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"C++ wrapper currently does not support optimization member functions.\"",
")"
] | https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/cpp_wrappers/optimization.py#L475-L477 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/virtualenv.py | python | _running_under_regular_virtualenv | () | return hasattr(sys, 'real_prefix') | Checks if sys.real_prefix is set.
This handles virtual environments created with pypa's virtualenv. | Checks if sys.real_prefix is set. | [
"Checks",
"if",
"sys",
".",
"real_prefix",
"is",
"set",
"."
] | def _running_under_regular_virtualenv():
# type: () -> bool
"""Checks if sys.real_prefix is set.
This handles virtual environments created with pypa's virtualenv.
"""
# pypa/virtualenv case
return hasattr(sys, 'real_prefix') | [
"def",
"_running_under_regular_virtualenv",
"(",
")",
":",
"# type: () -> bool",
"# pypa/virtualenv case",
"return",
"hasattr",
"(",
"sys",
",",
"'real_prefix'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/virtualenv.py#L53-L67 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py | python | DependencyGraph.topological_sort | (self) | return result, list(alist.keys()) | Perform a topological sort of the graph.
:return: A tuple, the first element of which is a topologically sorted
list of distributions, and the second element of which is a
list of distributions that cannot be sorted because they have
circular dependencies and s... | Perform a topological sort of the graph.
:return: A tuple, the first element of which is a topologically sorted
list of distributions, and the second element of which is a
list of distributions that cannot be sorted because they have
circular dependencies and s... | [
"Perform",
"a",
"topological",
"sort",
"of",
"the",
"graph",
".",
":",
"return",
":",
"A",
"tuple",
"the",
"first",
"element",
"of",
"which",
"is",
"a",
"topologically",
"sorted",
"list",
"of",
"distributions",
"and",
"the",
"second",
"element",
"of",
"whi... | def topological_sort(self):
"""
Perform a topological sort of the graph.
:return: A tuple, the first element of which is a topologically sorted
list of distributions, and the second element of which is a
list of distributions that cannot be sorted because they h... | [
"def",
"topological_sort",
"(",
"self",
")",
":",
"result",
"=",
"[",
"]",
"# Make a shallow copy of the adjacency list",
"alist",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"self",
".",
"adjacency_list",
".",
"items",
"(",
")",
":",
"alist",
"[",
"k",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py#L1186-L1215 | |
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/boost_1.75.0/tools/build/src/build/virtual_target.py | python | VirtualTarget.actualize_action | (self, target) | Sets up build actions for 'target'. Should call appropriate rules
and set target variables. | Sets up build actions for 'target'. Should call appropriate rules
and set target variables. | [
"Sets",
"up",
"build",
"actions",
"for",
"target",
".",
"Should",
"call",
"appropriate",
"rules",
"and",
"set",
"target",
"variables",
"."
] | def actualize_action (self, target):
""" Sets up build actions for 'target'. Should call appropriate rules
and set target variables.
"""
raise BaseException ("method should be defined in derived classes") | [
"def",
"actualize_action",
"(",
"self",
",",
"target",
")",
":",
"raise",
"BaseException",
"(",
"\"method should be defined in derived classes\"",
")"
] | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/build/virtual_target.py#L353-L357 | ||
stack-of-tasks/pinocchio | 593d4d43fded997bb9aa2421f4e55294dbd233c4 | bindings/python/pinocchio/robot_wrapper.py | python | RobotWrapper.frameJacobian | (self, q, frame_id) | return pin.computeFrameJacobian(self.model, self.data, q, frame_id) | Similar to getFrameJacobian but does not need pin.computeJointJacobians and
pin.updateFramePlacements to update internal value of self.data related to frames. | Similar to getFrameJacobian but does not need pin.computeJointJacobians and
pin.updateFramePlacements to update internal value of self.data related to frames. | [
"Similar",
"to",
"getFrameJacobian",
"but",
"does",
"not",
"need",
"pin",
".",
"computeJointJacobians",
"and",
"pin",
".",
"updateFramePlacements",
"to",
"update",
"internal",
"value",
"of",
"self",
".",
"data",
"related",
"to",
"frames",
"."
] | def frameJacobian(self, q, frame_id):
"""
Similar to getFrameJacobian but does not need pin.computeJointJacobians and
pin.updateFramePlacements to update internal value of self.data related to frames.
"""
return pin.computeFrameJacobian(self.model, self.data, q, frame_id) | [
"def",
"frameJacobian",
"(",
"self",
",",
"q",
",",
"frame_id",
")",
":",
"return",
"pin",
".",
"computeFrameJacobian",
"(",
"self",
".",
"model",
",",
"self",
".",
"data",
",",
"q",
",",
"frame_id",
")"
] | https://github.com/stack-of-tasks/pinocchio/blob/593d4d43fded997bb9aa2421f4e55294dbd233c4/bindings/python/pinocchio/robot_wrapper.py#L220-L225 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/callbacks.py | python | _is_generator_like | (data) | return (hasattr(data, 'next') or hasattr(data, '__next__') or isinstance(
data, (Sequence, iterator_ops.Iterator, iterator_ops.IteratorV2))) | Checks if data is a generator, Sequence, or Iterator. | Checks if data is a generator, Sequence, or Iterator. | [
"Checks",
"if",
"data",
"is",
"a",
"generator",
"Sequence",
"or",
"Iterator",
"."
] | def _is_generator_like(data):
"""Checks if data is a generator, Sequence, or Iterator."""
return (hasattr(data, 'next') or hasattr(data, '__next__') or isinstance(
data, (Sequence, iterator_ops.Iterator, iterator_ops.IteratorV2))) | [
"def",
"_is_generator_like",
"(",
"data",
")",
":",
"return",
"(",
"hasattr",
"(",
"data",
",",
"'next'",
")",
"or",
"hasattr",
"(",
"data",
",",
"'__next__'",
")",
"or",
"isinstance",
"(",
"data",
",",
"(",
"Sequence",
",",
"iterator_ops",
".",
"Iterato... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/callbacks.py#L169-L172 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/graph_editor/subgraph.py | python | SubGraphView.is_passthrough | (self, t) | return t in self._passthrough_ts | Check whether a tensor is passthrough. | Check whether a tensor is passthrough. | [
"Check",
"whether",
"a",
"tensor",
"is",
"passthrough",
"."
] | def is_passthrough(self, t):
"""Check whether a tensor is passthrough."""
return t in self._passthrough_ts | [
"def",
"is_passthrough",
"(",
"self",
",",
"t",
")",
":",
"return",
"t",
"in",
"self",
".",
"_passthrough_ts"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/graph_editor/subgraph.py#L477-L479 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/importers/common/converters.py | python | ConvertConstant.convert | (self, conversion_parameters: typing.Mapping[str, typing.Any]) | return None | Return the appropriate ELL node | Return the appropriate ELL node | [
"Return",
"the",
"appropriate",
"ELL",
"node"
] | def convert(self, conversion_parameters: typing.Mapping[str, typing.Any]):
"""
Return the appropriate ELL node
"""
return None | [
"def",
"convert",
"(",
"self",
",",
"conversion_parameters",
":",
"typing",
".",
"Mapping",
"[",
"str",
",",
"typing",
".",
"Any",
"]",
")",
":",
"return",
"None"
] | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/common/converters.py#L1892-L1896 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/debug/cli/analyzer_cli.py | python | DebugAnalyzer.add_tensor_filter | (self, filter_name, filter_callable) | Add a tensor filter.
A tensor filter is a named callable of the signature:
filter_callable(dump_datum, tensor),
wherein dump_datum is an instance of debug_data.DebugTensorDatum carrying
metadata about the dumped tensor, including tensor name, timestamps, etc.
tensor is the value of the dumped te... | Add a tensor filter. | [
"Add",
"a",
"tensor",
"filter",
"."
] | def add_tensor_filter(self, filter_name, filter_callable):
"""Add a tensor filter.
A tensor filter is a named callable of the signature:
filter_callable(dump_datum, tensor),
wherein dump_datum is an instance of debug_data.DebugTensorDatum carrying
metadata about the dumped tensor, including tens... | [
"def",
"add_tensor_filter",
"(",
"self",
",",
"filter_name",
",",
"filter_callable",
")",
":",
"if",
"not",
"isinstance",
"(",
"filter_name",
",",
"str",
")",
":",
"raise",
"TypeError",
"(",
"\"Input argument filter_name is expected to be str, \"",
"\"but is not.\"",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/cli/analyzer_cli.py#L415-L453 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/image/detection.py | python | CreateMultiRandCropAugmenter | (min_object_covered=0.1, aspect_ratio_range=(0.75, 1.33),
area_range=(0.05, 1.0), min_eject_coverage=0.3,
max_attempts=50, skip_prob=0) | return DetRandomSelectAug(augs, skip_prob=skip_prob) | Helper function to create multiple random crop augmenters.
Parameters
----------
min_object_covered : float or list of float, default=0.1
The cropped area of the image must contain at least this fraction of
any bounding box supplied. The value of this parameter should be non-negative.
... | Helper function to create multiple random crop augmenters. | [
"Helper",
"function",
"to",
"create",
"multiple",
"random",
"crop",
"augmenters",
"."
] | def CreateMultiRandCropAugmenter(min_object_covered=0.1, aspect_ratio_range=(0.75, 1.33),
area_range=(0.05, 1.0), min_eject_coverage=0.3,
max_attempts=50, skip_prob=0):
"""Helper function to create multiple random crop augmenters.
Parameters
... | [
"def",
"CreateMultiRandCropAugmenter",
"(",
"min_object_covered",
"=",
"0.1",
",",
"aspect_ratio_range",
"=",
"(",
"0.75",
",",
"1.33",
")",
",",
"area_range",
"=",
"(",
"0.05",
",",
"1.0",
")",
",",
"min_eject_coverage",
"=",
"0.3",
",",
"max_attempts",
"=",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/image/detection.py#L417-L479 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | panda/src/tinydisplay/ztriangle.py | python | closeCode | () | Close the previously-opened code file. | Close the previously-opened code file. | [
"Close",
"the",
"previously",
"-",
"opened",
"code",
"file",
"."
] | def closeCode():
""" Close the previously-opened code file. """
if code:
print >> code, ''
print >> code, 'ZB_fillTriangleFunc ztriangle_code_%s[%s] = {' % (codeSeg, len(fnameList))
for fname in fnameList:
print >> code, ' %s,' % (fname)
print >> code, '};'
c... | [
"def",
"closeCode",
"(",
")",
":",
"if",
"code",
":",
"print",
">>",
"code",
",",
"''",
"print",
">>",
"code",
",",
"'ZB_fillTriangleFunc ztriangle_code_%s[%s] = {'",
"%",
"(",
"codeSeg",
",",
"len",
"(",
"fnameList",
")",
")",
"for",
"fname",
"in",
"fname... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/panda/src/tinydisplay/ztriangle.py#L148-L156 | ||
microsoft/DirectXShaderCompiler | 8348ff8d9e0287610ba05d3a828e10af981a1c05 | tools/clang/bindings/python/clang/cindex.py | python | CursorKind.is_declaration | (self) | return conf.lib.clang_isDeclaration(self) | Test if this is a declaration kind. | Test if this is a declaration kind. | [
"Test",
"if",
"this",
"is",
"a",
"declaration",
"kind",
"."
] | def is_declaration(self):
"""Test if this is a declaration kind."""
return conf.lib.clang_isDeclaration(self) | [
"def",
"is_declaration",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isDeclaration",
"(",
"self",
")"
] | https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/tools/clang/bindings/python/clang/cindex.py#L559-L561 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/autograph/impl/api.py | python | _fall_back_unconverted | (f, args, kwargs, options, exc) | return _call_unconverted(f, args, kwargs, options) | Falls back to calling the function unconverted, in case of error. | Falls back to calling the function unconverted, in case of error. | [
"Falls",
"back",
"to",
"calling",
"the",
"function",
"unconverted",
"in",
"case",
"of",
"error",
"."
] | def _fall_back_unconverted(f, args, kwargs, options, exc):
"""Falls back to calling the function unconverted, in case of error."""
# TODO(mdan): Consider adding an internal metric.
warning_template = (
'AutoGraph could not transform %s and will run it as-is.\n'
'%s'
'Cause: %s\n'
'To silen... | [
"def",
"_fall_back_unconverted",
"(",
"f",
",",
"args",
",",
"kwargs",
",",
"options",
",",
"exc",
")",
":",
"# TODO(mdan): Consider adding an internal metric.",
"warning_template",
"=",
"(",
"'AutoGraph could not transform %s and will run it as-is.\\n'",
"'%s'",
"'Cause: %s\... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/impl/api.py#L462-L484 | |
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | llvm/utils/docker/scripts/llvm_checksum/llvm_checksum.py | python | ValidateChecksums | (reference_checksums,
new_checksums,
allow_missing_projects=False) | return True | Validates that reference_checksums and new_checksums match.
Args:
reference_checksums: a dict of reference checksums, mapping from a project
name to a project checksum.
new_checksums: a dict of checksums to be checked, mapping from a project
name to a project checksum.
allow_missing_projects:... | Validates that reference_checksums and new_checksums match. | [
"Validates",
"that",
"reference_checksums",
"and",
"new_checksums",
"match",
"."
] | def ValidateChecksums(reference_checksums,
new_checksums,
allow_missing_projects=False):
"""Validates that reference_checksums and new_checksums match.
Args:
reference_checksums: a dict of reference checksums, mapping from a project
name to a project checksum.
... | [
"def",
"ValidateChecksums",
"(",
"reference_checksums",
",",
"new_checksums",
",",
"allow_missing_projects",
"=",
"False",
")",
":",
"if",
"not",
"allow_missing_projects",
":",
"if",
"len",
"(",
"new_checksums",
")",
"!=",
"len",
"(",
"reference_checksums",
")",
"... | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/llvm/utils/docker/scripts/llvm_checksum/llvm_checksum.py#L160-L194 | |
Yelp/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | moe/optimal_learning/python/cpp_wrappers/log_likelihood.py | python | GaussianProcessLogMarginalLikelihood.__init__ | (self, covariance_function, historical_data) | Construct a LogLikelihood object configured for Log Marginal Likelihood computation; see superclass ctor for details. | Construct a LogLikelihood object configured for Log Marginal Likelihood computation; see superclass ctor for details. | [
"Construct",
"a",
"LogLikelihood",
"object",
"configured",
"for",
"Log",
"Marginal",
"Likelihood",
"computation",
";",
"see",
"superclass",
"ctor",
"for",
"details",
"."
] | def __init__(self, covariance_function, historical_data):
"""Construct a LogLikelihood object configured for Log Marginal Likelihood computation; see superclass ctor for details."""
super(GaussianProcessLogMarginalLikelihood, self).__init__(
covariance_function,
historical_data,
... | [
"def",
"__init__",
"(",
"self",
",",
"covariance_function",
",",
"historical_data",
")",
":",
"super",
"(",
"GaussianProcessLogMarginalLikelihood",
",",
"self",
")",
".",
"__init__",
"(",
"covariance_function",
",",
"historical_data",
",",
"log_likelihood_type",
"=",
... | https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/cpp_wrappers/log_likelihood.py#L378-L384 | ||
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/__init__.py | python | _call_linker_cb | (env, callback, args, result = None) | return result | Returns the result of env['LINKCALLBACKS'][callback](*args)
if env['LINKCALLBACKS'] is a dictionary and env['LINKCALLBACKS'][callback]
is callable. If these conditions are not met, return the value provided as
the *result* argument. This function is mainly used for generating library
info such as versio... | Returns the result of env['LINKCALLBACKS'][callback](*args)
if env['LINKCALLBACKS'] is a dictionary and env['LINKCALLBACKS'][callback]
is callable. If these conditions are not met, return the value provided as
the *result* argument. This function is mainly used for generating library
info such as versio... | [
"Returns",
"the",
"result",
"of",
"env",
"[",
"LINKCALLBACKS",
"]",
"[",
"callback",
"]",
"(",
"*",
"args",
")",
"if",
"env",
"[",
"LINKCALLBACKS",
"]",
"is",
"a",
"dictionary",
"and",
"env",
"[",
"LINKCALLBACKS",
"]",
"[",
"callback",
"]",
"is",
"call... | def _call_linker_cb(env, callback, args, result = None):
"""Returns the result of env['LINKCALLBACKS'][callback](*args)
if env['LINKCALLBACKS'] is a dictionary and env['LINKCALLBACKS'][callback]
is callable. If these conditions are not met, return the value provided as
the *result* argument. This functi... | [
"def",
"_call_linker_cb",
"(",
"env",
",",
"callback",
",",
"args",
",",
"result",
"=",
"None",
")",
":",
"Verbose",
"=",
"False",
"if",
"Verbose",
":",
"print",
"(",
"'_call_linker_cb: args=%r'",
"%",
"args",
")",
"print",
"(",
"'_call_linker_cb: callback=%r'... | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/__init__.py#L355-L383 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py | python | Table.read_column | (
self,
column: str,
where=None,
start: Optional[int] = None,
stop: Optional[int] = None,
) | return a single column from the table, generally only indexables
are interesting | return a single column from the table, generally only indexables
are interesting | [
"return",
"a",
"single",
"column",
"from",
"the",
"table",
"generally",
"only",
"indexables",
"are",
"interesting"
] | def read_column(
self,
column: str,
where=None,
start: Optional[int] = None,
stop: Optional[int] = None,
):
"""return a single column from the table, generally only indexables
are interesting
"""
# validate the version
self.validate_ve... | [
"def",
"read_column",
"(",
"self",
",",
"column",
":",
"str",
",",
"where",
"=",
"None",
",",
"start",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
"stop",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
")",
":",
"# validate the version",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py#L4040-L4082 | ||
paullouisageneau/libdatachannel | 27569ce021bea0df6cfc3e0b99e71d5c2d180089 | pages/tasks.py | python | build | (c) | Build local version of site | Build local version of site | [
"Build",
"local",
"version",
"of",
"site"
] | def build(c):
"""Build local version of site"""
pelican_run('-s {settings_base}'.format(**CONFIG)) | [
"def",
"build",
"(",
"c",
")",
":",
"pelican_run",
"(",
"'-s {settings_base}'",
".",
"format",
"(",
"*",
"*",
"CONFIG",
")",
")"
] | https://github.com/paullouisageneau/libdatachannel/blob/27569ce021bea0df6cfc3e0b99e71d5c2d180089/pages/tasks.py#L43-L45 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/feature_column.py | python | _TPUSharedEmbeddingColumn.get_weight_key_name | (self) | return None | get_weight_key_name. | get_weight_key_name. | [
"get_weight_key_name",
"."
] | def get_weight_key_name(self):
"""get_weight_key_name."""
if self.is_categorical_column_weighted():
return self.categorical_column.weight_feature_key
return None | [
"def",
"get_weight_key_name",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_categorical_column_weighted",
"(",
")",
":",
"return",
"self",
".",
"categorical_column",
".",
"weight_feature_key",
"return",
"None"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/feature_column.py#L515-L519 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/layers/python/layers/optimizers.py | python | _multiply_gradients | (grads_and_vars, gradient_multipliers) | return multiplied_grads_and_vars | Multiply specified gradients. | Multiply specified gradients. | [
"Multiply",
"specified",
"gradients",
"."
] | def _multiply_gradients(grads_and_vars, gradient_multipliers):
"""Multiply specified gradients."""
multiplied_grads_and_vars = []
for grad, var in grads_and_vars:
if (grad is not None and
(var in gradient_multipliers or var.name in gradient_multipliers)):
key = var if var in gradient_multipliers... | [
"def",
"_multiply_gradients",
"(",
"grads_and_vars",
",",
"gradient_multipliers",
")",
":",
"multiplied_grads_and_vars",
"=",
"[",
"]",
"for",
"grad",
",",
"var",
"in",
"grads_and_vars",
":",
"if",
"(",
"grad",
"is",
"not",
"None",
"and",
"(",
"var",
"in",
"... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/layers/python/layers/optimizers.py#L245-L260 | |
QMCPACK/qmcpack | d0948ab455e38364458740cc8e2239600a14c5cd | utils/afqmctools/bin/afqmc_to_fcidump.py | python | parse_args | (args) | return options | Parse command-line arguments.
Parameters
----------
args : list of strings
command-line arguments.
Returns
-------
options : :class:`argparse.ArgumentParser`
Command line arguments. | Parse command-line arguments. | [
"Parse",
"command",
"-",
"line",
"arguments",
"."
] | def parse_args(args):
"""Parse command-line arguments.
Parameters
----------
args : list of strings
command-line arguments.
Returns
-------
options : :class:`argparse.ArgumentParser`
Command line arguments.
"""
parser = argparse.ArgumentParser(description = __doc__... | [
"def",
"parse_args",
"(",
"args",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"__doc__",
")",
"parser",
".",
"add_argument",
"(",
"'-i'",
",",
"'--input'",
",",
"dest",
"=",
"'input_file'",
",",
"type",
"=",
"str",
... | https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/utils/afqmctools/bin/afqmc_to_fcidump.py#L12-L54 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/quantize/python/fold_batch_norms.py | python | _CloneOp | (op, new_name, new_inputs) | return _OP_CLONER.Clone(op, inputs, new_name) | Clones a given op, replaces its name and some of its inputs.
Args:
op: Operation to modify.
new_name: String, a new name to set on cloned op.
new_inputs: A list of tuples (idx, tensor), each input with corresponding
index will be replaced by the given Tensor in the cloned op.
Returns:
Oper... | Clones a given op, replaces its name and some of its inputs. | [
"Clones",
"a",
"given",
"op",
"replaces",
"its",
"name",
"and",
"some",
"of",
"its",
"inputs",
"."
] | def _CloneOp(op, new_name, new_inputs):
"""Clones a given op, replaces its name and some of its inputs.
Args:
op: Operation to modify.
new_name: String, a new name to set on cloned op.
new_inputs: A list of tuples (idx, tensor), each input with corresponding
index will be replaced by the given ... | [
"def",
"_CloneOp",
"(",
"op",
",",
"new_name",
",",
"new_inputs",
")",
":",
"inputs",
"=",
"list",
"(",
"op",
".",
"inputs",
")",
"for",
"new_input",
"in",
"new_inputs",
":",
"inputs",
"[",
"new_input",
"[",
"0",
"]",
"]",
"=",
"new_input",
"[",
"1",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/quantize/python/fold_batch_norms.py#L432-L451 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/factorization/python/ops/factorization_ops.py | python | WALSModel.update_col_factors | (self, sp_input=None, transpose_input=False) | return self._process_input_helper(False, sp_input=sp_input,
transpose_input=transpose_input) | Updates the column factors.
Args:
sp_input: A SparseTensor representing a subset of columns of the full
input. Please refer to comments for update_row_factors for
restrictions.
transpose_input: If true, logically transposes the input.
Returns:
A tuple consisting of the follow... | Updates the column factors. | [
"Updates",
"the",
"column",
"factors",
"."
] | def update_col_factors(self, sp_input=None, transpose_input=False):
"""Updates the column factors.
Args:
sp_input: A SparseTensor representing a subset of columns of the full
input. Please refer to comments for update_row_factors for
restrictions.
transpose_input: If true, logically... | [
"def",
"update_col_factors",
"(",
"self",
",",
"sp_input",
"=",
"None",
",",
"transpose_input",
"=",
"False",
")",
":",
"return",
"self",
".",
"_process_input_helper",
"(",
"False",
",",
"sp_input",
"=",
"sp_input",
",",
"transpose_input",
"=",
"transpose_input"... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/factorization_ops.py#L351-L367 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/sysconfig.py | python | get_config_var | (name) | return get_config_vars().get(name) | Return the value of a single variable using the dictionary returned by
'get_config_vars()'.
Equivalent to get_config_vars().get(name) | Return the value of a single variable using the dictionary returned by
'get_config_vars()'. | [
"Return",
"the",
"value",
"of",
"a",
"single",
"variable",
"using",
"the",
"dictionary",
"returned",
"by",
"get_config_vars",
"()",
"."
] | def get_config_var(name):
"""Return the value of a single variable using the dictionary returned by
'get_config_vars()'.
Equivalent to get_config_vars().get(name)
"""
if name == 'SO':
import warnings
warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2)
return... | [
"def",
"get_config_var",
"(",
"name",
")",
":",
"if",
"name",
"==",
"'SO'",
":",
"import",
"warnings",
"warnings",
".",
"warn",
"(",
"'SO is deprecated, use EXT_SUFFIX'",
",",
"DeprecationWarning",
",",
"2",
")",
"return",
"get_config_vars",
"(",
")",
".",
"ge... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/sysconfig.py#L593-L602 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/http/cookiejar.py | python | CookieJar.set_cookie | (self, cookie) | Set a cookie, without checking whether or not it should be set. | Set a cookie, without checking whether or not it should be set. | [
"Set",
"a",
"cookie",
"without",
"checking",
"whether",
"or",
"not",
"it",
"should",
"be",
"set",
"."
] | def set_cookie(self, cookie):
"""Set a cookie, without checking whether or not it should be set."""
c = self._cookies
self._cookies_lock.acquire()
try:
if cookie.domain not in c: c[cookie.domain] = {}
c2 = c[cookie.domain]
if cookie.path not in c2: c2[... | [
"def",
"set_cookie",
"(",
"self",
",",
"cookie",
")",
":",
"c",
"=",
"self",
".",
"_cookies",
"self",
".",
"_cookies_lock",
".",
"acquire",
"(",
")",
"try",
":",
"if",
"cookie",
".",
"domain",
"not",
"in",
"c",
":",
"c",
"[",
"cookie",
".",
"domain... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/http/cookiejar.py#L1661-L1672 | ||
ElementsProject/elements | 7d83cc0089345a0646834986c56e58543fd5ee07 | contrib/devtools/security-check.py | python | check_ELF_Canary | (executable) | return ok | Check for use of stack canary | Check for use of stack canary | [
"Check",
"for",
"use",
"of",
"stack",
"canary"
] | def check_ELF_Canary(executable) -> bool:
'''
Check for use of stack canary
'''
stdout = run_command([READELF_CMD, '--dyn-syms', '-W', executable])
ok = False
for line in stdout.splitlines():
if '__stack_chk_fail' in line:
ok = True
return ok | [
"def",
"check_ELF_Canary",
"(",
"executable",
")",
"->",
"bool",
":",
"stdout",
"=",
"run_command",
"(",
"[",
"READELF_CMD",
",",
"'--dyn-syms'",
",",
"'-W'",
",",
"executable",
"]",
")",
"ok",
"=",
"False",
"for",
"line",
"in",
"stdout",
".",
"splitlines"... | https://github.com/ElementsProject/elements/blob/7d83cc0089345a0646834986c56e58543fd5ee07/contrib/devtools/security-check.py#L127-L137 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/opsworks/layer1.py | python | OpsWorksConnection.set_permission | (self, stack_id, iam_user_arn, allow_ssh=None,
allow_sudo=None, level=None) | return self.make_request(action='SetPermission',
body=json.dumps(params)) | Specifies a user's permissions. For more information, see
`Security and Permissions`_.
**Required Permissions**: To use this action, an IAM user must
have a Manage permissions level for the stack, or an attached
policy that explicitly grants permissions. For more
information on ... | Specifies a user's permissions. For more information, see
`Security and Permissions`_. | [
"Specifies",
"a",
"user",
"s",
"permissions",
".",
"For",
"more",
"information",
"see",
"Security",
"and",
"Permissions",
"_",
"."
] | def set_permission(self, stack_id, iam_user_arn, allow_ssh=None,
allow_sudo=None, level=None):
"""
Specifies a user's permissions. For more information, see
`Security and Permissions`_.
**Required Permissions**: To use this action, an IAM user must
have a ... | [
"def",
"set_permission",
"(",
"self",
",",
"stack_id",
",",
"iam_user_arn",
",",
"allow_ssh",
"=",
"None",
",",
"allow_sudo",
"=",
"None",
",",
"level",
"=",
"None",
")",
":",
"params",
"=",
"{",
"'StackId'",
":",
"stack_id",
",",
"'IamUserArn'",
":",
"i... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/opsworks/layer1.py#L2219-L2268 | |
google/ml-metadata | b60196492d2ea2bcd8e4ddff0f3757e5fd710e4d | ml_metadata/metadata_store/metadata_store.py | python | MetadataStore.put_contexts | (self, contexts: Sequence[proto.Context]) | return result | Inserts or updates contexts in the database.
If an context id is specified for an context, it is an update.
If an context id is unspecified, it will insert a new context.
For new contexts, type must be specified.
For old contexts, type must be unchanged or unspecified.
The name of a context cannot ... | Inserts or updates contexts in the database. | [
"Inserts",
"or",
"updates",
"contexts",
"in",
"the",
"database",
"."
] | def put_contexts(self, contexts: Sequence[proto.Context]) -> List[int]:
"""Inserts or updates contexts in the database.
If an context id is specified for an context, it is an update.
If an context id is unspecified, it will insert a new context.
For new contexts, type must be specified.
For old con... | [
"def",
"put_contexts",
"(",
"self",
",",
"contexts",
":",
"Sequence",
"[",
"proto",
".",
"Context",
"]",
")",
"->",
"List",
"[",
"int",
"]",
":",
"request",
"=",
"metadata_store_service_pb2",
".",
"PutContextsRequest",
"(",
")",
"for",
"x",
"in",
"contexts... | https://github.com/google/ml-metadata/blob/b60196492d2ea2bcd8e4ddff0f3757e5fd710e4d/ml_metadata/metadata_store/metadata_store.py#L425-L455 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/onnx/mx2onnx/_op_translations.py | python | convert_minus_scalar | (node, **kwargs) | return scalar_op_helper(node, 'Sub', **kwargs) | Map MXNet's _minus_scalar operator attributes to onnx's Minus operator.
Creates a new node for the input scalar value, adds it to the initializer
and return multiple created nodes. | Map MXNet's _minus_scalar operator attributes to onnx's Minus operator.
Creates a new node for the input scalar value, adds it to the initializer
and return multiple created nodes. | [
"Map",
"MXNet",
"s",
"_minus_scalar",
"operator",
"attributes",
"to",
"onnx",
"s",
"Minus",
"operator",
".",
"Creates",
"a",
"new",
"node",
"for",
"the",
"input",
"scalar",
"value",
"adds",
"it",
"to",
"the",
"initializer",
"and",
"return",
"multiple",
"crea... | def convert_minus_scalar(node, **kwargs):
"""Map MXNet's _minus_scalar operator attributes to onnx's Minus operator.
Creates a new node for the input scalar value, adds it to the initializer
and return multiple created nodes.
"""
return scalar_op_helper(node, 'Sub', **kwargs) | [
"def",
"convert_minus_scalar",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"scalar_op_helper",
"(",
"node",
",",
"'Sub'",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1080-L1085 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/dygraph/dygraph_to_static/utils.py | python | BaseNodeVisitor.visit | (self, node) | return ret | Visit a node. | Visit a node. | [
"Visit",
"a",
"node",
"."
] | def visit(self, node):
"""Visit a node."""
self.ancestor_nodes.append(node)
method = 'visit_' + node.__class__.__name__
visitor = getattr(self, method, self.generic_visit)
ret = visitor(node)
self.ancestor_nodes.pop()
return ret | [
"def",
"visit",
"(",
"self",
",",
"node",
")",
":",
"self",
".",
"ancestor_nodes",
".",
"append",
"(",
"node",
")",
"method",
"=",
"'visit_'",
"+",
"node",
".",
"__class__",
".",
"__name__",
"visitor",
"=",
"getattr",
"(",
"self",
",",
"method",
",",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dygraph/dygraph_to_static/utils.py#L51-L59 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/fractions.py | python | Fraction.__lt__ | (a, b) | return a._richcmp(b, operator.lt) | a < b | a < b | [
"a",
"<",
"b"
] | def __lt__(a, b):
"""a < b"""
return a._richcmp(b, operator.lt) | [
"def",
"__lt__",
"(",
"a",
",",
"b",
")",
":",
"return",
"a",
".",
"_richcmp",
"(",
"b",
",",
"operator",
".",
"lt",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/fractions.py#L606-L608 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/backend.py | python | gradients | (loss, variables) | return gradients_module.gradients(
loss, variables, colocate_gradients_with_ops=True) | Returns the gradients of `loss` w.r.t. `variables`.
Args:
loss: Scalar tensor to minimize.
variables: List of variables.
Returns:
A gradients tensor. | Returns the gradients of `loss` w.r.t. `variables`. | [
"Returns",
"the",
"gradients",
"of",
"loss",
"w",
".",
"r",
".",
"t",
".",
"variables",
"."
] | def gradients(loss, variables):
"""Returns the gradients of `loss` w.r.t. `variables`.
Args:
loss: Scalar tensor to minimize.
variables: List of variables.
Returns:
A gradients tensor.
"""
return gradients_module.gradients(
loss, variables, colocate_gradients_with_ops=True) | [
"def",
"gradients",
"(",
"loss",
",",
"variables",
")",
":",
"return",
"gradients_module",
".",
"gradients",
"(",
"loss",
",",
"variables",
",",
"colocate_gradients_with_ops",
"=",
"True",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/backend.py#L4133-L4144 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/traitlets/py3/traitlets/traitlets.py | python | HasTraits.trait_events | (cls, name=None) | return events | Get a ``dict`` of all the event handlers of this class.
Parameters
----------
name : str (default: None)
The name of a trait of this class. If name is ``None`` then all
the event handlers of this class will be returned instead.
Returns
-------
Th... | Get a ``dict`` of all the event handlers of this class. | [
"Get",
"a",
"dict",
"of",
"all",
"the",
"event",
"handlers",
"of",
"this",
"class",
"."
] | def trait_events(cls, name=None):
"""Get a ``dict`` of all the event handlers of this class.
Parameters
----------
name : str (default: None)
The name of a trait of this class. If name is ``None`` then all
the event handlers of this class will be returned instead... | [
"def",
"trait_events",
"(",
"cls",
",",
"name",
"=",
"None",
")",
":",
"events",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"getmembers",
"(",
"cls",
")",
":",
"if",
"isinstance",
"(",
"v",
",",
"EventHandler",
")",
":",
"if",
"name",
"is",
"None... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py3/traitlets/traitlets.py#L1650-L1673 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchStructure.py | python | _StructuralSystem.getAxisPlacement | (self,obj) | return None | returns an axis placement | returns an axis placement | [
"returns",
"an",
"axis",
"placement"
] | def getAxisPlacement(self,obj):
"returns an axis placement"
if obj.Axes:
return obj.Axes[0].Placement
return None | [
"def",
"getAxisPlacement",
"(",
"self",
",",
"obj",
")",
":",
"if",
"obj",
".",
"Axes",
":",
"return",
"obj",
".",
"Axes",
"[",
"0",
"]",
".",
"Placement",
"return",
"None"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchStructure.py#L1442-L1446 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | catboost/python-package/catboost/metrics.py | python | _set_param | (metric_obj, value, name) | Validate a new parameter value in a created metric object. | Validate a new parameter value in a created metric object. | [
"Validate",
"a",
"new",
"parameter",
"value",
"in",
"a",
"created",
"metric",
"object",
"."
] | def _set_param(metric_obj, value, name):
"""Validate a new parameter value in a created metric object."""
if name not in metric_obj._valid_params:
raise ValueError('Metric {} doesn\'t have a parameter {}.'.format(metric_obj.__name__, name))
setattr(metric_obj, '_' + name, value) | [
"def",
"_set_param",
"(",
"metric_obj",
",",
"value",
",",
"name",
")",
":",
"if",
"name",
"not",
"in",
"metric_obj",
".",
"_valid_params",
":",
"raise",
"ValueError",
"(",
"'Metric {} doesn\\'t have a parameter {}.'",
".",
"format",
"(",
"metric_obj",
".",
"__n... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/catboost/python-package/catboost/metrics.py#L220-L224 | ||
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/app/forcefield.py | python | _createFunctions | (force, functions) | Add TabulatedFunctions to a Force based on the information that was recorded by _parseFunctions(). | Add TabulatedFunctions to a Force based on the information that was recorded by _parseFunctions(). | [
"Add",
"TabulatedFunctions",
"to",
"a",
"Force",
"based",
"on",
"the",
"information",
"that",
"was",
"recorded",
"by",
"_parseFunctions",
"()",
"."
] | def _createFunctions(force, functions):
"""Add TabulatedFunctions to a Force based on the information that was recorded by _parseFunctions()."""
for (name, type, values, params) in functions:
if type == 'Continuous1D':
force.addTabulatedFunction(
name,
mm.Cont... | [
"def",
"_createFunctions",
"(",
"force",
",",
"functions",
")",
":",
"for",
"(",
"name",
",",
"type",
",",
"values",
",",
"params",
")",
"in",
"functions",
":",
"if",
"type",
"==",
"'Continuous1D'",
":",
"force",
".",
"addTabulatedFunction",
"(",
"name",
... | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/forcefield.py#L98-L134 | ||
PrincetonUniversity/athena-public-version | 9c266692b9423743d8e23509b3ab266a232a92d2 | tst/style/cpplint.py | python | _IsSourceExtension | (s) | return s in GetNonHeaderExtensions() | File extension (excluding dot) matches a source file extension. | File extension (excluding dot) matches a source file extension. | [
"File",
"extension",
"(",
"excluding",
"dot",
")",
"matches",
"a",
"source",
"file",
"extension",
"."
] | def _IsSourceExtension(s):
"""File extension (excluding dot) matches a source file extension."""
return s in GetNonHeaderExtensions() | [
"def",
"_IsSourceExtension",
"(",
"s",
")",
":",
"return",
"s",
"in",
"GetNonHeaderExtensions",
"(",
")"
] | https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/tst/style/cpplint.py#L830-L832 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/typeinfer.py | python | CallConstraint._add_refine_map | (self, typeinfer, typevars, sig) | Add this expression to the refine_map base on the type of target_type | Add this expression to the refine_map base on the type of target_type | [
"Add",
"this",
"expression",
"to",
"the",
"refine_map",
"base",
"on",
"the",
"type",
"of",
"target_type"
] | def _add_refine_map(self, typeinfer, typevars, sig):
"""Add this expression to the refine_map base on the type of target_type
"""
target_type = typevars[self.target].getone()
# Array
if (isinstance(target_type, types.Array)
and isinstance(sig.return_type.dtype, ty... | [
"def",
"_add_refine_map",
"(",
"self",
",",
"typeinfer",
",",
"typevars",
",",
"sig",
")",
":",
"target_type",
"=",
"typevars",
"[",
"self",
".",
"target",
"]",
".",
"getone",
"(",
")",
"# Array",
"if",
"(",
"isinstance",
"(",
"target_type",
",",
"types"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/typeinfer.py#L572-L583 | ||
ablab/spades | 3a754192b88540524ce6fb69eef5ea9273a38465 | assembler/ext/src/python_libs/joblib3/memory.py | python | MemorizedFunc._hash_func | (self) | return id(self.func), hash(self.func), func_code_h | Hash a function to key the online cache | Hash a function to key the online cache | [
"Hash",
"a",
"function",
"to",
"key",
"the",
"online",
"cache"
] | def _hash_func(self):
"""Hash a function to key the online cache"""
func_code_h = hash(getattr(self.func, '__code__', None))
return id(self.func), hash(self.func), func_code_h | [
"def",
"_hash_func",
"(",
"self",
")",
":",
"func_code_h",
"=",
"hash",
"(",
"getattr",
"(",
"self",
".",
"func",
",",
"'__code__'",
",",
"None",
")",
")",
"return",
"id",
"(",
"self",
".",
"func",
")",
",",
"hash",
"(",
"self",
".",
"func",
")",
... | https://github.com/ablab/spades/blob/3a754192b88540524ce6fb69eef5ea9273a38465/assembler/ext/src/python_libs/joblib3/memory.py#L532-L535 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/l2hmc/l2hmc.py | python | loss_and_grads | (dynamics, x, loss_fn=compute_loss) | return loss_val, grads, out, accept_prob | Obtain loss value and gradients. | Obtain loss value and gradients. | [
"Obtain",
"loss",
"value",
"and",
"gradients",
"."
] | def loss_and_grads(dynamics, x, loss_fn=compute_loss):
"""Obtain loss value and gradients."""
with tf.GradientTape() as tape:
loss_val, out, accept_prob = loss_fn(dynamics, x)
grads = tape.gradient(loss_val, dynamics.trainable_variables)
return loss_val, grads, out, accept_prob | [
"def",
"loss_and_grads",
"(",
"dynamics",
",",
"x",
",",
"loss_fn",
"=",
"compute_loss",
")",
":",
"with",
"tf",
".",
"GradientTape",
"(",
")",
"as",
"tape",
":",
"loss_val",
",",
"out",
",",
"accept_prob",
"=",
"loss_fn",
"(",
"dynamics",
",",
"x",
")... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/l2hmc/l2hmc.py#L345-L351 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.