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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/FrameDecorator.py | python | SymValueWrapper.value | (self) | return self.val | Return the value associated with this symbol, or None | Return the value associated with this symbol, or None | [
"Return",
"the",
"value",
"associated",
"with",
"this",
"symbol",
"or",
"None"
] | def value(self):
""" Return the value associated with this symbol, or None"""
return self.val | [
"def",
"value",
"(",
"self",
")",
":",
"return",
"self",
".",
"val"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/FrameDecorator.py#L213-L215 | |
FeatherCoin/Feathercoin | 8dad11707024149029bb9bfdd7bc5e10385e0e77 | contrib/devtools/security-check.py | python | check_PE_NX | (executable) | return (bits & IMAGE_DLL_CHARACTERISTICS_NX_COMPAT) == IMAGE_DLL_CHARACTERISTICS_NX_COMPAT | NX: DllCharacteristics bit 0x100 signifies nxcompat (DEP) | NX: DllCharacteristics bit 0x100 signifies nxcompat (DEP) | [
"NX",
":",
"DllCharacteristics",
"bit",
"0x100",
"signifies",
"nxcompat",
"(",
"DEP",
")"
] | def check_PE_NX(executable):
'''NX: DllCharacteristics bit 0x100 signifies nxcompat (DEP)'''
(arch,bits) = get_PE_dll_characteristics(executable)
return (bits & IMAGE_DLL_CHARACTERISTICS_NX_COMPAT) == IMAGE_DLL_CHARACTERISTICS_NX_COMPAT | [
"def",
"check_PE_NX",
"(",
"executable",
")",
":",
"(",
"arch",
",",
"bits",
")",
"=",
"get_PE_dll_characteristics",
"(",
"executable",
")",
"return",
"(",
"bits",
"&",
"IMAGE_DLL_CHARACTERISTICS_NX_COMPAT",
")",
"==",
"IMAGE_DLL_CHARACTERISTICS_NX_COMPAT"
] | https://github.com/FeatherCoin/Feathercoin/blob/8dad11707024149029bb9bfdd7bc5e10385e0e77/contrib/devtools/security-check.py#L160-L163 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/predictor/contrib_estimator_predictor.py | python | ContribEstimatorPredictor.__init__ | (self,
estimator,
prediction_input_fn,
input_alternative_key=None,
output_alternative_key=None,
graph=None) | Initialize a `ContribEstimatorPredictor`.
Args:
estimator: an instance of `tf.contrib.learn.Estimator`.
prediction_input_fn: a function that takes no arguments and returns an
instance of `InputFnOps`.
input_alternative_key: Optional. Specify the input alternative used for
predicti... | Initialize a `ContribEstimatorPredictor`. | [
"Initialize",
"a",
"ContribEstimatorPredictor",
"."
] | def __init__(self,
estimator,
prediction_input_fn,
input_alternative_key=None,
output_alternative_key=None,
graph=None):
"""Initialize a `ContribEstimatorPredictor`.
Args:
estimator: an instance of `tf.contrib.learn.Estimator`.
... | [
"def",
"__init__",
"(",
"self",
",",
"estimator",
",",
"prediction_input_fn",
",",
"input_alternative_key",
"=",
"None",
",",
"output_alternative_key",
"=",
"None",
",",
"graph",
"=",
"None",
")",
":",
"self",
".",
"_graph",
"=",
"graph",
"or",
"ops",
".",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/predictor/contrib_estimator_predictor.py#L32-L74 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py | python | _ProxyFile.seek | (self, offset, whence=0) | Change position. | Change position. | [
"Change",
"position",
"."
] | def seek(self, offset, whence=0):
"""Change position."""
if whence == 1:
self._file.seek(self._pos)
self._file.seek(offset, whence)
self._pos = self._file.tell() | [
"def",
"seek",
"(",
"self",
",",
"offset",
",",
"whence",
"=",
"0",
")",
":",
"if",
"whence",
"==",
"1",
":",
"self",
".",
"_file",
".",
"seek",
"(",
"self",
".",
"_pos",
")",
"self",
".",
"_file",
".",
"seek",
"(",
"offset",
",",
"whence",
")"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py#L1898-L1903 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/wsgiref/handlers.py | python | BaseHandler.add_cgi_vars | (self) | Override in subclass to insert CGI variables in 'self.environ | Override in subclass to insert CGI variables in 'self.environ | [
"Override",
"in",
"subclass",
"to",
"insert",
"CGI",
"variables",
"in",
"self",
".",
"environ"
] | def add_cgi_vars(self):
"""Override in subclass to insert CGI variables in 'self.environ'"""
raise NotImplementedError | [
"def",
"add_cgi_vars",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/wsgiref/handlers.py#L353-L355 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/compiler/pyassem.py | python | Block.getContainedGraphs | (self) | return contained | Return all graphs contained within this block.
For example, a MAKE_FUNCTION block will contain a reference to
the graph for the function body. | Return all graphs contained within this block. | [
"Return",
"all",
"graphs",
"contained",
"within",
"this",
"block",
"."
] | def getContainedGraphs(self):
"""Return all graphs contained within this block.
For example, a MAKE_FUNCTION block will contain a reference to
the graph for the function body.
"""
contained = []
for inst in self.insts:
if len(inst) == 1:
conti... | [
"def",
"getContainedGraphs",
"(",
"self",
")",
":",
"contained",
"=",
"[",
"]",
"for",
"inst",
"in",
"self",
".",
"insts",
":",
"if",
"len",
"(",
"inst",
")",
"==",
"1",
":",
"continue",
"op",
"=",
"inst",
"[",
"1",
"]",
"if",
"hasattr",
"(",
"op... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/compiler/pyassem.py#L231-L244 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | TreeItemId.IsOk | (*args, **kwargs) | return _controls_.TreeItemId_IsOk(*args, **kwargs) | IsOk(self) -> bool | IsOk(self) -> bool | [
"IsOk",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsOk(*args, **kwargs):
"""IsOk(self) -> bool"""
return _controls_.TreeItemId_IsOk(*args, **kwargs) | [
"def",
"IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeItemId_IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L5001-L5003 | |
chipsalliance/verible | aa14e0074ff89945bf65eecfb9ef78684d996058 | verilog/tools/syntax/export_json_examples/verible_verilog_syntax.py | python | BranchNode.find_all | (self, filter_: Union[CallableFilter, KeyValueFilter, None],
max_count: int = 0, iter_: TreeIterator = LevelOrderTreeIterator,
**kwargs) | return list(self.iter_find_all(filter_, max_count=max_count, iter_=iter_,
**kwargs)) | Find all nodes matching specified filter.
Args:
filter_: Describes what to search for. Might be:
* Callable taking Node as an argument and returning True for accepted
nodes.
* Dict mapping Node attribute names to searched value or list of
searched values.
max_count: ... | Find all nodes matching specified filter. | [
"Find",
"all",
"nodes",
"matching",
"specified",
"filter",
"."
] | def find_all(self, filter_: Union[CallableFilter, KeyValueFilter, None],
max_count: int = 0, iter_: TreeIterator = LevelOrderTreeIterator,
**kwargs) -> List[Node]:
"""Find all nodes matching specified filter.
Args:
filter_: Describes what to search for. Might be:
* C... | [
"def",
"find_all",
"(",
"self",
",",
"filter_",
":",
"Union",
"[",
"CallableFilter",
",",
"KeyValueFilter",
",",
"None",
"]",
",",
"max_count",
":",
"int",
"=",
"0",
",",
"iter_",
":",
"TreeIterator",
"=",
"LevelOrderTreeIterator",
",",
"*",
"*",
"kwargs",... | https://github.com/chipsalliance/verible/blob/aa14e0074ff89945bf65eecfb9ef78684d996058/verilog/tools/syntax/export_json_examples/verible_verilog_syntax.py#L218-L236 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/runtime.py | python | LoopContextBase.changed | (self, *value) | return False | Checks whether the value has changed since the last call. | Checks whether the value has changed since the last call. | [
"Checks",
"whether",
"the",
"value",
"has",
"changed",
"since",
"the",
"last",
"call",
"."
] | def changed(self, *value):
"""Checks whether the value has changed since the last call."""
if self._last_checked_value != value:
self._last_checked_value = value
return True
return False | [
"def",
"changed",
"(",
"self",
",",
"*",
"value",
")",
":",
"if",
"self",
".",
"_last_checked_value",
"!=",
"value",
":",
"self",
".",
"_last_checked_value",
"=",
"value",
"return",
"True",
"return",
"False"
] | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/runtime.py#L372-L377 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/msvs_emulation.py | python | MsvsSettings.GetDefFile | (self, gyp_to_build_path) | return None | Returns the .def file from sources, if any. Otherwise returns None. | Returns the .def file from sources, if any. Otherwise returns None. | [
"Returns",
"the",
".",
"def",
"file",
"from",
"sources",
"if",
"any",
".",
"Otherwise",
"returns",
"None",
"."
] | def GetDefFile(self, gyp_to_build_path):
"""Returns the .def file from sources, if any. Otherwise returns None."""
spec = self.spec
if spec['type'] in ('shared_library', 'loadable_module', 'executable'):
def_files = [s for s in spec.get('sources', []) if s.lower().endswith('.def')]
if len(def_f... | [
"def",
"GetDefFile",
"(",
"self",
",",
"gyp_to_build_path",
")",
":",
"spec",
"=",
"self",
".",
"spec",
"if",
"spec",
"[",
"'type'",
"]",
"in",
"(",
"'shared_library'",
",",
"'loadable_module'",
",",
"'executable'",
")",
":",
"def_files",
"=",
"[",
"s",
... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/msvs_emulation.py#L493-L502 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py | python | IRBuilder.bswap | (self, cond) | Used to byte swap integer values with an even number of bytes (positive multiple of 16 bits) | Used to byte swap integer values with an even number of bytes (positive multiple of 16 bits) | [
"Used",
"to",
"byte",
"swap",
"integer",
"values",
"with",
"an",
"even",
"number",
"of",
"bytes",
"(",
"positive",
"multiple",
"of",
"16",
"bits",
")"
] | def bswap(self, cond):
"""
Used to byte swap integer values with an even number of bytes (positive multiple of 16 bits)
""" | [
"def",
"bswap",
"(",
"self",
",",
"cond",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py#L1001-L1004 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PropertyGridInterface.Properties | (self) | This attribute is a pythonic iterator over all properties in
this `PropertyGrid` property container. It will only skip
categories and private child properties. Usage is simple::
for prop in propGrid.Properties:
print(prop)
:see: `wx.propgrid.PropertyGridInterface.It... | This attribute is a pythonic iterator over all properties in
this `PropertyGrid` property container. It will only skip
categories and private child properties. Usage is simple:: | [
"This",
"attribute",
"is",
"a",
"pythonic",
"iterator",
"over",
"all",
"properties",
"in",
"this",
"PropertyGrid",
"property",
"container",
".",
"It",
"will",
"only",
"skip",
"categories",
"and",
"private",
"child",
"properties",
".",
"Usage",
"is",
"simple",
... | def Properties(self):
"""
This attribute is a pythonic iterator over all properties in
this `PropertyGrid` property container. It will only skip
categories and private child properties. Usage is simple::
for prop in propGrid.Properties:
print(prop)
:... | [
"def",
"Properties",
"(",
"self",
")",
":",
"it",
"=",
"self",
".",
"GetVIterator",
"(",
"PG_ITERATE_NORMAL",
")",
"while",
"not",
"it",
".",
"AtEnd",
"(",
")",
":",
"yield",
"it",
".",
"GetProperty",
"(",
")",
"it",
".",
"Next",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L1765-L1780 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchCommands.py | python | survey | (callback=False) | survey(): starts survey mode, where you can click edges and faces to get their lengths or area.
Clicking on no object (on an empty area) resets the count. | survey(): starts survey mode, where you can click edges and faces to get their lengths or area.
Clicking on no object (on an empty area) resets the count. | [
"survey",
"()",
":",
"starts",
"survey",
"mode",
"where",
"you",
"can",
"click",
"edges",
"and",
"faces",
"to",
"get",
"their",
"lengths",
"or",
"area",
".",
"Clicking",
"on",
"no",
"object",
"(",
"on",
"an",
"empty",
"area",
")",
"resets",
"the",
"cou... | def survey(callback=False):
"""survey(): starts survey mode, where you can click edges and faces to get their lengths or area.
Clicking on no object (on an empty area) resets the count."""
if not callback:
if hasattr(FreeCAD,"SurveyObserver"):
for label in FreeCAD.SurveyObserver.labels:
... | [
"def",
"survey",
"(",
"callback",
"=",
"False",
")",
":",
"if",
"not",
"callback",
":",
"if",
"hasattr",
"(",
"FreeCAD",
",",
"\"SurveyObserver\"",
")",
":",
"for",
"label",
"in",
"FreeCAD",
".",
"SurveyObserver",
".",
"labels",
":",
"FreeCAD",
".",
"Act... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchCommands.py#L792-L955 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/debug/lib/debug_data.py | python | DebugDumpDir.t0 | (self) | return self._t0 | Absolute timestamp of the first dumped tensor across all devices.
Returns:
(`int`) absolute timestamp of the first dumped tensor, in microseconds. | Absolute timestamp of the first dumped tensor across all devices. | [
"Absolute",
"timestamp",
"of",
"the",
"first",
"dumped",
"tensor",
"across",
"all",
"devices",
"."
] | def t0(self):
"""Absolute timestamp of the first dumped tensor across all devices.
Returns:
(`int`) absolute timestamp of the first dumped tensor, in microseconds.
"""
return self._t0 | [
"def",
"t0",
"(",
"self",
")",
":",
"return",
"self",
".",
"_t0"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/debug_data.py#L733-L739 | |
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/build/lib.linux-x86_64-2.7/mxnet/executor_manager.py | python | DataParallelExecutorGroup.update_metric | (self, metric, labels) | Update evaluation metric with label and current outputs | Update evaluation metric with label and current outputs | [
"Update",
"evaluation",
"metric",
"with",
"label",
"and",
"current",
"outputs"
] | def update_metric(self, metric, labels):
""" Update evaluation metric with label and current outputs """
for texec, islice in zip(self.train_execs, self.slices):
labels_slice = [label[islice] for label in labels]
metric.update(labels_slice, texec.outputs) | [
"def",
"update_metric",
"(",
"self",
",",
"metric",
",",
"labels",
")",
":",
"for",
"texec",
",",
"islice",
"in",
"zip",
"(",
"self",
".",
"train_execs",
",",
"self",
".",
"slices",
")",
":",
"labels_slice",
"=",
"[",
"label",
"[",
"islice",
"]",
"fo... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/executor_manager.py#L245-L249 | ||
NicknineTheEagle/TF2-Base | 20459c5a7fbc995b6bf54fa85c2f62a101e9fb64 | src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/wire_format.py | python | _VarUInt64ByteSizeNoTag | (uint64) | return 10 | Returns the number of bytes required to serialize a single varint
using boundary value comparisons. (unrolled loop optimization -WPierce)
uint64 must be unsigned. | Returns the number of bytes required to serialize a single varint
using boundary value comparisons. (unrolled loop optimization -WPierce)
uint64 must be unsigned. | [
"Returns",
"the",
"number",
"of",
"bytes",
"required",
"to",
"serialize",
"a",
"single",
"varint",
"using",
"boundary",
"value",
"comparisons",
".",
"(",
"unrolled",
"loop",
"optimization",
"-",
"WPierce",
")",
"uint64",
"must",
"be",
"unsigned",
"."
] | def _VarUInt64ByteSizeNoTag(uint64):
"""Returns the number of bytes required to serialize a single varint
using boundary value comparisons. (unrolled loop optimization -WPierce)
uint64 must be unsigned.
"""
if uint64 <= 0x7f: return 1
if uint64 <= 0x3fff: return 2
if uint64 <= 0x1fffff: return 3
if uint... | [
"def",
"_VarUInt64ByteSizeNoTag",
"(",
"uint64",
")",
":",
"if",
"uint64",
"<=",
"0x7f",
":",
"return",
"1",
"if",
"uint64",
"<=",
"0x3fff",
":",
"return",
"2",
"if",
"uint64",
"<=",
"0x1fffff",
":",
"return",
"3",
"if",
"uint64",
"<=",
"0xfffffff",
":",... | https://github.com/NicknineTheEagle/TF2-Base/blob/20459c5a7fbc995b6bf54fa85c2f62a101e9fb64/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/wire_format.py#L232-L248 | |
D-X-Y/caffe-faster-rcnn | eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb | scripts/cpp_lint.py | python | FindNextMultiLineCommentStart | (lines, lineix) | return len(lines) | Find the beginning marker for a multiline comment. | Find the beginning marker for a multiline comment. | [
"Find",
"the",
"beginning",
"marker",
"for",
"a",
"multiline",
"comment",
"."
] | def FindNextMultiLineCommentStart(lines, lineix):
"""Find the beginning marker for a multiline comment."""
while lineix < len(lines):
if lines[lineix].strip().startswith('/*'):
# Only return this marker if the comment goes beyond this line
if lines[lineix].strip().find('*/', 2) < 0:
return l... | [
"def",
"FindNextMultiLineCommentStart",
"(",
"lines",
",",
"lineix",
")",
":",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"if",
"lines",
"[",
"lineix",
"]",
".",
"strip",
"(",
")",
".",
"startswith",
"(",
"'/*'",
")",
":",
"# Only return this... | https://github.com/D-X-Y/caffe-faster-rcnn/blob/eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb/scripts/cpp_lint.py#L1127-L1135 | |
potassco/clingo | e0c91d8f95cc28de1c480a871f9c97c30de83d40 | libpyclingo/clingo/ast.py | python | ShowTerm | (location: Location, term: AST, body: Sequence[AST], csp: int) | return AST(p_ast[0]) | Construct an AST node of type `ASTType.ShowTerm`. | Construct an AST node of type `ASTType.ShowTerm`. | [
"Construct",
"an",
"AST",
"node",
"of",
"type",
"ASTType",
".",
"ShowTerm",
"."
] | def ShowTerm(location: Location, term: AST, body: Sequence[AST], csp: int) -> AST:
'''
Construct an AST node of type `ASTType.ShowTerm`.
'''
p_ast = _ffi.new('clingo_ast_t**')
c_location = _c_location(location)
_handle_error(_lib.clingo_ast_build(
_lib.clingo_ast_type_show_term, p_ast,
... | [
"def",
"ShowTerm",
"(",
"location",
":",
"Location",
",",
"term",
":",
"AST",
",",
"body",
":",
"Sequence",
"[",
"AST",
"]",
",",
"csp",
":",
"int",
")",
"->",
"AST",
":",
"p_ast",
"=",
"_ffi",
".",
"new",
"(",
"'clingo_ast_t**'",
")",
"c_location",
... | https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/ast.py#L1732-L1745 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/textwrap.py | python | TextWrapper._fix_sentence_endings | (self, chunks) | _fix_sentence_endings(chunks : [string])
Correct for sentence endings buried in 'chunks'. Eg. when the
original text contains "... foo.\\nBar ...", munge_whitespace()
and split() will convert that to [..., "foo.", " ", "Bar", ...]
which has one too few spaces; this method simply change... | _fix_sentence_endings(chunks : [string]) | [
"_fix_sentence_endings",
"(",
"chunks",
":",
"[",
"string",
"]",
")"
] | def _fix_sentence_endings(self, chunks):
"""_fix_sentence_endings(chunks : [string])
Correct for sentence endings buried in 'chunks'. Eg. when the
original text contains "... foo.\\nBar ...", munge_whitespace()
and split() will convert that to [..., "foo.", " ", "Bar", ...]
whi... | [
"def",
"_fix_sentence_endings",
"(",
"self",
",",
"chunks",
")",
":",
"i",
"=",
"0",
"patsearch",
"=",
"self",
".",
"sentence_end_re",
".",
"search",
"while",
"i",
"<",
"len",
"(",
"chunks",
")",
"-",
"1",
":",
"if",
"chunks",
"[",
"i",
"+",
"1",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/textwrap.py#L182-L198 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py | python | device_memset | (dst, val, size, stream=0) | Memset on the device.
If stream is not zero, asynchronous mode is used.
dst: device memory
val: byte value to be written
size: number of byte to be written
stream: a CUDA stream | Memset on the device.
If stream is not zero, asynchronous mode is used. | [
"Memset",
"on",
"the",
"device",
".",
"If",
"stream",
"is",
"not",
"zero",
"asynchronous",
"mode",
"is",
"used",
"."
] | def device_memset(dst, val, size, stream=0):
"""Memset on the device.
If stream is not zero, asynchronous mode is used.
dst: device memory
val: byte value to be written
size: number of byte to be written
stream: a CUDA stream
"""
varargs = []
if stream:
assert isinstance(st... | [
"def",
"device_memset",
"(",
"dst",
",",
"val",
",",
"size",
",",
"stream",
"=",
"0",
")",
":",
"varargs",
"=",
"[",
"]",
"if",
"stream",
":",
"assert",
"isinstance",
"(",
"stream",
",",
"Stream",
")",
"fn",
"=",
"driver",
".",
"cuMemsetD8Async",
"va... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py#L1939-L1957 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm.py | python | GMM.__init__ | (self,
num_clusters,
model_dir=None,
random_seed=0,
params='wmc',
initial_clusters='random',
covariance_type='full',
batch_size=128,
steps=10,
continue_training=False,
co... | Creates a model for running GMM training and inference.
Args:
num_clusters: number of clusters to train.
model_dir: the directory to save the model results and log files.
random_seed: Python integer. Seed for PRNG used to initialize centers.
params: Controls which parameters are updated in ... | Creates a model for running GMM training and inference. | [
"Creates",
"a",
"model",
"for",
"running",
"GMM",
"training",
"and",
"inference",
"."
] | def __init__(self,
num_clusters,
model_dir=None,
random_seed=0,
params='wmc',
initial_clusters='random',
covariance_type='full',
batch_size=128,
steps=10,
continue_training=False,
... | [
"def",
"__init__",
"(",
"self",
",",
"num_clusters",
",",
"model_dir",
"=",
"None",
",",
"random_seed",
"=",
"0",
",",
"params",
"=",
"'wmc'",
",",
"initial_clusters",
"=",
"'random'",
",",
"covariance_type",
"=",
"'full'",
",",
"batch_size",
"=",
"128",
"... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm.py#L43-L85 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | ToolBarToolBase.SetToggle | (*args, **kwargs) | return _controls_.ToolBarToolBase_SetToggle(*args, **kwargs) | SetToggle(self, bool toggle) -> bool | SetToggle(self, bool toggle) -> bool | [
"SetToggle",
"(",
"self",
"bool",
"toggle",
")",
"-",
">",
"bool"
] | def SetToggle(*args, **kwargs):
"""SetToggle(self, bool toggle) -> bool"""
return _controls_.ToolBarToolBase_SetToggle(*args, **kwargs) | [
"def",
"SetToggle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ToolBarToolBase_SetToggle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L3521-L3523 | |
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/engine/ensembles.py | python | NPTEnsemble.step | (self) | NPT time step.
Note that the barostat only propagates the centroid coordinates. If this
approximation is made a centroid virial pressure and stress estimator can
be defined, so this gives the best statistical convergence. This is
allowed as the normal mode propagation is approximately unaffecte... | NPT time step. | [
"NPT",
"time",
"step",
"."
] | def step(self):
"""NPT time step.
Note that the barostat only propagates the centroid coordinates. If this
approximation is made a centroid virial pressure and stress estimator can
be defined, so this gives the best statistical convergence. This is
allowed as the normal mode propagation i... | [
"def",
"step",
"(",
"self",
")",
":",
"self",
".",
"ttime",
"=",
"-",
"time",
".",
"time",
"(",
")",
"self",
".",
"thermostat",
".",
"step",
"(",
")",
"self",
".",
"barostat",
".",
"thermostat",
".",
"step",
"(",
")",
"self",
".",
"rmcom",
"(",
... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/engine/ensembles.py#L455-L489 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/google/protobuf/descriptor.py | python | FileDescriptor.CopyToProto | (self, proto) | Copies this to a descriptor_pb2.FileDescriptorProto.
Args:
proto: An empty descriptor_pb2.FileDescriptorProto. | Copies this to a descriptor_pb2.FileDescriptorProto. | [
"Copies",
"this",
"to",
"a",
"descriptor_pb2",
".",
"FileDescriptorProto",
"."
] | def CopyToProto(self, proto):
"""Copies this to a descriptor_pb2.FileDescriptorProto.
Args:
proto: An empty descriptor_pb2.FileDescriptorProto.
"""
proto.ParseFromString(self.serialized_pb) | [
"def",
"CopyToProto",
"(",
"self",
",",
"proto",
")",
":",
"proto",
".",
"ParseFromString",
"(",
"self",
".",
"serialized_pb",
")"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/descriptor.py#L581-L587 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | tools/update-packaging/make_incremental_updates.py | python | create_add_patch_for_file | (to_marfile_entry, patch_info) | Copy the file to the working dir, add the add instruction, and add it to the list of archive files | Copy the file to the working dir, add the add instruction, and add it to the list of archive files | [
"Copy",
"the",
"file",
"to",
"the",
"working",
"dir",
"add",
"the",
"add",
"instruction",
"and",
"add",
"it",
"to",
"the",
"list",
"of",
"archive",
"files"
] | def create_add_patch_for_file(to_marfile_entry, patch_info):
""" Copy the file to the working dir, add the add instruction, and add it to the list of archive files """
copy_file(to_marfile_entry.abs_path, os.path.join(patch_info.work_dir, to_marfile_entry.name))
patch_info.append_add_instruction(to_marfile... | [
"def",
"create_add_patch_for_file",
"(",
"to_marfile_entry",
",",
"patch_info",
")",
":",
"copy_file",
"(",
"to_marfile_entry",
".",
"abs_path",
",",
"os",
".",
"path",
".",
"join",
"(",
"patch_info",
".",
"work_dir",
",",
"to_marfile_entry",
".",
"name",
")",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/tools/update-packaging/make_incremental_updates.py#L284-L288 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/plan/robotcspace.py | python | ClosedLoopRobotCSpace.setIKActiveDofs | (self,activeSet) | Marks that only a subset of the DOFs of the robot are to be used for solving
the IK constraint. | Marks that only a subset of the DOFs of the robot are to be used for solving
the IK constraint. | [
"Marks",
"that",
"only",
"a",
"subset",
"of",
"the",
"DOFs",
"of",
"the",
"robot",
"are",
"to",
"be",
"used",
"for",
"solving",
"the",
"IK",
"constraint",
"."
] | def setIKActiveDofs(self,activeSet):
"""Marks that only a subset of the DOFs of the robot are to be used for solving
the IK constraint."""
self.solver.setActiveDofs(activeSet) | [
"def",
"setIKActiveDofs",
"(",
"self",
",",
"activeSet",
")",
":",
"self",
".",
"solver",
".",
"setActiveDofs",
"(",
"activeSet",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/plan/robotcspace.py#L211-L214 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/shutil.py | python | unpack_archive | (filename, extract_dir=None, format=None) | Unpack an archive.
`filename` is the name of the archive.
`extract_dir` is the name of the target directory, where the archive
is unpacked. If not provided, the current working directory is used.
`format` is the archive format: one of "zip", "tar", "gztar", "bztar",
or "xztar". Or any other regi... | Unpack an archive. | [
"Unpack",
"an",
"archive",
"."
] | def unpack_archive(filename, extract_dir=None, format=None):
"""Unpack an archive.
`filename` is the name of the archive.
`extract_dir` is the name of the target directory, where the archive
is unpacked. If not provided, the current working directory is used.
`format` is the archive format: one o... | [
"def",
"unpack_archive",
"(",
"filename",
",",
"extract_dir",
"=",
"None",
",",
"format",
"=",
"None",
")",
":",
"if",
"extract_dir",
"is",
"None",
":",
"extract_dir",
"=",
"os",
".",
"getcwd",
"(",
")",
"extract_dir",
"=",
"os",
".",
"fspath",
"(",
"e... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/shutil.py#L965-L1002 | ||
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/utils.py | python | clear_caches | () | Jinja2 keeps internal caches for environments and lexers. These are
used so that Jinja2 doesn't have to recreate environments and lexers all
the time. Normally you don't have to care about that but if you are
measuring memory consumption you may want to clean the caches. | Jinja2 keeps internal caches for environments and lexers. These are
used so that Jinja2 doesn't have to recreate environments and lexers all
the time. Normally you don't have to care about that but if you are
measuring memory consumption you may want to clean the caches. | [
"Jinja2",
"keeps",
"internal",
"caches",
"for",
"environments",
"and",
"lexers",
".",
"These",
"are",
"used",
"so",
"that",
"Jinja2",
"doesn",
"t",
"have",
"to",
"recreate",
"environments",
"and",
"lexers",
"all",
"the",
"time",
".",
"Normally",
"you",
"don"... | def clear_caches():
"""Jinja2 keeps internal caches for environments and lexers. These are
used so that Jinja2 doesn't have to recreate environments and lexers all
the time. Normally you don't have to care about that but if you are
measuring memory consumption you may want to clean the caches.
"""... | [
"def",
"clear_caches",
"(",
")",
":",
"from",
"jinja2",
".",
"environment",
"import",
"_spontaneous_environments",
"from",
"jinja2",
".",
"lexer",
"import",
"_lexer_cache",
"_spontaneous_environments",
".",
"clear",
"(",
")",
"_lexer_cache",
".",
"clear",
"(",
")"... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/utils.py#L111-L120 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | Log_DoCreateOnDemand | (*args) | return _misc_.Log_DoCreateOnDemand(*args) | Log_DoCreateOnDemand() | Log_DoCreateOnDemand() | [
"Log_DoCreateOnDemand",
"()"
] | def Log_DoCreateOnDemand(*args):
"""Log_DoCreateOnDemand()"""
return _misc_.Log_DoCreateOnDemand(*args) | [
"def",
"Log_DoCreateOnDemand",
"(",
"*",
"args",
")",
":",
"return",
"_misc_",
".",
"Log_DoCreateOnDemand",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L1684-L1686 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/computation/pytables.py | python | BinOp.is_in_table | (self) | return self.queryables.get(self.lhs) is not None | return True if this is a valid column name for generation (e.g. an
actual column in the table) | return True if this is a valid column name for generation (e.g. an
actual column in the table) | [
"return",
"True",
"if",
"this",
"is",
"a",
"valid",
"column",
"name",
"for",
"generation",
"(",
"e",
".",
"g",
".",
"an",
"actual",
"column",
"in",
"the",
"table",
")"
] | def is_in_table(self) -> bool:
"""
return True if this is a valid column name for generation (e.g. an
actual column in the table)
"""
return self.queryables.get(self.lhs) is not None | [
"def",
"is_in_table",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"queryables",
".",
"get",
"(",
"self",
".",
"lhs",
")",
"is",
"not",
"None"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/computation/pytables.py#L170-L175 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | chrome/common/extensions/docs/server2/compiled_file_system.py | python | SingleFile | (fn) | return fn | A decorator which can be optionally applied to the compilation function
passed to CompiledFileSystem.Create, indicating that the function only
needs access to the file which is given in the function's callback. When
this is the case some optimisations can be done.
Note that this decorator must be listed first ... | A decorator which can be optionally applied to the compilation function
passed to CompiledFileSystem.Create, indicating that the function only
needs access to the file which is given in the function's callback. When
this is the case some optimisations can be done. | [
"A",
"decorator",
"which",
"can",
"be",
"optionally",
"applied",
"to",
"the",
"compilation",
"function",
"passed",
"to",
"CompiledFileSystem",
".",
"Create",
"indicating",
"that",
"the",
"function",
"only",
"needs",
"access",
"to",
"the",
"file",
"which",
"is",
... | def SingleFile(fn):
'''A decorator which can be optionally applied to the compilation function
passed to CompiledFileSystem.Create, indicating that the function only
needs access to the file which is given in the function's callback. When
this is the case some optimisations can be done.
Note that this decora... | [
"def",
"SingleFile",
"(",
"fn",
")",
":",
"_SINGLE_FILE_FUNCTIONS",
".",
"add",
"(",
"fn",
")",
"return",
"fn"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/compiled_file_system.py#L20-L30 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/cython/Cython/Compiler/ExprNodes.py | python | BufferIndexNode.buffer_lookup_code | (self, code) | return buffer_entry, Buffer.put_buffer_lookup_code(
entry=buffer_entry,
index_signeds=[ivar.type.signed for ivar in self.indices],
index_cnames=index_temps,
directives=code.globalstate.directives,
pos=self.pos, code=code,
negative_indices=negative_... | ndarray[1, 2, 3] and memslice[1, 2, 3] | ndarray[1, 2, 3] and memslice[1, 2, 3] | [
"ndarray",
"[",
"1",
"2",
"3",
"]",
"and",
"memslice",
"[",
"1",
"2",
"3",
"]"
] | def buffer_lookup_code(self, code):
"""
ndarray[1, 2, 3] and memslice[1, 2, 3]
"""
if self.in_nogil_context:
if self.is_buffer_access or self.is_memview_index:
if code.globalstate.directives['boundscheck']:
warning(self.pos, "Use boundschec... | [
"def",
"buffer_lookup_code",
"(",
"self",
",",
"code",
")",
":",
"if",
"self",
".",
"in_nogil_context",
":",
"if",
"self",
".",
"is_buffer_access",
"or",
"self",
".",
"is_memview_index",
":",
"if",
"code",
".",
"globalstate",
".",
"directives",
"[",
"'bounds... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Compiler/ExprNodes.py#L4287-L4314 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Source/bindings/scripts/generate_global_constructors.py | python | interface_name_to_constructors | (interface_name) | return flatten_list(global_name_to_constructors[global_name]
for global_name in global_names) | Returns constructors for an interface. | Returns constructors for an interface. | [
"Returns",
"constructors",
"for",
"an",
"interface",
"."
] | def interface_name_to_constructors(interface_name):
"""Returns constructors for an interface."""
global_names = interface_name_to_global_names[interface_name]
return flatten_list(global_name_to_constructors[global_name]
for global_name in global_names) | [
"def",
"interface_name_to_constructors",
"(",
"interface_name",
")",
":",
"global_names",
"=",
"interface_name_to_global_names",
"[",
"interface_name",
"]",
"return",
"flatten_list",
"(",
"global_name_to_constructors",
"[",
"global_name",
"]",
"for",
"global_name",
"in",
... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Source/bindings/scripts/generate_global_constructors.py#L64-L68 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/docs/method.py | python | document_custom_signature | (section, name, method,
include=None, exclude=None) | Documents the signature of a custom method
:param section: The section to write the documentation to.
:param name: The name of the method
:param method: The handle to the method being documented
:type include: Dictionary where keys are parameter names and
values are the shapes of the paramet... | Documents the signature of a custom method | [
"Documents",
"the",
"signature",
"of",
"a",
"custom",
"method"
] | def document_custom_signature(section, name, method,
include=None, exclude=None):
"""Documents the signature of a custom method
:param section: The section to write the documentation to.
:param name: The name of the method
:param method: The handle to the method being do... | [
"def",
"document_custom_signature",
"(",
"section",
",",
"name",
",",
"method",
",",
"include",
"=",
"None",
",",
"exclude",
"=",
"None",
")",
":",
"args",
",",
"varargs",
",",
"keywords",
",",
"defaults",
"=",
"inspect",
".",
"getargspec",
"(",
"method",
... | 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/method.py#L81-L105 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/robotparser.py | python | RobotFileParser.mtime | (self) | return self.last_checked | Returns the time the robots.txt file was last fetched.
This is useful for long-running web spiders that need to
check for new robots.txt files periodically. | Returns the time the robots.txt file was last fetched. | [
"Returns",
"the",
"time",
"the",
"robots",
".",
"txt",
"file",
"was",
"last",
"fetched",
"."
] | def mtime(self):
"""Returns the time the robots.txt file was last fetched.
This is useful for long-running web spiders that need to
check for new robots.txt files periodically.
"""
return self.last_checked | [
"def",
"mtime",
"(",
"self",
")",
":",
"return",
"self",
".",
"last_checked"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/robotparser.py#L33-L40 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/dummy.py | python | DummyRegressor.predict | (self, X) | return y | Perform classification on test vectors X.
Parameters
----------
X : {array-like, sparse matrix}, shape = [n_samples, n_features]
Input vectors, where n_samples is the number of samples
and n_features is the number of features.
Returns
-------
y :... | Perform classification on test vectors X. | [
"Perform",
"classification",
"on",
"test",
"vectors",
"X",
"."
] | def predict(self, X):
"""
Perform classification on test vectors X.
Parameters
----------
X : {array-like, sparse matrix}, shape = [n_samples, n_features]
Input vectors, where n_samples is the number of samples
and n_features is the number of features.
... | [
"def",
"predict",
"(",
"self",
",",
"X",
")",
":",
"check_is_fitted",
"(",
"self",
",",
"\"constant_\"",
")",
"X",
"=",
"check_array",
"(",
"X",
",",
"accept_sparse",
"=",
"[",
"'csr'",
",",
"'csc'",
",",
"'coo'",
"]",
")",
"n_samples",
"=",
"X",
"."... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/dummy.py#L452-L476 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/wizard.py | python | WizardEvent.GetDirection | (*args, **kwargs) | return _wizard.WizardEvent_GetDirection(*args, **kwargs) | GetDirection(self) -> bool | GetDirection(self) -> bool | [
"GetDirection",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetDirection(*args, **kwargs):
"""GetDirection(self) -> bool"""
return _wizard.WizardEvent_GetDirection(*args, **kwargs) | [
"def",
"GetDirection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_wizard",
".",
"WizardEvent_GetDirection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/wizard.py#L96-L98 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Tools/Scripts/logmerge.py | python | digest_chunk | (chunk, branch=None) | return records | Digest a chunk -- extract working file name and revisions | Digest a chunk -- extract working file name and revisions | [
"Digest",
"a",
"chunk",
"--",
"extract",
"working",
"file",
"name",
"and",
"revisions"
] | def digest_chunk(chunk, branch=None):
"""Digest a chunk -- extract working file name and revisions"""
lines = chunk[0]
key = 'Working file:'
keylen = len(key)
for line in lines:
if line[:keylen] == key:
working_file = line[keylen:].strip()
break
else:
work... | [
"def",
"digest_chunk",
"(",
"chunk",
",",
"branch",
"=",
"None",
")",
":",
"lines",
"=",
"chunk",
"[",
"0",
"]",
"key",
"=",
"'Working file:'",
"keylen",
"=",
"len",
"(",
"key",
")",
"for",
"line",
"in",
"lines",
":",
"if",
"line",
"[",
":",
"keyle... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Tools/Scripts/logmerge.py#L96-L163 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/procrouting/proc.py | python | select_mp2 | (name, **kwargs) | Function selecting the algorithm for a MP2 energy call
and directing to specified or best-performance default modules. | Function selecting the algorithm for a MP2 energy call
and directing to specified or best-performance default modules. | [
"Function",
"selecting",
"the",
"algorithm",
"for",
"a",
"MP2",
"energy",
"call",
"and",
"directing",
"to",
"specified",
"or",
"best",
"-",
"performance",
"default",
"modules",
"."
] | def select_mp2(name, **kwargs):
"""Function selecting the algorithm for a MP2 energy call
and directing to specified or best-performance default modules.
"""
reference = core.get_option('SCF', 'REFERENCE')
mtd_type = core.get_global_option('MP2_TYPE')
module = core.get_global_option('QC_MODULE'... | [
"def",
"select_mp2",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"reference",
"=",
"core",
".",
"get_option",
"(",
"'SCF'",
",",
"'REFERENCE'",
")",
"mtd_type",
"=",
"core",
".",
"get_global_option",
"(",
"'MP2_TYPE'",
")",
"module",
"=",
"core",
"."... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/proc.py#L65-L136 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/json_format.py | python | MessageToDict | (
message,
including_default_value_fields=False,
preserving_proto_field_name=False,
use_integers_for_enums=False,
descriptor_pool=None,
float_precision=None) | return printer._MessageToJsonObject(message) | Converts protobuf message to a dictionary.
When the dictionary is encoded to JSON, it conforms to proto3 JSON spec.
Args:
message: The protocol buffers message instance to serialize.
including_default_value_fields: If True, singular primitive fields,
repeated fields, and map fields will always be ... | Converts protobuf message to a dictionary. | [
"Converts",
"protobuf",
"message",
"to",
"a",
"dictionary",
"."
] | def MessageToDict(
message,
including_default_value_fields=False,
preserving_proto_field_name=False,
use_integers_for_enums=False,
descriptor_pool=None,
float_precision=None):
"""Converts protobuf message to a dictionary.
When the dictionary is encoded to JSON, it conforms to proto3 JSON sp... | [
"def",
"MessageToDict",
"(",
"message",
",",
"including_default_value_fields",
"=",
"False",
",",
"preserving_proto_field_name",
"=",
"False",
",",
"use_integers_for_enums",
"=",
"False",
",",
"descriptor_pool",
"=",
"None",
",",
"float_precision",
"=",
"None",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/json_format.py#L140-L175 | |
jeog/TOSDataBridge | 6a5a08ca5cf3883db1f12e9bc89ef374d098df5a | python/tosdb/__init__.py | python | VInit | (address, dllpath=None, root="C:\\", password=None, timeout=DEF_TIMEOUT) | Manage a virtual 'session' with a host system's C lib, engine, and TOS platform.
The context manager handles initialization of the virtual admin interface
and the host C Lib, then tries to connect the latter with the engine and
TOS platform on the host. On exiting the context block it automatically
cle... | Manage a virtual 'session' with a host system's C lib, engine, and TOS platform. | [
"Manage",
"a",
"virtual",
"session",
"with",
"a",
"host",
"system",
"s",
"C",
"lib",
"engine",
"and",
"TOS",
"platform",
"."
] | def VInit(address, dllpath=None, root="C:\\", password=None, timeout=DEF_TIMEOUT):
""" Manage a virtual 'session' with a host system's C lib, engine, and TOS platform.
The context manager handles initialization of the virtual admin interface
and the host C Lib, then tries to connect the latter with the eng... | [
"def",
"VInit",
"(",
"address",
",",
"dllpath",
"=",
"None",
",",
"root",
"=",
"\"C:\\\\\"",
",",
"password",
"=",
"None",
",",
"timeout",
"=",
"DEF_TIMEOUT",
")",
":",
"try",
":",
"admin_init",
"(",
"address",
",",
"password",
",",
"timeout",
")",
"if... | https://github.com/jeog/TOSDataBridge/blob/6a5a08ca5cf3883db1f12e9bc89ef374d098df5a/python/tosdb/__init__.py#L266-L299 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mimetools.py | python | decode | (input, output, encoding) | Decode common content-transfer-encodings (base64, quopri, uuencode). | Decode common content-transfer-encodings (base64, quopri, uuencode). | [
"Decode",
"common",
"content",
"-",
"transfer",
"-",
"encodings",
"(",
"base64",
"quopri",
"uuencode",
")",
"."
] | def decode(input, output, encoding):
"""Decode common content-transfer-encodings (base64, quopri, uuencode)."""
if encoding == 'base64':
import base64
return base64.decode(input, output)
if encoding == 'quoted-printable':
import quopri
return quopri.decode(input, output)
... | [
"def",
"decode",
"(",
"input",
",",
"output",
",",
"encoding",
")",
":",
"if",
"encoding",
"==",
"'base64'",
":",
"import",
"base64",
"return",
"base64",
".",
"decode",
"(",
"input",
",",
"output",
")",
"if",
"encoding",
"==",
"'quoted-printable'",
":",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mimetools.py#L157-L174 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/win/toolchain/toolchain.py | python | CopyToFinalLocation2010 | (extracted, target_dir) | Copy all the directories we need to the target location. | Copy all the directories we need to the target location. | [
"Copy",
"all",
"the",
"directories",
"we",
"need",
"to",
"the",
"target",
"location",
"."
] | def CopyToFinalLocation2010(extracted, target_dir):
"""Copy all the directories we need to the target location."""
sys.stdout.write('Pulling together required pieces...\n')
# Note that order is important because some of the older ones are
# overwritten by updates.
from_sdk = [(r'Windows Kits\8.0', r'win8sdk'... | [
"def",
"CopyToFinalLocation2010",
"(",
"extracted",
",",
"target_dir",
")",
":",
"sys",
".",
"stdout",
".",
"write",
"(",
"'Pulling together required pieces...\\n'",
")",
"# Note that order is important because some of the older ones are",
"# overwritten by updates.",
"from_sdk",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/win/toolchain/toolchain.py#L426-L500 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HtmlRenderingInfo.__init__ | (self, *args, **kwargs) | __init__(self) -> HtmlRenderingInfo | __init__(self) -> HtmlRenderingInfo | [
"__init__",
"(",
"self",
")",
"-",
">",
"HtmlRenderingInfo"
] | def __init__(self, *args, **kwargs):
"""__init__(self) -> HtmlRenderingInfo"""
_html.HtmlRenderingInfo_swiginit(self,_html.new_HtmlRenderingInfo(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_html",
".",
"HtmlRenderingInfo_swiginit",
"(",
"self",
",",
"_html",
".",
"new_HtmlRenderingInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L566-L568 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/platform/benchmark.py | python | _global_report_benchmark | (
name, iters=None, cpu_time=None, wall_time=None,
throughput=None, extras=None, metrics=None) | Method for recording a benchmark directly.
Args:
name: The BenchmarkEntry name.
iters: (optional) How many iterations were run
cpu_time: (optional) Total cpu time in seconds
wall_time: (optional) Total wall time in seconds
throughput: (optional) Throughput (in MB/s)
extras: (optional) Dict ma... | Method for recording a benchmark directly. | [
"Method",
"for",
"recording",
"a",
"benchmark",
"directly",
"."
] | def _global_report_benchmark(
name, iters=None, cpu_time=None, wall_time=None,
throughput=None, extras=None, metrics=None):
"""Method for recording a benchmark directly.
Args:
name: The BenchmarkEntry name.
iters: (optional) How many iterations were run
cpu_time: (optional) Total cpu time in se... | [
"def",
"_global_report_benchmark",
"(",
"name",
",",
"iters",
"=",
"None",
",",
"cpu_time",
"=",
"None",
",",
"wall_time",
"=",
"None",
",",
"throughput",
"=",
"None",
",",
"extras",
"=",
"None",
",",
"metrics",
"=",
"None",
")",
":",
"logging",
".",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/platform/benchmark.py#L54-L132 | ||
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Logs.py | python | init_log | () | Initializes the logger :py:attr:`waflib.Logs.log` | Initializes the logger :py:attr:`waflib.Logs.log` | [
"Initializes",
"the",
"logger",
":",
"py",
":",
"attr",
":",
"waflib",
".",
"Logs",
".",
"log"
] | def init_log():
"""
Initializes the logger :py:attr:`waflib.Logs.log`
"""
global log
log = logging.getLogger('waflib')
log.handlers = []
log.filters = []
hdlr = log_handler()
hdlr.setFormatter(formatter())
log.addHandler(hdlr)
log.addFilter(log_filter())
log.setLevel(logging.DEBUG) | [
"def",
"init_log",
"(",
")",
":",
"global",
"log",
"log",
"=",
"logging",
".",
"getLogger",
"(",
"'waflib'",
")",
"log",
".",
"handlers",
"=",
"[",
"]",
"log",
".",
"filters",
"=",
"[",
"]",
"hdlr",
"=",
"log_handler",
"(",
")",
"hdlr",
".",
"setFo... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Logs.py#L292-L304 | ||
KhronosGroup/Vulkan-Headers | b32da5329b50e3cb96229aaecba9ded032fe29cc | registry/generator.py | python | OutputGenerator.newline | (self) | Print a newline to the output file (utility function) | Print a newline to the output file (utility function) | [
"Print",
"a",
"newline",
"to",
"the",
"output",
"file",
"(",
"utility",
"function",
")"
] | def newline(self):
"""Print a newline to the output file (utility function)"""
write('', file=self.outFile) | [
"def",
"newline",
"(",
"self",
")",
":",
"write",
"(",
"''",
",",
"file",
"=",
"self",
".",
"outFile",
")"
] | https://github.com/KhronosGroup/Vulkan-Headers/blob/b32da5329b50e3cb96229aaecba9ded032fe29cc/registry/generator.py#L1220-L1222 | ||
hyperledger-archives/iroha | ed579f85126d0e86532a1f4f1f6ce5681bbcd3a9 | docs/permissions_compiler/rst.py | python | excerpt | (permission) | return result | Renders source file listing
:param permission: name of permission to list, used as a part of filename
:return: rst lines | Renders source file listing
:param permission: name of permission to list, used as a part of filename
:return: rst lines | [
"Renders",
"source",
"file",
"listing",
":",
"param",
"permission",
":",
"name",
"of",
"permission",
"to",
"list",
"used",
"as",
"a",
"part",
"of",
"filename",
":",
"return",
":",
"rst",
"lines"
] | def excerpt(permission):
"""
Renders source file listing
:param permission: name of permission to list, used as a part of filename
:return: rst lines
"""
compile_time_path = [os.path.pardir, os.path.pardir, 'example', 'python', 'permissions', '{}.py'.format(permission)]
path = os.path.join(*... | [
"def",
"excerpt",
"(",
"permission",
")",
":",
"compile_time_path",
"=",
"[",
"os",
".",
"path",
".",
"pardir",
",",
"os",
".",
"path",
".",
"pardir",
",",
"'example'",
",",
"'python'",
",",
"'permissions'",
",",
"'{}.py'",
".",
"format",
"(",
"permissio... | https://github.com/hyperledger-archives/iroha/blob/ed579f85126d0e86532a1f4f1f6ce5681bbcd3a9/docs/permissions_compiler/rst.py#L140-L154 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py | python | EveryN.every_n_step_begin | (self, step) | return [] | Callback before every n'th step begins.
Args:
step: `int`, the current value of the global step.
Returns:
A `list` of tensors that will be evaluated at this step. | Callback before every n'th step begins. | [
"Callback",
"before",
"every",
"n",
"th",
"step",
"begins",
"."
] | def every_n_step_begin(self, step): # pylint: disable=unused-argument
"""Callback before every n'th step begins.
Args:
step: `int`, the current value of the global step.
Returns:
A `list` of tensors that will be evaluated at this step.
"""
return [] | [
"def",
"every_n_step_begin",
"(",
"self",
",",
"step",
")",
":",
"# pylint: disable=unused-argument",
"return",
"[",
"]"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py#L315-L324 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/fleet/dataset/dataset.py | python | InMemoryDataset.load_into_memory | (self, is_shuffle=False) | :api_attr: Static Graph
Load data into memory
Args:
is_shuffle(bool): whether to use local shuffle, default is False
Examples:
.. code-block:: python
import paddle
paddle.enable_static()
dataset ... | :api_attr: Static Graph
Load data into memory | [
":",
"api_attr",
":",
"Static",
"Graph",
"Load",
"data",
"into",
"memory"
] | def load_into_memory(self, is_shuffle=False):
"""
:api_attr: Static Graph
Load data into memory
Args:
is_shuffle(bool): whether to use local shuffle, default is False
Examples:
.. code-block:: python
import paddle
... | [
"def",
"load_into_memory",
"(",
"self",
",",
"is_shuffle",
"=",
"False",
")",
":",
"self",
".",
"_prepare_to_run",
"(",
")",
"if",
"not",
"self",
".",
"use_ps_gpu",
":",
"self",
".",
"dataset",
".",
"load_into_memory",
"(",
")",
"elif",
"core",
".",
"_is... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/dataset/dataset.py#L827-L864 | ||
bumptop/BumpTop | 466d23597a07ae738f4265262fa01087fc6e257c | trunk/win/Source/bin/jinja2/utils.py | python | LRUCache.keys | (self) | return list(self) | Return a list of all keys ordered by most recent usage. | Return a list of all keys ordered by most recent usage. | [
"Return",
"a",
"list",
"of",
"all",
"keys",
"ordered",
"by",
"most",
"recent",
"usage",
"."
] | def keys(self):
"""Return a list of all keys ordered by most recent usage."""
return list(self) | [
"def",
"keys",
"(",
"self",
")",
":",
"return",
"list",
"(",
"self",
")"
] | https://github.com/bumptop/BumpTop/blob/466d23597a07ae738f4265262fa01087fc6e257c/trunk/win/Source/bin/jinja2/utils.py#L672-L674 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | Locale.GetLanguageInfo | (*args, **kwargs) | return _gdi_.Locale_GetLanguageInfo(*args, **kwargs) | GetLanguageInfo(int lang) -> LanguageInfo | GetLanguageInfo(int lang) -> LanguageInfo | [
"GetLanguageInfo",
"(",
"int",
"lang",
")",
"-",
">",
"LanguageInfo"
] | def GetLanguageInfo(*args, **kwargs):
"""GetLanguageInfo(int lang) -> LanguageInfo"""
return _gdi_.Locale_GetLanguageInfo(*args, **kwargs) | [
"def",
"GetLanguageInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Locale_GetLanguageInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L3152-L3154 | |
fabianschenk/REVO | eb949c0fdbcdf0be09a38464eb0592a90803947f | thirdparty/Sophus/py/sophus/se3.py | python | Se3.matrix | (self) | return (R.row_join(self.t)).col_join(sympy.Matrix(1, 4, [0, 0, 0, 1])) | returns matrix representation | returns matrix representation | [
"returns",
"matrix",
"representation"
] | def matrix(self):
""" returns matrix representation """
R = self.so3.matrix()
return (R.row_join(self.t)).col_join(sympy.Matrix(1, 4, [0, 0, 0, 1])) | [
"def",
"matrix",
"(",
"self",
")",
":",
"R",
"=",
"self",
".",
"so3",
".",
"matrix",
"(",
")",
"return",
"(",
"R",
".",
"row_join",
"(",
"self",
".",
"t",
")",
")",
".",
"col_join",
"(",
"sympy",
".",
"Matrix",
"(",
"1",
",",
"4",
",",
"[",
... | https://github.com/fabianschenk/REVO/blob/eb949c0fdbcdf0be09a38464eb0592a90803947f/thirdparty/Sophus/py/sophus/se3.py#L60-L63 | |
CoolProp/CoolProp | 381c8535e5dec3eec27ad430ebbfff8bc9dfc008 | wrappers/Python/CoolProp/Plots/Common.py | python | BasePlot._set_axis_limits | (self, limits) | Set the limits of the internal axis object based on SI units,
takes [xmin, xmax, ymin, ymax] | Set the limits of the internal axis object based on SI units,
takes [xmin, xmax, ymin, ymax] | [
"Set",
"the",
"limits",
"of",
"the",
"internal",
"axis",
"object",
"based",
"on",
"SI",
"units",
"takes",
"[",
"xmin",
"xmax",
"ymin",
"ymax",
"]"
] | def _set_axis_limits(self, limits):
"""Set the limits of the internal axis object based on SI units,
takes [xmin, xmax, ymin, ymax]"""
dim = self._system[self._x_index]
self.axis.set_xlim([dim.from_SI(limits[0]), dim.from_SI(limits[1])])
dim = self._system[self._y_index]
... | [
"def",
"_set_axis_limits",
"(",
"self",
",",
"limits",
")",
":",
"dim",
"=",
"self",
".",
"_system",
"[",
"self",
".",
"_x_index",
"]",
"self",
".",
"axis",
".",
"set_xlim",
"(",
"[",
"dim",
".",
"from_SI",
"(",
"limits",
"[",
"0",
"]",
")",
",",
... | https://github.com/CoolProp/CoolProp/blob/381c8535e5dec3eec27ad430ebbfff8bc9dfc008/wrappers/Python/CoolProp/Plots/Common.py#L939-L945 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/jinja2/runtime.py | python | Context.super | (self, name, current) | return BlockReference(name, self, blocks, index) | Render a parent block. | Render a parent block. | [
"Render",
"a",
"parent",
"block",
"."
] | def super(self, name, current):
"""Render a parent block."""
try:
blocks = self.blocks[name]
index = blocks.index(current) + 1
blocks[index]
except LookupError:
return self.environment.undefined('there is no parent block '
... | [
"def",
"super",
"(",
"self",
",",
"name",
",",
"current",
")",
":",
"try",
":",
"blocks",
"=",
"self",
".",
"blocks",
"[",
"name",
"]",
"index",
"=",
"blocks",
".",
"index",
"(",
"current",
")",
"+",
"1",
"blocks",
"[",
"index",
"]",
"except",
"L... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/runtime.py#L175-L185 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/asyncio/base_events.py | python | BaseEventLoop.set_exception_handler | (self, handler) | Set handler as the new event loop exception handler.
If handler is None, the default exception handler will
be set.
If handler is a callable object, it should have a
signature matching '(loop, context)', where 'loop'
will be a reference to the active event loop, 'context'
... | Set handler as the new event loop exception handler. | [
"Set",
"handler",
"as",
"the",
"new",
"event",
"loop",
"exception",
"handler",
"."
] | def set_exception_handler(self, handler):
"""Set handler as the new event loop exception handler.
If handler is None, the default exception handler will
be set.
If handler is a callable object, it should have a
signature matching '(loop, context)', where 'loop'
will be ... | [
"def",
"set_exception_handler",
"(",
"self",
",",
"handler",
")",
":",
"if",
"handler",
"is",
"not",
"None",
"and",
"not",
"callable",
"(",
"handler",
")",
":",
"raise",
"TypeError",
"(",
"f'A callable object or None is expected, '",
"f'got {handler!r}'",
")",
"se... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/base_events.py#L1673-L1688 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | PhysicsTools/PythonAnalysis/python/rootplot/root2matplotlib.py | python | replace | (string, replacements) | return string | Modify a string based on a list of patterns and substitutions.
replacements should be a list of two-entry tuples, the first entry giving
a string to search for and the second entry giving the string with which
to replace it. If replacements includes a pattern entry containing
'use_regexp', then all pa... | Modify a string based on a list of patterns and substitutions. | [
"Modify",
"a",
"string",
"based",
"on",
"a",
"list",
"of",
"patterns",
"and",
"substitutions",
"."
] | def replace(string, replacements):
"""
Modify a string based on a list of patterns and substitutions.
replacements should be a list of two-entry tuples, the first entry giving
a string to search for and the second entry giving the string with which
to replace it. If replacements includes a pattern... | [
"def",
"replace",
"(",
"string",
",",
"replacements",
")",
":",
"if",
"not",
"replacements",
":",
"return",
"string",
"if",
"'use_regexp'",
"in",
"[",
"x",
"for",
"x",
",",
"y",
"in",
"replacements",
"]",
":",
"for",
"pattern",
",",
"repl",
"in",
"[",
... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/PythonAnalysis/python/rootplot/root2matplotlib.py#L444-L465 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | _AppendOrReturn | (append, element) | If |append| is None, simply return |element|. If |append| is not None,
then add |element| to it, adding each item in |element| if it's a list or
tuple. | If |append| is None, simply return |element|. If |append| is not None,
then add |element| to it, adding each item in |element| if it's a list or
tuple. | [
"If",
"|append|",
"is",
"None",
"simply",
"return",
"|element|",
".",
"If",
"|append|",
"is",
"not",
"None",
"then",
"add",
"|element|",
"to",
"it",
"adding",
"each",
"item",
"in",
"|element|",
"if",
"it",
"s",
"a",
"list",
"or",
"tuple",
"."
] | def _AppendOrReturn(append, element):
"""If |append| is None, simply return |element|. If |append| is not None,
then add |element| to it, adding each item in |element| if it's a list or
tuple."""
if append is not None and element is not None:
if isinstance(element, list) or isinstance(element, tuple):
... | [
"def",
"_AppendOrReturn",
"(",
"append",
",",
"element",
")",
":",
"if",
"append",
"is",
"not",
"None",
"and",
"element",
"is",
"not",
"None",
":",
"if",
"isinstance",
"(",
"element",
",",
"list",
")",
"or",
"isinstance",
"(",
"element",
",",
"tuple",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L103-L113 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | GridRangeSelectEvent.GetBottomRightCoords | (*args, **kwargs) | return _grid.GridRangeSelectEvent_GetBottomRightCoords(*args, **kwargs) | GetBottomRightCoords(self) -> GridCellCoords | GetBottomRightCoords(self) -> GridCellCoords | [
"GetBottomRightCoords",
"(",
"self",
")",
"-",
">",
"GridCellCoords"
] | def GetBottomRightCoords(*args, **kwargs):
"""GetBottomRightCoords(self) -> GridCellCoords"""
return _grid.GridRangeSelectEvent_GetBottomRightCoords(*args, **kwargs) | [
"def",
"GetBottomRightCoords",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridRangeSelectEvent_GetBottomRightCoords",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L2405-L2407 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/pkg_resources/_vendor/pyparsing.py | python | matchOnlyAtCol | (n) | return verifyCol | Helper method for defining parse actions that require matching at a specific
column in the input text. | Helper method for defining parse actions that require matching at a specific
column in the input text. | [
"Helper",
"method",
"for",
"defining",
"parse",
"actions",
"that",
"require",
"matching",
"at",
"a",
"specific",
"column",
"in",
"the",
"input",
"text",
"."
] | def matchOnlyAtCol(n):
"""
Helper method for defining parse actions that require matching at a specific
column in the input text.
"""
def verifyCol(strg,locn,toks):
if col(locn,strg) != n:
raise ParseException(strg,locn,"matched token not at column %d" % n)
return verifyCol | [
"def",
"matchOnlyAtCol",
"(",
"n",
")",
":",
"def",
"verifyCol",
"(",
"strg",
",",
"locn",
",",
"toks",
")",
":",
"if",
"col",
"(",
"locn",
",",
"strg",
")",
"!=",
"n",
":",
"raise",
"ParseException",
"(",
"strg",
",",
"locn",
",",
"\"matched token n... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/_vendor/pyparsing.py#L4787-L4795 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/xml/sax/__init__.py | python | make_parser | (parser_list = []) | Creates and returns a SAX parser.
Creates the first parser it is able to instantiate of the ones
given in the list created by doing parser_list +
default_parser_list. The lists must contain the names of Python
modules containing both a SAX parser and a create_parser function. | Creates and returns a SAX parser. | [
"Creates",
"and",
"returns",
"a",
"SAX",
"parser",
"."
] | def make_parser(parser_list = []):
"""Creates and returns a SAX parser.
Creates the first parser it is able to instantiate of the ones
given in the list created by doing parser_list +
default_parser_list. The lists must contain the names of Python
modules containing both a SAX parser and a create_... | [
"def",
"make_parser",
"(",
"parser_list",
"=",
"[",
"]",
")",
":",
"for",
"parser_name",
"in",
"parser_list",
"+",
"default_parser_list",
":",
"try",
":",
"return",
"_create_parser",
"(",
"parser_name",
")",
"except",
"ImportError",
",",
"e",
":",
"import",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/xml/sax/__init__.py#L71-L93 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/utils/logging.py | python | get_logger | () | Return logger instance. | Return logger instance. | [
"Return",
"logger",
"instance",
"."
] | def get_logger():
"""Return logger instance."""
global _logger
# Use double-checked locking to avoid taking lock unnecessarily.
if _logger:
return _logger
_logger_lock.acquire()
try:
if _logger:
return _logger
# Scope the TensorFlow logger to not conflict with users' loggers.
logge... | [
"def",
"get_logger",
"(",
")",
":",
"global",
"_logger",
"# Use double-checked locking to avoid taking lock unnecessarily.",
"if",
"_logger",
":",
"return",
"_logger",
"_logger_lock",
".",
"acquire",
"(",
")",
"try",
":",
"if",
"_logger",
":",
"return",
"_logger",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/utils/logging.py#L130-L181 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/femtools/femutils.py | python | get_part_to_mesh | (mesh_obj) | gmsh mesh object: the Attribute is Part
netgen mesh object: the Attribute is Shape
other mesh objects: do not have a Attribute which holds the part to mesh | gmsh mesh object: the Attribute is Part
netgen mesh object: the Attribute is Shape
other mesh objects: do not have a Attribute which holds the part to mesh | [
"gmsh",
"mesh",
"object",
":",
"the",
"Attribute",
"is",
"Part",
"netgen",
"mesh",
"object",
":",
"the",
"Attribute",
"is",
"Shape",
"other",
"mesh",
"objects",
":",
"do",
"not",
"have",
"a",
"Attribute",
"which",
"holds",
"the",
"part",
"to",
"mesh"
] | def get_part_to_mesh(mesh_obj):
"""
gmsh mesh object: the Attribute is Part
netgen mesh object: the Attribute is Shape
other mesh objects: do not have a Attribute which holds the part to mesh
"""
if is_derived_from(mesh_obj, "Fem::FemMeshGmsh"):
return mesh_obj.Part
elif is_derived_f... | [
"def",
"get_part_to_mesh",
"(",
"mesh_obj",
")",
":",
"if",
"is_derived_from",
"(",
"mesh_obj",
",",
"\"Fem::FemMeshGmsh\"",
")",
":",
"return",
"mesh_obj",
".",
"Part",
"elif",
"is_derived_from",
"(",
"mesh_obj",
",",
"\"Fem::FemMeshShapeNetgenObject\"",
")",
":",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/femtools/femutils.py#L246-L257 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/utils/saved_model_export_utils.py | python | BestModelSelector._get_best_eval_result | (self, event_files) | return best_eval_result | Get the best eval result from event files.
Args:
event_files: Absolute pattern of event files.
Returns:
The best eval result. | Get the best eval result from event files. | [
"Get",
"the",
"best",
"eval",
"result",
"from",
"event",
"files",
"."
] | def _get_best_eval_result(self, event_files):
"""Get the best eval result from event files.
Args:
event_files: Absolute pattern of event files.
Returns:
The best eval result.
"""
if not event_files:
return None
best_eval_result = None
for event_file in gfile.Glob(os.path... | [
"def",
"_get_best_eval_result",
"(",
"self",
",",
"event_files",
")",
":",
"if",
"not",
"event_files",
":",
"return",
"None",
"best_eval_result",
"=",
"None",
"for",
"event_file",
"in",
"gfile",
".",
"Glob",
"(",
"os",
".",
"path",
".",
"join",
"(",
"event... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/utils/saved_model_export_utils.py#L622-L645 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLReduction.py | python | DirectILLReduction._convertToDistribution | (self, mainWS) | return mainWS | Convert the workspace into a distribution. | Convert the workspace into a distribution. | [
"Convert",
"the",
"workspace",
"into",
"a",
"distribution",
"."
] | def _convertToDistribution(self, mainWS):
"""Convert the workspace into a distribution."""
ConvertToDistribution(Workspace=mainWS,
EnableLogging=self._subalgLogging)
return mainWS | [
"def",
"_convertToDistribution",
"(",
"self",
",",
"mainWS",
")",
":",
"ConvertToDistribution",
"(",
"Workspace",
"=",
"mainWS",
",",
"EnableLogging",
"=",
"self",
".",
"_subalgLogging",
")",
"return",
"mainWS"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLReduction.py#L409-L413 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/serve/snippets/util/sparse_tree.py | python | _SetAbstractThroughRepeated | (parts, value, store, log) | Set value at parts, when the top of store is 'repeated'.
Complements _GeneralSetAbstract.
It is different from normal setting, in that we set corresponding field in
repeated elements (and their descendants).
In case we have pre-existing items of repeated element in store,
we set corresponding field in all th... | Set value at parts, when the top of store is 'repeated'. | [
"Set",
"value",
"at",
"parts",
"when",
"the",
"top",
"of",
"store",
"is",
"repeated",
"."
] | def _SetAbstractThroughRepeated(parts, value, store, log):
"""Set value at parts, when the top of store is 'repeated'.
Complements _GeneralSetAbstract.
It is different from normal setting, in that we set corresponding field in
repeated elements (and their descendants).
In case we have pre-existing items of r... | [
"def",
"_SetAbstractThroughRepeated",
"(",
"parts",
",",
"value",
",",
"store",
",",
"log",
")",
":",
"assert",
"(",
"parts",
"and",
"parts",
"[",
"0",
"]",
"==",
"\"[]\"",
")",
",",
"\"expected element of path to be abstract index.\"",
"assert",
"isinstance",
"... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/snippets/util/sparse_tree.py#L282-L330 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/external/bazel_tools/tools/build_defs/docker/rewrite_json.py | python | DeepCopySkipNull | (data) | return copy.deepcopy(data) | Do a deep copy, skipping null entry. | Do a deep copy, skipping null entry. | [
"Do",
"a",
"deep",
"copy",
"skipping",
"null",
"entry",
"."
] | def DeepCopySkipNull(data):
"""Do a deep copy, skipping null entry."""
if type(data) == type(dict()):
return dict((DeepCopySkipNull(k), DeepCopySkipNull(v))
for k, v in data.iteritems() if v is not None)
return copy.deepcopy(data) | [
"def",
"DeepCopySkipNull",
"(",
"data",
")",
":",
"if",
"type",
"(",
"data",
")",
"==",
"type",
"(",
"dict",
"(",
")",
")",
":",
"return",
"dict",
"(",
"(",
"DeepCopySkipNull",
"(",
"k",
")",
",",
"DeepCopySkipNull",
"(",
"v",
")",
")",
"for",
"k",... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/tools/build_defs/docker/rewrite_json.py#L121-L126 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/executionengine.py | python | ExecutionEngine.get_function_address | (self, name) | return ffi.lib.LLVMPY_GetFunctionAddress(self, name.encode("ascii")) | Return the address of the function named *name* as an integer.
It's a fatal error in LLVM if the symbol of *name* doesn't exist. | Return the address of the function named *name* as an integer. | [
"Return",
"the",
"address",
"of",
"the",
"function",
"named",
"*",
"name",
"*",
"as",
"an",
"integer",
"."
] | def get_function_address(self, name):
"""
Return the address of the function named *name* as an integer.
It's a fatal error in LLVM if the symbol of *name* doesn't exist.
"""
return ffi.lib.LLVMPY_GetFunctionAddress(self, name.encode("ascii")) | [
"def",
"get_function_address",
"(",
"self",
",",
"name",
")",
":",
"return",
"ffi",
".",
"lib",
".",
"LLVMPY_GetFunctionAddress",
"(",
"self",
",",
"name",
".",
"encode",
"(",
"\"ascii\"",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/executionengine.py#L60-L66 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/cookies.py | python | get_cookie_header | (jar, request) | return r.get_new_headers().get('Cookie') | Produce an appropriate Cookie header string to be sent with `request`, or None.
:rtype: str | Produce an appropriate Cookie header string to be sent with `request`, or None. | [
"Produce",
"an",
"appropriate",
"Cookie",
"header",
"string",
"to",
"be",
"sent",
"with",
"request",
"or",
"None",
"."
] | def get_cookie_header(jar, request):
"""
Produce an appropriate Cookie header string to be sent with `request`, or None.
:rtype: str
"""
r = MockRequest(request)
jar.add_cookie_header(r)
return r.get_new_headers().get('Cookie') | [
"def",
"get_cookie_header",
"(",
"jar",
",",
"request",
")",
":",
"r",
"=",
"MockRequest",
"(",
"request",
")",
"jar",
".",
"add_cookie_header",
"(",
"r",
")",
"return",
"r",
".",
"get_new_headers",
"(",
")",
".",
"get",
"(",
"'Cookie'",
")"
] | 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/requests/cookies.py#L135-L143 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/PSDraw.py | python | PSDraw.end_document | (self) | Ends printing. (Write Postscript DSC footer.) | Ends printing. (Write Postscript DSC footer.) | [
"Ends",
"printing",
".",
"(",
"Write",
"Postscript",
"DSC",
"footer",
".",
")"
] | def end_document(self):
"""Ends printing. (Write Postscript DSC footer.)"""
self._fp_write("%%EndDocument\nrestore showpage\n%%End\n")
if hasattr(self.fp, "flush"):
self.fp.flush() | [
"def",
"end_document",
"(",
"self",
")",
":",
"self",
".",
"_fp_write",
"(",
"\"%%EndDocument\\nrestore showpage\\n%%End\\n\"",
")",
"if",
"hasattr",
"(",
"self",
".",
"fp",
",",
"\"flush\"",
")",
":",
"self",
".",
"fp",
".",
"flush",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/PSDraw.py#L59-L63 | ||
OpenGenus/cosmos | 1a94e8880068e51d571543be179c323936bd0936 | code/languages/python/web_programming/world_covid19_stats.py | python | world_covid19_stats | (url: str = "https://www.worldometers.info/coronavirus") | return {key.text.strip(): value.text.strip() for key, value in zip(keys, values)} | Return a dict of current worldwide COVID-19 statistics | Return a dict of current worldwide COVID-19 statistics | [
"Return",
"a",
"dict",
"of",
"current",
"worldwide",
"COVID",
"-",
"19",
"statistics"
] | def world_covid19_stats(url: str = "https://www.worldometers.info/coronavirus") -> dict:
"""
Return a dict of current worldwide COVID-19 statistics
"""
soup = BeautifulSoup(requests.get(url).text, "html.parser")
keys = soup.findAll("h1")
values = soup.findAll("div", {"class": "maincounter-number... | [
"def",
"world_covid19_stats",
"(",
"url",
":",
"str",
"=",
"\"https://www.worldometers.info/coronavirus\"",
")",
"->",
"dict",
":",
"soup",
"=",
"BeautifulSoup",
"(",
"requests",
".",
"get",
"(",
"url",
")",
".",
"text",
",",
"\"html.parser\"",
")",
"keys",
"=... | https://github.com/OpenGenus/cosmos/blob/1a94e8880068e51d571543be179c323936bd0936/code/languages/python/web_programming/world_covid19_stats.py#L12-L21 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | Function.WriteServiceUnitTest | (self, file) | Writes the service implementation for a command. | Writes the service implementation for a command. | [
"Writes",
"the",
"service",
"implementation",
"for",
"a",
"command",
"."
] | def WriteServiceUnitTest(self, file):
"""Writes the service implementation for a command."""
self.type_handler.WriteServiceUnitTest(self, file) | [
"def",
"WriteServiceUnitTest",
"(",
"self",
",",
"file",
")",
":",
"self",
".",
"type_handler",
".",
"WriteServiceUnitTest",
"(",
"self",
",",
"file",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L6585-L6587 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/decomposition/nmf.py | python | NMF.fit_transform | (self, X, y=None, W=None, H=None) | return W | Learn a NMF model for the data X and returns the transformed data.
This is more efficient than calling fit followed by transform.
Parameters
----------
X: {array-like, sparse matrix}, shape (n_samples, n_features)
Data matrix to be decomposed
W : array-like, shape ... | Learn a NMF model for the data X and returns the transformed data. | [
"Learn",
"a",
"NMF",
"model",
"for",
"the",
"data",
"X",
"and",
"returns",
"the",
"transformed",
"data",
"."
] | def fit_transform(self, X, y=None, W=None, H=None):
"""Learn a NMF model for the data X and returns the transformed data.
This is more efficient than calling fit followed by transform.
Parameters
----------
X: {array-like, sparse matrix}, shape (n_samples, n_features)
... | [
"def",
"fit_transform",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
",",
"W",
"=",
"None",
",",
"H",
"=",
"None",
")",
":",
"X",
"=",
"check_array",
"(",
"X",
",",
"accept_sparse",
"=",
"(",
"'csr'",
",",
"'csc'",
")",
")",
"W",
",",
"H",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/decomposition/nmf.py#L1003-L1046 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py | python | ZerosLikeOutsideLoop | (op, index) | Create zeros_like for the specified output of an op. | Create zeros_like for the specified output of an op. | [
"Create",
"zeros_like",
"for",
"the",
"specified",
"output",
"of",
"an",
"op",
"."
] | def ZerosLikeOutsideLoop(op, index):
"""Create zeros_like for the specified output of an op."""
val = op.outputs[index]
if not IsSwitch(op):
return array_ops.zeros_like(val)
else:
op_ctxt = op._get_control_flow_context()
pred = op_ctxt.pred
branch = op_ctxt.branch
switch_val = switch(op.inpu... | [
"def",
"ZerosLikeOutsideLoop",
"(",
"op",
",",
"index",
")",
":",
"val",
"=",
"op",
".",
"outputs",
"[",
"index",
"]",
"if",
"not",
"IsSwitch",
"(",
"op",
")",
":",
"return",
"array_ops",
".",
"zeros_like",
"(",
"val",
")",
"else",
":",
"op_ctxt",
"=... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L1053-L1064 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/SConf.py | python | Streamer.getvalue | (self) | return self.s.getvalue() | Return everything written to orig since the Streamer was created. | Return everything written to orig since the Streamer was created. | [
"Return",
"everything",
"written",
"to",
"orig",
"since",
"the",
"Streamer",
"was",
"created",
"."
] | def getvalue(self):
"""
Return everything written to orig since the Streamer was created.
"""
return self.s.getvalue() | [
"def",
"getvalue",
"(",
"self",
")",
":",
"return",
"self",
".",
"s",
".",
"getvalue",
"(",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/SConf.py#L215-L219 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/keras/_impl/keras/applications/mobilenet.py | python | _conv_block | (inputs, filters, alpha, kernel=(3, 3), strides=(1, 1)) | return Activation(relu6, name='conv1_relu')(x) | Adds an initial convolution layer (with batch normalization and relu6).
Arguments:
inputs: Input tensor of shape `(rows, cols, 3)`
(with `channels_last` data format) or
(3, rows, cols) (with `channels_first` data format).
It should have exactly 3 inputs channels,
and wid... | Adds an initial convolution layer (with batch normalization and relu6). | [
"Adds",
"an",
"initial",
"convolution",
"layer",
"(",
"with",
"batch",
"normalization",
"and",
"relu6",
")",
"."
] | def _conv_block(inputs, filters, alpha, kernel=(3, 3), strides=(1, 1)):
"""Adds an initial convolution layer (with batch normalization and relu6).
Arguments:
inputs: Input tensor of shape `(rows, cols, 3)`
(with `channels_last` data format) or
(3, rows, cols) (with `channels_first` data f... | [
"def",
"_conv_block",
"(",
"inputs",
",",
"filters",
",",
"alpha",
",",
"kernel",
"=",
"(",
"3",
",",
"3",
")",
",",
"strides",
"=",
"(",
"1",
",",
"1",
")",
")",
":",
"channel_axis",
"=",
"1",
"if",
"K",
".",
"image_data_format",
"(",
")",
"==",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/applications/mobilenet.py#L537-L593 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py | python | Bits._readfloatle | (self, length, start) | Read bits and interpret as a little-endian float. | Read bits and interpret as a little-endian float. | [
"Read",
"bits",
"and",
"interpret",
"as",
"a",
"little",
"-",
"endian",
"float",
"."
] | def _readfloatle(self, length, start):
"""Read bits and interpret as a little-endian float."""
startbyte, offset = divmod(start + self._offset, 8)
if not offset:
if length == 32:
f, = struct.unpack('<f', bytes(self._datastore.getbyteslice(startbyte, startbyte + 4)))
... | [
"def",
"_readfloatle",
"(",
"self",
",",
"length",
",",
"start",
")",
":",
"startbyte",
",",
"offset",
"=",
"divmod",
"(",
"start",
"+",
"self",
".",
"_offset",
",",
"8",
")",
"if",
"not",
"offset",
":",
"if",
"length",
"==",
"32",
":",
"f",
",",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L1591-L1608 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/google_appengine_cloudstorage/cloudstorage/cloudstorage_api.py | python | open | (filename,
mode='r',
content_type=None,
options=None,
read_buffer_size=storage_api.ReadBuffer.DEFAULT_BUFFER_SIZE,
retry_params=None,
_account_id=None) | Opens a Google Cloud Storage file and returns it as a File-like object.
Args:
filename: A Google Cloud Storage filename of form '/bucket/filename'.
mode: 'r' for reading mode. 'w' for writing mode.
In reading mode, the file must exist. In writing mode, a file will
be created or be overrode.
c... | Opens a Google Cloud Storage file and returns it as a File-like object. | [
"Opens",
"a",
"Google",
"Cloud",
"Storage",
"file",
"and",
"returns",
"it",
"as",
"a",
"File",
"-",
"like",
"object",
"."
] | def open(filename,
mode='r',
content_type=None,
options=None,
read_buffer_size=storage_api.ReadBuffer.DEFAULT_BUFFER_SIZE,
retry_params=None,
_account_id=None):
"""Opens a Google Cloud Storage file and returns it as a File-like object.
Args:
filename: A Goo... | [
"def",
"open",
"(",
"filename",
",",
"mode",
"=",
"'r'",
",",
"content_type",
"=",
"None",
",",
"options",
"=",
"None",
",",
"read_buffer_size",
"=",
"storage_api",
".",
"ReadBuffer",
".",
"DEFAULT_BUFFER_SIZE",
",",
"retry_params",
"=",
"None",
",",
"_accou... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/google_appengine_cloudstorage/cloudstorage/cloudstorage_api.py#L40-L96 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/ttk.py | python | Treeview.set_children | (self, item, *newchildren) | Replaces item's child with newchildren.
Children present in item that are not present in newchildren
are detached from tree. No items in newchildren may be an
ancestor of item. | Replaces item's child with newchildren. | [
"Replaces",
"item",
"s",
"child",
"with",
"newchildren",
"."
] | def set_children(self, item, *newchildren):
"""Replaces item's child with newchildren.
Children present in item that are not present in newchildren
are detached from tree. No items in newchildren may be an
ancestor of item."""
self.tk.call(self._w, "children", item, newchildren) | [
"def",
"set_children",
"(",
"self",
",",
"item",
",",
"*",
"newchildren",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"children\"",
",",
"item",
",",
"newchildren",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/ttk.py#L1194-L1200 | ||
nasa/astrobee | 9241e67e6692810d6e275abb3165b6d02f4ca5ef | scripts/git/cpplint.py | python | FindNextMultiLineCommentEnd | (lines, lineix) | return len(lines) | We are inside a comment, find the end marker. | We are inside a comment, find the end marker. | [
"We",
"are",
"inside",
"a",
"comment",
"find",
"the",
"end",
"marker",
"."
] | def FindNextMultiLineCommentEnd(lines, lineix):
"""We are inside a comment, find the end marker."""
while lineix < len(lines):
if lines[lineix].strip().endswith("*/"):
return lineix
lineix += 1
return len(lines) | [
"def",
"FindNextMultiLineCommentEnd",
"(",
"lines",
",",
"lineix",
")",
":",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"if",
"lines",
"[",
"lineix",
"]",
".",
"strip",
"(",
")",
".",
"endswith",
"(",
"\"*/\"",
")",
":",
"return",
"lineix",... | https://github.com/nasa/astrobee/blob/9241e67e6692810d6e275abb3165b6d02f4ca5ef/scripts/git/cpplint.py#L1304-L1310 | |
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/agents/networks.py | python | feed_forward_gaussian | (config, action_size, observations, unused_length, state=None) | return NetworkOutput(policy, mean, logstd, value, state) | Independent feed forward networks for policy and value.
The policy network outputs the mean action and the log standard deviation
is learned as independent parameter vector.
Args:
config: Configuration object.
action_size: Length of the action vector.
observations: Sequences of observations.
unu... | Independent feed forward networks for policy and value. | [
"Independent",
"feed",
"forward",
"networks",
"for",
"policy",
"and",
"value",
"."
] | def feed_forward_gaussian(config, action_size, observations, unused_length, state=None):
"""Independent feed forward networks for policy and value.
The policy network outputs the mean action and the log standard deviation
is learned as independent parameter vector.
Args:
config: Configuration object.
... | [
"def",
"feed_forward_gaussian",
"(",
"config",
",",
"action_size",
",",
"observations",
",",
"unused_length",
",",
"state",
"=",
"None",
")",
":",
"mean_weights_initializer",
"=",
"tf",
".",
"contrib",
".",
"layers",
".",
"variance_scaling_initializer",
"(",
"fact... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/agents/networks.py#L32-L77 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tix.py | python | Grid.entrycget | (self, x, y, option) | return self.tk.call(self, 'entrycget', x, y, option) | Get the option value for cell at (x,y) | Get the option value for cell at (x,y) | [
"Get",
"the",
"option",
"value",
"for",
"cell",
"at",
"(",
"x",
"y",
")"
] | def entrycget(self, x, y, option):
"Get the option value for cell at (x,y)"
if option and option[0] != '-':
option = '-' + option
return self.tk.call(self, 'entrycget', x, y, option) | [
"def",
"entrycget",
"(",
"self",
",",
"x",
",",
"y",
",",
"option",
")",
":",
"if",
"option",
"and",
"option",
"[",
"0",
"]",
"!=",
"'-'",
":",
"option",
"=",
"'-'",
"+",
"option",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
",",
"'e... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tix.py#L1856-L1860 | |
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/io/blob_fetcher.py | python | BlobFetcher.__init__ | (self, **kwargs) | Construct a ``BlobFetcher``.
Parameters
----------
batch_size : int
The size of a training batch.
partition : boolean
Whether to partition batch. Default is ``False``.
prefetch : int
The prefetch count. Default is ``5``. | Construct a ``BlobFetcher``. | [
"Construct",
"a",
"BlobFetcher",
"."
] | def __init__(self, **kwargs):
"""Construct a ``BlobFetcher``.
Parameters
----------
batch_size : int
The size of a training batch.
partition : boolean
Whether to partition batch. Default is ``False``.
prefetch : int
The prefetch count.... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"BlobFetcher",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_batch_size",
"=",
"GetProperty",
"(",
"kwargs",
",",
"'batch_size'",
",",
"100",
")",
"self",
... | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/io/blob_fetcher.py#L19-L38 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TStr.GetHex | (self) | return _snap.TStr_GetHex(self) | GetHex(TStr self) -> TStr
Parameters:
self: TStr const * | GetHex(TStr self) -> TStr | [
"GetHex",
"(",
"TStr",
"self",
")",
"-",
">",
"TStr"
] | def GetHex(self):
"""
GetHex(TStr self) -> TStr
Parameters:
self: TStr const *
"""
return _snap.TStr_GetHex(self) | [
"def",
"GetHex",
"(",
"self",
")",
":",
"return",
"_snap",
".",
"TStr_GetHex",
"(",
"self",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L9853-L9861 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py | python | obj_function.get_capi_proto | (self, defined_structs = [], prefix = None) | return result | Return the prototype of the C API function. | Return the prototype of the C API function. | [
"Return",
"the",
"prototype",
"of",
"the",
"C",
"API",
"function",
"."
] | def get_capi_proto(self, defined_structs = [], prefix = None):
""" Return the prototype of the C API function. """
parts = self.get_capi_parts(defined_structs, prefix)
result = parts['retval']+' '+parts['name']+ \
'('+string.join(parts['args'], ', ')+')'
return result | [
"def",
"get_capi_proto",
"(",
"self",
",",
"defined_structs",
"=",
"[",
"]",
",",
"prefix",
"=",
"None",
")",
":",
"parts",
"=",
"self",
".",
"get_capi_parts",
"(",
"defined_structs",
",",
"prefix",
")",
"result",
"=",
"parts",
"[",
"'retval'",
"]",
"+",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py#L1187-L1192 | |
AndroidAdvanceWithGeektime/Chapter01 | da2bc56d708fa74035c64564b134189045f51213 | breakpad-build/src/main/cpp/external/libbreakpad/src/tools/python/filter_syms.py | python | SymbolFileParser._AdjustPath | (self, path) | return path[len(filter(path.startswith,
self.ignored_prefixes + [''])[0]):] | Adjusts the supplied path after performing path de-duplication.
This may be used to perform secondary adjustments, such as removing a
common prefix, such as "/D/build", or replacing the file system path with
information from the version control system.
Returns:
The actual path to use when writ... | Adjusts the supplied path after performing path de-duplication. | [
"Adjusts",
"the",
"supplied",
"path",
"after",
"performing",
"path",
"de",
"-",
"duplication",
"."
] | def _AdjustPath(self, path):
"""Adjusts the supplied path after performing path de-duplication.
This may be used to perform secondary adjustments, such as removing a
common prefix, such as "/D/build", or replacing the file system path with
information from the version control system.
Returns:
... | [
"def",
"_AdjustPath",
"(",
"self",
",",
"path",
")",
":",
"return",
"path",
"[",
"len",
"(",
"filter",
"(",
"path",
".",
"startswith",
",",
"self",
".",
"ignored_prefixes",
"+",
"[",
"''",
"]",
")",
"[",
"0",
"]",
")",
":",
"]"
] | https://github.com/AndroidAdvanceWithGeektime/Chapter01/blob/da2bc56d708fa74035c64564b134189045f51213/breakpad-build/src/main/cpp/external/libbreakpad/src/tools/python/filter_syms.py#L126-L137 | |
sc0ty/subsync | be5390d00ff475b6543eb0140c7e65b34317d95b | subsync/assets/downloader.py | python | AssetDownloader.run | (self, timeout=None) | return True | Start downloader (asynchronously).
Could be called multiple times, has no effect if downloader is already
in progress. If downloader is already running, timeout will not be
updated. See `AssetDownloade.registerCallbacks`.
Parameters
----------
timeout: float, optional
... | Start downloader (asynchronously). | [
"Start",
"downloader",
"(",
"asynchronously",
")",
"."
] | def run(self, timeout=None):
"""Start downloader (asynchronously).
Could be called multiple times, has no effect if downloader is already
in progress. If downloader is already running, timeout will not be
updated. See `AssetDownloade.registerCallbacks`.
Parameters
----... | [
"def",
"run",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"if",
"self",
".",
"_thread",
":",
"return",
"False",
"if",
"not",
"self",
".",
"_asset",
".",
"hasUpdate",
"(",
")",
":",
"raise",
"RuntimeError",
"(",
"'No update available'",
")",
"se... | https://github.com/sc0ty/subsync/blob/be5390d00ff475b6543eb0140c7e65b34317d95b/subsync/assets/downloader.py#L32-L63 | |
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | CheckSectionSpacing | (filename, clean_lines, class_info, linenum, error) | Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
class_info: A _ClassInfo objects.
linenum: The number ... | Checks for additional blank line issues related to sections. | [
"Checks",
"for",
"additional",
"blank",
"line",
"issues",
"related",
"to",
"sections",
"."
] | def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):
"""Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance co... | [
"def",
"CheckSectionSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"class_info",
",",
"linenum",
",",
"error",
")",
":",
"# Skip checks if the class is small, where small means 25 lines or less.",
"# 25 lines seems like a good cutoff since that's the usual height of",
"# termina... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L2489-L2541 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/symbolic_io.py | python | exprToStr | (expr,parseCompatible=True,expandSubexprs='auto') | Converts an Expression to a printable or parseable string.
Args:
expr (Expression): the Expression to convert
parseCompatible (bool, optional): if True, the result is readable via exprFromStr()
expandSubexprs (str or bool, optional): whether to expand subexpressions. Can be:
* ... | Converts an Expression to a printable or parseable string. | [
"Converts",
"an",
"Expression",
"to",
"a",
"printable",
"or",
"parseable",
"string",
"."
] | def exprToStr(expr,parseCompatible=True,expandSubexprs='auto'):
"""Converts an Expression to a printable or parseable string.
Args:
expr (Expression): the Expression to convert
parseCompatible (bool, optional): if True, the result is readable via exprFromStr()
expandSubexprs (str or boo... | [
"def",
"exprToStr",
"(",
"expr",
",",
"parseCompatible",
"=",
"True",
",",
"expandSubexprs",
"=",
"'auto'",
")",
":",
"if",
"isinstance",
"(",
"expr",
",",
"ConstantExpression",
")",
":",
"if",
"isinstance",
"(",
"expr",
".",
"value",
",",
"slice",
")",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/symbolic_io.py#L202-L314 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_vehicle.py | python | VehicleDomain.setVehicleClass | (self, vehID, clazz) | setVehicleClass(string, string) -> None
Sets the vehicle class for this vehicle. | setVehicleClass(string, string) -> None | [
"setVehicleClass",
"(",
"string",
"string",
")",
"-",
">",
"None"
] | def setVehicleClass(self, vehID, clazz):
"""setVehicleClass(string, string) -> None
Sets the vehicle class for this vehicle.
"""
self._setCmd(tc.VAR_VEHICLECLASS, vehID, "s", clazz) | [
"def",
"setVehicleClass",
"(",
"self",
",",
"vehID",
",",
"clazz",
")",
":",
"self",
".",
"_setCmd",
"(",
"tc",
".",
"VAR_VEHICLECLASS",
",",
"vehID",
",",
"\"s\"",
",",
"clazz",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_vehicle.py#L1380-L1385 | ||
genn-team/genn | 75e1eb218cafa228bf36ae4613d1ce26e877b12c | pygenn/genn_model.py | python | create_var_ref | (pop, var_name) | return (genn_wrapper.create_var_ref(pop.pop, var_name), pop) | This helper function creates a Models::VarReference
pointing to a neuron or current source variable
for initialising variable references.
Args:
pop -- population, either a NeuronGroup or CurrentSource object
var_name -- name of variable in population to reference | This helper function creates a Models::VarReference
pointing to a neuron or current source variable
for initialising variable references. | [
"This",
"helper",
"function",
"creates",
"a",
"Models",
"::",
"VarReference",
"pointing",
"to",
"a",
"neuron",
"or",
"current",
"source",
"variable",
"for",
"initialising",
"variable",
"references",
"."
] | def create_var_ref(pop, var_name):
"""This helper function creates a Models::VarReference
pointing to a neuron or current source variable
for initialising variable references.
Args:
pop -- population, either a NeuronGroup or CurrentSource object
var_name -- name of variable in popula... | [
"def",
"create_var_ref",
"(",
"pop",
",",
"var_name",
")",
":",
"return",
"(",
"genn_wrapper",
".",
"create_var_ref",
"(",
"pop",
".",
"pop",
",",
"var_name",
")",
",",
"pop",
")"
] | https://github.com/genn-team/genn/blob/75e1eb218cafa228bf36ae4613d1ce26e877b12c/pygenn/genn_model.py#L965-L974 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/optimizer/qgt/qgt_jacobian_pytree.py | python | QGTJacobianPyTree | (
vstate=None,
*,
mode: str = None,
holomorphic: bool = None,
rescale_shift=False,
**kwargs,
) | return QGTJacobianPyTreeT(
O=O, scale=scale, params=vstate.parameters, mode=mode, **kwargs
) | Semi-lazy representation of an S Matrix where the Jacobian O_k is precomputed
and stored as a PyTree.
The matrix of gradients O is computed on initialisation, but not S,
which can be computed by calling :code:`to_dense`.
The details on how the ⟨S⟩⁻¹⟨F⟩ system is solved are contaianed in
the field `... | Semi-lazy representation of an S Matrix where the Jacobian O_k is precomputed
and stored as a PyTree. | [
"Semi",
"-",
"lazy",
"representation",
"of",
"an",
"S",
"Matrix",
"where",
"the",
"Jacobian",
"O_k",
"is",
"precomputed",
"and",
"stored",
"as",
"a",
"PyTree",
"."
] | def QGTJacobianPyTree(
vstate=None,
*,
mode: str = None,
holomorphic: bool = None,
rescale_shift=False,
**kwargs,
) -> "QGTJacobianPyTreeT":
"""
Semi-lazy representation of an S Matrix where the Jacobian O_k is precomputed
and stored as a PyTree.
The matrix of gradients O is com... | [
"def",
"QGTJacobianPyTree",
"(",
"vstate",
"=",
"None",
",",
"*",
",",
"mode",
":",
"str",
"=",
"None",
",",
"holomorphic",
":",
"bool",
"=",
"None",
",",
"rescale_shift",
"=",
"False",
",",
"*",
"*",
"kwargs",
",",
")",
"->",
"\"QGTJacobianPyTreeT\"",
... | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/optimizer/qgt/qgt_jacobian_pytree.py#L35-L113 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-utils/blocktool/core/parseheader_generic.py | python | GenericHeaderParser.run_blocktool | (self) | Run, run, run. | Run, run, run. | [
"Run",
"run",
"run",
"."
] | def run_blocktool(self):
""" Run, run, run. """
pass | [
"def",
"run_blocktool",
"(",
"self",
")",
":",
"pass"
] | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-utils/blocktool/core/parseheader_generic.py#L350-L352 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/models/wheel.py | python | Wheel.support_index_min | (self, tags) | return min(tags.index(tag) for tag in self.file_tags if tag in tags) | Return the lowest index that one of the wheel's file_tag combinations
achieves in the given list of supported tags.
For example, if there are 8 supported tags and one of the file tags
is first in the list, then return 0.
:param tags: the PEP 425 tags to check the wheel against, i... | Return the lowest index that one of the wheel's file_tag combinations | [
"Return",
"the",
"lowest",
"index",
"that",
"one",
"of",
"the",
"wheel",
"s",
"file_tag",
"combinations"
] | def support_index_min(self, tags):
# type: (List[Tag]) -> int
"""Return the lowest index that one of the wheel's file_tag combinations
achieves in the given list of supported tags.
For example, if there are 8 supported tags and one of the file tags
is first in the list, th... | [
"def",
"support_index_min",
"(",
"self",
",",
"tags",
")",
":",
"# type: (List[Tag]) -> int",
"return",
"min",
"(",
"tags",
".",
"index",
"(",
"tag",
")",
"for",
"tag",
"in",
"self",
".",
"file_tags",
"if",
"tag",
"in",
"tags",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/models/wheel.py#L111-L139 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | SimRobotController.getControlType | (self) | return _robotsim.SimRobotController_getControlType(self) | getControlType(SimRobotController self) -> std::string
Returns the control type for the active controller.
Possible return values are:
* unknown
* off
* torque
* PID
* locked_velocity | getControlType(SimRobotController self) -> std::string | [
"getControlType",
"(",
"SimRobotController",
"self",
")",
"-",
">",
"std",
"::",
"string"
] | def getControlType(self):
"""
getControlType(SimRobotController self) -> std::string
Returns the control type for the active controller.
Possible return values are:
* unknown
* off
* torque
* PID
* locked_velocity
... | [
"def",
"getControlType",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"SimRobotController_getControlType",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L7756-L7773 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | DataFormats/FWLite/python/__init__.py | python | Lumis._next | (self) | (Internal) Iterator internals | (Internal) Iterator internals | [
"(",
"Internal",
")",
"Iterator",
"internals"
] | def _next (self):
"""(Internal) Iterator internals"""
while True:
if self._lumi.atEnd():
if not self._createFWLiteLumi():
# there are no more files here, so we are done
break
yield self
self._lumiCounts += 1
... | [
"def",
"_next",
"(",
"self",
")",
":",
"while",
"True",
":",
"if",
"self",
".",
"_lumi",
".",
"atEnd",
"(",
")",
":",
"if",
"not",
"self",
".",
"_createFWLiteLumi",
"(",
")",
":",
"# there are no more files here, so we are done",
"break",
"yield",
"self",
... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/DataFormats/FWLite/python/__init__.py#L276-L287 | ||
wujian16/Cornell-MOE | df299d1be882d2af9796d7a68b3f9505cac7a53e | moe/optimal_learning/python/cpp_wrappers/domain.py | python | SimplexIntersectTensorProductDomain.__init__ | (self, domain_bounds) | Construct a SimplexIntersectTensorProductDomain that can be used with cpp_wrappers.* functions/classes.
:param domain_bounds: the boundaries of a dim-dimensional tensor-product domain.
:type domain_bounds: iterable of dim ClosedInterval | Construct a SimplexIntersectTensorProductDomain that can be used with cpp_wrappers.* functions/classes. | [
"Construct",
"a",
"SimplexIntersectTensorProductDomain",
"that",
"can",
"be",
"used",
"with",
"cpp_wrappers",
".",
"*",
"functions",
"/",
"classes",
"."
] | def __init__(self, domain_bounds):
"""Construct a SimplexIntersectTensorProductDomain that can be used with cpp_wrappers.* functions/classes.
:param domain_bounds: the boundaries of a dim-dimensional tensor-product domain.
:type domain_bounds: iterable of dim ClosedInterval
"""
... | [
"def",
"__init__",
"(",
"self",
",",
"domain_bounds",
")",
":",
"self",
".",
"_tensor_product_domain",
"=",
"TensorProductDomain",
"(",
"domain_bounds",
")",
"self",
".",
"_domain_type",
"=",
"C_GP",
".",
"DomainTypes",
".",
"simplex"
] | https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/cpp_wrappers/domain.py#L130-L138 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/six.py | python | _SixMetaPathImporter.get_code | (self, fullname) | return None | Return None
Required, if is_package is implemented | Return None | [
"Return",
"None"
] | def get_code(self, fullname):
"""Return None
Required, if is_package is implemented"""
self.__get_module(fullname) # eventually raises ImportError
return None | [
"def",
"get_code",
"(",
"self",
",",
"fullname",
")",
":",
"self",
".",
"__get_module",
"(",
"fullname",
")",
"# eventually raises ImportError",
"return",
"None"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/six.py#L435-L445 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pubsub/utils/topictreeprinter.py | python | printTreeDocs | (rootTopic=None, topicMgr=None, **kwargs) | Print out the topic tree to a file (or file-like object like a
StringIO), starting at rootTopic. If root topic should be root of
whole tree, get it from pub.getDefaultTopicTreeRoot().
The treeVisitor is an instance of pub.TopicTreeTraverser.
Printing the tree docs would normally involve this::
... | Print out the topic tree to a file (or file-like object like a
StringIO), starting at rootTopic. If root topic should be root of
whole tree, get it from pub.getDefaultTopicTreeRoot().
The treeVisitor is an instance of pub.TopicTreeTraverser. | [
"Print",
"out",
"the",
"topic",
"tree",
"to",
"a",
"file",
"(",
"or",
"file",
"-",
"like",
"object",
"like",
"a",
"StringIO",
")",
"starting",
"at",
"rootTopic",
".",
"If",
"root",
"topic",
"should",
"be",
"root",
"of",
"whole",
"tree",
"get",
"it",
... | def printTreeDocs(rootTopic=None, topicMgr=None, **kwargs):
"""Print out the topic tree to a file (or file-like object like a
StringIO), starting at rootTopic. If root topic should be root of
whole tree, get it from pub.getDefaultTopicTreeRoot().
The treeVisitor is an instance of pub.TopicTreeTraverser.... | [
"def",
"printTreeDocs",
"(",
"rootTopic",
"=",
"None",
",",
"topicMgr",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"rootTopic",
"is",
"None",
":",
"if",
"topicMgr",
"is",
"None",
":",
"from",
".",
".",
"import",
"pub",
"topicMgr",
"=",
"pu... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/utils/topictreeprinter.py#L163-L193 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/motionplanning.py | python | CSpaceInterface.setFeasibility | (self, pyFeas) | return _motionplanning.CSpaceInterface_setFeasibility(self, pyFeas) | setFeasibility(CSpaceInterface self, PyObject * pyFeas) | setFeasibility(CSpaceInterface self, PyObject * pyFeas) | [
"setFeasibility",
"(",
"CSpaceInterface",
"self",
"PyObject",
"*",
"pyFeas",
")"
] | def setFeasibility(self, pyFeas):
"""
setFeasibility(CSpaceInterface self, PyObject * pyFeas)
"""
return _motionplanning.CSpaceInterface_setFeasibility(self, pyFeas) | [
"def",
"setFeasibility",
"(",
"self",
",",
"pyFeas",
")",
":",
"return",
"_motionplanning",
".",
"CSpaceInterface_setFeasibility",
"(",
"self",
",",
"pyFeas",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/motionplanning.py#L336-L343 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.