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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/controls.py | python | UIContent.__getitem__ | (self, lineno: int) | Make it iterable (iterate line by line). | Make it iterable (iterate line by line). | [
"Make",
"it",
"iterable",
"(",
"iterate",
"line",
"by",
"line",
")",
"."
] | def __getitem__(self, lineno: int) -> StyleAndTextTuples:
"Make it iterable (iterate line by line)."
if lineno < self.line_count:
return self.get_line(lineno)
else:
raise IndexError | [
"def",
"__getitem__",
"(",
"self",
",",
"lineno",
":",
"int",
")",
"->",
"StyleAndTextTuples",
":",
"if",
"lineno",
"<",
"self",
".",
"line_count",
":",
"return",
"self",
".",
"get_line",
"(",
"lineno",
")",
"else",
":",
"raise",
"IndexError"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/controls.py#L177-L182 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py | python | TensorFlowDataFrame.from_csv | (cls,
filepatterns,
default_values,
has_header=True,
column_names=None,
num_threads=1,
enqueue_size=None,
batch_size=32,
queue_capacity=None,
min_after_dequeue=None,
shuf... | return cls._from_csv_base(filepatterns, get_default_values, has_header,
column_names, num_threads,
enqueue_size, batch_size, queue_capacity,
min_after_dequeue, shuffle, seed) | Create a `DataFrame` from CSV files.
If `has_header` is false, then `column_names` must be specified. If
`has_header` is true and `column_names` are specified, then `column_names`
overrides the names in the header.
Args:
filepatterns: a list of file patterns that resolve to CSV files.
defa... | Create a `DataFrame` from CSV files. | [
"Create",
"a",
"DataFrame",
"from",
"CSV",
"files",
"."
] | def from_csv(cls,
filepatterns,
default_values,
has_header=True,
column_names=None,
num_threads=1,
enqueue_size=None,
batch_size=32,
queue_capacity=None,
min_after_dequeue=None,
... | [
"def",
"from_csv",
"(",
"cls",
",",
"filepatterns",
",",
"default_values",
",",
"has_header",
"=",
"True",
",",
"column_names",
"=",
"None",
",",
"num_threads",
"=",
"1",
",",
"enqueue_size",
"=",
"None",
",",
"batch_size",
"=",
"32",
",",
"queue_capacity",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py#L330-L378 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/_cpconfig.py | python | Config.__call__ | (self, *args, **kwargs) | return tool_decorator | Decorator for page handlers to set _cp_config. | Decorator for page handlers to set _cp_config. | [
"Decorator",
"for",
"page",
"handlers",
"to",
"set",
"_cp_config",
"."
] | def __call__(self, *args, **kwargs):
"""Decorator for page handlers to set _cp_config."""
if args:
raise TypeError(
"The cherrypy.config decorator does not accept positional "
"arguments; you must use keyword arguments.")
def tool_decorator(f):
... | [
"def",
"__call__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"args",
":",
"raise",
"TypeError",
"(",
"\"The cherrypy.config decorator does not accept positional \"",
"\"arguments; you must use keyword arguments.\"",
")",
"def",
"tool_decora... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/_cpconfig.py#L168-L180 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/callconv.py | python | MinimalCallConv.decorate_function | (self, fn, args, fe_argtypes, noalias=False) | return fn | Set names and attributes of function arguments. | Set names and attributes of function arguments. | [
"Set",
"names",
"and",
"attributes",
"of",
"function",
"arguments",
"."
] | def decorate_function(self, fn, args, fe_argtypes, noalias=False):
"""
Set names and attributes of function arguments.
"""
assert not noalias
arginfo = self._get_arg_packer(fe_argtypes)
arginfo.assign_names(self.get_arguments(fn),
['arg.' + a ... | [
"def",
"decorate_function",
"(",
"self",
",",
"fn",
",",
"args",
",",
"fe_argtypes",
",",
"noalias",
"=",
"False",
")",
":",
"assert",
"not",
"noalias",
"arginfo",
"=",
"self",
".",
"_get_arg_packer",
"(",
"fe_argtypes",
")",
"arginfo",
".",
"assign_names",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/callconv.py#L251-L260 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/models.py | python | Response.links | (self) | return l | Returns the parsed header links of the response, if any. | Returns the parsed header links of the response, if any. | [
"Returns",
"the",
"parsed",
"header",
"links",
"of",
"the",
"response",
"if",
"any",
"."
] | def links(self):
"""Returns the parsed header links of the response, if any."""
header = self.headers.get('link')
# l = MultiDict()
l = {}
if header:
links = parse_header_links(header)
for link in links:
key = link.get('rel') or link.ge... | [
"def",
"links",
"(",
"self",
")",
":",
"header",
"=",
"self",
".",
"headers",
".",
"get",
"(",
"'link'",
")",
"# l = MultiDict()",
"l",
"=",
"{",
"}",
"if",
"header",
":",
"links",
"=",
"parse_header_links",
"(",
"header",
")",
"for",
"link",
"in",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/models.py#L901-L916 | |
moflow/moflow | 2dfb27c799c90c6caf1477508eca3eec616ef7d2 | bap/libtracewrap/libtrace/protobuf/python/mox.py | python | MultipleTimesGroup.MethodCalled | (self, mock_method) | Remove a method call from the group.
If the method is not in the set, an UnexpectedMethodCallError will be
raised.
Args:
mock_method: a mock method that should be equal to a method in the group.
Returns:
The mock method from the group
Raises:
UnexpectedMethodCallError if the mo... | Remove a method call from the group. | [
"Remove",
"a",
"method",
"call",
"from",
"the",
"group",
"."
] | def MethodCalled(self, mock_method):
"""Remove a method call from the group.
If the method is not in the set, an UnexpectedMethodCallError will be
raised.
Args:
mock_method: a mock method that should be equal to a method in the group.
Returns:
The mock method from the group
Raise... | [
"def",
"MethodCalled",
"(",
"self",
",",
"mock_method",
")",
":",
"# Check to see if this method exists, and if so add it to the set of",
"# called methods.",
"for",
"method",
"in",
"self",
".",
"_methods",
":",
"if",
"method",
"==",
"mock_method",
":",
"self",
".",
"... | https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/mox.py#L1285-L1316 | ||
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/sat/python/cp_model.py | python | LinearExpr.RebuildFromLinearExpressionProto | (cls, model, proto) | Recreate a LinearExpr from a LinearExpressionProto. | Recreate a LinearExpr from a LinearExpressionProto. | [
"Recreate",
"a",
"LinearExpr",
"from",
"a",
"LinearExpressionProto",
"."
] | def RebuildFromLinearExpressionProto(cls, model, proto):
"""Recreate a LinearExpr from a LinearExpressionProto."""
offset = proto.offset
num_elements = len(proto.vars)
if num_elements == 0:
return offset
elif num_elements == 1:
return IntVar(model, proto.v... | [
"def",
"RebuildFromLinearExpressionProto",
"(",
"cls",
",",
"model",
",",
"proto",
")",
":",
"offset",
"=",
"proto",
".",
"offset",
"num_elements",
"=",
"len",
"(",
"proto",
".",
"vars",
")",
"if",
"num_elements",
"==",
"0",
":",
"return",
"offset",
"elif"... | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/sat/python/cp_model.py#L212-L232 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | models/AI-Model-Zoo/caffe-xilinx/scripts/cpp_lint.py | python | _BlockInfo.CheckEnd | (self, filename, clean_lines, linenum, error) | Run checks that applies to text after the closing brace.
This is mostly used for checking end of namespace comments.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to... | Run checks that applies to text after the closing brace. | [
"Run",
"checks",
"that",
"applies",
"to",
"text",
"after",
"the",
"closing",
"brace",
"."
] | def CheckEnd(self, filename, clean_lines, linenum, error):
"""Run checks that applies to text after the closing brace.
This is mostly used for checking end of namespace comments.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
line... | [
"def",
"CheckEnd",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"pass"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/scripts/cpp_lint.py#L1778-L1789 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/command/bdist_egg.py | python | bdist_egg.call_command | (self, cmdname, **kw) | return cmd | Invoke reinitialized command `cmdname` with keyword args | Invoke reinitialized command `cmdname` with keyword args | [
"Invoke",
"reinitialized",
"command",
"cmdname",
"with",
"keyword",
"args"
] | def call_command(self, cmdname, **kw):
"""Invoke reinitialized command `cmdname` with keyword args"""
for dirname in INSTALL_DIRECTORY_ATTRS:
kw.setdefault(dirname, self.bdist_dir)
kw.setdefault('skip_build', self.skip_build)
kw.setdefault('dry_run', self.dry_run)
cmd... | [
"def",
"call_command",
"(",
"self",
",",
"cmdname",
",",
"*",
"*",
"kw",
")",
":",
"for",
"dirname",
"in",
"INSTALL_DIRECTORY_ATTRS",
":",
"kw",
".",
"setdefault",
"(",
"dirname",
",",
"self",
".",
"bdist_dir",
")",
"kw",
".",
"setdefault",
"(",
"'skip_b... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/command/bdist_egg.py#L151-L159 | |
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/deephol/deephol_loop/prover_runner.py | python | training_examples_pipeline | (
proof_logs,
tactics_filename: Text,
theorem_db: proof_assistant_pb2.TheoremDatabase,
examples_sstables: List[Text],
scrub_parameters: options_pb2.ConvertorOptions.ScrubParametersEnum,
) | Create the pipeline to convert ProofLogs to Examples.
Args:
proof_logs: beam node for the proof logs.
tactics_filename: Name for the tactics file.
theorem_db: Theorem database file.
examples_sstables: List of strings with sstable pattern to write the
examples to.
scrub_parameters: Theorem p... | Create the pipeline to convert ProofLogs to Examples. | [
"Create",
"the",
"pipeline",
"to",
"convert",
"ProofLogs",
"to",
"Examples",
"."
] | def training_examples_pipeline(
proof_logs,
tactics_filename: Text,
theorem_db: proof_assistant_pb2.TheoremDatabase,
examples_sstables: List[Text],
scrub_parameters: options_pb2.ConvertorOptions.ScrubParametersEnum,
):
"""Create the pipeline to convert ProofLogs to Examples.
Args:
proof_log... | [
"def",
"training_examples_pipeline",
"(",
"proof_logs",
",",
"tactics_filename",
":",
"Text",
",",
"theorem_db",
":",
"proof_assistant_pb2",
".",
"TheoremDatabase",
",",
"examples_sstables",
":",
"List",
"[",
"Text",
"]",
",",
"scrub_parameters",
":",
"options_pb2",
... | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/deephol/deephol_loop/prover_runner.py#L112-L144 | ||
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | mp/src/thirdparty/protobuf-2.3.0/python/mox.py | python | Mox.CreateMockAnything | (self) | return new_mock | Create a mock that will accept any method calls.
This does not enforce an interface. | Create a mock that will accept any method calls. | [
"Create",
"a",
"mock",
"that",
"will",
"accept",
"any",
"method",
"calls",
"."
] | def CreateMockAnything(self):
"""Create a mock that will accept any method calls.
This does not enforce an interface.
"""
new_mock = MockAnything()
self._mock_objects.append(new_mock)
return new_mock | [
"def",
"CreateMockAnything",
"(",
"self",
")",
":",
"new_mock",
"=",
"MockAnything",
"(",
")",
"self",
".",
"_mock_objects",
".",
"append",
"(",
"new_mock",
")",
"return",
"new_mock"
] | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/mox.py#L179-L187 | |
0vercl0k/rp | 5fe693c26d76b514efaedb4084f6e37d820db023 | src/third_party/capstone/bindings/python/capstone/__init__.py | python | copy_ctypes | (src) | return dst | Returns a new ctypes object which is a bitwise copy of an existing one | Returns a new ctypes object which is a bitwise copy of an existing one | [
"Returns",
"a",
"new",
"ctypes",
"object",
"which",
"is",
"a",
"bitwise",
"copy",
"of",
"an",
"existing",
"one"
] | def copy_ctypes(src):
"""Returns a new ctypes object which is a bitwise copy of an existing one"""
dst = type(src)()
ctypes.memmove(ctypes.byref(dst), ctypes.byref(src), ctypes.sizeof(type(src)))
return dst | [
"def",
"copy_ctypes",
"(",
"src",
")",
":",
"dst",
"=",
"type",
"(",
"src",
")",
"(",
")",
"ctypes",
".",
"memmove",
"(",
"ctypes",
".",
"byref",
"(",
"dst",
")",
",",
"ctypes",
".",
"byref",
"(",
"src",
")",
",",
"ctypes",
".",
"sizeof",
"(",
... | https://github.com/0vercl0k/rp/blob/5fe693c26d76b514efaedb4084f6e37d820db023/src/third_party/capstone/bindings/python/capstone/__init__.py#L320-L324 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/abs_ds.py | python | _abs_ds_tbe | () | return | Abs TBE register | Abs TBE register | [
"Abs",
"TBE",
"register"
] | def _abs_ds_tbe():
"""Abs TBE register"""
return | [
"def",
"_abs_ds_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/abs_ds.py#L37-L39 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/vqs/mc/mc_state/state.py | python | MCState.log_value | (self, σ: jnp.ndarray) | return jit_evaluate(self._apply_fun, self.variables, σ) | Evaluate the variational state for a batch of states and returns
the logarithm of the amplitude of the quantum state. For pure states,
this is :math:`log(<σ|ψ>)`, whereas for mixed states this is
:math:`log(<σr|ρ|σc>)`, where ψ and ρ are respectively a pure state
(wavefunction) and a mix... | Evaluate the variational state for a batch of states and returns
the logarithm of the amplitude of the quantum state. For pure states,
this is :math:`log(<σ|ψ>)`, whereas for mixed states this is
:math:`log(<σr|ρ|σc>)`, where ψ and ρ are respectively a pure state
(wavefunction) and a mix... | [
"Evaluate",
"the",
"variational",
"state",
"for",
"a",
"batch",
"of",
"states",
"and",
"returns",
"the",
"logarithm",
"of",
"the",
"amplitude",
"of",
"the",
"quantum",
"state",
".",
"For",
"pure",
"states",
"this",
"is",
":",
"math",
":",
"log",
"(",
"<σ... | def log_value(self, σ: jnp.ndarray) -> jnp.ndarray:
"""
Evaluate the variational state for a batch of states and returns
the logarithm of the amplitude of the quantum state. For pure states,
this is :math:`log(<σ|ψ>)`, whereas for mixed states this is
:math:`log(<σr|ρ|σc>)`, wher... | [
"def",
"log_value",
"(",
"self",
",",
"σ:",
" ",
"np.",
"n",
"darray)",
" ",
"> ",
"np.",
"n",
"darray:",
"",
"return",
"jit_evaluate",
"(",
"self",
".",
"_apply_fun",
",",
"self",
".",
"variables",
",",
"σ)",
""
] | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/vqs/mc/mc_state/state.py#L538-L550 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenuButton.ProcessLeftUp | (self, pt) | return True | Handles left up mouse events.
:param `pt`: an instance of :class:`Point` where the left mouse button was released. | Handles left up mouse events. | [
"Handles",
"left",
"up",
"mouse",
"events",
"."
] | def ProcessLeftUp(self, pt):
"""
Handles left up mouse events.
:param `pt`: an instance of :class:`Point` where the left mouse button was released.
"""
# always stop the timer
self._timer.Stop()
if not self.Contains(pt):
return False
self._... | [
"def",
"ProcessLeftUp",
"(",
"self",
",",
"pt",
")",
":",
"# always stop the timer",
"self",
".",
"_timer",
".",
"Stop",
"(",
")",
"if",
"not",
"self",
".",
"Contains",
"(",
"pt",
")",
":",
"return",
"False",
"self",
".",
"_state",
"=",
"ControlFocus",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L4021-L4037 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/array_analysis.py | python | ShapeEquivSet.get_equiv_const | (self, obj) | return super(ShapeEquivSet, self).get_equiv_const(names[0]) | If the given object is equivalent to a constant scalar,
return the scalar value, or None otherwise. | If the given object is equivalent to a constant scalar,
return the scalar value, or None otherwise. | [
"If",
"the",
"given",
"object",
"is",
"equivalent",
"to",
"a",
"constant",
"scalar",
"return",
"the",
"scalar",
"value",
"or",
"None",
"otherwise",
"."
] | def get_equiv_const(self, obj):
"""If the given object is equivalent to a constant scalar,
return the scalar value, or None otherwise.
"""
names = self._get_names(obj)
if len(names) > 1:
return None
return super(ShapeEquivSet, self).get_equiv_const(names[0]) | [
"def",
"get_equiv_const",
"(",
"self",
",",
"obj",
")",
":",
"names",
"=",
"self",
".",
"_get_names",
"(",
"obj",
")",
"if",
"len",
"(",
"names",
")",
">",
"1",
":",
"return",
"None",
"return",
"super",
"(",
"ShapeEquivSet",
",",
"self",
")",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/array_analysis.py#L416-L423 | |
apache/kudu | 90895ce76590f10730ad7aac3613b69d89ff5422 | build-support/iwyu/fix_includes.py | python | _GetLineKind | (file_line, filename, flags) | Given a file_line + file being edited, return best *_KIND value or None.
Arguments:
file_line: the LineInfo structure to be analyzed
filename: the file which contains the line to be analyzed
flags: the program flags. Uses 'separate_project_includes' and 'thirdparty_include_dirs' | Given a file_line + file being edited, return best *_KIND value or None. | [
"Given",
"a",
"file_line",
"+",
"file",
"being",
"edited",
"return",
"best",
"*",
"_KIND",
"value",
"or",
"None",
"."
] | def _GetLineKind(file_line, filename, flags):
"""Given a file_line + file being edited, return best *_KIND value or None.
Arguments:
file_line: the LineInfo structure to be analyzed
filename: the file which contains the line to be analyzed
flags: the program flags. Uses 'separate_project_includes' and ... | [
"def",
"_GetLineKind",
"(",
"file_line",
",",
"filename",
",",
"flags",
")",
":",
"if",
"flags",
".",
"source_root",
":",
"filename",
"=",
"os",
".",
"path",
".",
"relpath",
"(",
"filename",
",",
"flags",
".",
"source_root",
")",
"line_without_coments",
"=... | https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/build-support/iwyu/fix_includes.py#L1661-L1692 | ||
thomaskeck/FastBDT | e67f71525612020acc78721031fca681d173c144 | examples/splot.py | python | calculate_splot_weights | (pdfs, yields) | return [sum(covariance[n, k] * pdfs[k] for k in range(N_components)) /
sum(yields[k] * pdfs[k] for k in range(N_components)) for n in range(N_components)] | Calculates sPlot weights using the pdfs
@param pdfs list of 1-d numpy.array with pdf values of the different components for each event
@param yields list of the yields of the different components | Calculates sPlot weights using the pdfs | [
"Calculates",
"sPlot",
"weights",
"using",
"the",
"pdfs"
] | def calculate_splot_weights(pdfs, yields):
"""
Calculates sPlot weights using the pdfs
@param pdfs list of 1-d numpy.array with pdf values of the different components for each event
@param yields list of the yields of the different components
"""
N_components = len(pdfs)
# Consistenc... | [
"def",
"calculate_splot_weights",
"(",
"pdfs",
",",
"yields",
")",
":",
"N_components",
"=",
"len",
"(",
"pdfs",
")",
"# Consistency checks",
"if",
"N_components",
"!=",
"len",
"(",
"yields",
")",
":",
"raise",
"RuntimeError",
"(",
"\"You have to provide the same ... | https://github.com/thomaskeck/FastBDT/blob/e67f71525612020acc78721031fca681d173c144/examples/splot.py#L70-L95 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/ogl/_basic.py | python | Shape.SortLines | (self, attachment, linesToSort) | Reorder the lines coming into the node image at this attachment
position, in the order in which they appear in linesToSort.
Any remaining lines not in the list will be added to the end. | Reorder the lines coming into the node image at this attachment
position, in the order in which they appear in linesToSort. | [
"Reorder",
"the",
"lines",
"coming",
"into",
"the",
"node",
"image",
"at",
"this",
"attachment",
"position",
"in",
"the",
"order",
"in",
"which",
"they",
"appear",
"in",
"linesToSort",
"."
] | def SortLines(self, attachment, linesToSort):
""" Reorder the lines coming into the node image at this attachment
position, in the order in which they appear in linesToSort.
Any remaining lines not in the list will be added to the end.
"""
# This is a temporary store of all the ... | [
"def",
"SortLines",
"(",
"self",
",",
"attachment",
",",
"linesToSort",
")",
":",
"# This is a temporary store of all the lines at this attachment",
"# point. We'll tick them off as we've processed them.",
"linesAtThisAttachment",
"=",
"[",
"]",
"for",
"line",
"in",
"self",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_basic.py#L962-L985 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/signal/bsplines.py | python | quadratic | (x) | return res | A quadratic B-spline.
This is a special case of `bspline`, and equivalent to ``bspline(x, 2)``. | A quadratic B-spline. | [
"A",
"quadratic",
"B",
"-",
"spline",
"."
] | def quadratic(x):
"""A quadratic B-spline.
This is a special case of `bspline`, and equivalent to ``bspline(x, 2)``.
"""
ax = abs(asarray(x))
res = zeros_like(ax)
cond1 = less(ax, 0.5)
if cond1.any():
ax1 = ax[cond1]
res[cond1] = 0.75 - ax1 ** 2
cond2 = ~cond1 & less(ax,... | [
"def",
"quadratic",
"(",
"x",
")",
":",
"ax",
"=",
"abs",
"(",
"asarray",
"(",
"x",
")",
")",
"res",
"=",
"zeros_like",
"(",
"ax",
")",
"cond1",
"=",
"less",
"(",
"ax",
",",
"0.5",
")",
"if",
"cond1",
".",
"any",
"(",
")",
":",
"ax1",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/bsplines.py#L157-L172 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/sparse/sputils.py | python | isscalarlike | (x) | return np.isscalar(x) or (isdense(x) and x.ndim == 0) | Is x either a scalar, an array scalar, or a 0-dim array? | Is x either a scalar, an array scalar, or a 0-dim array? | [
"Is",
"x",
"either",
"a",
"scalar",
"an",
"array",
"scalar",
"or",
"a",
"0",
"-",
"dim",
"array?"
] | def isscalarlike(x):
"""Is x either a scalar, an array scalar, or a 0-dim array?"""
return np.isscalar(x) or (isdense(x) and x.ndim == 0) | [
"def",
"isscalarlike",
"(",
"x",
")",
":",
"return",
"np",
".",
"isscalar",
"(",
"x",
")",
"or",
"(",
"isdense",
"(",
"x",
")",
"and",
"x",
".",
"ndim",
"==",
"0",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/sparse/sputils.py#L189-L191 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/lib/npyio.py | python | NpzFile.iterkeys | (self) | return self.__iter__() | Return an iterator over the files in the archive. | Return an iterator over the files in the archive. | [
"Return",
"an",
"iterator",
"over",
"the",
"files",
"in",
"the",
"archive",
"."
] | def iterkeys(self):
"""Return an iterator over the files in the archive."""
return self.__iter__() | [
"def",
"iterkeys",
"(",
"self",
")",
":",
"return",
"self",
".",
"__iter__",
"(",
")"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/npyio.py#L257-L259 | |
KhronosGroup/Vulkan-Headers | b32da5329b50e3cb96229aaecba9ded032fe29cc | registry/cgenerator.py | python | COutputGenerator.endFeature | (self) | Actually write the interface to the output file. | Actually write the interface to the output file. | [
"Actually",
"write",
"the",
"interface",
"to",
"the",
"output",
"file",
"."
] | def endFeature(self):
"Actually write the interface to the output file."
# C-specific
if self.emit:
if self.feature_not_empty:
if self.genOpts.conventions.writeFeature(self.featureExtraProtect, self.genOpts.filename):
self.newline()
... | [
"def",
"endFeature",
"(",
"self",
")",
":",
"# C-specific",
"if",
"self",
".",
"emit",
":",
"if",
"self",
".",
"feature_not_empty",
":",
"if",
"self",
".",
"genOpts",
".",
"conventions",
".",
"writeFeature",
"(",
"self",
".",
"featureExtraProtect",
",",
"s... | https://github.com/KhronosGroup/Vulkan-Headers/blob/b32da5329b50e3cb96229aaecba9ded032fe29cc/registry/cgenerator.py#L196-L233 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/agents/trajectory_generator/tg_inplace.py | python | step | (current_phases, leg_frequencies, dt, tg_params) | return new_phases, extensions | Steps forward the in-place trajectory generator.
Args:
current_phases: phases of each leg.
leg_frequencies: the frequency to proceed the phase of each leg.
dt: amount of time (sec) between consecutive time steps.
tg_params: a set of parameters for trajectory generator, see the docstring
of "_ge... | Steps forward the in-place trajectory generator. | [
"Steps",
"forward",
"the",
"in",
"-",
"place",
"trajectory",
"generator",
"."
] | def step(current_phases, leg_frequencies, dt, tg_params):
"""Steps forward the in-place trajectory generator.
Args:
current_phases: phases of each leg.
leg_frequencies: the frequency to proceed the phase of each leg.
dt: amount of time (sec) between consecutive time steps.
tg_params: a set of param... | [
"def",
"step",
"(",
"current_phases",
",",
"leg_frequencies",
",",
"dt",
",",
"tg_params",
")",
":",
"new_phases",
"=",
"np",
".",
"fmod",
"(",
"current_phases",
"+",
"TWO_PI",
"*",
"leg_frequencies",
"*",
"dt",
",",
"TWO_PI",
")",
"extensions",
"=",
"[",
... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/agents/trajectory_generator/tg_inplace.py#L34-L53 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/numeric.py | python | isclose | (a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False) | Returns a boolean array where two arrays are element-wise equal within a
tolerance.
The tolerance values are positive, typically very small numbers. The
relative difference (`rtol` * abs(`b`)) and the absolute difference
`atol` are added together to compare against the absolute difference
between ... | Returns a boolean array where two arrays are element-wise equal within a
tolerance. | [
"Returns",
"a",
"boolean",
"array",
"where",
"two",
"arrays",
"are",
"element",
"-",
"wise",
"equal",
"within",
"a",
"tolerance",
"."
] | def isclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False):
"""
Returns a boolean array where two arrays are element-wise equal within a
tolerance.
The tolerance values are positive, typically very small numbers. The
relative difference (`rtol` * abs(`b`)) and the absolute difference
`atol` ar... | [
"def",
"isclose",
"(",
"a",
",",
"b",
",",
"rtol",
"=",
"1.e-5",
",",
"atol",
"=",
"1.e-8",
",",
"equal_nan",
"=",
"False",
")",
":",
"def",
"within_tol",
"(",
"x",
",",
"y",
",",
"atol",
",",
"rtol",
")",
":",
"with",
"errstate",
"(",
"invalid",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/numeric.py#L2168-L2280 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/bench_find_anomalies.py | python | RunExperimentalPipeline.run | (self, bench_name, description) | The root pipeline that start simulation tasks and generating report.
This spawns tasks to spawn more tasks that run simulation and executes the
generate report task on the aggregated the results.
Args:
bench_name: A string bench name.
description: A string description of this bench job.
Y... | The root pipeline that start simulation tasks and generating report. | [
"The",
"root",
"pipeline",
"that",
"start",
"simulation",
"tasks",
"and",
"generating",
"report",
"."
] | def run(self, bench_name, description): # pylint: disable=invalid-name
"""The root pipeline that start simulation tasks and generating report.
This spawns tasks to spawn more tasks that run simulation and executes the
generate report task on the aggregated the results.
Args:
bench_name: A strin... | [
"def",
"run",
"(",
"self",
",",
"bench_name",
",",
"description",
")",
":",
"# pylint: disable=invalid-name",
"test_bench_keys",
"=",
"TestBench",
".",
"query",
"(",
")",
".",
"fetch",
"(",
"keys_only",
"=",
"True",
")",
"test_bench_ids",
"=",
"[",
"k",
".",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/bench_find_anomalies.py#L338-L365 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/learn/python/learn/estimators/svm.py | python | SVM.predict | (self, x=None, input_fn=None, batch_size=None, as_iterable=False) | return preds[linear._CLASSES] | Runs inference to determine the predicted class. | Runs inference to determine the predicted class. | [
"Runs",
"inference",
"to",
"determine",
"the",
"predicted",
"class",
"."
] | def predict(self, x=None, input_fn=None, batch_size=None, as_iterable=False):
"""Runs inference to determine the predicted class."""
preds = self._estimator.predict(x=x, input_fn=input_fn,
batch_size=batch_size,
outputs=[linear._CLASSES],
... | [
"def",
"predict",
"(",
"self",
",",
"x",
"=",
"None",
",",
"input_fn",
"=",
"None",
",",
"batch_size",
"=",
"None",
",",
"as_iterable",
"=",
"False",
")",
":",
"preds",
"=",
"self",
".",
"_estimator",
".",
"predict",
"(",
"x",
"=",
"x",
",",
"input... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/estimators/svm.py#L205-L213 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | ExodusModel._merge_node_pairs | (self, node_pairs) | Merge the given node pairs.
Example:
>>> model._merge_node_pairs([(1, 3), (2, 5), (1, 5)]) | Merge the given node pairs. | [
"Merge",
"the",
"given",
"node",
"pairs",
"."
] | def _merge_node_pairs(self, node_pairs):
"""
Merge the given node pairs.
Example:
>>> model._merge_node_pairs([(1, 3), (2, 5), (1, 5)])
"""
# create groups of nodes to merge
node_group = [None] * len(self.nodes)
merge_group = []
for pair in node_... | [
"def",
"_merge_node_pairs",
"(",
"self",
",",
"node_pairs",
")",
":",
"# create groups of nodes to merge",
"node_group",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"self",
".",
"nodes",
")",
"merge_group",
"=",
"[",
"]",
"for",
"pair",
"in",
"node_pairs",
":",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L7032-L7069 | ||
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/__init__.py | python | Node.remove | (self) | return None | Remove this Node: no-op by default. | Remove this Node: no-op by default. | [
"Remove",
"this",
"Node",
":",
"no",
"-",
"op",
"by",
"default",
"."
] | def remove(self):
"""Remove this Node: no-op by default."""
return None | [
"def",
"remove",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/__init__.py#L1267-L1269 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/lib/demo.py | python | Demo._get_index | (self,index) | return index | Get the current block index, validating and checking status.
Returns None if the demo is finished | Get the current block index, validating and checking status. | [
"Get",
"the",
"current",
"block",
"index",
"validating",
"and",
"checking",
"status",
"."
] | def _get_index(self,index):
"""Get the current block index, validating and checking status.
Returns None if the demo is finished"""
if index is None:
if self.finished:
print('Demo finished. Use <demo_name>.reset() if you want to rerun it.')
return N... | [
"def",
"_get_index",
"(",
"self",
",",
"index",
")",
":",
"if",
"index",
"is",
"None",
":",
"if",
"self",
".",
"finished",
":",
"print",
"(",
"'Demo finished. Use <demo_name>.reset() if you want to rerun it.'",
")",
"return",
"None",
"index",
"=",
"self",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/lib/demo.py#L322-L334 | |
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | scripts/cpp_lint.py | python | _VerboseLevel | () | return _cpplint_state.verbose_level | Returns the module's verbosity setting. | Returns the module's verbosity setting. | [
"Returns",
"the",
"module",
"s",
"verbosity",
"setting",
"."
] | def _VerboseLevel():
"""Returns the module's verbosity setting."""
return _cpplint_state.verbose_level | [
"def",
"_VerboseLevel",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"verbose_level"
] | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/scripts/cpp_lint.py#L777-L779 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py | python | _cf_dictionary_from_tuples | (tuples) | return CoreFoundation.CFDictionaryCreate(
CoreFoundation.kCFAllocatorDefault,
cf_keys,
cf_values,
dictionary_size,
CoreFoundation.kCFTypeDictionaryKeyCallBacks,
CoreFoundation.kCFTypeDictionaryValueCallBacks,
) | Given a list of Python tuples, create an associated CFDictionary. | Given a list of Python tuples, create an associated CFDictionary. | [
"Given",
"a",
"list",
"of",
"Python",
"tuples",
"create",
"an",
"associated",
"CFDictionary",
"."
] | def _cf_dictionary_from_tuples(tuples):
"""
Given a list of Python tuples, create an associated CFDictionary.
"""
dictionary_size = len(tuples)
# We need to get the dictionary keys and values out in the same order.
keys = (t[0] for t in tuples)
values = (t[1] for t in tuples)
cf_keys = ... | [
"def",
"_cf_dictionary_from_tuples",
"(",
"tuples",
")",
":",
"dictionary_size",
"=",
"len",
"(",
"tuples",
")",
"# We need to get the dictionary keys and values out in the same order.",
"keys",
"=",
"(",
"t",
"[",
"0",
"]",
"for",
"t",
"in",
"tuples",
")",
"values"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py#L37-L56 | |
Slicer/Slicer | ba9fadf332cb0303515b68d8d06a344c82e3e3e5 | Modules/Scripted/ScreenCapture/ScreenCapture.py | python | ScreenCaptureLogic.captureImageFromView | (self, view, filename=None, transparentBackground=False, volumeNode=None) | Capture an image of the specified view and store in the specified object.
:param view: View to capture. If none, all views are captured.
:param filename: Filename of the desired output file. If none, no file will be written.
:param transparentBackground: Set the background to be transparent for single-view... | Capture an image of the specified view and store in the specified object. | [
"Capture",
"an",
"image",
"of",
"the",
"specified",
"view",
"and",
"store",
"in",
"the",
"specified",
"object",
"."
] | def captureImageFromView(self, view, filename=None, transparentBackground=False, volumeNode=None):
"""
Capture an image of the specified view and store in the specified object.
:param view: View to capture. If none, all views are captured.
:param filename: Filename of the desired output file. If none, ... | [
"def",
"captureImageFromView",
"(",
"self",
",",
"view",
",",
"filename",
"=",
"None",
",",
"transparentBackground",
"=",
"False",
",",
"volumeNode",
"=",
"None",
")",
":",
"slicer",
".",
"app",
".",
"processEvents",
"(",
")",
"if",
"view",
":",
"if",
"t... | https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Modules/Scripted/ScreenCapture/ScreenCapture.py#L1009-L1113 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/email/charset.py | python | Charset.to_splittable | (self, s) | Convert a possibly multibyte string to a safely splittable format.
Uses the input_codec to try and convert the string to Unicode, so it
can be safely split on character boundaries (even for multibyte
characters).
Returns the string as-is if it isn't known how to convert it to
U... | Convert a possibly multibyte string to a safely splittable format. | [
"Convert",
"a",
"possibly",
"multibyte",
"string",
"to",
"a",
"safely",
"splittable",
"format",
"."
] | def to_splittable(self, s):
"""Convert a possibly multibyte string to a safely splittable format.
Uses the input_codec to try and convert the string to Unicode, so it
can be safely split on character boundaries (even for multibyte
characters).
Returns the string as-is if it isn... | [
"def",
"to_splittable",
"(",
"self",
",",
"s",
")",
":",
"if",
"isinstance",
"(",
"s",
",",
"unicode",
")",
"or",
"self",
".",
"input_codec",
"is",
"None",
":",
"return",
"s",
"try",
":",
"return",
"unicode",
"(",
"s",
",",
"self",
".",
"input_codec"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/email/charset.py#L271-L291 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_stc.py | python | EditraStc.Expand | (self, line, do_expand, force=False, vis_levels=0, level=-1) | return line | Open the Margin Folder
@postcondition: the selected folder is expanded | Open the Margin Folder
@postcondition: the selected folder is expanded | [
"Open",
"the",
"Margin",
"Folder",
"@postcondition",
":",
"the",
"selected",
"folder",
"is",
"expanded"
] | def Expand(self, line, do_expand, force=False, vis_levels=0, level=-1):
"""Open the Margin Folder
@postcondition: the selected folder is expanded
"""
last_child = self.GetLastChild(line, level)
line = line + 1
while line <= last_child:
if force:
... | [
"def",
"Expand",
"(",
"self",
",",
"line",
",",
"do_expand",
",",
"force",
"=",
"False",
",",
"vis_levels",
"=",
"0",
",",
"level",
"=",
"-",
"1",
")",
":",
"last_child",
"=",
"self",
".",
"GetLastChild",
"(",
"line",
",",
"level",
")",
"line",
"="... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_stc.py#L1029-L1061 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | IKObjective.setFixedPosConstraint | (self, tlocal, tworld) | return _robotsim.IKObjective_setFixedPosConstraint(self, tlocal, tworld) | setFixedPosConstraint(IKObjective self, double const [3] tlocal, double const [3] tworld)
Manual: Sets a fixed position constraint. | setFixedPosConstraint(IKObjective self, double const [3] tlocal, double const [3] tworld) | [
"setFixedPosConstraint",
"(",
"IKObjective",
"self",
"double",
"const",
"[",
"3",
"]",
"tlocal",
"double",
"const",
"[",
"3",
"]",
"tworld",
")"
] | def setFixedPosConstraint(self, tlocal, tworld):
"""
setFixedPosConstraint(IKObjective self, double const [3] tlocal, double const [3] tworld)
Manual: Sets a fixed position constraint.
"""
return _robotsim.IKObjective_setFixedPosConstraint(self, tlocal, tworld) | [
"def",
"setFixedPosConstraint",
"(",
"self",
",",
"tlocal",
",",
"tworld",
")",
":",
"return",
"_robotsim",
".",
"IKObjective_setFixedPosConstraint",
"(",
"self",
",",
"tlocal",
",",
"tworld",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L6329-L6338 | |
Gulden/gulden-official | 444c4263001726d9d00b74af1925b38b84ec0691 | contrib/devtools/security-check.py | python | get_PE_dll_characteristics | (executable) | return (arch,bits) | Get PE DllCharacteristics bits.
Returns a tuple (arch,bits) where arch is 'i386:x86-64' or 'i386'
and bits is the DllCharacteristics value. | Get PE DllCharacteristics bits.
Returns a tuple (arch,bits) where arch is 'i386:x86-64' or 'i386'
and bits is the DllCharacteristics value. | [
"Get",
"PE",
"DllCharacteristics",
"bits",
".",
"Returns",
"a",
"tuple",
"(",
"arch",
"bits",
")",
"where",
"arch",
"is",
"i386",
":",
"x86",
"-",
"64",
"or",
"i386",
"and",
"bits",
"is",
"the",
"DllCharacteristics",
"value",
"."
] | def get_PE_dll_characteristics(executable):
'''
Get PE DllCharacteristics bits.
Returns a tuple (arch,bits) where arch is 'i386:x86-64' or 'i386'
and bits is the DllCharacteristics value.
'''
p = subprocess.Popen([OBJDUMP_CMD, '-x', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, s... | [
"def",
"get_PE_dll_characteristics",
"(",
"executable",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"OBJDUMP_CMD",
",",
"'-x'",
",",
"executable",
"]",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"stderr",
"=",
"subprocess",
".",
"PIP... | https://github.com/Gulden/gulden-official/blob/444c4263001726d9d00b74af1925b38b84ec0691/contrib/devtools/security-check.py#L119-L137 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/nodes.py | python | Element.first_child_not_matching_class | (self, childclass, start=0,
end=sys.maxint) | return None | Return the index of the first child whose class does *not* match.
Parameters:
- `childclass`: A `Node` subclass to skip, or a tuple of `Node`
classes. If a tuple, none of the classes may match.
- `start`: Initial index to check.
- `end`: Initial index to *not* check. | Return the index of the first child whose class does *not* match. | [
"Return",
"the",
"index",
"of",
"the",
"first",
"child",
"whose",
"class",
"does",
"*",
"not",
"*",
"match",
"."
] | def first_child_not_matching_class(self, childclass, start=0,
end=sys.maxint):
"""
Return the index of the first child whose class does *not* match.
Parameters:
- `childclass`: A `Node` subclass to skip, or a tuple of `Node`
classes. If ... | [
"def",
"first_child_not_matching_class",
"(",
"self",
",",
"childclass",
",",
"start",
"=",
"0",
",",
"end",
"=",
"sys",
".",
"maxint",
")",
":",
"if",
"not",
"isinstance",
"(",
"childclass",
",",
"tuple",
")",
":",
"childclass",
"=",
"(",
"childclass",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/nodes.py#L976-L996 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | KeyboardState.SetShiftDown | (*args, **kwargs) | return _core_.KeyboardState_SetShiftDown(*args, **kwargs) | SetShiftDown(self, bool down) | SetShiftDown(self, bool down) | [
"SetShiftDown",
"(",
"self",
"bool",
"down",
")"
] | def SetShiftDown(*args, **kwargs):
"""SetShiftDown(self, bool down)"""
return _core_.KeyboardState_SetShiftDown(*args, **kwargs) | [
"def",
"SetShiftDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"KeyboardState_SetShiftDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L4384-L4386 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/utils/scheduler.py | python | Scheduler.cancel | (self, event) | Remove an event from the queue.
Raises a ValueError if the event is not in the queue. | Remove an event from the queue. | [
"Remove",
"an",
"event",
"from",
"the",
"queue",
"."
] | def cancel(self, event):
"""Remove an event from the queue.
Raises a ValueError if the event is not in the queue.
"""
# The changes from https://hg.python.org/cpython/rev/d8802b055474 made it so sched.Event
# instances returned by sched.scheduler.enter() and sched.scheduler.ent... | [
"def",
"cancel",
"(",
"self",
",",
"event",
")",
":",
"# The changes from https://hg.python.org/cpython/rev/d8802b055474 made it so sched.Event",
"# instances returned by sched.scheduler.enter() and sched.scheduler.enterabs() are treated",
"# as equal if they have the same (time, priority). It i... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/utils/scheduler.py#L10-L30 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | lldb/examples/python/gdbremote.py | python | TerminalColors.white | (self, fg=True) | return '' | Set the foreground or background color to white.
The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False. | Set the foreground or background color to white.
The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False. | [
"Set",
"the",
"foreground",
"or",
"background",
"color",
"to",
"white",
".",
"The",
"foreground",
"color",
"will",
"be",
"set",
"if",
"fg",
"tests",
"True",
".",
"The",
"background",
"color",
"will",
"be",
"set",
"if",
"fg",
"tests",
"False",
"."
] | def white(self, fg=True):
'''Set the foreground or background color to white.
The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
if self.enabled:
if fg:
return "\x1b[37m"
else:
retu... | [
"def",
"white",
"(",
"self",
",",
"fg",
"=",
"True",
")",
":",
"if",
"self",
".",
"enabled",
":",
"if",
"fg",
":",
"return",
"\"\\x1b[37m\"",
"else",
":",
"return",
"\"\\x1b[47m\"",
"return",
"''"
] | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/examples/python/gdbremote.py#L171-L179 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/data/experimental/ops/io.py | python | load | (path, element_spec=None, compression=None, reader_func=None) | return _LoadDataset(
path=path,
element_spec=element_spec,
compression=compression,
reader_func=reader_func) | Loads a previously saved dataset.
Example usage:
>>> import tempfile
>>> path = os.path.join(tempfile.gettempdir(), "saved_data")
>>> # Save a dataset
>>> dataset = tf.data.Dataset.range(2)
>>> tf.data.experimental.save(dataset, path)
>>> new_dataset = tf.data.experimental.load(path)
>>> for elem in n... | Loads a previously saved dataset. | [
"Loads",
"a",
"previously",
"saved",
"dataset",
"."
] | def load(path, element_spec=None, compression=None, reader_func=None):
"""Loads a previously saved dataset.
Example usage:
>>> import tempfile
>>> path = os.path.join(tempfile.gettempdir(), "saved_data")
>>> # Save a dataset
>>> dataset = tf.data.Dataset.range(2)
>>> tf.data.experimental.save(dataset, p... | [
"def",
"load",
"(",
"path",
",",
"element_spec",
"=",
"None",
",",
"compression",
"=",
"None",
",",
"reader_func",
"=",
"None",
")",
":",
"return",
"_LoadDataset",
"(",
"path",
"=",
"path",
",",
"element_spec",
"=",
"element_spec",
",",
"compression",
"=",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/data/experimental/ops/io.py#L248-L314 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | remoting/tools/me2me_virtual_host.py | python | Config.save | (self) | Saves the config to file.
Raises:
IOError: Error writing data
TypeError: Error serialising JSON | Saves the config to file. | [
"Saves",
"the",
"config",
"to",
"file",
"."
] | def save(self):
"""Saves the config to file.
Raises:
IOError: Error writing data
TypeError: Error serialising JSON
"""
if not self.changed:
return
old_umask = os.umask(0066)
try:
settings_file = open(self.path, 'w')
settings_file.write(json.dumps(self.data, indent=... | [
"def",
"save",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"changed",
":",
"return",
"old_umask",
"=",
"os",
".",
"umask",
"(",
"0066",
")",
"try",
":",
"settings_file",
"=",
"open",
"(",
"self",
".",
"path",
",",
"'w'",
")",
"settings_file",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/remoting/tools/me2me_virtual_host.py#L108-L124 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | buildscripts/resmokelib/utils/timer.py | python | AlarmClock.dismiss | (self) | Disables the timer. | Disables the timer. | [
"Disables",
"the",
"timer",
"."
] | def dismiss(self):
"""
Disables the timer.
"""
with self.lock:
self.dismissed = True
self.cond.notify_all()
self.join() | [
"def",
"dismiss",
"(",
"self",
")",
":",
"with",
"self",
".",
"lock",
":",
"self",
".",
"dismissed",
"=",
"True",
"self",
".",
"cond",
".",
"notify_all",
"(",
")",
"self",
".",
"join",
"(",
")"
] | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/resmokelib/utils/timer.py#L42-L51 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/linalg/_interpolative_backend.py | python | idzp_aid | (eps, A) | return k, idx, proj | Compute ID of a complex matrix to a specified relative precision using
random sampling.
:param eps:
Relative precision.
:type eps: float
:param A:
Matrix.
:type A: :class:`numpy.ndarray`
:return:
Rank of ID.
:rtype: int
:return:
Column index array.
:... | Compute ID of a complex matrix to a specified relative precision using
random sampling. | [
"Compute",
"ID",
"of",
"a",
"complex",
"matrix",
"to",
"a",
"specified",
"relative",
"precision",
"using",
"random",
"sampling",
"."
] | def idzp_aid(eps, A):
"""
Compute ID of a complex matrix to a specified relative precision using
random sampling.
:param eps:
Relative precision.
:type eps: float
:param A:
Matrix.
:type A: :class:`numpy.ndarray`
:return:
Rank of ID.
:rtype: int
:return:... | [
"def",
"idzp_aid",
"(",
"eps",
",",
"A",
")",
":",
"A",
"=",
"np",
".",
"asfortranarray",
"(",
"A",
")",
"m",
",",
"n",
"=",
"A",
".",
"shape",
"n2",
",",
"w",
"=",
"idz_frmi",
"(",
"m",
")",
"proj",
"=",
"np",
".",
"empty",
"(",
"n",
"*",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/_interpolative_backend.py#L1278-L1306 | |
numworks/epsilon | 8952d2f8b1de1c3f064eec8ffcea804c5594ba4c | build/device/usb/libloader.py | python | locate_library | (candidates, find_library=ctypes.util.find_library) | return None | Tries to locate a library listed in candidates using the given
find_library() function (or ctypes.util.find_library).
Returns the first library found, which can be the library's name
or the path to the library file, depending on find_library().
Returns None if no library is found.
arguments:
* ... | Tries to locate a library listed in candidates using the given
find_library() function (or ctypes.util.find_library).
Returns the first library found, which can be the library's name
or the path to the library file, depending on find_library().
Returns None if no library is found. | [
"Tries",
"to",
"locate",
"a",
"library",
"listed",
"in",
"candidates",
"using",
"the",
"given",
"find_library",
"()",
"function",
"(",
"or",
"ctypes",
".",
"util",
".",
"find_library",
")",
".",
"Returns",
"the",
"first",
"library",
"found",
"which",
"can",
... | def locate_library (candidates, find_library=ctypes.util.find_library):
"""Tries to locate a library listed in candidates using the given
find_library() function (or ctypes.util.find_library).
Returns the first library found, which can be the library's name
or the path to the library file, depending on ... | [
"def",
"locate_library",
"(",
"candidates",
",",
"find_library",
"=",
"ctypes",
".",
"util",
".",
"find_library",
")",
":",
"if",
"find_library",
"is",
"None",
":",
"find_library",
"=",
"ctypes",
".",
"util",
".",
"find_library",
"use_dll_workaround",
"=",
"("... | https://github.com/numworks/epsilon/blob/8952d2f8b1de1c3f064eec8ffcea804c5594ba4c/build/device/usb/libloader.py#L69-L101 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Checkbutton.__init__ | (self, master=None, cnf={}, **kw) | Construct a checkbutton widget with the parent MASTER.
Valid resource names: activebackground, activeforeground, anchor,
background, bd, bg, bitmap, borderwidth, command, cursor,
disabledforeground, fg, font, foreground, height,
highlightbackground, highlightcolor, highlightthickness, i... | Construct a checkbutton widget with the parent MASTER. | [
"Construct",
"a",
"checkbutton",
"widget",
"with",
"the",
"parent",
"MASTER",
"."
] | def __init__(self, master=None, cnf={}, **kw):
"""Construct a checkbutton widget with the parent MASTER.
Valid resource names: activebackground, activeforeground, anchor,
background, bd, bg, bitmap, borderwidth, command, cursor,
disabledforeground, fg, font, foreground, height,
... | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"cnf",
"=",
"{",
"}",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"'checkbutton'",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2407-L2417 | ||
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/build/lib.linux-x86_64-2.7/mxnet/model.py | python | FeedForward.fit | (self, X, y=None, eval_data=None, eval_metric='acc',
epoch_end_callback=None, batch_end_callback=None, kvstore='local', logger=None,
work_load_list=None, monitor=None, eval_batch_end_callback=None) | Fit the model.
Parameters
----------
X : DataIter, or numpy.ndarray/NDArray
Training data. If X is an DataIter, the name or, if not available,
position, of its outputs should match the corresponding variable
names defined in the symbolic graph.
y : num... | Fit the model.
Parameters
----------
X : DataIter, or numpy.ndarray/NDArray
Training data. If X is an DataIter, the name or, if not available,
position, of its outputs should match the corresponding variable
names defined in the symbolic graph.
y : num... | [
"Fit",
"the",
"model",
".",
"Parameters",
"----------",
"X",
":",
"DataIter",
"or",
"numpy",
".",
"ndarray",
"/",
"NDArray",
"Training",
"data",
".",
"If",
"X",
"is",
"an",
"DataIter",
"the",
"name",
"or",
"if",
"not",
"available",
"position",
"of",
"its... | def fit(self, X, y=None, eval_data=None, eval_metric='acc',
epoch_end_callback=None, batch_end_callback=None, kvstore='local', logger=None,
work_load_list=None, monitor=None, eval_batch_end_callback=None):
"""Fit the model.
Parameters
----------
X : DataIter, or n... | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
",",
"eval_data",
"=",
"None",
",",
"eval_metric",
"=",
"'acc'",
",",
"epoch_end_callback",
"=",
"None",
",",
"batch_end_callback",
"=",
"None",
",",
"kvstore",
"=",
"'local'",
",",
"logger",
... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/model.py#L688-L774 | ||
alexgkendall/caffe-segnet | 344c113bf1832886f1cbe9f33ffe28a3beeaf412 | scripts/cpp_lint.py | python | _SetFilters | (filters) | Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Sets the module's error-message filters. | [
"Sets",
"the",
"module",
"s",
"error",
"-",
"message",
"filters",
"."
] | def _SetFilters(filters):
"""Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint... | [
"def",
"_SetFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"SetFilters",
"(",
"filters",
")"
] | https://github.com/alexgkendall/caffe-segnet/blob/344c113bf1832886f1cbe9f33ffe28a3beeaf412/scripts/cpp_lint.py#L797-L807 | ||
yushroom/FishEngine | a4b9fb9b0a6dc202f7990e75f4b7d8d5163209d9 | Script/reflect/clang/cindex.py | python | Cursor.access_specifier | (self) | return AccessSpecifier.from_id(self._access_specifier) | Retrieves the access specifier (if any) of the entity pointed at by the
cursor. | Retrieves the access specifier (if any) of the entity pointed at by the
cursor. | [
"Retrieves",
"the",
"access",
"specifier",
"(",
"if",
"any",
")",
"of",
"the",
"entity",
"pointed",
"at",
"by",
"the",
"cursor",
"."
] | def access_specifier(self):
"""
Retrieves the access specifier (if any) of the entity pointed at by the
cursor.
"""
if not hasattr(self, '_access_specifier'):
self._access_specifier = conf.lib.clang_getCXXAccessSpecifier(self)
return AccessSpecifier.from_id(s... | [
"def",
"access_specifier",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_access_specifier'",
")",
":",
"self",
".",
"_access_specifier",
"=",
"conf",
".",
"lib",
".",
"clang_getCXXAccessSpecifier",
"(",
"self",
")",
"return",
"AccessSpeci... | https://github.com/yushroom/FishEngine/blob/a4b9fb9b0a6dc202f7990e75f4b7d8d5163209d9/Script/reflect/clang/cindex.py#L1492-L1500 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/engine/datasets.py | python | Dataset.bucket_batch_by_length | (self, column_names, bucket_boundaries, bucket_batch_sizes, element_length_function=None,
pad_info=None, pad_to_bucket_boundary=False, drop_remainder=False) | return BucketBatchByLengthDataset(self, column_names, bucket_boundaries, bucket_batch_sizes,
element_length_function, pad_info, pad_to_bucket_boundary, drop_remainder) | Bucket elements according to their lengths. Each bucket will be padded and batched when
they are full.
A length function is called on each row in the dataset. The row is then
bucketed based on its length and bucket boundaries. When a bucket reaches its
corresponding size specified in bu... | Bucket elements according to their lengths. Each bucket will be padded and batched when
they are full. | [
"Bucket",
"elements",
"according",
"to",
"their",
"lengths",
".",
"Each",
"bucket",
"will",
"be",
"padded",
"and",
"batched",
"when",
"they",
"are",
"full",
"."
] | def bucket_batch_by_length(self, column_names, bucket_boundaries, bucket_batch_sizes, element_length_function=None,
pad_info=None, pad_to_bucket_boundary=False, drop_remainder=False):
"""
Bucket elements according to their lengths. Each bucket will be padded and batched wh... | [
"def",
"bucket_batch_by_length",
"(",
"self",
",",
"column_names",
",",
"bucket_boundaries",
",",
"bucket_batch_sizes",
",",
"element_length_function",
"=",
"None",
",",
"pad_info",
"=",
"None",
",",
"pad_to_bucket_boundary",
"=",
"False",
",",
"drop_remainder",
"=",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/datasets.py#L407-L474 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/utils/_process_win32_controller.py | python | Win32ShellCommandController._stdin_raw_nonblock | (self) | Use the raw Win32 handle of sys.stdin to do non-blocking reads | Use the raw Win32 handle of sys.stdin to do non-blocking reads | [
"Use",
"the",
"raw",
"Win32",
"handle",
"of",
"sys",
".",
"stdin",
"to",
"do",
"non",
"-",
"blocking",
"reads"
] | def _stdin_raw_nonblock(self):
"""Use the raw Win32 handle of sys.stdin to do non-blocking reads"""
# WARNING: This is experimental, and produces inconsistent results.
# It's possible for the handle not to be appropriate for use
# with WaitForSingleObject, among other t... | [
"def",
"_stdin_raw_nonblock",
"(",
"self",
")",
":",
"# WARNING: This is experimental, and produces inconsistent results.",
"# It's possible for the handle not to be appropriate for use",
"# with WaitForSingleObject, among other things.",
"handle",
"=",
"msvcrt",
".",
"ge... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/utils/_process_win32_controller.py#L447-L476 | ||
facebook/wangle | 2e7e3fbb3a15c4986d6fe0e36c31daeeba614ce3 | build/fbcode_builder/getdeps/subcmd.py | python | SubCmd.run | (self, args) | return 0 | perform the command | perform the command | [
"perform",
"the",
"command"
] | def run(self, args):
"""perform the command"""
return 0 | [
"def",
"run",
"(",
"self",
",",
"args",
")",
":",
"return",
"0"
] | https://github.com/facebook/wangle/blob/2e7e3fbb3a15c4986d6fe0e36c31daeeba614ce3/build/fbcode_builder/getdeps/subcmd.py#L11-L13 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | TreeCtrl.IsEmpty | (*args, **kwargs) | return _controls_.TreeCtrl_IsEmpty(*args, **kwargs) | IsEmpty(self) -> bool | IsEmpty(self) -> bool | [
"IsEmpty",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsEmpty(*args, **kwargs):
"""IsEmpty(self) -> bool"""
return _controls_.TreeCtrl_IsEmpty(*args, **kwargs) | [
"def",
"IsEmpty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeCtrl_IsEmpty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L5351-L5353 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py | python | RegistryInfo.microsoft | (self, key, x86=False) | return join('Software', node64, 'Microsoft', key) | Return key in Microsoft software registry.
Parameters
----------
key: str
Registry key path where look.
x86: str
Force x86 software registry.
Return
------
str
Registry key | Return key in Microsoft software registry. | [
"Return",
"key",
"in",
"Microsoft",
"software",
"registry",
"."
] | def microsoft(self, key, x86=False):
"""
Return key in Microsoft software registry.
Parameters
----------
key: str
Registry key path where look.
x86: str
Force x86 software registry.
Return
------
str
Registry ... | [
"def",
"microsoft",
"(",
"self",
",",
"key",
",",
"x86",
"=",
"False",
")",
":",
"node64",
"=",
"''",
"if",
"self",
".",
"pi",
".",
"current_is_x86",
"(",
")",
"or",
"x86",
"else",
"'Wow6432Node'",
"return",
"join",
"(",
"'Software'",
",",
"node64",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py#L609-L626 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/locators.py | python | DependencyFinder.try_to_replace | (self, provider, other, problems) | return result | Attempt to replace one provider with another. This is typically used
when resolving dependencies from multiple sources, e.g. A requires
(B >= 1.0) while C requires (B >= 1.1).
For successful replacement, ``provider`` must meet all the requirements
which ``other`` fulfills.
:par... | Attempt to replace one provider with another. This is typically used
when resolving dependencies from multiple sources, e.g. A requires
(B >= 1.0) while C requires (B >= 1.1). | [
"Attempt",
"to",
"replace",
"one",
"provider",
"with",
"another",
".",
"This",
"is",
"typically",
"used",
"when",
"resolving",
"dependencies",
"from",
"multiple",
"sources",
"e",
".",
"g",
".",
"A",
"requires",
"(",
"B",
">",
"=",
"1",
".",
"0",
")",
"... | def try_to_replace(self, provider, other, problems):
"""
Attempt to replace one provider with another. This is typically used
when resolving dependencies from multiple sources, e.g. A requires
(B >= 1.0) while C requires (B >= 1.1).
For successful replacement, ``provider`` must ... | [
"def",
"try_to_replace",
"(",
"self",
",",
"provider",
",",
"other",
",",
"problems",
")",
":",
"rlist",
"=",
"self",
".",
"reqts",
"[",
"other",
"]",
"unmatched",
"=",
"set",
"(",
")",
"for",
"s",
"in",
"rlist",
":",
"matcher",
"=",
"self",
".",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/locators.py#L1154-L1192 | |
google/skia | 82d65d0487bd72f5f7332d002429ec2dc61d2463 | tools/jsondiff.py | python | GMDiffer._GetFileContentsAsString | (self, filepath) | Returns the full contents of a file, as a single string.
If the filename looks like a URL, download its contents.
If the filename is None, return None. | Returns the full contents of a file, as a single string.
If the filename looks like a URL, download its contents.
If the filename is None, return None. | [
"Returns",
"the",
"full",
"contents",
"of",
"a",
"file",
"as",
"a",
"single",
"string",
".",
"If",
"the",
"filename",
"looks",
"like",
"a",
"URL",
"download",
"its",
"contents",
".",
"If",
"the",
"filename",
"is",
"None",
"return",
"None",
"."
] | def _GetFileContentsAsString(self, filepath):
"""Returns the full contents of a file, as a single string.
If the filename looks like a URL, download its contents.
If the filename is None, return None."""
if filepath is None:
return None
elif filepath.startswith('http:... | [
"def",
"_GetFileContentsAsString",
"(",
"self",
",",
"filepath",
")",
":",
"if",
"filepath",
"is",
"None",
":",
"return",
"None",
"elif",
"filepath",
".",
"startswith",
"(",
"'http:'",
")",
"or",
"filepath",
".",
"startswith",
"(",
"'https:'",
")",
":",
"r... | https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/tools/jsondiff.py#L49-L58 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/serve/push/search/util/search_schema_parser.py | python | SearchSchemaParser.__StartDocument | (self) | Start document handler.
It is used to initialize variables before any actual parsing happens. | Start document handler. | [
"Start",
"document",
"handler",
"."
] | def __StartDocument(self):
"""Start document handler.
It is used to initialize variables before any actual parsing happens.
"""
self._num_fields = 0
self._table_fields = []
self._index_columns = []
self._sql_insert = ""
self._sql_search = ""
self._select_clause = []
self._where... | [
"def",
"__StartDocument",
"(",
"self",
")",
":",
"self",
".",
"_num_fields",
"=",
"0",
"self",
".",
"_table_fields",
"=",
"[",
"]",
"self",
".",
"_index_columns",
"=",
"[",
"]",
"self",
".",
"_sql_insert",
"=",
"\"\"",
"self",
".",
"_sql_search",
"=",
... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/push/search/util/search_schema_parser.py#L327-L350 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | buildscripts/eslint.py | python | check_output | (*popenargs, **kwargs) | return output | r"""Run command with arguments and return its output as a byte string.
If the exit code was non-zero it raises a CalledProcessError. The
CalledProcessError object will have the return code in the returncode
attribute and output in the output attribute.
The arguments are the same as for the Popen cons... | r"""Run command with arguments and return its output as a byte string. | [
"r",
"Run",
"command",
"with",
"arguments",
"and",
"return",
"its",
"output",
"as",
"a",
"byte",
"string",
"."
] | def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
If the exit code was non-zero it raises a CalledProcessError. The
CalledProcessError object will have the return code in the returncode
attribute and output in the output attribute.
The ... | [
"def",
"check_output",
"(",
"*",
"popenargs",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'stdout'",
"in",
"kwargs",
":",
"raise",
"ValueError",
"(",
"'stdout argument not allowed, it will be overridden.'",
")",
"process",
"=",
"subprocess",
".",
"Popen",
"(",
"st... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/eslint.py#L80-L110 | |
QMCPACK/qmcpack | d0948ab455e38364458740cc8e2239600a14c5cd | nexus/lib/gaussian_process.py | python | GaussianProcessOptimizer.optimize_stateless | (self) | return state.optimal_trajectory() | Optimizes energy_function without saving state. | Optimizes energy_function without saving state. | [
"Optimizes",
"energy_function",
"without",
"saving",
"state",
"."
] | def optimize_stateless(self):
"""
Optimizes energy_function without saving state.
"""
state = self.state
for i in range(self.niterations+1):
state.iteration+=1
self.vlog('iteration {0}'.format(state.iteration),n=1)
self.vlog('sampling parameter... | [
"def",
"optimize_stateless",
"(",
"self",
")",
":",
"state",
"=",
"self",
".",
"state",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"niterations",
"+",
"1",
")",
":",
"state",
".",
"iteration",
"+=",
"1",
"self",
".",
"vlog",
"(",
"'iteration {0}'",
... | https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/nexus/lib/gaussian_process.py#L1556-L1578 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/symbol/symbol.py | python | Symbol.sign | (self, *args, **kwargs) | return op.sign(self, *args, **kwargs) | Convenience fluent method for :py:func:`sign`.
The arguments are the same as for :py:func:`sign`, with
this array as data. | Convenience fluent method for :py:func:`sign`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"sign",
"."
] | def sign(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`sign`.
The arguments are the same as for :py:func:`sign`, with
this array as data.
"""
return op.sign(self, *args, **kwargs) | [
"def",
"sign",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"sign",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/symbol/symbol.py#L2078-L2084 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/index.py | python | PackageIndex.save_configuration | (self) | Save the PyPI access configuration. You must have set ``username`` and
``password`` attributes before calling this method.
Again, distutils is used to do the actual work. | Save the PyPI access configuration. You must have set ``username`` and
``password`` attributes before calling this method. | [
"Save",
"the",
"PyPI",
"access",
"configuration",
".",
"You",
"must",
"have",
"set",
"username",
"and",
"password",
"attributes",
"before",
"calling",
"this",
"method",
"."
] | def save_configuration(self):
"""
Save the PyPI access configuration. You must have set ``username`` and
``password`` attributes before calling this method.
Again, distutils is used to do the actual work.
"""
self.check_credentials()
# get distutils to do the wor... | [
"def",
"save_configuration",
"(",
"self",
")",
":",
"self",
".",
"check_credentials",
"(",
")",
"# get distutils to do the work",
"c",
"=",
"self",
".",
"_get_pypirc_command",
"(",
")",
"c",
".",
"_store_pypirc",
"(",
"self",
".",
"username",
",",
"self",
".",... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/index.py#L90-L100 | ||
sailing-pmls/bosen | 06cb58902d011fbea5f9428f10ce30e621492204 | style_script/cpplint.py | python | CheckAltTokens | (filename, clean_lines, linenum, error) | Check alternative keywords being used in boolean expressions.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Check alternative keywords being used in boolean expressions. | [
"Check",
"alternative",
"keywords",
"being",
"used",
"in",
"boolean",
"expressions",
"."
] | def CheckAltTokens(filename, clean_lines, linenum, error):
"""Check alternative keywords being used in boolean expressions.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call ... | [
"def",
"CheckAltTokens",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Avoid preprocessor lines",
"if",
"Match",
"(",
"r'^\\s*#'",
",",
"line",
")",
":",
"retur... | https://github.com/sailing-pmls/bosen/blob/06cb58902d011fbea5f9428f10ce30e621492204/style_script/cpplint.py#L4319-L4348 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/email/iterators.py | python | body_line_iterator | (msg, decode=False) | Iterate over the parts, returning string payloads line-by-line.
Optional decode (default False) is passed through to .get_payload(). | Iterate over the parts, returning string payloads line-by-line. | [
"Iterate",
"over",
"the",
"parts",
"returning",
"string",
"payloads",
"line",
"-",
"by",
"-",
"line",
"."
] | def body_line_iterator(msg, decode=False):
"""Iterate over the parts, returning string payloads line-by-line.
Optional decode (default False) is passed through to .get_payload().
"""
for subpart in msg.walk():
payload = subpart.get_payload(decode=decode)
if isinstance(payload, basestrin... | [
"def",
"body_line_iterator",
"(",
"msg",
",",
"decode",
"=",
"False",
")",
":",
"for",
"subpart",
"in",
"msg",
".",
"walk",
"(",
")",
":",
"payload",
"=",
"subpart",
".",
"get_payload",
"(",
"decode",
"=",
"decode",
")",
"if",
"isinstance",
"(",
"paylo... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/email/iterators.py#L35-L44 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/Configuration.py | python | Descriptor.needsHeaderInclude | (self) | return (self.interface.isExternal() or self.concrete or
self.interface.hasInterfacePrototypeObject() or
any((m.isAttr() or m.isMethod()) and m.isStatic() for m
in self.interface.members)) | An interface doesn't need a header file if it is not concrete,
not pref-controlled, has no prototype object, and has no
static methods or attributes. | An interface doesn't need a header file if it is not concrete,
not pref-controlled, has no prototype object, and has no
static methods or attributes. | [
"An",
"interface",
"doesn",
"t",
"need",
"a",
"header",
"file",
"if",
"it",
"is",
"not",
"concrete",
"not",
"pref",
"-",
"controlled",
"has",
"no",
"prototype",
"object",
"and",
"has",
"no",
"static",
"methods",
"or",
"attributes",
"."
] | def needsHeaderInclude(self):
"""
An interface doesn't need a header file if it is not concrete,
not pref-controlled, has no prototype object, and has no
static methods or attributes.
"""
return (self.interface.isExternal() or self.concrete or
self.interface.h... | [
"def",
"needsHeaderInclude",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"interface",
".",
"isExternal",
"(",
")",
"or",
"self",
".",
"concrete",
"or",
"self",
".",
"interface",
".",
"hasInterfacePrototypeObject",
"(",
")",
"or",
"any",
"(",
"(",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/Configuration.py#L537-L546 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/cookielib.py | python | CookiePolicy.return_ok | (self, cookie, request) | Return true if (and only if) cookie should be returned to server. | Return true if (and only if) cookie should be returned to server. | [
"Return",
"true",
"if",
"(",
"and",
"only",
"if",
")",
"cookie",
"should",
"be",
"returned",
"to",
"server",
"."
] | def return_ok(self, cookie, request):
"""Return true if (and only if) cookie should be returned to server."""
raise NotImplementedError() | [
"def",
"return_ok",
"(",
"self",
",",
"cookie",
",",
"request",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/cookielib.py#L822-L824 | ||
msoos/cryptominisat | 02f53d1fc045fdba53671306964d3d094feb949e | scripts/crystal/helper.py | python | print_confusion_matrix | (cm,
normalize=False,
title='Confusion matrix',
cmap=plt.cm.Blues) | This function prints and plots the confusion matrix.
Normalization can be applied by setting `normalize=True`. | This function prints and plots the confusion matrix.
Normalization can be applied by setting `normalize=True`. | [
"This",
"function",
"prints",
"and",
"plots",
"the",
"confusion",
"matrix",
".",
"Normalization",
"can",
"be",
"applied",
"by",
"setting",
"normalize",
"=",
"True",
"."
] | def print_confusion_matrix(cm,
normalize=False,
title='Confusion matrix',
cmap=plt.cm.Blues):
"""
This function prints and plots the confusion matrix.
Normalization can be applied by setting `normalize=True`.
"""
if nor... | [
"def",
"print_confusion_matrix",
"(",
"cm",
",",
"normalize",
"=",
"False",
",",
"title",
"=",
"'Confusion matrix'",
",",
"cmap",
"=",
"plt",
".",
"cm",
".",
"Blues",
")",
":",
"if",
"normalize",
":",
"cm",
"=",
"cm",
".",
"astype",
"(",
"'float'",
")"... | https://github.com/msoos/cryptominisat/blob/02f53d1fc045fdba53671306964d3d094feb949e/scripts/crystal/helper.py#L435-L450 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/config.py | python | ConfigMetadataHandler.parsers | (self) | return {
'platforms': parse_list,
'keywords': parse_list,
'provides': parse_list,
'requires': self._deprecated_config_handler(
parse_list,
"The requires parameter is deprecated, please use "
"install_requires for runtime dep... | Metadata item name to parser function mapping. | Metadata item name to parser function mapping. | [
"Metadata",
"item",
"name",
"to",
"parser",
"function",
"mapping",
"."
] | def parsers(self):
"""Metadata item name to parser function mapping."""
parse_list = self._parse_list
parse_file = self._parse_file
parse_dict = self._parse_dict
exclude_files_parser = self._exclude_files_parser
return {
'platforms': parse_list,
'... | [
"def",
"parsers",
"(",
"self",
")",
":",
"parse_list",
"=",
"self",
".",
"_parse_list",
"parse_file",
"=",
"self",
".",
"_parse_file",
"parse_dict",
"=",
"self",
".",
"_parse_dict",
"exclude_files_parser",
"=",
"self",
".",
"_exclude_files_parser",
"return",
"{"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/config.py#L542-L573 | |
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/infer/deep_eval.py | python | DeepEval.model_type | (self) | return self._model_type | Get type of model.
:type:str | Get type of model. | [
"Get",
"type",
"of",
"model",
"."
] | def model_type(self) -> str:
"""Get type of model.
:type:str
"""
if not self._model_type:
t_mt = self._get_tensor("model_attr/model_type:0")
sess = tf.Session(graph=self.graph, config=default_tf_session_config)
[mt] = run_sess(sess, [t_mt], feed_dict=... | [
"def",
"model_type",
"(",
"self",
")",
"->",
"str",
":",
"if",
"not",
"self",
".",
"_model_type",
":",
"t_mt",
"=",
"self",
".",
"_get_tensor",
"(",
"\"model_attr/model_type:0\"",
")",
"sess",
"=",
"tf",
".",
"Session",
"(",
"graph",
"=",
"self",
".",
... | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/infer/deep_eval.py#L67-L77 | |
nasa/astrobee | 9241e67e6692810d6e275abb3165b6d02f4ca5ef | localization/sparse_mapping/tools/view_control_points.py | python | gen_marker | (marker_id, marker_type, Point, Color, scale, text) | return marker | Place a marker of a given type and color at a given location | Place a marker of a given type and color at a given location | [
"Place",
"a",
"marker",
"of",
"a",
"given",
"type",
"and",
"color",
"at",
"a",
"given",
"location"
] | def gen_marker(marker_id, marker_type, Point, Color, scale, text):
"""Place a marker of a given type and color at a given location"""
marker = """ -
header:
seq: 1482
stamp:
secs: 1556650754
nsecs: 179000000
frame_id: "world"
ns: "thick_traj"
id: %d
type: %... | [
"def",
"gen_marker",
"(",
"marker_id",
",",
"marker_type",
",",
"Point",
",",
"Color",
",",
"scale",
",",
"text",
")",
":",
"marker",
"=",
"\"\"\" - \n header: \n seq: 1482\n stamp: \n secs: 1556650754\n nsecs: 179000000\n frame_id: \"world\"\n ... | https://github.com/nasa/astrobee/blob/9241e67e6692810d6e275abb3165b6d02f4ca5ef/localization/sparse_mapping/tools/view_control_points.py#L28-L83 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | python | GenerateOutput | (target_list, target_dicts, data, params) | Generate .sln and .vcproj files.
This is the entry point for this generator.
Arguments:
target_list: List of target pairs: 'base/base.gyp:base'.
target_dicts: Dict of target properties keyed on target pair.
data: Dictionary containing per .gyp data. | Generate .sln and .vcproj files. | [
"Generate",
".",
"sln",
"and",
".",
"vcproj",
"files",
"."
] | def GenerateOutput(target_list, target_dicts, data, params):
"""Generate .sln and .vcproj files.
This is the entry point for this generator.
Arguments:
target_list: List of target pairs: 'base/base.gyp:base'.
target_dicts: Dict of target properties keyed on target pair.
data: Dictionary containing pe... | [
"def",
"GenerateOutput",
"(",
"target_list",
",",
"target_dicts",
",",
"data",
",",
"params",
")",
":",
"global",
"fixpath_prefix",
"options",
"=",
"params",
"[",
"'options'",
"]",
"# Get the project file format version back out of where we stashed it in",
"# GeneratorCalcu... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L1956-L2034 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/devices.py | python | get_context | (devnum=None) | return _runtime.get_or_create_context(devnum) | Get the current device or use a device by device number, and
return the CUDA context. | Get the current device or use a device by device number, and
return the CUDA context. | [
"Get",
"the",
"current",
"device",
"or",
"use",
"a",
"device",
"by",
"device",
"number",
"and",
"return",
"the",
"CUDA",
"context",
"."
] | def get_context(devnum=None):
"""Get the current device or use a device by device number, and
return the CUDA context.
"""
return _runtime.get_or_create_context(devnum) | [
"def",
"get_context",
"(",
"devnum",
"=",
"None",
")",
":",
"return",
"_runtime",
".",
"get_or_create_context",
"(",
"devnum",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/devices.py#L209-L213 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/v8/tools/clusterfuzz/js_fuzzer/tools/run_one.py | python | random_seed | () | return seed | Returns random, non-zero seed. | Returns random, non-zero seed. | [
"Returns",
"random",
"non",
"-",
"zero",
"seed",
"."
] | def random_seed():
"""Returns random, non-zero seed."""
seed = 0
while not seed:
seed = random.SystemRandom().randint(-2147483648, 2147483647)
return seed | [
"def",
"random_seed",
"(",
")",
":",
"seed",
"=",
"0",
"while",
"not",
"seed",
":",
"seed",
"=",
"random",
".",
"SystemRandom",
"(",
")",
".",
"randint",
"(",
"-",
"2147483648",
",",
"2147483647",
")",
"return",
"seed"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/tools/clusterfuzz/js_fuzzer/tools/run_one.py#L44-L49 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/rpc.py | python | RPCServer.get_request | (self) | return self.socket, self.server_address | Override TCPServer method, return already connected socket | Override TCPServer method, return already connected socket | [
"Override",
"TCPServer",
"method",
"return",
"already",
"connected",
"socket"
] | def get_request(self):
"Override TCPServer method, return already connected socket"
return self.socket, self.server_address | [
"def",
"get_request",
"(",
"self",
")",
":",
"return",
"self",
".",
"socket",
",",
"self",
".",
"server_address"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/rpc.py#L89-L91 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | TextAttrDimensions.GetTop | (*args, **kwargs) | return _richtext.TextAttrDimensions_GetTop(*args, **kwargs) | GetTop(self) -> TextAttrDimension | GetTop(self) -> TextAttrDimension | [
"GetTop",
"(",
"self",
")",
"-",
">",
"TextAttrDimension"
] | def GetTop(*args, **kwargs):
"""GetTop(self) -> TextAttrDimension"""
return _richtext.TextAttrDimensions_GetTop(*args, **kwargs) | [
"def",
"GetTop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"TextAttrDimensions_GetTop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L240-L242 | |
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | Tools/ecl_ekf/plotting/data_plots.py | python | TimeSeriesPlot.plot | (self) | plots the time series data.
:return: | plots the time series data.
:return: | [
"plots",
"the",
"time",
"series",
"data",
".",
":",
"return",
":"
] | def plot(self):
"""
plots the time series data.
:return:
"""
if self.fig is None:
return
for i in range(len(self._variable_names)):
plt.subplot(len(self._variable_names), 1, i + 1)
for v in self._variable_names[i]:
plt.... | [
"def",
"plot",
"(",
"self",
")",
":",
"if",
"self",
".",
"fig",
"is",
"None",
":",
"return",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"_variable_names",
")",
")",
":",
"plt",
".",
"subplot",
"(",
"len",
"(",
"self",
".",
"_variabl... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/ecl_ekf/plotting/data_plots.py#L167-L182 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/internal/well_known_types.py | python | Duration.FromNanoseconds | (self, nanos) | Converts nanoseconds to Duration. | Converts nanoseconds to Duration. | [
"Converts",
"nanoseconds",
"to",
"Duration",
"."
] | def FromNanoseconds(self, nanos):
"""Converts nanoseconds to Duration."""
self._NormalizeDuration(nanos // _NANOS_PER_SECOND,
nanos % _NANOS_PER_SECOND) | [
"def",
"FromNanoseconds",
"(",
"self",
",",
"nanos",
")",
":",
"self",
".",
"_NormalizeDuration",
"(",
"nanos",
"//",
"_NANOS_PER_SECOND",
",",
"nanos",
"%",
"_NANOS_PER_SECOND",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/internal/well_known_types.py#L345-L348 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py | python | DEFINE_integer | (name, default, help, lower_bound=None, upper_bound=None,
flag_values=FLAGS, **args) | Registers a flag whose value must be an integer.
If lower_bound, or upper_bound are set, then this flag must be
within the given range. | Registers a flag whose value must be an integer. | [
"Registers",
"a",
"flag",
"whose",
"value",
"must",
"be",
"an",
"integer",
"."
] | def DEFINE_integer(name, default, help, lower_bound=None, upper_bound=None,
flag_values=FLAGS, **args):
"""Registers a flag whose value must be an integer.
If lower_bound, or upper_bound are set, then this flag must be
within the given range.
"""
parser = IntegerParser(lower_bound, upper_b... | [
"def",
"DEFINE_integer",
"(",
"name",
",",
"default",
",",
"help",
",",
"lower_bound",
"=",
"None",
",",
"upper_bound",
"=",
"None",
",",
"flag_values",
"=",
"FLAGS",
",",
"*",
"*",
"args",
")",
":",
"parser",
"=",
"IntegerParser",
"(",
"lower_bound",
",... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L2569-L2579 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/autodiff/ad.py | python | ADFunctionInterface.argname | (self,arg) | return "Arg %d"%(arg,) | Returns a descriptive string for argument #arg | Returns a descriptive string for argument #arg | [
"Returns",
"a",
"descriptive",
"string",
"for",
"argument",
"#arg"
] | def argname(self,arg):
"""Returns a descriptive string for argument #arg"""
return "Arg %d"%(arg,) | [
"def",
"argname",
"(",
"self",
",",
"arg",
")",
":",
"return",
"\"Arg %d\"",
"%",
"(",
"arg",
",",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/autodiff/ad.py#L299-L301 | |
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/image_tool.py | python | ImageTool.resize_by_hw_list | (self, size_list, num_case=1, inplace=True) | Args:
num_case: num of resize cases, must be <= the length of size_list
inplace: inplace imgs or not (return new_imgs) | Args:
num_case: num of resize cases, must be <= the length of size_list
inplace: inplace imgs or not (return new_imgs) | [
"Args",
":",
"num_case",
":",
"num",
"of",
"resize",
"cases",
"must",
"be",
"<",
"=",
"the",
"length",
"of",
"size_list",
"inplace",
":",
"inplace",
"imgs",
"or",
"not",
"(",
"return",
"new_imgs",
")"
] | def resize_by_hw_list(self, size_list, num_case=1, inplace=True):
'''
Args:
num_case: num of resize cases, must be <= the length of size_list
inplace: inplace imgs or not (return new_imgs)
'''
new_imgs = []
if num_case < 1 or num_case > len(size_list):
... | [
"def",
"resize_by_hw_list",
"(",
"self",
",",
"size_list",
",",
"num_case",
"=",
"1",
",",
"inplace",
"=",
"True",
")",
":",
"new_imgs",
"=",
"[",
"]",
"if",
"num_case",
"<",
"1",
"or",
"num_case",
">",
"len",
"(",
"size_list",
")",
":",
"raise",
"Ex... | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/image_tool.py#L315-L339 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/gluon/loss.py | python | _apply_weighting | (loss, weight=None, sample_weight=None) | return loss | Apply weighting to loss.
Parameters
----------
loss : Symbol
The loss to be weighted.
weight : float or None
Global scalar weight for loss.
sample_weight : Symbol or None
Per sample weighting. Must be broadcastable to
the same shape as loss. For example, if loss has
... | Apply weighting to loss. | [
"Apply",
"weighting",
"to",
"loss",
"."
] | def _apply_weighting(loss, weight=None, sample_weight=None):
"""Apply weighting to loss.
Parameters
----------
loss : Symbol
The loss to be weighted.
weight : float or None
Global scalar weight for loss.
sample_weight : Symbol or None
Per sample weighting. Must be broadc... | [
"def",
"_apply_weighting",
"(",
"loss",
",",
"weight",
"=",
"None",
",",
"sample_weight",
"=",
"None",
")",
":",
"if",
"sample_weight",
"is",
"not",
"None",
":",
"loss",
"=",
"loss",
"*",
"sample_weight",
"if",
"weight",
"is",
"not",
"None",
":",
"assert... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/loss.py#L34-L62 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/metrics/__init__.py | python | edit_distance_error | (input_a, input_b, subPen=1, delPen=1, insPen=1, squashInputs=False, tokensToIgnore=[], name='') | return edit_distance_error(input_a, input_b, subPen, delPen, insPen, squashInputs, tokensToIgnore, name) | Edit distance error evaluation function with the option of specifying penalty of substitution, deletion and insertion, as well as squashing the input sequences and ignoring certain samples.
Using the classic DP algorithm as described in https://en.wikipedia.org/wiki/Edit_distance, adjusted to take into account the ... | Edit distance error evaluation function with the option of specifying penalty of substitution, deletion and insertion, as well as squashing the input sequences and ignoring certain samples.
Using the classic DP algorithm as described in https://en.wikipedia.org/wiki/Edit_distance, adjusted to take into account the ... | [
"Edit",
"distance",
"error",
"evaluation",
"function",
"with",
"the",
"option",
"of",
"specifying",
"penalty",
"of",
"substitution",
"deletion",
"and",
"insertion",
"as",
"well",
"as",
"squashing",
"the",
"input",
"sequences",
"and",
"ignoring",
"certain",
"sample... | def edit_distance_error(input_a, input_b, subPen=1, delPen=1, insPen=1, squashInputs=False, tokensToIgnore=[], name=''):
'''
Edit distance error evaluation function with the option of specifying penalty of substitution, deletion and insertion, as well as squashing the input sequences and ignoring certain sample... | [
"def",
"edit_distance_error",
"(",
"input_a",
",",
"input_b",
",",
"subPen",
"=",
"1",
",",
"delPen",
"=",
"1",
",",
"insPen",
"=",
"1",
",",
"squashInputs",
"=",
"False",
",",
"tokensToIgnore",
"=",
"[",
"]",
",",
"name",
"=",
"''",
")",
":",
"from"... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/metrics/__init__.py#L101-L147 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/docs/bcdoc/restdoc.py | python | ReSTDocument.peek_write | (self) | return self._writes[-1] | Returns the last content written to the document without
removing it from the stack. | Returns the last content written to the document without
removing it from the stack. | [
"Returns",
"the",
"last",
"content",
"written",
"to",
"the",
"document",
"without",
"removing",
"it",
"from",
"the",
"stack",
"."
] | def peek_write(self):
"""
Returns the last content written to the document without
removing it from the stack.
"""
return self._writes[-1] | [
"def",
"peek_write",
"(",
"self",
")",
":",
"return",
"self",
".",
"_writes",
"[",
"-",
"1",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/docs/bcdoc/restdoc.py#L51-L56 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/groupby/groupby.py | python | GroupBy.any | (self, skipna=True) | return self._bool_agg('any', skipna) | Returns True if any value in the group is truthful, else False.
Parameters
----------
skipna : bool, default True
Flag to ignore nan values during truth testing | Returns True if any value in the group is truthful, else False. | [
"Returns",
"True",
"if",
"any",
"value",
"in",
"the",
"group",
"is",
"truthful",
"else",
"False",
"."
] | def any(self, skipna=True):
"""
Returns True if any value in the group is truthful, else False.
Parameters
----------
skipna : bool, default True
Flag to ignore nan values during truth testing
"""
return self._bool_agg('any', skipna) | [
"def",
"any",
"(",
"self",
",",
"skipna",
"=",
"True",
")",
":",
"return",
"self",
".",
"_bool_agg",
"(",
"'any'",
",",
"skipna",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/groupby/groupby.py#L1048-L1057 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/linalg/linear_operator.py | python | LinearOperator._solvevec | (self, rhs, adjoint=False) | return array_ops.squeeze(solution_mat, axis=-1) | Default implementation of _solvevec. | Default implementation of _solvevec. | [
"Default",
"implementation",
"of",
"_solvevec",
"."
] | def _solvevec(self, rhs, adjoint=False):
"""Default implementation of _solvevec."""
rhs_mat = array_ops.expand_dims(rhs, axis=-1)
solution_mat = self.solve(rhs_mat, adjoint=adjoint)
return array_ops.squeeze(solution_mat, axis=-1) | [
"def",
"_solvevec",
"(",
"self",
",",
"rhs",
",",
"adjoint",
"=",
"False",
")",
":",
"rhs_mat",
"=",
"array_ops",
".",
"expand_dims",
"(",
"rhs",
",",
"axis",
"=",
"-",
"1",
")",
"solution_mat",
"=",
"self",
".",
"solve",
"(",
"rhs_mat",
",",
"adjoin... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/linalg/linear_operator.py#L791-L795 | |
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | configs/example/read_config.py | python | ConfigFile.get_port_peers | (self, object_name, port_name) | Get the list of connected port names (in the string form
object.port(\[index\])?) of the port object_name.port_name | Get the list of connected port names (in the string form
object.port(\[index\])?) of the port object_name.port_name | [
"Get",
"the",
"list",
"of",
"connected",
"port",
"names",
"(",
"in",
"the",
"string",
"form",
"object",
".",
"port",
"(",
"\\",
"[",
"index",
"\\",
"]",
")",
"?",
")",
"of",
"the",
"port",
"object_name",
".",
"port_name"
] | def get_port_peers(self, object_name, port_name):
"""Get the list of connected port names (in the string form
object.port(\[index\])?) of the port object_name.port_name"""
pass | [
"def",
"get_port_peers",
"(",
"self",
",",
"object_name",
",",
"port_name",
")",
":",
"pass"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/configs/example/read_config.py#L404-L407 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/decimal.py | python | _iexp | (x, M, L=8) | return M+y | Given integers x and M, M > 0, such that x/M is small in absolute
value, compute an integer approximation to M*exp(x/M). For 0 <=
x/M <= 2.4, the absolute error in the result is bounded by 60 (and
is usually much smaller). | Given integers x and M, M > 0, such that x/M is small in absolute
value, compute an integer approximation to M*exp(x/M). For 0 <=
x/M <= 2.4, the absolute error in the result is bounded by 60 (and
is usually much smaller). | [
"Given",
"integers",
"x",
"and",
"M",
"M",
">",
"0",
"such",
"that",
"x",
"/",
"M",
"is",
"small",
"in",
"absolute",
"value",
"compute",
"an",
"integer",
"approximation",
"to",
"M",
"*",
"exp",
"(",
"x",
"/",
"M",
")",
".",
"For",
"0",
"<",
"=",
... | def _iexp(x, M, L=8):
"""Given integers x and M, M > 0, such that x/M is small in absolute
value, compute an integer approximation to M*exp(x/M). For 0 <=
x/M <= 2.4, the absolute error in the result is bounded by 60 (and
is usually much smaller)."""
# Algorithm: to compute exp(z) for a real numbe... | [
"def",
"_iexp",
"(",
"x",
",",
"M",
",",
"L",
"=",
"8",
")",
":",
"# Algorithm: to compute exp(z) for a real number z, first divide z",
"# by a suitable power R of 2 so that |z/2**R| < 2**-L. Then",
"# compute expm1(z/2**R) = exp(z/2**R) - 1 using the usual Taylor",
"# series",
"#",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/decimal.py#L5709-L5744 | |
PaddlePaddle/PaddleOCR | b756bf5f8c90142e0d89d3db0163965c686b6ffe | ppstructure/table/tablepyxl/tablepyxl.py | python | document_to_xl | (doc, filename, base_url=None) | Takes a string representation of an html document and writes one sheet for
every table in the document. The workbook is written out to a file called filename | Takes a string representation of an html document and writes one sheet for
every table in the document. The workbook is written out to a file called filename | [
"Takes",
"a",
"string",
"representation",
"of",
"an",
"html",
"document",
"and",
"writes",
"one",
"sheet",
"for",
"every",
"table",
"in",
"the",
"document",
".",
"The",
"workbook",
"is",
"written",
"out",
"to",
"a",
"file",
"called",
"filename"
] | def document_to_xl(doc, filename, base_url=None):
"""
Takes a string representation of an html document and writes one sheet for
every table in the document. The workbook is written out to a file called filename
"""
wb = document_to_workbook(doc, base_url=base_url)
wb.save(filename) | [
"def",
"document_to_xl",
"(",
"doc",
",",
"filename",
",",
"base_url",
"=",
"None",
")",
":",
"wb",
"=",
"document_to_workbook",
"(",
"doc",
",",
"base_url",
"=",
"base_url",
")",
"wb",
".",
"save",
"(",
"filename",
")"
] | https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppstructure/table/tablepyxl/tablepyxl.py#L96-L102 | ||
eldar/deepcut-cnn | 928bf2f224fce132f6e4404b4c95fb017297a5e0 | python/caffe/pycaffe.py | python | _Net_set_input_arrays | (self, data, labels) | return self._set_input_arrays(data, labels) | Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.) | Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.) | [
"Set",
"input",
"arrays",
"of",
"the",
"in",
"-",
"memory",
"MemoryDataLayer",
".",
"(",
"Note",
":",
"this",
"is",
"only",
"for",
"networks",
"declared",
"with",
"the",
"memory",
"data",
"layer",
".",
")"
] | def _Net_set_input_arrays(self, data, labels):
"""
Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.)
"""
if labels.ndim == 1:
labels = np.ascontiguousarray(labels[:, np.newaxis, np.newaxis,
... | [
"def",
"_Net_set_input_arrays",
"(",
"self",
",",
"data",
",",
"labels",
")",
":",
"if",
"labels",
".",
"ndim",
"==",
"1",
":",
"labels",
"=",
"np",
".",
"ascontiguousarray",
"(",
"labels",
"[",
":",
",",
"np",
".",
"newaxis",
",",
"np",
".",
"newaxi... | https://github.com/eldar/deepcut-cnn/blob/928bf2f224fce132f6e4404b4c95fb017297a5e0/python/caffe/pycaffe.py#L235-L243 | |
apache/incubator-weex | 5c25f0b59f7ac90703c363e7261f60bd06356dbe | weex_core/tools/cpplint.py | python | _CppLintState.SetFilters | (self, filters) | Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Raises:
ValueError: The comma-sepa... | Sets the error-message filters. | [
"Sets",
"the",
"error",
"-",
"message",
"filters",
"."
] | def SetFilters(self, filters):
"""Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Ra... | [
"def",
"SetFilters",
"(",
"self",
",",
"filters",
")",
":",
"# Default filters always have less priority than the flag ones.",
"self",
".",
"filters",
"=",
"_DEFAULT_FILTERS",
"[",
":",
"]",
"self",
".",
"AddFilters",
"(",
"filters",
")"
] | https://github.com/apache/incubator-weex/blob/5c25f0b59f7ac90703c363e7261f60bd06356dbe/weex_core/tools/cpplint.py#L901-L917 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py | python | Standard_Suite_Events.count | (self, _object, _attributes={}, **_arguments) | count: Return the number of elements of a particular class within an object.
Required argument: the object for the command
Keyword argument each: The class of objects to be counted.
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: the reply for the command | count: Return the number of elements of a particular class within an object.
Required argument: the object for the command
Keyword argument each: The class of objects to be counted.
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: the reply for the command | [
"count",
":",
"Return",
"the",
"number",
"of",
"elements",
"of",
"a",
"particular",
"class",
"within",
"an",
"object",
".",
"Required",
"argument",
":",
"the",
"object",
"for",
"the",
"command",
"Keyword",
"argument",
"each",
":",
"The",
"class",
"of",
"ob... | def count(self, _object, _attributes={}, **_arguments):
"""count: Return the number of elements of a particular class within an object.
Required argument: the object for the command
Keyword argument each: The class of objects to be counted.
Keyword argument _attributes: AppleEvent attrib... | [
"def",
"count",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'core'",
"_subcode",
"=",
"'cnte'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_argmap_count",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py#L47-L67 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | clang/tools/scan-build-py/lib/libscanbuild/clang.py | python | is_ctu_capable | (extdef_map_cmd) | return True | Detects if the current (or given) clang and external definition mapping
executables are CTU compatible. | Detects if the current (or given) clang and external definition mapping
executables are CTU compatible. | [
"Detects",
"if",
"the",
"current",
"(",
"or",
"given",
")",
"clang",
"and",
"external",
"definition",
"mapping",
"executables",
"are",
"CTU",
"compatible",
"."
] | def is_ctu_capable(extdef_map_cmd):
""" Detects if the current (or given) clang and external definition mapping
executables are CTU compatible. """
try:
run_command([extdef_map_cmd, '-version'])
except (OSError, subprocess.CalledProcessError):
return False
return True | [
"def",
"is_ctu_capable",
"(",
"extdef_map_cmd",
")",
":",
"try",
":",
"run_command",
"(",
"[",
"extdef_map_cmd",
",",
"'-version'",
"]",
")",
"except",
"(",
"OSError",
",",
"subprocess",
".",
"CalledProcessError",
")",
":",
"return",
"False",
"return",
"True"
... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/tools/scan-build-py/lib/libscanbuild/clang.py#L164-L172 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/MQTTLib.py | python | AWSIoTMQTTClient.disconnect | (self) | return self._mqtt_core.disconnect() | **Description**
Disconnect from AWS IoT.
**Syntax**
.. code:: python
myAWSIoTMQTTClient.disconnect()
**Parameters**
None
**Returns**
True if the disconnect attempt succeeded. False if failed. | **Description** | [
"**",
"Description",
"**"
] | def disconnect(self):
"""
**Description**
Disconnect from AWS IoT.
**Syntax**
.. code:: python
myAWSIoTMQTTClient.disconnect()
**Parameters**
None
**Returns**
True if the disconnect attempt succeeded. False if failed.
"""... | [
"def",
"disconnect",
"(",
"self",
")",
":",
"return",
"self",
".",
"_mqtt_core",
".",
"disconnect",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/MQTTLib.py#L552-L573 | |
fengbingchun/NN_Test | d6305825d5273e4569ccd1eda9ffa2a9c72e18d2 | src/tiny-dnn/third_party/cpplint.py | python | NestingState.InAsmBlock | (self) | return self.stack and self.stack[-1].inline_asm != _NO_ASM | Check if we are currently one level inside an inline ASM block.
Returns:
True if the top of the stack is a block containing inline ASM. | Check if we are currently one level inside an inline ASM block. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"an",
"inline",
"ASM",
"block",
"."
] | def InAsmBlock(self):
"""Check if we are currently one level inside an inline ASM block.
Returns:
True if the top of the stack is a block containing inline ASM.
"""
return self.stack and self.stack[-1].inline_asm != _NO_ASM | [
"def",
"InAsmBlock",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
".",
"inline_asm",
"!=",
"_NO_ASM"
] | https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/cpplint.py#L2573-L2579 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/cr/cr/plugin.py | python | Plugin.Init | (self) | Post plugin registration initialisation method. | Post plugin registration initialisation method. | [
"Post",
"plugin",
"registration",
"initialisation",
"method",
"."
] | def Init(self):
"""Post plugin registration initialisation method."""
for config_root in CONFIG_TYPES:
config = getattr(self, config_root.property_name)
config.name = self.name
if config_root.only_active and not self.is_active:
config.enabled = False
if config_root.only_enabled a... | [
"def",
"Init",
"(",
"self",
")",
":",
"for",
"config_root",
"in",
"CONFIG_TYPES",
":",
"config",
"=",
"getattr",
"(",
"self",
",",
"config_root",
".",
"property_name",
")",
"config",
".",
"name",
"=",
"self",
".",
"name",
"if",
"config_root",
".",
"only_... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/cr/cr/plugin.py#L138-L151 | ||
vnpy/vnpy | f50f2535ed39dd33272e0985ed40c7078e4c19f6 | vnpy/chart/widget.py | python | ChartCursor._init_label | (self) | Create label objects on axis. | Create label objects on axis. | [
"Create",
"label",
"objects",
"on",
"axis",
"."
] | def _init_label(self) -> None:
"""
Create label objects on axis.
"""
self._y_labels: Dict[str, pg.TextItem] = {}
for plot_name, plot in self._plots.items():
label = pg.TextItem(
plot_name, fill=CURSOR_COLOR, color=BLACK_COLOR)
label.hide()
... | [
"def",
"_init_label",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"_y_labels",
":",
"Dict",
"[",
"str",
",",
"pg",
".",
"TextItem",
"]",
"=",
"{",
"}",
"for",
"plot_name",
",",
"plot",
"in",
"self",
".",
"_plots",
".",
"items",
"(",
")",
":... | https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/chart/widget.py#L361-L380 | ||
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | scripts/cpp_lint.py | python | _CppLintState.SetOutputFormat | (self, output_format) | Sets the output format for errors. | Sets the output format for errors. | [
"Sets",
"the",
"output",
"format",
"for",
"errors",
"."
] | def SetOutputFormat(self, output_format):
"""Sets the output format for errors."""
self.output_format = output_format | [
"def",
"SetOutputFormat",
"(",
"self",
",",
"output_format",
")",
":",
"self",
".",
"output_format",
"=",
"output_format"
] | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/scripts/cpp_lint.py#L703-L705 | ||
vmware/concord-bft | ec036a384b4c81be0423d4b429bd37900b13b864 | scripts/prepare-code-coverage-artifact.py | python | change_permissions_recursive | (path, mode) | Set permissions for all the files/folders under path
:param path: Path to the folder
:param mode: Permission | Set permissions for all the files/folders under path
:param path: Path to the folder
:param mode: Permission | [
"Set",
"permissions",
"for",
"all",
"the",
"files",
"/",
"folders",
"under",
"path",
":",
"param",
"path",
":",
"Path",
"to",
"the",
"folder",
":",
"param",
"mode",
":",
"Permission"
] | def change_permissions_recursive(path, mode):
"""
Set permissions for all the files/folders under path
:param path: Path to the folder
:param mode: Permission
"""
for root, dirs, files in os.walk(path, topdown=False):
for directory in [os.path.join(root, d) for d in dirs]:
os... | [
"def",
"change_permissions_recursive",
"(",
"path",
",",
"mode",
")",
":",
"for",
"root",
",",
"dirs",
",",
"files",
"in",
"os",
".",
"walk",
"(",
"path",
",",
"topdown",
"=",
"False",
")",
":",
"for",
"directory",
"in",
"[",
"os",
".",
"path",
".",
... | https://github.com/vmware/concord-bft/blob/ec036a384b4c81be0423d4b429bd37900b13b864/scripts/prepare-code-coverage-artifact.py#L25-L35 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/utilities/env_utils.py | python | get_robot_base_orientation | (robot) | Gets the base orientation of robot. | Gets the base orientation of robot. | [
"Gets",
"the",
"base",
"orientation",
"of",
"robot",
"."
] | def get_robot_base_orientation(robot):
"""Gets the base orientation of robot."""
# TODO(b/151975607): Clean this after robot interface migration.
if hasattr(robot, "GetBaseOrientation"):
return robot.GetBaseOrientation()
else:
return robot.base_orientation_quaternion | [
"def",
"get_robot_base_orientation",
"(",
"robot",
")",
":",
"# TODO(b/151975607): Clean this after robot interface migration.",
"if",
"hasattr",
"(",
"robot",
",",
"\"GetBaseOrientation\"",
")",
":",
"return",
"robot",
".",
"GetBaseOrientation",
"(",
")",
"else",
":",
... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/utilities/env_utils.py#L174-L180 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/symsrc/pefile.py | python | PE.set_dword_at_rva | (self, rva, dword) | return self.set_bytes_at_rva(rva, self.get_data_from_dword(dword)) | Set the double word value at the file offset corresponding to the given RVA. | Set the double word value at the file offset corresponding to the given RVA. | [
"Set",
"the",
"double",
"word",
"value",
"at",
"the",
"file",
"offset",
"corresponding",
"to",
"the",
"given",
"RVA",
"."
] | def set_dword_at_rva(self, rva, dword):
"""Set the double word value at the file offset corresponding to the given RVA."""
return self.set_bytes_at_rva(rva, self.get_data_from_dword(dword)) | [
"def",
"set_dword_at_rva",
"(",
"self",
",",
"rva",
",",
"dword",
")",
":",
"return",
"self",
".",
"set_bytes_at_rva",
"(",
"rva",
",",
"self",
".",
"get_data_from_dword",
"(",
"dword",
")",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/symsrc/pefile.py#L3435-L3437 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.