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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
qtumproject/qtum | f5a195cc8c62510336ce4f30b7f74b5fdc445ad7 | src/crc32c/.ycm_extra_conf.py | python | MakeRelativePathsInFlagsAbsolute | (flags, build_root) | return new_flags | Expands relative paths in a list of Clang command-line flags.
Args:
flags: The list of flags passed to Clang.
build_root: The current directory when running the Clang compiler. Should be
an absolute path.
Returns:
A list of flags with relative paths replaced by absolute paths. | Expands relative paths in a list of Clang command-line flags. | [
"Expands",
"relative",
"paths",
"in",
"a",
"list",
"of",
"Clang",
"command",
"-",
"line",
"flags",
"."
] | def MakeRelativePathsInFlagsAbsolute(flags, build_root):
"""Expands relative paths in a list of Clang command-line flags.
Args:
flags: The list of flags passed to Clang.
build_root: The current directory when running the Clang compiler. Should be
an absolute path.
Returns:
A list of flags wi... | [
"def",
"MakeRelativePathsInFlagsAbsolute",
"(",
"flags",
",",
"build_root",
")",
":",
"new_flags",
"=",
"[",
"]",
"make_next_absolute",
"=",
"False",
"for",
"flag",
"in",
"flags",
":",
"new_flag",
"=",
"flag",
"if",
"make_next_absolute",
":",
"make_next_absolute",... | https://github.com/qtumproject/qtum/blob/f5a195cc8c62510336ce4f30b7f74b5fdc445ad7/src/crc32c/.ycm_extra_conf.py#L37-L70 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/_collections_abc.py | python | Mapping.items | (self) | return ItemsView(self) | D.items() -> a set-like object providing a view on D's items | D.items() -> a set-like object providing a view on D's items | [
"D",
".",
"items",
"()",
"-",
">",
"a",
"set",
"-",
"like",
"object",
"providing",
"a",
"view",
"on",
"D",
"s",
"items"
] | def items(self):
"D.items() -> a set-like object providing a view on D's items"
return ItemsView(self) | [
"def",
"items",
"(",
"self",
")",
":",
"return",
"ItemsView",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_collections_abc.py#L676-L678 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | PyPreviewFrame.CreateControlBar | (*args, **kwargs) | return _windows_.PyPreviewFrame_CreateControlBar(*args, **kwargs) | CreateControlBar(self) | CreateControlBar(self) | [
"CreateControlBar",
"(",
"self",
")"
] | def CreateControlBar(*args, **kwargs):
"""CreateControlBar(self)"""
return _windows_.PyPreviewFrame_CreateControlBar(*args, **kwargs) | [
"def",
"CreateControlBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PyPreviewFrame_CreateControlBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L5760-L5762 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/distutils/ccompiler.py | python | CCompiler._fix_lib_args | (self, libraries, library_dirs, runtime_library_dirs) | return (libraries, library_dirs, runtime_library_dirs) | Typecheck and fix up some of the arguments supplied to the
'link_*' methods. Specifically: ensure that all arguments are
lists, and augment them with their permanent versions
(eg. 'self.libraries' augments 'libraries'). Return a tuple with
fixed versions of all arguments. | Typecheck and fix up some of the arguments supplied to the
'link_*' methods. Specifically: ensure that all arguments are
lists, and augment them with their permanent versions
(eg. 'self.libraries' augments 'libraries'). Return a tuple with
fixed versions of all arguments. | [
"Typecheck",
"and",
"fix",
"up",
"some",
"of",
"the",
"arguments",
"supplied",
"to",
"the",
"link_",
"*",
"methods",
".",
"Specifically",
":",
"ensure",
"that",
"all",
"arguments",
"are",
"lists",
"and",
"augment",
"them",
"with",
"their",
"permanent",
"vers... | def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
"""Typecheck and fix up some of the arguments supplied to the
'link_*' methods. Specifically: ensure that all arguments are
lists, and augment them with their permanent versions
(eg. 'self.libraries' augments 'libra... | [
"def",
"_fix_lib_args",
"(",
"self",
",",
"libraries",
",",
"library_dirs",
",",
"runtime_library_dirs",
")",
":",
"if",
"libraries",
"is",
"None",
":",
"libraries",
"=",
"self",
".",
"libraries",
"elif",
"isinstance",
"(",
"libraries",
",",
"(",
"list",
","... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/ccompiler.py#L427-L459 | |
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/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/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/internal/wire_format.py#L231-L247 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/frameworks/modelling.py | python | MeshModelling.setMesh | (self, mesh, ignoreRegionManager=False) | Set mesh and specify whether region manager can be ignored. | Set mesh and specify whether region manager can be ignored. | [
"Set",
"mesh",
"and",
"specify",
"whether",
"region",
"manager",
"can",
"be",
"ignored",
"."
] | def setMesh(self, mesh, ignoreRegionManager=False):
"""Set mesh and specify whether region manager can be ignored."""
self._baseMesh = mesh
if ignoreRegionManager is False:
self._regionManagerInUse = True
if ignoreRegionManager or not self._regionManagerInUse:
se... | [
"def",
"setMesh",
"(",
"self",
",",
"mesh",
",",
"ignoreRegionManager",
"=",
"False",
")",
":",
"self",
".",
"_baseMesh",
"=",
"mesh",
"if",
"ignoreRegionManager",
"is",
"False",
":",
"self",
".",
"_regionManagerInUse",
"=",
"True",
"if",
"ignoreRegionManager"... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/frameworks/modelling.py#L575-L596 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/_html.py | python | SyntaxData.GetSyntaxSpec | (self) | return SYNTAX_ITEMS + _javascript.SYNTAX_ITEMS | Syntax Specifications | Syntax Specifications | [
"Syntax",
"Specifications"
] | def GetSyntaxSpec(self):
"""Syntax Specifications"""
return SYNTAX_ITEMS + _javascript.SYNTAX_ITEMS | [
"def",
"GetSyntaxSpec",
"(",
"self",
")",
":",
"return",
"SYNTAX_ITEMS",
"+",
"_javascript",
".",
"SYNTAX_ITEMS"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/_html.py#L218-L220 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/linalg/lapack_lite/make_lite.py | python | FortranLibrary.addRoutine | (self, rname) | Add a routine to the library. | Add a routine to the library. | [
"Add",
"a",
"routine",
"to",
"the",
"library",
"."
] | def addRoutine(self, rname):
"""Add a routine to the library.
"""
self.getRoutine(rname) | [
"def",
"addRoutine",
"(",
"self",
",",
"rname",
")",
":",
"self",
".",
"getRoutine",
"(",
"rname",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/linalg/lapack_lite/make_lite.py#L123-L126 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/control/motion_generation.py | python | AccelerationBoundedMotionGeneration.brake | (self) | Stops as quickly as possible under the acceleration bounds. | Stops as quickly as possible under the acceleration bounds. | [
"Stops",
"as",
"quickly",
"as",
"possible",
"under",
"the",
"acceleration",
"bounds",
"."
] | def brake(self):
"""Stops as quickly as possible under the acceleration bounds.
"""
self._trim(False)
if brake_nd is None:
#0.8.x Klampt
raise NotImplementedError("brake() not available in Klampt 0.8.x")
t,m,v = brake_nd(self.x,self.v,self.xmin,s... | [
"def",
"brake",
"(",
"self",
")",
":",
"self",
".",
"_trim",
"(",
"False",
")",
"if",
"brake_nd",
"is",
"None",
":",
"#0.8.x Klampt",
"raise",
"NotImplementedError",
"(",
"\"brake() not available in Klampt 0.8.x\"",
")",
"t",
",",
"m",
",",
"v",
"=",
"brake_... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/motion_generation.py#L305-L320 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/s3transfer/processpool.py | python | TransferMonitor.poll_for_result | (self, transfer_id) | return None | Poll for the result of a transfer
:param transfer_id: Unique identifier for the transfer
:return: If the transfer succeeded, it will return the result. If the
transfer failed, it will raise the exception associated to the
failure. | Poll for the result of a transfer | [
"Poll",
"for",
"the",
"result",
"of",
"a",
"transfer"
] | def poll_for_result(self, transfer_id):
"""Poll for the result of a transfer
:param transfer_id: Unique identifier for the transfer
:return: If the transfer succeeded, it will return the result. If the
transfer failed, it will raise the exception associated to the
failur... | [
"def",
"poll_for_result",
"(",
"self",
",",
"transfer_id",
")",
":",
"self",
".",
"_transfer_states",
"[",
"transfer_id",
"]",
".",
"wait_till_done",
"(",
")",
"exception",
"=",
"self",
".",
"_transfer_states",
"[",
"transfer_id",
"]",
".",
"exception",
"if",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/s3transfer/processpool.py#L606-L618 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/generator/analyzer.py | python | TargetCalculator._supplied_target_names_no_all | (self) | return result | Returns the supplied test targets without 'all'. | Returns the supplied test targets without 'all'. | [
"Returns",
"the",
"supplied",
"test",
"targets",
"without",
"all",
"."
] | def _supplied_target_names_no_all(self):
"""Returns the supplied test targets without 'all'."""
result = self._supplied_target_names();
result.discard('all')
return result | [
"def",
"_supplied_target_names_no_all",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"_supplied_target_names",
"(",
")",
"result",
".",
"discard",
"(",
"'all'",
")",
"return",
"result"
] | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/generator/analyzer.py#L611-L615 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/email/message.py | python | Message.get_params | (self, failobj=None, header='content-type', unquote=True) | Return the message's Content-Type parameters, as a list.
The elements of the returned list are 2-tuples of key/value pairs, as
split on the `=' sign. The left hand side of the `=' is the key,
while the right hand side is the value. If there is no `=' sign in
the parameter the value is... | Return the message's Content-Type parameters, as a list. | [
"Return",
"the",
"message",
"s",
"Content",
"-",
"Type",
"parameters",
"as",
"a",
"list",
"."
] | def get_params(self, failobj=None, header='content-type', unquote=True):
"""Return the message's Content-Type parameters, as a list.
The elements of the returned list are 2-tuples of key/value pairs, as
split on the `=' sign. The left hand side of the `=' is the key,
while the right ha... | [
"def",
"get_params",
"(",
"self",
",",
"failobj",
"=",
"None",
",",
"header",
"=",
"'content-type'",
",",
"unquote",
"=",
"True",
")",
":",
"missing",
"=",
"object",
"(",
")",
"params",
"=",
"self",
".",
"_get_params_preserve",
"(",
"missing",
",",
"head... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/message.py#L645-L665 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | PyWindow.DoGetVirtualSize | (*args, **kwargs) | return _windows_.PyWindow_DoGetVirtualSize(*args, **kwargs) | DoGetVirtualSize(self) -> Size | DoGetVirtualSize(self) -> Size | [
"DoGetVirtualSize",
"(",
"self",
")",
"-",
">",
"Size"
] | def DoGetVirtualSize(*args, **kwargs):
"""DoGetVirtualSize(self) -> Size"""
return _windows_.PyWindow_DoGetVirtualSize(*args, **kwargs) | [
"def",
"DoGetVirtualSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PyWindow_DoGetVirtualSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L4174-L4176 | |
fifengine/fifengine | 4b62c42e85bec19893cef8e63e6855927cff2c47 | engine/python/fife/extensions/serializers/__init__.py | python | loadImportFile | (loader, path, engine, debug=False) | uses XMLObjectLoader to load import files from path
@type path: string
@param path: path to import file
@type debug: bool
@param debug: flag to activate / deactivate print statements | uses XMLObjectLoader to load import files from path | [
"uses",
"XMLObjectLoader",
"to",
"load",
"import",
"files",
"from",
"path"
] | def loadImportFile(loader, path, engine, debug=False):
""" uses XMLObjectLoader to load import files from path
@type path: string
@param path: path to import file
@type debug: bool
@param debug: flag to activate / deactivate print statements
"""
loader.loadResource(fife.ResourceLocation(path))
if debug: print... | [
"def",
"loadImportFile",
"(",
"loader",
",",
"path",
",",
"engine",
",",
"debug",
"=",
"False",
")",
":",
"loader",
".",
"loadResource",
"(",
"fife",
".",
"ResourceLocation",
"(",
"path",
")",
")",
"if",
"debug",
":",
"print",
"(",
"'imported object file '... | https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/serializers/__init__.py#L110-L119 | ||
JumpingYang001/webrtc | c03d6e965e1f54aeadd670e491eabe5fdb8db968 | PRESUBMIT.py | python | _CalculateAddedDeps | (os_path, old_contents, new_contents) | return results | Helper method for _CheckAddedDepsHaveTargetApprovals. Returns
a set of DEPS entries that we should look up.
For a directory (rather than a specific filename) we fake a path to
a specific filename by adding /DEPS. This is chosen as a file that
will seldom or never be subject to per-file include_rules. | Helper method for _CheckAddedDepsHaveTargetApprovals. Returns
a set of DEPS entries that we should look up. | [
"Helper",
"method",
"for",
"_CheckAddedDepsHaveTargetApprovals",
".",
"Returns",
"a",
"set",
"of",
"DEPS",
"entries",
"that",
"we",
"should",
"look",
"up",
"."
] | def _CalculateAddedDeps(os_path, old_contents, new_contents):
"""Helper method for _CheckAddedDepsHaveTargetApprovals. Returns
a set of DEPS entries that we should look up.
For a directory (rather than a specific filename) we fake a path to
a specific filename by adding /DEPS. This is chosen as a file that
... | [
"def",
"_CalculateAddedDeps",
"(",
"os_path",
",",
"old_contents",
",",
"new_contents",
")",
":",
"# We ignore deps entries on auto-generated directories.",
"auto_generated_dirs",
"=",
"[",
"'grit'",
",",
"'jni'",
"]",
"old_deps",
"=",
"_ExtractAddRulesFromParsedDeps",
"(",... | https://github.com/JumpingYang001/webrtc/blob/c03d6e965e1f54aeadd670e491eabe5fdb8db968/PRESUBMIT.py#L1292-L1317 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg/linear_operator_algebra.py | python | RegisterSolve.__init__ | (self, lin_op_cls_a, lin_op_cls_b) | Initialize the LinearOperator registrar.
Args:
lin_op_cls_a: the class of the LinearOperator that is computing solve.
lin_op_cls_b: the class of the second LinearOperator to solve. | Initialize the LinearOperator registrar. | [
"Initialize",
"the",
"LinearOperator",
"registrar",
"."
] | def __init__(self, lin_op_cls_a, lin_op_cls_b):
"""Initialize the LinearOperator registrar.
Args:
lin_op_cls_a: the class of the LinearOperator that is computing solve.
lin_op_cls_b: the class of the second LinearOperator to solve.
"""
self._key = (lin_op_cls_a, lin_op_cls_b) | [
"def",
"__init__",
"(",
"self",
",",
"lin_op_cls_a",
",",
"lin_op_cls_b",
")",
":",
"self",
".",
"_key",
"=",
"(",
"lin_op_cls_a",
",",
"lin_op_cls_b",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg/linear_operator_algebra.py#L337-L344 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py | python | BeamSearchDecoderMixin._maybe_sort_array_beams | (self, t, parent_ids, sequence_length) | Maybe sorts beams within a `TensorArray`.
Args:
t: A `TensorArray` of size `max_time` that contains `Tensor`s of shape
`[batch_size, beam_width, s]` or `[batch_size * beam_width, s]` where
`s` is the depth shape.
parent_ids: The parent ids of shape `[max_time, batch_size, beam_width]`.
... | Maybe sorts beams within a `TensorArray`. | [
"Maybe",
"sorts",
"beams",
"within",
"a",
"TensorArray",
"."
] | def _maybe_sort_array_beams(self, t, parent_ids, sequence_length):
"""Maybe sorts beams within a `TensorArray`.
Args:
t: A `TensorArray` of size `max_time` that contains `Tensor`s of shape
`[batch_size, beam_width, s]` or `[batch_size * beam_width, s]` where
`s` is the depth shape.
... | [
"def",
"_maybe_sort_array_beams",
"(",
"self",
",",
"t",
",",
"parent_ids",
",",
"sequence_length",
")",
":",
"if",
"not",
"isinstance",
"(",
"t",
",",
"tensor_array_ops",
".",
"TensorArray",
")",
":",
"return",
"t",
"if",
"t",
".",
"element_shape",
".",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py#L490-L520 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/framework/memory_checker.py | python | MemoryChecker.record_snapshot | (self) | Take a memory snapshot for later analysis.
`record_snapshot()` must be called once every iteration at the same
location. This is because the detection algorithm relies on the assumption
that if there is a leak, it's happening similarly on every snapshot.
The recommended number of `record_snapshot()` c... | Take a memory snapshot for later analysis. | [
"Take",
"a",
"memory",
"snapshot",
"for",
"later",
"analysis",
"."
] | def record_snapshot(self):
"""Take a memory snapshot for later analysis.
`record_snapshot()` must be called once every iteration at the same
location. This is because the detection algorithm relies on the assumption
that if there is a leak, it's happening similarly on every snapshot.
The recommend... | [
"def",
"record_snapshot",
"(",
"self",
")",
":",
"self",
".",
"_python_memory_checker",
".",
"record_snapshot",
"(",
")",
"if",
"CppMemoryChecker",
":",
"self",
".",
"_cpp_memory_checker",
".",
"record_snapshot",
"(",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/memory_checker.py#L84-L96 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/layers/distributions.py | python | Distribution.sample | (self) | Sampling from the distribution. | Sampling from the distribution. | [
"Sampling",
"from",
"the",
"distribution",
"."
] | def sample(self):
"""Sampling from the distribution."""
raise NotImplementedError | [
"def",
"sample",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/distributions.py#L35-L37 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py | python | RawTurtle.setundobuffer | (self, size) | Set or disable undobuffer.
Argument:
size -- an integer or None
If size is an integer an empty undobuffer of given size is installed.
Size gives the maximum number of turtle-actions that can be undone
by the undo() function.
If size is None, no undobuffer is present.
... | Set or disable undobuffer. | [
"Set",
"or",
"disable",
"undobuffer",
"."
] | def setundobuffer(self, size):
"""Set or disable undobuffer.
Argument:
size -- an integer or None
If size is an integer an empty undobuffer of given size is installed.
Size gives the maximum number of turtle-actions that can be undone
by the undo() function.
If ... | [
"def",
"setundobuffer",
"(",
"self",
",",
"size",
")",
":",
"if",
"size",
"is",
"None",
"or",
"size",
"<=",
"0",
":",
"self",
".",
"undobuffer",
"=",
"None",
"else",
":",
"self",
".",
"undobuffer",
"=",
"Tbuffer",
"(",
"size",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py#L2584-L2601 | ||
s9xie/hed | 94fb22f10cbfec8d84fbc0642b224022014b6bd6 | scripts/cpp_lint.py | python | _ClassifyInclude | (fileinfo, include, is_system) | return _OTHER_HEADER | Figures out what kind of header 'include' is.
Args:
fileinfo: The current file cpplint is running over. A FileInfo instance.
include: The path to a #included file.
is_system: True if the #include used <> rather than "".
Returns:
One of the _XXX_HEADER constants.
For example:
>>> _ClassifyIn... | Figures out what kind of header 'include' is. | [
"Figures",
"out",
"what",
"kind",
"of",
"header",
"include",
"is",
"."
] | def _ClassifyInclude(fileinfo, include, is_system):
"""Figures out what kind of header 'include' is.
Args:
fileinfo: The current file cpplint is running over. A FileInfo instance.
include: The path to a #included file.
is_system: True if the #include used <> rather than "".
Returns:
One of the _... | [
"def",
"_ClassifyInclude",
"(",
"fileinfo",
",",
"include",
",",
"is_system",
")",
":",
"# This is a list of all standard c++ header files, except",
"# those already checked for above.",
"is_cpp_h",
"=",
"include",
"in",
"_CPP_HEADERS",
"if",
"is_system",
":",
"if",
"is_cpp... | https://github.com/s9xie/hed/blob/94fb22f10cbfec8d84fbc0642b224022014b6bd6/scripts/cpp_lint.py#L3620-L3676 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/pygments/lexers/text.py | python | YamlLexer.set_block_scalar_indent | (token_class) | return callback | Set an explicit indentation level for a block scalar. | Set an explicit indentation level for a block scalar. | [
"Set",
"an",
"explicit",
"indentation",
"level",
"for",
"a",
"block",
"scalar",
"."
] | def set_block_scalar_indent(token_class):
"""Set an explicit indentation level for a block scalar."""
def callback(lexer, match, context):
text = match.group()
context.block_scalar_indent = None
if not text:
return
increment = match.group(1... | [
"def",
"set_block_scalar_indent",
"(",
"token_class",
")",
":",
"def",
"callback",
"(",
"lexer",
",",
"match",
",",
"context",
")",
":",
"text",
"=",
"match",
".",
"group",
"(",
")",
"context",
".",
"block_scalar_indent",
"=",
"None",
"if",
"not",
"text",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/pygments/lexers/text.py#L1137-L1152 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | FocusEvent.__init__ | (self, *args, **kwargs) | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
Constructor | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent | [
"__init__",
"(",
"self",
"EventType",
"type",
"=",
"wxEVT_NULL",
"int",
"winid",
"=",
"0",
")",
"-",
">",
"FocusEvent"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
Constructor
"""
_core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"FocusEvent_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_FocusEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L6301-L6307 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/util/ssl_.py | python | assert_fingerprint | (cert, fingerprint) | Checks if given fingerprint matches the supplied certificate.
:param cert:
Certificate as bytes object.
:param fingerprint:
Fingerprint as string of hexdigits, can be interspersed by colons. | Checks if given fingerprint matches the supplied certificate. | [
"Checks",
"if",
"given",
"fingerprint",
"matches",
"the",
"supplied",
"certificate",
"."
] | def assert_fingerprint(cert, fingerprint):
"""
Checks if given fingerprint matches the supplied certificate.
:param cert:
Certificate as bytes object.
:param fingerprint:
Fingerprint as string of hexdigits, can be interspersed by colons.
"""
fingerprint = fingerprint.replace(":... | [
"def",
"assert_fingerprint",
"(",
"cert",
",",
"fingerprint",
")",
":",
"fingerprint",
"=",
"fingerprint",
".",
"replace",
"(",
"\":\"",
",",
"\"\"",
")",
".",
"lower",
"(",
")",
"digest_length",
"=",
"len",
"(",
"fingerprint",
")",
"hashfunc",
"=",
"HASHF... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/util/ssl_.py#L152-L178 | ||
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/utils/path.py | python | DPOSPath.__str__ | (self) | return str(self.path) | Represent string | Represent string | [
"Represent",
"string"
] | def __str__(self) -> str:
"""Represent string"""
return str(self.path) | [
"def",
"__str__",
"(",
"self",
")",
"->",
"str",
":",
"return",
"str",
"(",
"self",
".",
"path",
")"
] | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/utils/path.py#L195-L197 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/fixpy2.py | python | modif | (dir, name, fun) | execute a substitution function | execute a substitution function | [
"execute",
"a",
"substitution",
"function"
] | def modif(dir, name, fun):
"""execute a substitution function"""
if name == '*':
lst = []
for y in '. Tools extras'.split():
for x in os.listdir(os.path.join(dir, y)):
if x.endswith('.py'):
lst.append(y + os.sep + x)
for x in lst:
modif(dir, x, fun)
return
filename = os.path.join(dir, name)
... | [
"def",
"modif",
"(",
"dir",
",",
"name",
",",
"fun",
")",
":",
"if",
"name",
"==",
"'*'",
":",
"lst",
"=",
"[",
"]",
"for",
"y",
"in",
"'. Tools extras'",
".",
"split",
"(",
")",
":",
"for",
"x",
"in",
"os",
".",
"listdir",
"(",
"os",
".",
"p... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/fixpy2.py#L19-L44 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/xcode_emulation.py | python | GetStdout | (cmdlist) | return out.rstrip("\n") | Returns the content of standard output returned by invoking |cmdlist|.
Raises |GypError| if the command return with a non-zero return code. | Returns the content of standard output returned by invoking |cmdlist|.
Raises |GypError| if the command return with a non-zero return code. | [
"Returns",
"the",
"content",
"of",
"standard",
"output",
"returned",
"by",
"invoking",
"|cmdlist|",
".",
"Raises",
"|GypError|",
"if",
"the",
"command",
"return",
"with",
"a",
"non",
"-",
"zero",
"return",
"code",
"."
] | def GetStdout(cmdlist):
"""Returns the content of standard output returned by invoking |cmdlist|.
Raises |GypError| if the command return with a non-zero return code."""
job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE)
out = job.communicate()[0].decode("utf-8")
if job.returncode != 0:
s... | [
"def",
"GetStdout",
"(",
"cmdlist",
")",
":",
"job",
"=",
"subprocess",
".",
"Popen",
"(",
"cmdlist",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
")",
"out",
"=",
"job",
".",
"communicate",
"(",
")",
"[",
"0",
"]",
".",
"decode",
"(",
"\"utf-8\"",... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/xcode_emulation.py#L1567-L1575 | |
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | examples/scripting/tree_utils.py | python | print_tree | (root) | Recursively traverse a binary search tree, printing out
the words at the nodes in alphabetical order (the
search order for the binary tree).
This function assumes the binary search tree is
the one defined in dictionary.c It uses LLDB API
functions to examine and traverse the tree nodes. | Recursively traverse a binary search tree, printing out
the words at the nodes in alphabetical order (the
search order for the binary tree). | [
"Recursively",
"traverse",
"a",
"binary",
"search",
"tree",
"printing",
"out",
"the",
"words",
"at",
"the",
"nodes",
"in",
"alphabetical",
"order",
"(",
"the",
"search",
"order",
"for",
"the",
"binary",
"tree",
")",
"."
] | def print_tree(root):
"""
Recursively traverse a binary search tree, printing out
the words at the nodes in alphabetical order (the
search order for the binary tree).
This function assumes the binary search tree is
the one defined in dictionary.c It uses LLDB API
functions to examine and t... | [
"def",
"print_tree",
"(",
"root",
")",
":",
"if",
"(",
"root",
".",
"GetChildAtIndex",
"(",
"1",
")",
".",
"GetValue",
"(",
")",
"is",
"not",
"None",
")",
"and",
"(",
"int",
"(",
"root",
".",
"GetChildAtIndex",
"(",
"1",
")",
".",
"GetValue",
"(",
... | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/examples/scripting/tree_utils.py#L101-L119 | ||
ArmageddonGames/ZeldaClassic | c244ae6c1d361d24a5529b1c0394e656f1f5d965 | allegro/misc/genexamp.py | python | load_example_short_descriptions | (path) | func(path_to_directory)
Loads the file examples.txt from the specified directory and
extracts the short example descriptions which are in "exblah -
text" format. The short descriptions are stored in the global
dictionary short_descriptions. | func(path_to_directory) | [
"func",
"(",
"path_to_directory",
")"
] | def load_example_short_descriptions(path):
"""func(path_to_directory)
Loads the file examples.txt from the specified directory and
extracts the short example descriptions which are in "exblah -
text" format. The short descriptions are stored in the global
dictionary short_descriptions.
"""
file_in... | [
"def",
"load_example_short_descriptions",
"(",
"path",
")",
":",
"file_input",
"=",
"file",
"(",
"os",
".",
"path",
".",
"join",
"(",
"path",
",",
"\"examples.txt\"",
")",
",",
"\"rt\"",
")",
"try",
":",
"regex",
"=",
"re",
".",
"compile",
"(",
"r\"(ex\\... | https://github.com/ArmageddonGames/ZeldaClassic/blob/c244ae6c1d361d24a5529b1c0394e656f1f5d965/allegro/misc/genexamp.py#L82-L101 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Image.FindFirstUnusedColour | (*args, **kwargs) | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
Find first colour that is not used in the image and has higher RGB
values than startR, startG, startB. Returns a tuple consisting of a
success flag and rgb values. | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | [
"FindFirstUnusedColour",
"(",
"int",
"startR",
"=",
"1",
"int",
"startG",
"=",
"0",
"int",
"startB",
"=",
"0",
")",
"-",
">",
"(",
"success",
"r",
"g",
"b",
")"
] | def FindFirstUnusedColour(*args, **kwargs):
"""
FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
Find first colour that is not used in the image and has higher RGB
values than startR, startG, startB. Returns a tuple consisting of a
success f... | [
"def",
"FindFirstUnusedColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_FindFirstUnusedColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L3100-L3108 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py2/jinja2/lexer.py | python | describe_token | (token) | return _describe_token_type(token.type) | Returns a description of the token. | Returns a description of the token. | [
"Returns",
"a",
"description",
"of",
"the",
"token",
"."
] | def describe_token(token):
"""Returns a description of the token."""
if token.type == TOKEN_NAME:
return token.value
return _describe_token_type(token.type) | [
"def",
"describe_token",
"(",
"token",
")",
":",
"if",
"token",
".",
"type",
"==",
"TOKEN_NAME",
":",
"return",
"token",
".",
"value",
"return",
"_describe_token_type",
"(",
"token",
".",
"type",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py2/jinja2/lexer.py#L180-L184 | |
google/gemmlowp | e844ffd17118c1e17d94e1ba4354c075a4577b88 | meta/generators/streams_common.py | python | _GenerateAggregatorReduction | (emitter, registers, aggregators,
output_address, multiplicative_sum_offset,
additive_sum_offset) | Reduce 4 lane sum aggregators to 1 value and store the sums. | Reduce 4 lane sum aggregators to 1 value and store the sums. | [
"Reduce",
"4",
"lane",
"sum",
"aggregators",
"to",
"1",
"value",
"and",
"store",
"the",
"sums",
"."
] | def _GenerateAggregatorReduction(emitter, registers, aggregators,
output_address, multiplicative_sum_offset,
additive_sum_offset):
"""Reduce 4 lane sum aggregators to 1 value and store the sums."""
multiplier = registers.DoubleRegister()
emitter.Em... | [
"def",
"_GenerateAggregatorReduction",
"(",
"emitter",
",",
"registers",
",",
"aggregators",
",",
"output_address",
",",
"multiplicative_sum_offset",
",",
"additive_sum_offset",
")",
":",
"multiplier",
"=",
"registers",
".",
"DoubleRegister",
"(",
")",
"emitter",
".",... | https://github.com/google/gemmlowp/blob/e844ffd17118c1e17d94e1ba4354c075a4577b88/meta/generators/streams_common.py#L111-L138 | ||
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/bundy/socket_cache.py | python | Cache.get_socket | (self, token, application) | return socket.fileno | This returns the socket created by get_token. The token should be the
one returned from previous call from get_token. The token can be used
only once to receive the socket.
The application is a token representing the application that
requested it. Currently, bundy-init uses the file des... | This returns the socket created by get_token. The token should be the
one returned from previous call from get_token. The token can be used
only once to receive the socket. | [
"This",
"returns",
"the",
"socket",
"created",
"by",
"get_token",
".",
"The",
"token",
"should",
"be",
"the",
"one",
"returned",
"from",
"previous",
"call",
"from",
"get_token",
".",
"The",
"token",
"can",
"be",
"used",
"only",
"once",
"to",
"receive",
"th... | def get_socket(self, token, application):
"""
This returns the socket created by get_token. The token should be the
one returned from previous call from get_token. The token can be used
only once to receive the socket.
The application is a token representing the application that... | [
"def",
"get_socket",
"(",
"self",
",",
"token",
",",
"application",
")",
":",
"try",
":",
"socket",
"=",
"self",
".",
"_waiting_tokens",
"[",
"token",
"]",
"except",
"KeyError",
":",
"raise",
"ValueError",
"(",
"\"Token \"",
"+",
"token",
"+",
"\" isn't wa... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/bundy/socket_cache.py#L218-L246 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiPaneInfo.IsMaximized | (*args, **kwargs) | return _aui.AuiPaneInfo_IsMaximized(*args, **kwargs) | IsMaximized(self) -> bool | IsMaximized(self) -> bool | [
"IsMaximized",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsMaximized(*args, **kwargs):
"""IsMaximized(self) -> bool"""
return _aui.AuiPaneInfo_IsMaximized(*args, **kwargs) | [
"def",
"IsMaximized",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiPaneInfo_IsMaximized",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L297-L299 | |
ot/ds2i | 2cf8237f638f45da0b25caebd2b3c1fbfebf9149 | ext/baker.py | python | Baker.return_cmd_doc | (self, cmd) | return ret | Print the documentation for this command. | Print the documentation for this command. | [
"Print",
"the",
"documentation",
"for",
"this",
"command",
"."
] | def return_cmd_doc(self, cmd):
"""
Print the documentation for this command.
"""
paras = process_docstring(cmd.docstring)
ret = []
if paras:
# Print the first paragraph with no indent (usually just a summary
# line)
for line in format_p... | [
"def",
"return_cmd_doc",
"(",
"self",
",",
"cmd",
")",
":",
"paras",
"=",
"process_docstring",
"(",
"cmd",
".",
"docstring",
")",
"ret",
"=",
"[",
"]",
"if",
"paras",
":",
"# Print the first paragraph with no indent (usually just a summary",
"# line)",
"for",
"lin... | https://github.com/ot/ds2i/blob/2cf8237f638f45da0b25caebd2b3c1fbfebf9149/ext/baker.py#L442-L460 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.SetMargins | (*args, **kwargs) | return _stc.StyledTextCtrl_SetMargins(*args, **kwargs) | SetMargins(self, int left, int right)
Set the left and right margin in the edit area, measured in pixels. | SetMargins(self, int left, int right) | [
"SetMargins",
"(",
"self",
"int",
"left",
"int",
"right",
")"
] | def SetMargins(*args, **kwargs):
"""
SetMargins(self, int left, int right)
Set the left and right margin in the edit area, measured in pixels.
"""
return _stc.StyledTextCtrl_SetMargins(*args, **kwargs) | [
"def",
"SetMargins",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetMargins",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L6589-L6595 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/dead_time_corrections_view.py | python | DeadTimeCorrectionsView.is_dead_time_from_other_file_selected | (self) | return self.dead_time_from_selector.currentText() == DEAD_TIME_OTHER_FILE | Returns true if the dead time should be retrieved from some other file. | Returns true if the dead time should be retrieved from some other file. | [
"Returns",
"true",
"if",
"the",
"dead",
"time",
"should",
"be",
"retrieved",
"from",
"some",
"other",
"file",
"."
] | def is_dead_time_from_other_file_selected(self) -> bool:
"""Returns true if the dead time should be retrieved from some other file."""
return self.dead_time_from_selector.currentText() == DEAD_TIME_OTHER_FILE | [
"def",
"is_dead_time_from_other_file_selected",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"dead_time_from_selector",
".",
"currentText",
"(",
")",
"==",
"DEAD_TIME_OTHER_FILE"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/dead_time_corrections_view.py#L62-L64 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/utils/validation.py | python | _is_arraylike | (x) | return (hasattr(x, '__len__') or
hasattr(x, 'shape') or
hasattr(x, '__array__')) | Returns whether the input is array-like | Returns whether the input is array-like | [
"Returns",
"whether",
"the",
"input",
"is",
"array",
"-",
"like"
] | def _is_arraylike(x):
"""Returns whether the input is array-like"""
return (hasattr(x, '__len__') or
hasattr(x, 'shape') or
hasattr(x, '__array__')) | [
"def",
"_is_arraylike",
"(",
"x",
")",
":",
"return",
"(",
"hasattr",
"(",
"x",
",",
"'__len__'",
")",
"or",
"hasattr",
"(",
"x",
",",
"'shape'",
")",
"or",
"hasattr",
"(",
"x",
",",
"'__array__'",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/utils/validation.py#L129-L133 | |
mapsme/omim | 1892903b63f2c85b16ed4966d21fe76aba06b9ba | tools/python/planet_checks/validate_countries.py | python | find_single_label | (boundary, country_places, used_country_places) | return None | Given the boundary has only one label member, validates the label
and, if it is good, returns corresponding country place. | Given the boundary has only one label member, validates the label
and, if it is good, returns corresponding country place. | [
"Given",
"the",
"boundary",
"has",
"only",
"one",
"label",
"member",
"validates",
"the",
"label",
"and",
"if",
"it",
"is",
"good",
"returns",
"corresponding",
"country",
"place",
"."
] | def find_single_label(boundary, country_places, used_country_places):
"""Given the boundary has only one label member, validates the label
and, if it is good, returns corresponding country place."""
name, nameen = (boundary['tags'][tag] for tag in ('name', 'name:en'))
display_name = nameen or name
e... | [
"def",
"find_single_label",
"(",
"boundary",
",",
"country_places",
",",
"used_country_places",
")",
":",
"name",
",",
"nameen",
"=",
"(",
"boundary",
"[",
"'tags'",
"]",
"[",
"tag",
"]",
"for",
"tag",
"in",
"(",
"'name'",
",",
"'name:en'",
")",
")",
"di... | https://github.com/mapsme/omim/blob/1892903b63f2c85b16ed4966d21fe76aba06b9ba/tools/python/planet_checks/validate_countries.py#L210-L229 | |
apache/mesos | 97d9a4063332aae3825d78de71611657e05cf5e2 | support/cpplint.py | python | IsCppString | (line) | return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1 | Does line terminate so, that the next symbol is in string constant.
This function does not consider single-line nor multi-line comments.
Args:
line: is a partial line of code starting from the 0..n.
Returns:
True, if next character appended to 'line' is inside a
string constant. | Does line terminate so, that the next symbol is in string constant. | [
"Does",
"line",
"terminate",
"so",
"that",
"the",
"next",
"symbol",
"is",
"in",
"string",
"constant",
"."
] | def IsCppString(line):
"""Does line terminate so, that the next symbol is in string constant.
This function does not consider single-line nor multi-line comments.
Args:
line: is a partial line of code starting from the 0..n.
Returns:
True, if next character appended to 'line' is inside a
string c... | [
"def",
"IsCppString",
"(",
"line",
")",
":",
"line",
"=",
"line",
".",
"replace",
"(",
"r'\\\\'",
",",
"'XX'",
")",
"# after this, \\\\\" does not match to \\\"",
"return",
"(",
"(",
"line",
".",
"count",
"(",
"'\"'",
")",
"-",
"line",
".",
"count",
"(",
... | https://github.com/apache/mesos/blob/97d9a4063332aae3825d78de71611657e05cf5e2/support/cpplint.py#L1276-L1290 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/io/excel.py | python | _fill_mi_header | (row, control_row) | return _maybe_convert_to_string(row), control_row | Forward fills blank entries in row, but only inside the same parent index
Used for creating headers in Multiindex.
Parameters
----------
row : list
List of items in a single row.
control_row : list of bool
Helps to determine if particular column is in same parent index as the
... | Forward fills blank entries in row, but only inside the same parent index | [
"Forward",
"fills",
"blank",
"entries",
"in",
"row",
"but",
"only",
"inside",
"the",
"same",
"parent",
"index"
] | def _fill_mi_header(row, control_row):
"""Forward fills blank entries in row, but only inside the same parent index
Used for creating headers in Multiindex.
Parameters
----------
row : list
List of items in a single row.
control_row : list of bool
Helps to determine if particula... | [
"def",
"_fill_mi_header",
"(",
"row",
",",
"control_row",
")",
":",
"last",
"=",
"row",
"[",
"0",
"]",
"for",
"i",
"in",
"range",
"(",
"1",
",",
"len",
"(",
"row",
")",
")",
":",
"if",
"not",
"control_row",
"[",
"i",
"]",
":",
"last",
"=",
"row... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/io/excel.py#L892-L920 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/dataview.py | python | DataViewCtrl.PrependBitmapColumn | (*args, **kwargs) | return _dataview.DataViewCtrl_PrependBitmapColumn(*args, **kwargs) | PrependBitmapColumn(self, PyObject label_or_bitmap, unsigned int model_column,
int mode=DATAVIEW_CELL_INERT, int width=-1,
int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn | PrependBitmapColumn(self, PyObject label_or_bitmap, unsigned int model_column,
int mode=DATAVIEW_CELL_INERT, int width=-1,
int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn | [
"PrependBitmapColumn",
"(",
"self",
"PyObject",
"label_or_bitmap",
"unsigned",
"int",
"model_column",
"int",
"mode",
"=",
"DATAVIEW_CELL_INERT",
"int",
"width",
"=",
"-",
"1",
"int",
"align",
"=",
"ALIGN_CENTER",
"int",
"flags",
"=",
"DATAVIEW_COL_RESIZABLE",
")",
... | def PrependBitmapColumn(*args, **kwargs):
"""
PrependBitmapColumn(self, PyObject label_or_bitmap, unsigned int model_column,
int mode=DATAVIEW_CELL_INERT, int width=-1,
int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
"""
return _datav... | [
"def",
"PrependBitmapColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewCtrl_PrependBitmapColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1631-L1637 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/applications/workbench/workbench/plugins/editor.py | python | MultiFileEditor.execute_async | (self) | return self.editors.execute_async() | Executes _everything_ in currently active code editor.
:return: | Executes _everything_ in currently active code editor.
:return: | [
"Executes",
"_everything_",
"in",
"currently",
"active",
"code",
"editor",
".",
":",
"return",
":"
] | def execute_async(self):
"""
Executes _everything_ in currently active code editor.
:return:
"""
return self.editors.execute_async() | [
"def",
"execute_async",
"(",
"self",
")",
":",
"return",
"self",
".",
"editors",
".",
"execute_async",
"(",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/plugins/editor.py#L75-L80 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_model.py | python | BasicFittingModel.end_xs | (self) | return self.fitting_context.end_xs | Returns all of the end Xs stored by the model. | Returns all of the end Xs stored by the model. | [
"Returns",
"all",
"of",
"the",
"end",
"Xs",
"stored",
"by",
"the",
"model",
"."
] | def end_xs(self) -> list:
"""Returns all of the end Xs stored by the model."""
return self.fitting_context.end_xs | [
"def",
"end_xs",
"(",
"self",
")",
"->",
"list",
":",
"return",
"self",
".",
"fitting_context",
".",
"end_xs"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_model.py#L159-L161 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/cmd.py | python | Cmd.onecmd | (self, line) | Interpret the argument as though it had been typed in response
to the prompt.
This may be overridden, but should not normally need to be;
see the precmd() and postcmd() methods for useful execution hooks.
The return value is a flag indicating whether interpretation of
commands b... | Interpret the argument as though it had been typed in response
to the prompt. | [
"Interpret",
"the",
"argument",
"as",
"though",
"it",
"had",
"been",
"typed",
"in",
"response",
"to",
"the",
"prompt",
"."
] | def onecmd(self, line):
"""Interpret the argument as though it had been typed in response
to the prompt.
This may be overridden, but should not normally need to be;
see the precmd() and postcmd() methods for useful execution hooks.
The return value is a flag indicating whether i... | [
"def",
"onecmd",
"(",
"self",
",",
"line",
")",
":",
"cmd",
",",
"arg",
",",
"line",
"=",
"self",
".",
"parseline",
"(",
"line",
")",
"if",
"not",
"line",
":",
"return",
"self",
".",
"emptyline",
"(",
")",
"if",
"cmd",
"is",
"None",
":",
"return"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/cmd.py#L196-L219 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd_identity.py | python | OperatorPDIdentity.inputs | (self) | return [self._shape] | List of tensors that were provided as initialization inputs. | List of tensors that were provided as initialization inputs. | [
"List",
"of",
"tensors",
"that",
"were",
"provided",
"as",
"initialization",
"inputs",
"."
] | def inputs(self):
"""List of tensors that were provided as initialization inputs."""
return [self._shape] | [
"def",
"inputs",
"(",
"self",
")",
":",
"return",
"[",
"self",
".",
"_shape",
"]"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd_identity.py#L149-L151 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py | python | Context.abs | (self, a) | return a.__abs__(context=self) | Returns the absolute value of the operand.
If the operand is negative, the result is the same as using the minus
operation on the operand. Otherwise, the result is the same as using
the plus operation on the operand.
>>> ExtendedContext.abs(Decimal('2.1'))
Decimal('2.1')
... | Returns the absolute value of the operand. | [
"Returns",
"the",
"absolute",
"value",
"of",
"the",
"operand",
"."
] | def abs(self, a):
"""Returns the absolute value of the operand.
If the operand is negative, the result is the same as using the minus
operation on the operand. Otherwise, the result is the same as using
the plus operation on the operand.
>>> ExtendedContext.abs(Decimal('2.1'))... | [
"def",
"abs",
"(",
"self",
",",
"a",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"__abs__",
"(",
"context",
"=",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py#L4129-L4148 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/distributions/python/ops/operator_pd_identity.py | python | OperatorPDIdentity.name | (self) | return self._name | String name identifying this `Operator`. | String name identifying this `Operator`. | [
"String",
"name",
"identifying",
"this",
"Operator",
"."
] | def name(self):
"""String name identifying this `Operator`."""
return self._name | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_name"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/distributions/python/ops/operator_pd_identity.py#L124-L126 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/period.py | python | validate_dtype_freq | (dtype, freq) | return freq | If both a dtype and a freq are available, ensure they match. If only
dtype is available, extract the implied freq.
Parameters
----------
dtype : dtype
freq : DateOffset or None
Returns
-------
freq : DateOffset
Raises
------
ValueError : non-period dtype
IncompatibleF... | If both a dtype and a freq are available, ensure they match. If only
dtype is available, extract the implied freq. | [
"If",
"both",
"a",
"dtype",
"and",
"a",
"freq",
"are",
"available",
"ensure",
"they",
"match",
".",
"If",
"only",
"dtype",
"is",
"available",
"extract",
"the",
"implied",
"freq",
"."
] | def validate_dtype_freq(dtype, freq):
"""
If both a dtype and a freq are available, ensure they match. If only
dtype is available, extract the implied freq.
Parameters
----------
dtype : dtype
freq : DateOffset or None
Returns
-------
freq : DateOffset
Raises
------
... | [
"def",
"validate_dtype_freq",
"(",
"dtype",
",",
"freq",
")",
":",
"if",
"freq",
"is",
"not",
"None",
":",
"freq",
"=",
"frequencies",
".",
"to_offset",
"(",
"freq",
")",
"if",
"dtype",
"is",
"not",
"None",
":",
"dtype",
"=",
"pandas_dtype",
"(",
"dtyp... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/period.py#L876-L906 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/special/orthogonal.py | python | _initial_nodes | (n) | return iv | Initial guesses for the Hermite roots
Computes an initial approximation to the non-negative
roots :math:`x_k` of the Hermite polynomial :math:`H_n`
of order :math:`n`. The Tricomi and Gatteschi initial
guesses are used in the region where they are accurate.
Parameters
----------
n : int
... | Initial guesses for the Hermite roots | [
"Initial",
"guesses",
"for",
"the",
"Hermite",
"roots"
] | def _initial_nodes(n):
"""Initial guesses for the Hermite roots
Computes an initial approximation to the non-negative
roots :math:`x_k` of the Hermite polynomial :math:`H_n`
of order :math:`n`. The Tricomi and Gatteschi initial
guesses are used in the region where they are accurate.
Parameters... | [
"def",
"_initial_nodes",
"(",
"n",
")",
":",
"# Turnover point",
"# linear polynomial fit to error of 10, 25, 40, ..., 1000 point rules",
"fit",
"=",
"0.49082003",
"*",
"n",
"-",
"4.37859653",
"turnover",
"=",
"around",
"(",
"fit",
")",
".",
"astype",
"(",
"int",
")... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/special/orthogonal.py#L827-L863 | |
verilog-to-routing/vtr-verilog-to-routing | d9719cf7374821156c3cee31d66991cb85578562 | vtr_flow/scripts/upgrade_arch.py | python | upgrade_connection_block_input_switch | (arch) | return modified | Convert connection block input switch specification to use a switch named
in <switchlist> | Convert connection block input switch specification to use a switch named
in <switchlist> | [
"Convert",
"connection",
"block",
"input",
"switch",
"specification",
"to",
"use",
"a",
"switch",
"named",
"in",
"<switchlist",
">"
] | def upgrade_connection_block_input_switch(arch):
"""
Convert connection block input switch specification to use a switch named
in <switchlist>
"""
modified = False
device_tag = arch.find("./device")
timing_tag = device_tag.find("./timing")
sizing_tag = device_tag.find("./sizing")
sw... | [
"def",
"upgrade_connection_block_input_switch",
"(",
"arch",
")",
":",
"modified",
"=",
"False",
"device_tag",
"=",
"arch",
".",
"find",
"(",
"\"./device\"",
")",
"timing_tag",
"=",
"device_tag",
".",
"find",
"(",
"\"./timing\"",
")",
"sizing_tag",
"=",
"device_... | https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/upgrade_arch.py#L660-L732 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/sets_impl.py | python | set_intersection | (a, b, validate_indices=True) | return _set_operation(a, b, "intersection", validate_indices) | Compute set intersection of elements in last dimension of `a` and `b`.
All but the last dimension of `a` and `b` must match.
Example:
```python
import tensorflow as tf
import collections
# Represent the following array of sets as a sparse tensor:
# a = np.array([[{1, 2}, {3}], [{4}, {5, 6}]])
... | Compute set intersection of elements in last dimension of `a` and `b`. | [
"Compute",
"set",
"intersection",
"of",
"elements",
"in",
"last",
"dimension",
"of",
"a",
"and",
"b",
"."
] | def set_intersection(a, b, validate_indices=True):
"""Compute set intersection of elements in last dimension of `a` and `b`.
All but the last dimension of `a` and `b` must match.
Example:
```python
import tensorflow as tf
import collections
# Represent the following array of sets as a sparse ten... | [
"def",
"set_intersection",
"(",
"a",
",",
"b",
",",
"validate_indices",
"=",
"True",
")",
":",
"a",
",",
"b",
",",
"_",
"=",
"_convert_to_tensors_or_sparse_tensors",
"(",
"a",
",",
"b",
")",
"return",
"_set_operation",
"(",
"a",
",",
"b",
",",
"\"interse... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/sets_impl.py#L139-L204 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/layers/python/layers/summaries.py | python | summarize_collection | (collection, name_filter=None,
summarizer=summarize_tensor) | return summarize_tensors(tensors, summarizer) | Summarize a graph collection of tensors, possibly filtered by name. | Summarize a graph collection of tensors, possibly filtered by name. | [
"Summarize",
"a",
"graph",
"collection",
"of",
"tensors",
"possibly",
"filtered",
"by",
"name",
"."
] | def summarize_collection(collection, name_filter=None,
summarizer=summarize_tensor):
"""Summarize a graph collection of tensors, possibly filtered by name."""
tensors = []
for op in ops.get_collection(collection):
if name_filter is None or re.match(name_filter, op.op.name):
tens... | [
"def",
"summarize_collection",
"(",
"collection",
",",
"name_filter",
"=",
"None",
",",
"summarizer",
"=",
"summarize_tensor",
")",
":",
"tensors",
"=",
"[",
"]",
"for",
"op",
"in",
"ops",
".",
"get_collection",
"(",
"collection",
")",
":",
"if",
"name_filte... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/layers/python/layers/summaries.py#L155-L162 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/mixed_precision/loss_scale.py | python | get | (identifier) | Get a loss scale object. | Get a loss scale object. | [
"Get",
"a",
"loss",
"scale",
"object",
"."
] | def get(identifier):
"""Get a loss scale object."""
if isinstance(identifier, dict):
return deserialize(identifier)
if isinstance(identifier, (int, float)):
return loss_scale_module.FixedLossScale(identifier)
if identifier == 'dynamic':
return loss_scale_module.DynamicLossScale()
if isinstance(id... | [
"def",
"get",
"(",
"identifier",
")",
":",
"if",
"isinstance",
"(",
"identifier",
",",
"dict",
")",
":",
"return",
"deserialize",
"(",
"identifier",
")",
"if",
"isinstance",
"(",
"identifier",
",",
"(",
"int",
",",
"float",
")",
")",
":",
"return",
"lo... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/mixed_precision/loss_scale.py#L43-L58 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | cmake/developer_package/cpplint/cpplint.py | python | NestingState.InClassDeclaration | (self) | return self.stack and isinstance(self.stack[-1], _ClassInfo) | Check if we are currently one level inside a class or struct declaration.
Returns:
True if top of the stack is a class/struct, False otherwise. | Check if we are currently one level inside a class or struct declaration. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"a",
"class",
"or",
"struct",
"declaration",
"."
] | def InClassDeclaration(self):
"""Check if we are currently one level inside a class or struct declaration.
Returns:
True if top of the stack is a class/struct, False otherwise.
"""
return self.stack and isinstance(self.stack[-1], _ClassInfo) | [
"def",
"InClassDeclaration",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"isinstance",
"(",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
",",
"_ClassInfo",
")"
] | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/cmake/developer_package/cpplint/cpplint.py#L2689-L2695 | |
plaidml/plaidml | f3c6681db21460e5fdc11ae651d6d7b6c27f8262 | plaidml/edsl/__init__.py | python | reshape | (x, dims) | return intrinsic('reshape', x, *dims) | Takes a tensor ``x`` and reshapes it according to ``dims``.
Args:
x (Tensor): The tensor to reshape.
dims (list): The desired shape of the tensor.
Returns:
Tensor: The reshaped tensor. | Takes a tensor ``x`` and reshapes it according to ``dims``. | [
"Takes",
"a",
"tensor",
"x",
"and",
"reshapes",
"it",
"according",
"to",
"dims",
"."
] | def reshape(x, dims):
"""Takes a tensor ``x`` and reshapes it according to ``dims``.
Args:
x (Tensor): The tensor to reshape.
dims (list): The desired shape of the tensor.
Returns:
Tensor: The reshaped tensor.
"""
return intrinsic('reshape', x, *dims) | [
"def",
"reshape",
"(",
"x",
",",
"dims",
")",
":",
"return",
"intrinsic",
"(",
"'reshape'",
",",
"x",
",",
"*",
"dims",
")"
] | https://github.com/plaidml/plaidml/blob/f3c6681db21460e5fdc11ae651d6d7b6c27f8262/plaidml/edsl/__init__.py#L1019-L1029 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | external/tools/build/v2/build/generators.py | python | __viable_source_types_real | (target_type) | return result | Returns a list of source type which can possibly be converted
to 'target_type' by some chain of generator invocation.
More formally, takes all generators for 'target_type' and
returns union of source types for those generators and result
of calling itself recusrively on source t... | Returns a list of source type which can possibly be converted
to 'target_type' by some chain of generator invocation.
More formally, takes all generators for 'target_type' and
returns union of source types for those generators and result
of calling itself recusrively on source t... | [
"Returns",
"a",
"list",
"of",
"source",
"type",
"which",
"can",
"possibly",
"be",
"converted",
"to",
"target_type",
"by",
"some",
"chain",
"of",
"generator",
"invocation",
".",
"More",
"formally",
"takes",
"all",
"generators",
"for",
"target_type",
"and",
"ret... | def __viable_source_types_real (target_type):
""" Returns a list of source type which can possibly be converted
to 'target_type' by some chain of generator invocation.
More formally, takes all generators for 'target_type' and
returns union of source types for those generators and re... | [
"def",
"__viable_source_types_real",
"(",
"target_type",
")",
":",
"generators",
"=",
"[",
"]",
"# 't0' is the initial list of target types we need to process to get a list",
"# of their viable source target types. New target types will not be added to",
"# this list. ",
"t0",
"=... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/generators.py#L697-L754 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Tools/ccroot.py | python | link_task.add_target | (self, target) | Process the *target* attribute to add the platform-specific prefix/suffix such as *.so* or *.exe*.
The settings are retrieved from ``env.clsname_PATTERN`` | Process the *target* attribute to add the platform-specific prefix/suffix such as *.so* or *.exe*.
The settings are retrieved from ``env.clsname_PATTERN`` | [
"Process",
"the",
"*",
"target",
"*",
"attribute",
"to",
"add",
"the",
"platform",
"-",
"specific",
"prefix",
"/",
"suffix",
"such",
"as",
"*",
".",
"so",
"*",
"or",
"*",
".",
"exe",
"*",
".",
"The",
"settings",
"are",
"retrieved",
"from",
"env",
"."... | def add_target(self, target):
"""
Process the *target* attribute to add the platform-specific prefix/suffix such as *.so* or *.exe*.
The settings are retrieved from ``env.clsname_PATTERN``
"""
if isinstance(target, str):
pattern = self.env[self.__class__.__name__ + '_PATTERN']
if not pattern:
patter... | [
"def",
"add_target",
"(",
"self",
",",
"target",
")",
":",
"if",
"isinstance",
"(",
"target",
",",
"str",
")",
":",
"pattern",
"=",
"self",
".",
"env",
"[",
"self",
".",
"__class__",
".",
"__name__",
"+",
"'_PATTERN'",
"]",
"if",
"not",
"pattern",
":... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/ccroot.py#L178-L200 | ||
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/xcode_emulation.py | python | XcodeSettings.GetExtraPlistItems | (self, configname=None) | return items | Returns a dictionary with extra items to insert into Info.plist. | Returns a dictionary with extra items to insert into Info.plist. | [
"Returns",
"a",
"dictionary",
"with",
"extra",
"items",
"to",
"insert",
"into",
"Info",
".",
"plist",
"."
] | def GetExtraPlistItems(self, configname=None):
"""Returns a dictionary with extra items to insert into Info.plist."""
if configname not in XcodeSettings._plist_cache:
cache = {}
cache['BuildMachineOSBuild'] = self._BuildMachineOSBuild()
xcode, xcode_build = XcodeVersion()
cache['DTXcode... | [
"def",
"GetExtraPlistItems",
"(",
"self",
",",
"configname",
"=",
"None",
")",
":",
"if",
"configname",
"not",
"in",
"XcodeSettings",
".",
"_plist_cache",
":",
"cache",
"=",
"{",
"}",
"cache",
"[",
"'BuildMachineOSBuild'",
"]",
"=",
"self",
".",
"_BuildMachi... | 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/xcode_emulation.py#L1068-L1103 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_print.py | python | EdPrinter.CreatePrintout | (self) | return printout | Creates a printout of the current stc window
@return: a printout object | Creates a printout of the current stc window
@return: a printout object | [
"Creates",
"a",
"printout",
"of",
"the",
"current",
"stc",
"window",
"@return",
":",
"a",
"printout",
"object"
] | def CreatePrintout(self):
"""Creates a printout of the current stc window
@return: a printout object
"""
colour = COLOURMODES[self.print_mode]
dlg_data = wx.PageSetupDialogData(self.print_data)
dlg_data.SetPrintData(self.print_data)
dlg_data.SetMarginTopLeft(self... | [
"def",
"CreatePrintout",
"(",
"self",
")",
":",
"colour",
"=",
"COLOURMODES",
"[",
"self",
".",
"print_mode",
"]",
"dlg_data",
"=",
"wx",
".",
"PageSetupDialogData",
"(",
"self",
".",
"print_data",
")",
"dlg_data",
".",
"SetPrintData",
"(",
"self",
".",
"p... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_print.py#L66-L80 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/Composite/Composite.py | python | Composite.SetInputOrder | (self, colNames) | sets the input order
**Arguments**
- colNames: a list of the names of the data columns that will be passed in
**Note**
- you must call _SetDescriptorNames()_ first for this to work
- if the local descriptor names do not appear in _colNames_, this will
raise an _IndexEr... | sets the input order | [
"sets",
"the",
"input",
"order"
] | def SetInputOrder(self, colNames):
""" sets the input order
**Arguments**
- colNames: a list of the names of the data columns that will be passed in
**Note**
- you must call _SetDescriptorNames()_ first for this to work
- if the local descriptor names do not appear in _colNa... | [
"def",
"SetInputOrder",
"(",
"self",
",",
"colNames",
")",
":",
"if",
"type",
"(",
"colNames",
")",
"!=",
"list",
":",
"colNames",
"=",
"list",
"(",
"colNames",
")",
"descs",
"=",
"[",
"x",
".",
"upper",
"(",
")",
"for",
"x",
"in",
"self",
".",
"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Composite/Composite.py#L366-L406 | ||
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/__init__.py | python | unary_stream_rpc_method_handler | (behavior,
request_deserializer=None,
response_serializer=None) | return _utilities.RpcMethodHandler(False, True, request_deserializer,
response_serializer, None, behavior,
None, None) | Creates an RpcMethodHandler for a unary-stream RPC method.
Args:
behavior: The implementation of an RPC that accepts one request
and returns an iterator of response values.
request_deserializer: An optional :term:`deserializer` for request deserialization.
response_serializer: An optional... | Creates an RpcMethodHandler for a unary-stream RPC method. | [
"Creates",
"an",
"RpcMethodHandler",
"for",
"a",
"unary",
"-",
"stream",
"RPC",
"method",
"."
] | def unary_stream_rpc_method_handler(behavior,
request_deserializer=None,
response_serializer=None):
"""Creates an RpcMethodHandler for a unary-stream RPC method.
Args:
behavior: The implementation of an RPC that accepts one request
... | [
"def",
"unary_stream_rpc_method_handler",
"(",
"behavior",
",",
"request_deserializer",
"=",
"None",
",",
"response_serializer",
"=",
"None",
")",
":",
"from",
"grpc",
"import",
"_utilities",
"# pylint: disable=cyclic-import",
"return",
"_utilities",
".",
"RpcMethodHandle... | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/__init__.py#L1530-L1547 | |
openai/triton | 7b48340ffddd7d2624b0330b219eb05b673c086b | python/triton/language/core.py | python | cat | (input, other, _builder=None) | return frontend.cat(input, other, _builder) | Concatenate the given blocks
:param input: The first input block.
:type input:
:param other: The second input block.
:type other: | Concatenate the given blocks | [
"Concatenate",
"the",
"given",
"blocks"
] | def cat(input, other, _builder=None):
"""
Concatenate the given blocks
:param input: The first input block.
:type input:
:param other: The second input block.
:type other:
"""
return frontend.cat(input, other, _builder) | [
"def",
"cat",
"(",
"input",
",",
"other",
",",
"_builder",
"=",
"None",
")",
":",
"return",
"frontend",
".",
"cat",
"(",
"input",
",",
"other",
",",
"_builder",
")"
] | https://github.com/openai/triton/blob/7b48340ffddd7d2624b0330b219eb05b673c086b/python/triton/language/core.py#L506-L515 | |
geemaple/leetcode | 68bc5032e1ee52c22ef2f2e608053484c487af54 | leetcode/246.strobogrammatic-number.py | python | Solution.isStrobogrammatic | (self, num) | return True | :type num: str
:rtype: bool | :type num: str
:rtype: bool | [
":",
"type",
"num",
":",
"str",
":",
"rtype",
":",
"bool"
] | def isStrobogrammatic(self, num):
"""
:type num: str
:rtype: bool
"""
if num is None or len(num) == 0:
return True
mirror_mapping = {'1': '1', '6': '9', '8': '8', '9': '6', '0': '0'}
left = 0
right = len(num) - 1
while(left <= right)... | [
"def",
"isStrobogrammatic",
"(",
"self",
",",
"num",
")",
":",
"if",
"num",
"is",
"None",
"or",
"len",
"(",
"num",
")",
"==",
"0",
":",
"return",
"True",
"mirror_mapping",
"=",
"{",
"'1'",
":",
"'1'",
",",
"'6'",
":",
"'9'",
",",
"'8'",
":",
"'8'... | https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/246.strobogrammatic-number.py#L2-L22 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/head.py | python | TimeSeriesRegressionHead.create_estimator_spec | (self, features, mode, labels=None) | Performs basic error checking and returns an EstimatorSpec. | Performs basic error checking and returns an EstimatorSpec. | [
"Performs",
"basic",
"error",
"checking",
"and",
"returns",
"an",
"EstimatorSpec",
"."
] | def create_estimator_spec(self, features, mode, labels=None):
"""Performs basic error checking and returns an EstimatorSpec."""
with ops.name_scope(self._name, "head"):
if labels is not None and labels != {}: # for better error messages.
raise ValueError(
"The model received a `labels... | [
"def",
"create_estimator_spec",
"(",
"self",
",",
"features",
",",
"mode",
",",
"labels",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"self",
".",
"_name",
",",
"\"head\"",
")",
":",
"if",
"labels",
"is",
"not",
"None",
"and",
"labels... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/head.py#L232-L277 | ||
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | ctpx/ctp3/ctptd.py | python | CtpTd.onRspQryProduct | (self, ProductField, RspInfoField, requestId, final) | 请求查询产品响应 | 请求查询产品响应 | [
"请求查询产品响应"
] | def onRspQryProduct(self, ProductField, RspInfoField, requestId, final):
"""请求查询产品响应"""
pass | [
"def",
"onRspQryProduct",
"(",
"self",
",",
"ProductField",
",",
"RspInfoField",
",",
"requestId",
",",
"final",
")",
":",
"pass"
] | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/ctpx/ctp3/ctptd.py#L229-L231 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | parserCtxt.ctxtResetPush | (self, chunk, size, filename, encoding) | return ret | Reset a push parser context | Reset a push parser context | [
"Reset",
"a",
"push",
"parser",
"context"
] | def ctxtResetPush(self, chunk, size, filename, encoding):
"""Reset a push parser context """
ret = libxml2mod.xmlCtxtResetPush(self._o, chunk, size, filename, encoding)
return ret | [
"def",
"ctxtResetPush",
"(",
"self",
",",
"chunk",
",",
"size",
",",
"filename",
",",
"encoding",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlCtxtResetPush",
"(",
"self",
".",
"_o",
",",
"chunk",
",",
"size",
",",
"filename",
",",
"encoding",
")",
"re... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L5080-L5083 | |
Manu343726/siplasplas | 9fae7559f87087cf8ef34f04bd1e774b84b2ea9c | reference/cindex.py | python | Token.cursor | (self) | return cursor | The Cursor this Token corresponds to. | The Cursor this Token corresponds to. | [
"The",
"Cursor",
"this",
"Token",
"corresponds",
"to",
"."
] | def cursor(self):
"""The Cursor this Token corresponds to."""
cursor = Cursor()
conf.lib.clang_annotateTokens(self._tu, byref(self), 1, byref(cursor))
return cursor | [
"def",
"cursor",
"(",
"self",
")",
":",
"cursor",
"=",
"Cursor",
"(",
")",
"conf",
".",
"lib",
".",
"clang_annotateTokens",
"(",
"self",
".",
"_tu",
",",
"byref",
"(",
"self",
")",
",",
"1",
",",
"byref",
"(",
"cursor",
")",
")",
"return",
"cursor"... | https://github.com/Manu343726/siplasplas/blob/9fae7559f87087cf8ef34f04bd1e774b84b2ea9c/reference/cindex.py#L2858-L2864 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Tools/iobench/iobench.py | python | modify_seek_forward_blockwise | (f, source) | alternate write & seek 1000 units | alternate write & seek 1000 units | [
"alternate",
"write",
"&",
"seek",
"1000",
"units"
] | def modify_seek_forward_blockwise(f, source):
""" alternate write & seek 1000 units """
f.seek(0)
for i in xrange(0, len(source), 2000):
f.write(source[i:i+1000])
f.seek(i+2000) | [
"def",
"modify_seek_forward_blockwise",
"(",
"f",
",",
"source",
")",
":",
"f",
".",
"seek",
"(",
"0",
")",
"for",
"i",
"in",
"xrange",
"(",
"0",
",",
"len",
"(",
"source",
")",
",",
"2000",
")",
":",
"f",
".",
"write",
"(",
"source",
"[",
"i",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Tools/iobench/iobench.py#L199-L204 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/smtplib.py | python | SMTP.putcmd | (self, cmd, args="") | Send a command to the server. | Send a command to the server. | [
"Send",
"a",
"command",
"to",
"the",
"server",
"."
] | def putcmd(self, cmd, args=""):
"""Send a command to the server."""
if args == "":
s = cmd
else:
s = f'{cmd} {args}'
if '\r' in s or '\n' in s:
s = s.replace('\n', '\\n').replace('\r', '\\r')
raise ValueError(
f'command and ... | [
"def",
"putcmd",
"(",
"self",
",",
"cmd",
",",
"args",
"=",
"\"\"",
")",
":",
"if",
"args",
"==",
"\"\"",
":",
"s",
"=",
"cmd",
"else",
":",
"s",
"=",
"f'{cmd} {args}'",
"if",
"'\\r'",
"in",
"s",
"or",
"'\\n'",
"in",
"s",
":",
"s",
"=",
"s",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/smtplib.py#L367-L378 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/pgen2/driver.py | python | load_grammar | (gt="Grammar.txt", gp=None,
save=True, force=False, logger=None) | return g | Load the grammar (maybe from a pickle). | Load the grammar (maybe from a pickle). | [
"Load",
"the",
"grammar",
"(",
"maybe",
"from",
"a",
"pickle",
")",
"."
] | def load_grammar(gt="Grammar.txt", gp=None,
save=True, force=False, logger=None):
"""Load the grammar (maybe from a pickle)."""
if logger is None:
logger = logging.getLogger()
if gp is None:
head, tail = os.path.splitext(gt)
if tail == ".txt":
tail = ""
... | [
"def",
"load_grammar",
"(",
"gt",
"=",
"\"Grammar.txt\"",
",",
"gp",
"=",
"None",
",",
"save",
"=",
"True",
",",
"force",
"=",
"False",
",",
"logger",
"=",
"None",
")",
":",
"if",
"logger",
"is",
"None",
":",
"logger",
"=",
"logging",
".",
"getLogger... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/pgen2/driver.py#L109-L131 | |
wenwei202/caffe | f54a74abaf6951d8485cbdcfa1d74a4c37839466 | scripts/cpp_lint.py | python | _VerboseLevel | () | return _cpplint_state.verbose_level | Returns the module's verbosity setting. | Returns the module's verbosity setting. | [
"Returns",
"the",
"module",
"s",
"verbosity",
"setting",
"."
] | def _VerboseLevel():
"""Returns the module's verbosity setting."""
return _cpplint_state.verbose_level | [
"def",
"_VerboseLevel",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"verbose_level"
] | https://github.com/wenwei202/caffe/blob/f54a74abaf6951d8485cbdcfa1d74a4c37839466/scripts/cpp_lint.py#L777-L779 | |
yue/yue | 619d62c191b13c51c01be451dc48917c34a5aefc | building/tools/cpplint.py | python | ProcessFileData | (filename, file_extension, lines, error,
extra_check_functions=[]) | Performs lint checks and reports any errors to the given error function.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
lines: An array of strings, each representing a line of the file, with the
last element being emp... | Performs lint checks and reports any errors to the given error function. | [
"Performs",
"lint",
"checks",
"and",
"reports",
"any",
"errors",
"to",
"the",
"given",
"error",
"function",
"."
] | def ProcessFileData(filename, file_extension, lines, error,
extra_check_functions=[]):
"""Performs lint checks and reports any errors to the given error function.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
... | [
"def",
"ProcessFileData",
"(",
"filename",
",",
"file_extension",
",",
"lines",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"lines",
"=",
"(",
"[",
"'// marker so line numbers and indices both start at 1'",
"]",
"+",
"lines",
"+",
"[",
"... | https://github.com/yue/yue/blob/619d62c191b13c51c01be451dc48917c34a5aefc/building/tools/cpplint.py#L5879-L5928 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Window.SetForegroundColour | (*args, **kwargs) | return _core_.Window_SetForegroundColour(*args, **kwargs) | SetForegroundColour(self, Colour colour) -> bool
Sets the foreground colour of the window. Returns True is the colour
was changed. The interpretation of foreground colour is dependent on
the window class; it may be the text colour or other colour, or it may
not be used at all. | SetForegroundColour(self, Colour colour) -> bool | [
"SetForegroundColour",
"(",
"self",
"Colour",
"colour",
")",
"-",
">",
"bool"
] | def SetForegroundColour(*args, **kwargs):
"""
SetForegroundColour(self, Colour colour) -> bool
Sets the foreground colour of the window. Returns True is the colour
was changed. The interpretation of foreground colour is dependent on
the window class; it may be the text colour ... | [
"def",
"SetForegroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_SetForegroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L10869-L10878 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/display.py | python | display_javascript | (*objs, **kwargs) | Display the Javascript representation of an object.
Parameters
----------
*objs : object
The Python objects to display, or if raw=True raw javascript data to
display.
raw : bool
Are the data objects raw data or Python objects that need to be
formatted before display? [de... | Display the Javascript representation of an object. | [
"Display",
"the",
"Javascript",
"representation",
"of",
"an",
"object",
"."
] | def display_javascript(*objs, **kwargs):
"""Display the Javascript representation of an object.
Parameters
----------
*objs : object
The Python objects to display, or if raw=True raw javascript data to
display.
raw : bool
Are the data objects raw data or Python objects that ... | [
"def",
"display_javascript",
"(",
"*",
"objs",
",",
"*",
"*",
"kwargs",
")",
":",
"_display_mimetype",
"(",
"'application/javascript'",
",",
"objs",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/display.py#L545-L559 | ||
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | QuantifierRef.__getitem__ | (self, arg) | return _array_select(self, arg) | Return the Z3 expression `self[arg]`. | Return the Z3 expression `self[arg]`. | [
"Return",
"the",
"Z3",
"expression",
"self",
"[",
"arg",
"]",
"."
] | def __getitem__(self, arg):
"""Return the Z3 expression `self[arg]`.
"""
if z3_debug():
_z3_assert(self.is_lambda(), "quantifier should be a lambda expression")
return _array_select(self, arg) | [
"def",
"__getitem__",
"(",
"self",
",",
"arg",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"self",
".",
"is_lambda",
"(",
")",
",",
"\"quantifier should be a lambda expression\"",
")",
"return",
"_array_select",
"(",
"self",
",",
"arg",
")"... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L2013-L2018 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | TimeSpan.__sub__ | (*args, **kwargs) | return _misc_.TimeSpan___sub__(*args, **kwargs) | __sub__(self, TimeSpan other) -> TimeSpan | __sub__(self, TimeSpan other) -> TimeSpan | [
"__sub__",
"(",
"self",
"TimeSpan",
"other",
")",
"-",
">",
"TimeSpan"
] | def __sub__(*args, **kwargs):
"""__sub__(self, TimeSpan other) -> TimeSpan"""
return _misc_.TimeSpan___sub__(*args, **kwargs) | [
"def",
"__sub__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"TimeSpan___sub__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L4454-L4456 | |
linyouhappy/kongkongxiyou | 7a69b2913eb29f4be77f9a62fb90cdd72c4160f1 | cocosjs/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | TokenKind.register | (value, name) | Register a new TokenKind enumeration.
This should only be called at module load time by code within this
package. | Register a new TokenKind enumeration. | [
"Register",
"a",
"new",
"TokenKind",
"enumeration",
"."
] | def register(value, name):
"""Register a new TokenKind enumeration.
This should only be called at module load time by code within this
package.
"""
if value in TokenKind._value_map:
raise ValueError('TokenKind already registered: %d' % value)
kind = TokenKin... | [
"def",
"register",
"(",
"value",
",",
"name",
")",
":",
"if",
"value",
"in",
"TokenKind",
".",
"_value_map",
":",
"raise",
"ValueError",
"(",
"'TokenKind already registered: %d'",
"%",
"value",
")",
"kind",
"=",
"TokenKind",
"(",
"value",
",",
"name",
")",
... | https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L462-L473 | ||
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM2_GetCapability_REQUEST.fromTpm | (buf) | return buf.createObj(TPM2_GetCapability_REQUEST) | Returns new TPM2_GetCapability_REQUEST object constructed from its
marshaled representation in the given TpmBuffer buffer | Returns new TPM2_GetCapability_REQUEST object constructed from its
marshaled representation in the given TpmBuffer buffer | [
"Returns",
"new",
"TPM2_GetCapability_REQUEST",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"TpmBuffer",
"buffer"
] | def fromTpm(buf):
""" Returns new TPM2_GetCapability_REQUEST object constructed from its
marshaled representation in the given TpmBuffer buffer
"""
return buf.createObj(TPM2_GetCapability_REQUEST) | [
"def",
"fromTpm",
"(",
"buf",
")",
":",
"return",
"buf",
".",
"createObj",
"(",
"TPM2_GetCapability_REQUEST",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L16453-L16457 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pdfviewer/dcgraphics.py | python | dcGraphicsState.__init__ | (self) | Creates an instance with default values | Creates an instance with default values | [
"Creates",
"an",
"instance",
"with",
"default",
"values"
] | def __init__ (self):
""" Creates an instance with default values """
self.Yoffset = 0.0
self.Xtrans = 0.0
self.Ytrans = 0.0
self.Xscale = 1.0
self.Yscale = 1.0
self.sinA = 0.0
self.cosA = 1.0
self.tanAlpha = 0.0
self.tanBeta = 0.0
s... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"Yoffset",
"=",
"0.0",
"self",
".",
"Xtrans",
"=",
"0.0",
"self",
".",
"Ytrans",
"=",
"0.0",
"self",
".",
"Xscale",
"=",
"1.0",
"self",
".",
"Yscale",
"=",
"1.0",
"self",
".",
"sinA",
"=",
"0... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pdfviewer/dcgraphics.py#L43-L54 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/ir_utils.py | python | replace_returns | (blocks, target, return_label) | Return return statement by assigning directly to target, and a jump. | Return return statement by assigning directly to target, and a jump. | [
"Return",
"return",
"statement",
"by",
"assigning",
"directly",
"to",
"target",
"and",
"a",
"jump",
"."
] | def replace_returns(blocks, target, return_label):
"""
Return return statement by assigning directly to target, and a jump.
"""
for block in blocks.values():
casts = []
for i, stmt in enumerate(block.body):
if isinstance(stmt, ir.Return):
assert(i + 1 == len(b... | [
"def",
"replace_returns",
"(",
"blocks",
",",
"target",
",",
"return_label",
")",
":",
"for",
"block",
"in",
"blocks",
".",
"values",
"(",
")",
":",
"casts",
"=",
"[",
"]",
"for",
"i",
",",
"stmt",
"in",
"enumerate",
"(",
"block",
".",
"body",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/ir_utils.py#L1703-L1719 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/training/python/training/device_setter.py | python | RandomStrategy.__call__ | (self, op) | return int(n % self._num_tasks) | Chooses a ps task index for the given `Operation`. | Chooses a ps task index for the given `Operation`. | [
"Chooses",
"a",
"ps",
"task",
"index",
"for",
"the",
"given",
"Operation",
"."
] | def __call__(self, op):
"""Chooses a ps task index for the given `Operation`."""
key = "%s_%d" % (op.name, self._seed)
key = key.encode("utf-8")
# Use MD5 instead of Python's built-in hash() to get consistent outputs
# between runs.
n = int(hashlib.md5(key).hexdigest(), 16)
return int(n % se... | [
"def",
"__call__",
"(",
"self",
",",
"op",
")",
":",
"key",
"=",
"\"%s_%d\"",
"%",
"(",
"op",
".",
"name",
",",
"self",
".",
"_seed",
")",
"key",
"=",
"key",
".",
"encode",
"(",
"\"utf-8\"",
")",
"# Use MD5 instead of Python's built-in hash() to get consiste... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/training/python/training/device_setter.py#L46-L53 | |
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | mp/src/thirdparty/protobuf-2.3.0/python/stubout.py | python | StubOutForTesting.Set | (self, parent, child_name, new_child) | Replace child_name's old definition with new_child, in the context
of the given parent. The parent could be a module when the child is a
function at module scope. Or the parent could be a class when a class'
method is being replaced. The named child is set to new_child, while
the prior definition is ... | Replace child_name's old definition with new_child, in the context
of the given parent. The parent could be a module when the child is a
function at module scope. Or the parent could be a class when a class'
method is being replaced. The named child is set to new_child, while
the prior definition is ... | [
"Replace",
"child_name",
"s",
"old",
"definition",
"with",
"new_child",
"in",
"the",
"context",
"of",
"the",
"given",
"parent",
".",
"The",
"parent",
"could",
"be",
"a",
"module",
"when",
"the",
"child",
"is",
"a",
"function",
"at",
"module",
"scope",
".",... | def Set(self, parent, child_name, new_child):
"""Replace child_name's old definition with new_child, in the context
of the given parent. The parent could be a module when the child is a
function at module scope. Or the parent could be a class when a class'
method is being replaced. The named child is... | [
"def",
"Set",
"(",
"self",
",",
"parent",
",",
"child_name",
",",
"new_child",
")",
":",
"old_child",
"=",
"getattr",
"(",
"parent",
",",
"child_name",
")",
"old_attribute",
"=",
"parent",
".",
"__dict__",
".",
"get",
"(",
"child_name",
")",
"if",
"old_a... | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/stubout.py#L109-L126 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/inspector_protocol/jinja2/compiler.py | python | CodeGenerator.return_buffer_contents | (self, frame, force_unescaped=False) | Return the buffer contents of the frame. | Return the buffer contents of the frame. | [
"Return",
"the",
"buffer",
"contents",
"of",
"the",
"frame",
"."
] | def return_buffer_contents(self, frame, force_unescaped=False):
"""Return the buffer contents of the frame."""
if not force_unescaped:
if frame.eval_ctx.volatile:
self.writeline('if context.eval_ctx.autoescape:')
self.indent()
self.writeline('r... | [
"def",
"return_buffer_contents",
"(",
"self",
",",
"frame",
",",
"force_unescaped",
"=",
"False",
")",
":",
"if",
"not",
"force_unescaped",
":",
"if",
"frame",
".",
"eval_ctx",
".",
"volatile",
":",
"self",
".",
"writeline",
"(",
"'if context.eval_ctx.autoescape... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/compiler.py#L327-L343 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/xrc.py | python | XmlNode.GetDepth | (*args, **kwargs) | return _xrc.XmlNode_GetDepth(*args, **kwargs) | GetDepth(self, XmlNode grandparent=None) -> int | GetDepth(self, XmlNode grandparent=None) -> int | [
"GetDepth",
"(",
"self",
"XmlNode",
"grandparent",
"=",
"None",
")",
"-",
">",
"int"
] | def GetDepth(*args, **kwargs):
"""GetDepth(self, XmlNode grandparent=None) -> int"""
return _xrc.XmlNode_GetDepth(*args, **kwargs) | [
"def",
"GetDepth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlNode_GetDepth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/xrc.py#L402-L404 | |
google/fhir | d77f57706c1a168529b0b87ca7ccb1c0113e83c2 | py/google/fhir/utils/fhir_package.py | python | _read_fhir_package_zip | (
zip_file_path: str
) | return (package_info, json_files) | Indexes the file entries at `zip_file_path` and returns package info.
Args:
zip_file_path: The `.zip` file that should be parsed.
Returns:
A tuple of (package info, JSON entries), detailing the package information
and associated `.json` files indexed by filename, respectively.
Raises:
ValueErro... | Indexes the file entries at `zip_file_path` and returns package info. | [
"Indexes",
"the",
"file",
"entries",
"at",
"zip_file_path",
"and",
"returns",
"package",
"info",
"."
] | def _read_fhir_package_zip(
zip_file_path: str
) -> Tuple[profile_config_pb2.PackageInfo, Dict[str, str]]:
"""Indexes the file entries at `zip_file_path` and returns package info.
Args:
zip_file_path: The `.zip` file that should be parsed.
Returns:
A tuple of (package info, JSON entries), detailing ... | [
"def",
"_read_fhir_package_zip",
"(",
"zip_file_path",
":",
"str",
")",
"->",
"Tuple",
"[",
"profile_config_pb2",
".",
"PackageInfo",
",",
"Dict",
"[",
"str",
",",
"str",
"]",
"]",
":",
"package_info",
":",
"Optional",
"[",
"profile_config_pb2",
".",
"PackageI... | https://github.com/google/fhir/blob/d77f57706c1a168529b0b87ca7ccb1c0113e83c2/py/google/fhir/utils/fhir_package.py#L46-L85 | |
sigmaai/self-driving-golf-cart | 8d891600af3d851add27a10ae45cf3c2108bb87c | ros/src/ros_carla_bridge/carla_manual_control/src/carla_manual_control/carla_manual_control.py | python | World.destroy | (self) | destroy all objects | destroy all objects | [
"destroy",
"all",
"objects"
] | def destroy(self):
"""
destroy all objects
"""
self.image_subscriber.unregister()
self.collision_subscriber.unregister()
self.lane_invasion_subscriber.unregister() | [
"def",
"destroy",
"(",
"self",
")",
":",
"self",
".",
"image_subscriber",
".",
"unregister",
"(",
")",
"self",
".",
"collision_subscriber",
".",
"unregister",
"(",
")",
"self",
".",
"lane_invasion_subscriber",
".",
"unregister",
"(",
")"
] | https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_manual_control/src/carla_manual_control/carla_manual_control.py#L138-L144 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/vis/visualization.py | python | VisAppearance.drawText | (self,text,point) | Draws the given text at the given point | Draws the given text at the given point | [
"Draws",
"the",
"given",
"text",
"at",
"the",
"given",
"point"
] | def drawText(self,text,point):
"""Draws the given text at the given point"""
self.widget.addLabel(text,point[:],[0,0,0]) | [
"def",
"drawText",
"(",
"self",
",",
"text",
",",
"point",
")",
":",
"self",
".",
"widget",
".",
"addLabel",
"(",
"text",
",",
"point",
"[",
":",
"]",
",",
"[",
"0",
",",
"0",
",",
"0",
"]",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/vis/visualization.py#L1851-L1853 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/control_flow_ops.py | python | ControlFlowState.PostProcessing | (self) | Perform postprocessing at the end of gradients().
We have created the gradient graph at this point. So this function
can be used to perform any postprocessing on the gradient graph.
We currently perform the following postprocessing:
1. Patch the gradient graph if the output of a loop variable
... | Perform postprocessing at the end of gradients(). | [
"Perform",
"postprocessing",
"at",
"the",
"end",
"of",
"gradients",
"()",
"."
] | def PostProcessing(self):
"""Perform postprocessing at the end of gradients().
We have created the gradient graph at this point. So this function
can be used to perform any postprocessing on the gradient graph.
We currently perform the following postprocessing:
1. Patch the gradient graph if the ... | [
"def",
"PostProcessing",
"(",
"self",
")",
":",
"for",
"_",
",",
"grad_state",
"in",
"self",
".",
"_map",
".",
"items",
"(",
")",
":",
"for",
"_",
",",
"b_merge",
"in",
"grad_state",
".",
"switch_map",
".",
"items",
"(",
")",
":",
"if",
"b_merge",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/control_flow_ops.py#L1228-L1265 | ||
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/app/metadynamics.py | python | Metadynamics._syncWithDisk | (self) | Save biases to disk, and check for updated files created by other processes. | Save biases to disk, and check for updated files created by other processes. | [
"Save",
"biases",
"to",
"disk",
"and",
"check",
"for",
"updated",
"files",
"created",
"by",
"other",
"processes",
"."
] | def _syncWithDisk(self):
"""Save biases to disk, and check for updated files created by other processes."""
if self.biasDir is None:
return
# Use a safe save to write out the biases to disk, then delete the older file.
oldName = os.path.join(self.biasDir, 'bias_%d_%d.npy' %... | [
"def",
"_syncWithDisk",
"(",
"self",
")",
":",
"if",
"self",
".",
"biasDir",
"is",
"None",
":",
"return",
"# Use a safe save to write out the biases to disk, then delete the older file.",
"oldName",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"biasDir",
... | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/metadynamics.py#L228-L269 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Validation/RecoTrack/python/plotting/ntupleDataFormat.py | python | Vertex.tracks | (self) | Returns a generator for the tracks used in the vertex fit.
The generator returns Track object. | Returns a generator for the tracks used in the vertex fit. | [
"Returns",
"a",
"generator",
"for",
"the",
"tracks",
"used",
"in",
"the",
"vertex",
"fit",
"."
] | def tracks(self):
"""Returns a generator for the tracks used in the vertex fit.
The generator returns Track object.
"""
self._checkIsValid()
for itrk in self._tree.vtx_trkIdx[self._index]:
yield Track(self._tree, itrk) | [
"def",
"tracks",
"(",
"self",
")",
":",
"self",
".",
"_checkIsValid",
"(",
")",
"for",
"itrk",
"in",
"self",
".",
"_tree",
".",
"vtx_trkIdx",
"[",
"self",
".",
"_index",
"]",
":",
"yield",
"Track",
"(",
"self",
".",
"_tree",
",",
"itrk",
")"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/RecoTrack/python/plotting/ntupleDataFormat.py#L1113-L1120 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/lookup.py | python | RosdepLookup.get_views_that_define | (self, rosdep_name) | return retval | Locate all views that directly define *rosdep_name*. A
side-effect of this method is that all available rosdep files
in the configuration will be loaded into memory.
Error state from single-stack failures
(e.g. :exc:`InvalidData`, :exc:`ResourceNotFound`) are
not propagated. C... | Locate all views that directly define *rosdep_name*. A
side-effect of this method is that all available rosdep files
in the configuration will be loaded into memory. | [
"Locate",
"all",
"views",
"that",
"directly",
"define",
"*",
"rosdep_name",
"*",
".",
"A",
"side",
"-",
"effect",
"of",
"this",
"method",
"is",
"that",
"all",
"available",
"rosdep",
"files",
"in",
"the",
"configuration",
"will",
"be",
"loaded",
"into",
"me... | def get_views_that_define(self, rosdep_name):
"""
Locate all views that directly define *rosdep_name*. A
side-effect of this method is that all available rosdep files
in the configuration will be loaded into memory.
Error state from single-stack failures
(e.g. :exc:`Inv... | [
"def",
"get_views_that_define",
"(",
"self",
",",
"rosdep_name",
")",
":",
"#TODOXXX: change this to return errors object so that caller cannot ignore",
"self",
".",
"_load_all_views",
"(",
"self",
".",
"loader",
")",
"db",
"=",
"self",
".",
"rosdep_db",
"retval",
"=",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/lookup.py#L609-L636 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintsmolecule.py | python | LibmintsMolecule.connectivity | (self) | return copy.deepcopy(self.PYconnectivity) | Get molecule connectivity
>>> print(H2OH2O.connectivity())
[(0, 1, 1.0), (0, 2, 1.0)] | Get molecule connectivity | [
"Get",
"molecule",
"connectivity"
] | def connectivity(self):
"""Get molecule connectivity
>>> print(H2OH2O.connectivity())
[(0, 1, 1.0), (0, 2, 1.0)]
"""
return copy.deepcopy(self.PYconnectivity) | [
"def",
"connectivity",
"(",
"self",
")",
":",
"return",
"copy",
".",
"deepcopy",
"(",
"self",
".",
"PYconnectivity",
")"
] | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintsmolecule.py#L220-L227 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/minimum-number-of-lines-to-cover-points.py | python | Solution.minimumLines | (self, points) | return result | :type points: List[List[int]]
:rtype: int | :type points: List[List[int]]
:rtype: int | [
":",
"type",
"points",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"rtype",
":",
"int"
] | def minimumLines(self, points):
"""
:type points: List[List[int]]
:rtype: int
"""
def gcd(a, b): # Time: O(log(a + b))
while b:
a, b = b, a % b
return a
def popcount(x):
result = 0
while x:
... | [
"def",
"minimumLines",
"(",
"self",
",",
"points",
")",
":",
"def",
"gcd",
"(",
"a",
",",
"b",
")",
":",
"# Time: O(log(a + b))",
"while",
"b",
":",
"a",
",",
"b",
"=",
"b",
",",
"a",
"%",
"b",
"return",
"a",
"def",
"popcount",
"(",
"x",
")",
"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimum-number-of-lines-to-cover-points.py#L9-L52 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/resources/model.py | python | ResourceModel._load_name_with_category | (self, names, name, category,
snake_case=True) | Load a name with a given category, possibly renaming it
if that name is already in use. The name will be stored
in ``names`` and possibly be set up in ``self._renamed``.
:type names: set
:param names: Existing names (Python attributes, properties, or
methods) on th... | Load a name with a given category, possibly renaming it
if that name is already in use. The name will be stored
in ``names`` and possibly be set up in ``self._renamed``. | [
"Load",
"a",
"name",
"with",
"a",
"given",
"category",
"possibly",
"renaming",
"it",
"if",
"that",
"name",
"is",
"already",
"in",
"use",
".",
"The",
"name",
"will",
"be",
"stored",
"in",
"names",
"and",
"possibly",
"be",
"set",
"up",
"in",
"self",
".",... | def _load_name_with_category(self, names, name, category,
snake_case=True):
"""
Load a name with a given category, possibly renaming it
if that name is already in use. The name will be stored
in ``names`` and possibly be set up in ``self._renamed``.
... | [
"def",
"_load_name_with_category",
"(",
"self",
",",
"names",
",",
"name",
",",
"category",
",",
"snake_case",
"=",
"True",
")",
":",
"if",
"snake_case",
":",
"name",
"=",
"xform_name",
"(",
"name",
")",
"if",
"name",
"in",
"names",
":",
"logger",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/resources/model.py#L337-L368 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/logging/__init__.py | python | warning | (msg, *args, **kwargs) | Log a message with severity 'WARNING' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format. | Log a message with severity 'WARNING' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format. | [
"Log",
"a",
"message",
"with",
"severity",
"WARNING",
"on",
"the",
"root",
"logger",
".",
"If",
"the",
"logger",
"has",
"no",
"handlers",
"call",
"basicConfig",
"()",
"to",
"add",
"a",
"console",
"handler",
"with",
"a",
"pre",
"-",
"defined",
"format",
"... | def warning(msg, *args, **kwargs):
"""
Log a message with severity 'WARNING' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format.
"""
if len(root.handlers) == 0:
basicConfig()
root.warning(msg, *args, **kwargs) | [
"def",
"warning",
"(",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"len",
"(",
"root",
".",
"handlers",
")",
"==",
"0",
":",
"basicConfig",
"(",
")",
"root",
".",
"warning",
"(",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/logging/__init__.py#L2074-L2082 | ||
yun-liu/RCF | 91bfb054ad04187dbbe21e539e165ad9bd3ff00b | scripts/cpp_lint.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/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/scripts/cpp_lint.py#L1134-L1140 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/metrics/python/ops/metric_ops.py | python | _count_condition | (values, weights=None, metrics_collections=None,
updates_collections=None) | return value_tensor, update_op | Sums the weights of cases where the given values are True.
If `weights` is `None`, weights default to 1. Use weights of 0 to mask values.
Args:
values: A `bool` `Tensor` of arbitrary size.
weights: Optional `Tensor` whose rank is either 0, or the same rank as
`values`, and must be broadcastable to `... | Sums the weights of cases where the given values are True. | [
"Sums",
"the",
"weights",
"of",
"cases",
"where",
"the",
"given",
"values",
"are",
"True",
"."
] | def _count_condition(values, weights=None, metrics_collections=None,
updates_collections=None):
"""Sums the weights of cases where the given values are True.
If `weights` is `None`, weights default to 1. Use weights of 0 to mask values.
Args:
values: A `bool` `Tensor` of arbitrary size.... | [
"def",
"_count_condition",
"(",
"values",
",",
"weights",
"=",
"None",
",",
"metrics_collections",
"=",
"None",
",",
"updates_collections",
"=",
"None",
")",
":",
"check_ops",
".",
"assert_type",
"(",
"values",
",",
"dtypes",
".",
"bool",
")",
"count",
"=",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/metrics/python/ops/metric_ops.py#L89-L133 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/symbolic.py | python | Type.match | (self,obj,strict=False) | Returns true if the given object type matches all aspects of this specification.
Integers and booleans match with numeric, vectors and matrices match with array.
obj is a Type, str, or Python object. If obj is a str, it is either a character specifier
or a class name, and sizes aren't checked.... | Returns true if the given object type matches all aspects of this specification.
Integers and booleans match with numeric, vectors and matrices match with array. | [
"Returns",
"true",
"if",
"the",
"given",
"object",
"type",
"matches",
"all",
"aspects",
"of",
"this",
"specification",
".",
"Integers",
"and",
"booleans",
"match",
"with",
"numeric",
"vectors",
"and",
"matrices",
"match",
"with",
"array",
"."
] | def match(self,obj,strict=False):
"""Returns true if the given object type matches all aspects of this specification.
Integers and booleans match with numeric, vectors and matrices match with array.
obj is a Type, str, or Python object. If obj is a str, it is either a character specifier
... | [
"def",
"match",
"(",
"self",
",",
"obj",
",",
"strict",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"Type",
")",
":",
"if",
"obj",
".",
"char",
"is",
"None",
"and",
"not",
"strict",
":",
"return",
"True",
"if",
"self",
".",
"char... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/symbolic.py#L870-L937 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/composite/multitype_ops/not_equal_impl.py | python | _none_not_equal_tensor | (x, y) | return True | Determine if tensor not equal none.
Args:
x : None.
y : Tensor.
Returns:
bool, return True. | Determine if tensor not equal none. | [
"Determine",
"if",
"tensor",
"not",
"equal",
"none",
"."
] | def _none_not_equal_tensor(x, y):
"""
Determine if tensor not equal none.
Args:
x : None.
y : Tensor.
Returns:
bool, return True.
"""
return True | [
"def",
"_none_not_equal_tensor",
"(",
"x",
",",
"y",
")",
":",
"return",
"True"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/not_equal_impl.py#L243-L254 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.