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/Arch/importIFClegacy.py
python
IfcFile.nextString
(self, s, start)
return len(s)+1
Parse the data part of a line
Parse the data part of a line
[ "Parse", "the", "data", "part", "of", "a", "line" ]
def nextString(self, s, start): """ Parse the data part of a line """ parens = 0 quotes = 0 for pos in range(start,len(s)): c = s[pos] if c == "," and parens == 0 and quotes == 0: return pos+1 elif c == "(" and quotes =...
[ "def", "nextString", "(", "self", ",", "s", ",", "start", ")", ":", "parens", "=", "0", "quotes", "=", "0", "for", "pos", "in", "range", "(", "start", ",", "len", "(", "s", ")", ")", ":", "c", "=", "s", "[", "pos", "]", "if", "c", "==", "\"...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/importIFClegacy.py#L1612-L1632
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/sharedctypes.py
python
Array
(typecode_or_type, size_or_initializer, *, lock=True, ctx=None)
return synchronized(obj, lock, ctx=ctx)
Return a synchronization wrapper for a RawArray
Return a synchronization wrapper for a RawArray
[ "Return", "a", "synchronization", "wrapper", "for", "a", "RawArray" ]
def Array(typecode_or_type, size_or_initializer, *, lock=True, ctx=None): ''' Return a synchronization wrapper for a RawArray ''' obj = RawArray(typecode_or_type, size_or_initializer) if lock is False: return obj if lock in (True, None): ctx = ctx or get_context() lock = ...
[ "def", "Array", "(", "typecode_or_type", ",", "size_or_initializer", ",", "*", ",", "lock", "=", "True", ",", "ctx", "=", "None", ")", ":", "obj", "=", "RawArray", "(", "typecode_or_type", ",", "size_or_initializer", ")", "if", "lock", "is", "False", ":", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/sharedctypes.py#L84-L96
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/framemanager.py
python
AuiManager.AddPane
(self, window, arg1=None, arg2=None, target=None)
Tells the frame manager to start managing a child window. There are four versions of this function. The first verison allows the full spectrum of pane parameter possibilities (:meth:`AddPane1`). The second version is used for simpler user interfaces which do not require as much configuration (:m...
Tells the frame manager to start managing a child window. There are four versions of this function. The first verison allows the full spectrum of pane parameter possibilities (:meth:`AddPane1`). The second version is used for simpler user interfaces which do not require as much configuration (:m...
[ "Tells", "the", "frame", "manager", "to", "start", "managing", "a", "child", "window", ".", "There", "are", "four", "versions", "of", "this", "function", ".", "The", "first", "verison", "allows", "the", "full", "spectrum", "of", "pane", "parameter", "possibi...
def AddPane(self, window, arg1=None, arg2=None, target=None): """ Tells the frame manager to start managing a child window. There are four versions of this function. The first verison allows the full spectrum of pane parameter possibilities (:meth:`AddPane1`). The second version is used ...
[ "def", "AddPane", "(", "self", ",", "window", ",", "arg1", "=", "None", ",", "arg2", "=", "None", ",", "target", "=", "None", ")", ":", "if", "target", "in", "self", ".", "_panes", ":", "return", "self", ".", "AddPane4", "(", "window", ",", "arg1",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L4683-L4717
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/ops/autoencoder_ops.py
python
dnn_autoencoder
( tensor_in, hidden_units, activation=nn.relu, add_noise=None, dropout=None, scope=None)
Creates fully connected autoencoder subgraph. Args: tensor_in: tensor or placeholder for input features. hidden_units: list of counts of hidden units in each layer. activation: activation function used to map inner latent layer onto reconstruction layer. add_noise: a function that add...
Creates fully connected autoencoder subgraph.
[ "Creates", "fully", "connected", "autoencoder", "subgraph", "." ]
def dnn_autoencoder( tensor_in, hidden_units, activation=nn.relu, add_noise=None, dropout=None, scope=None): """Creates fully connected autoencoder subgraph. Args: tensor_in: tensor or placeholder for input features. hidden_units: list of counts of hidden units in each layer. activation: activa...
[ "def", "dnn_autoencoder", "(", "tensor_in", ",", "hidden_units", ",", "activation", "=", "nn", ".", "relu", ",", "add_noise", "=", "None", ",", "dropout", "=", "None", ",", "scope", "=", "None", ")", ":", "with", "vs", ".", "variable_op_scope", "(", "[",...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/ops/autoencoder_ops.py#L27-L58
alibaba/MNN
c4d9566171d589c3ded23aa18ffb197016995a12
pymnn/pip_package/MNN/expr/__init__.py
python
relu6
(x, min=0.0, max=6.0)
return _F.relu6(x, min, max)
relu6(x, min=0.0, max=6.0) `max(min(x, max), min)` of `x`. Parameters ---------- x : var_like, input value. min : float, input value. Default is 0.0; max : float, input value. Default is 6.0; Returns ------- relu6_res : Var. Example: ------- >>> expr.relu6([-1.0, 7.0, ...
relu6(x, min=0.0, max=6.0) `max(min(x, max), min)` of `x`.
[ "relu6", "(", "x", "min", "=", "0", ".", "0", "max", "=", "6", ".", "0", ")", "max", "(", "min", "(", "x", "max", ")", "min", ")", "of", "x", "." ]
def relu6(x, min=0.0, max=6.0): ''' relu6(x, min=0.0, max=6.0) `max(min(x, max), min)` of `x`. Parameters ---------- x : var_like, input value. min : float, input value. Default is 0.0; max : float, input value. Default is 6.0; Returns ------- relu6_res : Var. Example:...
[ "def", "relu6", "(", "x", ",", "min", "=", "0.0", ",", "max", "=", "6.0", ")", ":", "x", "=", "_to_var", "(", "x", ")", "min", "=", "_to_float", "(", "min", ")", "max", "=", "_to_float", "(", "max", ")", "return", "_F", ".", "relu6", "(", "x"...
https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L1918-L1941
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_math_ops.py
python
ragged_reduce_aggregate
(reduce_op, unsorted_segment_op, rt_input, axis, keepdims, separator=None, name=None)
Aggregates across axes of a RaggedTensor using the given `Tensor` ops. Reduces `rt_input` along the dimensions given in `axis`. The rank of the tensor is reduced by 1 for each entry in `axis`. If `axis` is not specified, then all dimensions are reduced, and a scalar value is returned. This op assumes that `...
Aggregates across axes of a RaggedTensor using the given `Tensor` ops.
[ "Aggregates", "across", "axes", "of", "a", "RaggedTensor", "using", "the", "given", "Tensor", "ops", "." ]
def ragged_reduce_aggregate(reduce_op, unsorted_segment_op, rt_input, axis, keepdims, separator=None, name=None): """Aggregates across axes of a Ragge...
[ "def", "ragged_reduce_aggregate", "(", "reduce_op", ",", "unsorted_segment_op", ",", "rt_input", ",", "axis", ",", "keepdims", ",", "separator", "=", "None", ",", "name", "=", "None", ")", ":", "if", "not", "ragged_tensor", ".", "is_ragged", "(", "rt_input", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_math_ops.py#L427-L545
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/chigger/observers/KeyObserver.py
python
KeyObserver.addObserver
(self, event, vtkinteractor)
return vtkinteractor.AddObserver(event, self._callback)
Add the KeyPressEvent for this object.
Add the KeyPressEvent for this object.
[ "Add", "the", "KeyPressEvent", "for", "this", "object", "." ]
def addObserver(self, event, vtkinteractor): """ Add the KeyPressEvent for this object. """ return vtkinteractor.AddObserver(event, self._callback)
[ "def", "addObserver", "(", "self", ",", "event", ",", "vtkinteractor", ")", ":", "return", "vtkinteractor", ".", "AddObserver", "(", "event", ",", "self", ".", "_callback", ")" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/observers/KeyObserver.py#L26-L30
lmb-freiburg/flownet2
b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc
scripts/cpp_lint.py
python
FileInfo.NoExtension
(self)
return '/'.join(self.Split()[0:2])
File has no source file extension.
File has no source file extension.
[ "File", "has", "no", "source", "file", "extension", "." ]
def NoExtension(self): """File has no source file extension.""" return '/'.join(self.Split()[0:2])
[ "def", "NoExtension", "(", "self", ")", ":", "return", "'/'", ".", "join", "(", "self", ".", "Split", "(", ")", "[", "0", ":", "2", "]", ")" ]
https://github.com/lmb-freiburg/flownet2/blob/b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc/scripts/cpp_lint.py#L952-L954
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/distutils/ccompiler.py
python
CCompiler.undefine_macro
(self, name)
Undefine a preprocessor macro for all compilations driven by this compiler object. If the same macro is defined by 'define_macro()' and undefined by 'undefine_macro()' the last call takes precedence (including multiple redefinitions or undefinitions). If the macro is redefined/undefine...
Undefine a preprocessor macro for all compilations driven by this compiler object. If the same macro is defined by 'define_macro()' and undefined by 'undefine_macro()' the last call takes precedence (including multiple redefinitions or undefinitions). If the macro is redefined/undefine...
[ "Undefine", "a", "preprocessor", "macro", "for", "all", "compilations", "driven", "by", "this", "compiler", "object", ".", "If", "the", "same", "macro", "is", "defined", "by", "define_macro", "()", "and", "undefined", "by", "undefine_macro", "()", "the", "last...
def undefine_macro(self, name): """Undefine a preprocessor macro for all compilations driven by this compiler object. If the same macro is defined by 'define_macro()' and undefined by 'undefine_macro()' the last call takes precedence (including multiple redefinitions or undefini...
[ "def", "undefine_macro", "(", "self", ",", "name", ")", ":", "# Delete from the list of macro definitions/undefinitions if", "# already there (so that this one will take precedence).", "i", "=", "self", ".", "_find_macro", "(", "name", ")", "if", "i", "is", "not", "None",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/ccompiler.py#L199-L215
GeometryCollective/boundary-first-flattening
8250e5a0e85980ec50b5e8aa8f49dd6519f915cd
deps/nanogui/ext/pybind11/tools/clang/cindex.py
python
register_functions
(lib, ignore_errors)
Register function prototypes with a libclang library instance. This must be called as part of library instantiation so Python knows how to call out to the shared library.
Register function prototypes with a libclang library instance.
[ "Register", "function", "prototypes", "with", "a", "libclang", "library", "instance", "." ]
def register_functions(lib, ignore_errors): """Register function prototypes with a libclang library instance. This must be called as part of library instantiation so Python knows how to call out to the shared library. """ def register(item): return register_function(lib, item, ignore_error...
[ "def", "register_functions", "(", "lib", ",", "ignore_errors", ")", ":", "def", "register", "(", "item", ")", ":", "return", "register_function", "(", "lib", ",", "item", ",", "ignore_errors", ")", "for", "f", "in", "functionList", ":", "register", "(", "f...
https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/ext/pybind11/tools/clang/cindex.py#L3618-L3629
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/math_ops.py
python
real
(input, name=None)
Returns the real part of a complex number. Given a tensor `input` of complex numbers, this operation returns a tensor of type `float32` or `float64` that is the real part of each element in `input`. All elements in `input` must be complex numbers of the form \\(a + bj\\), where *a* is the real part returned by...
Returns the real part of a complex number.
[ "Returns", "the", "real", "part", "of", "a", "complex", "number", "." ]
def real(input, name=None): """Returns the real part of a complex number. Given a tensor `input` of complex numbers, this operation returns a tensor of type `float32` or `float64` that is the real part of each element in `input`. All elements in `input` must be complex numbers of the form \\(a + bj\\), where...
[ "def", "real", "(", "input", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "input", "]", ",", "name", ",", "\"Real\"", ")", "as", "name", ":", "return", "gen_math_ops", ".", "real", "(", "input", ",", "Tout", "=", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L508-L533
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/fftpack/pseudo_diffs.py
python
itilbert
(x,h,period=None, _cache=_cache)
return convolve.convolve(tmp,omega,swap_real_imag=1,overwrite_x=overwrite_x)
Return inverse h-Tilbert transform of a periodic sequence x. If ``x_j`` and ``y_j`` are Fourier coefficients of periodic functions x and y, respectively, then:: y_j = -sqrt(-1)*tanh(j*h*2*pi/period) * x_j y_0 = 0 For more details, see `tilbert`.
Return inverse h-Tilbert transform of a periodic sequence x.
[ "Return", "inverse", "h", "-", "Tilbert", "transform", "of", "a", "periodic", "sequence", "x", "." ]
def itilbert(x,h,period=None, _cache=_cache): """ Return inverse h-Tilbert transform of a periodic sequence x. If ``x_j`` and ``y_j`` are Fourier coefficients of periodic functions x and y, respectively, then:: y_j = -sqrt(-1)*tanh(j*h*2*pi/period) * x_j y_0 = 0 For more details, see ...
[ "def", "itilbert", "(", "x", ",", "h", ",", "period", "=", "None", ",", "_cache", "=", "_cache", ")", ":", "tmp", "=", "asarray", "(", "x", ")", "if", "iscomplexobj", "(", "tmp", ")", ":", "return", "itilbert", "(", "tmp", ".", "real", ",", "h", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/fftpack/pseudo_diffs.py#L159-L192
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/quantization/keras/vitis/utils/model_utils.py
python
_adjust_vitis_sigmoid
(model, quantize_info)
return adjusted_quantize_info
Adjust quantize info of VitisSigmoid layers. DPU compiler constraints for VitisSigmoid: 1. input pos of VitisSigmoid >= 0 2. output pos of VitisSigmoid >= 7
Adjust quantize info of VitisSigmoid layers.
[ "Adjust", "quantize", "info", "of", "VitisSigmoid", "layers", "." ]
def _adjust_vitis_sigmoid(model, quantize_info): """Adjust quantize info of VitisSigmoid layers. DPU compiler constraints for VitisSigmoid: 1. input pos of VitisSigmoid >= 0 2. output pos of VitisSigmoid >= 7 """ adjusted_quantize_info = copy.deepcopy(quantize_info) for i in range(1, len(model.layer...
[ "def", "_adjust_vitis_sigmoid", "(", "model", ",", "quantize_info", ")", ":", "adjusted_quantize_info", "=", "copy", ".", "deepcopy", "(", "quantize_info", ")", "for", "i", "in", "range", "(", "1", ",", "len", "(", "model", ".", "layers", ")", ")", ":", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/quantization/keras/vitis/utils/model_utils.py#L575-L603
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/json_schema_compiler/model.py
python
_GetTypes
(parent, json, namespace, origin)
return types
Creates Type objects extracted from |json|.
Creates Type objects extracted from |json|.
[ "Creates", "Type", "objects", "extracted", "from", "|json|", "." ]
def _GetTypes(parent, json, namespace, origin): """Creates Type objects extracted from |json|. """ types = OrderedDict() for type_json in json.get('types', []): type_ = Type(parent, type_json['id'], type_json, namespace, origin) types[type_.name] = type_ return types
[ "def", "_GetTypes", "(", "parent", ",", "json", ",", "namespace", ",", "origin", ")", ":", "types", "=", "OrderedDict", "(", ")", "for", "type_json", "in", "json", ".", "get", "(", "'types'", ",", "[", "]", ")", ":", "type_", "=", "Type", "(", "par...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/json_schema_compiler/model.py#L543-L550
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/LRAutoReduction.py
python
LRAutoReduction._save_partial_output
(self, data_set, first_run_of_set, sequence_number, run_number)
return file_path
Stitch and save the full reflectivity curve, or as much as we have at the moment. @param data_set: DataSets object @param run_number: run number according to the data file name @param first_run_of_set: first run in the sequence (sequence ID) @param sequence_number: the ID...
Stitch and save the full reflectivity curve, or as much as we have at the moment.
[ "Stitch", "and", "save", "the", "full", "reflectivity", "curve", "or", "as", "much", "as", "we", "have", "at", "the", "moment", "." ]
def _save_partial_output(self, data_set, first_run_of_set, sequence_number, run_number): """ Stitch and save the full reflectivity curve, or as much as we have at the moment. @param data_set: DataSets object @param run_number: run number according to the data file name ...
[ "def", "_save_partial_output", "(", "self", ",", "data_set", ",", "first_run_of_set", ",", "sequence_number", ",", "run_number", ")", ":", "output_dir", "=", "self", ".", "getProperty", "(", "\"OutputDirectory\"", ")", ".", "value", "output_file", "=", "self", "...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/LRAutoReduction.py#L529-L591
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/urllib.py
python
urlencode
(query, doseq=0)
return '&'.join(l)
Encode a sequence of two-element tuples or dictionary into a URL query string. If any values in the query arg are sequences and doseq is true, each sequence element is converted to a separate parameter. If the query arg is a sequence of two-element tuples, the order of the parameters in the output wil...
Encode a sequence of two-element tuples or dictionary into a URL query string.
[ "Encode", "a", "sequence", "of", "two", "-", "element", "tuples", "or", "dictionary", "into", "a", "URL", "query", "string", "." ]
def urlencode(query, doseq=0): """Encode a sequence of two-element tuples or dictionary into a URL query string. If any values in the query arg are sequences and doseq is true, each sequence element is converted to a separate parameter. If the query arg is a sequence of two-element tuples, the order o...
[ "def", "urlencode", "(", "query", ",", "doseq", "=", "0", ")", ":", "if", "hasattr", "(", "query", ",", "\"items\"", ")", ":", "# mapping objects", "query", "=", "query", ".", "items", "(", ")", "else", ":", "# it's a bother at times that strings and string-li...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/urllib.py#L1291-L1352
NVIDIAGameWorks/kaolin
e5148d05e9c1e2ce92a07881ce3593b1c5c3f166
kaolin/io/usd.py
python
get_authored_time_samples
(file_path)
return sorted(res)
r""" Returns *all* authored time samples within the USD, aggregated across all primitives. Args: file_path (str): Path to usd file (\*.usd, \*.usda). Returns: (list)
r""" Returns *all* authored time samples within the USD, aggregated across all primitives.
[ "r", "Returns", "*", "all", "*", "authored", "time", "samples", "within", "the", "USD", "aggregated", "across", "all", "primitives", "." ]
def get_authored_time_samples(file_path): r""" Returns *all* authored time samples within the USD, aggregated across all primitives. Args: file_path (str): Path to usd file (\*.usd, \*.usda). Returns: (list) """ stage = Usd.Stage.Open(file_path) scene_paths = get_scene_path...
[ "def", "get_authored_time_samples", "(", "file_path", ")", ":", "stage", "=", "Usd", ".", "Stage", ".", "Open", "(", "file_path", ")", "scene_paths", "=", "get_scene_paths", "(", "file_path", ")", "res", "=", "set", "(", ")", "for", "scene_path", "in", "sc...
https://github.com/NVIDIAGameWorks/kaolin/blob/e5148d05e9c1e2ce92a07881ce3593b1c5c3f166/kaolin/io/usd.py#L338-L355
Tencent/TNN
7acca99f54c55747b415a4c57677403eebc7b706
third_party/flatbuffers/python/flatbuffers/builder.py
python
Builder.EndVector
(self)
return self.Offset()
EndVector writes data necessary to finish vector construction.
EndVector writes data necessary to finish vector construction.
[ "EndVector", "writes", "data", "necessary", "to", "finish", "vector", "construction", "." ]
def EndVector(self): """EndVector writes data necessary to finish vector construction.""" self.assertNested() ## @cond FLATBUFFERS_INTERNAL self.nested = False ## @endcond # we already made space for this, so write without PrependUint32 self.PlaceUOffsetT(self.ve...
[ "def", "EndVector", "(", "self", ")", ":", "self", ".", "assertNested", "(", ")", "## @cond FLATBUFFERS_INTERNAL", "self", ".", "nested", "=", "False", "## @endcond", "# we already made space for this, so write without PrependUint32", "self", ".", "PlaceUOffsetT", "(", ...
https://github.com/Tencent/TNN/blob/7acca99f54c55747b415a4c57677403eebc7b706/third_party/flatbuffers/python/flatbuffers/builder.py#L380-L390
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/input.py
python
DependencyGraphNode.DeepDependencies
(self, dependencies=None)
return dependencies
Returns an OrderedSet of all of a target's dependencies, recursively.
Returns an OrderedSet of all of a target's dependencies, recursively.
[ "Returns", "an", "OrderedSet", "of", "all", "of", "a", "target", "s", "dependencies", "recursively", "." ]
def DeepDependencies(self, dependencies=None): """Returns an OrderedSet of all of a target's dependencies, recursively.""" if dependencies is None: # Using a list to get ordered output and a set to do fast "is it # already added" checks. dependencies = OrderedSet() for dependency in self....
[ "def", "DeepDependencies", "(", "self", ",", "dependencies", "=", "None", ")", ":", "if", "dependencies", "is", "None", ":", "# Using a list to get ordered output and a set to do fast \"is it", "# already added\" checks.", "dependencies", "=", "OrderedSet", "(", ")", "for...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/input.py#L1435-L1450
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
ci/build.py
python
Cleanup.__call__
(self)
Perform cleanup
Perform cleanup
[ "Perform", "cleanup" ]
def __call__(self): """Perform cleanup""" self._cleanup_containers()
[ "def", "__call__", "(", "self", ")", ":", "self", ".", "_cleanup_containers", "(", ")" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/ci/build.py#L84-L86
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/eager/context.py
python
Context.config
(self)
return config
Return the ConfigProto with all runtime deltas applied.
Return the ConfigProto with all runtime deltas applied.
[ "Return", "the", "ConfigProto", "with", "all", "runtime", "deltas", "applied", "." ]
def config(self): """Return the ConfigProto with all runtime deltas applied.""" # Ensure physical devices have been discovered and config has been imported self._initialize_physical_devices() config = config_pb2.ConfigProto() if self._config is not None: config.CopyFrom(self._config) if ...
[ "def", "config", "(", "self", ")", ":", "# Ensure physical devices have been discovered and config has been imported", "self", ".", "_initialize_physical_devices", "(", ")", "config", "=", "config_pb2", ".", "ConfigProto", "(", ")", "if", "self", ".", "_config", "is", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/context.py#L1071-L1185
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/_pyio.py
python
FileIO.read
(self, size=None)
Read at most size bytes, returned as bytes. Only makes one system call, so less data may be returned than requested In non-blocking mode, returns None if no data is available. Return an empty bytes object at EOF.
Read at most size bytes, returned as bytes.
[ "Read", "at", "most", "size", "bytes", "returned", "as", "bytes", "." ]
def read(self, size=None): """Read at most size bytes, returned as bytes. Only makes one system call, so less data may be returned than requested In non-blocking mode, returns None if no data is available. Return an empty bytes object at EOF. """ self._checkClosed() ...
[ "def", "read", "(", "self", ",", "size", "=", "None", ")", ":", "self", ".", "_checkClosed", "(", ")", "self", ".", "_checkReadable", "(", ")", "if", "size", "is", "None", "or", "size", "<", "0", ":", "return", "self", ".", "readall", "(", ")", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/_pyio.py#L1638-L1652
fengbingchun/NN_Test
d6305825d5273e4569ccd1eda9ffa2a9c72e18d2
src/tiny-dnn/third_party/cpplint.py
python
IsDecltype
(clean_lines, linenum, column)
return False
Check if the token ending on (linenum, column) is decltype(). Args: clean_lines: A CleansedLines instance containing the file. linenum: the number of the line to check. column: end column of the token to check. Returns: True if this token is decltype() expression, False otherwise.
Check if the token ending on (linenum, column) is decltype().
[ "Check", "if", "the", "token", "ending", "on", "(", "linenum", "column", ")", "is", "decltype", "()", "." ]
def IsDecltype(clean_lines, linenum, column): """Check if the token ending on (linenum, column) is decltype(). Args: clean_lines: A CleansedLines instance containing the file. linenum: the number of the line to check. column: end column of the token to check. Returns: True if this token is declty...
[ "def", "IsDecltype", "(", "clean_lines", ",", "linenum", ",", "column", ")", ":", "(", "text", ",", "_", ",", "start_col", ")", "=", "ReverseCloseExpression", "(", "clean_lines", ",", "linenum", ",", "column", ")", "if", "start_col", "<", "0", ":", "retu...
https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/cpplint.py#L3781-L3796
yrnkrn/zapcc
c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50
bindings/python/llvm/object.py
python
Section.has_symbol
(self, symbol)
return lib.LLVMGetSectionContainsSymbol(self, symbol)
Returns whether a Symbol instance is present in this Section.
Returns whether a Symbol instance is present in this Section.
[ "Returns", "whether", "a", "Symbol", "instance", "is", "present", "in", "this", "Section", "." ]
def has_symbol(self, symbol): """Returns whether a Symbol instance is present in this Section.""" if self.expired: raise Exception('Section instance has expired.') assert isinstance(symbol, Symbol) return lib.LLVMGetSectionContainsSymbol(self, symbol)
[ "def", "has_symbol", "(", "self", ",", "symbol", ")", ":", "if", "self", ".", "expired", ":", "raise", "Exception", "(", "'Section instance has expired.'", ")", "assert", "isinstance", "(", "symbol", ",", "Symbol", ")", "return", "lib", ".", "LLVMGetSectionCon...
https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/bindings/python/llvm/object.py#L232-L238
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/nn/functional/conv.py
python
conv3d
(x, weight, bias=None, stride=1, padding=0, dilation=1, groups=1, data_format="NCDHW", name=None)
return _conv_nd(x, weight, bias, stride, padding, padding_algorithm, dilation, groups, data_format, channel_dim, op_type, use_cudnn, False, name)
r""" The convolution3D layer calculates the output based on the input, filter and strides, paddings, dilations, groups parameters. Input(Input) and Output(Output) are in NCDHW or NDHWC format. Where N is batch size C is the number of channels, D is the depth of the feature, H is the height of the featu...
r"""
[ "r" ]
def conv3d(x, weight, bias=None, stride=1, padding=0, dilation=1, groups=1, data_format="NCDHW", name=None): r""" The convolution3D layer calculates the output based on the input, filter and strides, paddings, dilations...
[ "def", "conv3d", "(", "x", ",", "weight", ",", "bias", "=", "None", ",", "stride", "=", "1", ",", "padding", "=", "0", ",", "dilation", "=", "1", ",", "groups", "=", "1", ",", "data_format", "=", "\"NCDHW\"", ",", "name", "=", "None", ")", ":", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/nn/functional/conv.py#L1099-L1255
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/inspector_protocol/jinja2/environment.py
python
Template.render_async
(self, *args, **kwargs)
This works similar to :meth:`render` but returns a coroutine that when awaited returns the entire rendered template string. This requires the async feature to be enabled. Example usage:: await template.render_async(knights='that say nih; asynchronously')
This works similar to :meth:`render` but returns a coroutine that when awaited returns the entire rendered template string. This requires the async feature to be enabled.
[ "This", "works", "similar", "to", ":", "meth", ":", "render", "but", "returns", "a", "coroutine", "that", "when", "awaited", "returns", "the", "entire", "rendered", "template", "string", ".", "This", "requires", "the", "async", "feature", "to", "be", "enable...
def render_async(self, *args, **kwargs): """This works similar to :meth:`render` but returns a coroutine that when awaited returns the entire rendered template string. This requires the async feature to be enabled. Example usage:: await template.render_async(knights='that ...
[ "def", "render_async", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# see asyncsupport for the actual implementation", "raise", "NotImplementedError", "(", "'This feature is not available for this '", "'version of Python'", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/environment.py#L1010-L1021
raymondlu/super-animation-samples
04234269112ff0dc32447f27a761dbbb00b8ba17
samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py
python
Cursor.get_bitfield_width
(self)
return conf.lib.clang_getFieldDeclBitWidth(self)
Retrieve the width of a bitfield.
Retrieve the width of a bitfield.
[ "Retrieve", "the", "width", "of", "a", "bitfield", "." ]
def get_bitfield_width(self): """ Retrieve the width of a bitfield. """ return conf.lib.clang_getFieldDeclBitWidth(self)
[ "def", "get_bitfield_width", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getFieldDeclBitWidth", "(", "self", ")" ]
https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L1489-L1493
facebook/fbthrift
fb9c8562aba04c4fd9b17716eb5d970cc88a75bb
thrift/lib/py/util/remote.py
python
RemoteClient._get_client
(self, options)
Get the thrift client that will be used to make method calls
Get the thrift client that will be used to make method calls
[ "Get", "the", "thrift", "client", "that", "will", "be", "used", "to", "make", "method", "calls" ]
def _get_client(self, options): """Get the thrift client that will be used to make method calls""" raise TypeError("_get_client should be called on " "a subclass of RemoteClient")
[ "def", "_get_client", "(", "self", ",", "options", ")", ":", "raise", "TypeError", "(", "\"_get_client should be called on \"", "\"a subclass of RemoteClient\"", ")" ]
https://github.com/facebook/fbthrift/blob/fb9c8562aba04c4fd9b17716eb5d970cc88a75bb/thrift/lib/py/util/remote.py#L393-L396
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/ffi.py
python
_lib_wrapper._name
(self)
return self._lib._name
The name of the library passed in the CDLL constructor. For duck-typing a ctypes.CDLL
The name of the library passed in the CDLL constructor.
[ "The", "name", "of", "the", "library", "passed", "in", "the", "CDLL", "constructor", "." ]
def _name(self): """The name of the library passed in the CDLL constructor. For duck-typing a ctypes.CDLL """ return self._lib._name
[ "def", "_name", "(", "self", ")", ":", "return", "self", ".", "_lib", ".", "_name" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/ffi.py#L67-L72
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/formats/style.py
python
_is_visible
(idx_row, idx_col, lengths)
return (idx_col, idx_row) in lengths
Index -> {(idx_row, idx_col): bool}).
Index -> {(idx_row, idx_col): bool}).
[ "Index", "-", ">", "{", "(", "idx_row", "idx_col", ")", ":", "bool", "}", ")", "." ]
def _is_visible(idx_row, idx_col, lengths): """ Index -> {(idx_row, idx_col): bool}). """ return (idx_col, idx_row) in lengths
[ "def", "_is_visible", "(", "idx_row", ",", "idx_col", ",", "lengths", ")", ":", "return", "(", "idx_col", ",", "idx_row", ")", "in", "lengths" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/formats/style.py#L1463-L1467
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/elastic/timer/api.py
python
TimerServer.register_timers
(self, timer_requests: List[TimerRequest])
Processes the incoming timer requests and registers them with the server. The timer request can either be a acquire-timer or release-timer request. Timer requests with a negative expiration_time should be interpreted as a release-timer request.
Processes the incoming timer requests and registers them with the server. The timer request can either be a acquire-timer or release-timer request. Timer requests with a negative expiration_time should be interpreted as a release-timer request.
[ "Processes", "the", "incoming", "timer", "requests", "and", "registers", "them", "with", "the", "server", ".", "The", "timer", "request", "can", "either", "be", "a", "acquire", "-", "timer", "or", "release", "-", "timer", "request", ".", "Timer", "requests",...
def register_timers(self, timer_requests: List[TimerRequest]) -> None: """ Processes the incoming timer requests and registers them with the server. The timer request can either be a acquire-timer or release-timer request. Timer requests with a negative expiration_time should be interpre...
[ "def", "register_timers", "(", "self", ",", "timer_requests", ":", "List", "[", "TimerRequest", "]", ")", "->", "None", ":", "pass" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/elastic/timer/api.py#L128-L135
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/smtplib.py
python
quoteaddr
(addr)
Quote a subset of the email addresses defined by RFC 821. Should be able to handle anything rfc822.parseaddr can handle.
Quote a subset of the email addresses defined by RFC 821.
[ "Quote", "a", "subset", "of", "the", "email", "addresses", "defined", "by", "RFC", "821", "." ]
def quoteaddr(addr): """Quote a subset of the email addresses defined by RFC 821. Should be able to handle anything rfc822.parseaddr can handle. """ m = (None, None) try: m = email.utils.parseaddr(addr)[1] except AttributeError: pass if m == (None, None): # Indicates parse ...
[ "def", "quoteaddr", "(", "addr", ")", ":", "m", "=", "(", "None", ",", "None", ")", "try", ":", "m", "=", "email", ".", "utils", ".", "parseaddr", "(", "addr", ")", "[", "1", "]", "except", "AttributeError", ":", "pass", "if", "m", "==", "(", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/smtplib.py#L133-L150
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
PickerBase.GetTextCtrlProportion
(*args, **kwargs)
return _controls_.PickerBase_GetTextCtrlProportion(*args, **kwargs)
GetTextCtrlProportion(self) -> int Returns the proportion between the text control and the picker.
GetTextCtrlProportion(self) -> int
[ "GetTextCtrlProportion", "(", "self", ")", "-", ">", "int" ]
def GetTextCtrlProportion(*args, **kwargs): """ GetTextCtrlProportion(self) -> int Returns the proportion between the text control and the picker. """ return _controls_.PickerBase_GetTextCtrlProportion(*args, **kwargs)
[ "def", "GetTextCtrlProportion", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "PickerBase_GetTextCtrlProportion", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L6766-L6772
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/data/experimental/ops/prefetching_ops.py
python
map_on_gpu
(map_func)
return _apply_fn
Maps `map_func` across the elements of this dataset. NOTE: This is a highly experimental version of `tf.data.Dataset.map` that runs `map_func` on GPU. It must be used after applying the `tf.data.experimental.copy_to_device` transformation with a GPU device argument. Args: map_func: A function mapping a ...
Maps `map_func` across the elements of this dataset.
[ "Maps", "map_func", "across", "the", "elements", "of", "this", "dataset", "." ]
def map_on_gpu(map_func): """Maps `map_func` across the elements of this dataset. NOTE: This is a highly experimental version of `tf.data.Dataset.map` that runs `map_func` on GPU. It must be used after applying the `tf.data.experimental.copy_to_device` transformation with a GPU device argument. Args: ...
[ "def", "map_on_gpu", "(", "map_func", ")", ":", "def", "_apply_fn", "(", "dataset", ")", ":", "return", "_MapOnGpuDataset", "(", "dataset", ",", "map_func", ")", "return", "_apply_fn" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/data/experimental/ops/prefetching_ops.py#L263-L284
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/core/multiarray.py
python
dot
(a, b, out=None)
return (a, b, out)
dot(a, b, out=None) Dot product of two arrays. Specifically, - If both `a` and `b` are 1-D arrays, it is inner product of vectors (without complex conjugation). - If both `a` and `b` are 2-D arrays, it is matrix multiplication, but using :func:`matmul` or ``a @ b`` is preferred. - If eit...
dot(a, b, out=None)
[ "dot", "(", "a", "b", "out", "=", "None", ")" ]
def dot(a, b, out=None): """ dot(a, b, out=None) Dot product of two arrays. Specifically, - If both `a` and `b` are 1-D arrays, it is inner product of vectors (without complex conjugation). - If both `a` and `b` are 2-D arrays, it is matrix multiplication, but using :func:`matmul` or ...
[ "def", "dot", "(", "a", ",", "b", ",", "out", "=", "None", ")", ":", "return", "(", "a", ",", "b", ",", "out", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/multiarray.py#L701-L785
CNevd/Difacto_DMLC
f16862e35062707b1cf7e37d04d9b6ae34bbfd28
dmlc-core/scripts/lint3.py
python
get_header_guard_dmlc
(filename)
return re.sub(r'[-./\s]', '_', file_path_from_root).upper() + '_'
Get Header Guard Convention for DMLC Projects. For headers in include, directly use the path For headers in src, use project name plus path Examples: with project-name = dmlc include/dmlc/timer.h -> DMLC_TIMTER_H_ src/io/libsvm_parser.h -> DMLC_IO_LIBSVM_PARSER_H_
Get Header Guard Convention for DMLC Projects.
[ "Get", "Header", "Guard", "Convention", "for", "DMLC", "Projects", "." ]
def get_header_guard_dmlc(filename): """Get Header Guard Convention for DMLC Projects. For headers in include, directly use the path For headers in src, use project name plus path Examples: with project-name = dmlc include/dmlc/timer.h -> DMLC_TIMTER_H_ src/io/libsvm_parser.h -> DMLC_I...
[ "def", "get_header_guard_dmlc", "(", "filename", ")", ":", "fileinfo", "=", "cpplint", ".", "FileInfo", "(", "filename", ")", "file_path_from_root", "=", "fileinfo", ".", "RepositoryName", "(", ")", "inc_list", "=", "[", "'include'", ",", "'api'", ",", "'wrapp...
https://github.com/CNevd/Difacto_DMLC/blob/f16862e35062707b1cf7e37d04d9b6ae34bbfd28/dmlc-core/scripts/lint3.py#L103-L125
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/_string_helpers.py
python
english_capitalize
(s)
Apply English case rules to convert the first character of an ASCII string to upper case. This is an internal utility function to replace calls to str.capitalize() such that we can avoid changing behavior with changing locales. Parameters ---------- s : str Returns ------- capital...
Apply English case rules to convert the first character of an ASCII string to upper case.
[ "Apply", "English", "case", "rules", "to", "convert", "the", "first", "character", "of", "an", "ASCII", "string", "to", "upper", "case", "." ]
def english_capitalize(s): """ Apply English case rules to convert the first character of an ASCII string to upper case. This is an internal utility function to replace calls to str.capitalize() such that we can avoid changing behavior with changing locales. Parameters ---------- s : str ...
[ "def", "english_capitalize", "(", "s", ")", ":", "if", "s", ":", "return", "english_upper", "(", "s", "[", "0", "]", ")", "+", "s", "[", "1", ":", "]", "else", ":", "return", "s" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/_string_helpers.py#L72-L100
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/stc.py
python
StyledTextCtrl.CmdKeyAssign
(*args, **kwargs)
return _stc.StyledTextCtrl_CmdKeyAssign(*args, **kwargs)
CmdKeyAssign(self, int key, int modifiers, int cmd) When key+modifier combination km is pressed perform msg.
CmdKeyAssign(self, int key, int modifiers, int cmd)
[ "CmdKeyAssign", "(", "self", "int", "key", "int", "modifiers", "int", "cmd", ")" ]
def CmdKeyAssign(*args, **kwargs): """ CmdKeyAssign(self, int key, int modifiers, int cmd) When key+modifier combination km is pressed perform msg. """ return _stc.StyledTextCtrl_CmdKeyAssign(*args, **kwargs)
[ "def", "CmdKeyAssign", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_CmdKeyAssign", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L2779-L2785
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/eager/context.py
python
Context.device_spec
(self)
return self._eager_context.device_spec
Returns the device spec for the current thread.
Returns the device spec for the current thread.
[ "Returns", "the", "device", "spec", "for", "the", "current", "thread", "." ]
def device_spec(self): """Returns the device spec for the current thread.""" return self._eager_context.device_spec
[ "def", "device_spec", "(", "self", ")", ":", "return", "self", ".", "_eager_context", ".", "device_spec" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/context.py#L229-L231
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/enum34/enum/__init__.py
python
EnumMeta._get_mixins_
(bases)
return member_type, first_enum
Returns the type for creating enum members, and the first inherited enum class. bases: the tuple of bases that was given to __new__
Returns the type for creating enum members, and the first inherited enum class.
[ "Returns", "the", "type", "for", "creating", "enum", "members", "and", "the", "first", "inherited", "enum", "class", "." ]
def _get_mixins_(bases): """Returns the type for creating enum members, and the first inherited enum class. bases: the tuple of bases that was given to __new__ """ if not bases or Enum is None: return object, Enum # double check that we are not subclassing...
[ "def", "_get_mixins_", "(", "bases", ")", ":", "if", "not", "bases", "or", "Enum", "is", "None", ":", "return", "object", ",", "Enum", "# double check that we are not subclassing a class with existing", "# enumeration members; while we're at it, see if any other data", "# typ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/enum34/enum/__init__.py#L499-L542
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/project_settings.py
python
get_bootstrap_assets
(self, platform=None)
return assets
:param self: :param platform: optional, defaults to current build's platform :return: Asset type requested for the supplied platform in bootstrap.cfg
:param self: :param platform: optional, defaults to current build's platform :return: Asset type requested for the supplied platform in bootstrap.cfg
[ ":", "param", "self", ":", ":", "param", "platform", ":", "optional", "defaults", "to", "current", "build", "s", "platform", ":", "return", ":", "Asset", "type", "requested", "for", "the", "supplied", "platform", "in", "bootstrap", ".", "cfg" ]
def get_bootstrap_assets(self, platform=None): """ :param self: :param platform: optional, defaults to current build's platform :return: Asset type requested for the supplied platform in bootstrap.cfg """ project_folder_node = getattr(self, 'srcnode', self.path) bootstrap_cfg = project_folde...
[ "def", "get_bootstrap_assets", "(", "self", ",", "platform", "=", "None", ")", ":", "project_folder_node", "=", "getattr", "(", "self", ",", "'srcnode'", ",", "self", ".", "path", ")", "bootstrap_cfg", "=", "project_folder_node", ".", "make_node", "(", "'boots...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/project_settings.py#L688-L707
bairdzhang/smallhardface
76fa1d87a9602d9b13d7a7fe693fc7aec91cab80
caffe/scripts/cpp_lint.py
python
CleanseRawStrings
(raw_lines)
return lines_without_raw_strings
Removes C++11 raw strings from lines. Before: static const char kData[] = R"( multi-line string )"; After: static const char kData[] = "" (replaced by blank line) ""; Args: raw_lines: list of raw lines. Returns: list of lines with C++11 raw str...
Removes C++11 raw strings from lines.
[ "Removes", "C", "++", "11", "raw", "strings", "from", "lines", "." ]
def CleanseRawStrings(raw_lines): """Removes C++11 raw strings from lines. Before: static const char kData[] = R"( multi-line string )"; After: static const char kData[] = "" (replaced by blank line) ""; Args: raw_lines: list of raw lines. Return...
[ "def", "CleanseRawStrings", "(", "raw_lines", ")", ":", "delimiter", "=", "None", "lines_without_raw_strings", "=", "[", "]", "for", "line", "in", "raw_lines", ":", "if", "delimiter", ":", "# Inside a raw string, look for the end", "end", "=", "line", ".", "find",...
https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/caffe/scripts/cpp_lint.py#L1066-L1124
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/contrib/autograd.py
python
train_section
()
return TrainingStateScope(True)
Returns a training scope context to be used in 'with' statement and captures training code. Example:: with autograd.train_section(): y = model(x) compute_gradient([y]) metric.update(...) optim.step(...)
Returns a training scope context to be used in 'with' statement and captures training code.
[ "Returns", "a", "training", "scope", "context", "to", "be", "used", "in", "with", "statement", "and", "captures", "training", "code", "." ]
def train_section(): """Returns a training scope context to be used in 'with' statement and captures training code. Example:: with autograd.train_section(): y = model(x) compute_gradient([y]) metric.update(...) optim.step(...) """ return TrainingState...
[ "def", "train_section", "(", ")", ":", "return", "TrainingStateScope", "(", "True", ")" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/autograd.py#L74-L85
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
build/android/android_commands.py
python
AndroidCommands.StartActivity
(self, package, activity, action='android.intent.action.VIEW', data=None, extras=None, trace_file_name=None)
Starts |package|'s activity on the device. Args: package: Name of package to start (e.g. 'com.android.chrome'). activity: Name of activity (e.g. '.Main' or 'com.android.chrome.Main'). data: Data string to pass to activity (e.g. 'http://www.example.com/'). extras: Dict of extras to pass to a...
Starts |package|'s activity on the device.
[ "Starts", "|package|", "s", "activity", "on", "the", "device", "." ]
def StartActivity(self, package, activity, action='android.intent.action.VIEW', data=None, extras=None, trace_file_name=None): """Starts |package|'s activity on the device. Args: package: Name of package to start (e.g. 'com.android.chrome'). activity: Name of...
[ "def", "StartActivity", "(", "self", ",", "package", ",", "activity", ",", "action", "=", "'android.intent.action.VIEW'", ",", "data", "=", "None", ",", "extras", "=", "None", ",", "trace_file_name", "=", "None", ")", ":", "cmd", "=", "'am start -a %s -n %s/%s...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/build/android/android_commands.py#L341-L362
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/_pssunos.py
python
users
()
return retlist
Return currently connected users as a list of namedtuples.
Return currently connected users as a list of namedtuples.
[ "Return", "currently", "connected", "users", "as", "a", "list", "of", "namedtuples", "." ]
def users(): """Return currently connected users as a list of namedtuples.""" retlist = [] rawlist = cext.users() localhost = (':0.0', ':0') for item in rawlist: user, tty, hostname, tstamp, user_process, pid = item # note: the underlying C function includes entries about # s...
[ "def", "users", "(", ")", ":", "retlist", "=", "[", "]", "rawlist", "=", "cext", ".", "users", "(", ")", "localhost", "=", "(", "':0.0'", ",", "':0'", ")", "for", "item", "in", "rawlist", ":", "user", ",", "tty", ",", "hostname", ",", "tstamp", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/_pssunos.py#L308-L324
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/docs/__init__.py
python
generate_docs
(root_dir, session)
Generates the reference documentation for botocore This will go through every available AWS service and output ReSTructured text files documenting each service. :param root_dir: The directory to write the reference files to. Each service's reference documentation is loacated at root_dir/re...
Generates the reference documentation for botocore
[ "Generates", "the", "reference", "documentation", "for", "botocore" ]
def generate_docs(root_dir, session): """Generates the reference documentation for botocore This will go through every available AWS service and output ReSTructured text files documenting each service. :param root_dir: The directory to write the reference files to. Each service's reference doc...
[ "def", "generate_docs", "(", "root_dir", ",", "session", ")", ":", "services_doc_path", "=", "os", ".", "path", ".", "join", "(", "root_dir", ",", "'reference'", ",", "'services'", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "services_doc_path...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/docs/__init__.py#L18-L38
jubatus/jubatus
1251ce551bac980488a6313728e72b3fe0b79a9f
tools/codestyle/cpplint/cpplint.py
python
PrintCategories
()
Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter.
Prints a list of all the error-categories used by error messages.
[ "Prints", "a", "list", "of", "all", "the", "error", "-", "categories", "used", "by", "error", "messages", "." ]
def PrintCategories(): """Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter. """ sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) sys.exit(0)
[ "def", "PrintCategories", "(", ")", ":", "sys", ".", "stderr", ".", "write", "(", "''", ".", "join", "(", "' %s\\n'", "%", "cat", "for", "cat", "in", "_ERROR_CATEGORIES", ")", ")", "sys", ".", "exit", "(", "0", ")" ]
https://github.com/jubatus/jubatus/blob/1251ce551bac980488a6313728e72b3fe0b79a9f/tools/codestyle/cpplint/cpplint.py#L3313-L3319
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/AccumulativeLookup.py
python
AccumulativeLookup.size
(self)
return self._internal.get_size()
Gets the vector length.
Gets the vector length.
[ "Gets", "the", "vector", "length", "." ]
def size(self): """Gets the vector length. """ return self._internal.get_size()
[ "def", "size", "(", "self", ")", ":", "return", "self", ".", "_internal", ".", "get_size", "(", ")" ]
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/AccumulativeLookup.py#L68-L71
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/docs.py
python
Library._remove_docstring_indent
(self, docstring)
return lines
Remove indenting. We follow Python's convention and remove the minimum indent of the lines after the first, see: https://www.python.org/dev/peps/pep-0257/#handling-docstring-indentation preserving relative indentation. Args: docstring: A docstring. Returns: A list of strings, one ...
Remove indenting.
[ "Remove", "indenting", "." ]
def _remove_docstring_indent(self, docstring): """Remove indenting. We follow Python's convention and remove the minimum indent of the lines after the first, see: https://www.python.org/dev/peps/pep-0257/#handling-docstring-indentation preserving relative indentation. Args: docstring: A ...
[ "def", "_remove_docstring_indent", "(", "self", ",", "docstring", ")", ":", "docstring", "=", "docstring", "or", "\"\"", "lines", "=", "docstring", ".", "strip", "(", ")", ".", "split", "(", "\"\\n\"", ")", "min_indent", "=", "len", "(", "docstring", ")", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/docs.py#L329-L359
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/gan/mnist.py
python
Discriminator.call
(self, inputs)
return x
Return two logits per image estimating input authenticity. Users should invoke __call__ to run the network, which delegates to this method (and not call this method directly). Args: inputs: A batch of images as a Tensor with shape [batch_size, 28, 28, 1] or [batch_size, 1, 28, 28] Retur...
Return two logits per image estimating input authenticity.
[ "Return", "two", "logits", "per", "image", "estimating", "input", "authenticity", "." ]
def call(self, inputs): """Return two logits per image estimating input authenticity. Users should invoke __call__ to run the network, which delegates to this method (and not call this method directly). Args: inputs: A batch of images as a Tensor with shape [batch_size, 28, 28, 1] or [ba...
[ "def", "call", "(", "self", ",", "inputs", ")", ":", "x", "=", "tf", ".", "reshape", "(", "inputs", ",", "self", ".", "_input_shape", ")", "x", "=", "self", ".", "conv1", "(", "x", ")", "x", "=", "self", ".", "pool1", "(", "x", ")", "x", "=",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/gan/mnist.py#L69-L91
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ebmlib/searcheng.py
python
SearchEngine.SearchInBuffer
(self, sbuffer)
Search in the buffer @param sbuffer: buffer like object @todo: implement
Search in the buffer @param sbuffer: buffer like object @todo: implement
[ "Search", "in", "the", "buffer", "@param", "sbuffer", ":", "buffer", "like", "object", "@todo", ":", "implement" ]
def SearchInBuffer(self, sbuffer): """Search in the buffer @param sbuffer: buffer like object @todo: implement """ raise NotImplementedError
[ "def", "SearchInBuffer", "(", "self", ",", "sbuffer", ")", ":", "raise", "NotImplementedError" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/searcheng.py#L263-L269
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/threading.py
python
Thread._set_tstate_lock
(self)
Set a lock object which will be released by the interpreter when the underlying thread state (see pystate.h) gets deleted.
Set a lock object which will be released by the interpreter when the underlying thread state (see pystate.h) gets deleted.
[ "Set", "a", "lock", "object", "which", "will", "be", "released", "by", "the", "interpreter", "when", "the", "underlying", "thread", "state", "(", "see", "pystate", ".", "h", ")", "gets", "deleted", "." ]
def _set_tstate_lock(self): """ Set a lock object which will be released by the interpreter when the underlying thread state (see pystate.h) gets deleted. """ self._tstate_lock = _set_sentinel() self._tstate_lock.acquire() if not self.daemon: with _sh...
[ "def", "_set_tstate_lock", "(", "self", ")", ":", "self", ".", "_tstate_lock", "=", "_set_sentinel", "(", ")", "self", ".", "_tstate_lock", ".", "acquire", "(", ")", "if", "not", "self", ".", "daemon", ":", "with", "_shutdown_locks_lock", ":", "_shutdown_loc...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/threading.py#L899-L909
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Code/Tools/AzCodeGenerator/Scripts/az_code_gen/clang_cpp.py
python
expand_annotations
(source_dictionary)
Takes a partially extracted JSON tree generated by C++ and parses the annotations fields, expanding them into python dictionary trees. @param source_dictionary - The dictionary containing the annotation fields to expand.
Takes a partially extracted JSON tree generated by C++ and parses the annotations fields, expanding them into python dictionary trees.
[ "Takes", "a", "partially", "extracted", "JSON", "tree", "generated", "by", "C", "++", "and", "parses", "the", "annotations", "fields", "expanding", "them", "into", "python", "dictionary", "trees", "." ]
def expand_annotations(source_dictionary): """Takes a partially extracted JSON tree generated by C++ and parses the annotations fields, expanding them into python dictionary trees. @param source_dictionary - The dictionary containing the annotation fields to expand. ""...
[ "def", "expand_annotations", "(", "source_dictionary", ")", ":", "def", "expand_and_store_annotation", "(", "dest", ",", "key", ",", "tag", ",", "value", ")", ":", "# extract any template params if they exist", "match", "=", "TEMPLATE_TAG_PATTERN", ".", "match", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Code/Tools/AzCodeGenerator/Scripts/az_code_gen/clang_cpp.py#L200-L233
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py
python
obj_class.get_analysis
(self, value, named = True)
return obj_analysis([self, self.parent], value, named)
Return an analysis of the value based on the class definition context.
Return an analysis of the value based on the class definition context.
[ "Return", "an", "analysis", "of", "the", "value", "based", "on", "the", "class", "definition", "context", "." ]
def get_analysis(self, value, named = True): """ Return an analysis of the value based on the class definition context. """ return obj_analysis([self, self.parent], value, named)
[ "def", "get_analysis", "(", "self", ",", "value", ",", "named", "=", "True", ")", ":", "return", "obj_analysis", "(", "[", "self", ",", "self", ".", "parent", "]", ",", "value", ",", "named", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py#L977-L981
luliyucoordinate/Leetcode
96afcdc54807d1d184e881a075d1dbf3371e31fb
src/0071-Simplify-Path/0071.py
python
Solution.simplifyPath
(self, path)
return '/'+'/'.join(stack)
:type path: str :rtype: str
:type path: str :rtype: str
[ ":", "type", "path", ":", "str", ":", "rtype", ":", "str" ]
def simplifyPath(self, path): """ :type path: str :rtype: str """ stack = list() path = [p for p in path.split('/') if p] for f in path: if f == '.': continue elif f == '..': if stack: ...
[ "def", "simplifyPath", "(", "self", ",", "path", ")", ":", "stack", "=", "list", "(", ")", "path", "=", "[", "p", "for", "p", "in", "path", ".", "split", "(", "'/'", ")", "if", "p", "]", "for", "f", "in", "path", ":", "if", "f", "==", "'.'", ...
https://github.com/luliyucoordinate/Leetcode/blob/96afcdc54807d1d184e881a075d1dbf3371e31fb/src/0071-Simplify-Path/0071.py#L2-L18
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/yaml/scanner.py
python
Scanner.__init__
(self)
Initialize the scanner.
Initialize the scanner.
[ "Initialize", "the", "scanner", "." ]
def __init__(self): """Initialize the scanner.""" # It is assumed that Scanner and Reader will have a common descendant. # Reader do the dirty work of checking for BOM and converting the # input data to Unicode. It also adds NUL to the end. # # Reader supports the followi...
[ "def", "__init__", "(", "self", ")", ":", "# It is assumed that Scanner and Reader will have a common descendant.", "# Reader do the dirty work of checking for BOM and converting the", "# input data to Unicode. It also adds NUL to the end.", "#", "# Reader supports the following methods", "# ...
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/yaml/scanner.py#L48-L109
raymondlu/super-animation-samples
04234269112ff0dc32447f27a761dbbb00b8ba17
samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py
python
Diagnostic.option
(self)
return conf.lib.clang_getDiagnosticOption(self, None)
The command-line option that enables this diagnostic.
The command-line option that enables this diagnostic.
[ "The", "command", "-", "line", "option", "that", "enables", "this", "diagnostic", "." ]
def option(self): """The command-line option that enables this diagnostic.""" return conf.lib.clang_getDiagnosticOption(self, None)
[ "def", "option", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getDiagnosticOption", "(", "self", ",", "None", ")" ]
https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L350-L352
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/LocalizationAndMapping/icp_lidar_localization/fast_gicp/thirdparty/Sophus/py/sophus/so2.py
python
So2.matrix
(self)
return sympy.Matrix([ [self.z.real, -self.z.imag], [self.z.imag, self.z.real]])
returns matrix representation
returns matrix representation
[ "returns", "matrix", "representation" ]
def matrix(self): """ returns matrix representation """ return sympy.Matrix([ [self.z.real, -self.z.imag], [self.z.imag, self.z.real]])
[ "def", "matrix", "(", "self", ")", ":", "return", "sympy", ".", "Matrix", "(", "[", "[", "self", ".", "z", ".", "real", ",", "-", "self", ".", "z", ".", "imag", "]", ",", "[", "self", ".", "z", ".", "imag", ",", "self", ".", "z", ".", "real...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/icp_lidar_localization/fast_gicp/thirdparty/Sophus/py/sophus/so2.py#L35-L39
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
samples/python/speech_sample/utils.py
python
set_scale_factors
(plugin_config: dict, scale_factors: list)
Set a scale factor provided for each input
Set a scale factor provided for each input
[ "Set", "a", "scale", "factor", "provided", "for", "each", "input" ]
def set_scale_factors(plugin_config: dict, scale_factors: list): """Set a scale factor provided for each input""" for i, scale_factor in enumerate(scale_factors): log.info(f'For input {i} using scale factor of {scale_factor:.7f}') plugin_config[f'GNA_SCALE_FACTOR_{i}'] = str(scale_factor)
[ "def", "set_scale_factors", "(", "plugin_config", ":", "dict", ",", "scale_factors", ":", "list", ")", ":", "for", "i", ",", "scale_factor", "in", "enumerate", "(", "scale_factors", ")", ":", "log", ".", "info", "(", "f'For input {i} using scale factor of {scale_f...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/samples/python/speech_sample/utils.py#L47-L51
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Tool/mslink.py
python
_dllEmitter
(target, source, env, paramtp)
return (target+extratargets, source+extrasources)
Common implementation of dll emitter.
Common implementation of dll emitter.
[ "Common", "implementation", "of", "dll", "emitter", "." ]
def _dllEmitter(target, source, env, paramtp): """Common implementation of dll emitter.""" SCons.Tool.msvc.validate_vars(env) extratargets = [] extrasources = [] dll = env.FindIxes(target, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp) no_import_lib = env.get('no_import_lib', 0) if not dll: ...
[ "def", "_dllEmitter", "(", "target", ",", "source", ",", "env", ",", "paramtp", ")", ":", "SCons", ".", "Tool", ".", "msvc", ".", "validate_vars", "(", "env", ")", "extratargets", "=", "[", "]", "extrasources", "=", "[", "]", "dll", "=", "env", ".", ...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Tool/mslink.py#L92-L150
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/util/_cloudpickle/_cloudpickle.py
python
cell_set
(cell, value)
Set the value of a closure cell. The point of this function is to set the cell_contents attribute of a cell after its creation. This operation is necessary in case the cell contains a reference to the function the cell belongs to, as when calling the function's constructor ``f = types.FunctionType(...
Set the value of a closure cell.
[ "Set", "the", "value", "of", "a", "closure", "cell", "." ]
def cell_set(cell, value): """Set the value of a closure cell. The point of this function is to set the cell_contents attribute of a cell after its creation. This operation is necessary in case the cell contains a reference to the function the cell belongs to, as when calling the function's constru...
[ "def", "cell_set", "(", "cell", ",", "value", ")", ":", "if", "sys", ".", "version_info", "[", ":", "2", "]", ">=", "(", "3", ",", "7", ")", ":", "# pragma: no branch", "cell", ".", "cell_contents", "=", "value", "else", ":", "_cell_set", "=", "types...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/util/_cloudpickle/_cloudpickle.py#L308-L370
xiaolonw/caffe-video_triplet
c39ea1ad6e937ccf7deba4510b7e555165abf05f
scripts/cpp_lint.py
python
ProcessLine
(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions=[])
Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. clean_lines: An array of strings, each representing a line of the file, with comments stripped. line: Number of line being ...
Processes a single line in the file.
[ "Processes", "a", "single", "line", "in", "the", "file", "." ]
def ProcessLine(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions=[]): """Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension (d...
[ "def", "ProcessLine", "(", "filename", ",", "file_extension", ",", "clean_lines", ",", "line", ",", "include_state", ",", "function_state", ",", "nesting_state", ",", "error", ",", "extra_check_functions", "=", "[", "]", ")", ":", "raw_lines", "=", "clean_lines"...
https://github.com/xiaolonw/caffe-video_triplet/blob/c39ea1ad6e937ccf7deba4510b7e555165abf05f/scripts/cpp_lint.py#L4600-L4642
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/eventloop/posix.py
python
PosixEventLoop.add_reader
(self, fd, callback)
Add read file descriptor to the event loop.
Add read file descriptor to the event loop.
[ "Add", "read", "file", "descriptor", "to", "the", "event", "loop", "." ]
def add_reader(self, fd, callback): " Add read file descriptor to the event loop. " fd = fd_to_int(fd) self._read_fds[fd] = callback self.selector.register(fd)
[ "def", "add_reader", "(", "self", ",", "fd", ",", "callback", ")", ":", "fd", "=", "fd_to_int", "(", "fd", ")", "self", ".", "_read_fds", "[", "fd", "]", "=", "callback", "self", ".", "selector", ".", "register", "(", "fd", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/eventloop/posix.py#L271-L275
llvm-mirror/lldb
d01083a850f577b85501a0902b52fd0930de72c7
utils/vim-lldb/python-vim-lldb/vim_ui.py
python
UI.__init__
(self)
Declare UI state variables
Declare UI state variables
[ "Declare", "UI", "state", "variables" ]
def __init__(self): """ Declare UI state variables """ # Default panes to display self.defaultPanes = [ 'breakpoints', 'backtrace', 'locals', 'threads', 'registers', 'disassembly'] # map of tuples (filename, line) ...
[ "def", "__init__", "(", "self", ")", ":", "# Default panes to display", "self", ".", "defaultPanes", "=", "[", "'breakpoints'", ",", "'backtrace'", ",", "'locals'", ",", "'threads'", ",", "'registers'", ",", "'disassembly'", "]", "# map of tuples (filename, line) --> ...
https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/utils/vim-lldb/python-vim-lldb/vim_ui.py#L24-L52
google/or-tools
2cb85b4eead4c38e1c54b48044f92087cf165bce
ortools/constraint_solver/doc/routing_svg.py
python
SVGPrinter.draw_routes
(self)
Draws the routes.
Draws the routes.
[ "Draws", "the", "routes", "." ]
def draw_routes(self): """Draws the routes.""" print(r'<!-- Print routes -->') for route_idx, route in enumerate(self.routes()): print(r'<!-- Print route {idx} -->'.format(idx=route_idx)) color = self._color_palette.value(route_idx) colorname = self._color_pal...
[ "def", "draw_routes", "(", "self", ")", ":", "print", "(", "r'<!-- Print routes -->'", ")", "for", "route_idx", ",", "route", "in", "enumerate", "(", "self", ".", "routes", "(", ")", ")", ":", "print", "(", "r'<!-- Print route {idx} -->'", ".", "format", "("...
https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/constraint_solver/doc/routing_svg.py#L586-L593
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py
python
DECLARE_key_flag
(flag_name, flag_values=FLAGS)
Declares one flag as key to the current module. Key flags are flags that are deemed really important for a module. They are important when listing help messages; e.g., if the --helpshort command-line flag is used, then only the key flags of the main module are listed (instead of all flags, as in the case of ...
Declares one flag as key to the current module.
[ "Declares", "one", "flag", "as", "key", "to", "the", "current", "module", "." ]
def DECLARE_key_flag(flag_name, flag_values=FLAGS): """Declares one flag as key to the current module. Key flags are flags that are deemed really important for a module. They are important when listing help messages; e.g., if the --helpshort command-line flag is used, then only the key flags of the main modu...
[ "def", "DECLARE_key_flag", "(", "flag_name", ",", "flag_values", "=", "FLAGS", ")", ":", "if", "flag_name", "in", "_SPECIAL_FLAGS", ":", "# Take care of the special flags, e.g., --flagfile, --undefok.", "# These flags are defined in _SPECIAL_FLAGS, and are treated", "# specially du...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L2238-L2267
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/distutils/command/register.py
python
register.check_metadata
(self)
Deprecated API.
Deprecated API.
[ "Deprecated", "API", "." ]
def check_metadata(self): """Deprecated API.""" warn("distutils.command.register.check_metadata is deprecated, \ use the check command instead", PendingDeprecationWarning) check = self.distribution.get_command_obj('check') check.ensure_finalized() check.strict = sel...
[ "def", "check_metadata", "(", "self", ")", ":", "warn", "(", "\"distutils.command.register.check_metadata is deprecated, \\\n use the check command instead\"", ",", "PendingDeprecationWarning", ")", "check", "=", "self", ".", "distribution", ".", "get_command_obj", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/command/register.py#L58-L66
hakuna-m/wubiuefi
caec1af0a09c78fd5a345180ada1fe45e0c63493
src/openpgp/sap/util/strnum.py
python
int2str
(n)
return binascii.unhexlify(h)
Convert an integer to a string. :Parameters: - `n`: integer to convert to string :Returns: string This is a simple transformation using the builtin hex() function to return the number. **Note:** I'm not sure what the relationship between hex() representations and endian issues...
Convert an integer to a string.
[ "Convert", "an", "integer", "to", "a", "string", "." ]
def int2str(n): """Convert an integer to a string. :Parameters: - `n`: integer to convert to string :Returns: string This is a simple transformation using the builtin hex() function to return the number. **Note:** I'm not sure what the relationship between hex() representa...
[ "def", "int2str", "(", "n", ")", ":", "h", "=", "hex", "(", "n", ")", "[", "2", ":", "]", "# chop off the '0x' ", "if", "h", "[", "-", "1", "]", "in", "[", "'l'", ",", "'L'", "]", ":", "h", "=", "h", "[", ":", "-", "1", "]", "if", "1", ...
https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/openpgp/sap/util/strnum.py#L79-L103
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
DateTime_GetEnglishWeekDayName
(*args, **kwargs)
return _misc_.DateTime_GetEnglishWeekDayName(*args, **kwargs)
DateTime_GetEnglishWeekDayName(int weekday, int flags=Name_Full) -> String
DateTime_GetEnglishWeekDayName(int weekday, int flags=Name_Full) -> String
[ "DateTime_GetEnglishWeekDayName", "(", "int", "weekday", "int", "flags", "=", "Name_Full", ")", "-", ">", "String" ]
def DateTime_GetEnglishWeekDayName(*args, **kwargs): """DateTime_GetEnglishWeekDayName(int weekday, int flags=Name_Full) -> String""" return _misc_.DateTime_GetEnglishWeekDayName(*args, **kwargs)
[ "def", "DateTime_GetEnglishWeekDayName", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_GetEnglishWeekDayName", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4277-L4279
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/idlelib/IdleHistory.py
python
History.history_next
(self, event)
return "break"
Fetch later statement; start with ealiest if cyclic.
Fetch later statement; start with ealiest if cyclic.
[ "Fetch", "later", "statement", ";", "start", "with", "ealiest", "if", "cyclic", "." ]
def history_next(self, event): "Fetch later statement; start with ealiest if cyclic." self.fetch(reverse=False) return "break"
[ "def", "history_next", "(", "self", ",", "event", ")", ":", "self", ".", "fetch", "(", "reverse", "=", "False", ")", "return", "\"break\"" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/IdleHistory.py#L30-L33
bsdnoobz/opencv-code
d3bd05d9f29d7c602d560d59f627760f654a83c7
opencv-qt-integration-2/python/ImageApp.py
python
ImageApp.do_canny
(self)
Perform Gaussian blurring on original image and display the result.
Perform Gaussian blurring on original image and display the result.
[ "Perform", "Gaussian", "blurring", "on", "original", "image", "and", "display", "the", "result", "." ]
def do_canny(self): """Perform Gaussian blurring on original image and display the result.""" img = cv2.cvtColor(self.original_img, cv2.COLOR_RGB2GRAY) img = cv2.Canny(img, 150, 150) img = cv2.cvtColor(img, cv2.COLOR_GRAY2RGB) self.show_image(img)
[ "def", "do_canny", "(", "self", ")", ":", "img", "=", "cv2", ".", "cvtColor", "(", "self", ".", "original_img", ",", "cv2", ".", "COLOR_RGB2GRAY", ")", "img", "=", "cv2", ".", "Canny", "(", "img", ",", "150", ",", "150", ")", "img", "=", "cv2", "...
https://github.com/bsdnoobz/opencv-code/blob/d3bd05d9f29d7c602d560d59f627760f654a83c7/opencv-qt-integration-2/python/ImageApp.py#L63-L68
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/fleet/utils/internal_storage.py
python
GradStorage._array_grads
(self)
Given the parameters gradients which have been registered previously, rebuild the whole InternalStorage.
Given the parameters gradients which have been registered previously, rebuild the whole InternalStorage.
[ "Given", "the", "parameters", "gradients", "which", "have", "been", "registered", "previously", "rebuild", "the", "whole", "InternalStorage", "." ]
def _array_grads(self): """ Given the parameters gradients which have been registered previously, rebuild the whole InternalStorage. """ if len(self._params) > 0: self._fill = 0 for p in self._params: self._add_grad_as_view(p, self._parm2align[p.na...
[ "def", "_array_grads", "(", "self", ")", ":", "if", "len", "(", "self", ".", "_params", ")", ">", "0", ":", "self", ".", "_fill", "=", "0", "for", "p", "in", "self", ".", "_params", ":", "self", ".", "_add_grad_as_view", "(", "p", ",", "self", "....
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/utils/internal_storage.py#L291-L298
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py
python
CheckContext.Result
(self, res)
Inform about the result of the test. If res is not a string, displays 'yes' or 'no' depending on whether res is evaluated as true or false. The result is only displayed when self.did_show_result is not set.
Inform about the result of the test. If res is not a string, displays 'yes' or 'no' depending on whether res is evaluated as true or false. The result is only displayed when self.did_show_result is not set.
[ "Inform", "about", "the", "result", "of", "the", "test", ".", "If", "res", "is", "not", "a", "string", "displays", "yes", "or", "no", "depending", "on", "whether", "res", "is", "evaluated", "as", "true", "or", "false", ".", "The", "result", "is", "only...
def Result(self, res): """Inform about the result of the test. If res is not a string, displays 'yes' or 'no' depending on whether res is evaluated as true or false. The result is only displayed when self.did_show_result is not set. """ if isinstance(res, str): text =...
[ "def", "Result", "(", "self", ",", "res", ")", ":", "if", "isinstance", "(", "res", ",", "str", ")", ":", "text", "=", "res", "elif", "res", ":", "text", "=", "\"yes\"", "else", ":", "text", "=", "\"no\"", "if", "self", ".", "did_show_result", "=="...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py#L795-L810
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/importlib/resources.py
python
read_text
(package: Package, resource: Resource, encoding: str = 'utf-8', errors: str = 'strict')
Return the decoded string of the resource. The decoding-related arguments have the same semantics as those of bytes.decode().
Return the decoded string of the resource.
[ "Return", "the", "decoded", "string", "of", "the", "resource", "." ]
def read_text(package: Package, resource: Resource, encoding: str = 'utf-8', errors: str = 'strict') -> str: """Return the decoded string of the resource. The decoding-related arguments have the same semantics as those of bytes.decode(). """ with open_text(...
[ "def", "read_text", "(", "package", ":", "Package", ",", "resource", ":", "Resource", ",", "encoding", ":", "str", "=", "'utf-8'", ",", "errors", ":", "str", "=", "'strict'", ")", "->", "str", ":", "with", "open_text", "(", "package", ",", "resource", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/importlib/resources.py#L130-L140
GeometryCollective/boundary-first-flattening
8250e5a0e85980ec50b5e8aa8f49dd6519f915cd
deps/nanogui/ext/pybind11/tools/clang/cindex.py
python
TypeKind.spelling
(self)
return conf.lib.clang_getTypeKindSpelling(self.value)
Retrieve the spelling of this TypeKind.
Retrieve the spelling of this TypeKind.
[ "Retrieve", "the", "spelling", "of", "this", "TypeKind", "." ]
def spelling(self): """Retrieve the spelling of this TypeKind.""" return conf.lib.clang_getTypeKindSpelling(self.value)
[ "def", "spelling", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getTypeKindSpelling", "(", "self", ".", "value", ")" ]
https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/ext/pybind11/tools/clang/cindex.py#L1697-L1699
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.MarginSetStyles
(*args, **kwargs)
return _stc.StyledTextCtrl_MarginSetStyles(*args, **kwargs)
MarginSetStyles(self, int line, String styles) Set the style in the text margin for a line
MarginSetStyles(self, int line, String styles)
[ "MarginSetStyles", "(", "self", "int", "line", "String", "styles", ")" ]
def MarginSetStyles(*args, **kwargs): """ MarginSetStyles(self, int line, String styles) Set the style in the text margin for a line """ return _stc.StyledTextCtrl_MarginSetStyles(*args, **kwargs)
[ "def", "MarginSetStyles", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_MarginSetStyles", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L5871-L5877
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/stats/mstats_extras.py
python
hdquantiles
(data, prob=list([.25,.5,.75]), axis=None, var=False,)
return ma.fix_invalid(result, copy=False)
Computes quantile estimates with the Harrell-Davis method. The quantile estimates are calculated as a weighted linear combination of order statistics. Parameters ---------- data : array_like Data array. prob : sequence, optional Sequence of quantiles to compute. axis : int ...
Computes quantile estimates with the Harrell-Davis method.
[ "Computes", "quantile", "estimates", "with", "the", "Harrell", "-", "Davis", "method", "." ]
def hdquantiles(data, prob=list([.25,.5,.75]), axis=None, var=False,): """ Computes quantile estimates with the Harrell-Davis method. The quantile estimates are calculated as a weighted linear combination of order statistics. Parameters ---------- data : array_like Data array. ...
[ "def", "hdquantiles", "(", "data", ",", "prob", "=", "list", "(", "[", ".25", ",", ".5", ",", ".75", "]", ")", ",", "axis", "=", "None", ",", "var", "=", "False", ",", ")", ":", "def", "_hd_1D", "(", "data", ",", "prob", ",", "var", ")", ":",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/mstats_extras.py#L31-L103
google/tink
59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14
python/tink/jwt/_jwt_hmac_key_manager.py
python
_JwtHmac.verify_mac_and_decode_with_kid
( self, compact: str, validator: _jwt_validator.JwtValidator, kid: Optional[str])
return _verified_jwt.VerifiedJwt._create(raw_jwt)
Verifies, validates and decodes a MACed compact JWT token.
Verifies, validates and decodes a MACed compact JWT token.
[ "Verifies", "validates", "and", "decodes", "a", "MACed", "compact", "JWT", "token", "." ]
def verify_mac_and_decode_with_kid( self, compact: str, validator: _jwt_validator.JwtValidator, kid: Optional[str]) -> _verified_jwt.VerifiedJwt: """Verifies, validates and decodes a MACed compact JWT token.""" parts = _jwt_format.split_signed_compact(compact) unsigned_compact, json_header, json...
[ "def", "verify_mac_and_decode_with_kid", "(", "self", ",", "compact", ":", "str", ",", "validator", ":", "_jwt_validator", ".", "JwtValidator", ",", "kid", ":", "Optional", "[", "str", "]", ")", "->", "_verified_jwt", ".", "VerifiedJwt", ":", "parts", "=", "...
https://github.com/google/tink/blob/59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14/python/tink/jwt/_jwt_hmac_key_manager.py#L80-L96
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
clang/bindings/python/clang/cindex.py
python
Cursor.get_bitfield_width
(self)
return conf.lib.clang_getFieldDeclBitWidth(self)
Retrieve the width of a bitfield.
Retrieve the width of a bitfield.
[ "Retrieve", "the", "width", "of", "a", "bitfield", "." ]
def get_bitfield_width(self): """ Retrieve the width of a bitfield. """ return conf.lib.clang_getFieldDeclBitWidth(self)
[ "def", "get_bitfield_width", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getFieldDeclBitWidth", "(", "self", ")" ]
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/bindings/python/clang/cindex.py#L1878-L1882
NVIDIA/thrust
627dccb359a635afdd69e95a6cc59698f23f70e2
internal/benchmark/compare_benchmark_results.py
python
record_aggregator.__iter__
(self)
return self
Return an iterator to the output sequence of separated distinguishing variables and dependent variables (a tuple of two `dict`s). This is a requirement for the `Iterable` protocol.
Return an iterator to the output sequence of separated distinguishing variables and dependent variables (a tuple of two `dict`s).
[ "Return", "an", "iterator", "to", "the", "output", "sequence", "of", "separated", "distinguishing", "variables", "and", "dependent", "variables", "(", "a", "tuple", "of", "two", "dict", "s", ")", "." ]
def __iter__(self): """Return an iterator to the output sequence of separated distinguishing variables and dependent variables (a tuple of two `dict`s). This is a requirement for the `Iterable` protocol. """ return self
[ "def", "__iter__", "(", "self", ")", ":", "return", "self" ]
https://github.com/NVIDIA/thrust/blob/627dccb359a635afdd69e95a6cc59698f23f70e2/internal/benchmark/compare_benchmark_results.py#L1018-L1024
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py
python
PtyProcess.isatty
(self)
return os.isatty(self.fd)
This returns True if the file descriptor is open and connected to a tty(-like) device, else False. On SVR4-style platforms implementing streams, such as SunOS and HP-UX, the child pty may not appear as a terminal device. This means methods such as setecho(), setwinsize(), getwinsize() ...
This returns True if the file descriptor is open and connected to a tty(-like) device, else False.
[ "This", "returns", "True", "if", "the", "file", "descriptor", "is", "open", "and", "connected", "to", "a", "tty", "(", "-", "like", ")", "device", "else", "False", "." ]
def isatty(self): '''This returns True if the file descriptor is open and connected to a tty(-like) device, else False. On SVR4-style platforms implementing streams, such as SunOS and HP-UX, the child pty may not appear as a terminal device. This means methods such as setecho()...
[ "def", "isatty", "(", "self", ")", ":", "return", "os", ".", "isatty", "(", "self", ".", "fd", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L411-L420
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
VScrolledWindow.EstimateTotalHeight
(*args, **kwargs)
return _windows_.VScrolledWindow_EstimateTotalHeight(*args, **kwargs)
EstimateTotalHeight(self) -> int
EstimateTotalHeight(self) -> int
[ "EstimateTotalHeight", "(", "self", ")", "-", ">", "int" ]
def EstimateTotalHeight(*args, **kwargs): """EstimateTotalHeight(self) -> int""" return _windows_.VScrolledWindow_EstimateTotalHeight(*args, **kwargs)
[ "def", "EstimateTotalHeight", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "VScrolledWindow_EstimateTotalHeight", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L2442-L2444
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/user_preferences.py
python
UserPreferences.hide_name_from_leaderboard
(self, hide_name_from_leaderboard)
Sets the hide_name_from_leaderboard of this UserPreferences. :param hide_name_from_leaderboard: The hide_name_from_leaderboard of this UserPreferences. # noqa: E501 :type: bool
Sets the hide_name_from_leaderboard of this UserPreferences.
[ "Sets", "the", "hide_name_from_leaderboard", "of", "this", "UserPreferences", "." ]
def hide_name_from_leaderboard(self, hide_name_from_leaderboard): """Sets the hide_name_from_leaderboard of this UserPreferences. :param hide_name_from_leaderboard: The hide_name_from_leaderboard of this UserPreferences. # noqa: E501 :type: bool """ self._hide_name_from_leade...
[ "def", "hide_name_from_leaderboard", "(", "self", ",", "hide_name_from_leaderboard", ")", ":", "self", ".", "_hide_name_from_leaderboard", "=", "hide_name_from_leaderboard" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/user_preferences.py#L443-L451
numenta/nupic.core
949950cf2c6d8d894c7eabfa2860aae679bf91f7
bindings/py/setup.py
python
fixPath
(path)
return path
Ensures paths are correct for linux and windows
Ensures paths are correct for linux and windows
[ "Ensures", "paths", "are", "correct", "for", "linux", "and", "windows" ]
def fixPath(path): """ Ensures paths are correct for linux and windows """ path = os.path.abspath(os.path.expanduser(path)) if path.startswith("\\"): return "C:" + path return path
[ "def", "fixPath", "(", "path", ")", ":", "path", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "expanduser", "(", "path", ")", ")", "if", "path", ".", "startswith", "(", "\"\\\\\"", ")", ":", "return", "\"C:\"", "+", "path", ...
https://github.com/numenta/nupic.core/blob/949950cf2c6d8d894c7eabfa2860aae679bf91f7/bindings/py/setup.py#L79-L87
p4lang/PI
38d87e81253feff9fff0660d662c885be78fb719
tools/cpplint.py
python
_IncludeState.CheckNextIncludeOrder
(self, header_type)
return ''
Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The empty string if the header is in the right order, or a...
Returns a non-empty error message if the next header is out of order.
[ "Returns", "a", "non", "-", "empty", "error", "message", "if", "the", "next", "header", "is", "out", "of", "order", "." ]
def CheckNextIncludeOrder(self, header_type): """Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The e...
[ "def", "CheckNextIncludeOrder", "(", "self", ",", "header_type", ")", ":", "error_message", "=", "(", "'Found %s after %s'", "%", "(", "self", ".", "_TYPE_NAMES", "[", "header_type", "]", ",", "self", ".", "_SECTION_NAMES", "[", "self", ".", "_section", "]", ...
https://github.com/p4lang/PI/blob/38d87e81253feff9fff0660d662c885be78fb719/tools/cpplint.py#L1185-L1242
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
DateTime.ParseISOTime
(*args, **kwargs)
return _misc_.DateTime_ParseISOTime(*args, **kwargs)
ParseISOTime(self, String time) -> bool
ParseISOTime(self, String time) -> bool
[ "ParseISOTime", "(", "self", "String", "time", ")", "-", ">", "bool" ]
def ParseISOTime(*args, **kwargs): """ParseISOTime(self, String time) -> bool""" return _misc_.DateTime_ParseISOTime(*args, **kwargs)
[ "def", "ParseISOTime", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_ParseISOTime", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4142-L4144
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
caffe2/python/rnn_cell.py
python
RNNCell.get_output_state_index
(self)
return 0
Return index into state list of the "primary" step-wise output.
Return index into state list of the "primary" step-wise output.
[ "Return", "index", "into", "state", "list", "of", "the", "primary", "step", "-", "wise", "output", "." ]
def get_output_state_index(self): ''' Return index into state list of the "primary" step-wise output. ''' return 0
[ "def", "get_output_state_index", "(", "self", ")", ":", "return", "0" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/rnn_cell.py#L227-L231
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/req/req_uninstall.py
python
UninstallPathSet.remove
(self, auto_confirm=False, verbose=False)
Remove paths in ``self.paths`` with confirmation (unless ``auto_confirm`` is True).
Remove paths in ``self.paths`` with confirmation (unless ``auto_confirm`` is True).
[ "Remove", "paths", "in", "self", ".", "paths", "with", "confirmation", "(", "unless", "auto_confirm", "is", "True", ")", "." ]
def remove(self, auto_confirm=False, verbose=False): # type: (bool, bool) -> None """Remove paths in ``self.paths`` with confirmation (unless ``auto_confirm`` is True).""" if not self.paths: logger.info( "Can't uninstall '%s'. No files were found to uninstall...
[ "def", "remove", "(", "self", ",", "auto_confirm", "=", "False", ",", "verbose", "=", "False", ")", ":", "# type: (bool, bool) -> None", "if", "not", "self", ".", "paths", ":", "logger", ".", "info", "(", "\"Can't uninstall '%s'. No files were found to uninstall.\""...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/req/req_uninstall.py#L376-L406
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/util/file_util.py
python
upload_to_local
(src_path, dst_path, is_dir=False, silent=False)
Copies a file/dir to a local path
Copies a file/dir to a local path
[ "Copies", "a", "file", "/", "dir", "to", "a", "local", "path" ]
def upload_to_local(src_path, dst_path, is_dir=False, silent=False): '''Copies a file/dir to a local path''' if not silent: __logger__.info('Uploading local path %s to path: %s' % (src_path, dst_path)) if not os.path.exists(src_path): raise RuntimeError("Cannot find file/path: %s" % src_pat...
[ "def", "upload_to_local", "(", "src_path", ",", "dst_path", ",", "is_dir", "=", "False", ",", "silent", "=", "False", ")", ":", "if", "not", "silent", ":", "__logger__", ".", "info", "(", "'Uploading local path %s to path: %s'", "%", "(", "src_path", ",", "d...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/util/file_util.py#L137-L161
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/lib2to3/fixer_util.py
python
ListComp
(xp, fp, it, test=None)
return Node(syms.atom, [Leaf(token.LBRACE, "["), inner, Leaf(token.RBRACE, "]")])
A list comprehension of the form [xp for fp in it if test]. If test is None, the "if test" part is omitted.
A list comprehension of the form [xp for fp in it if test].
[ "A", "list", "comprehension", "of", "the", "form", "[", "xp", "for", "fp", "in", "it", "if", "test", "]", "." ]
def ListComp(xp, fp, it, test=None): """A list comprehension of the form [xp for fp in it if test]. If test is None, the "if test" part is omitted. """ xp.prefix = "" fp.prefix = " " it.prefix = " " for_leaf = Leaf(token.NAME, "for") for_leaf.prefix = " " in_leaf = Leaf(token.NAME, ...
[ "def", "ListComp", "(", "xp", ",", "fp", ",", "it", ",", "test", "=", "None", ")", ":", "xp", ".", "prefix", "=", "\"\"", "fp", ".", "prefix", "=", "\" \"", "it", ".", "prefix", "=", "\" \"", "for_leaf", "=", "Leaf", "(", "token", ".", "NAME", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/lib2to3/fixer_util.py#L87-L109
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/nntplib.py
python
NNTP._statparse
(self, resp)
return resp, art_num, message_id
Internal: parse the response line of a STAT, NEXT, LAST, ARTICLE, HEAD or BODY command.
Internal: parse the response line of a STAT, NEXT, LAST, ARTICLE, HEAD or BODY command.
[ "Internal", ":", "parse", "the", "response", "line", "of", "a", "STAT", "NEXT", "LAST", "ARTICLE", "HEAD", "or", "BODY", "command", "." ]
def _statparse(self, resp): """Internal: parse the response line of a STAT, NEXT, LAST, ARTICLE, HEAD or BODY command.""" if not resp.startswith('22'): raise NNTPReplyError(resp) words = resp.split() art_num = int(words[1]) message_id = words[2] return...
[ "def", "_statparse", "(", "self", ",", "resp", ")", ":", "if", "not", "resp", ".", "startswith", "(", "'22'", ")", ":", "raise", "NNTPReplyError", "(", "resp", ")", "words", "=", "resp", ".", "split", "(", ")", "art_num", "=", "int", "(", "words", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/nntplib.py#L716-L724
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/slim/python/slim/data/parallel_reader.py
python
ParallelReader.__init__
(self, reader_class, common_queue, num_readers=4, reader_kwargs=None)
ParallelReader creates num_readers instances of the reader_class. Each instance is created by calling the `reader_class` function passing the arguments specified in `reader_kwargs` as in: reader_class(**read_kwargs) When you read from a ParallelReader, with its `read()` method, you just dequeue ...
ParallelReader creates num_readers instances of the reader_class.
[ "ParallelReader", "creates", "num_readers", "instances", "of", "the", "reader_class", "." ]
def __init__(self, reader_class, common_queue, num_readers=4, reader_kwargs=None): """ParallelReader creates num_readers instances of the reader_class. Each instance is created by calling the `reader_class` function passing the arguments specified...
[ "def", "__init__", "(", "self", ",", "reader_class", ",", "common_queue", ",", "num_readers", "=", "4", ",", "reader_kwargs", "=", "None", ")", ":", "if", "len", "(", "common_queue", ".", "dtypes", ")", "!=", "2", ":", "raise", "TypeError", "(", "'common...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/slim/python/slim/data/parallel_reader.py#L38-L95
DLR-SC/tigl
d1c5901e948e33d10b1f9659ff3e22c4717b455f
bindings/bindings_generator/cheader_parser.py
python
Annotation.parse_string
(self, string)
Parses an annotion string for input and output arguments #annotate in: 1,2 out: 3A(4), 5A(M) nohandle returns: error|value the number in the annotation specifies the index of an argument (counting from 0). An "A" states, that the argument is an array Brackets af...
Parses an annotion string for input and output arguments #annotate in: 1,2 out: 3A(4), 5A(M) nohandle returns: error|value the number in the annotation specifies the index of an argument (counting from 0). An "A" states, that the argument is an array Brackets af...
[ "Parses", "an", "annotion", "string", "for", "input", "and", "output", "arguments", "#annotate", "in", ":", "1", "2", "out", ":", "3A", "(", "4", ")", "5A", "(", "M", ")", "nohandle", "returns", ":", "error|value", "the", "number", "in", "the", "annota...
def parse_string(self, string): """ Parses an annotion string for input and output arguments #annotate in: 1,2 out: 3A(4), 5A(M) nohandle returns: error|value the number in the annotation specifies the index of an argument (counting from 0). An "A" state...
[ "def", "parse_string", "(", "self", ",", "string", ")", ":", "#search output args", "self", ".", "parse_param_group", "(", "'out'", ",", "string", ",", "self", ".", "outargs", ")", "#search input args", "self", ".", "parse_param_group", "(", "'in'", ",", "stri...
https://github.com/DLR-SC/tigl/blob/d1c5901e948e33d10b1f9659ff3e22c4717b455f/bindings/bindings_generator/cheader_parser.py#L183-L221
zju3dv/clean-pvnet
5870c509e3cc205e1bb28910a7b1a9a3c8add9a8
lib/utils/pysixd/transform.py
python
affine_matrix_from_points
(v0, v1, shear=True, scale=True, usesvd=True)
return M
Return affine transform matrix to register two point sets. v0 and v1 are shape (ndims, \*) arrays of at least ndims non-homogeneous coordinates, where ndims is the dimensionality of the coordinate space. If shear is False, a similarity transformation matrix is returned. If also scale is False, a rigid...
Return affine transform matrix to register two point sets.
[ "Return", "affine", "transform", "matrix", "to", "register", "two", "point", "sets", "." ]
def affine_matrix_from_points(v0, v1, shear=True, scale=True, usesvd=True): """Return affine transform matrix to register two point sets. v0 and v1 are shape (ndims, \*) arrays of at least ndims non-homogeneous coordinates, where ndims is the dimensionality of the coordinate space. If shear is False, ...
[ "def", "affine_matrix_from_points", "(", "v0", ",", "v1", ",", "shear", "=", "True", ",", "scale", "=", "True", ",", "usesvd", "=", "True", ")", ":", "v0", "=", "numpy", ".", "array", "(", "v0", ",", "dtype", "=", "numpy", ".", "float64", ",", "cop...
https://github.com/zju3dv/clean-pvnet/blob/5870c509e3cc205e1bb28910a7b1a9a3c8add9a8/lib/utils/pysixd/transform.py#L889-L995
rsummers11/CADLab
976ed959a0b5208bb4173127a7ef732ac73a9b6f
body_part_regressor/bodypartregressor/load_img.py
python
im_list_to_blob
(ims, use_max_size=True)
return blob
Convert a list of images into a network input.
Convert a list of images into a network input.
[ "Convert", "a", "list", "of", "images", "into", "a", "network", "input", "." ]
def im_list_to_blob(ims, use_max_size=True): """Convert a list of images into a network input. """ # max_shape = np.array([im.shape for im in ims]).max(axis=0) # min_shape = np.array([im.shape for im in ims]).min(axis=0) # print max_shape, min_shape if use_max_size: max_shape = np.array(...
[ "def", "im_list_to_blob", "(", "ims", ",", "use_max_size", "=", "True", ")", ":", "# max_shape = np.array([im.shape for im in ims]).max(axis=0)", "# min_shape = np.array([im.shape for im in ims]).min(axis=0)", "# print max_shape, min_shape", "if", "use_max_size", ":", "max_shape", ...
https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/body_part_regressor/bodypartregressor/load_img.py#L62-L82
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/find_depot_tools.py
python
add_depot_tools_to_path
()
return None
Search for depot_tools and add it to sys.path.
Search for depot_tools and add it to sys.path.
[ "Search", "for", "depot_tools", "and", "add", "it", "to", "sys", ".", "path", "." ]
def add_depot_tools_to_path(): """Search for depot_tools and add it to sys.path.""" # First, check if we have a DEPS'd in "depot_tools". deps_depot_tools = os.path.join(SRC, 'third_party', 'depot_tools') if IsRealDepotTools(deps_depot_tools): # Put the pinned version at the start of the sys.path, in case th...
[ "def", "add_depot_tools_to_path", "(", ")", ":", "# First, check if we have a DEPS'd in \"depot_tools\".", "deps_depot_tools", "=", "os", ".", "path", ".", "join", "(", "SRC", ",", "'third_party'", ",", "'depot_tools'", ")", "if", "IsRealDepotTools", "(", "deps_depot_to...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/find_depot_tools.py#L29-L59
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/sysconfig.py
python
parse_makefile
(fn, g=None)
return g
Parse a Makefile-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary.
Parse a Makefile-style file.
[ "Parse", "a", "Makefile", "-", "style", "file", "." ]
def parse_makefile(fn, g=None): """Parse a Makefile-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. """ from distutils.text_file import TextFile fp = TextFile(fn, strip_...
[ "def", "parse_makefile", "(", "fn", ",", "g", "=", "None", ")", ":", "from", "distutils", ".", "text_file", "import", "TextFile", "fp", "=", "TextFile", "(", "fn", ",", "strip_comments", "=", "1", ",", "skip_blanks", "=", "1", ",", "join_lines", "=", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/sysconfig.py#L300-L403
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/gluon/data/dataloader.py
python
ConnectionWrapper.__getattr__
(self, name)
return getattr(attr, name)
Emmulate conn
Emmulate conn
[ "Emmulate", "conn" ]
def __getattr__(self, name): """Emmulate conn""" attr = self.__dict__.get('_conn', None) return getattr(attr, name)
[ "def", "__getattr__", "(", "self", ",", "name", ")", ":", "attr", "=", "self", ".", "__dict__", ".", "get", "(", "'_conn'", ",", "None", ")", "return", "getattr", "(", "attr", ",", "name", ")" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/data/dataloader.py#L92-L95
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/inputs/normalmodes.py
python
InputNormalModes.fetch
(self)
return NormalModes(self.mode.fetch(), self.transform.fetch(), super(InputNormalModes,self).fetch() )
Creates a normal modes object. Returns: A normal modes object.
Creates a normal modes object.
[ "Creates", "a", "normal", "modes", "object", "." ]
def fetch(self): """Creates a normal modes object. Returns: A normal modes object. """ super(InputNormalModes,self).check() return NormalModes(self.mode.fetch(), self.transform.fetch(), super(InputNormalModes,self).fetch() )
[ "def", "fetch", "(", "self", ")", ":", "super", "(", "InputNormalModes", ",", "self", ")", ".", "check", "(", ")", "return", "NormalModes", "(", "self", ".", "mode", ".", "fetch", "(", ")", ",", "self", ".", "transform", ".", "fetch", "(", ")", ","...
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/inputs/normalmodes.py#L76-L84
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
tools/harness-thci/OpenThread_BR.py
python
SerialHandle.bash
(self, cmd, timeout=10)
Execute the command in bash.
Execute the command in bash.
[ "Execute", "the", "command", "in", "bash", "." ]
def bash(self, cmd, timeout=10): """ Execute the command in bash. """ self.__bashClearLines() self.__bashWriteLine(cmd) self.__bashExpect(cmd, timeout=timeout, endswith=True) response = [] deadline = time.time() + timeout while time.time() < dead...
[ "def", "bash", "(", "self", ",", "cmd", ",", "timeout", "=", "10", ")", ":", "self", ".", "__bashClearLines", "(", ")", "self", ".", "__bashWriteLine", "(", "cmd", ")", "self", ".", "__bashExpect", "(", "cmd", ",", "timeout", "=", "timeout", ",", "en...
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread_BR.py#L169-L193