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
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Import/App/automotive_design.py
python
build_axes
(axis,ref_direction,)
return [d2,normalise(cross_product(d1,d2)).vector.orientation,d1]
:param axis :type axis:direction :param ref_direction :type ref_direction:direction
:param axis :type axis:direction :param ref_direction :type ref_direction:direction
[ ":", "param", "axis", ":", "type", "axis", ":", "direction", ":", "param", "ref_direction", ":", "type", "ref_direction", ":", "direction" ]
def build_axes(axis,ref_direction,): ''' :param axis :type axis:direction :param ref_direction :type ref_direction:direction ''' d1 = NVL(normalise(axis),dummy_gri == direction([0,0,1])) d2 = first_proj_axis(d1,ref_direction) return [d2,normalise(cross_product(d1,d2)).vector.orientation,d1]
[ "def", "build_axes", "(", "axis", ",", "ref_direction", ",", ")", ":", "d1", "=", "NVL", "(", "normalise", "(", "axis", ")", ",", "dummy_gri", "==", "direction", "(", "[", "0", ",", "0", ",", "1", "]", ")", ")", "d2", "=", "first_proj_axis", "(", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Import/App/automotive_design.py#L40743-L40752
cocos-creator/engine-native
984c4c9f5838253313b44ccd429bd8fac4ec8a6a
tools/bindings-generator/clang/cindex.py
python
CompileCommand.filename
(self)
return conf.lib.clang_CompileCommand_getFilename(self.cmd)
Get the working filename for this CompileCommand
Get the working filename for this CompileCommand
[ "Get", "the", "working", "filename", "for", "this", "CompileCommand" ]
def filename(self): """Get the working filename for this CompileCommand""" return conf.lib.clang_CompileCommand_getFilename(self.cmd)
[ "def", "filename", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_CompileCommand_getFilename", "(", "self", ".", "cmd", ")" ]
https://github.com/cocos-creator/engine-native/blob/984c4c9f5838253313b44ccd429bd8fac4ec8a6a/tools/bindings-generator/clang/cindex.py#L3184-L3186
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/distribute/tpu_values.py
python
TPUVariableMixin._dense_var_to_tensor
(self, dtype=None, name=None, as_ref=False)
Converts a variable to a tensor.
Converts a variable to a tensor.
[ "Converts", "a", "variable", "to", "a", "tensor", "." ]
def _dense_var_to_tensor(self, dtype=None, name=None, as_ref=False): """Converts a variable to a tensor.""" # pylint: disable=protected-access if tpu_util.enclosing_tpu_context() is None: return super(TPUVariableMixin, self)._dense_var_to_tensor( dtype=dtype, name=name, as_ref=as_ref) # ...
[ "def", "_dense_var_to_tensor", "(", "self", ",", "dtype", "=", "None", ",", "name", "=", "None", ",", "as_ref", "=", "False", ")", ":", "# pylint: disable=protected-access", "if", "tpu_util", ".", "enclosing_tpu_context", "(", ")", "is", "None", ":", "return",...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/tpu_values.py#L139-L149
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/round_ds.py
python
_round_ds_tbe
()
return
Round TBE register
Round TBE register
[ "Round", "TBE", "register" ]
def _round_ds_tbe(): """Round TBE register""" return
[ "def", "_round_ds_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/round_ds.py#L37-L39
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/mailbox.py
python
Mailbox.keys
(self)
return list(self.iterkeys())
Return a list of keys.
Return a list of keys.
[ "Return", "a", "list", "of", "keys", "." ]
def keys(self): """Return a list of keys.""" return list(self.iterkeys())
[ "def", "keys", "(", "self", ")", ":", "return", "list", "(", "self", ".", "iterkeys", "(", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mailbox.py#L100-L102
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/random_forest.py
python
TensorForestEstimator.predict
( self, x=None, input_fn=None, axis=None, batch_size=None, as_iterable=False)
Returns predictions for given features. Args: x: features. input_fn: Input function. If set, x must be None. axis: Axis on which to argmax (for classification). Last axis is used by default. batch_size: Override default batch size. as_iterable: If True, return an iterable ...
Returns predictions for given features.
[ "Returns", "predictions", "for", "given", "features", "." ]
def predict( self, x=None, input_fn=None, axis=None, batch_size=None, as_iterable=False): """Returns predictions for given features. Args: x: features. input_fn: Input function. If set, x must be None. axis: Axis on which to argmax (for classification). Last axis is us...
[ "def", "predict", "(", "self", ",", "x", "=", "None", ",", "input_fn", "=", "None", ",", "axis", "=", "None", ",", "batch_size", "=", "None", ",", "as_iterable", "=", "False", ")", ":", "probabilities", "=", "self", ".", "predict_proba", "(", "x", "=...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/random_forest.py#L125-L153
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/layers/python/layers/feature_column.py
python
embedding_column
(sparse_id_column, dimension, combiner="mean", initializer=None, ckpt_to_load_from=None, tensor_name_in_ckpt=None, max_norm=None, trainable=True)
return _EmbeddingColumn(sparse_id_column, dimension, combiner, initializer, ckpt_to_load_from, tensor_name_in_ckpt, max_norm=max_norm, trainable=trainable)
Creates an `_EmbeddingColumn` for feeding sparse data into a DNN. Args: sparse_id_column: A `_SparseColumn` which is created by for example `sparse_column_with_*` or crossed_column functions. Note that `combiner` defined in `sparse_id_column` is ignored. dimension: An integer specifying dimension...
Creates an `_EmbeddingColumn` for feeding sparse data into a DNN.
[ "Creates", "an", "_EmbeddingColumn", "for", "feeding", "sparse", "data", "into", "a", "DNN", "." ]
def embedding_column(sparse_id_column, dimension, combiner="mean", initializer=None, ckpt_to_load_from=None, tensor_name_in_ckpt=None, max_norm=None, trainable=True): """C...
[ "def", "embedding_column", "(", "sparse_id_column", ",", "dimension", ",", "combiner", "=", "\"mean\"", ",", "initializer", "=", "None", ",", "ckpt_to_load_from", "=", "None", ",", "tensor_name_in_ckpt", "=", "None", ",", "max_norm", "=", "None", ",", "trainable...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/feature_column.py#L1259-L1302
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/vis/backends/qtbackend.py
python
QtGLWindow.setProgram
(self,program)
User will call this to set up the program variable
User will call this to set up the program variable
[ "User", "will", "call", "this", "to", "set", "up", "the", "program", "variable" ]
def setProgram(self,program): """User will call this to set up the program variable""" from ..glprogram import GLProgram assert isinstance(program,GLProgram) print("######### QGLWidget setProgram ###############") if hasattr(program,'name'): self.name = program.name ...
[ "def", "setProgram", "(", "self", ",", "program", ")", ":", "from", ".", ".", "glprogram", "import", "GLProgram", "assert", "isinstance", "(", "program", ",", "GLProgram", ")", "print", "(", "\"######### QGLWidget setProgram ###############\"", ")", "if", "hasattr...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/backends/qtbackend.py#L130-L155
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/_pyio.py
python
IOBase.readlines
(self, hint=None)
return lines
Return a list of lines from the stream. hint can be specified to control the number of lines read: no more lines will be read if the total size (in bytes/characters) of all lines so far exceeds hint.
Return a list of lines from the stream.
[ "Return", "a", "list", "of", "lines", "from", "the", "stream", "." ]
def readlines(self, hint=None): """Return a list of lines from the stream. hint can be specified to control the number of lines read: no more lines will be read if the total size (in bytes/characters) of all lines so far exceeds hint. """ if hint is None or hint <= 0: ...
[ "def", "readlines", "(", "self", ",", "hint", "=", "None", ")", ":", "if", "hint", "is", "None", "or", "hint", "<=", "0", ":", "return", "list", "(", "self", ")", "n", "=", "0", "lines", "=", "[", "]", "for", "line", "in", "self", ":", "lines",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/_pyio.py#L577-L593
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py
python
transpose
(a, axes=None)
reorder dimensions per tuple axes
reorder dimensions per tuple axes
[ "reorder", "dimensions", "per", "tuple", "axes" ]
def transpose(a, axes=None): "reorder dimensions per tuple axes" m = getmask(a) d = filled(a) if m is nomask: return masked_array(numeric.transpose(d, axes)) else: return masked_array(numeric.transpose(d, axes), mask = numeric.transpose(m, axes))
[ "def", "transpose", "(", "a", ",", "axes", "=", "None", ")", ":", "m", "=", "getmask", "(", "a", ")", "d", "=", "filled", "(", "a", ")", "if", "m", "is", "nomask", ":", "return", "masked_array", "(", "numeric", ".", "transpose", "(", "d", ",", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L1892-L1900
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/functional/tensor.py
python
full_like
( inp: Union[Tensor, SymbolVar], value: Union[int, float] )
return broadcast_to(x, inp.shape)
r"""Returns a tensor filled with given value with the same shape as input tensor. Args: inp: input tensor. value: target value. Return: output tensor. Examples: .. testcode:: import numpy as np from megengine import tensor import megen...
r"""Returns a tensor filled with given value with the same shape as input tensor.
[ "r", "Returns", "a", "tensor", "filled", "with", "given", "value", "with", "the", "same", "shape", "as", "input", "tensor", "." ]
def full_like( inp: Union[Tensor, SymbolVar], value: Union[int, float] ) -> Union[Tensor, SymbolVar]: r"""Returns a tensor filled with given value with the same shape as input tensor. Args: inp: input tensor. value: target value. Return: output tensor. Examples: ....
[ "def", "full_like", "(", "inp", ":", "Union", "[", "Tensor", ",", "SymbolVar", "]", ",", "value", ":", "Union", "[", "int", ",", "float", "]", ")", "->", "Union", "[", "Tensor", ",", "SymbolVar", "]", ":", "(", "x", ",", ")", "=", "Const", "(", ...
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/tensor.py#L288-L323
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBTarget.SetLaunchInfo
(self, *args)
return _lldb.SBTarget_SetLaunchInfo(self, *args)
SetLaunchInfo(self, SBLaunchInfo launch_info)
SetLaunchInfo(self, SBLaunchInfo launch_info)
[ "SetLaunchInfo", "(", "self", "SBLaunchInfo", "launch_info", ")" ]
def SetLaunchInfo(self, *args): """SetLaunchInfo(self, SBLaunchInfo launch_info)""" return _lldb.SBTarget_SetLaunchInfo(self, *args)
[ "def", "SetLaunchInfo", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBTarget_SetLaunchInfo", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L9322-L9324
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
GetCmnNbrs
(*args)
return _snap.GetCmnNbrs(*args)
GetCmnNbrs(PNEANet Graph, int const & NId1, int const & NId2) -> int Parameters: Graph: TPt< TNEANet > const & NId1: int const & NId2: int const & GetCmnNbrs(PNEANet Graph, int const & NId1, int const & NId2, TIntV NbrV) -> int Parameters: Graph: TPt< TNEANet > const & ...
GetCmnNbrs(PNEANet Graph, int const & NId1, int const & NId2) -> int
[ "GetCmnNbrs", "(", "PNEANet", "Graph", "int", "const", "&", "NId1", "int", "const", "&", "NId2", ")", "-", ">", "int" ]
def GetCmnNbrs(*args): """ GetCmnNbrs(PNEANet Graph, int const & NId1, int const & NId2) -> int Parameters: Graph: TPt< TNEANet > const & NId1: int const & NId2: int const & GetCmnNbrs(PNEANet Graph, int const & NId1, int const & NId2, TIntV NbrV) -> int Parameters: ...
[ "def", "GetCmnNbrs", "(", "*", "args", ")", ":", "return", "_snap", ".", "GetCmnNbrs", "(", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L25307-L25325
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/lite/python/lite.py
python
QuantizationMode._validate_full_integer_quantization_bias_type
(self)
Validates bias type for full interger quantization.
Validates bias type for full interger quantization.
[ "Validates", "bias", "type", "for", "full", "interger", "quantization", "." ]
def _validate_full_integer_quantization_bias_type(self): """Validates bias type for full interger quantization.""" bias_type = self._full_integer_quantization_bias_type if not bias_type: return if self.activations_type() == _dtypes.float32: raise ValueError( "`full_integer_quantiz...
[ "def", "_validate_full_integer_quantization_bias_type", "(", "self", ")", ":", "bias_type", "=", "self", ".", "_full_integer_quantization_bias_type", "if", "not", "bias_type", ":", "return", "if", "self", ".", "activations_type", "(", ")", "==", "_dtypes", ".", "flo...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/python/lite.py#L442-L462
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/base.py
python
TensorFlowEstimator.predict
(self, x, axis=1, batch_size=None)
return self._predict(x, axis=axis, batch_size=batch_size)
Predict class or regression for `x`. For a classification model, the predicted class for each sample in `x` is returned. For a regression model, the predicted value based on `x` is returned. Args: x: array-like matrix, [n_samples, n_features...] or iterator. axis: Which axis to argmax for c...
Predict class or regression for `x`.
[ "Predict", "class", "or", "regression", "for", "x", "." ]
def predict(self, x, axis=1, batch_size=None): """Predict class or regression for `x`. For a classification model, the predicted class for each sample in `x` is returned. For a regression model, the predicted value based on `x` is returned. Args: x: array-like matrix, [n_samples, n_features.....
[ "def", "predict", "(", "self", ",", "x", ",", "axis", "=", "1", ",", "batch_size", "=", "None", ")", ":", "return", "self", ".", "_predict", "(", "x", ",", "axis", "=", "axis", ",", "batch_size", "=", "batch_size", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/base.py#L224-L243
fengbingchun/NN_Test
d6305825d5273e4569ccd1eda9ffa2a9c72e18d2
src/tiny-dnn/third_party/cpplint.py
python
_FunctionState.End
(self)
Stop analyzing function body.
Stop analyzing function body.
[ "Stop", "analyzing", "function", "body", "." ]
def End(self): """Stop analyzing function body.""" self.in_a_function = False
[ "def", "End", "(", "self", ")", ":", "self", ".", "in_a_function", "=", "False" ]
https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/cpplint.py#L1240-L1242
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/signal/signaltools.py
python
_inputs_swap_needed
(mode, shape1, shape2)
return False
If in 'valid' mode, returns whether or not the input arrays need to be swapped depending on whether `shape1` is at least as large as `shape2` in every dimension. This is important for some of the correlation and convolution implementations in this module, where the larger array input needs to come ...
If in 'valid' mode, returns whether or not the input arrays need to be swapped depending on whether `shape1` is at least as large as `shape2` in every dimension.
[ "If", "in", "valid", "mode", "returns", "whether", "or", "not", "the", "input", "arrays", "need", "to", "be", "swapped", "depending", "on", "whether", "shape1", "is", "at", "least", "as", "large", "as", "shape2", "in", "every", "dimension", "." ]
def _inputs_swap_needed(mode, shape1, shape2): """ If in 'valid' mode, returns whether or not the input arrays need to be swapped depending on whether `shape1` is at least as large as `shape2` in every dimension. This is important for some of the correlation and convolution implementations in t...
[ "def", "_inputs_swap_needed", "(", "mode", ",", "shape1", ",", "shape2", ")", ":", "if", "mode", "==", "'valid'", ":", "ok1", ",", "ok2", "=", "True", ",", "True", "for", "d1", ",", "d2", "in", "zip", "(", "shape1", ",", "shape2", ")", ":", "if", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/signaltools.py#L74-L102
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/pg_autoscaler/module.py
python
PgAutoscaler._calc_final_pg_target
( self, p: Dict[str, Any], pool_name: str, root_map: Dict[int, CrushSubtreeResourceStatus], root_id: int, capacity_ratio: float, bias: float, even_pools: Dict[str, Dict[str, Any]], bulk_pools: Dict[str, Dict[str,...
return final_ratio, pool_pg_target, final_pg_target
`profile` determines behaviour of the autoscaler. `first_pass` flag used to determine if this is the first pass where the caller tries to calculate/adjust pools that has used_ratio > even_ratio else this is the second pass, we calculate final_ratio by giving it 1 / pool_count of ...
`profile` determines behaviour of the autoscaler. `first_pass` flag used to determine if this is the first pass where the caller tries to calculate/adjust pools that has used_ratio > even_ratio else this is the second pass, we calculate final_ratio by giving it 1 / pool_count of ...
[ "profile", "determines", "behaviour", "of", "the", "autoscaler", ".", "first_pass", "flag", "used", "to", "determine", "if", "this", "is", "the", "first", "pass", "where", "the", "caller", "tries", "to", "calculate", "/", "adjust", "pools", "that", "has", "u...
def _calc_final_pg_target( self, p: Dict[str, Any], pool_name: str, root_map: Dict[int, CrushSubtreeResourceStatus], root_id: int, capacity_ratio: float, bias: float, even_pools: Dict[str, Dict[str, Any]], bulk_p...
[ "def", "_calc_final_pg_target", "(", "self", ",", "p", ":", "Dict", "[", "str", ",", "Any", "]", ",", "pool_name", ":", "str", ",", "root_map", ":", "Dict", "[", "int", ",", "CrushSubtreeResourceStatus", "]", ",", "root_id", ":", "int", ",", "capacity_ra...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/pg_autoscaler/module.py#L430-L511
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
kratos/python_scripts/sympy_fe_utilities.py
python
div
(DN,x)
return Matrix( [ simplify(div_x) ])
This method defines the divergence Keyword arguments: DN -- The shape function derivatives x -- The variable to compute the gradient
This method defines the divergence
[ "This", "method", "defines", "the", "divergence" ]
def div(DN,x): """ This method defines the divergence Keyword arguments: DN -- The shape function derivatives x -- The variable to compute the gradient """ if(DN.shape != x.shape): raise Exception("shapes are not compatible") div_x = 0 for i in range(0,DN.shape[0]): for...
[ "def", "div", "(", "DN", ",", "x", ")", ":", "if", "(", "DN", ".", "shape", "!=", "x", ".", "shape", ")", ":", "raise", "Exception", "(", "\"shapes are not compatible\"", ")", "div_x", "=", "0", "for", "i", "in", "range", "(", "0", ",", "DN", "."...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/sympy_fe_utilities.py#L181-L196
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/state_ops.py
python
assign_add
(ref, value, use_locking=None, name=None)
return ref.assign_add(value)
Update `ref` by adding `value` to it. This operation outputs "ref" after the update is done. This makes it easier to chain operations that need to use the reset value. Unlike `tf.math.add`, this op does not broadcast. `ref` and `value` must have the same shape. Args: ref: A mutable `Tensor`. Must be one...
Update `ref` by adding `value` to it.
[ "Update", "ref", "by", "adding", "value", "to", "it", "." ]
def assign_add(ref, value, use_locking=None, name=None): """Update `ref` by adding `value` to it. This operation outputs "ref" after the update is done. This makes it easier to chain operations that need to use the reset value. Unlike `tf.math.add`, this op does not broadcast. `ref` and `value` must have the...
[ "def", "assign_add", "(", "ref", ",", "value", ",", "use_locking", "=", "None", ",", "name", "=", "None", ")", ":", "if", "ref", ".", "dtype", ".", "_is_ref_dtype", ":", "return", "gen_state_ops", ".", "assign_add", "(", "ref", ",", "value", ",", "use_...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/state_ops.py#L168-L195
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/vision/transforms/functional.py
python
adjust_brightness
(img, brightness_factor)
Adjusts brightness of an Image. Args: img (PIL.Image|np.array): Image to be adjusted. brightness_factor (float): How much to adjust the brightness. Can be any non negative number. 0 gives a black image, 1 gives the original image while 2 increases the brightness by a factor ...
Adjusts brightness of an Image.
[ "Adjusts", "brightness", "of", "an", "Image", "." ]
def adjust_brightness(img, brightness_factor): """Adjusts brightness of an Image. Args: img (PIL.Image|np.array): Image to be adjusted. brightness_factor (float): How much to adjust the brightness. Can be any non negative number. 0 gives a black image, 1 gives the origin...
[ "def", "adjust_brightness", "(", "img", ",", "brightness_factor", ")", ":", "if", "not", "(", "_is_pil_image", "(", "img", ")", "or", "_is_numpy_image", "(", "img", ")", ")", ":", "raise", "TypeError", "(", "'img should be PIL Image or ndarray with dim=[2 or 3]. Got...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/vision/transforms/functional.py#L367-L401
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/metrics/python/ops/metric_ops.py
python
streaming_covariance
(predictions, labels, weights=None, metrics_collections=None, updates_collections=None, name=None)
return covariance, update_op
Computes the unbiased sample covariance between `predictions` and `labels`. The `streaming_covariance` function creates four local variables, `comoment`, `mean_prediction`, `mean_label`, and `count`, which are used to compute the sample covariance between predictions and labels across multiple batches of data....
Computes the unbiased sample covariance between `predictions` and `labels`.
[ "Computes", "the", "unbiased", "sample", "covariance", "between", "predictions", "and", "labels", "." ]
def streaming_covariance(predictions, labels, weights=None, metrics_collections=None, updates_collections=None, name=None): """Computes the unbiased sample covariance between `predictions` and ...
[ "def", "streaming_covariance", "(", "predictions", ",", "labels", ",", "weights", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ")", ":", "with", "variable_scope", ".", "variable_scope", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/metrics/python/ops/metric_ops.py#L2312-L2435
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/attrs/attr/_funcs.py
python
resolve_types
(cls, globalns=None, localns=None, attribs=None)
return cls
Resolve any strings and forward annotations in type annotations. This is only required if you need concrete types in `Attribute`'s *type* field. In other words, you don't need to resolve your types if you only use them for static type checking. With no arguments, names will be looked up in the module ...
Resolve any strings and forward annotations in type annotations.
[ "Resolve", "any", "strings", "and", "forward", "annotations", "in", "type", "annotations", "." ]
def resolve_types(cls, globalns=None, localns=None, attribs=None): """ Resolve any strings and forward annotations in type annotations. This is only required if you need concrete types in `Attribute`'s *type* field. In other words, you don't need to resolve your types if you only use them for stati...
[ "def", "resolve_types", "(", "cls", ",", "globalns", "=", "None", ",", "localns", "=", "None", ",", "attribs", "=", "None", ")", ":", "try", ":", "# Since calling get_type_hints is expensive we cache whether we've", "# done it already.", "cls", ".", "__attrs_types_res...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/attrs/attr/_funcs.py#L346-L395
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Action.py
python
_do_create_action
(act, kw)
return None
This is the actual "implementation" for the Action factory method, below. This handles the fact that passing lists to Action() itself has different semantics than passing lists as elements of lists. The former will create a ListAction, the latter will create a CommandAction by converting the i...
This is the actual "implementation" for the Action factory method, below. This handles the fact that passing lists to Action() itself has different semantics than passing lists as elements of lists.
[ "This", "is", "the", "actual", "implementation", "for", "the", "Action", "factory", "method", "below", ".", "This", "handles", "the", "fact", "that", "passing", "lists", "to", "Action", "()", "itself", "has", "different", "semantics", "than", "passing", "lists...
def _do_create_action(act, kw): """This is the actual "implementation" for the Action factory method, below. This handles the fact that passing lists to Action() itself has different semantics than passing lists as elements of lists. The former will create a ListAction, the latter will cre...
[ "def", "_do_create_action", "(", "act", ",", "kw", ")", ":", "if", "isinstance", "(", "act", ",", "ActionBase", ")", ":", "return", "act", "if", "is_String", "(", "act", ")", ":", "var", "=", "SCons", ".", "Util", ".", "get_environment_var", "(", "act"...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Action.py#L441-L491
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/ceph_manager.py
python
CephManager.get_pgids_to_cancel_force
(self, backfill)
return pgids
Return the randomized list of PGs whose recovery/backfill priority is forced
Return the randomized list of PGs whose recovery/backfill priority is forced
[ "Return", "the", "randomized", "list", "of", "PGs", "whose", "recovery", "/", "backfill", "priority", "is", "forced" ]
def get_pgids_to_cancel_force(self, backfill): """ Return the randomized list of PGs whose recovery/backfill priority is forced """ j = self.get_pg_stats(); pgids = [] if backfill: wanted = 'forced_backfill' else: wanted = 'forced_recovery' f...
[ "def", "get_pgids_to_cancel_force", "(", "self", ",", "backfill", ")", ":", "j", "=", "self", ".", "get_pg_stats", "(", ")", "pgids", "=", "[", "]", "if", "backfill", ":", "wanted", "=", "'forced_backfill'", "else", ":", "wanted", "=", "'forced_recovery'", ...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph_manager.py#L2376-L2390
apache/singa
93fd9da72694e68bfe3fb29d0183a65263d238a1
python/singa/sonnx.py
python
SingaBackend._create_scatter_elements
(cls, onnx_node, operator, opset_version=_opset_version)
return operator(None, None, axis)
get the ScatterElements from the onnx node Args: onnx_node(OnnxNode): a given onnx node operator (Operator Class): a singa operator class opset_version(int): the opset version Returns: singa operator instance
get the ScatterElements from the onnx node Args: onnx_node(OnnxNode): a given onnx node operator (Operator Class): a singa operator class opset_version(int): the opset version Returns: singa operator instance
[ "get", "the", "ScatterElements", "from", "the", "onnx", "node", "Args", ":", "onnx_node", "(", "OnnxNode", ")", ":", "a", "given", "onnx", "node", "operator", "(", "Operator", "Class", ")", ":", "a", "singa", "operator", "class", "opset_version", "(", "int...
def _create_scatter_elements(cls, onnx_node, operator, opset_version=_opset_version): """ get the ScatterElements from the onnx node Args: onnx_node(OnnxNode): a given onnx node ...
[ "def", "_create_scatter_elements", "(", "cls", ",", "onnx_node", ",", "operator", ",", "opset_version", "=", "_opset_version", ")", ":", "axis", "=", "onnx_node", ".", "getattr", "(", "\"axis\"", ",", "0", ")", "onnx_node", ".", "set_attr_inputs", "(", "onnx_n...
https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/sonnx.py#L1711-L1727
runtimejs/runtime
0a6e84c30823d35a4548d6634166784260ae7b74
deps/v8/tools/stats-viewer.py
python
StatsViewer.RefreshCounters
(self)
Tear down and rebuild the controls in the main window.
Tear down and rebuild the controls in the main window.
[ "Tear", "down", "and", "rebuild", "the", "controls", "in", "the", "main", "window", "." ]
def RefreshCounters(self): """Tear down and rebuild the controls in the main window.""" counters = self.ComputeCounters() self.RebuildMainWindow(counters)
[ "def", "RefreshCounters", "(", "self", ")", ":", "counters", "=", "self", ".", "ComputeCounters", "(", ")", "self", ".", "RebuildMainWindow", "(", "counters", ")" ]
https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/tools/stats-viewer.py#L172-L175
scanner-research/scanner
04a0c4b4196341995985acd729c0788aab823e1c
python/scannerpy/column.py
python
Column.load
(self, ty=None, fn=None, rows=None, workers=16)
Loads the results of a Scanner computation into Python. Kwargs: fn: Optional function to apply to the binary blobs as they are read in. Returns: Generator that yields either a numpy array for frame columns or a binary blob for non-frame columns (opti...
Loads the results of a Scanner computation into Python.
[ "Loads", "the", "results", "of", "a", "Scanner", "computation", "into", "Python", "." ]
def load(self, ty=None, fn=None, rows=None, workers=16): """ Loads the results of a Scanner computation into Python. Kwargs: fn: Optional function to apply to the binary blobs as they are read in. Returns: Generator that yields either a numpy arr...
[ "def", "load", "(", "self", ",", "ty", "=", "None", ",", "fn", "=", "None", ",", "rows", "=", "None", ",", "workers", "=", "16", ")", ":", "self", ".", "_load_meta", "(", ")", "# If the column is a video, then dump the requested frames to disk as", "# PNGs and...
https://github.com/scanner-research/scanner/blob/04a0c4b4196341995985acd729c0788aab823e1c/python/scannerpy/column.py#L214-L281
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/v8/third_party/jinja2/nodes.py
python
Node.set_ctx
(self, ctx)
return self
Reset the context of a node and all child nodes. Per default the parser will all generate nodes that have a 'load' context as it's the most common one. This method is used in the parser to set assignment targets and other nodes to a store context.
Reset the context of a node and all child nodes. Per default the parser will all generate nodes that have a 'load' context as it's the most common one. This method is used in the parser to set assignment targets and other nodes to a store context.
[ "Reset", "the", "context", "of", "a", "node", "and", "all", "child", "nodes", ".", "Per", "default", "the", "parser", "will", "all", "generate", "nodes", "that", "have", "a", "load", "context", "as", "it", "s", "the", "most", "common", "one", ".", "Thi...
def set_ctx(self, ctx): """Reset the context of a node and all child nodes. Per default the parser will all generate nodes that have a 'load' context as it's the most common one. This method is used in the parser to set assignment targets and other nodes to a store context. """...
[ "def", "set_ctx", "(", "self", ",", "ctx", ")", ":", "todo", "=", "deque", "(", "[", "self", "]", ")", "while", "todo", ":", "node", "=", "todo", ".", "popleft", "(", ")", "if", "'ctx'", "in", "node", ".", "fields", ":", "node", ".", "ctx", "="...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/nodes.py#L194-L206
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/connection.py
python
EC2Connection.confirm_product_instance
(self, product_code, instance_id, dry_run=False)
return (rs.status, rs.ownerId)
:type dry_run: bool :param dry_run: Set to True if the operation should not actually run.
:type dry_run: bool :param dry_run: Set to True if the operation should not actually run.
[ ":", "type", "dry_run", ":", "bool", ":", "param", "dry_run", ":", "Set", "to", "True", "if", "the", "operation", "should", "not", "actually", "run", "." ]
def confirm_product_instance(self, product_code, instance_id, dry_run=False): """ :type dry_run: bool :param dry_run: Set to True if the operation should not actually run. """ params = {'ProductCode': product_code, 'InstanceId':...
[ "def", "confirm_product_instance", "(", "self", ",", "product_code", ",", "instance_id", ",", "dry_run", "=", "False", ")", ":", "params", "=", "{", "'ProductCode'", ":", "product_code", ",", "'InstanceId'", ":", "instance_id", "}", "if", "dry_run", ":", "para...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/connection.py#L1081-L1094
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/ndarray/ndarray.py
python
NDArray.copyto
(self, other)
Copies the value of this array to another array. If ``other`` is a ``NDArray`` object, then ``other.shape`` and ``self.shape`` should be the same. This function copies the value from ``self`` to ``other``. If ``other`` is a context, a new ``NDArray`` will be first created on th...
Copies the value of this array to another array.
[ "Copies", "the", "value", "of", "this", "array", "to", "another", "array", "." ]
def copyto(self, other): """Copies the value of this array to another array. If ``other`` is a ``NDArray`` object, then ``other.shape`` and ``self.shape`` should be the same. This function copies the value from ``self`` to ``other``. If ``other`` is a context, a new ``NDArray``...
[ "def", "copyto", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "NDArray", ")", ":", "if", "other", ".", "handle", "is", "self", ".", "handle", ":", "warnings", ".", "warn", "(", "'You are attempting to copy an array to itself'",...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L2075-L2119
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/gtk/gizmos.py
python
TreeListCtrl.GetMainColumn
(*args, **kwargs)
return _gizmos.TreeListCtrl_GetMainColumn(*args, **kwargs)
GetMainColumn(self) -> size_t
GetMainColumn(self) -> size_t
[ "GetMainColumn", "(", "self", ")", "-", ">", "size_t" ]
def GetMainColumn(*args, **kwargs): """GetMainColumn(self) -> size_t""" return _gizmos.TreeListCtrl_GetMainColumn(*args, **kwargs)
[ "def", "GetMainColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_GetMainColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/gtk/gizmos.py#L590-L592
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/multiprocessing/process.py
python
_ParentProcess.join
(self, timeout=None)
Wait until parent process terminates
Wait until parent process terminates
[ "Wait", "until", "parent", "process", "terminates" ]
def join(self, timeout=None): ''' Wait until parent process terminates ''' from multiprocessing.connection import wait wait([self._sentinel], timeout=timeout)
[ "def", "join", "(", "self", ",", "timeout", "=", "None", ")", ":", "from", "multiprocessing", ".", "connection", "import", "wait", "wait", "(", "[", "self", ".", "_sentinel", "]", ",", "timeout", "=", "timeout", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/multiprocessing/process.py#L378-L383
yifita/3PU
9ca4c3dfe4e3ead08c72e98a62e4cf181d5c70e0
code/mixed_data_provider.py
python
Fetcher.rotate_perturbation_point_cloud
(self, batch_data, angle_sigma=0.03, angle_clip=0.09)
return batch_data
Randomly perturb the point clouds by small rotations Input: BxNx3 array, original batch of point clouds Return: BxNx3 array, rotated batch of point clouds
Randomly perturb the point clouds by small rotations Input: BxNx3 array, original batch of point clouds Return: BxNx3 array, rotated batch of point clouds
[ "Randomly", "perturb", "the", "point", "clouds", "by", "small", "rotations", "Input", ":", "BxNx3", "array", "original", "batch", "of", "point", "clouds", "Return", ":", "BxNx3", "array", "rotated", "batch", "of", "point", "clouds" ]
def rotate_perturbation_point_cloud(self, batch_data, angle_sigma=0.03, angle_clip=0.09): """ Randomly perturb the point clouds by small rotations Input: BxNx3 array, original batch of point clouds Return: BxNx3 array, rotated batch of point clouds """...
[ "def", "rotate_perturbation_point_cloud", "(", "self", ",", "batch_data", ",", "angle_sigma", "=", "0.03", ",", "angle_clip", "=", "0.09", ")", ":", "batch_size", ",", "num_point", ",", "num_channels", "=", "batch_data", ".", "get_shape", "(", ")", ".", "as_li...
https://github.com/yifita/3PU/blob/9ca4c3dfe4e3ead08c72e98a62e4cf181d5c70e0/code/mixed_data_provider.py#L253-L296
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
driver/python/pysequoiadb/domain.py
python
domain.list_collection_spaces
(self)
return result
List all collection spaces in this domain. Return values: The cursor object of collection spaces. Exceptions: pysequoiadb.error.SDBBaseError
List all collection spaces in this domain.
[ "List", "all", "collection", "spaces", "in", "this", "domain", "." ]
def list_collection_spaces(self): """List all collection spaces in this domain. Return values: The cursor object of collection spaces. Exceptions: pysequoiadb.error.SDBBaseError """ result = cursor() try: rc = sdb.domain_list_cs(self._do...
[ "def", "list_collection_spaces", "(", "self", ")", ":", "result", "=", "cursor", "(", ")", "try", ":", "rc", "=", "sdb", ".", "domain_list_cs", "(", "self", ".", "_domain", ",", "result", ".", "_cursor", ")", "raise_if_error", "(", "rc", ",", "\"Failed t...
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/driver/python/pysequoiadb/domain.py#L92-L108
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/processors.py
python
HighlightMatchingBracketProcessor._get_positions_to_highlight
(self, document: Document)
Return a list of (row, col) tuples that need to be highlighted.
Return a list of (row, col) tuples that need to be highlighted.
[ "Return", "a", "list", "of", "(", "row", "col", ")", "tuples", "that", "need", "to", "be", "highlighted", "." ]
def _get_positions_to_highlight(self, document: Document) -> List[Tuple[int, int]]: """ Return a list of (row, col) tuples that need to be highlighted. """ pos: Optional[int] # Try for the character under the cursor. if document.current_char and document.current_char in ...
[ "def", "_get_positions_to_highlight", "(", "self", ",", "document", ":", "Document", ")", "->", "List", "[", "Tuple", "[", "int", ",", "int", "]", "]", ":", "pos", ":", "Optional", "[", "int", "]", "# Try for the character under the cursor.", "if", "document",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/processors.py#L361-L398
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/py/crust.py
python
Display.__init__
(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN | wx.SUNKEN_BORDER, static=False)
Create Display instance.
Create Display instance.
[ "Create", "Display", "instance", "." ]
def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN | wx.SUNKEN_BORDER, static=False): """Create Display instance.""" editwindow.EditWindow.__init__(self, parent, id, pos, size, style) # Configur...
[ "def", "__init__", "(", "self", ",", "parent", ",", "id", "=", "-", "1", ",", "pos", "=", "wx", ".", "DefaultPosition", ",", "size", "=", "wx", ".", "DefaultSize", ",", "style", "=", "wx", ".", "CLIP_CHILDREN", "|", "wx", ".", "SUNKEN_BORDER", ",", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/crust.py#L161-L171
wyrover/book-code
7f4883d9030d553bc6bcfa3da685e34789839900
3rdparty/protobuf/python/google/protobuf/internal/python_message.py
python
GeneratedProtocolMessageType.__new__
(cls, name, bases, dictionary)
return new_class
Custom allocation for runtime-generated class types. We override __new__ because this is apparently the only place where we can meaningfully set __slots__ on the class we're creating(?). (The interplay between metaclasses and slots is not very well-documented). Args: name: Name of the class (ign...
Custom allocation for runtime-generated class types.
[ "Custom", "allocation", "for", "runtime", "-", "generated", "class", "types", "." ]
def __new__(cls, name, bases, dictionary): """Custom allocation for runtime-generated class types. We override __new__ because this is apparently the only place where we can meaningfully set __slots__ on the class we're creating(?). (The interplay between metaclasses and slots is not very well-document...
[ "def", "__new__", "(", "cls", ",", "name", ",", "bases", ",", "dictionary", ")", ":", "descriptor", "=", "dictionary", "[", "GeneratedProtocolMessageType", ".", "_DESCRIPTOR_KEY", "]", "if", "descriptor", ".", "full_name", "in", "well_known_types", ".", "WKTBASE...
https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/internal/python_message.py#L112-L141
FEniCS/dolfinx
3dfdf038cccdb70962865b58a63bf29c2e55ec6e
python/dolfinx/fem/assemble.py
python
assemble_matrix_nest
(a: typing.List[typing.List[FormMetaClass]], bcs: typing.List[DirichletBCMetaClass] = [], mat_types=[], diagonal: float = 1.0, coeffs=Coefficients(None, None))
return A
Assemble bilinear forms into matrix
Assemble bilinear forms into matrix
[ "Assemble", "bilinear", "forms", "into", "matrix" ]
def assemble_matrix_nest(a: typing.List[typing.List[FormMetaClass]], bcs: typing.List[DirichletBCMetaClass] = [], mat_types=[], diagonal: float = 1.0, coeffs=Coefficients(None, None)) -> PETSc.Mat: """Assemble bilinear forms into matrix""" ...
[ "def", "assemble_matrix_nest", "(", "a", ":", "typing", ".", "List", "[", "typing", ".", "List", "[", "FormMetaClass", "]", "]", ",", "bcs", ":", "typing", ".", "List", "[", "DirichletBCMetaClass", "]", "=", "[", "]", ",", "mat_types", "=", "[", "]", ...
https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/python/dolfinx/fem/assemble.py#L287-L294
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
TextEntryBase.GetSelection
(*args, **kwargs)
return _core_.TextEntryBase_GetSelection(*args, **kwargs)
GetSelection() -> (from, to) If the return values from and to are the same, there is no selection.
GetSelection() -> (from, to)
[ "GetSelection", "()", "-", ">", "(", "from", "to", ")" ]
def GetSelection(*args, **kwargs): """ GetSelection() -> (from, to) If the return values from and to are the same, there is no selection. """ return _core_.TextEntryBase_GetSelection(*args, **kwargs)
[ "def", "GetSelection", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "TextEntryBase_GetSelection", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L13311-L13317
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/clang/tools/scan-build-py/libscanbuild/intercept.py
python
is_preload_disabled
(platform)
Library-based interposition will fail silently if SIP is enabled, so this should be detected. You can detect whether SIP is enabled on Darwin by checking whether (1) there is a binary called 'csrutil' in the path and, if so, (2) whether the output of executing 'csrutil status' contains 'System Integrity...
Library-based interposition will fail silently if SIP is enabled, so this should be detected. You can detect whether SIP is enabled on Darwin by checking whether (1) there is a binary called 'csrutil' in the path and, if so, (2) whether the output of executing 'csrutil status' contains 'System Integrity...
[ "Library", "-", "based", "interposition", "will", "fail", "silently", "if", "SIP", "is", "enabled", "so", "this", "should", "be", "detected", ".", "You", "can", "detect", "whether", "SIP", "is", "enabled", "on", "Darwin", "by", "checking", "whether", "(", ...
def is_preload_disabled(platform): """ Library-based interposition will fail silently if SIP is enabled, so this should be detected. You can detect whether SIP is enabled on Darwin by checking whether (1) there is a binary called 'csrutil' in the path and, if so, (2) whether the output of executing 'csr...
[ "def", "is_preload_disabled", "(", "platform", ")", ":", "if", "platform", "==", "'darwin'", ":", "pattern", "=", "re", ".", "compile", "(", "r'System Integrity Protection status:\\s+enabled'", ")", "command", "=", "[", "'csrutil'", ",", "'status'", "]", "elif", ...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/tools/scan-build-py/libscanbuild/intercept.py#L234-L257
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
TransformPoser.get
(self)
return _robotsim.TransformPoser_get(self)
r""" get(TransformPoser self)
r""" get(TransformPoser self)
[ "r", "get", "(", "TransformPoser", "self", ")" ]
def get(self) -> "void": r""" get(TransformPoser self) """ return _robotsim.TransformPoser_get(self)
[ "def", "get", "(", "self", ")", "->", "\"void\"", ":", "return", "_robotsim", ".", "TransformPoser_get", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L3560-L3566
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/lib/debug_data.py
python
DebugTensorDatum.tensor_name
(self)
return _get_tensor_name(self.node_name, self.output_slot)
Name of the tensor watched by the debug op. Returns: (`str`) `Tensor` name, in the form of `node_name`:`output_slot`
Name of the tensor watched by the debug op.
[ "Name", "of", "the", "tensor", "watched", "by", "the", "debug", "op", "." ]
def tensor_name(self): """Name of the tensor watched by the debug op. Returns: (`str`) `Tensor` name, in the form of `node_name`:`output_slot` """ return _get_tensor_name(self.node_name, self.output_slot)
[ "def", "tensor_name", "(", "self", ")", ":", "return", "_get_tensor_name", "(", "self", ".", "node_name", ",", "self", ".", "output_slot", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/lib/debug_data.py#L414-L421
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/locators.py
python
PyPIRPCLocator.__init__
(self, url, **kwargs)
Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor.
Initialise an instance.
[ "Initialise", "an", "instance", "." ]
def __init__(self, url, **kwargs): """ Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. """ super(PyPIRPCLocator, self).__init__(**kwargs) self.base_url = url self.client = ServerProxy(ur...
[ "def", "__init__", "(", "self", ",", "url", ",", "*", "*", "kwargs", ")", ":", "super", "(", "PyPIRPCLocator", ",", "self", ")", ".", "__init__", "(", "*", "*", "kwargs", ")", "self", ".", "base_url", "=", "url", "self", ".", "client", "=", "Server...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/locators.py#L377-L386
quarnster/boxeebox-xbmc
7209547d3d247a4082de956f4d9a765086d96985
tools/EventClients/Clients/PS3 Sixaxis Controller/ps3d.py
python
PS3RemoteThread.zeroconf_service_handler
(self, event, service)
return
Zeroconf event handler
Zeroconf event handler
[ "Zeroconf", "event", "handler" ]
def zeroconf_service_handler(self, event, service): """ Zeroconf event handler """ if event == zeroconf.SERVICE_FOUND: # new xbmc service detected self.services.append( service ) elif event == zeroconf.SERVICE_LOST: # xbmc service lost try: ...
[ "def", "zeroconf_service_handler", "(", "self", ",", "event", ",", "service", ")", ":", "if", "event", "==", "zeroconf", ".", "SERVICE_FOUND", ":", "# new xbmc service detected", "self", ".", "services", ".", "append", "(", "service", ")", "elif", "event", "==...
https://github.com/quarnster/boxeebox-xbmc/blob/7209547d3d247a4082de956f4d9a765086d96985/tools/EventClients/Clients/PS3 Sixaxis Controller/ps3d.py#L230-L247
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/io/parquet.py
python
ParquetDatasetWriter.__init__
( self, path, partition_cols, index=None, compression=None, statistics="ROWGROUP", )
Write a parquet file or dataset incrementally Parameters ---------- path : str File path or Root Directory path. Will be used as Root Directory path while writing a partitioned dataset. partition_cols : list Column names by which to partition the data...
Write a parquet file or dataset incrementally
[ "Write", "a", "parquet", "file", "or", "dataset", "incrementally" ]
def __init__( self, path, partition_cols, index=None, compression=None, statistics="ROWGROUP", ) -> None: """ Write a parquet file or dataset incrementally Parameters ---------- path : str File path or Root Director...
[ "def", "__init__", "(", "self", ",", "path", ",", "partition_cols", ",", "index", "=", "None", ",", "compression", "=", "None", ",", "statistics", "=", "\"ROWGROUP\"", ",", ")", "->", "None", ":", "self", ".", "path", "=", "path", "self", ".", "common_...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/io/parquet.py#L692-L766
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/python/google/protobuf/text_format.py
python
Tokenizer.ConsumeIdentifier
(self)
return result
Consumes protocol message field identifier. Returns: Identifier string. Raises: ParseError: If an identifier couldn't be consumed.
Consumes protocol message field identifier.
[ "Consumes", "protocol", "message", "field", "identifier", "." ]
def ConsumeIdentifier(self): """Consumes protocol message field identifier. Returns: Identifier string. Raises: ParseError: If an identifier couldn't be consumed. """ result = self.token if not self._IDENTIFIER.match(result): raise self.ParseError('Expected identifier.') ...
[ "def", "ConsumeIdentifier", "(", "self", ")", ":", "result", "=", "self", ".", "token", "if", "not", "self", ".", "_IDENTIFIER", ".", "match", "(", "result", ")", ":", "raise", "self", ".", "ParseError", "(", "'Expected identifier.'", ")", "self", ".", "...
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/text_format.py#L1058-L1071
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
python
_GetOutputFilePathAndTool
(spec, msbuild)
return out_file, vc_tool, msbuild_tool
Returns the path and tool to use for this target. Figures out the path of the file this spec will create and the name of the VC tool that will create it. Arguments: spec: The target dictionary containing the properties of the target. Returns: A triple of (file path, name of the vc tool, name of the ms...
Returns the path and tool to use for this target.
[ "Returns", "the", "path", "and", "tool", "to", "use", "for", "this", "target", "." ]
def _GetOutputFilePathAndTool(spec, msbuild): """Returns the path and tool to use for this target. Figures out the path of the file this spec will create and the name of the VC tool that will create it. Arguments: spec: The target dictionary containing the properties of the target. Returns: A trip...
[ "def", "_GetOutputFilePathAndTool", "(", "spec", ",", "msbuild", ")", ":", "# Select a name for the output file.", "out_file", "=", "\"\"", "vc_tool", "=", "\"\"", "msbuild_tool", "=", "\"\"", "output_file_map", "=", "{", "\"executable\"", ":", "(", "\"VCLinkerTool\""...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L1316-L1352
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/framework/tensor_util.py
python
constant_value
(tensor)
return ret
Returns the constant value of the given tensor, if efficiently calculable. This function attempts to partially evaluate the given tensor, and returns its value as a numpy ndarray if this succeeds. TODO(mrry): Consider whether this function should use a registration mechanism like gradients and ShapeFunctions,...
Returns the constant value of the given tensor, if efficiently calculable.
[ "Returns", "the", "constant", "value", "of", "the", "given", "tensor", "if", "efficiently", "calculable", "." ]
def constant_value(tensor): """Returns the constant value of the given tensor, if efficiently calculable. This function attempts to partially evaluate the given tensor, and returns its value as a numpy ndarray if this succeeds. TODO(mrry): Consider whether this function should use a registration mechanism l...
[ "def", "constant_value", "(", "tensor", ")", ":", "ret", "=", "_ConstantValue", "(", "tensor", ")", "if", "ret", "is", "not", "None", ":", "# The caller may now depend on the constant value of `tensor`, so we", "# conservatively prevent it from being fed.", "tensor", ".", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/tensor_util.py#L601-L631
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mox3/mox3/mox.py
python
MockMethod.__init__
(self, method_name, call_queue, replay_mode, method_to_mock=None, description=None, class_to_bind=None)
Construct a new mock method. Args: # method_name: the name of the method # call_queue: deque of calls, verify this call against the head, # or add this call to the queue. # replay_mode: False if we are recording, True if we are verifying #...
Construct a new mock method.
[ "Construct", "a", "new", "mock", "method", "." ]
def __init__(self, method_name, call_queue, replay_mode, method_to_mock=None, description=None, class_to_bind=None): """Construct a new mock method. Args: # method_name: the name of the method # call_queue: deque of calls, verify this call against the head, ...
[ "def", "__init__", "(", "self", ",", "method_name", ",", "call_queue", ",", "replay_mode", ",", "method_to_mock", "=", "None", ",", "description", "=", "None", ",", "class_to_bind", "=", "None", ")", ":", "self", ".", "_name", "=", "method_name", "self", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mox3/mox3/mox.py#L1041-L1087
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/turtle.py
python
TurtleScreenBase._drawline
(self, lineitem, coordlist=None, fill=None, width=None, top=False)
Configure lineitem according to provided arguments: coordlist is sequence of coordinates fill is drawing color width is width of drawn line. top is a boolean value, which specifies if polyitem will be put on top of the canvas' displaylist so it will not be covered by othe...
Configure lineitem according to provided arguments: coordlist is sequence of coordinates fill is drawing color width is width of drawn line. top is a boolean value, which specifies if polyitem will be put on top of the canvas' displaylist so it will not be covered by othe...
[ "Configure", "lineitem", "according", "to", "provided", "arguments", ":", "coordlist", "is", "sequence", "of", "coordinates", "fill", "is", "drawing", "color", "width", "is", "width", "of", "drawn", "line", ".", "top", "is", "a", "boolean", "value", "which", ...
def _drawline(self, lineitem, coordlist=None, fill=None, width=None, top=False): """Configure lineitem according to provided arguments: coordlist is sequence of coordinates fill is drawing color width is width of drawn line. top is a boolean value, which specifi...
[ "def", "_drawline", "(", "self", ",", "lineitem", ",", "coordlist", "=", "None", ",", "fill", "=", "None", ",", "width", "=", "None", ",", "top", "=", "False", ")", ":", "if", "coordlist", "is", "not", "None", ":", "cl", "=", "[", "]", "for", "x"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/turtle.py#L529-L550
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/numbers.py
python
Integral.__xor__
(self, other)
self ^ other
self ^ other
[ "self", "^", "other" ]
def __xor__(self, other): """self ^ other""" raise NotImplementedError
[ "def", "__xor__", "(", "self", ",", "other", ")", ":", "raise", "NotImplementedError" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/numbers.py#L351-L353
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/compilerop.py
python
CachingCompiler.reset_compiler_flags
(self)
Reset compiler flags to default state.
Reset compiler flags to default state.
[ "Reset", "compiler", "flags", "to", "default", "state", "." ]
def reset_compiler_flags(self): """Reset compiler flags to default state.""" # This value is copied from codeop.Compile.__init__, so if that ever # changes, it will need to be updated. self.flags = codeop.PyCF_DONT_IMPLY_DEDENT
[ "def", "reset_compiler_flags", "(", "self", ")", ":", "# This value is copied from codeop.Compile.__init__, so if that ever", "# changes, it will need to be updated.", "self", ".", "flags", "=", "codeop", ".", "PyCF_DONT_IMPLY_DEDENT" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/compilerop.py#L103-L107
mysql/mysql-workbench
2f35f9034f015cbcd22139a60e1baa2e3e8e795c
plugins/wb.admin/backend/wb_log_reader.py
python
BaseLogFileReader.has_next
(self)
return self.chunk_end < self.file_size
If there is a next chunk that can be read.
If there is a next chunk that can be read.
[ "If", "there", "is", "a", "next", "chunk", "that", "can", "be", "read", "." ]
def has_next(self): ''' If there is a next chunk that can be read. ''' return self.chunk_end < self.file_size
[ "def", "has_next", "(", "self", ")", ":", "return", "self", ".", "chunk_end", "<", "self", ".", "file_size" ]
https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/plugins/wb.admin/backend/wb_log_reader.py#L410-L414
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_keras2_converter.py
python
_convert_training_info
(model, builder, output_features)
Convert the training information from the given Keras 'model' into the Core ML in 'builder'. :param model: keras.model.Sequential The source Keras model. :param builder: NeutralNetworkBuilder The target model that will gain the loss and optimizer. :param output_features: list of tuples,...
Convert the training information from the given Keras 'model' into the Core ML in 'builder'.
[ "Convert", "the", "training", "information", "from", "the", "given", "Keras", "model", "into", "the", "Core", "ML", "in", "builder", "." ]
def _convert_training_info(model, builder, output_features): """ Convert the training information from the given Keras 'model' into the Core ML in 'builder'. :param model: keras.model.Sequential The source Keras model. :param builder: NeutralNetworkBuilder The target model that will...
[ "def", "_convert_training_info", "(", "model", ",", "builder", ",", "output_features", ")", ":", "# Keras does not have a number of epochs compiled into the model, so we", "# invent one here for ease of use. 1 makes the most sense, as the user", "# can just invoke training repeatedly if the...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_keras2_converter.py#L193-L313
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/signal/ltisys.py
python
StateSpace.__init__
(self, *system, **kwargs)
Initialize the state space lti/dlti system.
Initialize the state space lti/dlti system.
[ "Initialize", "the", "state", "space", "lti", "/", "dlti", "system", "." ]
def __init__(self, *system, **kwargs): """Initialize the state space lti/dlti system.""" # Conversion of lti instances is handled in __new__ if isinstance(system[0], LinearTimeInvariant): return # Remove system arguments, not needed by parents anymore super(StateSpac...
[ "def", "__init__", "(", "self", ",", "*", "system", ",", "*", "*", "kwargs", ")", ":", "# Conversion of lti instances is handled in __new__", "if", "isinstance", "(", "system", "[", "0", "]", ",", "LinearTimeInvariant", ")", ":", "return", "# Remove system argumen...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/ltisys.py#L1319-L1333
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py
python
TFExampleReader.__init__
(self, filenames, features)
Configure `tf.Example` parsing. Args: filenames: A filename or list of filenames to read the time series from. Each line must have columns corresponding to `column_names`. features: A dictionary mapping from feature keys to `tf.io.FixedLenFeature` objects. Must include `TrainEvalFeature...
Configure `tf.Example` parsing.
[ "Configure", "tf", ".", "Example", "parsing", "." ]
def __init__(self, filenames, features): """Configure `tf.Example` parsing. Args: filenames: A filename or list of filenames to read the time series from. Each line must have columns corresponding to `column_names`. features: A dictionary mapping from feature keys to `tf.io.FixedLen...
[ "def", "__init__", "(", "self", ",", "filenames", ",", "features", ")", ":", "if", "feature_keys", ".", "TrainEvalFeatures", ".", "TIMES", "not", "in", "features", ":", "raise", "ValueError", "(", "\"'{}' is a required column.\"", ".", "format", "(", "feature_ke...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py#L519-L540
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
MenuEvent.GetMenu
(*args, **kwargs)
return _core_.MenuEvent_GetMenu(*args, **kwargs)
GetMenu(self) -> Menu Returns the menu which is being opened or closed. This method should only be used with the OPEN and CLOSE events.
GetMenu(self) -> Menu
[ "GetMenu", "(", "self", ")", "-", ">", "Menu" ]
def GetMenu(*args, **kwargs): """ GetMenu(self) -> Menu Returns the menu which is being opened or closed. This method should only be used with the OPEN and CLOSE events. """ return _core_.MenuEvent_GetMenu(*args, **kwargs)
[ "def", "GetMenu", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "MenuEvent_GetMenu", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L6461-L6468
FEniCS/dolfinx
3dfdf038cccdb70962865b58a63bf29c2e55ec6e
python/dolfinx/fem/function.py
python
FunctionSpace.mesh
(self)
return self._cpp_object.mesh
Return the mesh on which the function space is defined.
Return the mesh on which the function space is defined.
[ "Return", "the", "mesh", "on", "which", "the", "function", "space", "is", "defined", "." ]
def mesh(self) -> _cpp.mesh.Mesh: """Return the mesh on which the function space is defined.""" return self._cpp_object.mesh
[ "def", "mesh", "(", "self", ")", "->", "_cpp", ".", "mesh", ".", "Mesh", ":", "return", "self", ".", "_cpp_object", ".", "mesh" ]
https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/python/dolfinx/fem/function.py#L553-L555
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
v8_7_5/tools/stats-viewer.py
python
UiCounter.__init__
(self, var, format)
Creates a new ui counter. Args: var: the Tkinter string variable for updating the ui format: the format string used to format this counter
Creates a new ui counter.
[ "Creates", "a", "new", "ui", "counter", "." ]
def __init__(self, var, format): """Creates a new ui counter. Args: var: the Tkinter string variable for updating the ui format: the format string used to format this counter """ self.var = var self.format = format self.last_value = None
[ "def", "__init__", "(", "self", ",", "var", ",", "format", ")", ":", "self", ".", "var", "=", "var", "self", ".", "format", "=", "format", "self", ".", "last_value", "=", "None" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_7_5/tools/stats-viewer.py#L274-L283
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISLoadAndProcess.py
python
ReflectometryISISLoadAndProcess.category
(self)
return 'Reflectometry\\ISIS;Workflow\\Reflectometry'
Return the categories of the algorithm.
Return the categories of the algorithm.
[ "Return", "the", "categories", "of", "the", "algorithm", "." ]
def category(self): """Return the categories of the algorithm.""" return 'Reflectometry\\ISIS;Workflow\\Reflectometry'
[ "def", "category", "(", "self", ")", ":", "return", "'Reflectometry\\\\ISIS;Workflow\\\\Reflectometry'" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISLoadAndProcess.py#L47-L49
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/configDialog.py
python
ConfigDialog.SaveAllChangedConfigs
(self)
Save configuration changes to the user config file.
Save configuration changes to the user config file.
[ "Save", "configuration", "changes", "to", "the", "user", "config", "file", "." ]
def SaveAllChangedConfigs(self): "Save configuration changes to the user config file." idleConf.userCfg['main'].Save() for configType in self.changedItems.keys(): cfgTypeHasChanges = False for section in self.changedItems[configType].keys(): if section == ...
[ "def", "SaveAllChangedConfigs", "(", "self", ")", ":", "idleConf", ".", "userCfg", "[", "'main'", "]", ".", "Save", "(", ")", "for", "configType", "in", "self", ".", "changedItems", ".", "keys", "(", ")", ":", "cfgTypeHasChanges", "=", "False", "for", "s...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/configDialog.py#L1099-L1118
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/tex.py
python
generate_common
(env)
Add internal Builders and construction variables for LaTeX to an Environment.
Add internal Builders and construction variables for LaTeX to an Environment.
[ "Add", "internal", "Builders", "and", "construction", "variables", "for", "LaTeX", "to", "an", "Environment", "." ]
def generate_common(env): """Add internal Builders and construction variables for LaTeX to an Environment.""" # Add OSX system paths so TeX tools can be found # when a list of tools is given the exists() method is not called generate_darwin(env) # A generic tex file Action, sufficient for all tex ...
[ "def", "generate_common", "(", "env", ")", ":", "# Add OSX system paths so TeX tools can be found", "# when a list of tools is given the exists() method is not called", "generate_darwin", "(", "env", ")", "# A generic tex file Action, sufficient for all tex files.", "global", "TeXAction"...
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/tex.py#L866-L977
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/buffer.py
python
Buffer.delete
(self, count: int = 1)
Delete specified number of characters and Return the deleted text.
Delete specified number of characters and Return the deleted text.
[ "Delete", "specified", "number", "of", "characters", "and", "Return", "the", "deleted", "text", "." ]
def delete(self, count: int = 1) -> str: """ Delete specified number of characters and Return the deleted text. """ if self.cursor_position < len(self.text): deleted = self.document.text_after_cursor[:count] self.text = ( self.text[: self.cursor_po...
[ "def", "delete", "(", "self", ",", "count", ":", "int", "=", "1", ")", "->", "str", ":", "if", "self", ".", "cursor_position", "<", "len", "(", "self", ".", "text", ")", ":", "deleted", "=", "self", ".", "document", ".", "text_after_cursor", "[", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/buffer.py#L805-L817
msracver/Deep-Image-Analogy
632b9287b42552e32dad64922967c8c9ec7fc4d3
scripts/cpp_lint.py
python
_IncludeState.CanonicalizeAlphabeticalOrder
(self, header_path)
return header_path.replace('-inl.h', '.h').replace('-', '_').lower()
Returns a path canonicalized for alphabetical comparison. - replaces "-" with "_" so they both cmp the same. - removes '-inl' since we don't require them to be after the main header. - lowercase everything, just in case. Args: header_path: Path to be canonicalized. Returns: Canonicali...
Returns a path canonicalized for alphabetical comparison.
[ "Returns", "a", "path", "canonicalized", "for", "alphabetical", "comparison", "." ]
def CanonicalizeAlphabeticalOrder(self, header_path): """Returns a path canonicalized for alphabetical comparison. - replaces "-" with "_" so they both cmp the same. - removes '-inl' since we don't require them to be after the main header. - lowercase everything, just in case. Args: header_p...
[ "def", "CanonicalizeAlphabeticalOrder", "(", "self", ",", "header_path", ")", ":", "return", "header_path", ".", "replace", "(", "'-inl.h'", ",", "'.h'", ")", ".", "replace", "(", "'-'", ",", "'_'", ")", ".", "lower", "(", ")" ]
https://github.com/msracver/Deep-Image-Analogy/blob/632b9287b42552e32dad64922967c8c9ec7fc4d3/scripts/cpp_lint.py#L597-L610
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
DisplayChangedEvent.__init__
(self, *args, **kwargs)
__init__(self) -> DisplayChangedEvent
__init__(self) -> DisplayChangedEvent
[ "__init__", "(", "self", ")", "-", ">", "DisplayChangedEvent" ]
def __init__(self, *args, **kwargs): """__init__(self) -> DisplayChangedEvent""" _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_core_", ".", "DisplayChangedEvent_swiginit", "(", "self", ",", "_core_", ".", "new_DisplayChangedEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L7142-L7144
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/PublicKey/RSA.py
python
_import_keyDER
(extern_key, passphrase)
Import an RSA key (public or private half), encoded in DER form.
Import an RSA key (public or private half), encoded in DER form.
[ "Import", "an", "RSA", "key", "(", "public", "or", "private", "half", ")", "encoded", "in", "DER", "form", "." ]
def _import_keyDER(extern_key, passphrase): """Import an RSA key (public or private half), encoded in DER form.""" decodings = (_import_pkcs1_private, _import_pkcs1_public, _import_subjectPublicKeyInfo, _import_x509_cert, _import_pkcs8) f...
[ "def", "_import_keyDER", "(", "extern_key", ",", "passphrase", ")", ":", "decodings", "=", "(", "_import_pkcs1_private", ",", "_import_pkcs1_public", ",", "_import_subjectPublicKeyInfo", ",", "_import_x509_cert", ",", "_import_pkcs8", ")", "for", "decoding", "in", "de...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/PublicKey/RSA.py#L667-L682
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
FontEnumerator_GetFacenames
(*args)
return _gdi_.FontEnumerator_GetFacenames(*args)
FontEnumerator_GetFacenames() -> PyObject
FontEnumerator_GetFacenames() -> PyObject
[ "FontEnumerator_GetFacenames", "()", "-", ">", "PyObject" ]
def FontEnumerator_GetFacenames(*args): """FontEnumerator_GetFacenames() -> PyObject""" return _gdi_.FontEnumerator_GetFacenames(*args)
[ "def", "FontEnumerator_GetFacenames", "(", "*", "args", ")", ":", "return", "_gdi_", ".", "FontEnumerator_GetFacenames", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L2687-L2689
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TUNGraphEdgeI.__eq__
(self, *args)
return _snap.TUNGraphEdgeI___eq__(self, *args)
__eq__(TUNGraphEdgeI self, TUNGraphEdgeI EdgeI) -> bool Parameters: EdgeI: TUNGraphEdgeI const &
__eq__(TUNGraphEdgeI self, TUNGraphEdgeI EdgeI) -> bool
[ "__eq__", "(", "TUNGraphEdgeI", "self", "TUNGraphEdgeI", "EdgeI", ")", "-", ">", "bool" ]
def __eq__(self, *args): """ __eq__(TUNGraphEdgeI self, TUNGraphEdgeI EdgeI) -> bool Parameters: EdgeI: TUNGraphEdgeI const & """ return _snap.TUNGraphEdgeI___eq__(self, *args)
[ "def", "__eq__", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TUNGraphEdgeI___eq__", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L20664-L20672
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/ps/the_one_ps.py
python
TheOnePSRuntime._ps_inference_save_persistables
(self, executor, dirname, main_program=None, mode=0, **kwargs)
This function filters out all variables with `persistable==True` from the give `main_program` and then saves these variables to the folder `dirname` or file `filename`. The `dirname` is used to specify the folder where persistable variables are going to be saved. If you would like to sa...
This function filters out all variables with `persistable==True` from the give `main_program` and then saves these variables to the folder `dirname` or file `filename`.
[ "This", "function", "filters", "out", "all", "variables", "with", "persistable", "==", "True", "from", "the", "give", "main_program", "and", "then", "saves", "these", "variables", "to", "the", "folder", "dirname", "or", "file", "filename", "." ]
def _ps_inference_save_persistables(self, executor, dirname, main_program=None, mode=0, **kwargs): """ T...
[ "def", "_ps_inference_save_persistables", "(", "self", ",", "executor", ",", "dirname", ",", "main_program", "=", "None", ",", "mode", "=", "0", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "executor", ",", "ParallelExecutor", ")", ":", "rai...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/ps/the_one_ps.py#L1146-L1183
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/http/cookies.py
python
BaseCookie.js_output
(self, attrs=None)
return _nulljoin(result)
Return a string suitable for JavaScript.
Return a string suitable for JavaScript.
[ "Return", "a", "string", "suitable", "for", "JavaScript", "." ]
def js_output(self, attrs=None): """Return a string suitable for JavaScript.""" result = [] items = sorted(self.items()) for key, value in items: result.append(value.js_output(attrs)) return _nulljoin(result)
[ "def", "js_output", "(", "self", ",", "attrs", "=", "None", ")", ":", "result", "=", "[", "]", "items", "=", "sorted", "(", "self", ".", "items", "(", ")", ")", "for", "key", ",", "value", "in", "items", ":", "result", ".", "append", "(", "value"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/http/cookies.py#L514-L520
nvdla/sw
79538ba1b52b040a4a4645f630e457fa01839e90
umd/external/protobuf-2.6/python/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.__getslice__
(self, start, stop)
return self._values[start:stop]
Retrieves the subset of items from between the specified indices.
Retrieves the subset of items from between the specified indices.
[ "Retrieves", "the", "subset", "of", "items", "from", "between", "the", "specified", "indices", "." ]
def __getslice__(self, start, stop): """Retrieves the subset of items from between the specified indices.""" return self._values[start:stop]
[ "def", "__getslice__", "(", "self", ",", "start", ",", "stop", ")", ":", "return", "self", ".", "_values", "[", "start", ":", "stop", "]" ]
https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/internal/containers.py#L154-L156
Dobiasd/frugally-deep
99d9378c6ef537a209bcb2a102e953899a6ab0e3
keras_export/convert_model.py
python
get_layer_input_shape_tensor_shape
(layer)
return keras_shape_to_fdeep_tensor_shape(layer.input_shape)
Convert layer input shape to an fdeep shape
Convert layer input shape to an fdeep shape
[ "Convert", "layer", "input", "shape", "to", "an", "fdeep", "shape" ]
def get_layer_input_shape_tensor_shape(layer): """Convert layer input shape to an fdeep shape""" return keras_shape_to_fdeep_tensor_shape(layer.input_shape)
[ "def", "get_layer_input_shape_tensor_shape", "(", "layer", ")", ":", "return", "keras_shape_to_fdeep_tensor_shape", "(", "layer", ".", "input_shape", ")" ]
https://github.com/Dobiasd/frugally-deep/blob/99d9378c6ef537a209bcb2a102e953899a6ab0e3/keras_export/convert_model.py#L79-L81
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/sanitizers/sancov_formatter.py
python
merge
(options)
Implements the 'merge' action of this tool.
Implements the 'merge' action of this tool.
[ "Implements", "the", "merge", "action", "of", "this", "tool", "." ]
def merge(options): """Implements the 'merge' action of this tool.""" # Check if folder with coverage output exists. assert (os.path.exists(options.coverage_dir) and os.path.isdir(options.coverage_dir)) # Inputs for multiprocessing. List of tuples of: # Coverage dir, executable name, sancov file n...
[ "def", "merge", "(", "options", ")", ":", "# Check if folder with coverage output exists.", "assert", "(", "os", ".", "path", ".", "exists", "(", "options", ".", "coverage_dir", ")", "and", "os", ".", "path", ".", "isdir", "(", "options", ".", "coverage_dir", ...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/sanitizers/sancov_formatter.py#L334-L372
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/variables.py
python
Variable._set_save_slice_info
(self, save_slice_info)
Sets the slice info for this `Variable`. Args: save_slice_info: A `Variable.SaveSliceInfo` object.
Sets the slice info for this `Variable`.
[ "Sets", "the", "slice", "info", "for", "this", "Variable", "." ]
def _set_save_slice_info(self, save_slice_info): """Sets the slice info for this `Variable`. Args: save_slice_info: A `Variable.SaveSliceInfo` object. """ self._save_slice_info = save_slice_info
[ "def", "_set_save_slice_info", "(", "self", ",", "save_slice_info", ")", ":", "self", ".", "_save_slice_info", "=", "save_slice_info" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/variables.py#L1035-L1041
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/gradients.py
python
_hessian_vector_product
(ys, xs, v)
return gradients(elemwise_products, xs)
Multiply the Hessian of `ys` wrt `xs` by `v`. This is an efficient construction that uses a backprop-like approach to compute the product between the Hessian and another vector. The Hessian is usually too large to be explicitly computed or even represented, but this method allows us to at least multiply by it ...
Multiply the Hessian of `ys` wrt `xs` by `v`.
[ "Multiply", "the", "Hessian", "of", "ys", "wrt", "xs", "by", "v", "." ]
def _hessian_vector_product(ys, xs, v): """Multiply the Hessian of `ys` wrt `xs` by `v`. This is an efficient construction that uses a backprop-like approach to compute the product between the Hessian and another vector. The Hessian is usually too large to be explicitly computed or even represented, but this...
[ "def", "_hessian_vector_product", "(", "ys", ",", "xs", ",", "v", ")", ":", "# Validate the input", "length", "=", "len", "(", "xs", ")", "if", "len", "(", "v", ")", "!=", "length", ":", "raise", "ValueError", "(", "\"xs and v must have the same length.\"", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/gradients.py#L729-L777
nnrg/opennero
43e12a1bcba6e228639db3886fec1dc47ddc24cb
mods/Roomba/RTNEATAgent.py
python
RTNEATAgent.initialize
(self, init_info)
return True
Initialize an agent brain with sensor information
Initialize an agent brain with sensor information
[ "Initialize", "an", "agent", "brain", "with", "sensor", "information" ]
def initialize(self, init_info): """ Initialize an agent brain with sensor information """ self.actions = init_info.actions # constraints for actions self.sensors = init_info.sensors # constraints for sensors return True
[ "def", "initialize", "(", "self", ",", "init_info", ")", ":", "self", ".", "actions", "=", "init_info", ".", "actions", "# constraints for actions", "self", ".", "sensors", "=", "init_info", ".", "sensors", "# constraints for sensors", "return", "True" ]
https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/Roomba/RTNEATAgent.py#L18-L24
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
orttraining/orttraining/python/training/ortmodule/_fallback.py
python
_FallbackManager.handle_exception
(self, exception: Exception, log_level: _logger.LogLevel, override_policy: Optional[_FallbackPolicy] = None)
Process incoming `exception` based on the selected `policy` If the incoming `exception` is handled by the specified policy, `_FallbackManager` saves the exception so that ORTModule can track the pending fallback and trigger it during model execution. Otherwise, the incoming exception is...
Process incoming `exception` based on the selected `policy`
[ "Process", "incoming", "exception", "based", "on", "the", "selected", "policy" ]
def handle_exception(self, exception: Exception, log_level: _logger.LogLevel, override_policy: Optional[_FallbackPolicy] = None) -> None: '''Process incoming `exception` based on the selected `policy` If the incoming `exception`...
[ "def", "handle_exception", "(", "self", ",", "exception", ":", "Exception", ",", "log_level", ":", "_logger", ".", "LogLevel", ",", "override_policy", ":", "Optional", "[", "_FallbackPolicy", "]", "=", "None", ")", "->", "None", ":", "def", "_set_exception", ...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/orttraining/orttraining/python/training/ortmodule/_fallback.py#L105-L151
TGAC/KAT
e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216
deps/jellyfish-2.2.0/swig/python/jellyfish.py
python
MerDNA.reverse_complement
(self)
return _jellyfish.MerDNA_reverse_complement(self)
Change the mer to its reverse complement
Change the mer to its reverse complement
[ "Change", "the", "mer", "to", "its", "reverse", "complement" ]
def reverse_complement(self): """Change the mer to its reverse complement""" return _jellyfish.MerDNA_reverse_complement(self)
[ "def", "reverse_complement", "(", "self", ")", ":", "return", "_jellyfish", ".", "MerDNA_reverse_complement", "(", "self", ")" ]
https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/jellyfish-2.2.0/swig/python/jellyfish.py#L137-L139
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/webapp2/webapp2.py
python
RequestContext.__enter__
(self)
return request, response
Enters the request context. :returns: A tuple ``(request, response)``.
Enters the request context.
[ "Enters", "the", "request", "context", "." ]
def __enter__(self): """Enters the request context. :returns: A tuple ``(request, response)``. """ # Build request and response. request = self.app.request_class(self.environ) response = self.app.response_class() # Make active app and response availab...
[ "def", "__enter__", "(", "self", ")", ":", "# Build request and response.", "request", "=", "self", ".", "app", ".", "request_class", "(", "self", ".", "environ", ")", "response", "=", "self", ".", "app", ".", "response_class", "(", ")", "# Make active app and...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2.py#L1401-L1415
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.LinesJoin
(*args, **kwargs)
return _stc.StyledTextCtrl_LinesJoin(*args, **kwargs)
LinesJoin(self) Join the lines in the target.
LinesJoin(self)
[ "LinesJoin", "(", "self", ")" ]
def LinesJoin(*args, **kwargs): """ LinesJoin(self) Join the lines in the target. """ return _stc.StyledTextCtrl_LinesJoin(*args, **kwargs)
[ "def", "LinesJoin", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_LinesJoin", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L4297-L4303
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
ToolBarToolBase.GetLongHelp
(*args, **kwargs)
return _controls_.ToolBarToolBase_GetLongHelp(*args, **kwargs)
GetLongHelp(self) -> String
GetLongHelp(self) -> String
[ "GetLongHelp", "(", "self", ")", "-", ">", "String" ]
def GetLongHelp(*args, **kwargs): """GetLongHelp(self) -> String""" return _controls_.ToolBarToolBase_GetLongHelp(*args, **kwargs)
[ "def", "GetLongHelp", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ToolBarToolBase_GetLongHelp", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L3509-L3511
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/abins/input/casteploader.py
python
CASTEPLoader._check_acoustic_sum
(self)
Checks if acoustic sum correction has been applied during calculations. :returns: True is correction has been applied, otherwise False.
Checks if acoustic sum correction has been applied during calculations. :returns: True is correction has been applied, otherwise False.
[ "Checks", "if", "acoustic", "sum", "correction", "has", "been", "applied", "during", "calculations", ".", ":", "returns", ":", "True", "is", "correction", "has", "been", "applied", "otherwise", "False", "." ]
def _check_acoustic_sum(self): """ Checks if acoustic sum correction has been applied during calculations. :returns: True is correction has been applied, otherwise False. """ header_str_sum = r"^ +q-pt=\s+\d+ +(%(s)s) +(%(s)s) +(%(s)s) +(%(s)s) + " \ r"(%...
[ "def", "_check_acoustic_sum", "(", "self", ")", ":", "header_str_sum", "=", "r\"^ +q-pt=\\s+\\d+ +(%(s)s) +(%(s)s) +(%(s)s) +(%(s)s) + \"", "r\"(%(s)s) + (%(s)s) + (%(s)s)\"", "%", "{", "'s'", ":", "self", ".", "_float_regex", "}", "header_sum", "=", "re", ".", "compile",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/input/casteploader.py#L171-L186
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py
python
NanLoss.__init__
(self, loss_tensor, every_n_steps=100, fail_on_nan_loss=True)
Initializes NanLoss monitor. Args: loss_tensor: `Tensor`, the loss tensor. every_n_steps: `int`, run check every this many steps. fail_on_nan_loss: `bool`, whether to raise exception when loss is NaN.
Initializes NanLoss monitor.
[ "Initializes", "NanLoss", "monitor", "." ]
def __init__(self, loss_tensor, every_n_steps=100, fail_on_nan_loss=True): """Initializes NanLoss monitor. Args: loss_tensor: `Tensor`, the loss tensor. every_n_steps: `int`, run check every this many steps. fail_on_nan_loss: `bool`, whether to raise exception when loss is NaN. """ su...
[ "def", "__init__", "(", "self", ",", "loss_tensor", ",", "every_n_steps", "=", "100", ",", "fail_on_nan_loss", "=", "True", ")", ":", "super", "(", "NanLoss", ",", "self", ")", ".", "__init__", "(", "every_n_steps", "=", "every_n_steps", ")", "self", ".", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py#L1064-L1074
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/nanops.py
python
nanprod
(values, axis=None, skipna=True, min_count=0, mask=None)
return _maybe_null_out(result, axis, mask, min_count=min_count)
Parameters ---------- values : ndarray[dtype] axis: int, optional skipna : bool, default True min_count: int, default 0 mask : ndarray[bool], optional nan-mask if known Returns ------- result : dtype Examples -------- >>> import pandas.core.nanops as nanops ...
Parameters ---------- values : ndarray[dtype] axis: int, optional skipna : bool, default True min_count: int, default 0 mask : ndarray[bool], optional nan-mask if known
[ "Parameters", "----------", "values", ":", "ndarray", "[", "dtype", "]", "axis", ":", "int", "optional", "skipna", ":", "bool", "default", "True", "min_count", ":", "int", "default", "0", "mask", ":", "ndarray", "[", "bool", "]", "optional", "nan", "-", ...
def nanprod(values, axis=None, skipna=True, min_count=0, mask=None): """ Parameters ---------- values : ndarray[dtype] axis: int, optional skipna : bool, default True min_count: int, default 0 mask : ndarray[bool], optional nan-mask if known Returns ------- result : ...
[ "def", "nanprod", "(", "values", ",", "axis", "=", "None", ",", "skipna", "=", "True", ",", "min_count", "=", "0", ",", "mask", "=", "None", ")", ":", "if", "mask", "is", "None", ":", "mask", "=", "isna", "(", "values", ")", "if", "skipna", "and"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/nanops.py#L984-L1016
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Tools/scripts/patchcheck.py
python
reported_news
(file_paths)
return any(p.startswith(os.path.join('Misc', 'NEWS.d', 'next')) for p in file_paths)
Check if Misc/NEWS.d has been changed.
Check if Misc/NEWS.d has been changed.
[ "Check", "if", "Misc", "/", "NEWS", ".", "d", "has", "been", "changed", "." ]
def reported_news(file_paths): """Check if Misc/NEWS.d has been changed.""" return any(p.startswith(os.path.join('Misc', 'NEWS.d', 'next')) for p in file_paths)
[ "def", "reported_news", "(", "file_paths", ")", ":", "return", "any", "(", "p", ".", "startswith", "(", "os", ".", "path", ".", "join", "(", "'Misc'", ",", "'NEWS.d'", ",", "'next'", ")", ")", "for", "p", "in", "file_paths", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Tools/scripts/patchcheck.py#L202-L205
apache/kudu
90895ce76590f10730ad7aac3613b69d89ff5422
build-support/check_compatibility.py
python
find_client_jars
(path)
return [j for j in all_jars if ( "-javadoc" not in j and "-sources" not in j and "-test-sources" not in j and "-tests" not in j and "-unshaded" not in j and "buildSrc" not in j and "gradle-wrapper" not in j and "kudu-backup" not in j and "kudu-hive" not in j and ...
Return a list of jars within 'path' to be checked for compatibility.
Return a list of jars within 'path' to be checked for compatibility.
[ "Return", "a", "list", "of", "jars", "within", "path", "to", "be", "checked", "for", "compatibility", "." ]
def find_client_jars(path): """ Return a list of jars within 'path' to be checked for compatibility. """ all_jars = set(check_output(["find", path, "-name", "*.jar"]).decode('utf-8').splitlines()) return [j for j in all_jars if ( "-javadoc" not in j and "-sources" not in j and "-test-sources" no...
[ "def", "find_client_jars", "(", "path", ")", ":", "all_jars", "=", "set", "(", "check_output", "(", "[", "\"find\"", ",", "path", ",", "\"-name\"", ",", "\"*.jar\"", "]", ")", ".", "decode", "(", "'utf-8'", ")", ".", "splitlines", "(", ")", ")", "retur...
https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/build-support/check_compatibility.py#L121-L136
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/advancedsplash.py
python
AdvancedSplash.OnCloseWindow
(self, event)
Handles the ``wx.EVT_CLOSE`` event for :class:`AdvancedSplash`. :param `event`: a :class:`CloseEvent` to be processed. :note: This reproduces the behavior of :class:`SplashScreen`.
Handles the ``wx.EVT_CLOSE`` event for :class:`AdvancedSplash`.
[ "Handles", "the", "wx", ".", "EVT_CLOSE", "event", "for", ":", "class", ":", "AdvancedSplash", "." ]
def OnCloseWindow(self, event): """ Handles the ``wx.EVT_CLOSE`` event for :class:`AdvancedSplash`. :param `event`: a :class:`CloseEvent` to be processed. :note: This reproduces the behavior of :class:`SplashScreen`. """ if hasattr(self, "_splashtimer"): ...
[ "def", "OnCloseWindow", "(", "self", ",", "event", ")", ":", "if", "hasattr", "(", "self", ",", "\"_splashtimer\"", ")", ":", "self", ".", "_splashtimer", ".", "Stop", "(", ")", "del", "self", ".", "_splashtimer", "self", ".", "Destroy", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/advancedsplash.py#L380-L393
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiNotebookEvent.SetDragSource
(*args, **kwargs)
return _aui.AuiNotebookEvent_SetDragSource(*args, **kwargs)
SetDragSource(self, AuiNotebook s)
SetDragSource(self, AuiNotebook s)
[ "SetDragSource", "(", "self", "AuiNotebook", "s", ")" ]
def SetDragSource(*args, **kwargs): """SetDragSource(self, AuiNotebook s)""" return _aui.AuiNotebookEvent_SetDragSource(*args, **kwargs)
[ "def", "SetDragSource", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiNotebookEvent_SetDragSource", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L1084-L1086
facebook/bistro
db9eff7e92f5cedcc917a440d5c88064c7980e40
build/fbcode_builder/getdeps/platform.py
python
get_available_ram
()
Returns a platform-appropriate available RAM metric in MiB.
Returns a platform-appropriate available RAM metric in MiB.
[ "Returns", "a", "platform", "-", "appropriate", "available", "RAM", "metric", "in", "MiB", "." ]
def get_available_ram() -> int: """ Returns a platform-appropriate available RAM metric in MiB. """ if sys.platform == "linux": return _get_available_ram_linux() elif sys.platform == "darwin": return _get_available_ram_macos() elif sys.platform == "win32": return _get_ava...
[ "def", "get_available_ram", "(", ")", "->", "int", ":", "if", "sys", ".", "platform", "==", "\"linux\"", ":", "return", "_get_available_ram_linux", "(", ")", "elif", "sys", ".", "platform", "==", "\"darwin\"", ":", "return", "_get_available_ram_macos", "(", ")...
https://github.com/facebook/bistro/blob/db9eff7e92f5cedcc917a440d5c88064c7980e40/build/fbcode_builder/getdeps/platform.py#L133-L146
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
bindings/python/htcondor/htchirp/htchirp.py
python
HTChirp.getfile
(self, remote_file, local_file)
return bytes_recv
Retrieve an entire file efficiently from the remote machine. :param remote_file: Path to file to be sent from remote machine :param local_file: Path to file to be written to on local machine :returns: Bytes written
Retrieve an entire file efficiently from the remote machine.
[ "Retrieve", "an", "entire", "file", "efficiently", "from", "the", "remote", "machine", "." ]
def getfile(self, remote_file, local_file): """Retrieve an entire file efficiently from the remote machine. :param remote_file: Path to file to be sent from remote machine :param local_file: Path to file to be written to on local machine :returns: Bytes written """ len...
[ "def", "getfile", "(", "self", ",", "remote_file", ",", "local_file", ")", ":", "length", "=", "int", "(", "self", ".", "_simple_command", "(", "\"getfile {0}\\n\"", ".", "format", "(", "quote", "(", "remote_file", ")", ")", ")", ")", "bytes_recv", "=", ...
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/bindings/python/htcondor/htchirp/htchirp.py#L881-L893
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBCommandInterpreter.HasCustomQuitExitCode
(self)
return _lldb.SBCommandInterpreter_HasCustomQuitExitCode(self)
HasCustomQuitExitCode(SBCommandInterpreter self) -> bool
HasCustomQuitExitCode(SBCommandInterpreter self) -> bool
[ "HasCustomQuitExitCode", "(", "SBCommandInterpreter", "self", ")", "-", ">", "bool" ]
def HasCustomQuitExitCode(self): """HasCustomQuitExitCode(SBCommandInterpreter self) -> bool""" return _lldb.SBCommandInterpreter_HasCustomQuitExitCode(self)
[ "def", "HasCustomQuitExitCode", "(", "self", ")", ":", "return", "_lldb", ".", "SBCommandInterpreter_HasCustomQuitExitCode", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L2697-L2699
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/png/png.py
python
Test.testPGMin
(self)
Test that the command line tool can read PGM files.
Test that the command line tool can read PGM files.
[ "Test", "that", "the", "command", "line", "tool", "can", "read", "PGM", "files", "." ]
def testPGMin(self): """Test that the command line tool can read PGM files.""" def do(): return _main(['testPGMin']) s = BytesIO() s.write(strtobytes('P5 2 2 3\n')) s.write(strtobytes('\x00\x01\x02\x03')) s.flush() s.seek(0) o = BytesIO() ...
[ "def", "testPGMin", "(", "self", ")", ":", "def", "do", "(", ")", ":", "return", "_main", "(", "[", "'testPGMin'", "]", ")", "s", "=", "BytesIO", "(", ")", "s", ".", "write", "(", "strtobytes", "(", "'P5 2 2 3\\n'", ")", ")", "s", ".", "write", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/png/png.py#L2649-L2663
rodeofx/OpenWalter
6116fbe3f04f1146c854afbfbdbe944feaee647e
walter/common/walterWidgets/walterBaseTreeView.py
python
BaseDelegate.drawIcon
(self, rect, painter, option, index)
Draw the item's icon.
Draw the item's icon.
[ "Draw", "the", "item", "s", "icon", "." ]
def drawIcon(self, rect, painter, option, index): """Draw the item's icon.""" painter.save() if (index.column() == 0): icon = toPyObject(index.data(ICON)) if icon: newRect = QtCore.QRect() padding = dpiScale(4) center = \ ...
[ "def", "drawIcon", "(", "self", ",", "rect", ",", "painter", ",", "option", ",", "index", ")", ":", "painter", ".", "save", "(", ")", "if", "(", "index", ".", "column", "(", ")", "==", "0", ")", ":", "icon", "=", "toPyObject", "(", "index", ".", ...
https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/common/walterWidgets/walterBaseTreeView.py#L317-L335
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/matlib.py
python
rand
(*args)
return asmatrix(np.random.rand(*args))
Return a matrix of random values with given shape. Create a matrix of the given shape and propagate it with random samples from a uniform distribution over ``[0, 1)``. Parameters ---------- \\*args : Arguments Shape of the output. If given as N integers, each integer specifies the ...
Return a matrix of random values with given shape.
[ "Return", "a", "matrix", "of", "random", "values", "with", "given", "shape", "." ]
def rand(*args): """ Return a matrix of random values with given shape. Create a matrix of the given shape and propagate it with random samples from a uniform distribution over ``[0, 1)``. Parameters ---------- \\*args : Arguments Shape of the output. If given as N integers...
[ "def", "rand", "(", "*", "args", ")", ":", "if", "isinstance", "(", "args", "[", "0", "]", ",", "tuple", ")", ":", "args", "=", "args", "[", "0", "]", "return", "asmatrix", "(", "np", ".", "random", ".", "rand", "(", "*", "args", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/matlib.py#L220-L263
zachriggle/ida-splode
a4aee3be415b318a0e051a523ebd0a8d6d5e0026
py/idasplode/query.py
python
TracesWhichModifyOrReadCurrentIdaFile
(query={})
return TracesWhichInteractWithMemory(low=addr.Min(), high=addr.Max())
Queries for all Read and Write traces, where either the memory read, or the value at the memory address read, is within the file open in IDA.
Queries for all Read and Write traces, where either the memory read, or the value at the memory address read, is within the file open in IDA.
[ "Queries", "for", "all", "Read", "and", "Write", "traces", "where", "either", "the", "memory", "read", "or", "the", "value", "at", "the", "memory", "address", "read", "is", "within", "the", "file", "open", "in", "IDA", "." ]
def TracesWhichModifyOrReadCurrentIdaFile(query={}): """ Queries for all Read and Write traces, where either the memory read, or the value at the memory address read, is within the file open in IDA. """ return TracesWhichInteractWithMemory(low=addr.Min(), high=addr.Max())
[ "def", "TracesWhichModifyOrReadCurrentIdaFile", "(", "query", "=", "{", "}", ")", ":", "return", "TracesWhichInteractWithMemory", "(", "low", "=", "addr", ".", "Min", "(", ")", ",", "high", "=", "addr", ".", "Max", "(", ")", ")" ]
https://github.com/zachriggle/ida-splode/blob/a4aee3be415b318a0e051a523ebd0a8d6d5e0026/py/idasplode/query.py#L81-L87
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/agilepy/lib_wx/objpanel.py
python
BooleanWidgetContainer.get_widgetvalue
(self)
return self.valuewidget.GetValue()
Returnes current value from valuewidget. Depends on attribute type and hence widgettype. To be overwritten.
Returnes current value from valuewidget. Depends on attribute type and hence widgettype. To be overwritten.
[ "Returnes", "current", "value", "from", "valuewidget", ".", "Depends", "on", "attribute", "type", "and", "hence", "widgettype", ".", "To", "be", "overwritten", "." ]
def get_widgetvalue(self): """ Returnes current value from valuewidget. Depends on attribute type and hence widgettype. To be overwritten. """ return self.valuewidget.GetValue()
[ "def", "get_widgetvalue", "(", "self", ")", ":", "return", "self", ".", "valuewidget", ".", "GetValue", "(", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/objpanel.py#L801-L807
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
Slider.GetLineSize
(*args, **kwargs)
return _controls_.Slider_GetLineSize(*args, **kwargs)
GetLineSize(self) -> int
GetLineSize(self) -> int
[ "GetLineSize", "(", "self", ")", "-", ">", "int" ]
def GetLineSize(*args, **kwargs): """GetLineSize(self) -> int""" return _controls_.Slider_GetLineSize(*args, **kwargs)
[ "def", "GetLineSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Slider_GetLineSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L2879-L2881
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/zoombar.py
python
ZoomBarImage.SetSize
(self, width, height)
Sets the button size. :param `width`: the button width; :param `height`: the button height.
Sets the button size.
[ "Sets", "the", "button", "size", "." ]
def SetSize(self, width, height): """ Sets the button size. :param `width`: the button width; :param `height`: the button height. """ self._width = width self._height = height
[ "def", "SetSize", "(", "self", ",", "width", ",", "height", ")", ":", "self", ".", "_width", "=", "width", "self", ".", "_height", "=", "height" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/zoombar.py#L430-L439
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/codecs.py
python
StreamWriter.write
(self, object)
Writes the object's contents encoded to self.stream.
Writes the object's contents encoded to self.stream.
[ "Writes", "the", "object", "s", "contents", "encoded", "to", "self", ".", "stream", "." ]
def write(self, object): """ Writes the object's contents encoded to self.stream. """ data, consumed = self.encode(object, self.errors) self.stream.write(data)
[ "def", "write", "(", "self", ",", "object", ")", ":", "data", ",", "consumed", "=", "self", ".", "encode", "(", "object", ",", "self", ".", "errors", ")", "self", ".", "stream", ".", "write", "(", "data", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/codecs.py#L347-L352