nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/targets.py | python | TargetMachine._emit_to_memory | (self, module, use_object=False) | Returns bytes of object code of the module.
Args
----
use_object : bool
Emit object code or (if False) emit assembly code. | Returns bytes of object code of the module. | [
"Returns",
"bytes",
"of",
"object",
"code",
"of",
"the",
"module",
"."
] | def _emit_to_memory(self, module, use_object=False):
"""Returns bytes of object code of the module.
Args
----
use_object : bool
Emit object code or (if False) emit assembly code.
"""
with ffi.OutputString() as outerr:
mb = ffi.lib.LLVMPY_TargetMac... | [
"def",
"_emit_to_memory",
"(",
"self",
",",
"module",
",",
"use_object",
"=",
"False",
")",
":",
"with",
"ffi",
".",
"OutputString",
"(",
")",
"as",
"outerr",
":",
"mb",
"=",
"ffi",
".",
"lib",
".",
"LLVMPY_TargetMachineEmitToMemory",
"(",
"self",
",",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/targets.py#L285-L305 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/vision/py_transforms.py | python | NormalizePad.__call__ | (self, img) | return util.normalize(img, self.mean, self.std, pad_channel=True, dtype=self.dtype) | Call method.
Args:
img (numpy.ndarray): numpy.ndarray to be normalized and padded.
Returns:
numpy.ndarray, normalized and padded numpy.ndarray. | Call method. | [
"Call",
"method",
"."
] | def __call__(self, img):
"""
Call method.
Args:
img (numpy.ndarray): numpy.ndarray to be normalized and padded.
Returns:
numpy.ndarray, normalized and padded numpy.ndarray.
"""
return util.normalize(img, self.mean, self.std, pad_channel=True, dty... | [
"def",
"__call__",
"(",
"self",
",",
"img",
")",
":",
"return",
"util",
".",
"normalize",
"(",
"img",
",",
"self",
".",
"mean",
",",
"self",
".",
"std",
",",
"pad_channel",
"=",
"True",
",",
"dtype",
"=",
"self",
".",
"dtype",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/vision/py_transforms.py#L374-L384 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/engine/topology.py | python | Container.save | (self, filepath, overwrite=True, include_optimizer=True) | Save the model to a single HDF5 file.
The savefile includes:
- The model architecture, allowing to re-instantiate the model.
- The model weights.
- The state of the optimizer, allowing to resume training
exactly where you left off.
This allows you to save the entirety of th... | Save the model to a single HDF5 file. | [
"Save",
"the",
"model",
"to",
"a",
"single",
"HDF5",
"file",
"."
] | def save(self, filepath, overwrite=True, include_optimizer=True):
"""Save the model to a single HDF5 file.
The savefile includes:
- The model architecture, allowing to re-instantiate the model.
- The model weights.
- The state of the optimizer, allowing to resume training
ex... | [
"def",
"save",
"(",
"self",
",",
"filepath",
",",
"overwrite",
"=",
"True",
",",
"include_optimizer",
"=",
"True",
")",
":",
"from",
"tensorflow",
".",
"contrib",
".",
"keras",
".",
"python",
".",
"keras",
".",
"models",
"import",
"save_model",
"# pylint: ... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/engine/topology.py#L2178-L2215 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/multiprocessing/__init__.py | python | RLock | () | return RLock() | Returns a recursive lock object | Returns a recursive lock object | [
"Returns",
"a",
"recursive",
"lock",
"object"
] | def RLock():
'''
Returns a recursive lock object
'''
from multiprocessing.synchronize import RLock
return RLock() | [
"def",
"RLock",
"(",
")",
":",
"from",
"multiprocessing",
".",
"synchronize",
"import",
"RLock",
"return",
"RLock",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/multiprocessing/__init__.py#L178-L183 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | configure.py | python | set_gcc_host_compiler_path | (environ_cp) | Set GCC_HOST_COMPILER_PATH. | Set GCC_HOST_COMPILER_PATH. | [
"Set",
"GCC_HOST_COMPILER_PATH",
"."
] | def set_gcc_host_compiler_path(environ_cp):
"""Set GCC_HOST_COMPILER_PATH."""
default_gcc_host_compiler_path = which('gcc') or ''
cuda_bin_symlink = '%s/bin/gcc' % environ_cp.get('CUDA_TOOLKIT_PATH')
if os.path.islink(cuda_bin_symlink):
# os.readlink is only available in linux
default_gcc_host_compiler... | [
"def",
"set_gcc_host_compiler_path",
"(",
"environ_cp",
")",
":",
"default_gcc_host_compiler_path",
"=",
"which",
"(",
"'gcc'",
")",
"or",
"''",
"cuda_bin_symlink",
"=",
"'%s/bin/gcc'",
"%",
"environ_cp",
".",
"get",
"(",
"'CUDA_TOOLKIT_PATH'",
")",
"if",
"os",
".... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/configure.py#L836-L856 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/xgboost/python-package/xgboost/training.py | python | train | (params, dtrain, num_boost_round=10, evals=(), obj=None, feval=None,
maximize=False, early_stopping_rounds=None, evals_result=None,
verbose_eval=True, learning_rates=None, xgb_model=None) | Train a booster with given parameters.
Parameters
----------
params : dict
Booster params.
dtrain : DMatrix
Data to be trained.
num_boost_round: int
Number of boosting iterations.
watchlist (evals): list of pairs (DMatrix, string)
List of items to be evaluated du... | Train a booster with given parameters. | [
"Train",
"a",
"booster",
"with",
"given",
"parameters",
"."
] | def train(params, dtrain, num_boost_round=10, evals=(), obj=None, feval=None,
maximize=False, early_stopping_rounds=None, evals_result=None,
verbose_eval=True, learning_rates=None, xgb_model=None):
# pylint: disable=too-many-statements,too-many-branches, attribute-defined-outside-init
"""Tra... | [
"def",
"train",
"(",
"params",
",",
"dtrain",
",",
"num_boost_round",
"=",
"10",
",",
"evals",
"=",
"(",
")",
",",
"obj",
"=",
"None",
",",
"feval",
"=",
"None",
",",
"maximize",
"=",
"False",
",",
"early_stopping_rounds",
"=",
"None",
",",
"evals_resu... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/xgboost/python-package/xgboost/training.py#L12-L192 | ||
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/tools/numeric.py | python | to_numeric | (arg, errors="raise", downcast=None) | Convert argument into numerical types.
Parameters
----------
arg : column-convertible
The object to convert to numeric types
errors : {'raise', 'ignore', 'coerce'}, defaults 'raise'
Policy to handle errors during parsing.
* 'raise' will notify user all errors encountered.
... | Convert argument into numerical types. | [
"Convert",
"argument",
"into",
"numerical",
"types",
"."
] | def to_numeric(arg, errors="raise", downcast=None):
"""
Convert argument into numerical types.
Parameters
----------
arg : column-convertible
The object to convert to numeric types
errors : {'raise', 'ignore', 'coerce'}, defaults 'raise'
Policy to handle errors during parsing.
... | [
"def",
"to_numeric",
"(",
"arg",
",",
"errors",
"=",
"\"raise\"",
",",
"downcast",
"=",
"None",
")",
":",
"if",
"errors",
"not",
"in",
"{",
"\"raise\"",
",",
"\"ignore\"",
",",
"\"coerce\"",
"}",
":",
"raise",
"ValueError",
"(",
"\"invalid error value specif... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/tools/numeric.py#L24-L171 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/speech_recognition/stt_datagenerator.py | python | DataGenerator.sample_normalize | (self, k_samples=1000, overwrite=False) | Estimate the mean and std of the features from the training set
Params:
k_samples (int): Use this number of samples for estimation | Estimate the mean and std of the features from the training set
Params:
k_samples (int): Use this number of samples for estimation | [
"Estimate",
"the",
"mean",
"and",
"std",
"of",
"the",
"features",
"from",
"the",
"training",
"set",
"Params",
":",
"k_samples",
"(",
"int",
")",
":",
"Use",
"this",
"number",
"of",
"samples",
"for",
"estimation"
] | def sample_normalize(self, k_samples=1000, overwrite=False):
""" Estimate the mean and std of the features from the training set
Params:
k_samples (int): Use this number of samples for estimation
"""
log = logUtil.getlogger()
log.info("Calculating mean and std from sa... | [
"def",
"sample_normalize",
"(",
"self",
",",
"k_samples",
"=",
"1000",
",",
"overwrite",
"=",
"False",
")",
":",
"log",
"=",
"logUtil",
".",
"getlogger",
"(",
")",
"log",
".",
"info",
"(",
"\"Calculating mean and std from samples\"",
")",
"# if k_samples is nega... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/speech_recognition/stt_datagenerator.py#L245-L281 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/cpplint.py | python | NestingState.InAsmBlock | (self) | return self.stack and self.stack[-1].inline_asm != _NO_ASM | Check if we are currently one level inside an inline ASM block.
Returns:
True if the top of the stack is a block containing inline ASM. | Check if we are currently one level inside an inline ASM block. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"an",
"inline",
"ASM",
"block",
"."
] | def InAsmBlock(self):
"""Check if we are currently one level inside an inline ASM block.
Returns:
True if the top of the stack is a block containing inline ASM.
"""
return self.stack and self.stack[-1].inline_asm != _NO_ASM | [
"def",
"InAsmBlock",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
".",
"inline_asm",
"!=",
"_NO_ASM"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/cpplint.py#L2567-L2573 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/html5lib/treebuilders/base.py | python | Node.removeChild | (self, node) | Remove node from the children of the current node
:arg node: the child node to remove | Remove node from the children of the current node | [
"Remove",
"node",
"from",
"the",
"children",
"of",
"the",
"current",
"node"
] | def removeChild(self, node):
"""Remove node from the children of the current node
:arg node: the child node to remove
"""
raise NotImplementedError | [
"def",
"removeChild",
"(",
"self",
",",
"node",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/html5lib/treebuilders/base.py#L89-L95 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py | python | DeleteTool.on_change_selection | (self, event) | return False | Called after selection has been changed with SHIFT-click
Do operation on currently selected drawobjects. | Called after selection has been changed with SHIFT-click
Do operation on currently selected drawobjects. | [
"Called",
"after",
"selection",
"has",
"been",
"changed",
"with",
"SHIFT",
"-",
"click",
"Do",
"operation",
"on",
"currently",
"selected",
"drawobjects",
"."
] | def on_change_selection(self, event):
"""
Called after selection has been changed with SHIFT-click
Do operation on currently selected drawobjects.
"""
return False | [
"def",
"on_change_selection",
"(",
"self",
",",
"event",
")",
":",
"return",
"False"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py#L1211-L1216 | |
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/synfig/animation.py | python | get_bool_at_frame | (anim, frame) | return val | Calculates the boolean value at a given frame, given a boolean animation
Args:
anim (lxml.etree._Element): Boolean animation
frame (int) : Frame at which the value is to be calculated
Returns:
(bool) : True if the value is "true" at that frame
: False otherwise | Calculates the boolean value at a given frame, given a boolean animation | [
"Calculates",
"the",
"boolean",
"value",
"at",
"a",
"given",
"frame",
"given",
"a",
"boolean",
"animation"
] | def get_bool_at_frame(anim, frame):
"""
Calculates the boolean value at a given frame, given a boolean animation
Args:
anim (lxml.etree._Element): Boolean animation
frame (int) : Frame at which the value is to be calculated
Returns:
(bool) : True if the value is "true" at that frame
: ... | [
"def",
"get_bool_at_frame",
"(",
"anim",
",",
"frame",
")",
":",
"i",
"=",
"0",
"not_convert_flag",
"=",
"False",
"while",
"i",
"<",
"len",
"(",
"anim",
")",
":",
"cur_fr",
"=",
"get_frame",
"(",
"anim",
"[",
"i",
"]",
")",
"if",
"frame",
"<=",
"cu... | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/synfig/animation.py#L279-L342 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | DateSpan.__rmul__ | (*args, **kwargs) | return _misc_.DateSpan___rmul__(*args, **kwargs) | __rmul__(self, int n) -> DateSpan | __rmul__(self, int n) -> DateSpan | [
"__rmul__",
"(",
"self",
"int",
"n",
")",
"-",
">",
"DateSpan"
] | def __rmul__(*args, **kwargs):
"""__rmul__(self, int n) -> DateSpan"""
return _misc_.DateSpan___rmul__(*args, **kwargs) | [
"def",
"__rmul__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateSpan___rmul__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4733-L4735 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/sdk/adb_wrapper.py | python | AdbWrapper.__str__ | (self) | return self._device_serial | The string representation of an instance.
Returns:
The device serial number as a string. | The string representation of an instance. | [
"The",
"string",
"representation",
"of",
"an",
"instance",
"."
] | def __str__(self):
"""The string representation of an instance.
Returns:
The device serial number as a string.
"""
return self._device_serial | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"self",
".",
"_device_serial"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/sdk/adb_wrapper.py#L304-L310 | |
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/containers.py | python | BaseContainer.__init__ | (self, message_listener) | Args:
message_listener: A MessageListener implementation.
The RepeatedScalarFieldContainer will call this object's
Modified() method when it is modified. | Args:
message_listener: A MessageListener implementation.
The RepeatedScalarFieldContainer will call this object's
Modified() method when it is modified. | [
"Args",
":",
"message_listener",
":",
"A",
"MessageListener",
"implementation",
".",
"The",
"RepeatedScalarFieldContainer",
"will",
"call",
"this",
"object",
"s",
"Modified",
"()",
"method",
"when",
"it",
"is",
"modified",
"."
] | def __init__(self, message_listener):
"""
Args:
message_listener: A MessageListener implementation.
The RepeatedScalarFieldContainer will call this object's
Modified() method when it is modified.
"""
self._message_listener = message_listener
self._values = [] | [
"def",
"__init__",
"(",
"self",
",",
"message_listener",
")",
":",
"self",
".",
"_message_listener",
"=",
"message_listener",
"self",
".",
"_values",
"=",
"[",
"]"
] | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/containers.py#L52-L60 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/pywin/framework/app.py | python | HaveGoodGUI | () | return "pywin.framework.startup" in sys.modules | Returns true if we currently have a good gui available. | Returns true if we currently have a good gui available. | [
"Returns",
"true",
"if",
"we",
"currently",
"have",
"a",
"good",
"gui",
"available",
"."
] | def HaveGoodGUI():
"""Returns true if we currently have a good gui available.
"""
return "pywin.framework.startup" in sys.modules | [
"def",
"HaveGoodGUI",
"(",
")",
":",
"return",
"\"pywin.framework.startup\"",
"in",
"sys",
".",
"modules"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/pywin/framework/app.py#L388-L391 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py | python | _Macro.set | (self, value) | Explicitly set the value of the macro.
value is the new value. It may be a string, a list of strings or a
_UniqueList instance. | Explicitly set the value of the macro. | [
"Explicitly",
"set",
"the",
"value",
"of",
"the",
"macro",
"."
] | def set(self, value):
"""Explicitly set the value of the macro.
value is the new value. It may be a string, a list of strings or a
_UniqueList instance.
"""
self._macro = []
if isinstance(value, _UniqueList):
value = value.as_list()
if type(value) ... | [
"def",
"set",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"_macro",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"value",
",",
"_UniqueList",
")",
":",
"value",
"=",
"value",
".",
"as_list",
"(",
")",
"if",
"type",
"(",
"value",
")",
"==",
"list... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py#L261-L275 | ||
kismetwireless/kismet | a7c0dc270c960fb1f58bd9cec4601c201885fd4e | capture_sdr_rtladsb/KismetCaptureRtladsb/__init__.py | python | KismetRtladsb.adsb_msg_get_fs | (self, data) | return data[0] & 7 | Extract flight status from 4, 5, 20, 21 | Extract flight status from 4, 5, 20, 21 | [
"Extract",
"flight",
"status",
"from",
"4",
"5",
"20",
"21"
] | def adsb_msg_get_fs(self, data):
"""
Extract flight status from 4, 5, 20, 21
"""
return data[0] & 7 | [
"def",
"adsb_msg_get_fs",
"(",
"self",
",",
"data",
")",
":",
"return",
"data",
"[",
"0",
"]",
"&",
"7"
] | https://github.com/kismetwireless/kismet/blob/a7c0dc270c960fb1f58bd9cec4601c201885fd4e/capture_sdr_rtladsb/KismetCaptureRtladsb/__init__.py#L785-L789 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | chrome/installer/util/prebuild/create_string_rc.py | python | StringRcMaker.__init__ | (self, name, inputs, outdir) | Constructs a maker.
Args:
name: The base name of the generated files (e.g.,
'installer_util_strings').
inputs: A list of (grd_file, xtb_dir) pairs containing the source data.
outdir: The directory into which the files will be generated. | Constructs a maker. | [
"Constructs",
"a",
"maker",
"."
] | def __init__(self, name, inputs, outdir):
"""Constructs a maker.
Args:
name: The base name of the generated files (e.g.,
'installer_util_strings').
inputs: A list of (grd_file, xtb_dir) pairs containing the source data.
outdir: The directory into which the files will be generated.
... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"inputs",
",",
"outdir",
")",
":",
"self",
".",
"name",
"=",
"name",
"self",
".",
"inputs",
"=",
"inputs",
"self",
".",
"outdir",
"=",
"outdir"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/installer/util/prebuild/create_string_rc.py#L225-L236 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/algorithm_detail/batch_execution.py | python | set_properties_for_reduction_algorithm | (reduction_alg, reduction_package, workspace_to_name, workspace_to_monitor,
event_slice_optimisation=False) | Sets up everything necessary on the reduction algorithm.
:param reduction_alg: a handle to the reduction algorithm
:param reduction_package: a reduction package object
:param workspace_to_name: the workspace to name map
:param workspace_to_monitor: a workspace to monitor map
:param event_slice_opti... | Sets up everything necessary on the reduction algorithm. | [
"Sets",
"up",
"everything",
"necessary",
"on",
"the",
"reduction",
"algorithm",
"."
] | def set_properties_for_reduction_algorithm(reduction_alg, reduction_package, workspace_to_name, workspace_to_monitor,
event_slice_optimisation=False):
"""
Sets up everything necessary on the reduction algorithm.
:param reduction_alg: a handle to the reduction algo... | [
"def",
"set_properties_for_reduction_algorithm",
"(",
"reduction_alg",
",",
"reduction_package",
",",
"workspace_to_name",
",",
"workspace_to_monitor",
",",
"event_slice_optimisation",
"=",
"False",
")",
":",
"# Go through the elements of the reduction package and set them on the red... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/algorithm_detail/batch_execution.py#L677-L720 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/max-stack.py | python | MaxStack.peekMax | (self) | return self.__max | :rtype: int | :rtype: int | [
":",
"rtype",
":",
"int"
] | def peekMax(self):
"""
:rtype: int
"""
return self.__max | [
"def",
"peekMax",
"(",
"self",
")",
":",
"return",
"self",
".",
"__max"
] | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/max-stack.py#L51-L55 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PGEditorDialogAdapter.ShowDialog | (*args, **kwargs) | return _propgrid.PGEditorDialogAdapter_ShowDialog(*args, **kwargs) | ShowDialog(self, PropertyGrid propGrid, PGProperty property) -> bool | ShowDialog(self, PropertyGrid propGrid, PGProperty property) -> bool | [
"ShowDialog",
"(",
"self",
"PropertyGrid",
"propGrid",
"PGProperty",
"property",
")",
"-",
">",
"bool"
] | def ShowDialog(*args, **kwargs):
"""ShowDialog(self, PropertyGrid propGrid, PGProperty property) -> bool"""
return _propgrid.PGEditorDialogAdapter_ShowDialog(*args, **kwargs) | [
"def",
"ShowDialog",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGEditorDialogAdapter_ShowDialog",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2791-L2793 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/inspector_protocol/jinja2/compiler.py | python | Frame.inner | (self, isolated=False) | return Frame(self.eval_ctx, self) | Return an inner frame. | Return an inner frame. | [
"Return",
"an",
"inner",
"frame",
"."
] | def inner(self, isolated=False):
"""Return an inner frame."""
if isolated:
return Frame(self.eval_ctx, level=self.symbols.level + 1)
return Frame(self.eval_ctx, self) | [
"def",
"inner",
"(",
"self",
",",
"isolated",
"=",
"False",
")",
":",
"if",
"isolated",
":",
"return",
"Frame",
"(",
"self",
".",
"eval_ctx",
",",
"level",
"=",
"self",
".",
"symbols",
".",
"level",
"+",
"1",
")",
"return",
"Frame",
"(",
"self",
".... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/compiler.py#L172-L176 | |
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | python/lbann/core/training_algorithm.py | python | TrainingAlgorithm.export_proto | (self) | return algo | Get a protobuf representation of this object. | Get a protobuf representation of this object. | [
"Get",
"a",
"protobuf",
"representation",
"of",
"this",
"object",
"."
] | def export_proto(self):
"""Get a protobuf representation of this object."""
algo = AlgoProto.TrainingAlgorithm()
algo.name = self.name
algo.parameters.Pack(self.do_export_proto())
return algo | [
"def",
"export_proto",
"(",
"self",
")",
":",
"algo",
"=",
"AlgoProto",
".",
"TrainingAlgorithm",
"(",
")",
"algo",
".",
"name",
"=",
"self",
".",
"name",
"algo",
".",
"parameters",
".",
"Pack",
"(",
"self",
".",
"do_export_proto",
"(",
")",
")",
"retu... | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/python/lbann/core/training_algorithm.py#L34-L40 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | benchmark/opperf/utils/op_registry_utils.py | python | get_all_rearrange_operators | () | return rearrange_mx_operators | Gets all array rearrange operators registered with MXNet.
Returns
-------
{"operator_name": {"has_backward", "nd_op_handle", "params"}} | Gets all array rearrange operators registered with MXNet. | [
"Gets",
"all",
"array",
"rearrange",
"operators",
"registered",
"with",
"MXNet",
"."
] | def get_all_rearrange_operators():
"""Gets all array rearrange operators registered with MXNet.
Returns
-------
{"operator_name": {"has_backward", "nd_op_handle", "params"}}
"""
rearrange_ops = ['transpose', 'swapaxes', 'flip', 'depth_to_space',
'space_to_depth', 'SwapAxis'... | [
"def",
"get_all_rearrange_operators",
"(",
")",
":",
"rearrange_ops",
"=",
"[",
"'transpose'",
",",
"'swapaxes'",
",",
"'flip'",
",",
"'depth_to_space'",
",",
"'space_to_depth'",
",",
"'SwapAxis'",
",",
"'reverse'",
"]",
"# Get all mxnet operators",
"mx_operators",
"=... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/benchmark/opperf/utils/op_registry_utils.py#L446-L464 | |
DaFuCoding/MTCNN_Caffe | 09c30c3ff391bd9cb6b249c1910afaf147767ab3 | examples/pycaffe/layers/pascal_multilabel_datalayers.py | python | check_params | (params) | A utility function to check the parameters for the data layers. | A utility function to check the parameters for the data layers. | [
"A",
"utility",
"function",
"to",
"check",
"the",
"parameters",
"for",
"the",
"data",
"layers",
"."
] | def check_params(params):
"""
A utility function to check the parameters for the data layers.
"""
assert 'split' in params.keys(
), 'Params must include split (train, val, or test).'
required = ['batch_size', 'pascal_root', 'im_shape']
for r in required:
assert r in params.keys(), '... | [
"def",
"check_params",
"(",
"params",
")",
":",
"assert",
"'split'",
"in",
"params",
".",
"keys",
"(",
")",
",",
"'Params must include split (train, val, or test).'",
"required",
"=",
"[",
"'batch_size'",
",",
"'pascal_root'",
",",
"'im_shape'",
"]",
"for",
"r",
... | https://github.com/DaFuCoding/MTCNN_Caffe/blob/09c30c3ff391bd9cb6b249c1910afaf147767ab3/examples/pycaffe/layers/pascal_multilabel_datalayers.py#L196-L205 | ||
Bhupesh-V/30-seconds-of-cpp | 5e73ad8fa11f5e5a57307a307ed15e97f5716dd7 | update_readme.py | python | get_title | (function_file) | Read the file until we hit the first line that starts with a #
indicating a title in markdown. We'll use that as the title for this
entry. | Read the file until we hit the first line that starts with a #
indicating a title in markdown. We'll use that as the title for this
entry. | [
"Read",
"the",
"file",
"until",
"we",
"hit",
"the",
"first",
"line",
"that",
"starts",
"with",
"a",
"#",
"indicating",
"a",
"title",
"in",
"markdown",
".",
"We",
"ll",
"use",
"that",
"as",
"the",
"title",
"for",
"this",
"entry",
"."
] | def get_title(function_file):
''' Read the file until we hit the first line that starts with a #
indicating a title in markdown. We'll use that as the title for this
entry. '''
with open(function_file) as _file:
for line in _file:
line = line.strip()
if line.startswith('... | [
"def",
"get_title",
"(",
"function_file",
")",
":",
"with",
"open",
"(",
"function_file",
")",
"as",
"_file",
":",
"for",
"line",
"in",
"_file",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"line",
".",
"startswith",
"(",
"'#'",
")",
":",
... | https://github.com/Bhupesh-V/30-seconds-of-cpp/blob/5e73ad8fa11f5e5a57307a307ed15e97f5716dd7/update_readme.py#L84-L92 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/third_party/pyserial/serial/urlhandler/protocol_socket.py | python | SocketSerial.flushInput | (self) | Clear input buffer, discarding all that is in the buffer. | Clear input buffer, discarding all that is in the buffer. | [
"Clear",
"input",
"buffer",
"discarding",
"all",
"that",
"is",
"in",
"the",
"buffer",
"."
] | def flushInput(self):
"""Clear input buffer, discarding all that is in the buffer."""
if not self._isOpen: raise portNotOpenError
if self.logger:
self.logger.info('ignored flushInput') | [
"def",
"flushInput",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_isOpen",
":",
"raise",
"portNotOpenError",
"if",
"self",
".",
"logger",
":",
"self",
".",
"logger",
".",
"info",
"(",
"'ignored flushInput'",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/pyserial/serial/urlhandler/protocol_socket.py#L177-L181 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/styles/style.py | python | parse_color | (text: str) | Parse/validate color format.
Like in Pygments, but also support the ANSI color names.
(These will map to the colors of the 16 color palette.) | Parse/validate color format. | [
"Parse",
"/",
"validate",
"color",
"format",
"."
] | def parse_color(text: str) -> str:
"""
Parse/validate color format.
Like in Pygments, but also support the ANSI color names.
(These will map to the colors of the 16 color palette.)
"""
# ANSI color names.
if text in ANSI_COLOR_NAMES:
return text
if text in ANSI_COLOR_NAMES_ALIAS... | [
"def",
"parse_color",
"(",
"text",
":",
"str",
")",
"->",
"str",
":",
"# ANSI color names.",
"if",
"text",
"in",
"ANSI_COLOR_NAMES",
":",
"return",
"text",
"if",
"text",
"in",
"ANSI_COLOR_NAMES_ALIASES",
":",
"return",
"ANSI_COLOR_NAMES_ALIASES",
"[",
"text",
"]... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/styles/style.py#L31-L74 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/svm.py | python | SVM.predict_classes | (self, x=None, input_fn=None, batch_size=None,
as_iterable=True) | return preds[key] | Runs inference to determine the predicted class. | Runs inference to determine the predicted class. | [
"Runs",
"inference",
"to",
"determine",
"the",
"predicted",
"class",
"."
] | def predict_classes(self, x=None, input_fn=None, batch_size=None,
as_iterable=True):
"""Runs inference to determine the predicted class."""
key = prediction_key.PredictionKey.CLASSES
preds = super(SVM, self).predict(
x=x,
input_fn=input_fn,
batch_size=batch_size... | [
"def",
"predict_classes",
"(",
"self",
",",
"x",
"=",
"None",
",",
"input_fn",
"=",
"None",
",",
"batch_size",
"=",
"None",
",",
"as_iterable",
"=",
"True",
")",
":",
"key",
"=",
"prediction_key",
".",
"PredictionKey",
".",
"CLASSES",
"preds",
"=",
"supe... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/svm.py#L164-L176 | |
CaoWGG/TensorRT-YOLOv4 | 4d7c2edce99e8794a4cb4ea3540d51ce91158a36 | onnx-tensorrt/third_party/onnx/onnx/__init__.py | python | load_model | (f, format=None) | return load_model_from_string(s, format=format) | Loads a serialized ModelProto into memory
@params
f can be a file-like object (has "read" function) or a string containing a file name
format is for future use
@return
Loaded in-memory ModelProto | Loads a serialized ModelProto into memory | [
"Loads",
"a",
"serialized",
"ModelProto",
"into",
"memory"
] | def load_model(f, format=None): # type: (Union[IO[bytes], Text], Optional[Any]) -> ModelProto
'''
Loads a serialized ModelProto into memory
@params
f can be a file-like object (has "read" function) or a string containing a file name
format is for future use
@return
Loaded in-memory ModelP... | [
"def",
"load_model",
"(",
"f",
",",
"format",
"=",
"None",
")",
":",
"# type: (Union[IO[bytes], Text], Optional[Any]) -> ModelProto",
"s",
"=",
"_load_bytes",
"(",
"f",
")",
"return",
"load_model_from_string",
"(",
"s",
",",
"format",
"=",
"format",
")"
] | https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/onnx/__init__.py#L89-L101 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiMDIClientWindow.CreateClient | (*args, **kwargs) | return _aui.AuiMDIClientWindow_CreateClient(*args, **kwargs) | CreateClient(self, AuiMDIParentFrame parent, long style=wxVSCROLL|wxHSCROLL) -> bool | CreateClient(self, AuiMDIParentFrame parent, long style=wxVSCROLL|wxHSCROLL) -> bool | [
"CreateClient",
"(",
"self",
"AuiMDIParentFrame",
"parent",
"long",
"style",
"=",
"wxVSCROLL|wxHSCROLL",
")",
"-",
">",
"bool"
] | def CreateClient(*args, **kwargs):
"""CreateClient(self, AuiMDIParentFrame parent, long style=wxVSCROLL|wxHSCROLL) -> bool"""
return _aui.AuiMDIClientWindow_CreateClient(*args, **kwargs) | [
"def",
"CreateClient",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiMDIClientWindow_CreateClient",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1635-L1637 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/contrib/autograd.py | python | test_section | () | return TrainingStateScope(False) | Returns a testing scope context to be used in 'with' statement
and captures testing code.
Example::
with autograd.train_section():
y = model(x)
compute_gradient([y])
with autograd.test_section():
# testing, IO, gradient updates... | Returns a testing scope context to be used in 'with' statement
and captures testing code. | [
"Returns",
"a",
"testing",
"scope",
"context",
"to",
"be",
"used",
"in",
"with",
"statement",
"and",
"captures",
"testing",
"code",
"."
] | def test_section():
"""Returns a testing scope context to be used in 'with' statement
and captures testing code.
Example::
with autograd.train_section():
y = model(x)
compute_gradient([y])
with autograd.test_section():
# testing, IO, gradient upda... | [
"def",
"test_section",
"(",
")",
":",
"return",
"TrainingStateScope",
"(",
"False",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/contrib/autograd.py#L88-L99 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Window.GetFullTextExtent | (*args, **kwargs) | return _core_.Window_GetFullTextExtent(*args, **kwargs) | GetFullTextExtent(String string, Font font=None) ->
(width, height, descent, externalLeading)
Get the width, height, decent and leading of the text using the
current or specified font. | GetFullTextExtent(String string, Font font=None) ->
(width, height, descent, externalLeading) | [
"GetFullTextExtent",
"(",
"String",
"string",
"Font",
"font",
"=",
"None",
")",
"-",
">",
"(",
"width",
"height",
"descent",
"externalLeading",
")"
] | def GetFullTextExtent(*args, **kwargs):
"""
GetFullTextExtent(String string, Font font=None) ->
(width, height, descent, externalLeading)
Get the width, height, decent and leading of the text using the
current or specified font.
"""
return _core_.Window_GetFul... | [
"def",
"GetFullTextExtent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetFullTextExtent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L11038-L11046 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/opt/python/training/delay_compensated_gradient_descent.py | python | DelayCompensatedGradientDescentOptimizer.minimize | (self, loss, global_step=None, var_list=None,
gate_gradients=optimizer.Optimizer.GATE_OP, aggregation_method=None,
colocate_gradients_with_ops=False, name=None,
grad_loss=None, worker_index=None) | return self.apply_gradients(grads_and_vars, global_step=global_step,
name=name, worker_index=worker_index) | Add operations to minimize `loss` by updating `var_list`.
This method simply combines calls `compute_gradients()` and
`apply_gradients()`. If you want to process the gradient before applying
them call `compute_gradients()` and `apply_gradients()` explicitly instead
of using this function.
Args:
... | Add operations to minimize `loss` by updating `var_list`. | [
"Add",
"operations",
"to",
"minimize",
"loss",
"by",
"updating",
"var_list",
"."
] | def minimize(self, loss, global_step=None, var_list=None,
gate_gradients=optimizer.Optimizer.GATE_OP, aggregation_method=None,
colocate_gradients_with_ops=False, name=None,
grad_loss=None, worker_index=None):
"""Add operations to minimize `loss` by updating `var_list`.
... | [
"def",
"minimize",
"(",
"self",
",",
"loss",
",",
"global_step",
"=",
"None",
",",
"var_list",
"=",
"None",
",",
"gate_gradients",
"=",
"optimizer",
".",
"Optimizer",
".",
"GATE_OP",
",",
"aggregation_method",
"=",
"None",
",",
"colocate_gradients_with_ops",
"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/opt/python/training/delay_compensated_gradient_descent.py#L91-L144 | |
ideawu/ssdb | f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4 | deps/cpy/antlr3/tree.py | python | CommonTreeNodeStream.addNavigationNode | (self, ttype) | As we flatten the tree, we use UP, DOWN nodes to represent
the tree structure. When debugging we need unique nodes
so instantiate new ones when uniqueNavigationNodes is true. | As we flatten the tree, we use UP, DOWN nodes to represent
the tree structure. When debugging we need unique nodes
so instantiate new ones when uniqueNavigationNodes is true. | [
"As",
"we",
"flatten",
"the",
"tree",
"we",
"use",
"UP",
"DOWN",
"nodes",
"to",
"represent",
"the",
"tree",
"structure",
".",
"When",
"debugging",
"we",
"need",
"unique",
"nodes",
"so",
"instantiate",
"new",
"ones",
"when",
"uniqueNavigationNodes",
"is",
"tr... | def addNavigationNode(self, ttype):
"""
As we flatten the tree, we use UP, DOWN nodes to represent
the tree structure. When debugging we need unique nodes
so instantiate new ones when uniqueNavigationNodes is true.
"""
navNode = None
if ttype ==... | [
"def",
"addNavigationNode",
"(",
"self",
",",
"ttype",
")",
":",
"navNode",
"=",
"None",
"if",
"ttype",
"==",
"DOWN",
":",
"if",
"self",
".",
"hasUniqueNavigationNodes",
"(",
")",
":",
"navNode",
"=",
"self",
".",
"adaptor",
".",
"createFromType",
"(",
"... | https://github.com/ideawu/ssdb/blob/f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4/deps/cpy/antlr3/tree.py#L1771-L1794 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/vision/validators.py | python | check_degrees | (degrees) | Check if the `degrees` is legal. | Check if the `degrees` is legal. | [
"Check",
"if",
"the",
"degrees",
"is",
"legal",
"."
] | def check_degrees(degrees):
"""Check if the `degrees` is legal."""
type_check(degrees, (int, float, list, tuple), "degrees")
if isinstance(degrees, (int, float)):
check_non_negative_float32(degrees, "degrees")
elif isinstance(degrees, (list, tuple)):
if len(degrees) == 2:
typ... | [
"def",
"check_degrees",
"(",
"degrees",
")",
":",
"type_check",
"(",
"degrees",
",",
"(",
"int",
",",
"float",
",",
"list",
",",
"tuple",
")",
",",
"\"degrees\"",
")",
"if",
"isinstance",
"(",
"degrees",
",",
"(",
"int",
",",
"float",
")",
")",
":",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/vision/validators.py#L142-L155 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/util/tf_should_use.py | python | _add_should_use_warning | (x, error_in_function=False, warn_in_eager=False) | return _get_wrapper(x, tf_should_use_helper) | Wraps object x so that if it is never used, a warning is logged.
Args:
x: Python object.
error_in_function: Python bool. If `True`, a `RuntimeError` is raised
if the returned value is never used when created during `tf.function`
tracing.
warn_in_eager: Python bool. If `True` raise warning if... | Wraps object x so that if it is never used, a warning is logged. | [
"Wraps",
"object",
"x",
"so",
"that",
"if",
"it",
"is",
"never",
"used",
"a",
"warning",
"is",
"logged",
"."
] | def _add_should_use_warning(x, error_in_function=False, warn_in_eager=False):
"""Wraps object x so that if it is never used, a warning is logged.
Args:
x: Python object.
error_in_function: Python bool. If `True`, a `RuntimeError` is raised
if the returned value is never used when created during `tf.... | [
"def",
"_add_should_use_warning",
"(",
"x",
",",
"error_in_function",
"=",
"False",
",",
"warn_in_eager",
"=",
"False",
")",
":",
"if",
"x",
"is",
"None",
"or",
"(",
"isinstance",
"(",
"x",
",",
"list",
")",
"and",
"not",
"x",
")",
":",
"return",
"x",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/util/tf_should_use.py#L171-L209 | |
cksystemsgroup/scalloc | 049857919b5fa1d539c9e4206e353daca2e87394 | tools/cpplint.py | python | GetHeaderGuardCPPVariable | (filename) | return re.sub(r'[-./\s]', '_', file_path_from_root).upper() + '_' | Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file. | Returns the CPP variable that should be used as a header guard. | [
"Returns",
"the",
"CPP",
"variable",
"that",
"should",
"be",
"used",
"as",
"a",
"header",
"guard",
"."
] | def GetHeaderGuardCPPVariable(filename):
"""Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file.
"""
# Restores original filename in case that cpplint is... | [
"def",
"GetHeaderGuardCPPVariable",
"(",
"filename",
")",
":",
"# Restores original filename in case that cpplint is invoked from Emacs's",
"# flymake.",
"filename",
"=",
"re",
".",
"sub",
"(",
"r'_flymake\\.h$'",
",",
"'.h'",
",",
"filename",
")",
"filename",
"=",
"re",
... | https://github.com/cksystemsgroup/scalloc/blob/049857919b5fa1d539c9e4206e353daca2e87394/tools/cpplint.py#L1373-L1394 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetExecutablePath | (self) | Returns the directory name of the bundle represented by this target. E.g.
Chromium.app/Contents/MacOS/Chromium. | Returns the directory name of the bundle represented by this target. E.g.
Chromium.app/Contents/MacOS/Chromium. | [
"Returns",
"the",
"directory",
"name",
"of",
"the",
"bundle",
"represented",
"by",
"this",
"target",
".",
"E",
".",
"g",
".",
"Chromium",
".",
"app",
"/",
"Contents",
"/",
"MacOS",
"/",
"Chromium",
"."
] | def GetExecutablePath(self):
"""Returns the directory name of the bundle represented by this target. E.g.
Chromium.app/Contents/MacOS/Chromium."""
if self._IsBundle():
return self._GetBundleBinaryPath()
else:
return self._GetStandaloneBinaryPath() | [
"def",
"GetExecutablePath",
"(",
"self",
")",
":",
"if",
"self",
".",
"_IsBundle",
"(",
")",
":",
"return",
"self",
".",
"_GetBundleBinaryPath",
"(",
")",
"else",
":",
"return",
"self",
".",
"_GetStandaloneBinaryPath",
"(",
")"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L412-L418 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/package_index.py | python | PyPIConfig.find_credential | (self, url) | If the URL indicated appears to be a repository defined in this
config, return the credential for that repository. | If the URL indicated appears to be a repository defined in this
config, return the credential for that repository. | [
"If",
"the",
"URL",
"indicated",
"appears",
"to",
"be",
"a",
"repository",
"defined",
"in",
"this",
"config",
"return",
"the",
"credential",
"for",
"that",
"repository",
"."
] | def find_credential(self, url):
"""
If the URL indicated appears to be a repository defined in this
config, return the credential for that repository.
"""
for repository, cred in self.creds_by_repository.items():
if url.startswith(repository):
return c... | [
"def",
"find_credential",
"(",
"self",
",",
"url",
")",
":",
"for",
"repository",
",",
"cred",
"in",
"self",
".",
"creds_by_repository",
".",
"items",
"(",
")",
":",
"if",
"url",
".",
"startswith",
"(",
"repository",
")",
":",
"return",
"cred"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/package_index.py#L1040-L1047 | ||
GoSSIP-SJTU/Armariris | ad5d868482956b2194a77b39c8d543c7c2318200 | examples/Kaleidoscope/MCJIT/lazy/genk-timing.py | python | KScriptGenerator.updateFunctionCallMap | (self, caller, callee) | Maintains a map of functions that are called from other functions | Maintains a map of functions that are called from other functions | [
"Maintains",
"a",
"map",
"of",
"functions",
"that",
"are",
"called",
"from",
"other",
"functions"
] | def updateFunctionCallMap(self, caller, callee):
"""Maintains a map of functions that are called from other functions"""
if not caller in self.calledFunctionTable:
self.calledFunctionTable[caller] = []
if not callee in self.calledFunctionTable[caller]:
self.calledFunction... | [
"def",
"updateFunctionCallMap",
"(",
"self",
",",
"caller",
",",
"callee",
")",
":",
"if",
"not",
"caller",
"in",
"self",
".",
"calledFunctionTable",
":",
"self",
".",
"calledFunctionTable",
"[",
"caller",
"]",
"=",
"[",
"]",
"if",
"not",
"callee",
"in",
... | https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py#L56-L64 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | NumberEntryDialog.__init__ | (self, *args, **kwargs) | __init__(self, Window parent, String message, String prompt, String caption,
long value, long min, long max, Point pos=DefaultPosition) -> NumberEntryDialog
Constructor. Use ShowModal method to show the dialog. | __init__(self, Window parent, String message, String prompt, String caption,
long value, long min, long max, Point pos=DefaultPosition) -> NumberEntryDialog | [
"__init__",
"(",
"self",
"Window",
"parent",
"String",
"message",
"String",
"prompt",
"String",
"caption",
"long",
"value",
"long",
"min",
"long",
"max",
"Point",
"pos",
"=",
"DefaultPosition",
")",
"-",
">",
"NumberEntryDialog"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, String message, String prompt, String caption,
long value, long min, long max, Point pos=DefaultPosition) -> NumberEntryDialog
Constructor. Use ShowModal method to show the dialog.
"""
_windows... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_windows_",
".",
"NumberEntryDialog_swiginit",
"(",
"self",
",",
"_windows_",
".",
"new_NumberEntryDialog",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L3422-L3430 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PGProperty.__init__ | (self, *args) | __init__(self) -> PGProperty
__init__(self, String label, String name) -> PGProperty | __init__(self) -> PGProperty
__init__(self, String label, String name) -> PGProperty | [
"__init__",
"(",
"self",
")",
"-",
">",
"PGProperty",
"__init__",
"(",
"self",
"String",
"label",
"String",
"name",
")",
"-",
">",
"PGProperty"
] | def __init__(self, *args):
"""
__init__(self) -> PGProperty
__init__(self, String label, String name) -> PGProperty
"""
_propgrid.PGProperty_swiginit(self,_propgrid.new_PGProperty(*args)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"_propgrid",
".",
"PGProperty_swiginit",
"(",
"self",
",",
"_propgrid",
".",
"new_PGProperty",
"(",
"*",
"args",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L353-L358 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/plotting/_matplotlib/converter.py | python | TimeSeries_TimedeltaFormatter.format_timedelta_ticks | (x, pos, n_decimals: int) | return s | Convert seconds to 'D days HH:MM:SS.F' | Convert seconds to 'D days HH:MM:SS.F' | [
"Convert",
"seconds",
"to",
"D",
"days",
"HH",
":",
"MM",
":",
"SS",
".",
"F"
] | def format_timedelta_ticks(x, pos, n_decimals: int) -> str:
"""
Convert seconds to 'D days HH:MM:SS.F'
"""
s, ns = divmod(x, 10 ** 9)
m, s = divmod(s, 60)
h, m = divmod(m, 60)
d, h = divmod(h, 24)
decimals = int(ns * 10 ** (n_decimals - 9))
s = f"{... | [
"def",
"format_timedelta_ticks",
"(",
"x",
",",
"pos",
",",
"n_decimals",
":",
"int",
")",
"->",
"str",
":",
"s",
",",
"ns",
"=",
"divmod",
"(",
"x",
",",
"10",
"**",
"9",
")",
"m",
",",
"s",
"=",
"divmod",
"(",
"s",
",",
"60",
")",
"h",
",",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/plotting/_matplotlib/converter.py#L1079-L1093 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/ceph-volume/ceph_volume/terminal.py | python | subhelp | (mapper) | return '' | Look at every value of every key in the mapper and will output any
``class.help`` possible to return it as a string that will be sent to
stderr. | Look at every value of every key in the mapper and will output any
``class.help`` possible to return it as a string that will be sent to
stderr. | [
"Look",
"at",
"every",
"value",
"of",
"every",
"key",
"in",
"the",
"mapper",
"and",
"will",
"output",
"any",
"class",
".",
"help",
"possible",
"to",
"return",
"it",
"as",
"a",
"string",
"that",
"will",
"be",
"sent",
"to",
"stderr",
"."
] | def subhelp(mapper):
"""
Look at every value of every key in the mapper and will output any
``class.help`` possible to return it as a string that will be sent to
stderr.
"""
help_text_lines = []
for key, value in mapper.items():
try:
help_text = value.help
except ... | [
"def",
"subhelp",
"(",
"mapper",
")",
":",
"help_text_lines",
"=",
"[",
"]",
"for",
"key",
",",
"value",
"in",
"mapper",
".",
"items",
"(",
")",
":",
"try",
":",
"help_text",
"=",
"value",
".",
"help",
"except",
"AttributeError",
":",
"continue",
"help... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/ceph-volume/ceph_volume/terminal.py#L198-L214 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | Grid.CanEnableCellControl | (*args, **kwargs) | return _grid.Grid_CanEnableCellControl(*args, **kwargs) | CanEnableCellControl(self) -> bool | CanEnableCellControl(self) -> bool | [
"CanEnableCellControl",
"(",
"self",
")",
"-",
">",
"bool"
] | def CanEnableCellControl(*args, **kwargs):
"""CanEnableCellControl(self) -> bool"""
return _grid.Grid_CanEnableCellControl(*args, **kwargs) | [
"def",
"CanEnableCellControl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_CanEnableCellControl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1354-L1356 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/FS.py | python | Base.target_from_source | (self, prefix, suffix, splitext=SCons.Util.splitext) | return SCons.Node._target_from_source_map[self._func_target_from_source](self, prefix, suffix, splitext) | Generates a target entry that corresponds to this entry (usually
a source file) with the specified prefix and suffix.
Note that this method can be overridden dynamically for generated
files that need different behavior. See Tool/swig.py for
an example. | [] | def target_from_source(self, prefix, suffix, splitext=SCons.Util.splitext):
"""
Generates a target entry that corresponds to this entry (usually
a source file) with the specified prefix and suffix.
Note that this method can be overridden dynamically for generated
files that nee... | [
"def",
"target_from_source",
"(",
"self",
",",
"prefix",
",",
"suffix",
",",
"splitext",
"=",
"SCons",
".",
"Util",
".",
"splitext",
")",
":",
"return",
"SCons",
".",
"Node",
".",
"_target_from_source_map",
"[",
"self",
".",
"_func_target_from_source",
"]",
... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/FS.py#L863-L873 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/searchbase.py | python | SearchDialogBase.open | (self, text, searchphrase=None) | Make dialog visible on top of others and ready to use. | Make dialog visible on top of others and ready to use. | [
"Make",
"dialog",
"visible",
"on",
"top",
"of",
"others",
"and",
"ready",
"to",
"use",
"."
] | def open(self, text, searchphrase=None):
"Make dialog visible on top of others and ready to use."
self.text = text
if not self.top:
self.create_widgets()
else:
self.top.deiconify()
self.top.tkraise()
self.top.transient(text.winfo_toplevel())
... | [
"def",
"open",
"(",
"self",
",",
"text",
",",
"searchphrase",
"=",
"None",
")",
":",
"self",
".",
"text",
"=",
"text",
"if",
"not",
"self",
".",
"top",
":",
"self",
".",
"create_widgets",
"(",
")",
"else",
":",
"self",
".",
"top",
".",
"deiconify",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/searchbase.py#L49-L64 | ||
TimoSaemann/caffe-segnet-cudnn5 | abcf30dca449245e101bf4ced519f716177f0885 | scripts/cpp_lint.py | python | _DropCommonSuffixes | (filename) | return os.path.splitext(filename)[0] | Drops common suffixes like _test.cc or -inl.h from filename.
For example:
>>> _DropCommonSuffixes('foo/foo-inl.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/bar/foo.cc')
'foo/bar/foo'
>>> _DropCommonSuffixes('foo/foo_internal.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/foo_unusualinternal.h')... | Drops common suffixes like _test.cc or -inl.h from filename. | [
"Drops",
"common",
"suffixes",
"like",
"_test",
".",
"cc",
"or",
"-",
"inl",
".",
"h",
"from",
"filename",
"."
] | def _DropCommonSuffixes(filename):
"""Drops common suffixes like _test.cc or -inl.h from filename.
For example:
>>> _DropCommonSuffixes('foo/foo-inl.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/bar/foo.cc')
'foo/bar/foo'
>>> _DropCommonSuffixes('foo/foo_internal.h')
'foo/foo'
>>> _DropCom... | [
"def",
"_DropCommonSuffixes",
"(",
"filename",
")",
":",
"for",
"suffix",
"in",
"(",
"'test.cc'",
",",
"'regtest.cc'",
",",
"'unittest.cc'",
",",
"'inl.h'",
",",
"'impl.h'",
",",
"'internal.h'",
")",
":",
"if",
"(",
"filename",
".",
"endswith",
"(",
"suffix"... | https://github.com/TimoSaemann/caffe-segnet-cudnn5/blob/abcf30dca449245e101bf4ced519f716177f0885/scripts/cpp_lint.py#L3576-L3600 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | buildsystem/compilepy.py | python | main | () | CLI entry point | CLI entry point | [
"CLI",
"entry",
"point"
] | def main():
""" CLI entry point """
cli = argparse.ArgumentParser()
cli.add_argument("pymodule_list_file", help=(
"semicolon-separated list of all modules that shall be compiled"
))
cli.add_argument("input_dir", help=(
"base directory where files from the above list are in."
))
... | [
"def",
"main",
"(",
")",
":",
"cli",
"=",
"argparse",
".",
"ArgumentParser",
"(",
")",
"cli",
".",
"add_argument",
"(",
"\"pymodule_list_file\"",
",",
"help",
"=",
"(",
"\"semicolon-separated list of all modules that shall be compiled\"",
")",
")",
"cli",
".",
"ad... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/buildsystem/compilepy.py#L50-L107 | ||
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py | python | _AddListFieldsMethod | (message_descriptor, cls) | Helper for _AddMessageMethods(). | Helper for _AddMessageMethods(). | [
"Helper",
"for",
"_AddMessageMethods",
"()",
"."
] | def _AddListFieldsMethod(message_descriptor, cls):
"""Helper for _AddMessageMethods()."""
def ListFields(self):
all_fields = [item for item in self._fields.iteritems() if _IsPresent(item)]
all_fields.sort(key = lambda item: item[0].number)
return all_fields
cls.ListFields = ListFields | [
"def",
"_AddListFieldsMethod",
"(",
"message_descriptor",
",",
"cls",
")",
":",
"def",
"ListFields",
"(",
"self",
")",
":",
"all_fields",
"=",
"[",
"item",
"for",
"item",
"in",
"self",
".",
"_fields",
".",
"iteritems",
"(",
")",
"if",
"_IsPresent",
"(",
... | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py#L624-L632 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/array_grad.py | python | _UnpackGrad | (op, *grads) | return array_ops.pack(grads, axis=op.get_attr("axis")) | Gradient for unpack op. | Gradient for unpack op. | [
"Gradient",
"for",
"unpack",
"op",
"."
] | def _UnpackGrad(op, *grads):
"""Gradient for unpack op."""
return array_ops.pack(grads, axis=op.get_attr("axis")) | [
"def",
"_UnpackGrad",
"(",
"op",
",",
"*",
"grads",
")",
":",
"return",
"array_ops",
".",
"pack",
"(",
"grads",
",",
"axis",
"=",
"op",
".",
"get_attr",
"(",
"\"axis\"",
")",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/array_grad.py#L40-L42 | |
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | python/lbann/contrib/lc/systems.py | python | has_gpu | (system = system()) | return gpus_per_node(system) > 0 | Whether LC system has GPUs. | Whether LC system has GPUs. | [
"Whether",
"LC",
"system",
"has",
"GPUs",
"."
] | def has_gpu(system = system()):
"""Whether LC system has GPUs."""
return gpus_per_node(system) > 0 | [
"def",
"has_gpu",
"(",
"system",
"=",
"system",
"(",
")",
")",
":",
"return",
"gpus_per_node",
"(",
"system",
")",
">",
"0"
] | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/python/lbann/contrib/lc/systems.py#L55-L57 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cookielib.py | python | is_third_party | (request) | RFC 2965, section 3.3.6:
An unverifiable transaction is to a third-party host if its request-
host U does not domain-match the reach R of the request-host O in the
origin transaction. | [] | def is_third_party(request):
"""
RFC 2965, section 3.3.6:
An unverifiable transaction is to a third-party host if its request-
host U does not domain-match the reach R of the request-host O in the
origin transaction.
"""
req_host = request_host(request)
if not domain_match... | [
"def",
"is_third_party",
"(",
"request",
")",
":",
"req_host",
"=",
"request_host",
"(",
"request",
")",
"if",
"not",
"domain_match",
"(",
"req_host",
",",
"reach",
"(",
"request",
".",
"get_origin_req_host",
"(",
")",
")",
")",
":",
"return",
"True",
"els... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cookielib.py#L690-L704 | |||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/math_grad.py | python | _ProdGrad | (op, grad) | return array_ops.reshape(out, input_shape), None | Gradient for Prod. | Gradient for Prod. | [
"Gradient",
"for",
"Prod",
"."
] | def _ProdGrad(op, grad):
"""Gradient for Prod."""
# The gradient can be expressed by dividing the product by each entry of the
# input tensor, but this approach can't deal with zeros in the input.
# Here, we avoid this problem by composing the output as a product of two
# cumprod operations.
input_shape = ... | [
"def",
"_ProdGrad",
"(",
"op",
",",
"grad",
")",
":",
"# The gradient can be expressed by dividing the product by each entry of the",
"# input tensor, but this approach can't deal with zeros in the input.",
"# Here, we avoid this problem by composing the output as a product of two",
"# cumprod... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/math_grad.py#L110-L146 | |
TheLegendAli/DeepLab-Context | fb04e9e2fc2682490ad9f60533b9d6c4c0e0479c | scripts/cpp_lint.py | python | FileInfo.Split | (self) | return (project,) + os.path.splitext(rest) | Splits the file into the directory, basename, and extension.
For 'chrome/browser/browser.cc', Split() would
return ('chrome/browser', 'browser', '.cc')
Returns:
A tuple of (directory, basename, extension). | Splits the file into the directory, basename, and extension. | [
"Splits",
"the",
"file",
"into",
"the",
"directory",
"basename",
"and",
"extension",
"."
] | def Split(self):
"""Splits the file into the directory, basename, and extension.
For 'chrome/browser/browser.cc', Split() would
return ('chrome/browser', 'browser', '.cc')
Returns:
A tuple of (directory, basename, extension).
"""
googlename = self.RepositoryName()
project, rest = os... | [
"def",
"Split",
"(",
"self",
")",
":",
"googlename",
"=",
"self",
".",
"RepositoryName",
"(",
")",
"project",
",",
"rest",
"=",
"os",
".",
"path",
".",
"split",
"(",
"googlename",
")",
"return",
"(",
"project",
",",
")",
"+",
"os",
".",
"path",
"."... | https://github.com/TheLegendAli/DeepLab-Context/blob/fb04e9e2fc2682490ad9f60533b9d6c4c0e0479c/scripts/cpp_lint.py#L930-L942 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/parfor.py | python | parfor_defs | (parfor, use_set=None, def_set=None) | return analysis._use_defs_result(usemap=use_set, defmap=def_set) | list variables written in this parfor by recursively
calling compute_use_defs() on body and combining block defs. | list variables written in this parfor by recursively
calling compute_use_defs() on body and combining block defs. | [
"list",
"variables",
"written",
"in",
"this",
"parfor",
"by",
"recursively",
"calling",
"compute_use_defs",
"()",
"on",
"body",
"and",
"combining",
"block",
"defs",
"."
] | def parfor_defs(parfor, use_set=None, def_set=None):
"""list variables written in this parfor by recursively
calling compute_use_defs() on body and combining block defs.
"""
if use_set is None:
use_set = set()
if def_set is None:
def_set = set()
blocks = wrap_parfor_blocks(parfor... | [
"def",
"parfor_defs",
"(",
"parfor",
",",
"use_set",
"=",
"None",
",",
"def_set",
"=",
"None",
")",
":",
"if",
"use_set",
"is",
"None",
":",
"use_set",
"=",
"set",
"(",
")",
"if",
"def_set",
"is",
"None",
":",
"def_set",
"=",
"set",
"(",
")",
"bloc... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/parfor.py#L3229-L3278 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/timeseries/python/timeseries/state_space_models/kalman_filter.py | python | KalmanFilter.predict_state_var | (
self, prior_state_var, transition_matrices, transition_noise_sums) | return prior_variance_transitioned + transition_noise_sums | r"""Compute variance for state transitions.
Computes a noise estimate corresponding to the value returned by
predict_state_mean.
Args:
prior_state_var: Covariance matrix specifying uncertainty of current state
estimate [batch size x state dimension x state dimension]
transition_matri... | r"""Compute variance for state transitions. | [
"r",
"Compute",
"variance",
"for",
"state",
"transitions",
"."
] | def predict_state_var(
self, prior_state_var, transition_matrices, transition_noise_sums):
r"""Compute variance for state transitions.
Computes a noise estimate corresponding to the value returned by
predict_state_mean.
Args:
prior_state_var: Covariance matrix specifying uncertainty of cur... | [
"def",
"predict_state_var",
"(",
"self",
",",
"prior_state_var",
",",
"transition_matrices",
",",
"transition_noise_sums",
")",
":",
"prior_variance_transitioned",
"=",
"math_ops",
".",
"matmul",
"(",
"math_ops",
".",
"matmul",
"(",
"transition_matrices",
",",
"prior_... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/timeseries/python/timeseries/state_space_models/kalman_filter.py#L176-L211 | |
cornell-zhang/heterocl | 6d9e4b4acc2ee2707b2d25b27298c0335bccedfd | python/heterocl/tvm/ir_builder.py | python | create | () | return IRBuilder() | Create a new IRBuilder
Returns
-------
builder : IRBuilder
The created IRBuilder | Create a new IRBuilder | [
"Create",
"a",
"new",
"IRBuilder"
] | def create():
"""Create a new IRBuilder
Returns
-------
builder : IRBuilder
The created IRBuilder
"""
return IRBuilder() | [
"def",
"create",
"(",
")",
":",
"return",
"IRBuilder",
"(",
")"
] | https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/ir_builder.py#L383-L391 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | InfoOptions | (options=None, format='text', deserialize=True,
computeMinMax=False, reportHistograms=False, reportProj4=False,
stats=False, approxStats=False, computeChecksum=False,
showGCPs=True, showMetadata=True, showRAT=True, showColorTable=True,
listMDD=False, showFileList=True, allMetadata=Fa... | return (GDALInfoOptions(new_options), format, deserialize) | Create a InfoOptions() object that can be passed to gdal.Info()
options can be be an array of strings, a string or let empty and filled from other keywords. | Create a InfoOptions() object that can be passed to gdal.Info()
options can be be an array of strings, a string or let empty and filled from other keywords. | [
"Create",
"a",
"InfoOptions",
"()",
"object",
"that",
"can",
"be",
"passed",
"to",
"gdal",
".",
"Info",
"()",
"options",
"can",
"be",
"be",
"an",
"array",
"of",
"strings",
"a",
"string",
"or",
"let",
"empty",
"and",
"filled",
"from",
"other",
"keywords",... | def InfoOptions(options=None, format='text', deserialize=True,
computeMinMax=False, reportHistograms=False, reportProj4=False,
stats=False, approxStats=False, computeChecksum=False,
showGCPs=True, showMetadata=True, showRAT=True, showColorTable=True,
listMDD=False, showFileList=True,... | [
"def",
"InfoOptions",
"(",
"options",
"=",
"None",
",",
"format",
"=",
"'text'",
",",
"deserialize",
"=",
"True",
",",
"computeMinMax",
"=",
"False",
",",
"reportHistograms",
"=",
"False",
",",
"reportProj4",
"=",
"False",
",",
"stats",
"=",
"False",
",",
... | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L174-L228 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Task.py | python | compile_fun_noshell | (line) | return (funex(fun), dvars) | Create a compiled function to execute a process without the shell
WARNING: this method may disappear anytime, so use compile_fun instead | Create a compiled function to execute a process without the shell
WARNING: this method may disappear anytime, so use compile_fun instead | [
"Create",
"a",
"compiled",
"function",
"to",
"execute",
"a",
"process",
"without",
"the",
"shell",
"WARNING",
":",
"this",
"method",
"may",
"disappear",
"anytime",
"so",
"use",
"compile_fun",
"instead"
] | def compile_fun_noshell(line):
"""
Create a compiled function to execute a process without the shell
WARNING: this method may disappear anytime, so use compile_fun instead
"""
extr = []
def repl(match):
g = match.group
if g('dollar'): return "$"
elif g('subst'): extr.append((g('var'), g('code'))); return "<... | [
"def",
"compile_fun_noshell",
"(",
"line",
")",
":",
"extr",
"=",
"[",
"]",
"def",
"repl",
"(",
"match",
")",
":",
"g",
"=",
"match",
".",
"group",
"if",
"g",
"(",
"'dollar'",
")",
":",
"return",
"\"$\"",
"elif",
"g",
"(",
"'subst'",
")",
":",
"e... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Task.py#L1161-L1213 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | BVRedAnd | (a) | return BitVecRef(Z3_mk_bvredand(a.ctx_ref(), a.as_ast()), a.ctx) | Return the reduction-and expression of `a`. | Return the reduction-and expression of `a`. | [
"Return",
"the",
"reduction",
"-",
"and",
"expression",
"of",
"a",
"."
] | def BVRedAnd(a):
"""Return the reduction-and expression of `a`."""
if z3_debug():
_z3_assert(is_bv(a), "First argument must be a Z3 bit-vector expression")
return BitVecRef(Z3_mk_bvredand(a.ctx_ref(), a.as_ast()), a.ctx) | [
"def",
"BVRedAnd",
"(",
"a",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"is_bv",
"(",
"a",
")",
",",
"\"First argument must be a Z3 bit-vector expression\"",
")",
"return",
"BitVecRef",
"(",
"Z3_mk_bvredand",
"(",
"a",
".",
"ctx_ref",
"(",
... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L4410-L4414 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/nanops.py | python | nanmedian | (values, *, axis=None, skipna=True, mask=None) | return _wrap_results(res, dtype) | Parameters
----------
values : ndarray
axis : int, optional
skipna : bool, default True
mask : ndarray[bool], optional
nan-mask if known
Returns
-------
result : float
Unless input is a float array, in which case use the same
precision as the input array.
Ex... | Parameters
----------
values : ndarray
axis : int, optional
skipna : bool, default True
mask : ndarray[bool], optional
nan-mask if known | [
"Parameters",
"----------",
"values",
":",
"ndarray",
"axis",
":",
"int",
"optional",
"skipna",
":",
"bool",
"default",
"True",
"mask",
":",
"ndarray",
"[",
"bool",
"]",
"optional",
"nan",
"-",
"mask",
"if",
"known"
] | def nanmedian(values, *, axis=None, skipna=True, mask=None):
"""
Parameters
----------
values : ndarray
axis : int, optional
skipna : bool, default True
mask : ndarray[bool], optional
nan-mask if known
Returns
-------
result : float
Unless input is a float array,... | [
"def",
"nanmedian",
"(",
"values",
",",
"*",
",",
"axis",
"=",
"None",
",",
"skipna",
"=",
"True",
",",
"mask",
"=",
"None",
")",
":",
"def",
"get_median",
"(",
"x",
")",
":",
"mask",
"=",
"notna",
"(",
"x",
")",
"if",
"not",
"skipna",
"and",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/nanops.py#L683-L757 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListMainWindow.OnHoverTimer | (self, event) | Handles the ``wx.EVT_TIMER`` event for :class:`UltimateListMainWindow`.
:param `event`: a :class:`TimerEvent` event to be processed. | Handles the ``wx.EVT_TIMER`` event for :class:`UltimateListMainWindow`. | [
"Handles",
"the",
"wx",
".",
"EVT_TIMER",
"event",
"for",
":",
"class",
":",
"UltimateListMainWindow",
"."
] | def OnHoverTimer(self, event):
"""
Handles the ``wx.EVT_TIMER`` event for :class:`UltimateListMainWindow`.
:param `event`: a :class:`TimerEvent` event to be processed.
"""
x, y = self.ScreenToClient(wx.GetMousePosition())
x, y = self.CalcUnscrolledPosition(x, y)
... | [
"def",
"OnHoverTimer",
"(",
"self",
",",
"event",
")",
":",
"x",
",",
"y",
"=",
"self",
".",
"ScreenToClient",
"(",
"wx",
".",
"GetMousePosition",
"(",
")",
")",
"x",
",",
"y",
"=",
"self",
".",
"CalcUnscrolledPosition",
"(",
"x",
",",
"y",
")",
"i... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L7851-L7871 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/training/session_run_hook.py | python | SessionRunHook.before_run | (self, run_context) | return None | Called before each call to run().
You can return from this call a `SessionRunArgs` object indicating ops or
tensors to add to the upcoming `run()` call. These ops/tensors will be run
together with the ops/tensors originally passed to the original run() call.
The run args you return can also contain fe... | Called before each call to run(). | [
"Called",
"before",
"each",
"call",
"to",
"run",
"()",
"."
] | def before_run(self, run_context): # pylint: disable=unused-argument
"""Called before each call to run().
You can return from this call a `SessionRunArgs` object indicating ops or
tensors to add to the upcoming `run()` call. These ops/tensors will be run
together with the ops/tensors originally passe... | [
"def",
"before_run",
"(",
"self",
",",
"run_context",
")",
":",
"# pylint: disable=unused-argument",
"return",
"None"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/session_run_hook.py#L132-L153 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | PlatformInformation.__ne__ | (*args, **kwargs) | return _misc_.PlatformInformation___ne__(*args, **kwargs) | __ne__(self, PlatformInformation t) -> bool | __ne__(self, PlatformInformation t) -> bool | [
"__ne__",
"(",
"self",
"PlatformInformation",
"t",
")",
"-",
">",
"bool"
] | def __ne__(*args, **kwargs):
"""__ne__(self, PlatformInformation t) -> bool"""
return _misc_.PlatformInformation___ne__(*args, **kwargs) | [
"def",
"__ne__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"PlatformInformation___ne__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L1057-L1059 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mhlib.py | python | MH.error | (self, msg, *args) | Routine to print an error. May be overridden by a derived class. | Routine to print an error. May be overridden by a derived class. | [
"Routine",
"to",
"print",
"an",
"error",
".",
"May",
"be",
"overridden",
"by",
"a",
"derived",
"class",
"."
] | def error(self, msg, *args):
"""Routine to print an error. May be overridden by a derived class."""
sys.stderr.write('MH error: %s\n' % (msg % args)) | [
"def",
"error",
"(",
"self",
",",
"msg",
",",
"*",
"args",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"'MH error: %s\\n'",
"%",
"(",
"msg",
"%",
"args",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mhlib.py#L118-L120 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBProcess.WriteMemory | (self, addr, buf, error) | return _lldb.SBProcess_WriteMemory(self, addr, buf, error) | Writes memory to the current process's address space and maintains any
traps that might be present due to software breakpoints. Example:
# Create a Python string from the byte array.
new_value = str(bytes)
result = process.WriteMemory(addr, new_value, error)
if not error.Success... | [] | def WriteMemory(self, addr, buf, error):
"""
Writes memory to the current process's address space and maintains any
traps that might be present due to software breakpoints. Example:
# Create a Python string from the byte array.
new_value = str(bytes)
result = process.Wr... | [
"def",
"WriteMemory",
"(",
"self",
",",
"addr",
",",
"buf",
",",
"error",
")",
":",
"return",
"_lldb",
".",
"SBProcess_WriteMemory",
"(",
"self",
",",
"addr",
",",
"buf",
",",
"error",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L8581-L8593 | ||
DaFuCoding/MTCNN_Caffe | 09c30c3ff391bd9cb6b249c1910afaf147767ab3 | scripts/cpp_lint.py | python | CheckForNewlineAtEOF | (filename, lines, error) | Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found. | Logs an error if there is no newline char at the end of the file. | [
"Logs",
"an",
"error",
"if",
"there",
"is",
"no",
"newline",
"char",
"at",
"the",
"end",
"of",
"the",
"file",
"."
] | def CheckForNewlineAtEOF(filename, lines, error):
"""Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found.
"""
# The array ... | [
"def",
"CheckForNewlineAtEOF",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# The array lines() was created by adding two newlines to the",
"# original file (go figure), then splitting on \\n.",
"# To verify that the file ends in \\n, we just have to make sure the",
"# last-but-... | https://github.com/DaFuCoding/MTCNN_Caffe/blob/09c30c3ff391bd9cb6b249c1910afaf147767ab3/scripts/cpp_lint.py#L1508-L1523 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListMainWindow.GetItemCount | (self) | return (self.IsVirtual() and [self._countVirt] or [len(self._lines)])[0] | Returns the number of items in the :class:`UltimateListCtrl`. | Returns the number of items in the :class:`UltimateListCtrl`. | [
"Returns",
"the",
"number",
"of",
"items",
"in",
"the",
":",
"class",
":",
"UltimateListCtrl",
"."
] | def GetItemCount(self):
""" Returns the number of items in the :class:`UltimateListCtrl`. """
return (self.IsVirtual() and [self._countVirt] or [len(self._lines)])[0] | [
"def",
"GetItemCount",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"IsVirtual",
"(",
")",
"and",
"[",
"self",
".",
"_countVirt",
"]",
"or",
"[",
"len",
"(",
"self",
".",
"_lines",
")",
"]",
")",
"[",
"0",
"]"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L9464-L9467 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py | python | spawn.__interact_writen | (self, fd, data) | This is used by the interact() method. | This is used by the interact() method. | [
"This",
"is",
"used",
"by",
"the",
"interact",
"()",
"method",
"."
] | def __interact_writen(self, fd, data):
'''This is used by the interact() method.
'''
while data != b'' and self.isalive():
n = os.write(fd, data)
data = data[n:] | [
"def",
"__interact_writen",
"(",
"self",
",",
"fd",
",",
"data",
")",
":",
"while",
"data",
"!=",
"b''",
"and",
"self",
".",
"isalive",
"(",
")",
":",
"n",
"=",
"os",
".",
"write",
"(",
"fd",
",",
"data",
")",
"data",
"=",
"data",
"[",
"n",
":"... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py#L770-L776 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py | python | Logger.setLevel | (self, level) | Set the logging level of this logger. | Set the logging level of this logger. | [
"Set",
"the",
"logging",
"level",
"of",
"this",
"logger",
"."
] | def setLevel(self, level):
"""
Set the logging level of this logger.
"""
self.level = _checkLevel(level) | [
"def",
"setLevel",
"(",
"self",
",",
"level",
")",
":",
"self",
".",
"level",
"=",
"_checkLevel",
"(",
"level",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py#L1121-L1125 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/service_reflection.py | python | _ServiceStubBuilder._StubMethod | (self, stub, method_descriptor,
rpc_controller, request, callback) | return stub.rpc_channel.CallMethod(
method_descriptor, rpc_controller, request,
method_descriptor.output_type._concrete_class, callback) | The body of all service methods in the generated stub class.
Args:
stub: Stub instance.
method_descriptor: Descriptor of the invoked method.
rpc_controller: Rpc controller to execute the method.
request: Request protocol message.
callback: A callback to execute when the method finishe... | The body of all service methods in the generated stub class. | [
"The",
"body",
"of",
"all",
"service",
"methods",
"in",
"the",
"generated",
"stub",
"class",
"."
] | def _StubMethod(self, stub, method_descriptor,
rpc_controller, request, callback):
"""The body of all service methods in the generated stub class.
Args:
stub: Stub instance.
method_descriptor: Descriptor of the invoked method.
rpc_controller: Rpc controller to execute the me... | [
"def",
"_StubMethod",
"(",
"self",
",",
"stub",
",",
"method_descriptor",
",",
"rpc_controller",
",",
"request",
",",
"callback",
")",
":",
"return",
"stub",
".",
"rpc_channel",
".",
"CallMethod",
"(",
"method_descriptor",
",",
"rpc_controller",
",",
"request",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/service_reflection.py#L272-L287 | |
YannickJadoul/Parselmouth | 355c4746531c948faaaf9b13b828e5afea621efd | pybind11/pybind11/setup_helpers.py | python | no_recompile | (obg, src) | return True | This is the safest but slowest choice (and is the default) - will always
recompile sources. | This is the safest but slowest choice (and is the default) - will always
recompile sources. | [
"This",
"is",
"the",
"safest",
"but",
"slowest",
"choice",
"(",
"and",
"is",
"the",
"default",
")",
"-",
"will",
"always",
"recompile",
"sources",
"."
] | def no_recompile(obg, src):
"""
This is the safest but slowest choice (and is the default) - will always
recompile sources.
"""
return True | [
"def",
"no_recompile",
"(",
"obg",
",",
"src",
")",
":",
"return",
"True"
] | https://github.com/YannickJadoul/Parselmouth/blob/355c4746531c948faaaf9b13b828e5afea621efd/pybind11/pybind11/setup_helpers.py#L314-L319 | |
matplotlib/basemap | 1b80b3cee5dd688f32c652e780367ec6c93c4480 | packages/basemap/utils/GeosLibrary.py | python | GeosLibrary.__del__ | (self) | Clean up after :class:`GeosLibrary` destruction. | Clean up after :class:`GeosLibrary` destruction. | [
"Clean",
"up",
"after",
":",
"class",
":",
"GeosLibrary",
"destruction",
"."
] | def __del__(self):
"""Clean up after :class:`GeosLibrary` destruction."""
if self.temp:
try:
shutil.rmtree(self.root)
except OSError:
pass | [
"def",
"__del__",
"(",
"self",
")",
":",
"if",
"self",
".",
"temp",
":",
"try",
":",
"shutil",
".",
"rmtree",
"(",
"self",
".",
"root",
")",
"except",
"OSError",
":",
"pass"
] | https://github.com/matplotlib/basemap/blob/1b80b3cee5dd688f32c652e780367ec6c93c4480/packages/basemap/utils/GeosLibrary.py#L61-L68 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/stata.py | python | StataWriter._replace_nans | (self, data) | return data | Checks floating point data columns for nans, and replaces these with
the generic Stata for missing value (.) | Checks floating point data columns for nans, and replaces these with
the generic Stata for missing value (.) | [
"Checks",
"floating",
"point",
"data",
"columns",
"for",
"nans",
"and",
"replaces",
"these",
"with",
"the",
"generic",
"Stata",
"for",
"missing",
"value",
"(",
".",
")"
] | def _replace_nans(self, data):
# return data
"""Checks floating point data columns for nans, and replaces these with
the generic Stata for missing value (.)"""
for c in data:
dtype = data[c].dtype
if dtype in (np.float32, np.float64):
if dtype == n... | [
"def",
"_replace_nans",
"(",
"self",
",",
"data",
")",
":",
"# return data",
"for",
"c",
"in",
"data",
":",
"dtype",
"=",
"data",
"[",
"c",
"]",
".",
"dtype",
"if",
"dtype",
"in",
"(",
"np",
".",
"float32",
",",
"np",
".",
"float64",
")",
":",
"i... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/stata.py#L2136-L2149 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/system-gdbinit/elinos.py | python | elinos_init | () | Initialize debugger environment for ELinOS.
Let the debugger know where to find the ELinOS libraries on host. This
assumes that an ELinOS environment is properly set up. If some environment
variables are missing, warn about which library may be missing. | Initialize debugger environment for ELinOS. | [
"Initialize",
"debugger",
"environment",
"for",
"ELinOS",
"."
] | def elinos_init():
"""Initialize debugger environment for ELinOS.
Let the debugger know where to find the ELinOS libraries on host. This
assumes that an ELinOS environment is properly set up. If some environment
variables are missing, warn about which library may be missing.
"""
elinos_env = ge... | [
"def",
"elinos_init",
"(",
")",
":",
"elinos_env",
"=",
"get_elinos_environment",
"(",
")",
"solib_dirs",
"=",
"[",
"]",
"# System libraries",
"if",
"None",
"in",
"(",
"elinos_env",
"[",
"key",
"]",
"for",
"key",
"in",
"(",
"\"cdk\"",
",",
"\"target\"",
")... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/system-gdbinit/elinos.py#L58-L87 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/_extends/parse/standard_method.py | python | choose | (x, choices, mode='clip') | return F.gather_nd(choices, indices).astype(dtype) | Construct an array from an index array and a list of arrays to choose from.
Args:
choices (sequence of arrays): Choice arrays. `a` and all of the `choices` must
be broadcastable to the same shape. If `choices` is itself an array, then
its outermost dimension (i.e., the one correspon... | Construct an array from an index array and a list of arrays to choose from. | [
"Construct",
"an",
"array",
"from",
"an",
"index",
"array",
"and",
"a",
"list",
"of",
"arrays",
"to",
"choose",
"from",
"."
] | def choose(x, choices, mode='clip'):
"""
Construct an array from an index array and a list of arrays to choose from.
Args:
choices (sequence of arrays): Choice arrays. `a` and all of the `choices` must
be broadcastable to the same shape. If `choices` is itself an array, then
... | [
"def",
"choose",
"(",
"x",
",",
"choices",
",",
"mode",
"=",
"'clip'",
")",
":",
"if",
"check_is_tensor",
"(",
"F",
".",
"typeof",
"(",
"choices",
")",
")",
":",
"shape_choice",
"=",
"infer_out_shape",
"(",
"x",
".",
"shape",
",",
"choices",
".",
"sh... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parse/standard_method.py#L912-L984 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/ma/core.py | python | make_mask_descr | (ndtype) | return np.dtype(_recursive_make_descr(ndtype, np.bool)) | Construct a dtype description list from a given dtype.
Returns a new dtype object, with the type of all fields in `ndtype` to a
boolean type. Field names are not altered.
Parameters
----------
ndtype : dtype
The dtype to convert.
Returns
-------
result : dtype
A dtype ... | Construct a dtype description list from a given dtype. | [
"Construct",
"a",
"dtype",
"description",
"list",
"from",
"a",
"given",
"dtype",
"."
] | def make_mask_descr(ndtype):
"""
Construct a dtype description list from a given dtype.
Returns a new dtype object, with the type of all fields in `ndtype` to a
boolean type. Field names are not altered.
Parameters
----------
ndtype : dtype
The dtype to convert.
Returns
--... | [
"def",
"make_mask_descr",
"(",
"ndtype",
")",
":",
"# Make sure we do have a dtype",
"if",
"not",
"isinstance",
"(",
"ndtype",
",",
"np",
".",
"dtype",
")",
":",
"ndtype",
"=",
"np",
".",
"dtype",
"(",
"ndtype",
")",
"return",
"np",
".",
"dtype",
"(",
"_... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L1203-L1236 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/engine/validators.py | python | check_cityscapes_dataset | (method) | return new_method | A wrapper that wraps a parameter checker around the original CityScapesDataset. | A wrapper that wraps a parameter checker around the original CityScapesDataset. | [
"A",
"wrapper",
"that",
"wraps",
"a",
"parameter",
"checker",
"around",
"the",
"original",
"CityScapesDataset",
"."
] | def check_cityscapes_dataset(method):
"""A wrapper that wraps a parameter checker around the original CityScapesDataset."""
@wraps(method)
def new_method(self, *args, **kwargs):
_, param_dict = parse_user_args(method, *args, **kwargs)
nreq_param_int = ['num_samples', 'num_parallel_workers'... | [
"def",
"check_cityscapes_dataset",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_",
",",
"param_dict",
"=",
"parse_user_args",
"(",
"method",
",",
"*"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/validators.py#L1994-L2027 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rrset.py | python | RRset.__eq__ | (self, other) | return super(RRset, self).__eq__(other) | Two RRsets are equal if they have the same name and the same
rdataset
@rtype: bool | Two RRsets are equal if they have the same name and the same
rdataset | [
"Two",
"RRsets",
"are",
"equal",
"if",
"they",
"have",
"the",
"same",
"name",
"and",
"the",
"same",
"rdataset"
] | def __eq__(self, other):
"""Two RRsets are equal if they have the same name and the same
rdataset
@rtype: bool"""
if not isinstance(other, RRset):
return False
if self.name != other.name:
return False
return super(RRset, self).__eq__(other) | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"RRset",
")",
":",
"return",
"False",
"if",
"self",
".",
"name",
"!=",
"other",
".",
"name",
":",
"return",
"False",
"return",
"super",
"(",
"RRset",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rrset.py#L65-L74 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | MenuItem_GetLabelText | (*args, **kwargs) | return _core_.MenuItem_GetLabelText(*args, **kwargs) | MenuItem_GetLabelText(String label) -> String | MenuItem_GetLabelText(String label) -> String | [
"MenuItem_GetLabelText",
"(",
"String",
"label",
")",
"-",
">",
"String"
] | def MenuItem_GetLabelText(*args, **kwargs):
"""MenuItem_GetLabelText(String label) -> String"""
return _core_.MenuItem_GetLabelText(*args, **kwargs) | [
"def",
"MenuItem_GetLabelText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_GetLabelText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L12632-L12634 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/losses.py | python | cosine_proximity | (y_true, y_pred, axis=-1) | return math_ops.reduce_sum(y_true * y_pred, axis=axis) | Computes the cosine similarity between labels and predictions. | Computes the cosine similarity between labels and predictions. | [
"Computes",
"the",
"cosine",
"similarity",
"between",
"labels",
"and",
"predictions",
"."
] | def cosine_proximity(y_true, y_pred, axis=-1):
"""Computes the cosine similarity between labels and predictions."""
y_true = nn.l2_normalize(y_true, axis=axis)
y_pred = nn.l2_normalize(y_pred, axis=axis)
return math_ops.reduce_sum(y_true * y_pred, axis=axis) | [
"def",
"cosine_proximity",
"(",
"y_true",
",",
"y_pred",
",",
"axis",
"=",
"-",
"1",
")",
":",
"y_true",
"=",
"nn",
".",
"l2_normalize",
"(",
"y_true",
",",
"axis",
"=",
"axis",
")",
"y_pred",
"=",
"nn",
".",
"l2_normalize",
"(",
"y_pred",
",",
"axis... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/losses.py#L1071-L1075 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Standard_Suite.py | python | Standard_Suite_Events.select | (self, _object=None, _attributes={}, **_arguments) | select: select the specified object
Required argument: the object to select
Keyword argument _attributes: AppleEvent attribute dictionary | select: select the specified object
Required argument: the object to select
Keyword argument _attributes: AppleEvent attribute dictionary | [
"select",
":",
"select",
"the",
"specified",
"object",
"Required",
"argument",
":",
"the",
"object",
"to",
"select",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary"
] | def select(self, _object=None, _attributes={}, **_arguments):
"""select: select the specified object
Required argument: the object to select
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'misc'
_subcode = 'slct'
if _arguments: raise Ty... | [
"def",
"select",
"(",
"self",
",",
"_object",
"=",
"None",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'misc'",
"_subcode",
"=",
"'slct'",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Standard_Suite.py#L129-L147 | ||
omnisci/omniscidb | b9c95f1bd602b4ffc8b0edf18bfad61031e08d86 | QueryEngine/scripts/generate_TableFunctionsFactory_init.py | python | Tokenize.consume_identifier | (self) | IDENTIFIER: [A-Za-z_][A-Za-z0-9_]* | IDENTIFIER: [A-Za-z_][A-Za-z0-9_]* | [
"IDENTIFIER",
":",
"[",
"A",
"-",
"Za",
"-",
"z_",
"]",
"[",
"A",
"-",
"Za",
"-",
"z0",
"-",
"9_",
"]",
"*"
] | def consume_identifier(self):
"""
IDENTIFIER: [A-Za-z_][A-Za-z0-9_]*
"""
while True:
char = self.lookahead()
if char and char.isalnum() or char == "_":
self.advance()
else:
break
self.add_token(Token.IDENTIFIER)
... | [
"def",
"consume_identifier",
"(",
"self",
")",
":",
"while",
"True",
":",
"char",
"=",
"self",
".",
"lookahead",
"(",
")",
"if",
"char",
"and",
"char",
".",
"isalnum",
"(",
")",
"or",
"char",
"==",
"\"_\"",
":",
"self",
".",
"advance",
"(",
")",
"e... | https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/QueryEngine/scripts/generate_TableFunctionsFactory_init.py#L570-L581 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/framework/constant_op.py | python | _constant_impl | (
value, dtype, shape, name, verify_shape, allow_broadcast) | return const_tensor | Implementation of constant. | Implementation of constant. | [
"Implementation",
"of",
"constant",
"."
] | def _constant_impl(
value, dtype, shape, name, verify_shape, allow_broadcast):
"""Implementation of constant."""
ctx = context.context()
if ctx.executing_eagerly():
if trace.enabled:
with trace.Trace("tf.constant"):
return _constant_eager_impl(ctx, value, dtype, shape, verify_shape)
retu... | [
"def",
"_constant_impl",
"(",
"value",
",",
"dtype",
",",
"shape",
",",
"name",
",",
"verify_shape",
",",
"allow_broadcast",
")",
":",
"ctx",
"=",
"context",
".",
"context",
"(",
")",
"if",
"ctx",
".",
"executing_eagerly",
"(",
")",
":",
"if",
"trace",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/constant_op.py#L271-L299 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/elastic/multiprocessing/api.py | python | to_map | (
val_or_map: Union[Std, Dict[int, Std]], local_world_size: int
) | Certain APIs take redirect settings either as a single value (e.g. apply to all
local ranks) or as an explicit user-provided mapping. This method is a convenience
method that converts a value or mapping into a mapping.
Example:
::
to_map(Std.OUT, local_world_size=2) # returns: {0: Std.OUT, 1: St... | Certain APIs take redirect settings either as a single value (e.g. apply to all
local ranks) or as an explicit user-provided mapping. This method is a convenience
method that converts a value or mapping into a mapping. | [
"Certain",
"APIs",
"take",
"redirect",
"settings",
"either",
"as",
"a",
"single",
"value",
"(",
"e",
".",
"g",
".",
"apply",
"to",
"all",
"local",
"ranks",
")",
"or",
"as",
"an",
"explicit",
"user",
"-",
"provided",
"mapping",
".",
"This",
"method",
"i... | def to_map(
val_or_map: Union[Std, Dict[int, Std]], local_world_size: int
) -> Dict[int, Std]:
"""
Certain APIs take redirect settings either as a single value (e.g. apply to all
local ranks) or as an explicit user-provided mapping. This method is a convenience
method that converts a value or mappin... | [
"def",
"to_map",
"(",
"val_or_map",
":",
"Union",
"[",
"Std",
",",
"Dict",
"[",
"int",
",",
"Std",
"]",
"]",
",",
"local_world_size",
":",
"int",
")",
"->",
"Dict",
"[",
"int",
",",
"Std",
"]",
":",
"if",
"isinstance",
"(",
"val_or_map",
",",
"Std"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/elastic/multiprocessing/api.py#L139-L161 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | PseudoDC.DrawIdToDC | (*args, **kwargs) | return _gdi_.PseudoDC_DrawIdToDC(*args, **kwargs) | DrawIdToDC(self, int id, DC dc)
Draw recorded operations of id to dc. | DrawIdToDC(self, int id, DC dc) | [
"DrawIdToDC",
"(",
"self",
"int",
"id",
"DC",
"dc",
")"
] | def DrawIdToDC(*args, **kwargs):
"""
DrawIdToDC(self, int id, DC dc)
Draw recorded operations of id to dc.
"""
return _gdi_.PseudoDC_DrawIdToDC(*args, **kwargs) | [
"def",
"DrawIdToDC",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"PseudoDC_DrawIdToDC",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L7686-L7692 | |
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | Cursor.displayname | (self) | return self._displayname | Return the display name for the entity referenced by this cursor.
The display name contains extra information that helps identify the cursor,
such as the parameters of a function or template or the arguments of a
class template specialization. | Return the display name for the entity referenced by this cursor. | [
"Return",
"the",
"display",
"name",
"for",
"the",
"entity",
"referenced",
"by",
"this",
"cursor",
"."
] | def displayname(self):
"""
Return the display name for the entity referenced by this cursor.
The display name contains extra information that helps identify the cursor,
such as the parameters of a function or template or the arguments of a
class template specialization.
... | [
"def",
"displayname",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_displayname'",
")",
":",
"self",
".",
"_displayname",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorDisplayName",
"(",
"self",
")",
"return",
"self",
".",
"_displayna... | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L1267-L1278 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/http/server.py | python | BaseHTTPRequestHandler.log_error | (self, format, *args) | Log an error.
This is called when a request cannot be fulfilled. By
default it passes the message on to log_message().
Arguments are the same as for log_message().
XXX This should go to the separate error log. | Log an error. | [
"Log",
"an",
"error",
"."
] | def log_error(self, format, *args):
"""Log an error.
This is called when a request cannot be fulfilled. By
default it passes the message on to log_message().
Arguments are the same as for log_message().
XXX This should go to the separate error log.
"""
self.... | [
"def",
"log_error",
"(",
"self",
",",
"format",
",",
"*",
"args",
")",
":",
"self",
".",
"log_message",
"(",
"format",
",",
"*",
"args",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/http/server.py#L546-L558 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/sum-of-left-leaves.py | python | Solution.sumOfLeftLeaves | (self, root) | return sumOfLeftLeavesHelper(root, False) | :type root: TreeNode
:rtype: int | :type root: TreeNode
:rtype: int | [
":",
"type",
"root",
":",
"TreeNode",
":",
"rtype",
":",
"int"
] | def sumOfLeftLeaves(self, root):
"""
:type root: TreeNode
:rtype: int
"""
def sumOfLeftLeavesHelper(root, is_left):
if not root:
return 0
if not root.left and not root.right:
return root.val if is_left else 0
ret... | [
"def",
"sumOfLeftLeaves",
"(",
"self",
",",
"root",
")",
":",
"def",
"sumOfLeftLeavesHelper",
"(",
"root",
",",
"is_left",
")",
":",
"if",
"not",
"root",
":",
"return",
"0",
"if",
"not",
"root",
".",
"left",
"and",
"not",
"root",
".",
"right",
":",
"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/sum-of-left-leaves.py#L5-L18 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/email/utils.py | python | parseaddr | (addr) | return addrs[0] | Parse addr into its constituent realname and email address parts.
Return a tuple of realname and email address, unless the parse fails, in
which case return a 2-tuple of ('', ''). | Parse addr into its constituent realname and email address parts. | [
"Parse",
"addr",
"into",
"its",
"constituent",
"realname",
"and",
"email",
"address",
"parts",
"."
] | def parseaddr(addr):
"""
Parse addr into its constituent realname and email address parts.
Return a tuple of realname and email address, unless the parse fails, in
which case return a 2-tuple of ('', '').
"""
addrs = _AddressList(addr).addresslist
if not addrs:
return '', ''
ret... | [
"def",
"parseaddr",
"(",
"addr",
")",
":",
"addrs",
"=",
"_AddressList",
"(",
"addr",
")",
".",
"addresslist",
"if",
"not",
"addrs",
":",
"return",
"''",
",",
"''",
"return",
"addrs",
"[",
"0",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/email/utils.py#L213-L223 | |
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/esptool/serial/tools/miniterm.py | python | Miniterm.start | (self) | start worker threads | start worker threads | [
"start",
"worker",
"threads"
] | def start(self):
"""start worker threads"""
self.alive = True
self._start_reader()
# enter console->serial loop
self.transmitter_thread = threading.Thread(target=self.writer, name='tx')
self.transmitter_thread.daemon = True
self.transmitter_thread.start()
... | [
"def",
"start",
"(",
"self",
")",
":",
"self",
".",
"alive",
"=",
"True",
"self",
".",
"_start_reader",
"(",
")",
"# enter console->serial loop",
"self",
".",
"transmitter_thread",
"=",
"threading",
".",
"Thread",
"(",
"target",
"=",
"self",
".",
"writer",
... | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/serial/tools/miniterm.py#L373-L381 | ||
envoyproxy/envoy-wasm | ab5d9381fdf92a1efa0b87cff80036b5b3e81198 | tools/envoy_headersplit/headersplit.py | python | get_directives | (translation_unit: Type[TranslationUnit]) | return "" | "extracts" all header includes statements and other directives from the target source code file
for instance:
foo.h:
#pragma once
#include "a.h"
#include "b.h"
int foo(){
}
this function should return
'#pragma once\n#include "a.h"\n#include "b.h"'
Args:
translation_u... | "extracts" all header includes statements and other directives from the target source code file | [
"extracts",
"all",
"header",
"includes",
"statements",
"and",
"other",
"directives",
"from",
"the",
"target",
"source",
"code",
"file"
] | def get_directives(translation_unit: Type[TranslationUnit]) -> str:
"""
"extracts" all header includes statements and other directives from the target source code file
for instance:
foo.h:
#pragma once
#include "a.h"
#include "b.h"
int foo(){
}
this function should return
... | [
"def",
"get_directives",
"(",
"translation_unit",
":",
"Type",
"[",
"TranslationUnit",
"]",
")",
"->",
"str",
":",
"cursor",
"=",
"translation_unit",
".",
"cursor",
"for",
"descendant",
"in",
"cursor",
".",
"walk_preorder",
"(",
")",
":",
"if",
"descendant",
... | https://github.com/envoyproxy/envoy-wasm/blob/ab5d9381fdf92a1efa0b87cff80036b5b3e81198/tools/envoy_headersplit/headersplit.py#L39-L73 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/numpy/_op.py | python | pad | (x, pad_width, mode='constant', **kwargs) | return _api_internal.pad(x, pad_width, 'constant', 0, "even") | Pad an array.
Parameters
----------
array : array_like of rank N
The array to pad.
pad_width : {sequence, array_like, int}
Number of values padded to the edges of each axis.
((before_1, after_1), ... (before_N, after_N)) unique pad widths
for each axis.
((before,... | Pad an array. | [
"Pad",
"an",
"array",
"."
] | def pad(x, pad_width, mode='constant', **kwargs): # pylint: disable=too-many-arguments
"""
Pad an array.
Parameters
----------
array : array_like of rank N
The array to pad.
pad_width : {sequence, array_like, int}
Number of values padded to the edges of each axis.
((befo... | [
"def",
"pad",
"(",
"x",
",",
"pad_width",
",",
"mode",
"=",
"'constant'",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=too-many-arguments",
"# pylint: disable = too-many-return-statements, inconsistent-return-statements",
"if",
"not",
"_np",
".",
"asarray",
"("... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/numpy/_op.py#L9391-L9521 | |
taichi-dev/taichi | 973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6 | python/taichi/lang/ops.py | python | bit_xor | (a, b) | return _binary_operation(_ti_core.expr_bit_xor, _bt_ops_mod.xor, a, b) | Compute bitwise-xor
Args:
a (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): value LHS
b (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): value RHS
Returns:
Union[:class:`~taichi.lang.expr.Expr`, bool]: LHS bitwise-xor with RH... | Compute bitwise-xor | [
"Compute",
"bitwise",
"-",
"xor"
] | def bit_xor(a, b):
"""Compute bitwise-xor
Args:
a (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): value LHS
b (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): value RHS
Returns:
Union[:class:`~taichi.lang.expr.Expr`, bool... | [
"def",
"bit_xor",
"(",
"a",
",",
"b",
")",
":",
"return",
"_binary_operation",
"(",
"_ti_core",
".",
"expr_bit_xor",
",",
"_bt_ops_mod",
".",
"xor",
",",
"a",
",",
"b",
")"
] | https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/ops.py#L711-L722 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pyparsing.py | python | ParserElement.setWhitespaceChars | (self, chars) | return self | Overrides the default whitespace chars | Overrides the default whitespace chars | [
"Overrides",
"the",
"default",
"whitespace",
"chars"
] | def setWhitespaceChars(self, chars):
"""
Overrides the default whitespace chars
"""
self.skipWhitespace = True
self.whiteChars = chars
self.copyDefaultWhiteChars = False
return self | [
"def",
"setWhitespaceChars",
"(",
"self",
",",
"chars",
")",
":",
"self",
".",
"skipWhitespace",
"=",
"True",
"self",
".",
"whiteChars",
"=",
"chars",
"self",
".",
"copyDefaultWhiteChars",
"=",
"False",
"return",
"self"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pyparsing.py#L2450-L2457 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/Operation/PhactoriVectorProject.py | python | PhactoriVectorProject.CreateParaViewFilter | (self, inInputFilter) | return newParaViewFilter | create the projection calculators for ParaView | create the projection calculators for ParaView | [
"create",
"the",
"projection",
"calculators",
"for",
"ParaView"
] | def CreateParaViewFilter(self, inInputFilter):
"""create the projection calculators for ParaView"""
if PhactoriDbg(100):
myDebugPrint3("PhactoriVectorProject.CreateParaViewFilter "
"entered\n", 100)
savedActiveSource = GetActiveSource()
UpdatePipelineWithCurrentTimeArgument(inInputFilt... | [
"def",
"CreateParaViewFilter",
"(",
"self",
",",
"inInputFilter",
")",
":",
"if",
"PhactoriDbg",
"(",
"100",
")",
":",
"myDebugPrint3",
"(",
"\"PhactoriVectorProject.CreateParaViewFilter \"",
"\"entered\\n\"",
",",
"100",
")",
"savedActiveSource",
"=",
"GetActiveSource"... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/Operation/PhactoriVectorProject.py#L56-L103 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Task.py | python | Task.set_inputs | (self, inp) | Append the nodes to the *inputs*
:param inp: input nodes
:type inp: node or list of nodes | Append the nodes to the *inputs* | [
"Append",
"the",
"nodes",
"to",
"the",
"*",
"inputs",
"*"
] | def set_inputs(self, inp):
"""
Append the nodes to the *inputs*
:param inp: input nodes
:type inp: node or list of nodes
"""
if isinstance(inp, list): self.inputs += inp
else: self.inputs.append(inp) | [
"def",
"set_inputs",
"(",
"self",
",",
"inp",
")",
":",
"if",
"isinstance",
"(",
"inp",
",",
"list",
")",
":",
"self",
".",
"inputs",
"+=",
"inp",
"else",
":",
"self",
".",
"inputs",
".",
"append",
"(",
"inp",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Task.py#L499-L507 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.