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
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/generators/visitors/InstanceTopologyCppVisitor.py
python
InstanceTopologyCppVisitor.protectedVisit
(self, obj)
Defined to generate protected stuff within a class. @param args: the instance of the concrete element to operation on.
Defined to generate protected stuff within a class.
[ "Defined", "to", "generate", "protected", "stuff", "within", "a", "class", "." ]
def protectedVisit(self, obj): """ Defined to generate protected stuff within a class. @param args: the instance of the concrete element to operation on. """
[ "def", "protectedVisit", "(", "self", ",", "obj", ")", ":" ]
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/InstanceTopologyCppVisitor.py#L404-L408
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
Caret.GetSize
(*args, **kwargs)
return _misc_.Caret_GetSize(*args, **kwargs)
GetSize(self) -> Size
GetSize(self) -> Size
[ "GetSize", "(", "self", ")", "-", ">", "Size" ]
def GetSize(*args, **kwargs): """GetSize(self) -> Size""" return _misc_.Caret_GetSize(*args, **kwargs)
[ "def", "GetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Caret_GetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L762-L764
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/defchararray.py
python
find
(a, sub, start=0, end=None)
return _vec_string( a, integer, 'find', [sub, start] + _clean_args(end))
For each element, return the lowest index in the string where substring `sub` is found. Calls `str.find` element-wise. For each element, return the lowest index in the string where substring `sub` is found, such that `sub` is contained in the range [`start`, `end`]. Parameters ---------- ...
For each element, return the lowest index in the string where substring `sub` is found.
[ "For", "each", "element", "return", "the", "lowest", "index", "in", "the", "string", "where", "substring", "sub", "is", "found", "." ]
def find(a, sub, start=0, end=None): """ For each element, return the lowest index in the string where substring `sub` is found. Calls `str.find` element-wise. For each element, return the lowest index in the string where substring `sub` is found, such that `sub` is contained in the range ...
[ "def", "find", "(", "a", ",", "sub", ",", "start", "=", "0", ",", "end", "=", "None", ")", ":", "return", "_vec_string", "(", "a", ",", "integer", ",", "'find'", ",", "[", "sub", ",", "start", "]", "+", "_clean_args", "(", "end", ")", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/defchararray.py#L621-L653
makefile/frcnn
8d9b9ebf8be8315ba2f374d460121b0adf1df29c
scripts/cpp_lint.py
python
_CppLintState.SetFilters
(self, filters)
Sets the error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "+whitespace/indent"). Each filter should start with + or -; else we die. Raises: ValueError: The comma-sepa...
Sets the error-message filters.
[ "Sets", "the", "error", "-", "message", "filters", "." ]
def SetFilters(self, filters): """Sets the error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "+whitespace/indent"). Each filter should start with + or -; else we die. Ra...
[ "def", "SetFilters", "(", "self", ",", "filters", ")", ":", "# Default filters always have less priority than the flag ones.", "self", ".", "filters", "=", "_DEFAULT_FILTERS", "[", ":", "]", "for", "filt", "in", "filters", ".", "split", "(", "','", ")", ":", "cl...
https://github.com/makefile/frcnn/blob/8d9b9ebf8be8315ba2f374d460121b0adf1df29c/scripts/cpp_lint.py#L717-L740
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/data_structures/sarray.py
python
SArray.mean
(self)
Mean of all the values in the SArray, or mean image. Returns None on an empty SArray. Raises an exception if called on an SArray with non-numeric type or non-Image type. Returns ------- out : float | turicreate.Image Mean of all values in SArray, or image holding pe...
Mean of all the values in the SArray, or mean image.
[ "Mean", "of", "all", "the", "values", "in", "the", "SArray", "or", "mean", "image", "." ]
def mean(self): """ Mean of all the values in the SArray, or mean image. Returns None on an empty SArray. Raises an exception if called on an SArray with non-numeric type or non-Image type. Returns ------- out : float | turicreate.Image Mean of all v...
[ "def", "mean", "(", "self", ")", ":", "with", "cython_context", "(", ")", ":", "if", "self", ".", "dtype", "==", "_Image", ":", "from", ".", ".", "import", "extensions", "return", "extensions", ".", "generate_mean", "(", "self", ")", "else", ":", "retu...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sarray.py#L2276-L2299
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/utils.py
python
set_environ
(env_name, value)
Set the environment variable 'env_name' to 'value' Save previous value, yield, and then restore the previous value stored in the environment variable 'env_name'. If 'value' is None, do nothing
Set the environment variable 'env_name' to 'value'
[ "Set", "the", "environment", "variable", "env_name", "to", "value" ]
def set_environ(env_name, value): """Set the environment variable 'env_name' to 'value' Save previous value, yield, and then restore the previous value stored in the environment variable 'env_name'. If 'value' is None, do nothing""" value_changed = value is not None if value_changed: o...
[ "def", "set_environ", "(", "env_name", ",", "value", ")", ":", "value_changed", "=", "value", "is", "not", "None", "if", "value_changed", ":", "old_value", "=", "os", ".", "environ", ".", "get", "(", "env_name", ")", "os", ".", "environ", "[", "env_name"...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/utils.py#L673-L691
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/distribution_util.py
python
make_tril_scale
( loc=None, scale_tril=None, scale_diag=None, scale_identity_multiplier=None, shape_hint=None, validate_args=False, assert_positive=False, name=None)
return make_diag_scale( loc=loc, scale_diag=scale_diag, scale_identity_multiplier=scale_identity_multiplier, shape_hint=shape_hint, validate_args=validate_args, assert_positive=assert_positive, name=name)
Creates a LinOp representing a lower triangular matrix. Args: loc: Floating-point `Tensor`. This is used for inferring shape in the case where only `scale_identity_multiplier` is set. scale_tril: Floating-point `Tensor` representing the diagonal matrix. `scale_diag` has shape [N1, N2, ... k, k],...
Creates a LinOp representing a lower triangular matrix.
[ "Creates", "a", "LinOp", "representing", "a", "lower", "triangular", "matrix", "." ]
def make_tril_scale( loc=None, scale_tril=None, scale_diag=None, scale_identity_multiplier=None, shape_hint=None, validate_args=False, assert_positive=False, name=None): """Creates a LinOp representing a lower triangular matrix. Args: loc: Floating-point `Tensor`. This is used f...
[ "def", "make_tril_scale", "(", "loc", "=", "None", ",", "scale_tril", "=", "None", ",", "scale_diag", "=", "None", ",", "scale_identity_multiplier", "=", "None", ",", "shape_hint", "=", "None", ",", "validate_args", "=", "False", ",", "assert_positive", "=", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/distribution_util.py#L90-L183
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/operator.py
python
CustomOpProp.infer_type
(self, in_type)
return in_type, [in_type[0]]*len(self.list_outputs()), \ [in_type[0]]*len(self.list_auxiliary_states())
infer_type interface. override to create new operators Parameters ---------- in_type : list of np.dtype list of argument types in the same order as declared in list_arguments. Returns ------- in_type : list list of argument types. Can...
infer_type interface. override to create new operators
[ "infer_type", "interface", ".", "override", "to", "create", "new", "operators" ]
def infer_type(self, in_type): """infer_type interface. override to create new operators Parameters ---------- in_type : list of np.dtype list of argument types in the same order as declared in list_arguments. Returns ------- in_type : li...
[ "def", "infer_type", "(", "self", ",", "in_type", ")", ":", "return", "in_type", ",", "[", "in_type", "[", "0", "]", "]", "*", "len", "(", "self", ".", "list_outputs", "(", ")", ")", ",", "[", "in_type", "[", "0", "]", "]", "*", "len", "(", "se...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/operator.py#L521-L542
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/pymock/mock.py
python
_patch_multiple
(target, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs)
return patcher
Perform multiple patches in a single call. It takes the object to be patched (either as an object or a string to fetch the object by importing) and keyword arguments for the patches:: with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'): ... Use `DEFAULT` as the value i...
Perform multiple patches in a single call. It takes the object to be patched (either as an object or a string to fetch the object by importing) and keyword arguments for the patches::
[ "Perform", "multiple", "patches", "in", "a", "single", "call", ".", "It", "takes", "the", "object", "to", "be", "patched", "(", "either", "as", "an", "object", "or", "a", "string", "to", "fetch", "the", "object", "by", "importing", ")", "and", "keyword",...
def _patch_multiple(target, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs): """Perform multiple patches in a single call. It takes the object to be patched (either as an object or a string to fetch the object by importing) and keyword arguments for th...
[ "def", "_patch_multiple", "(", "target", ",", "spec", "=", "None", ",", "create", "=", "False", ",", "spec_set", "=", "None", ",", "autospec", "=", "None", ",", "new_callable", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "type", "(", "targe...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/pymock/mock.py#L1446-L1492
dmlc/nnvm
dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38
python/nnvm/frontend/darknet.py
python
_darknet_conv2d
(inputs, attrs)
return sym, out_name
Process the convolution 2d operation.
Process the convolution 2d operation.
[ "Process", "the", "convolution", "2d", "operation", "." ]
def _darknet_conv2d(inputs, attrs): """Process the convolution 2d operation.""" kernel = _darknet_parse_tshape(_darknet_required_attr(attrs, 'kernel')) if len(kernel) != 1: _darknet_raise_not_supported('non 2d kernel', 'conv2d') layout = attrs.get('layout', 'NCHW') if layout not in ['NCHW', ...
[ "def", "_darknet_conv2d", "(", "inputs", ",", "attrs", ")", ":", "kernel", "=", "_darknet_parse_tshape", "(", "_darknet_required_attr", "(", "attrs", ",", "'kernel'", ")", ")", "if", "len", "(", "kernel", ")", "!=", "1", ":", "_darknet_raise_not_supported", "(...
https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/frontend/darknet.py#L132-L169
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/step-by-step-directions-from-a-binary-tree-node-to-another.py
python
Solution2.getDirections
(self, root, startValue, destValue)
return "".join(['U']*len(src) + dst)
:type root: Optional[TreeNode] :type startValue: int :type destValue: int :rtype: str
:type root: Optional[TreeNode] :type startValue: int :type destValue: int :rtype: str
[ ":", "type", "root", ":", "Optional", "[", "TreeNode", "]", ":", "type", "startValue", ":", "int", ":", "type", "destValue", ":", "int", ":", "rtype", ":", "str" ]
def getDirections(self, root, startValue, destValue): """ :type root: Optional[TreeNode] :type startValue: int :type destValue: int :rtype: str """ def dfs(node, val, path): if node.val == val: return True if node.left and d...
[ "def", "getDirections", "(", "self", ",", "root", ",", "startValue", ",", "destValue", ")", ":", "def", "dfs", "(", "node", ",", "val", ",", "path", ")", ":", "if", "node", ".", "val", "==", "val", ":", "return", "True", "if", "node", ".", "left", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/step-by-step-directions-from-a-binary-tree-node-to-another.py#L54-L77
DaFuCoding/MTCNN_Caffe
09c30c3ff391bd9cb6b249c1910afaf147767ab3
scripts/cpp_lint.py
python
Error
(filename, linenum, category, confidence, message)
Logs the fact we've found a lint error. We log where the error was found, and also our confidence in the error, that is, how certain we are this is a legitimate style regression, and not a misidentification or a use that's sometimes justified. False positives can be suppressed by the use of "cpplint(categor...
Logs the fact we've found a lint error.
[ "Logs", "the", "fact", "we", "ve", "found", "a", "lint", "error", "." ]
def Error(filename, linenum, category, confidence, message): """Logs the fact we've found a lint error. We log where the error was found, and also our confidence in the error, that is, how certain we are this is a legitimate style regression, and not a misidentification or a use that's sometimes justified. ...
[ "def", "Error", "(", "filename", ",", "linenum", ",", "category", ",", "confidence", ",", "message", ")", ":", "if", "_ShouldPrintError", "(", "category", ",", "confidence", ",", "linenum", ")", ":", "_cpplint_state", ".", "IncrementErrorCount", "(", "category...
https://github.com/DaFuCoding/MTCNN_Caffe/blob/09c30c3ff391bd9cb6b249c1910afaf147767ab3/scripts/cpp_lint.py#L988-L1020
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/aui.py
python
AuiMDIChildFrame.Iconize
(*args, **kwargs)
return _aui.AuiMDIChildFrame_Iconize(*args, **kwargs)
Iconize(self, bool iconize=True)
Iconize(self, bool iconize=True)
[ "Iconize", "(", "self", "bool", "iconize", "=", "True", ")" ]
def Iconize(*args, **kwargs): """Iconize(self, bool iconize=True)""" return _aui.AuiMDIChildFrame_Iconize(*args, **kwargs)
[ "def", "Iconize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiMDIChildFrame_Iconize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L1570-L1572
google/or-tools
2cb85b4eead4c38e1c54b48044f92087cf165bce
examples/python/transit_time.py
python
DataProblem.time_per_demand_unit
(self)
return 5
Gets the time (in min) to load a demand
Gets the time (in min) to load a demand
[ "Gets", "the", "time", "(", "in", "min", ")", "to", "load", "a", "demand" ]
def time_per_demand_unit(self): """Gets the time (in min) to load a demand""" return 5
[ "def", "time_per_demand_unit", "(", "self", ")", ":", "return", "5" ]
https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/examples/python/transit_time.py#L133-L135
dscharrer/innoextract
5519d364cc8898f906f6285d81a87ab8c5469cde
cmake/cpplint.py
python
IsBlankLine
(line)
return not line or line.isspace()
Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank.
Returns true if the given line is blank.
[ "Returns", "true", "if", "the", "given", "line", "is", "blank", "." ]
def IsBlankLine(line): """Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank. """ return not line or line.isspace()
[ "def", "IsBlankLine", "(", "line", ")", ":", "return", "not", "line", "or", "line", ".", "isspace", "(", ")" ]
https://github.com/dscharrer/innoextract/blob/5519d364cc8898f906f6285d81a87ab8c5469cde/cmake/cpplint.py#L1629-L1641
RobotLocomotion/drake
0e18a34604c45ed65bc9018a54f7610f91cdad5b
tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/show_image.py
python
vtk_image_to_numpy
(image)
return data
Gets a properly shaped NumPy view of a VTK image's memory with the storage format `(h, w, num_channels)`. @note This coincides with most other NumPy-based image libraries (OpenCV, matplotlib, scipy).
Gets a properly shaped NumPy view of a VTK image's memory with the storage format `(h, w, num_channels)`.
[ "Gets", "a", "properly", "shaped", "NumPy", "view", "of", "a", "VTK", "image", "s", "memory", "with", "the", "storage", "format", "(", "h", "w", "num_channels", ")", "." ]
def vtk_image_to_numpy(image): """ Gets a properly shaped NumPy view of a VTK image's memory with the storage format `(h, w, num_channels)`. @note This coincides with most other NumPy-based image libraries (OpenCV, matplotlib, scipy). """ data = vtk_to_numpy(image.GetPointData().GetScalars(...
[ "def", "vtk_image_to_numpy", "(", "image", ")", ":", "data", "=", "vtk_to_numpy", "(", "image", ".", "GetPointData", "(", ")", ".", "GetScalars", "(", ")", ")", "data", ".", "shape", "=", "get_vtk_image_shape", "(", "image", ")", "return", "data" ]
https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/show_image.py#L305-L315
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/cephfs/filesystem.py
python
Filesystem.wait_for_daemons
(self, timeout=None, skip_max_mds_check=False, status=None)
Wait until all daemons are healthy :return:
Wait until all daemons are healthy :return:
[ "Wait", "until", "all", "daemons", "are", "healthy", ":", "return", ":" ]
def wait_for_daemons(self, timeout=None, skip_max_mds_check=False, status=None): """ Wait until all daemons are healthy :return: """ if timeout is None: timeout = DAEMON_WAIT_TIMEOUT if status is None: status = self.status() elapsed = 0 ...
[ "def", "wait_for_daemons", "(", "self", ",", "timeout", "=", "None", ",", "skip_max_mds_check", "=", "False", ",", "status", "=", "None", ")", ":", "if", "timeout", "is", "None", ":", "timeout", "=", "DAEMON_WAIT_TIMEOUT", "if", "status", "is", "None", ":"...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/filesystem.py#L1066-L1090
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
lldb/third_party/Python/module/pexpect-4.6/pexpect/FSM.py
python
FSM.add_transition_list
(self, list_input_symbols, state, action=None, next_state=None)
This adds the same transition for a list of input symbols. You can pass a list or a string. Note that it is handy to use string.digits, string.whitespace, string.letters, etc. to add transitions that match character classes. The action may be set to None in which case the process() meth...
This adds the same transition for a list of input symbols. You can pass a list or a string. Note that it is handy to use string.digits, string.whitespace, string.letters, etc. to add transitions that match character classes.
[ "This", "adds", "the", "same", "transition", "for", "a", "list", "of", "input", "symbols", ".", "You", "can", "pass", "a", "list", "or", "a", "string", ".", "Note", "that", "it", "is", "handy", "to", "use", "string", ".", "digits", "string", ".", "wh...
def add_transition_list (self, list_input_symbols, state, action=None, next_state=None): '''This adds the same transition for a list of input symbols. You can pass a list or a string. Note that it is handy to use string.digits, string.whitespace, string.letters, etc. to add transitions ...
[ "def", "add_transition_list", "(", "self", ",", "list_input_symbols", ",", "state", ",", "action", "=", "None", ",", "next_state", "=", "None", ")", ":", "if", "next_state", "is", "None", ":", "next_state", "=", "state", "for", "input_symbol", "in", "list_in...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/pexpect-4.6/pexpect/FSM.py#L148-L162
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/math_ops.py
python
saturate_cast
(value, dtype, name=None)
Performs a safe saturating cast of `value` to `dtype`. This function casts the input to `dtype` without applying any scaling. If there is a danger that values would over or underflow in the cast, this op applies the appropriate clamping before the cast. Args: value: A `Tensor`. dtype: The desired out...
Performs a safe saturating cast of `value` to `dtype`.
[ "Performs", "a", "safe", "saturating", "cast", "of", "value", "to", "dtype", "." ]
def saturate_cast(value, dtype, name=None): """Performs a safe saturating cast of `value` to `dtype`. This function casts the input to `dtype` without applying any scaling. If there is a danger that values would over or underflow in the cast, this op applies the appropriate clamping before the cast. Args: ...
[ "def", "saturate_cast", "(", "value", ",", "dtype", ",", "name", "=", "None", ")", ":", "# When casting to a type with smaller representable range, clamp.", "# Note that this covers casting to unsigned types as well.", "with", "ops", ".", "op_scope", "(", "[", "value", "]",...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L628-L654
lmb-freiburg/ogn
974f72ef4bf840d6f6693d22d1843a79223e77ce
scripts/cpp_lint.py
python
CheckSectionSpacing
(filename, clean_lines, class_info, linenum, error)
Checks for additional blank line issues related to sections. Currently the only thing checked here is blank line before protected/private. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. class_info: A _ClassInfo objects. linenum: The number ...
Checks for additional blank line issues related to sections.
[ "Checks", "for", "additional", "blank", "line", "issues", "related", "to", "sections", "." ]
def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): """Checks for additional blank line issues related to sections. Currently the only thing checked here is blank line before protected/private. Args: filename: The name of the current file. clean_lines: A CleansedLines instance co...
[ "def", "CheckSectionSpacing", "(", "filename", ",", "clean_lines", ",", "class_info", ",", "linenum", ",", "error", ")", ":", "# Skip checks if the class is small, where small means 25 lines or less.", "# 25 lines seems like a good cutoff since that's the usual height of", "# termina...
https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/scripts/cpp_lint.py#L2991-L3043
PaddlePaddle/PaddleOCR
b756bf5f8c90142e0d89d3db0163965c686b6ffe
ppocr/data/imaug/rec_img_aug.py
python
warp
(img, ang, use_tia=True, prob=0.4)
return new_img
warp
warp
[ "warp" ]
def warp(img, ang, use_tia=True, prob=0.4): """ warp """ h, w, _ = img.shape config = Config(use_tia=use_tia) config.make(w, h, ang) new_img = img if config.distort: img_height, img_width = img.shape[0:2] if random.random() <= prob and img_height >= 20 and img_width >= 2...
[ "def", "warp", "(", "img", ",", "ang", ",", "use_tia", "=", "True", ",", "prob", "=", "0.4", ")", ":", "h", ",", "w", ",", "_", "=", "img", ".", "shape", "config", "=", "Config", "(", "use_tia", "=", "use_tia", ")", "config", ".", "make", "(", ...
https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppocr/data/imaug/rec_img_aug.py#L491-L533
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/html2.py
python
WebView.GetZoomType
(*args, **kwargs)
return _html2.WebView_GetZoomType(*args, **kwargs)
GetZoomType(self) -> int
GetZoomType(self) -> int
[ "GetZoomType", "(", "self", ")", "-", ">", "int" ]
def GetZoomType(*args, **kwargs): """GetZoomType(self) -> int""" return _html2.WebView_GetZoomType(*args, **kwargs)
[ "def", "GetZoomType", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html2", ".", "WebView_GetZoomType", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html2.py#L314-L316
esa/pykep
b410363653623730b577de257c04b0e0289f2014
pykep/trajopt/_indirect.py
python
_indirect_base._plot_traj
(self, z, axes, units)
This function will be redefined in the inheriting classes
This function will be redefined in the inheriting classes
[ "This", "function", "will", "be", "redefined", "in", "the", "inheriting", "classes" ]
def _plot_traj(self, z, axes, units): """This function will be redefined in the inheriting classes """ pass
[ "def", "_plot_traj", "(", "self", ",", "z", ",", "axes", ",", "units", ")", ":", "pass" ]
https://github.com/esa/pykep/blob/b410363653623730b577de257c04b0e0289f2014/pykep/trajopt/_indirect.py#L42-L45
wywu/LAB
4b6debd302ae109fd104d4dd04dccc3418ae7471
python/caffe/classifier.py
python
Classifier.predict
(self, inputs, oversample=True)
return predictions
Predict classification probabilities of inputs. Parameters ---------- inputs : iterable of (H x W x K) input ndarrays. oversample : boolean average predictions across center, corners, and mirrors when True (default). Center-only prediction when False. Re...
Predict classification probabilities of inputs.
[ "Predict", "classification", "probabilities", "of", "inputs", "." ]
def predict(self, inputs, oversample=True): """ Predict classification probabilities of inputs. Parameters ---------- inputs : iterable of (H x W x K) input ndarrays. oversample : boolean average predictions across center, corners, and mirrors whe...
[ "def", "predict", "(", "self", ",", "inputs", ",", "oversample", "=", "True", ")", ":", "# Scale to standardize input dimensions.", "input_", "=", "np", ".", "zeros", "(", "(", "len", "(", "inputs", ")", ",", "self", ".", "image_dims", "[", "0", "]", ","...
https://github.com/wywu/LAB/blob/4b6debd302ae109fd104d4dd04dccc3418ae7471/python/caffe/classifier.py#L47-L98
vtraag/louvain-igraph
124ea1be49ee74eec2eaca8006599d7fc5560db6
src/louvain/Optimiser.py
python
Optimiser.set_rng_seed
(self, value)
Set the random seed for the random number generator. Parameters ---------- value The integer seed used in the random number generator
Set the random seed for the random number generator.
[ "Set", "the", "random", "seed", "for", "the", "random", "number", "generator", "." ]
def set_rng_seed(self, value): """ Set the random seed for the random number generator. Parameters ---------- value The integer seed used in the random number generator """ _c_louvain._Optimiser_set_rng_seed(self._optimiser, value)
[ "def", "set_rng_seed", "(", "self", ",", "value", ")", ":", "_c_louvain", ".", "_Optimiser_set_rng_seed", "(", "self", ".", "_optimiser", ",", "value", ")" ]
https://github.com/vtraag/louvain-igraph/blob/124ea1be49ee74eec2eaca8006599d7fc5560db6/src/louvain/Optimiser.py#L76-L84
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/__init__.py
python
disable_warnings
(category=exceptions.HTTPWarning)
Helper for quickly disabling all urllib3 warnings.
[]
def disable_warnings(category=exceptions.HTTPWarning): """ Helper for quickly disabling all urllib3 warnings. """ warnings.simplefilter("ignore", category)
[ "def", "disable_warnings", "(", "category", "=", "exceptions", ".", "HTTPWarning", ")", ":", "warnings", ".", "simplefilter", "(", "\"ignore\"", ",", "category", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/__init__.py#L161-L169
apache/trafodion
8455c839ad6b6d7b6e04edda5715053095b78046
install/python-installer/scripts/common.py
python
ParseJson.save
(self, dic)
return 0
save dict to json file with pretty format
save dict to json file with pretty format
[ "save", "dict", "to", "json", "file", "with", "pretty", "format" ]
def save(self, dic): """ save dict to json file with pretty format """ with open(self.__js_file, 'w') as f: f.write(json.dumps(dic, indent=4)) return 0
[ "def", "save", "(", "self", ",", "dic", ")", ":", "with", "open", "(", "self", ".", "__js_file", ",", "'w'", ")", "as", "f", ":", "f", ".", "write", "(", "json", ".", "dumps", "(", "dic", ",", "indent", "=", "4", ")", ")", "return", "0" ]
https://github.com/apache/trafodion/blob/8455c839ad6b6d7b6e04edda5715053095b78046/install/python-installer/scripts/common.py#L568-L572
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/v8/third_party/jinja2/compiler.py
python
UndeclaredNameVisitor.visit_Block
(self, node)
Stop visiting a blocks.
Stop visiting a blocks.
[ "Stop", "visiting", "a", "blocks", "." ]
def visit_Block(self, node): """Stop visiting a blocks."""
[ "def", "visit_Block", "(", "self", ",", "node", ")", ":" ]
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/third_party/jinja2/compiler.py#L268-L269
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/multiprocessing/__init__.py
python
allow_connection_pickling
()
Install support for sending connections and sockets between processes
Install support for sending connections and sockets between processes
[ "Install", "support", "for", "sending", "connections", "and", "sockets", "between", "processes" ]
def allow_connection_pickling(): ''' Install support for sending connections and sockets between processes ''' from multiprocessing import reduction
[ "def", "allow_connection_pickling", "(", ")", ":", "from", "multiprocessing", "import", "reduction" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/multiprocessing/__init__.py#L161-L165
happynear/caffe-windows
967eedf25009e334b7f6f933bb5e17aaaff5bef6
scripts/cpp_lint.py
python
FindNextMultiLineCommentEnd
(lines, lineix)
return len(lines)
We are inside a comment, find the end marker.
We are inside a comment, find the end marker.
[ "We", "are", "inside", "a", "comment", "find", "the", "end", "marker", "." ]
def FindNextMultiLineCommentEnd(lines, lineix): """We are inside a comment, find the end marker.""" while lineix < len(lines): if lines[lineix].strip().endswith('*/'): return lineix lineix += 1 return len(lines)
[ "def", "FindNextMultiLineCommentEnd", "(", "lines", ",", "lineix", ")", ":", "while", "lineix", "<", "len", "(", "lines", ")", ":", "if", "lines", "[", "lineix", "]", ".", "strip", "(", ")", ".", "endswith", "(", "'*/'", ")", ":", "return", "lineix", ...
https://github.com/happynear/caffe-windows/blob/967eedf25009e334b7f6f933bb5e17aaaff5bef6/scripts/cpp_lint.py#L1138-L1144
locusrobotics/robot_navigation
d0ebe153518a827622baf05f8a20508dc05dfe44
robot_nav_tools/rqt_dwb_plugin/src/rqt_dwb_plugin/multi_topic_view.py
python
MultiTopicView.__init__
(self, timeline, parent, main_topic, window=0.5)
Constructor. main_topic provides the topic of the messages to focus on. window provides the number of seconds for the surrounding time window.
Constructor.
[ "Constructor", "." ]
def __init__(self, timeline, parent, main_topic, window=0.5): """Constructor. main_topic provides the topic of the messages to focus on. window provides the number of seconds for the surrounding time window. """ super(MultiTopicView, self).__init__(timeline, parent, main_topic) ...
[ "def", "__init__", "(", "self", ",", "timeline", ",", "parent", ",", "main_topic", ",", "window", "=", "0.5", ")", ":", "super", "(", "MultiTopicView", ",", "self", ")", ".", "__init__", "(", "timeline", ",", "parent", ",", "main_topic", ")", "self", "...
https://github.com/locusrobotics/robot_navigation/blob/d0ebe153518a827622baf05f8a20508dc05dfe44/robot_nav_tools/rqt_dwb_plugin/src/rqt_dwb_plugin/multi_topic_view.py#L56-L88
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
txjsonrpc/jsonrpc.py
python
addIntrospection
(jsonrpc)
Add Introspection support to an JSONRPC server. @param jsonrpc: The jsonrpc server to add Introspection support to.
Add Introspection support to an JSONRPC server.
[ "Add", "Introspection", "support", "to", "an", "JSONRPC", "server", "." ]
def addIntrospection(jsonrpc): """ Add Introspection support to an JSONRPC server. @param jsonrpc: The jsonrpc server to add Introspection support to. """ #jsonrpc.putSubHandler('system', Introspection, ('protocol',)) jsonrpc.putSubHandler('system', Introspection(jsonrpc))
[ "def", "addIntrospection", "(", "jsonrpc", ")", ":", "#jsonrpc.putSubHandler('system', Introspection, ('protocol',))", "jsonrpc", ".", "putSubHandler", "(", "'system'", ",", "Introspection", "(", "jsonrpc", ")", ")" ]
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/txjsonrpc/jsonrpc.py#L202-L209
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py3/google/protobuf/internal/well_known_types.py
python
Struct.get_or_create_list
(self, key)
return self.fields[key].list_value
Returns a list for this key, creating if it didn't exist already.
Returns a list for this key, creating if it didn't exist already.
[ "Returns", "a", "list", "for", "this", "key", "creating", "if", "it", "didn", "t", "exist", "already", "." ]
def get_or_create_list(self, key): """Returns a list for this key, creating if it didn't exist already.""" if not self.fields[key].HasField('list_value'): # Clear will mark list_value modified which will indeed create a list. self.fields[key].list_value.Clear() return self.fields[key].list_value
[ "def", "get_or_create_list", "(", "self", ",", "key", ")", ":", "if", "not", "self", ".", "fields", "[", "key", "]", ".", "HasField", "(", "'list_value'", ")", ":", "# Clear will mark list_value modified which will indeed create a list.", "self", ".", "fields", "[...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/internal/well_known_types.py#L789-L794
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/flatnotebook.py
python
PageContainer.OnLeftDown
(self, event)
Handles the wx.EVT_LEFT_DOWN events for L{PageContainer}.
Handles the wx.EVT_LEFT_DOWN events for L{PageContainer}.
[ "Handles", "the", "wx", ".", "EVT_LEFT_DOWN", "events", "for", "L", "{", "PageContainer", "}", "." ]
def OnLeftDown(self, event): """ Handles the wx.EVT_LEFT_DOWN events for L{PageContainer}. """ # Reset buttons status self._nXButtonStatus = FNB_BTN_NONE self._nLeftButtonStatus = FNB_BTN_NONE self._nRightButtonStatus = FNB_BTN_NONE self._nTabXButtonStatus = FNB_BT...
[ "def", "OnLeftDown", "(", "self", ",", "event", ")", ":", "# Reset buttons status", "self", ".", "_nXButtonStatus", "=", "FNB_BTN_NONE", "self", ".", "_nLeftButtonStatus", "=", "FNB_BTN_NONE", "self", ".", "_nRightButtonStatus", "=", "FNB_BTN_NONE", "self", ".", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/flatnotebook.py#L3983-L4018
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
SearchCtrl.ShowSearchButton
(*args, **kwargs)
return _controls_.SearchCtrl_ShowSearchButton(*args, **kwargs)
ShowSearchButton(self, bool show) Sets the search button visibility value on the search control. If there is a menu attached, the search button will be visible regardless of the search button visibility value. This has no effect in Mac OS X v10.3
ShowSearchButton(self, bool show)
[ "ShowSearchButton", "(", "self", "bool", "show", ")" ]
def ShowSearchButton(*args, **kwargs): """ ShowSearchButton(self, bool show) Sets the search button visibility value on the search control. If there is a menu attached, the search button will be visible regardless of the search button visibility value. This has no effect in Mac...
[ "def", "ShowSearchButton", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "SearchCtrl_ShowSearchButton", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L7425-L7434
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
example/gluon/super_resolution/super_resolution.py
python
get_dataset
(prefetch=False)
return [PrefetchingIter(i) for i in iters] if prefetch else iters
Download the BSDS500 dataset and return train and test iters.
Download the BSDS500 dataset and return train and test iters.
[ "Download", "the", "BSDS500", "dataset", "and", "return", "train", "and", "test", "iters", "." ]
def get_dataset(prefetch=False): """Download the BSDS500 dataset and return train and test iters.""" if path.exists(data_dir): print( "Directory {} already exists, skipping.\n" "To force download and extraction, delete the directory and re-run." "".format(data_dir), ...
[ "def", "get_dataset", "(", "prefetch", "=", "False", ")", ":", "if", "path", ".", "exists", "(", "data_dir", ")", ":", "print", "(", "\"Directory {} already exists, skipping.\\n\"", "\"To force download and extraction, delete the directory and re-run.\"", "\"\"", ".", "fo...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/example/gluon/super_resolution/super_resolution.py#L70-L131
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/handler.py
python
ErrorHandler.warning
(self, exception)
Handle a warning.
Handle a warning.
[ "Handle", "a", "warning", "." ]
def warning(self, exception): "Handle a warning." print exception
[ "def", "warning", "(", "self", ",", "exception", ")", ":", "print", "exception" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/handler.py#L40-L42
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/webbrowser.py
python
_iscommand
(cmd)
return False
Return True if cmd is executable or can be found on the executable search path.
Return True if cmd is executable or can be found on the executable search path.
[ "Return", "True", "if", "cmd", "is", "executable", "or", "can", "be", "found", "on", "the", "executable", "search", "path", "." ]
def _iscommand(cmd): """Return True if cmd is executable or can be found on the executable search path.""" if _isexecutable(cmd): return True path = os.environ.get("PATH") if not path: return False for d in path.split(os.pathsep): exe = os.path.join(d, cmd) if _is...
[ "def", "_iscommand", "(", "cmd", ")", ":", "if", "_isexecutable", "(", "cmd", ")", ":", "return", "True", "path", "=", "os", ".", "environ", ".", "get", "(", "\"PATH\"", ")", "if", "not", "path", ":", "return", "False", "for", "d", "in", "path", "....
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/webbrowser.py#L121-L133
moflow/moflow
2dfb27c799c90c6caf1477508eca3eec616ef7d2
bap/libtracewrap/libtrace/protobuf/python/google/protobuf/message.py
python
Message.SetInParent
(self)
Mark this as present in the parent. This normally happens automatically when you assign a field of a sub-message, but sometimes you want to make the sub-message present while keeping it empty. If you find yourself using this, you may want to reconsider your design.
Mark this as present in the parent.
[ "Mark", "this", "as", "present", "in", "the", "parent", "." ]
def SetInParent(self): """Mark this as present in the parent. This normally happens automatically when you assign a field of a sub-message, but sometimes you want to make the sub-message present while keeping it empty. If you find yourself using this, you may want to reconsider your design.""" ...
[ "def", "SetInParent", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/message.py#L125-L132
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Tool/msvs.py
python
msvs_parse_version
(s)
return float(num), suite
Split a Visual Studio version, which may in fact be something like '7.0Exp', into is version number (returned as a float) and trailing "suite" portion.
Split a Visual Studio version, which may in fact be something like '7.0Exp', into is version number (returned as a float) and trailing "suite" portion.
[ "Split", "a", "Visual", "Studio", "version", "which", "may", "in", "fact", "be", "something", "like", "7", ".", "0Exp", "into", "is", "version", "number", "(", "returned", "as", "a", "float", ")", "and", "trailing", "suite", "portion", "." ]
def msvs_parse_version(s): """ Split a Visual Studio version, which may in fact be something like '7.0Exp', into is version number (returned as a float) and trailing "suite" portion. """ num, suite = version_re.match(s).groups() return float(num), suite
[ "def", "msvs_parse_version", "(", "s", ")", ":", "num", ",", "suite", "=", "version_re", ".", "match", "(", "s", ")", ".", "groups", "(", ")", "return", "float", "(", "num", ")", ",", "suite" ]
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/msvs.py#L131-L138
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/ContactStructuralMechanicsApplication/python_scripts/custom_sympy_fe_utilities.py
python
DefineShapeFunctions
(nnodes, dim, impose_partion_of_unity = False)
return sympy_fe_utilities.DefineShapeFunctions(nnodes, dim, impose_partion_of_unity)
This method defines shape functions and derivatives Note that partition of unity is imposed the name HAS TO BE --> N and DN Keyword arguments: nnodes -- Number of nodes dim -- Dimension of the space impose_partion_of_unity -- Impose the partition of unity
This method defines shape functions and derivatives Note that partition of unity is imposed the name HAS TO BE --> N and DN
[ "This", "method", "defines", "shape", "functions", "and", "derivatives", "Note", "that", "partition", "of", "unity", "is", "imposed", "the", "name", "HAS", "TO", "BE", "--", ">", "N", "and", "DN" ]
def DefineShapeFunctions(nnodes, dim, impose_partion_of_unity = False): """ This method defines shape functions and derivatives Note that partition of unity is imposed the name HAS TO BE --> N and DN Keyword arguments: nnodes -- Number of nodes dim -- Dimension of the space impose_partion_o...
[ "def", "DefineShapeFunctions", "(", "nnodes", ",", "dim", ",", "impose_partion_of_unity", "=", "False", ")", ":", "return", "sympy_fe_utilities", ".", "DefineShapeFunctions", "(", "nnodes", ",", "dim", ",", "impose_partion_of_unity", ")" ]
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ContactStructuralMechanicsApplication/python_scripts/custom_sympy_fe_utilities.py#L72-L82
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sarray.py
python
SArray.rolling_count
(self, window_start, window_end)
return SArray(_proxy=self.__proxy__.builtin_rolling_apply(agg_op, window_start, window_end, 0))
Count the number of non-NULL values of different subsets over this SArray. The subset that the count is excecuted on is defined as an inclusive range relative to the position to each value in the SArray, using `window_start` and `window_end`. For a better understanding of this, ...
Count the number of non-NULL values of different subsets over this SArray.
[ "Count", "the", "number", "of", "non", "-", "NULL", "values", "of", "different", "subsets", "over", "this", "SArray", "." ]
def rolling_count(self, window_start, window_end): """ Count the number of non-NULL values of different subsets over this SArray. The subset that the count is excecuted on is defined as an inclusive range relative to the position to each value in the SArray, using `windo...
[ "def", "rolling_count", "(", "self", ",", "window_start", ",", "window_end", ")", ":", "agg_op", "=", "'__builtin__nonnull__count__'", "return", "SArray", "(", "_proxy", "=", "self", ".", "__proxy__", ".", "builtin_rolling_apply", "(", "agg_op", ",", "window_start...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sarray.py#L3916-L3991
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/eager/backprop.py
python
_magic_gradient_function
(op_name, attr_tuple, num_inputs, inputs, outputs, out_grads)
return grad_fn(mock_op, *out_grads)
Calls the gradient function of the op. Args: op_name: the name of the op to be differentiated. attr_tuple: the attrs, as a tuple. num_inputs: the number of inputs to the op. inputs: inputs to the original operation. outputs: outputs to the original operation. out_grads: gradients of the opera...
Calls the gradient function of the op.
[ "Calls", "the", "gradient", "function", "of", "the", "op", "." ]
def _magic_gradient_function(op_name, attr_tuple, num_inputs, inputs, outputs, out_grads): """Calls the gradient function of the op. Args: op_name: the name of the op to be differentiated. attr_tuple: the attrs, as a tuple. num_inputs: the number of inputs to the op. in...
[ "def", "_magic_gradient_function", "(", "op_name", ",", "attr_tuple", ",", "num_inputs", ",", "inputs", ",", "outputs", ",", "out_grads", ")", ":", "mock_op", "=", "_MockOp", "(", "attr_tuple", ",", "inputs", ",", "outputs", ",", "op_name", ")", "grad_fn", "...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/backprop.py#L88-L108
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/quantization_utils.py
python
AdvancedQuantizedLayerSelector.do_quantize
(self, layer, weight_param=None)
return True
weight_param - should be name of the WeightParam field
weight_param - should be name of the WeightParam field
[ "weight_param", "-", "should", "be", "name", "of", "the", "WeightParam", "field" ]
def do_quantize(self, layer, weight_param=None): """ weight_param - should be name of the WeightParam field """ ret = super(AdvancedQuantizedLayerSelector, self).do_quantize(layer) if not ret: return False layer_type = layer.WhichOneof("layer") if layer_type ...
[ "def", "do_quantize", "(", "self", ",", "layer", ",", "weight_param", "=", "None", ")", ":", "ret", "=", "super", "(", "AdvancedQuantizedLayerSelector", ",", "self", ")", ".", "do_quantize", "(", "layer", ")", "if", "not", "ret", ":", "return", "False", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/quantization_utils.py#L135-L182
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.SetTargetStart
(*args, **kwargs)
return _stc.StyledTextCtrl_SetTargetStart(*args, **kwargs)
SetTargetStart(self, int pos) Sets the position that starts the target which is used for updating the document without affecting the scroll position.
SetTargetStart(self, int pos)
[ "SetTargetStart", "(", "self", "int", "pos", ")" ]
def SetTargetStart(*args, **kwargs): """ SetTargetStart(self, int pos) Sets the position that starts the target which is used for updating the document without affecting the scroll position. """ return _stc.StyledTextCtrl_SetTargetStart(*args, **kwargs)
[ "def", "SetTargetStart", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetTargetStart", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L3713-L3720
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/gan/python/train.py
python
_get_update_ops
(kwargs, gen_scope, dis_scope, check_for_unused_ops=True)
return gen_update_ops, dis_update_ops
Gets generator and discriminator update ops. Args: kwargs: A dictionary of kwargs to be passed to `create_train_op`. `update_ops` is removed, if present. gen_scope: A scope for the generator. dis_scope: A scope for the discriminator. check_for_unused_ops: A Python bool. If `True`, throw Excepti...
Gets generator and discriminator update ops.
[ "Gets", "generator", "and", "discriminator", "update", "ops", "." ]
def _get_update_ops(kwargs, gen_scope, dis_scope, check_for_unused_ops=True): """Gets generator and discriminator update ops. Args: kwargs: A dictionary of kwargs to be passed to `create_train_op`. `update_ops` is removed, if present. gen_scope: A scope for the generator. dis_scope: A scope for t...
[ "def", "_get_update_ops", "(", "kwargs", ",", "gen_scope", ",", "dis_scope", ",", "check_for_unused_ops", "=", "True", ")", ":", "if", "'update_ops'", "in", "kwargs", ":", "update_ops", "=", "set", "(", "kwargs", "[", "'update_ops'", "]", ")", "del", "kwargs...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/gan/python/train.py#L438-L473
may0324/DeepCompression-caffe
0aff6c1287bda4cfc7f378ed8a16524e1afabd8c
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/may0324/DeepCompression-caffe/blob/0aff6c1287bda4cfc7f378ed8a16524e1afabd8c/scripts/cpp_lint.py#L4600-L4642
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py
python
ServerConnection.ctcp
(self, ctcptype, target, parameter="")
Send a CTCP command.
Send a CTCP command.
[ "Send", "a", "CTCP", "command", "." ]
def ctcp(self, ctcptype, target, parameter=""): """Send a CTCP command.""" ctcptype = ctcptype.upper() self.privmsg(target, "\001%s%s\001" % (ctcptype, parameter and (" " + parameter) or ""))
[ "def", "ctcp", "(", "self", ",", "ctcptype", ",", "target", ",", "parameter", "=", "\"\"", ")", ":", "ctcptype", "=", "ctcptype", ".", "upper", "(", ")", "self", ".", "privmsg", "(", "target", ",", "\"\\001%s%s\\001\"", "%", "(", "ctcptype", ",", "para...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py#L638-L641
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/generator/msvs.py
python
GenerateOutput
(target_list, target_dicts, data, params)
Generate .sln and .vcproj files. This is the entry point for this generator. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. data: Dictionary containing per .gyp data.
Generate .sln and .vcproj files.
[ "Generate", ".", "sln", "and", ".", "vcproj", "files", "." ]
def GenerateOutput(target_list, target_dicts, data, params): """Generate .sln and .vcproj files. This is the entry point for this generator. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. data: Dictionary containing pe...
[ "def", "GenerateOutput", "(", "target_list", ",", "target_dicts", ",", "data", ",", "params", ")", ":", "global", "fixpath_prefix", "options", "=", "params", "[", "'options'", "]", "# Get the project file format version back out of where we stashed it in", "# GeneratorCalcu...
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/msvs.py#L1804-L1873
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/metrics_impl.py
python
precision_at_top_k
(labels, predictions_idx, k=None, class_id=None, weights=None, metrics_collections=None, updates_collections=None, name=None)
Computes precision@k of the predictions with respect to sparse labels. Differs from `sparse_precision_at_k` in that predictions must be in the form of top `k` class indices, whereas `sparse_precision_at_k` expects logits. Refer to `sparse_precision_at_k` for more details. Args: labels: `int64` `Tensor` or...
Computes precision@k of the predictions with respect to sparse labels.
[ "Computes", "precision@k", "of", "the", "predictions", "with", "respect", "to", "sparse", "labels", "." ]
def precision_at_top_k(labels, predictions_idx, k=None, class_id=None, weights=None, metrics_collections=None, updates_collections=None, name=None): """Compu...
[ "def", "precision_at_top_k", "(", "labels", ",", "predictions_idx", ",", "k", "=", "None", ",", "class_id", "=", "None", ",", "weights", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/metrics_impl.py#L3418-L3503
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Sizer.Add
(*args, **kwargs)
return _core_.Sizer_Add(*args, **kwargs)
Add(self, item, int proportion=0, int flag=0, int border=0, PyObject userData=None) -> wx.SizerItem Appends a child item to the sizer.
Add(self, item, int proportion=0, int flag=0, int border=0, PyObject userData=None) -> wx.SizerItem
[ "Add", "(", "self", "item", "int", "proportion", "=", "0", "int", "flag", "=", "0", "int", "border", "=", "0", "PyObject", "userData", "=", "None", ")", "-", ">", "wx", ".", "SizerItem" ]
def Add(*args, **kwargs): """ Add(self, item, int proportion=0, int flag=0, int border=0, PyObject userData=None) -> wx.SizerItem Appends a child item to the sizer. """ return _core_.Sizer_Add(*args, **kwargs)
[ "def", "Add", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Sizer_Add", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L14454-L14461
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
ppapi/generators/idl_parser.py
python
IDLParser.p_top_list
(self, p)
top_list : callback_decl top_list | describe_block top_list | dictionary_block top_list | enum_block top_list | inline top_list | interface_block top_list | label_block top_list | namespace top_list ...
top_list : callback_decl top_list | describe_block top_list | dictionary_block top_list | enum_block top_list | inline top_list | interface_block top_list | label_block top_list | namespace top_list ...
[ "top_list", ":", "callback_decl", "top_list", "|", "describe_block", "top_list", "|", "dictionary_block", "top_list", "|", "enum_block", "top_list", "|", "inline", "top_list", "|", "interface_block", "top_list", "|", "label_block", "top_list", "|", "namespace", "top_l...
def p_top_list(self, p): """top_list : callback_decl top_list | describe_block top_list | dictionary_block top_list | enum_block top_list | inline top_list | interface_block top_list | label_block top_list ...
[ "def", "p_top_list", "(", "self", ",", "p", ")", ":", "if", "len", "(", "p", ")", ">", "2", ":", "p", "[", "0", "]", "=", "ListFromConcat", "(", "p", "[", "1", "]", ",", "p", "[", "2", "]", ")", "if", "self", ".", "parse_debug", ":", "DumpR...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/ppapi/generators/idl_parser.py#L225-L239
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
DataViewModel.IsListModel
(*args, **kwargs)
return _dataview.DataViewModel_IsListModel(*args, **kwargs)
IsListModel(self) -> bool
IsListModel(self) -> bool
[ "IsListModel", "(", "self", ")", "-", ">", "bool" ]
def IsListModel(*args, **kwargs): """IsListModel(self) -> bool""" return _dataview.DataViewModel_IsListModel(*args, **kwargs)
[ "def", "IsListModel", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewModel_IsListModel", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L677-L679
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Wrapping/Python/paraview/servermanager.py
python
CreateRenderView
(session=None, **extraArgs)
return _create_view("RenderView", session, **extraArgs)
Creates a render window on the particular session. If session is not specified, then the active session is used, if available. This method can also be used to initialize properties by passing keyword arguments where the key is the name of the property. In addition registrationGroup and registrationName...
Creates a render window on the particular session. If session is not specified, then the active session is used, if available.
[ "Creates", "a", "render", "window", "on", "the", "particular", "session", ".", "If", "session", "is", "not", "specified", "then", "the", "active", "session", "is", "used", "if", "available", "." ]
def CreateRenderView(session=None, **extraArgs): """Creates a render window on the particular session. If session is not specified, then the active session is used, if available. This method can also be used to initialize properties by passing keyword arguments where the key is the name of the property...
[ "def", "CreateRenderView", "(", "session", "=", "None", ",", "*", "*", "extraArgs", ")", ":", "return", "_create_view", "(", "\"RenderView\"", ",", "session", ",", "*", "*", "extraArgs", ")" ]
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/servermanager.py#L2268-L2277
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/linalg/linalg.py
python
svd
(a, full_matrices=True, compute_uv=True, hermitian=False)
Singular Value Decomposition. When `a` is a 2D array, it is factorized as ``u @ np.diag(s) @ vh = (u * s) @ vh``, where `u` and `vh` are 2D unitary arrays and `s` is a 1D array of `a`'s singular values. When `a` is higher-dimensional, SVD is applied in stacked mode as explained below. Parameters ...
Singular Value Decomposition.
[ "Singular", "Value", "Decomposition", "." ]
def svd(a, full_matrices=True, compute_uv=True, hermitian=False): """ Singular Value Decomposition. When `a` is a 2D array, it is factorized as ``u @ np.diag(s) @ vh = (u * s) @ vh``, where `u` and `vh` are 2D unitary arrays and `s` is a 1D array of `a`'s singular values. When `a` is higher-dimensi...
[ "def", "svd", "(", "a", ",", "full_matrices", "=", "True", ",", "compute_uv", "=", "True", ",", "hermitian", "=", "False", ")", ":", "a", ",", "wrap", "=", "_makearray", "(", "a", ")", "if", "hermitian", ":", "# note: lapack returns eigenvalues in reverse or...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/linalg/linalg.py#L1459-L1640
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
buildscripts/clang_format.py
python
get_clang_format_from_linux_cache
(dest_file)
Get clang-format from mongodb's cache
Get clang-format from mongodb's cache
[ "Get", "clang", "-", "format", "from", "mongodb", "s", "cache" ]
def get_clang_format_from_linux_cache(dest_file): """Get clang-format from mongodb's cache """ # Get URL url = CLANG_FORMAT_HTTP_LINUX_CACHE dest_dir = tempfile.gettempdir() temp_tar_file = os.path.join(dest_dir, "temp.tar.xz") # Download the file print("Downloading clang-format %s fro...
[ "def", "get_clang_format_from_linux_cache", "(", "dest_file", ")", ":", "# Get URL", "url", "=", "CLANG_FORMAT_HTTP_LINUX_CACHE", "dest_dir", "=", "tempfile", ".", "gettempdir", "(", ")", "temp_tar_file", "=", "os", ".", "path", ".", "join", "(", "dest_dir", ",", ...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/clang_format.py#L167-L184
rrwick/Unicycler
96ffea71e3a78d63ade19d6124946773e65cf129
unicycler/assembly_graph.py
python
AssemblyGraph.get_mean_path_depth
(self, path)
return new_depth, original_depth
Returns the mean depth for the path. If any segments in the path are bridges, their depth isn't counted because bridges got their depth from the segments they are bridging, so to count them would be to count that depth twice.
Returns the mean depth for the path. If any segments in the path are bridges, their depth isn't counted because bridges got their depth from the segments they are bridging, so to count them would be to count that depth twice.
[ "Returns", "the", "mean", "depth", "for", "the", "path", ".", "If", "any", "segments", "in", "the", "path", "are", "bridges", "their", "depth", "isn", "t", "counted", "because", "bridges", "got", "their", "depth", "from", "the", "segments", "they", "are", ...
def get_mean_path_depth(self, path): """ Returns the mean depth for the path. If any segments in the path are bridges, their depth isn't counted because bridges got their depth from the segments they are bridging, so to count them would be to count that depth twice. """ n...
[ "def", "get_mean_path_depth", "(", "self", ",", "path", ")", ":", "non_bridge_seg_nums", "=", "[", "abs", "(", "x", ")", "for", "x", "in", "path", "if", "self", ".", "segments", "[", "abs", "(", "x", ")", "]", ".", "bridge", "is", "None", "]", "# I...
https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/assembly_graph.py#L574-L600
zyq8709/DexHunter
9d829a9f6f608ebad26923f29a294ae9c68d0441
art/tools/cpplint.py
python
CheckCheck
(filename, clean_lines, linenum, error)
Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks the use of CHECK and EXPECT macros.
[ "Checks", "the", "use", "of", "CHECK", "and", "EXPECT", "macros", "." ]
def CheckCheck(filename, clean_lines, linenum, error): """Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. ...
[ "def", "CheckCheck", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Decide the set of replacement macros that should be suggested", "raw_lines", "=", "clean_lines", ".", "raw_lines", "current_macro", "=", "''", "for", "macro", "in", "_...
https://github.com/zyq8709/DexHunter/blob/9d829a9f6f608ebad26923f29a294ae9c68d0441/art/tools/cpplint.py#L2715-L2745
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_extends/parse/parser.py
python
Parser.is_supported_namespace_module
(self, value)
return False
To check if the module is allowed to support.
To check if the module is allowed to support.
[ "To", "check", "if", "the", "module", "is", "allowed", "to", "support", "." ]
def is_supported_namespace_module(self, value): """To check if the module is allowed to support.""" # Check `mindspore` namespace. if not hasattr(value, '__name__'): logger.debug(f"'{str(value)}' has no '__name__' attribute, we suppose it's supported.") return True ...
[ "def", "is_supported_namespace_module", "(", "self", ",", "value", ")", ":", "# Check `mindspore` namespace.", "if", "not", "hasattr", "(", "value", ",", "'__name__'", ")", ":", "logger", ".", "debug", "(", "f\"'{str(value)}' has no '__name__' attribute, we suppose it's s...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parse/parser.py#L693-L755
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/bench/cssmin.py
python
condense_semicolons
(css)
return re.sub(r";;+", ";", css)
Condense multiple adjacent semicolon characters into one.
Condense multiple adjacent semicolon characters into one.
[ "Condense", "multiple", "adjacent", "semicolon", "characters", "into", "one", "." ]
def condense_semicolons(css): """Condense multiple adjacent semicolon characters into one.""" return re.sub(r";;+", ";", css)
[ "def", "condense_semicolons", "(", "css", ")", ":", "return", "re", ".", "sub", "(", "r\";;+\"", ",", "\";\"", ",", "css", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/bench/cssmin.py#L186-L189
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/tools/grit/grit/node/node_io.py
python
EmitNode.GetEmitType
(self)
return self.attrs['emit_type']
Returns the emit_type for this node. Default is 'append'.
Returns the emit_type for this node. Default is 'append'.
[ "Returns", "the", "emit_type", "for", "this", "node", ".", "Default", "is", "append", "." ]
def GetEmitType(self): '''Returns the emit_type for this node. Default is 'append'.''' return self.attrs['emit_type']
[ "def", "GetEmitType", "(", "self", ")", ":", "return", "self", ".", "attrs", "[", "'emit_type'", "]" ]
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/node/node_io.py#L115-L117
deepmind/reverb
ef3c8f0be1b720a741d2dee335e15e44668c291a
reverb/server_executable/server_from_proto.py
python
selector_from_proto
( s: schema_pb2.KeyDistributionOptions )
Convert protobuf to reverb_types.SelectorType.
Convert protobuf to reverb_types.SelectorType.
[ "Convert", "protobuf", "to", "reverb_types", ".", "SelectorType", "." ]
def selector_from_proto( s: schema_pb2.KeyDistributionOptions ) -> reverb_types.SelectorType: """Convert protobuf to reverb_types.SelectorType.""" if s.fifo: return reverb.selectors.Fifo() elif s.uniform: return reverb.selectors.Uniform() elif s.lifo: return reverb.selectors.Lifo() elif s.Whic...
[ "def", "selector_from_proto", "(", "s", ":", "schema_pb2", ".", "KeyDistributionOptions", ")", "->", "reverb_types", ".", "SelectorType", ":", "if", "s", ".", "fifo", ":", "return", "reverb", ".", "selectors", ".", "Fifo", "(", ")", "elif", "s", ".", "unif...
https://github.com/deepmind/reverb/blob/ef3c8f0be1b720a741d2dee335e15e44668c291a/reverb/server_executable/server_from_proto.py#L28-L53
microsoft/EdgeML
ef9f8a77f096acbdeb941014791f8eda1c1bc35b
pytorch/edgeml_pytorch/trainer/bonsaiTrainer.py
python
BonsaiTrainer.getModelSize
(self)
return totalnnZ, totalSize, hasSparse
Function to get aimed model size
Function to get aimed model size
[ "Function", "to", "get", "aimed", "model", "size" ]
def getModelSize(self): ''' Function to get aimed model size ''' nnzZ, sizeZ, sparseZ = utils.estimateNNZ(self.bonsaiObj.Z, self.sZ) nnzW, sizeW, sparseW = utils.estimateNNZ(self.bonsaiObj.W, self.sW) nnzV, sizeV, sparseV = utils.estimateNNZ(self.bonsaiObj.V, self.sV) ...
[ "def", "getModelSize", "(", "self", ")", ":", "nnzZ", ",", "sizeZ", ",", "sparseZ", "=", "utils", ".", "estimateNNZ", "(", "self", ".", "bonsaiObj", ".", "Z", ",", "self", ".", "sZ", ")", "nnzW", ",", "sizeW", ",", "sparseW", "=", "utils", ".", "es...
https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/pytorch/edgeml_pytorch/trainer/bonsaiTrainer.py#L223-L235
Smorodov/Multitarget-tracker
bee300e8bfd660c86cbeb6892c65a5b7195c9381
thirdparty/pybind11/tools/clang/cindex.py
python
Type.get_pointee
(self)
return conf.lib.clang_getPointeeType(self)
For pointer types, returns the type of the pointee.
For pointer types, returns the type of the pointee.
[ "For", "pointer", "types", "returns", "the", "type", "of", "the", "pointee", "." ]
def get_pointee(self): """ For pointer types, returns the type of the pointee. """ return conf.lib.clang_getPointeeType(self)
[ "def", "get_pointee", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getPointeeType", "(", "self", ")" ]
https://github.com/Smorodov/Multitarget-tracker/blob/bee300e8bfd660c86cbeb6892c65a5b7195c9381/thirdparty/pybind11/tools/clang/cindex.py#L2042-L2046
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/ceph_manager.py
python
CephManager.get_mon_status
(self, mon)
return json.loads(out)
Extract all the monitor status information from the cluster
Extract all the monitor status information from the cluster
[ "Extract", "all", "the", "monitor", "status", "information", "from", "the", "cluster" ]
def get_mon_status(self, mon): """ Extract all the monitor status information from the cluster """ out = self.raw_cluster_cmd('tell', 'mon.%s' % mon, 'mon_status') return json.loads(out)
[ "def", "get_mon_status", "(", "self", ",", "mon", ")", ":", "out", "=", "self", ".", "raw_cluster_cmd", "(", "'tell'", ",", "'mon.%s'", "%", "mon", ",", "'mon_status'", ")", "return", "json", ".", "loads", "(", "out", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph_manager.py#L3093-L3098
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/dtypes/cast.py
python
sanitize_to_nanoseconds
(values: np.ndarray, copy: bool = False)
return values
Safely convert non-nanosecond datetime64 or timedelta64 values to nanosecond.
Safely convert non-nanosecond datetime64 or timedelta64 values to nanosecond.
[ "Safely", "convert", "non", "-", "nanosecond", "datetime64", "or", "timedelta64", "values", "to", "nanosecond", "." ]
def sanitize_to_nanoseconds(values: np.ndarray, copy: bool = False) -> np.ndarray: """ Safely convert non-nanosecond datetime64 or timedelta64 values to nanosecond. """ dtype = values.dtype if dtype.kind == "M" and dtype != DT64NS_DTYPE: values = conversion.ensure_datetime64ns(values) e...
[ "def", "sanitize_to_nanoseconds", "(", "values", ":", "np", ".", "ndarray", ",", "copy", ":", "bool", "=", "False", ")", "->", "np", ".", "ndarray", ":", "dtype", "=", "values", ".", "dtype", "if", "dtype", ".", "kind", "==", "\"M\"", "and", "dtype", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/dtypes/cast.py#L1727-L1741
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/formats/style_render.py
python
Tooltips._class_styles
(self)
return [ { "selector": f".{self.class_name}", "props": maybe_convert_css_to_tuples(self.class_properties), } ]
Combine the ``_Tooltips`` CSS class name and CSS properties to the format required to extend the underlying ``Styler`` `table_styles` to allow tooltips to render in HTML. Returns ------- styles : List
Combine the ``_Tooltips`` CSS class name and CSS properties to the format required to extend the underlying ``Styler`` `table_styles` to allow tooltips to render in HTML.
[ "Combine", "the", "_Tooltips", "CSS", "class", "name", "and", "CSS", "properties", "to", "the", "format", "required", "to", "extend", "the", "underlying", "Styler", "table_styles", "to", "allow", "tooltips", "to", "render", "in", "HTML", "." ]
def _class_styles(self): """ Combine the ``_Tooltips`` CSS class name and CSS properties to the format required to extend the underlying ``Styler`` `table_styles` to allow tooltips to render in HTML. Returns ------- styles : List """ return [ ...
[ "def", "_class_styles", "(", "self", ")", ":", "return", "[", "{", "\"selector\"", ":", "f\".{self.class_name}\"", ",", "\"props\"", ":", "maybe_convert_css_to_tuples", "(", "self", ".", "class_properties", ")", ",", "}", "]" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/formats/style_render.py#L1121-L1136
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBExpressionOptions.GetTopLevel
(self)
return _lldb.SBExpressionOptions_GetTopLevel(self)
GetTopLevel(self) -> bool
GetTopLevel(self) -> bool
[ "GetTopLevel", "(", "self", ")", "-", ">", "bool" ]
def GetTopLevel(self): """GetTopLevel(self) -> bool""" return _lldb.SBExpressionOptions_GetTopLevel(self)
[ "def", "GetTopLevel", "(", "self", ")", ":", "return", "_lldb", ".", "SBExpressionOptions_GetTopLevel", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L4263-L4265
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/pytorch/losses/rl_losses.py
python
compute_advantages
(policy_logits, action_values, use_relu=False)
return torch.sum(policy_advantages, dim=1)
Compute advantages using pi and Q.
Compute advantages using pi and Q.
[ "Compute", "advantages", "using", "pi", "and", "Q", "." ]
def compute_advantages(policy_logits, action_values, use_relu=False): """Compute advantages using pi and Q.""" # Compute advantage. policy = F.softmax(policy_logits, dim=1) # Avoid computing gradients for action_values. action_values = action_values.detach() baseline = compute_baseline(policy, action_value...
[ "def", "compute_advantages", "(", "policy_logits", ",", "action_values", ",", "use_relu", "=", "False", ")", ":", "# Compute advantage.", "policy", "=", "F", ".", "softmax", "(", "policy_logits", ",", "dim", "=", "1", ")", "# Avoid computing gradients for action_val...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/pytorch/losses/rl_losses.py#L69-L84
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py
python
ParserElement.searchString
(self, instring, maxMatches=_MAX_INT)
Another extension to :class:`scanString`, simplifying the access to the tokens found to match the given parse expression. May be called with optional ``maxMatches`` argument, to clip searching after 'n' matches are found. Example:: # a capitalized word starts with an uppercase let...
Another extension to :class:`scanString`, simplifying the access to the tokens found to match the given parse expression. May be called with optional ``maxMatches`` argument, to clip searching after 'n' matches are found.
[ "Another", "extension", "to", ":", "class", ":", "scanString", "simplifying", "the", "access", "to", "the", "tokens", "found", "to", "match", "the", "given", "parse", "expression", ".", "May", "be", "called", "with", "optional", "maxMatches", "argument", "to",...
def searchString(self, instring, maxMatches=_MAX_INT): """ Another extension to :class:`scanString`, simplifying the access to the tokens found to match the given parse expression. May be called with optional ``maxMatches`` argument, to clip searching after 'n' matches are found. ...
[ "def", "searchString", "(", "self", ",", "instring", ",", "maxMatches", "=", "_MAX_INT", ")", ":", "try", ":", "return", "ParseResults", "(", "[", "t", "for", "t", ",", "s", ",", "e", "in", "self", ".", "scanString", "(", "instring", ",", "maxMatches",...
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/_vendor/pyparsing.py#L2081-L2111
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/mcts.py
python
SearchNode.to_str
(self, state=None)
return ("{:>6}: player: {}, prior: {:5.3f}, value: {:6.3f}, sims: {:5d}, " "outcome: {}, {:3d} children").format( action, self.player, self.prior, self.explore_count and self.total_reward / self.explore_count, self.explore_count, ("{:4.1f}".format(self.outcome...
Returns the string representation of this node. Args: state: A `pyspiel.State` object, to be used to convert the action id into a human readable format. If None, the action integer id is used.
Returns the string representation of this node.
[ "Returns", "the", "string", "representation", "of", "this", "node", "." ]
def to_str(self, state=None): """Returns the string representation of this node. Args: state: A `pyspiel.State` object, to be used to convert the action id into a human readable format. If None, the action integer id is used. """ action = ( state.action_to_string(state.current_pla...
[ "def", "to_str", "(", "self", ",", "state", "=", "None", ")", ":", "action", "=", "(", "state", ".", "action_to_string", "(", "state", ".", "current_player", "(", ")", ",", "self", ".", "action", ")", "if", "state", "and", "self", ".", "action", "is"...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/mcts.py#L178-L193
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/coverage/coverage/plugin.py
python
FileTracer.has_dynamic_source_filename
(self)
return False
Does this FileTracer have dynamic source file names? FileTracers can provide dynamically determined file names by implementing :meth:`dynamic_source_filename`. Invoking that function is expensive. To determine whether to invoke it, coverage.py uses the result of this function to know i...
Does this FileTracer have dynamic source file names?
[ "Does", "this", "FileTracer", "have", "dynamic", "source", "file", "names?" ]
def has_dynamic_source_filename(self): """Does this FileTracer have dynamic source file names? FileTracers can provide dynamically determined file names by implementing :meth:`dynamic_source_filename`. Invoking that function is expensive. To determine whether to invoke it, coverage.py ...
[ "def", "has_dynamic_source_filename", "(", "self", ")", ":", "return", "False" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/plugin.py#L133-L149
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/gslib/tab_complete.py
python
CloudObjectCompleter.__init__
(self, gsutil_api, bucket_only=False)
Instantiates completer for Cloud URLs. Args: gsutil_api: gsutil Cloud API instance to use. bucket_only: Whether the completer should only match buckets.
Instantiates completer for Cloud URLs.
[ "Instantiates", "completer", "for", "Cloud", "URLs", "." ]
def __init__(self, gsutil_api, bucket_only=False): """Instantiates completer for Cloud URLs. Args: gsutil_api: gsutil Cloud API instance to use. bucket_only: Whether the completer should only match buckets. """ self._gsutil_api = gsutil_api self._bucket_only = bucket_only
[ "def", "__init__", "(", "self", ",", "gsutil_api", ",", "bucket_only", "=", "False", ")", ":", "self", ".", "_gsutil_api", "=", "gsutil_api", "self", ".", "_bucket_only", "=", "bucket_only" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/tab_complete.py#L193-L201
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
lldb/examples/python/crashlog.py
python
CrashLog.__init__
(self, path, verbose)
CrashLog constructor that take a path to a darwin crash log file
CrashLog constructor that take a path to a darwin crash log file
[ "CrashLog", "constructor", "that", "take", "a", "path", "to", "a", "darwin", "crash", "log", "file" ]
def __init__(self, path, verbose): """CrashLog constructor that take a path to a darwin crash log file""" symbolication.Symbolicator.__init__(self) self.path = os.path.expanduser(path) self.info_lines = list() self.system_profile = list() self.threads = list() sel...
[ "def", "__init__", "(", "self", ",", "path", ",", "verbose", ")", ":", "symbolication", ".", "Symbolicator", ".", "__init__", "(", "self", ")", "self", ".", "path", "=", "os", ".", "path", ".", "expanduser", "(", "path", ")", "self", ".", "info_lines",...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/examples/python/crashlog.py#L361-L542
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TStr_GetNullStr
()
return _snap.TStr_GetNullStr()
TStr_GetNullStr() -> TStr
TStr_GetNullStr() -> TStr
[ "TStr_GetNullStr", "()", "-", ">", "TStr" ]
def TStr_GetNullStr(): """TStr_GetNullStr() -> TStr""" return _snap.TStr_GetNullStr()
[ "def", "TStr_GetNullStr", "(", ")", ":", "return", "_snap", ".", "TStr_GetNullStr", "(", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L11361-L11363
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/YouCompleteMe/third_party/jedi/jedi/docstrings.py
python
_search_param_in_docstr
(docstr, param_str)
return None
Search `docstr` for a type of `param_str`. >>> _search_param_in_docstr(':type param: int', 'param') 'int' >>> _search_param_in_docstr('@type param: int', 'param') 'int' >>> _search_param_in_docstr( ... ':type param: :class:`threading.Thread`', 'param') 'threading.Thread' >>> _search_p...
Search `docstr` for a type of `param_str`.
[ "Search", "docstr", "for", "a", "type", "of", "param_str", "." ]
def _search_param_in_docstr(docstr, param_str): """ Search `docstr` for a type of `param_str`. >>> _search_param_in_docstr(':type param: int', 'param') 'int' >>> _search_param_in_docstr('@type param: int', 'param') 'int' >>> _search_param_in_docstr( ... ':type param: :class:`threading...
[ "def", "_search_param_in_docstr", "(", "docstr", ",", "param_str", ")", ":", "# look at #40 to see definitions of those params", "patterns", "=", "[", "re", ".", "compile", "(", "p", "%", "re", ".", "escape", "(", "param_str", ")", ")", "for", "p", "in", "DOCS...
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/jedi/jedi/docstrings.py#L62-L85
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/lib/format.py
python
write_array
(fp, array, version=(1,0))
Write an array to an NPY file, including a header. If the array is neither C-contiguous nor Fortran-contiguous AND the file_like object is not a real file object, this function will have to copy data in memory. Parameters ---------- fp : file_like object An open, writable file object, ...
Write an array to an NPY file, including a header.
[ "Write", "an", "array", "to", "an", "NPY", "file", "including", "a", "header", "." ]
def write_array(fp, array, version=(1,0)): """ Write an array to an NPY file, including a header. If the array is neither C-contiguous nor Fortran-contiguous AND the file_like object is not a real file object, this function will have to copy data in memory. Parameters ---------- fp : f...
[ "def", "write_array", "(", "fp", ",", "array", ",", "version", "=", "(", "1", ",", "0", ")", ")", ":", "if", "version", "!=", "(", "1", ",", "0", ")", ":", "msg", "=", "\"we only support format version (1,0), not %s\"", "raise", "ValueError", "(", "msg",...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/format.py#L365-L413
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/chigger/observers/TimerObserver.py
python
TimerObserver.addObserver
(self, event, vtkinteractor)
return vtkinteractor.AddObserver(event, self._callback)
Add the TimerEvent for this object.
Add the TimerEvent for this object.
[ "Add", "the", "TimerEvent", "for", "this", "object", "." ]
def addObserver(self, event, vtkinteractor): """ Add the TimerEvent for this object. """ vtkinteractor.CreateRepeatingTimer(self.getOption('duration')) return vtkinteractor.AddObserver(event, self._callback)
[ "def", "addObserver", "(", "self", ",", "event", ",", "vtkinteractor", ")", ":", "vtkinteractor", ".", "CreateRepeatingTimer", "(", "self", ".", "getOption", "(", "'duration'", ")", ")", "return", "vtkinteractor", ".", "AddObserver", "(", "event", ",", "self",...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/observers/TimerObserver.py#L29-L34
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/symsrc/pefile.py
python
PE.parse_export_directory
(self, rva, size)
return ExportDirData( struct = export_dir, symbols = exports)
Parse the export directory. Given the rva of the export directory, it will process all its entries. The exports will be made available through a list "exports" containing a tuple with the following elements: (ordinal, symbol_address, symbol_name) ...
Parse the export directory. Given the rva of the export directory, it will process all its entries. The exports will be made available through a list "exports" containing a tuple with the following elements: (ordinal, symbol_address, symbol_name) ...
[ "Parse", "the", "export", "directory", ".", "Given", "the", "rva", "of", "the", "export", "directory", "it", "will", "process", "all", "its", "entries", ".", "The", "exports", "will", "be", "made", "available", "through", "a", "list", "exports", "containing"...
def parse_export_directory(self, rva, size): """Parse the export directory. Given the rva of the export directory, it will process all its entries. The exports will be made available through a list "exports" containing a tuple with the following elements: ...
[ "def", "parse_export_directory", "(", "self", ",", "rva", ",", "size", ")", ":", "try", ":", "export_dir", "=", "self", ".", "__unpack_data__", "(", "self", ".", "__IMAGE_EXPORT_DIRECTORY_format__", ",", "self", ".", "get_data", "(", "rva", ")", ",", "file_o...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/symsrc/pefile.py#L2576-L2682
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/urllib2.py
python
parse_keqv_list
(l)
return parsed
Parse list of key=value strings where keys are not duplicated.
Parse list of key=value strings where keys are not duplicated.
[ "Parse", "list", "of", "key", "=", "value", "strings", "where", "keys", "are", "not", "duplicated", "." ]
def parse_keqv_list(l): """Parse list of key=value strings where keys are not duplicated.""" parsed = {} for elt in l: k, v = elt.split('=', 1) if v[0] == '"' and v[-1] == '"': v = v[1:-1] parsed[k] = v return parsed
[ "def", "parse_keqv_list", "(", "l", ")", ":", "parsed", "=", "{", "}", "for", "elt", "in", "l", ":", "k", ",", "v", "=", "elt", ".", "split", "(", "'='", ",", "1", ")", "if", "v", "[", "0", "]", "==", "'\"'", "and", "v", "[", "-", "1", "]...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/urllib2.py#L1249-L1257
zyq8709/DexHunter
9d829a9f6f608ebad26923f29a294ae9c68d0441
art/tools/cpplint.py
python
CheckForUnicodeReplacementCharacters
(filename, lines, error)
Logs an error for each line containing Unicode replacement characters. These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that it's possible for this to throw off line numbering if the invalid UTF-8 occurred adjacent to a newline. ...
Logs an error for each line containing Unicode replacement characters.
[ "Logs", "an", "error", "for", "each", "line", "containing", "Unicode", "replacement", "characters", "." ]
def CheckForUnicodeReplacementCharacters(filename, lines, error): """Logs an error for each line containing Unicode replacement characters. These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that it's possible for this to throw off...
[ "def", "CheckForUnicodeReplacementCharacters", "(", "filename", ",", "lines", ",", "error", ")", ":", "for", "linenum", ",", "line", "in", "enumerate", "(", "lines", ")", ":", "if", "u'\\ufffd'", "in", "line", ":", "error", "(", "filename", ",", "linenum", ...
https://github.com/zyq8709/DexHunter/blob/9d829a9f6f608ebad26923f29a294ae9c68d0441/art/tools/cpplint.py#L1217-L1233
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py
python
Decimal._round_ceiling
(self, prec)
Rounds up (not away from 0 if negative.)
Rounds up (not away from 0 if negative.)
[ "Rounds", "up", "(", "not", "away", "from", "0", "if", "negative", ".", ")" ]
def _round_ceiling(self, prec): """Rounds up (not away from 0 if negative.)""" if self._sign: return self._round_down(prec) else: return -self._round_down(prec)
[ "def", "_round_ceiling", "(", "self", ",", "prec", ")", ":", "if", "self", ".", "_sign", ":", "return", "self", ".", "_round_down", "(", "prec", ")", "else", ":", "return", "-", "self", ".", "_round_down", "(", "prec", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py#L1798-L1803
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py
python
to_filename
(name)
return name.replace('-', '_')
Convert a project or version name to its filename-escaped form Any '-' characters are currently replaced with '_'.
Convert a project or version name to its filename-escaped form
[ "Convert", "a", "project", "or", "version", "name", "to", "its", "filename", "-", "escaped", "form" ]
def to_filename(name): """Convert a project or version name to its filename-escaped form Any '-' characters are currently replaced with '_'. """ return name.replace('-', '_')
[ "def", "to_filename", "(", "name", ")", ":", "return", "name", ".", "replace", "(", "'-'", ",", "'_'", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L1427-L1432
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/mem/slicc/parser.py
python
SLICC.p_param__pointer
(self, p)
param : type STAR ident
param : type STAR ident
[ "param", ":", "type", "STAR", "ident" ]
def p_param__pointer(self, p): "param : type STAR ident" p[0] = ast.FormalParamAST(self, p[1], p[3], None, "PTR")
[ "def", "p_param__pointer", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "ast", ".", "FormalParamAST", "(", "self", ",", "p", "[", "1", "]", ",", "p", "[", "3", "]", ",", "None", ",", "\"PTR\"", ")" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/mem/slicc/parser.py#L450-L452
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Text.window_configure
(self, index, cnf=None, **kw)
return self._configure(('window', 'configure', index), cnf, kw)
Configure an embedded window at INDEX.
Configure an embedded window at INDEX.
[ "Configure", "an", "embedded", "window", "at", "INDEX", "." ]
def window_configure(self, index, cnf=None, **kw): """Configure an embedded window at INDEX.""" return self._configure(('window', 'configure', index), cnf, kw)
[ "def", "window_configure", "(", "self", ",", "index", ",", "cnf", "=", "None", ",", "*", "*", "kw", ")", ":", "return", "self", ".", "_configure", "(", "(", "'window'", ",", "'configure'", ",", "index", ")", ",", "cnf", ",", "kw", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3173-L3175
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/operator/_hamiltonian.py
python
BoseHubbard.J
(self)
return self._J
The hopping amplitude.
The hopping amplitude.
[ "The", "hopping", "amplitude", "." ]
def J(self): """The hopping amplitude.""" return self._J
[ "def", "J", "(", "self", ")", ":", "return", "self", ".", "_J" ]
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/operator/_hamiltonian.py#L548-L550
Slicer/SlicerGitSVNArchive
65e92bb16c2b32ea47a1a66bee71f238891ee1ca
Base/Python/tpycl/tpycl.py
python
tpycl.py_eval
(self,cmd)
return( repr(evalResult) )
evaluated the python command string and returns the result - if the result is a vtk object instance, it is registered in the tcl interp - if the result is a tuple, it is converted to a tcl-style list
evaluated the python command string and returns the result - if the result is a vtk object instance, it is registered in the tcl interp - if the result is a tuple, it is converted to a tcl-style list
[ "evaluated", "the", "python", "command", "string", "and", "returns", "the", "result", "-", "if", "the", "result", "is", "a", "vtk", "object", "instance", "it", "is", "registered", "in", "the", "tcl", "interp", "-", "if", "the", "result", "is", "a", "tupl...
def py_eval(self,cmd): """ evaluated the python command string and returns the result - if the result is a vtk object instance, it is registered in the tcl interp - if the result is a tuple, it is converted to a tcl-style list """ cmd = "__tpycl_result = " + cmd try: exec( cmd, globals() )...
[ "def", "py_eval", "(", "self", ",", "cmd", ")", ":", "cmd", "=", "\"__tpycl_result = \"", "+", "cmd", "try", ":", "exec", "(", "cmd", ",", "globals", "(", ")", ")", "except", ":", "print", "(", "\"Error executing %s\"", "%", "cmd", ")", "print", "(", ...
https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Base/Python/tpycl/tpycl.py#L139-L169
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/factorization/examples/mnist.py
python
run_training
()
Train MNIST for a number of steps.
Train MNIST for a number of steps.
[ "Train", "MNIST", "for", "a", "number", "of", "steps", "." ]
def run_training(): """Train MNIST for a number of steps.""" # Get the sets of images and labels for training, validation, and # test on MNIST. train_dir = tempfile.mkdtemp() data_sets = input_data.read_data_sets(train_dir, FLAGS.fake_data) # Tell TensorFlow that the model will be built into the default Gr...
[ "def", "run_training", "(", ")", ":", "# Get the sets of images and labels for training, validation, and", "# test on MNIST.", "train_dir", "=", "tempfile", ".", "mkdtemp", "(", ")", "data_sets", "=", "input_data", ".", "read_data_sets", "(", "train_dir", ",", "FLAGS", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/factorization/examples/mnist.py#L180-L269
ideawu/ssdb-rocks
a3cbb322cafb2f493252829c608e2239df98c9ac
deps/cpy/antlr3/recognizers.py
python
Parser.setTokenStream
(self, input)
Set the token stream and reset the parser
Set the token stream and reset the parser
[ "Set", "the", "token", "stream", "and", "reset", "the", "parser" ]
def setTokenStream(self, input): """Set the token stream and reset the parser""" self.input = None self.reset() self.input = input
[ "def", "setTokenStream", "(", "self", ",", "input", ")", ":", "self", ".", "input", "=", "None", "self", ".", "reset", "(", ")", "self", ".", "input", "=", "input" ]
https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/recognizers.py#L1432-L1437
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/requests_oauthlib/oauth2_session.py
python
OAuth2Session.__init__
(self, client_id=None, client=None, auto_refresh_url=None, auto_refresh_kwargs=None, scope=None, redirect_uri=None, token=None, state=None, token_updater=None, **kwargs)
Construct a new OAuth 2 client session. :param client_id: Client id obtained during registration :param client: :class:`oauthlib.oauth2.Client` to be used. Default is WebApplicationClient which is useful for any hosted application but not mobile or desktop....
Construct a new OAuth 2 client session.
[ "Construct", "a", "new", "OAuth", "2", "client", "session", "." ]
def __init__(self, client_id=None, client=None, auto_refresh_url=None, auto_refresh_kwargs=None, scope=None, redirect_uri=None, token=None, state=None, token_updater=None, **kwargs): """Construct a new OAuth 2 client session. :param client_id: Client id obtained during registrat...
[ "def", "__init__", "(", "self", ",", "client_id", "=", "None", ",", "client", "=", "None", ",", "auto_refresh_url", "=", "None", ",", "auto_refresh_kwargs", "=", "None", ",", "scope", "=", "None", ",", "redirect_uri", "=", "None", ",", "token", "=", "Non...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/requests_oauthlib/oauth2_session.py#L37-L83
moflow/moflow
2dfb27c799c90c6caf1477508eca3eec616ef7d2
bap/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/encoder.py
python
TagBytes
(field_number, wire_type)
return _VarintBytes(wire_format.PackTag(field_number, wire_type))
Encode the given tag and return the bytes. Only called at startup.
Encode the given tag and return the bytes. Only called at startup.
[ "Encode", "the", "given", "tag", "and", "return", "the", "bytes", ".", "Only", "called", "at", "startup", "." ]
def TagBytes(field_number, wire_type): """Encode the given tag and return the bytes. Only called at startup.""" return _VarintBytes(wire_format.PackTag(field_number, wire_type))
[ "def", "TagBytes", "(", "field_number", ",", "wire_type", ")", ":", "return", "_VarintBytes", "(", "wire_format", ".", "PackTag", "(", "field_number", ",", "wire_type", ")", ")" ]
https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/encoder.py#L388-L391
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Window.PopEventHandler
(*args, **kwargs)
return _core_.Window_PopEventHandler(*args, **kwargs)
PopEventHandler(self, bool deleteHandler=False) -> EvtHandler Removes and returns the top-most event handler on the event handler stack. If deleteHandler is True then the wx.EvtHandler object will be destroyed after it is popped, and ``None`` will be returned instead.
PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
[ "PopEventHandler", "(", "self", "bool", "deleteHandler", "=", "False", ")", "-", ">", "EvtHandler" ]
def PopEventHandler(*args, **kwargs): """ PopEventHandler(self, bool deleteHandler=False) -> EvtHandler Removes and returns the top-most event handler on the event handler stack. If deleteHandler is True then the wx.EvtHandler object will be destroyed after it is popped, and ``...
[ "def", "PopEventHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_PopEventHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L10404-L10412
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/estimator.py
python
Estimator._call_model_fn
(self, features, targets, mode)
return self._model_fn(features, targets)
Calls model function with support of 2, 3 or 4 arguments.
Calls model function with support of 2, 3 or 4 arguments.
[ "Calls", "model", "function", "with", "support", "of", "2", "3", "or", "4", "arguments", "." ]
def _call_model_fn(self, features, targets, mode): """Calls model function with support of 2, 3 or 4 arguments.""" model_fn_args = _get_arguments(self._model_fn) if 'mode' in model_fn_args: if 'params' in model_fn_args: return self._model_fn(features, targets, mode=mode, params=self.params) ...
[ "def", "_call_model_fn", "(", "self", ",", "features", ",", "targets", ",", "mode", ")", ":", "model_fn_args", "=", "_get_arguments", "(", "self", ".", "_model_fn", ")", "if", "'mode'", "in", "model_fn_args", ":", "if", "'params'", "in", "model_fn_args", ":"...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/estimator.py#L725-L733
KhronosGroup/SPIRV-LLVM
1eb85593f3fe2c39379b9a9b088d51eda4f42b8b
examples/Kaleidoscope/MCJIT/cached/genk-timing.py
python
KScriptGenerator.updateCalledFunctionList
(self, callee)
Maintains a list of functions that will actually be called
Maintains a list of functions that will actually be called
[ "Maintains", "a", "list", "of", "functions", "that", "will", "actually", "be", "called" ]
def updateCalledFunctionList(self, callee): """Maintains a list of functions that will actually be called""" # Update the total call count self.updateTotalCallCount(callee) # If this function is already in the list, don't do anything else if callee in self.calledFunctions: ...
[ "def", "updateCalledFunctionList", "(", "self", ",", "callee", ")", ":", "# Update the total call count", "self", ".", "updateTotalCallCount", "(", "callee", ")", "# If this function is already in the list, don't do anything else", "if", "callee", "in", "self", ".", "called...
https://github.com/KhronosGroup/SPIRV-LLVM/blob/1eb85593f3fe2c39379b9a9b088d51eda4f42b8b/examples/Kaleidoscope/MCJIT/cached/genk-timing.py#L66-L78
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/calendar.py
python
Calendar.yeardatescalendar
(self, year, width=3)
return [months[i:i+width] for i in range(0, len(months), width) ]
Return the data for the specified year ready for formatting. The return value is a list of month rows. Each month row contains up to width months. Each month contains between 4 and 6 weeks and each week contains 1-7 days. Days are datetime.date objects.
Return the data for the specified year ready for formatting. The return value is a list of month rows. Each month row contains up to width months. Each month contains between 4 and 6 weeks and each week contains 1-7 days. Days are datetime.date objects.
[ "Return", "the", "data", "for", "the", "specified", "year", "ready", "for", "formatting", ".", "The", "return", "value", "is", "a", "list", "of", "month", "rows", ".", "Each", "month", "row", "contains", "up", "to", "width", "months", ".", "Each", "month...
def yeardatescalendar(self, year, width=3): """ Return the data for the specified year ready for formatting. The return value is a list of month rows. Each month row contains up to width months. Each month contains between 4 and 6 weeks and each week contains 1-7 days. Days are d...
[ "def", "yeardatescalendar", "(", "self", ",", "year", ",", "width", "=", "3", ")", ":", "months", "=", "[", "self", ".", "monthdatescalendar", "(", "year", ",", "i", ")", "for", "i", "in", "range", "(", "January", ",", "January", "+", "12", ")", "]...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/calendar.py#L254-L265
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/distributed/DistributedSmoothNode.py
python
DistributedSmoothNode.stopSmooth
(self)
This function stops the task spawned by startSmooth(), and allows show code to move the node around directly.
This function stops the task spawned by startSmooth(), and allows show code to move the node around directly.
[ "This", "function", "stops", "the", "task", "spawned", "by", "startSmooth", "()", "and", "allows", "show", "code", "to", "move", "the", "node", "around", "directly", "." ]
def stopSmooth(self): """ This function stops the task spawned by startSmooth(), and allows show code to move the node around directly. """ if self.smoothStarted: taskName = self.taskName("smooth") taskMgr.remove(taskName) self.forceToTruePosit...
[ "def", "stopSmooth", "(", "self", ")", ":", "if", "self", ".", "smoothStarted", ":", "taskName", "=", "self", ".", "taskName", "(", "\"smooth\"", ")", "taskMgr", ".", "remove", "(", "taskName", ")", "self", ".", "forceToTruePosition", "(", ")", "self", "...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/distributed/DistributedSmoothNode.py#L143-L152
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/frame.py
python
DataFrame.reset_index
( self, level: Optional[Union[Hashable, Sequence[Hashable]]] = None, drop: bool = False, inplace: bool = False, col_level: Hashable = 0, col_fill: Optional[Hashable] = "", )
return None
Reset the index, or a level of it. Reset the index of the DataFrame, and use the default one instead. If the DataFrame has a MultiIndex, this method can remove one or more levels. Parameters ---------- level : int, str, tuple, or list, default None Only remo...
Reset the index, or a level of it.
[ "Reset", "the", "index", "or", "a", "level", "of", "it", "." ]
def reset_index( self, level: Optional[Union[Hashable, Sequence[Hashable]]] = None, drop: bool = False, inplace: bool = False, col_level: Hashable = 0, col_fill: Optional[Hashable] = "", ) -> Optional["DataFrame"]: """ Reset the index, or a level of it...
[ "def", "reset_index", "(", "self", ",", "level", ":", "Optional", "[", "Union", "[", "Hashable", ",", "Sequence", "[", "Hashable", "]", "]", "]", "=", "None", ",", "drop", ":", "bool", "=", "False", ",", "inplace", ":", "bool", "=", "False", ",", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/frame.py#L4369-L4610
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/math/spline.py
python
hermite_to_bezier
(x1,v1,x2,v2)
return x1,c1,c2,x2
Returns the cubic bezier representation of a hermite curve
Returns the cubic bezier representation of a hermite curve
[ "Returns", "the", "cubic", "bezier", "representation", "of", "a", "hermite", "curve" ]
def hermite_to_bezier(x1,v1,x2,v2): """Returns the cubic bezier representation of a hermite curve""" c1 = vectorops.madd(x1,v1,1.0/3.0) c2 = vectorops.madd(x2,v2,-1.0/3.0) return x1,c1,c2,x2
[ "def", "hermite_to_bezier", "(", "x1", ",", "v1", ",", "x2", ",", "v2", ")", ":", "c1", "=", "vectorops", ".", "madd", "(", "x1", ",", "v1", ",", "1.0", "/", "3.0", ")", "c2", "=", "vectorops", ".", "madd", "(", "x2", ",", "v2", ",", "-", "1....
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/spline.py#L73-L77
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/tool/subtool/acquire_sourcedir.py
python
wanna_convert
()
return answer
Ask the user if assets should be converted.
Ask the user if assets should be converted.
[ "Ask", "the", "user", "if", "assets", "should", "be", "converted", "." ]
def wanna_convert(): """ Ask the user if assets should be converted. """ answer = None while answer is None: print(" Do you want to convert assets? [Y/n]") user_selection = input("> ") if user_selection.lower() in {"yes", "y", ""}: answer = True elif us...
[ "def", "wanna_convert", "(", ")", ":", "answer", "=", "None", "while", "answer", "is", "None", ":", "print", "(", "\" Do you want to convert assets? [Y/n]\"", ")", "user_selection", "=", "input", "(", "\"> \"", ")", "if", "user_selection", ".", "lower", "(", ...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/tool/subtool/acquire_sourcedir.py#L35-L50
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/jinja2/bccache.py
python
Bucket.reset
(self)
Resets the bucket (unloads the bytecode).
Resets the bucket (unloads the bytecode).
[ "Resets", "the", "bucket", "(", "unloads", "the", "bytecode", ")", "." ]
def reset(self): """Resets the bucket (unloads the bytecode).""" self.code = None
[ "def", "reset", "(", "self", ")", ":", "self", ".", "code", "=", "None" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/bccache.py#L75-L77