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
GoSSIP-SJTU/TripleDoggy
03648d6b19c812504b14e8b98c8c7b3f443f4e54
tools/clang/tools/scan-build-py/libscanbuild/arguments.py
python
create_default_parser
()
return parser
Creates command line parser for all build wrapper commands.
Creates command line parser for all build wrapper commands.
[ "Creates", "command", "line", "parser", "for", "all", "build", "wrapper", "commands", "." ]
def create_default_parser(): """ Creates command line parser for all build wrapper commands. """ parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument( '--verbose', '-v', action='count', default=0, help...
[ "def", "create_default_parser", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "formatter_class", "=", "argparse", ".", "ArgumentDefaultsHelpFormatter", ")", "parser", ".", "add_argument", "(", "'--verbose'", ",", "'-v'", ",", "action", "=",...
https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/tools/clang/tools/scan-build-py/libscanbuild/arguments.py#L409-L422
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Variables/__init__.py
python
Variables.__init__
(self, files=None, args=None, is_global=1)
files - [optional] List of option configuration files to load (backward compatibility) If a single string is passed it is automatically placed in a file list
files - [optional] List of option configuration files to load (backward compatibility) If a single string is passed it is automatically placed in a file list
[ "files", "-", "[", "optional", "]", "List", "of", "option", "configuration", "files", "to", "load", "(", "backward", "compatibility", ")", "If", "a", "single", "string", "is", "passed", "it", "is", "automatically", "placed", "in", "a", "file", "list" ]
def __init__(self, files=None, args=None, is_global=1): """ files - [optional] List of option configuration files to load (backward compatibility) If a single string is passed it is automatically placed in a file list """ # initialize argu...
[ "def", "__init__", "(", "self", ",", "files", "=", "None", ",", "args", "=", "None", ",", "is_global", "=", "1", ")", ":", "# initialize arguments", "if", "files", "is", "None", ":", "files", "=", "[", "]", "if", "args", "is", "None", ":", "args", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Variables/__init__.py#L54-L80
sigmaai/self-driving-golf-cart
8d891600af3d851add27a10ae45cf3c2108bb87c
ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/actor.py
python
Actor.publish_transform
(self, ros_transform_msg)
Helper function to send a ROS tf message of this child :return:
Helper function to send a ROS tf message of this child
[ "Helper", "function", "to", "send", "a", "ROS", "tf", "message", "of", "this", "child" ]
def publish_transform(self, ros_transform_msg): """ Helper function to send a ROS tf message of this child :return: """ self.publish_message('tf', ros_transform_msg)
[ "def", "publish_transform", "(", "self", ",", "ros_transform_msg", ")", ":", "self", ".", "publish_message", "(", "'tf'", ",", "ros_transform_msg", ")" ]
https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/actor.py#L116-L122
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py
python
Variable.trace_remove
(self, mode, cbname)
Delete the trace callback for a variable. Mode is one of "read", "write", "unset" or a list or tuple of such strings. Must be same as were specified in trace_add(). cbname is the name of the callback returned from trace_add().
Delete the trace callback for a variable.
[ "Delete", "the", "trace", "callback", "for", "a", "variable", "." ]
def trace_remove(self, mode, cbname): """Delete the trace callback for a variable. Mode is one of "read", "write", "unset" or a list or tuple of such strings. Must be same as were specified in trace_add(). cbname is the name of the callback returned from trace_add(). """ ...
[ "def", "trace_remove", "(", "self", ",", "mode", ",", "cbname", ")", ":", "self", ".", "_tk", ".", "call", "(", "'trace'", ",", "'remove'", ",", "'variable'", ",", "self", ".", "_name", ",", "mode", ",", "cbname", ")", "for", "m", ",", "ca", "in", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L382-L399
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Rect.__iadd__
(*args, **kwargs)
return _core_.Rect___iadd__(*args, **kwargs)
__iadd__(self, Rect rect) -> Rect Add the properties of rect to this rectangle, updating this rectangle.
__iadd__(self, Rect rect) -> Rect
[ "__iadd__", "(", "self", "Rect", "rect", ")", "-", ">", "Rect" ]
def __iadd__(*args, **kwargs): """ __iadd__(self, Rect rect) -> Rect Add the properties of rect to this rectangle, updating this rectangle. """ return _core_.Rect___iadd__(*args, **kwargs)
[ "def", "__iadd__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect___iadd__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L1493-L1499
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/math_grad.py
python
_Log1pGrad
(op, grad)
Returns grad * (1/(1 + x)).
Returns grad * (1/(1 + x)).
[ "Returns", "grad", "*", "(", "1", "/", "(", "1", "+", "x", "))", "." ]
def _Log1pGrad(op, grad): """Returns grad * (1/(1 + x)).""" x = op.inputs[0] with ops.control_dependencies([grad]): x = math_ops.conj(x) return grad * math_ops.reciprocal(1 + x)
[ "def", "_Log1pGrad", "(", "op", ",", "grad", ")", ":", "x", "=", "op", ".", "inputs", "[", "0", "]", "with", "ops", ".", "control_dependencies", "(", "[", "grad", "]", ")", ":", "x", "=", "math_ops", ".", "conj", "(", "x", ")", "return", "grad", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_grad.py#L701-L706
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/docs/doc_controls.py
python
do_not_doc_inheritable
(obj)
return obj
A decorator: Do not generate docs for this method. This version of the decorator is "inherited" by subclasses. No docs will be generated for the decorated method in any subclass. Even if the sub-class overrides the method. For example, to ensure that `method1` is **never documented** use this decorator on t...
A decorator: Do not generate docs for this method.
[ "A", "decorator", ":", "Do", "not", "generate", "docs", "for", "this", "method", "." ]
def do_not_doc_inheritable(obj): """A decorator: Do not generate docs for this method. This version of the decorator is "inherited" by subclasses. No docs will be generated for the decorated method in any subclass. Even if the sub-class overrides the method. For example, to ensure that `method1` is **never ...
[ "def", "do_not_doc_inheritable", "(", "obj", ")", ":", "setattr", "(", "obj", ",", "_DO_NOT_DOC_INHERITABLE", ",", "None", ")", "return", "obj" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/docs/doc_controls.py#L105-L162
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/hmac.py
python
HMAC._current
(self)
return h
Return a hash object for the current state. To be used only internally with digest() and hexdigest().
Return a hash object for the current state.
[ "Return", "a", "hash", "object", "for", "the", "current", "state", "." ]
def _current(self): """Return a hash object for the current state. To be used only internally with digest() and hexdigest(). """ h = self.outer.copy() h.update(self.inner.digest()) return h
[ "def", "_current", "(", "self", ")", ":", "h", "=", "self", ".", "outer", ".", "copy", "(", ")", "h", ".", "update", "(", "self", ".", "inner", ".", "digest", "(", ")", ")", "return", "h" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/hmac.py#L100-L107
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/kernel_methods/python/kernel_estimators.py
python
_update_features_and_columns
(features, feature_columns, kernel_mappers_dict)
return features, feature_columns
Updates features and feature_columns based on provided kernel mappers. Currently supports the update of `RealValuedColumn`s only. Args: features: Initial features dict. The key is a `string` (feature column name) and the value is a tensor. feature_columns: Initial iterable containing all the feature...
Updates features and feature_columns based on provided kernel mappers.
[ "Updates", "features", "and", "feature_columns", "based", "on", "provided", "kernel", "mappers", "." ]
def _update_features_and_columns(features, feature_columns, kernel_mappers_dict): """Updates features and feature_columns based on provided kernel mappers. Currently supports the update of `RealValuedColumn`s only. Args: features: Initial features dict. The key is a `string`...
[ "def", "_update_features_and_columns", "(", "features", ",", "feature_columns", ",", "kernel_mappers_dict", ")", ":", "if", "kernel_mappers_dict", "is", "None", ":", "return", "features", ",", "feature_columns", "# First construct new columns and features affected by kernel_map...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/kernel_methods/python/kernel_estimators.py#L58-L112
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py
python
Listbox.__init__
(self, master=None, cnf={}, **kw)
Construct a listbox widget with the parent MASTER. Valid resource names: background, bd, bg, borderwidth, cursor, exportselection, fg, font, foreground, height, highlightbackground, highlightcolor, highlightthickness, relief, selectbackground, selectborderwidth, selectforeground, select...
Construct a listbox widget with the parent MASTER.
[ "Construct", "a", "listbox", "widget", "with", "the", "parent", "MASTER", "." ]
def __init__(self, master=None, cnf={}, **kw): """Construct a listbox widget with the parent MASTER. Valid resource names: background, bd, bg, borderwidth, cursor, exportselection, fg, font, foreground, height, highlightbackground, highlightcolor, highlightthickness, relief, selectbackg...
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "cnf", "=", "{", "}", ",", "*", "*", "kw", ")", ":", "Widget", ".", "__init__", "(", "self", ",", "master", ",", "'listbox'", ",", "cnf", ",", "kw", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L2770-L2778
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
PyWindow.DoGetVirtualSize
(*args, **kwargs)
return _windows_.PyWindow_DoGetVirtualSize(*args, **kwargs)
DoGetVirtualSize(self) -> Size
DoGetVirtualSize(self) -> Size
[ "DoGetVirtualSize", "(", "self", ")", "-", ">", "Size" ]
def DoGetVirtualSize(*args, **kwargs): """DoGetVirtualSize(self) -> Size""" return _windows_.PyWindow_DoGetVirtualSize(*args, **kwargs)
[ "def", "DoGetVirtualSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PyWindow_DoGetVirtualSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L4174-L4176
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
third-party/benchmark/tools/gbench/util.py
python
is_executable_file
(filename)
Return 'True' if 'filename' names a valid file which is likely an executable. A file is considered an executable if it starts with the magic bytes for a EXE, Mach O, or ELF file.
Return 'True' if 'filename' names a valid file which is likely an executable. A file is considered an executable if it starts with the magic bytes for a EXE, Mach O, or ELF file.
[ "Return", "True", "if", "filename", "names", "a", "valid", "file", "which", "is", "likely", "an", "executable", ".", "A", "file", "is", "considered", "an", "executable", "if", "it", "starts", "with", "the", "magic", "bytes", "for", "a", "EXE", "Mach", "O...
def is_executable_file(filename): """ Return 'True' if 'filename' names a valid file which is likely an executable. A file is considered an executable if it starts with the magic bytes for a EXE, Mach O, or ELF file. """ if not os.path.isfile(filename): return False with open(filenam...
[ "def", "is_executable_file", "(", "filename", ")", ":", "if", "not", "os", ".", "path", ".", "isfile", "(", "filename", ")", ":", "return", "False", "with", "open", "(", "filename", ",", "mode", "=", "'rb'", ")", "as", "f", ":", "magic_bytes", "=", "...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/third-party/benchmark/tools/gbench/util.py#L18-L40
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/multiprocessing/pool.py
python
Pool._map_async
(self, func, iterable, mapper, chunksize=None, callback=None, error_callback=None)
return result
Helper function to implement map, starmap and their async counterparts.
Helper function to implement map, starmap and their async counterparts.
[ "Helper", "function", "to", "implement", "map", "starmap", "and", "their", "async", "counterparts", "." ]
def _map_async(self, func, iterable, mapper, chunksize=None, callback=None, error_callback=None): ''' Helper function to implement map, starmap and their async counterparts. ''' self._check_running() if not hasattr(iterable, '__len__'): iterable = list(ite...
[ "def", "_map_async", "(", "self", ",", "func", ",", "iterable", ",", "mapper", ",", "chunksize", "=", "None", ",", "callback", "=", "None", ",", "error_callback", "=", "None", ")", ":", "self", ".", "_check_running", "(", ")", "if", "not", "hasattr", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/multiprocessing/pool.py#L468-L495
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/multitype_ops/_compile_utils.py
python
_tensor_getitem_by_tuple
(data, tuple_index, op_name)
return result
Tensor getitem by a tuple of mixed tensor.
Tensor getitem by a tuple of mixed tensor.
[ "Tensor", "getitem", "by", "a", "tuple", "of", "mixed", "tensor", "." ]
def _tensor_getitem_by_tuple(data, tuple_index, op_name): """Tensor getitem by a tuple of mixed tensor.""" data_shape = F.shape(data) data_rank = len(data_shape) is_dynamic = -1 in data_shape for item in tuple_index: if isinstance(item, slice): is_dynamic = isinstance(slice_get_i...
[ "def", "_tensor_getitem_by_tuple", "(", "data", ",", "tuple_index", ",", "op_name", ")", ":", "data_shape", "=", "F", ".", "shape", "(", "data", ")", "data_rank", "=", "len", "(", "data_shape", ")", "is_dynamic", "=", "-", "1", "in", "data_shape", "for", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/_compile_utils.py#L549-L621
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/gems.py
python
scan_required_gems_paths
(ctx)
return required_gems
Scan the folder for any required gems :param ctx: Configuration Context
Scan the folder for any required gems
[ "Scan", "the", "folder", "for", "any", "required", "gems" ]
def scan_required_gems_paths(ctx): """ Scan the folder for any required gems :param ctx: Configuration Context """ required_gems = {} def _search_for_gem(base_path, folder): content_path = base_path.make_node(folder) if os.path.exists(os.path.join(content_path.abspath(), GEMS_...
[ "def", "scan_required_gems_paths", "(", "ctx", ")", ":", "required_gems", "=", "{", "}", "def", "_search_for_gem", "(", "base_path", ",", "folder", ")", ":", "content_path", "=", "base_path", ".", "make_node", "(", "folder", ")", "if", "os", ".", "path", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/gems.py#L1176-L1235
mickem/nscp
79f89fdbb6da63f91bc9dedb7aea202fe938f237
scripts/python/lib/google/protobuf/internal/cpp_message.py
python
_AddInitMethod
(message_descriptor, cls)
Adds an __init__ method to cls.
Adds an __init__ method to cls.
[ "Adds", "an", "__init__", "method", "to", "cls", "." ]
def _AddInitMethod(message_descriptor, cls): """Adds an __init__ method to cls.""" # Create and attach message field properties to the message class. # This can be done just once per message class, since property setters and # getters are passed the message instance. # This makes message instantiation extrem...
[ "def", "_AddInitMethod", "(", "message_descriptor", ",", "cls", ")", ":", "# Create and attach message field properties to the message class.", "# This can be done just once per message class, since property setters and", "# getters are passed the message instance.", "# This makes message inst...
https://github.com/mickem/nscp/blob/79f89fdbb6da63f91bc9dedb7aea202fe938f237/scripts/python/lib/google/protobuf/internal/cpp_message.py#L413-L473
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/pytree.py
python
BasePattern.optimize
(self)
return self
A subclass can define this as a hook for optimizations. Returns either self or another node with the same effect.
A subclass can define this as a hook for optimizations.
[ "A", "subclass", "can", "define", "this", "as", "a", "hook", "for", "optimizations", "." ]
def optimize(self): """ A subclass can define this as a hook for optimizations. Returns either self or another node with the same effect. """ return self
[ "def", "optimize", "(", "self", ")", ":", "return", "self" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/pytree.py#L480-L486
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/lib/utils.py
python
deprecate
(*args, **kwargs)
Issues a DeprecationWarning, adds warning to `old_name`'s docstring, rebinds ``old_name.__name__`` and returns the new function object. This function may also be used as a decorator. Parameters ---------- func : function The function to be deprecated. old_name : str, optional ...
Issues a DeprecationWarning, adds warning to `old_name`'s docstring, rebinds ``old_name.__name__`` and returns the new function object.
[ "Issues", "a", "DeprecationWarning", "adds", "warning", "to", "old_name", "s", "docstring", "rebinds", "old_name", ".", "__name__", "and", "returns", "the", "new", "function", "object", "." ]
def deprecate(*args, **kwargs): """ Issues a DeprecationWarning, adds warning to `old_name`'s docstring, rebinds ``old_name.__name__`` and returns the new function object. This function may also be used as a decorator. Parameters ---------- func : function The function to be de...
[ "def", "deprecate", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Deprecate may be run as a function or as a decorator", "# If run as a function, we initialise the decorator class", "# and execute its __call__ method.", "if", "args", ":", "fn", "=", "args", "[", "...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/utils.py#L157-L215
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Configure.py
python
ConfigurationContext.set_env
(self, val)
Setter for the env property
Setter for the env property
[ "Setter", "for", "the", "env", "property" ]
def set_env(self, val): """Setter for the env property""" self.all_envs[self.variant] = val
[ "def", "set_env", "(", "self", ",", "val", ")", ":", "self", ".", "all_envs", "[", "self", ".", "variant", "]", "=", "val" ]
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Configure.py#L90-L92
apache/kudu
90895ce76590f10730ad7aac3613b69d89ff5422
build-support/iwyu/fix_includes.py
python
IWYUOutputRecord.HasContentfulChanges
(self)
return (self.includes_and_forward_declares_to_add or self.lines_to_delete)
Returns true iff this record has at least one add or delete.
Returns true iff this record has at least one add or delete.
[ "Returns", "true", "iff", "this", "record", "has", "at", "least", "one", "add", "or", "delete", "." ]
def HasContentfulChanges(self): """Returns true iff this record has at least one add or delete.""" return (self.includes_and_forward_declares_to_add or self.lines_to_delete)
[ "def", "HasContentfulChanges", "(", "self", ")", ":", "return", "(", "self", ".", "includes_and_forward_declares_to_add", "or", "self", ".", "lines_to_delete", ")" ]
https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/build-support/iwyu/fix_includes.py#L286-L289
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/isis_instrument.py
python
SANS2D.cur_detector_position
(self, ws_name)
return [-pos.getX(), -pos.getY()]
Return the position of the center of the detector bank
Return the position of the center of the detector bank
[ "Return", "the", "position", "of", "the", "center", "of", "the", "detector", "bank" ]
def cur_detector_position(self, ws_name): """Return the position of the center of the detector bank""" ws = mtd[ws_name] pos = ws.getInstrument().getComponentByName(self.cur_detector().name()).getPos() return [-pos.getX(), -pos.getY()]
[ "def", "cur_detector_position", "(", "self", ",", "ws_name", ")", ":", "ws", "=", "mtd", "[", "ws_name", "]", "pos", "=", "ws", ".", "getInstrument", "(", ")", ".", "getComponentByName", "(", "self", ".", "cur_detector", "(", ")", ".", "name", "(", ")"...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_instrument.py#L1430-L1435
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
ScrollHelper.SetTargetRect
(*args, **kwargs)
return _windows_.ScrollHelper_SetTargetRect(*args, **kwargs)
SetTargetRect(self, Rect rect)
SetTargetRect(self, Rect rect)
[ "SetTargetRect", "(", "self", "Rect", "rect", ")" ]
def SetTargetRect(*args, **kwargs): """SetTargetRect(self, Rect rect)""" return _windows_.ScrollHelper_SetTargetRect(*args, **kwargs)
[ "def", "SetTargetRect", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "ScrollHelper_SetTargetRect", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L249-L251
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/config/configobj.py
python
ConfigObj._str
(self, value)
Used by ``stringify`` within validate, to turn non-string values into strings.
Used by ``stringify`` within validate, to turn non-string values into strings.
[ "Used", "by", "stringify", "within", "validate", "to", "turn", "non", "-", "string", "values", "into", "strings", "." ]
def _str(self, value): """ Used by ``stringify`` within validate, to turn non-string values into strings. """ if not isinstance(value, StringTypes): return str(value) else: return value
[ "def", "_str", "(", "self", ",", "value", ")", ":", "if", "not", "isinstance", "(", "value", ",", "StringTypes", ")", ":", "return", "str", "(", "value", ")", "else", ":", "return", "value" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/config/configobj.py#L1400-L1408
kismetwireless/kismet
a7c0dc270c960fb1f58bd9cec4601c201885fd4e
capture_sdr_rtladsb/KismetCaptureRtladsb/kismetexternal/__init__.py
python
ExternalInterface.start
(self)
return 0
Shim around async await
Shim around async await
[ "Shim", "around", "async", "await" ]
def start(self): """ Shim around async await """ try: self.loop.run_until_complete(self.__asyncio_connect()) except RuntimeError: print("Failed to connect to remote host, exiting.") return -1 return 0
[ "def", "start", "(", "self", ")", ":", "try", ":", "self", ".", "loop", ".", "run_until_complete", "(", "self", ".", "__asyncio_connect", "(", ")", ")", "except", "RuntimeError", ":", "print", "(", "\"Failed to connect to remote host, exiting.\"", ")", "return",...
https://github.com/kismetwireless/kismet/blob/a7c0dc270c960fb1f58bd9cec4601c201885fd4e/capture_sdr_rtladsb/KismetCaptureRtladsb/kismetexternal/__init__.py#L398-L409
CanalTP/navitia
cb84ce9859070187e708818b058e6a7e0b7f891b
source/jormungandr/jormungandr/interfaces/v1/swagger_schema.py
python
_from_nested_schema
(field)
return schema, field
return reference and a list of nested definitions from a Serializer or schema depending on param onlyRef
return reference and a list of nested definitions from a Serializer or schema depending on param onlyRef
[ "return", "reference", "and", "a", "list", "of", "nested", "definitions", "from", "a", "Serializer", "or", "schema", "depending", "on", "param", "onlyRef" ]
def _from_nested_schema(field): """ return reference and a list of nested definitions from a Serializer or schema depending on param onlyRef """ schema = {'$ref': '#/definitions/' + get_serializer_name(field)} return schema, field
[ "def", "_from_nested_schema", "(", "field", ")", ":", "schema", "=", "{", "'$ref'", ":", "'#/definitions/'", "+", "get_serializer_name", "(", "field", ")", "}", "return", "schema", ",", "field" ]
https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/jormungandr/jormungandr/interfaces/v1/swagger_schema.py#L187-L194
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/gslib/commands/perfdiag.py
python
PerfDiagCommand._Time
(self, key, bucket)
A context manager that measures time. A context manager that prints a status message before and after executing the inner command and times how long the inner command takes. Keeps track of the timing, aggregated by the given key. Args: key: The key to insert the timing value into a dictionary bu...
A context manager that measures time.
[ "A", "context", "manager", "that", "measures", "time", "." ]
def _Time(self, key, bucket): """A context manager that measures time. A context manager that prints a status message before and after executing the inner command and times how long the inner command takes. Keeps track of the timing, aggregated by the given key. Args: key: The key to insert ...
[ "def", "_Time", "(", "self", ",", "key", ",", "bucket", ")", ":", "self", ".", "logger", ".", "info", "(", "'%s starting...'", ",", "key", ")", "t0", "=", "time", ".", "time", "(", ")", "yield", "t1", "=", "time", ".", "time", "(", ")", "bucket",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/commands/perfdiag.py#L621-L640
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/client/session.py
python
_ElementFetchMapper.__init__
(self, fetches, contraction_fn)
Creates an _ElementFetchMapper. This is the fetch mapper used for leaves in the fetch struct. Because of the expansions mechanism, a leaf can actually fetch more than one tensor. Also note that the fetches here can be just strings (tensor or op names) or any other object that the graph knows how to c...
Creates an _ElementFetchMapper.
[ "Creates", "an", "_ElementFetchMapper", "." ]
def __init__(self, fetches, contraction_fn): """Creates an _ElementFetchMapper. This is the fetch mapper used for leaves in the fetch struct. Because of the expansions mechanism, a leaf can actually fetch more than one tensor. Also note that the fetches here can be just strings (tensor or op names) o...
[ "def", "__init__", "(", "self", ",", "fetches", ",", "contraction_fn", ")", ":", "self", ".", "_unique_fetches", "=", "[", "]", "for", "fetch", "in", "fetches", ":", "try", ":", "self", ".", "_unique_fetches", ".", "append", "(", "ops", ".", "get_default...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/client/session.py#L250-L281
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/dom/pulldom.py
python
PullDOM.clear
(self)
clear(): Explicitly release parsing structures
clear(): Explicitly release parsing structures
[ "clear", "()", ":", "Explicitly", "release", "parsing", "structures" ]
def clear(self): "clear(): Explicitly release parsing structures" self.document = None
[ "def", "clear", "(", "self", ")", ":", "self", ".", "document", "=", "None" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/dom/pulldom.py#L192-L194
dartsim/dart
495c82120c836005f2d136d4a50c8cc997fb879b
tools/cpplint.py
python
CheckAccess
(filename, clean_lines, linenum, nesting_state, error)
Checks for improper use of DISALLOW* 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. nesting_state: A _NestingState instance which maintains information about the current stac...
Checks for improper use of DISALLOW* macros.
[ "Checks", "for", "improper", "use", "of", "DISALLOW", "*", "macros", "." ]
def CheckAccess(filename, clean_lines, linenum, nesting_state, error): """Checks for improper use of DISALLOW* 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. nesting_state: A _NestingState in...
[ "def", "CheckAccess", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# get rid of comments and strings", "matched", "=", "Match", "(", "(", "r'...
https://github.com/dartsim/dart/blob/495c82120c836005f2d136d4a50c8cc997fb879b/tools/cpplint.py#L2365-L2393
shogun-toolbox/shogun
9b8d856971af5a295dd6ad70623ae45647a6334c
examples/meta/generator/parse.py
python
FastParser.p_assignment
(self, p)
assignment : identifier EQUALS expr | elementAccess EQUALS expr
assignment : identifier EQUALS expr | elementAccess EQUALS expr
[ "assignment", ":", "identifier", "EQUALS", "expr", "|", "elementAccess", "EQUALS", "expr" ]
def p_assignment(self, p): """ assignment : identifier EQUALS expr | elementAccess EQUALS expr """ p[0] = {"Assign": [p[1], p[3]]}
[ "def", "p_assignment", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "{", "\"Assign\"", ":", "[", "p", "[", "1", "]", ",", "p", "[", "3", "]", "]", "}" ]
https://github.com/shogun-toolbox/shogun/blob/9b8d856971af5a295dd6ad70623ae45647a6334c/examples/meta/generator/parse.py#L297-L302
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/logging/handlers.py
python
BaseRotatingHandler.emit
(self, record)
Emit a record. Output the record to the file, catering for rollover as described in doRollover().
Emit a record.
[ "Emit", "a", "record", "." ]
def emit(self, record): """ Emit a record. Output the record to the file, catering for rollover as described in doRollover(). """ try: if self.shouldRollover(record): self.doRollover() logging.FileHandler.emit(self, record) ...
[ "def", "emit", "(", "self", ",", "record", ")", ":", "try", ":", "if", "self", ".", "shouldRollover", "(", "record", ")", ":", "self", ".", "doRollover", "(", ")", "logging", ".", "FileHandler", ".", "emit", "(", "self", ",", "record", ")", "except",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/logging/handlers.py#L68-L82
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
python/gtsam/utils/plot.py
python
ellipsoid
(rx: float, ry: float, rz: float, n: int)
return x, y, z
Numpy equivalent of Matlab's ellipsoid function. Args: rx: Radius of ellipsoid in X-axis. ry: Radius of ellipsoid in Y-axis. rz: Radius of ellipsoid in Z-axis. n: The granularity of the ellipsoid plotted. Returns: The points in the x, y and z axes to use for the surface...
Numpy equivalent of Matlab's ellipsoid function.
[ "Numpy", "equivalent", "of", "Matlab", "s", "ellipsoid", "function", "." ]
def ellipsoid(rx: float, ry: float, rz: float, n: int) -> Tuple[np.ndarray, np.ndarray, np.ndarray]: """ Numpy equivalent of Matlab's ellipsoid function. Args: rx: Radius of ellipsoid in X-axis. ry: Radius of ellipsoid in Y-axis. rz: Radius of ellipsoid in Z-axis. ...
[ "def", "ellipsoid", "(", "rx", ":", "float", ",", "ry", ":", "float", ",", "rz", ":", "float", ",", "n", ":", "int", ")", "->", "Tuple", "[", "np", ".", "ndarray", ",", "np", ".", "ndarray", ",", "np", ".", "ndarray", "]", ":", "u", "=", "np"...
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/python/gtsam/utils/plot.py#L52-L72
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/pyserial/serial/urlhandler/protocol_socket.py
python
Serial.cts
(self)
return True
Read terminal status line: Clear To Send
Read terminal status line: Clear To Send
[ "Read", "terminal", "status", "line", ":", "Clear", "To", "Send" ]
def cts(self): """Read terminal status line: Clear To Send""" if not self.is_open: raise portNotOpenError if self.logger: self.logger.info('returning dummy for cts') return True
[ "def", "cts", "(", "self", ")", ":", "if", "not", "self", ".", "is_open", ":", "raise", "portNotOpenError", "if", "self", ".", "logger", ":", "self", ".", "logger", ".", "info", "(", "'returning dummy for cts'", ")", "return", "True" ]
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/urlhandler/protocol_socket.py#L301-L307
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/computation/parsing.py
python
clean_backtick_quoted_toks
(tok: tuple[int, str])
return toknum, tokval
Clean up a column name if surrounded by backticks. Backtick quoted string are indicated by a certain tokval value. If a string is a backtick quoted token it will processed by :func:`_create_valid_python_identifier` so that the parser can find this string when the query is executed. In this case the...
Clean up a column name if surrounded by backticks.
[ "Clean", "up", "a", "column", "name", "if", "surrounded", "by", "backticks", "." ]
def clean_backtick_quoted_toks(tok: tuple[int, str]) -> tuple[int, str]: """ Clean up a column name if surrounded by backticks. Backtick quoted string are indicated by a certain tokval value. If a string is a backtick quoted token it will processed by :func:`_create_valid_python_identifier` so that...
[ "def", "clean_backtick_quoted_toks", "(", "tok", ":", "tuple", "[", "int", ",", "str", "]", ")", "->", "tuple", "[", "int", ",", "str", "]", ":", "toknum", ",", "tokval", "=", "tok", "if", "toknum", "==", "BACKTICK_QUOTED_STRING", ":", "return", "tokeniz...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/computation/parsing.py#L69-L92
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/procrouting/solvent/efp.py
python
modify_Fock_induced
(efpobj, mints, verbose=1)
return V_ind
Returns shared matrix containing the EFP contribution to the potential felt by QM atoms due to EFP induced dipoles. Used in SCF procedure. Parameters ---------- efpobj : :py:class:`pylibefp.core.efp` Source of EFP induced dipole information. mints : `psi4.core.MintsHelper` Integral ...
Returns shared matrix containing the EFP contribution to the potential felt by QM atoms due to EFP induced dipoles. Used in SCF procedure.
[ "Returns", "shared", "matrix", "containing", "the", "EFP", "contribution", "to", "the", "potential", "felt", "by", "QM", "atoms", "due", "to", "EFP", "induced", "dipoles", ".", "Used", "in", "SCF", "procedure", "." ]
def modify_Fock_induced(efpobj, mints, verbose=1): """Returns shared matrix containing the EFP contribution to the potential felt by QM atoms due to EFP induced dipoles. Used in SCF procedure. Parameters ---------- efpobj : :py:class:`pylibefp.core.efp` Source of EFP induced dipole informat...
[ "def", "modify_Fock_induced", "(", "efpobj", ",", "mints", ",", "verbose", "=", "1", ")", ":", "# get induced dipoles count, pos'n, values from libefp", "# dipoles = 3", "nid", "=", "efpobj", ".", "get_induced_dipole_count", "(", ")", "xyz_id", "=", "np", ".", "as...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/solvent/efp.py#L135-L168
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/layers/python/layers/initializers.py
python
xavier_initializer
(uniform=True, seed=None, dtype=dtypes.float32)
return variance_scaling_initializer(factor=1.0, mode='FAN_AVG', uniform=uniform, seed=seed, dtype=dtype)
Returns an initializer performing "Xavier" initialization for weights. This function implements the weight initialization from: Xavier Glorot and Yoshua Bengio (2010): Understanding the difficulty of training deep feedforward neural networks. International conference on artificial intelligen...
Returns an initializer performing "Xavier" initialization for weights.
[ "Returns", "an", "initializer", "performing", "Xavier", "initialization", "for", "weights", "." ]
def xavier_initializer(uniform=True, seed=None, dtype=dtypes.float32): """Returns an initializer performing "Xavier" initialization for weights. This function implements the weight initialization from: Xavier Glorot and Yoshua Bengio (2010): Understanding the difficulty of training deep feedforward n...
[ "def", "xavier_initializer", "(", "uniform", "=", "True", ",", "seed", "=", "None", ",", "dtype", "=", "dtypes", ".", "float32", ")", ":", "return", "variance_scaling_initializer", "(", "factor", "=", "1.0", ",", "mode", "=", "'FAN_AVG'", ",", "uniform", "...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/layers/python/layers/initializers.py#L31-L57
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py
python
safe_version
(version)
Convert an arbitrary string to a standard version string
[]
def safe_version(version): """ Convert an arbitrary string to a standard version string """ try: # normalize the version return str(packaging.version.Version(version)) except packaging.version.InvalidVersion: version = version.replace(' ', '.') return re.sub(...
[ "def", "safe_version", "(", "version", ")", ":", "try", ":", "# normalize the version", "return", "str", "(", "packaging", ".", "version", ".", "Version", "(", "version", ")", ")", "except", "packaging", ".", "version", ".", "InvalidVersion", ":", "version", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L2649-L2667
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/framework/ops.py
python
IndexedSlices.values
(self)
return self._values
A `Tensor` containing the values of the slices.
A `Tensor` containing the values of the slices.
[ "A", "Tensor", "containing", "the", "values", "of", "the", "slices", "." ]
def values(self): """A `Tensor` containing the values of the slices.""" return self._values
[ "def", "values", "(", "self", ")", ":", "return", "self", ".", "_values" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/ops.py#L994-L996
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py
python
fix_w602
(source, aggressive=True)
return refactor(source, ['raise'], ignore='with_traceback')
Fix deprecated form of raising exception.
Fix deprecated form of raising exception.
[ "Fix", "deprecated", "form", "of", "raising", "exception", "." ]
def fix_w602(source, aggressive=True): """Fix deprecated form of raising exception.""" if not aggressive: return source return refactor(source, ['raise'], ignore='with_traceback')
[ "def", "fix_w602", "(", "source", ",", "aggressive", "=", "True", ")", ":", "if", "not", "aggressive", ":", "return", "source", "return", "refactor", "(", "source", ",", "[", "'raise'", "]", ",", "ignore", "=", "'with_traceback'", ")" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py#L1231-L1237
ufal/udpipe
e51f02d2744cdfd4a29efc1320644ea04d535f0b
doc/t2t_docsys/txt2tags.py
python
ConfigMaster.add
(self, key, val)
Adds the key:value pair to the config dictionary (if needed)
Adds the key:value pair to the config dictionary (if needed)
[ "Adds", "the", "key", ":", "value", "pair", "to", "the", "config", "dictionary", "(", "if", "needed", ")" ]
def add(self, key, val): "Adds the key:value pair to the config dictionary (if needed)" # %!options if key == 'options': ignoreme = list(self.dft_actions.keys()) + ['target'] ignoreme.remove('dump-config') ignoreme.remove('dump-source') ignoreme.remove('targets') raw_opts = CommandLine().get_raw_co...
[ "def", "add", "(", "self", ",", "key", ",", "val", ")", ":", "# %!options", "if", "key", "==", "'options'", ":", "ignoreme", "=", "list", "(", "self", ".", "dft_actions", ".", "keys", "(", ")", ")", "+", "[", "'target'", "]", "ignoreme", ".", "remo...
https://github.com/ufal/udpipe/blob/e51f02d2744cdfd4a29efc1320644ea04d535f0b/doc/t2t_docsys/txt2tags.py#L2753-L2798
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/xcodeproj_file.py
python
XCObject.UpdateProperties
(self, properties, do_copy=False)
Merge the supplied properties into the _properties dictionary. The input properties must adhere to the class schema or a KeyError or TypeError exception will be raised. If adding an object of an XCObject subclass and the schema indicates a strong relationship, the object's parent will be set to this o...
Merge the supplied properties into the _properties dictionary.
[ "Merge", "the", "supplied", "properties", "into", "the", "_properties", "dictionary", "." ]
def UpdateProperties(self, properties, do_copy=False): """Merge the supplied properties into the _properties dictionary. The input properties must adhere to the class schema or a KeyError or TypeError exception will be raised. If adding an object of an XCObject subclass and the schema indicates a stro...
[ "def", "UpdateProperties", "(", "self", ",", "properties", ",", "do_copy", "=", "False", ")", ":", "if", "properties", "is", "None", ":", "return", "for", "property", ",", "value", "in", "properties", ".", "iteritems", "(", ")", ":", "# Make sure the propert...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/xcodeproj_file.py#L740-L820
PX4/PX4-Autopilot
0b9f60a0370be53d683352c63fd92db3d6586e18
platforms/nuttx/NuttX/tools/kconfiglib.py
python
Kconfig.enable_undef_warnings
(self)
Enables warnings for assignments to undefined symbols. Disabled by default unless the KCONFIG_WARN_UNDEF_ASSIGN environment variable was set to 'y' when the Kconfig instance was created.
Enables warnings for assignments to undefined symbols. Disabled by default unless the KCONFIG_WARN_UNDEF_ASSIGN environment variable was set to 'y' when the Kconfig instance was created.
[ "Enables", "warnings", "for", "assignments", "to", "undefined", "symbols", ".", "Disabled", "by", "default", "unless", "the", "KCONFIG_WARN_UNDEF_ASSIGN", "environment", "variable", "was", "set", "to", "y", "when", "the", "Kconfig", "instance", "was", "created", "...
def enable_undef_warnings(self): """ Enables warnings for assignments to undefined symbols. Disabled by default unless the KCONFIG_WARN_UNDEF_ASSIGN environment variable was set to 'y' when the Kconfig instance was created. """ self._warn_for_undef_assign = True
[ "def", "enable_undef_warnings", "(", "self", ")", ":", "self", ".", "_warn_for_undef_assign", "=", "True" ]
https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/platforms/nuttx/NuttX/tools/kconfiglib.py#L1735-L1741
msitt/blpapi-python
bebcf43668c9e5f5467b1f685f9baebbfc45bc87
src/blpapi/sessionoptions.py
python
TlsOptions.setCrlFetchTimeoutMs
(self, timeoutMs)
Args: timeoutMs (int): Timeout threshold in milliseconds Set the CRL fetch timeout to the specified ``timeoutMs``. The default is ``20,000`` milliseconds. The TLS handshake timeout will be set to the default if the specified ``timeoutMs`` is not positive.
Args: timeoutMs (int): Timeout threshold in milliseconds
[ "Args", ":", "timeoutMs", "(", "int", ")", ":", "Timeout", "threshold", "in", "milliseconds" ]
def setCrlFetchTimeoutMs(self, timeoutMs): """ Args: timeoutMs (int): Timeout threshold in milliseconds Set the CRL fetch timeout to the specified ``timeoutMs``. The default is ``20,000`` milliseconds. The TLS handshake timeout will be set to the default if the spec...
[ "def", "setCrlFetchTimeoutMs", "(", "self", ",", "timeoutMs", ")", ":", "internals", ".", "blpapi_TlsOptions_setCrlFetchTimeoutMs", "(", "self", ".", "__handle", ",", "timeoutMs", ")" ]
https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/sessionoptions.py#L814-L824
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py
python
MaskedArray.__div__
(self, other)
return divide(self, other)
Divide other into self, and return a new masked array.
Divide other into self, and return a new masked array.
[ "Divide", "other", "into", "self", "and", "return", "a", "new", "masked", "array", "." ]
def __div__(self, other): "Divide other into self, and return a new masked array." return divide(self, other)
[ "def", "__div__", "(", "self", ",", "other", ")", ":", "return", "divide", "(", "self", ",", "other", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L3713-L3715
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/handler.py
python
ContentHandler.setDocumentLocator
(self, locator)
Called by the parser to give the application a locator for locating the origin of document events. SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before ...
Called by the parser to give the application a locator for locating the origin of document events.
[ "Called", "by", "the", "parser", "to", "give", "the", "application", "a", "locator", "for", "locating", "the", "origin", "of", "document", "events", "." ]
def setDocumentLocator(self, locator): """Called by the parser to give the application a locator for locating the origin of document events. SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the...
[ "def", "setDocumentLocator", "(", "self", ",", "locator", ")", ":", "self", ".", "_locator", "=", "locator" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/handler.py#L57-L78
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/parsing_ops.py
python
_parse_single_example_raw
(serialized, names=None, sparse_keys=None, sparse_types=None, dense_keys=None, dense_types=None, dense_defaults=None, ...
Parses a single `Example` proto. Args: serialized: A scalar string Tensor, a single serialized Example. See `_parse_example_raw` documentation for more details. names: (Optional) A scalar string Tensor, the associated name. See `_parse_example_raw` documentation for more details. sparse_keys:...
Parses a single `Example` proto.
[ "Parses", "a", "single", "Example", "proto", "." ]
def _parse_single_example_raw(serialized, names=None, sparse_keys=None, sparse_types=None, dense_keys=None, dense_types=None, dense_defaults...
[ "def", "_parse_single_example_raw", "(", "serialized", ",", "names", "=", "None", ",", "sparse_keys", "=", "None", ",", "sparse_types", "=", "None", ",", "dense_keys", "=", "None", ",", "dense_types", "=", "None", ",", "dense_defaults", "=", "None", ",", "de...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/parsing_ops.py#L1075-L1160
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py
python
NDFrame.get
(self, key, default=None)
Get item from object for given key (ex: DataFrame column). Returns default value if not found. Parameters ---------- key : object Returns ------- value : same type as items contained in object
Get item from object for given key (ex: DataFrame column).
[ "Get", "item", "from", "object", "for", "given", "key", "(", "ex", ":", "DataFrame", "column", ")", "." ]
def get(self, key, default=None): """ Get item from object for given key (ex: DataFrame column). Returns default value if not found. Parameters ---------- key : object Returns ------- value : same type as items contained in object """ ...
[ "def", "get", "(", "self", ",", "key", ",", "default", "=", "None", ")", ":", "try", ":", "return", "self", "[", "key", "]", "except", "(", "KeyError", ",", "ValueError", ",", "IndexError", ")", ":", "return", "default" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py#L3770-L3787
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Rect.ContainsRect
(*args, **kwargs)
return _core_.Rect_ContainsRect(*args, **kwargs)
ContainsRect(self, Rect rect) -> bool Returns ``True`` if the given rectangle is completely inside this rectangle or touches its boundary.
ContainsRect(self, Rect rect) -> bool
[ "ContainsRect", "(", "self", "Rect", "rect", ")", "-", ">", "bool" ]
def ContainsRect(*args, **kwargs): """ ContainsRect(self, Rect rect) -> bool Returns ``True`` if the given rectangle is completely inside this rectangle or touches its boundary. """ return _core_.Rect_ContainsRect(*args, **kwargs)
[ "def", "ContainsRect", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect_ContainsRect", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L1517-L1524
nasa/meshNetwork
ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c
python/mesh/generic/cmdProcessor.py
python
updateNodeMsgRcvdStatus
(nodeStatus, header, clock)
Updates the time of the last message received directly from a given node. Also sets presence flag to true if this is the first message from a node. Args: nodeStatus: NodeStatus instance. clock: Formation clock.
Updates the time of the last message received directly from a given node. Also sets presence flag to true if this is the first message from a node. Args: nodeStatus: NodeStatus instance. clock: Formation clock.
[ "Updates", "the", "time", "of", "the", "last", "message", "received", "directly", "from", "a", "given", "node", ".", "Also", "sets", "presence", "flag", "to", "true", "if", "this", "is", "the", "first", "message", "from", "a", "node", ".", "Args", ":", ...
def updateNodeMsgRcvdStatus(nodeStatus, header, clock): """Updates the time of the last message received directly from a given node. Also sets presence flag to true if this is the first message from a node. Args: nodeStatus: NodeStatus instance. clock: Formation clock. """ ...
[ "def", "updateNodeMsgRcvdStatus", "(", "nodeStatus", ",", "header", ",", "clock", ")", ":", "if", "'sourceId'", "in", "header", "and", "'cmdId'", "in", "header", ":", "if", "header", "[", "'cmdId'", "]", "not", "in", "cmdsToRelay", ":", "# relayed commands wil...
https://github.com/nasa/meshNetwork/blob/ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c/python/mesh/generic/cmdProcessor.py#L40-L54
raspberrypi/tools
13474ee775d0c5ec8a7da4fb0a9fa84187abfc87
arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/share/gdb/python/gdb/command/pretty_printers.py
python
count_all_enabled_printers
()
return (enabled_count, total_count)
Return a 2-tuble of the enabled state and total number of all printers. This includes subprinters.
Return a 2-tuble of the enabled state and total number of all printers. This includes subprinters.
[ "Return", "a", "2", "-", "tuble", "of", "the", "enabled", "state", "and", "total", "number", "of", "all", "printers", ".", "This", "includes", "subprinters", "." ]
def count_all_enabled_printers(): """Return a 2-tuble of the enabled state and total number of all printers. This includes subprinters. """ enabled_count = 0 total_count = 0 (t_enabled, t_total) = count_enabled_printers(gdb.pretty_printers) enabled_count += t_enabled total_count += t_tot...
[ "def", "count_all_enabled_printers", "(", ")", ":", "enabled_count", "=", "0", "total_count", "=", "0", "(", "t_enabled", ",", "t_total", ")", "=", "count_enabled_printers", "(", "gdb", ".", "pretty_printers", ")", "enabled_count", "+=", "t_enabled", "total_count"...
https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/share/gdb/python/gdb/command/pretty_printers.py#L186-L202
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/telnetlib.py
python
Telnet.write
(self, buffer)
Write a string to the socket, doubling any IAC characters. Can block if the connection is blocked. May raise socket.error if the connection is closed.
Write a string to the socket, doubling any IAC characters.
[ "Write", "a", "string", "to", "the", "socket", "doubling", "any", "IAC", "characters", "." ]
def write(self, buffer): """Write a string to the socket, doubling any IAC characters. Can block if the connection is blocked. May raise socket.error if the connection is closed. """ if IAC in buffer: buffer = buffer.replace(IAC, IAC+IAC) self.msg("send %r"...
[ "def", "write", "(", "self", ",", "buffer", ")", ":", "if", "IAC", "in", "buffer", ":", "buffer", "=", "buffer", ".", "replace", "(", "IAC", ",", "IAC", "+", "IAC", ")", "self", ".", "msg", "(", "\"send %r\"", ",", "buffer", ")", "self", ".", "so...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/telnetlib.py#L270-L280
google/filament
d21f092645b8e1e312307cbf89f1484891347c63
third_party/spirv-tools/utils/generate_grammar_tables.py
python
generate_extension_arrays
(extensions)
return '\n'.join(arrays)
Returns the arrays of extensions. Arguments: - caps: a sequence of sequence of extension names
Returns the arrays of extensions.
[ "Returns", "the", "arrays", "of", "extensions", "." ]
def generate_extension_arrays(extensions): """Returns the arrays of extensions. Arguments: - caps: a sequence of sequence of extension names """ extensions = sorted(set([tuple(e) for e in extensions if e])) arrays = [ 'static const spvtools::Extension {}[] = {};'.format( g...
[ "def", "generate_extension_arrays", "(", "extensions", ")", ":", "extensions", "=", "sorted", "(", "set", "(", "[", "tuple", "(", "e", ")", "for", "e", "in", "extensions", "if", "e", "]", ")", ")", "arrays", "=", "[", "'static const spvtools::Extension {}[] ...
https://github.com/google/filament/blob/d21f092645b8e1e312307cbf89f1484891347c63/third_party/spirv-tools/utils/generate_grammar_tables.py#L135-L146
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Inelastic/Direct/PropertiesDescriptors.py
python
mon2NormalizationEnergyRange.__set__
(self, instance, val)
set detector calibration file using various formats
set detector calibration file using various formats
[ "set", "detector", "calibration", "file", "using", "various", "formats" ]
def __set__(self, instance, val): """ set detector calibration file using various formats """ if isinstance(val, list): self._relative_range = self._check_range(val, instance) elif isinstance(val, str): val = self._parce_string2list(val) self.__set__(instance,...
[ "def", "__set__", "(", "self", ",", "instance", ",", "val", ")", ":", "if", "isinstance", "(", "val", ",", "list", ")", ":", "self", ".", "_relative_range", "=", "self", ".", "_check_range", "(", "val", ",", "instance", ")", "elif", "isinstance", "(", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/Direct/PropertiesDescriptors.py#L618-L627
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_6_0_0.py
python
MiroInterpreter.do_rm
(self, line)
rm <name> -- Removes an item by name in the feed/playlist selected.
rm <name> -- Removes an item by name in the feed/playlist selected.
[ "rm", "<name", ">", "--", "Removes", "an", "item", "by", "name", "in", "the", "feed", "/", "playlist", "selected", "." ]
def do_rm(self, line): """rm <name> -- Removes an item by name in the feed/playlist selected. """ if self.selection_type is None: print "Error: No feed/playlist selected." return item = self._find_item(line) if item is None: print "No item name...
[ "def", "do_rm", "(", "self", ",", "line", ")", ":", "if", "self", ".", "selection_type", "is", "None", ":", "print", "\"Error: No feed/playlist selected.\"", "return", "item", "=", "self", ".", "_find_item", "(", "line", ")", "if", "item", "is", "None", ":...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_6_0_0.py#L760-L773
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/utils/temp_dir.py
python
AdjacentTempDirectory._generate_names
(cls, name)
Generates a series of temporary names. The algorithm replaces the leading characters in the name with ones that are valid filesystem characters, but are not valid package names (for both Python and pip definitions of package).
Generates a series of temporary names.
[ "Generates", "a", "series", "of", "temporary", "names", "." ]
def _generate_names(cls, name): # type: (str) -> Iterator[str] """Generates a series of temporary names. The algorithm replaces the leading characters in the name with ones that are valid filesystem characters, but are not valid package names (for both Python and pip definitions...
[ "def", "_generate_names", "(", "cls", ",", "name", ")", ":", "# type: (str) -> Iterator[str]", "for", "i", "in", "range", "(", "1", ",", "len", "(", "name", ")", ")", ":", "for", "candidate", "in", "itertools", ".", "combinations_with_replacement", "(", "cls...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/utils/temp_dir.py#L237-L259
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/contrib/regular_languages/compiler.py
python
compile
(expression, escape_funcs=None, unescape_funcs=None)
return _compile_from_parse_tree( parse_regex(tokenize_regex(expression)), escape_funcs=escape_funcs, unescape_funcs=unescape_funcs)
Compile grammar (given as regex string), returning a `CompiledGrammar` instance.
Compile grammar (given as regex string), returning a `CompiledGrammar` instance.
[ "Compile", "grammar", "(", "given", "as", "regex", "string", ")", "returning", "a", "CompiledGrammar", "instance", "." ]
def compile(expression, escape_funcs=None, unescape_funcs=None): """ Compile grammar (given as regex string), returning a `CompiledGrammar` instance. """ return _compile_from_parse_tree( parse_regex(tokenize_regex(expression)), escape_funcs=escape_funcs, unescape_funcs=unesca...
[ "def", "compile", "(", "expression", ",", "escape_funcs", "=", "None", ",", "unescape_funcs", "=", "None", ")", ":", "return", "_compile_from_parse_tree", "(", "parse_regex", "(", "tokenize_regex", "(", "expression", ")", ")", ",", "escape_funcs", "=", "escape_f...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/contrib/regular_languages/compiler.py#L392-L400
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/_lsq/common.py
python
right_multiply
(J, d, copy=True)
return J
Compute J diag(d). If `copy` is False, `J` is modified in place (unless being LinearOperator).
Compute J diag(d). If `copy` is False, `J` is modified in place (unless being LinearOperator).
[ "Compute", "J", "diag", "(", "d", ")", ".", "If", "copy", "is", "False", "J", "is", "modified", "in", "place", "(", "unless", "being", "LinearOperator", ")", "." ]
def right_multiply(J, d, copy=True): """Compute J diag(d). If `copy` is False, `J` is modified in place (unless being LinearOperator). """ if copy and not isinstance(J, LinearOperator): J = J.copy() if issparse(J): J.data *= d.take(J.indices, mode='clip') # scikit-learn recipe...
[ "def", "right_multiply", "(", "J", ",", "d", ",", "copy", "=", "True", ")", ":", "if", "copy", "and", "not", "isinstance", "(", "J", ",", "LinearOperator", ")", ":", "J", "=", "J", ".", "copy", "(", ")", "if", "issparse", "(", "J", ")", ":", "J...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_lsq/common.py#L673-L688
ConfettiFX/The-Forge
da36bb40f6ea11df76167f528032c52999912d82
Common_3/Tools/ForgeShadingLanguage/compilers.py
python
gles
(src, dst)
return status
prepend glsl directives
prepend glsl directives
[ "prepend", "glsl", "directives" ]
def gles(src, dst): print('--> compiling GLES using (glslangValidator) {}'.format(src)) bin = get_compiler_from_env(*_config[Languages.GLES]) ''' prepend glsl directives ''' params = [src, '-I'+fsl_basepath] if '.frag' in src: params += ['-S', 'frag'] if '.vert' in src: par...
[ "def", "gles", "(", "src", ",", "dst", ")", ":", "print", "(", "'--> compiling GLES using (glslangValidator) {}'", ".", "format", "(", "src", ")", ")", "bin", "=", "get_compiler_from_env", "(", "*", "_config", "[", "Languages", ".", "GLES", "]", ")", "params...
https://github.com/ConfettiFX/The-Forge/blob/da36bb40f6ea11df76167f528032c52999912d82/Common_3/Tools/ForgeShadingLanguage/compilers.py#L254-L276
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/bisect.py
python
bisect_left
(a, x, lo=0, hi=None)
return lo
Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e < x, and all e in a[i:] have e >= x. So if x already appears in the list, a.insert(x) will insert just before the leftmost x already there. Optional args lo (default 0) and h...
Return the index where to insert item x in list a, assuming a is sorted.
[ "Return", "the", "index", "where", "to", "insert", "item", "x", "in", "list", "a", "assuming", "a", "is", "sorted", "." ]
def bisect_left(a, x, lo=0, hi=None): """Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e < x, and all e in a[i:] have e >= x. So if x already appears in the list, a.insert(x) will insert just before the leftmost x already t...
[ "def", "bisect_left", "(", "a", ",", "x", ",", "lo", "=", "0", ",", "hi", "=", "None", ")", ":", "if", "lo", "<", "0", ":", "raise", "ValueError", "(", "'lo must be non-negative'", ")", "if", "hi", "is", "None", ":", "hi", "=", "len", "(", "a", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/bisect.py#L67-L86
hcdth011/ROS-Hydro-SLAM
629448eecd2c9a3511158115fa53ea9e4ae41359
rpg_vikit/vikit_py/src/vikit_py/transformations.py
python
concatenate_matrices
(*matrices)
return M
Return concatenation of series of transformation matrices. >>> M = numpy.random.rand(16).reshape((4, 4)) - 0.5 >>> numpy.allclose(M, concatenate_matrices(M)) True >>> numpy.allclose(numpy.dot(M, M.T), concatenate_matrices(M, M.T)) True
Return concatenation of series of transformation matrices.
[ "Return", "concatenation", "of", "series", "of", "transformation", "matrices", "." ]
def concatenate_matrices(*matrices): """Return concatenation of series of transformation matrices. >>> M = numpy.random.rand(16).reshape((4, 4)) - 0.5 >>> numpy.allclose(M, concatenate_matrices(M)) True >>> numpy.allclose(numpy.dot(M, M.T), concatenate_matrices(M, M.T)) True """ M = nu...
[ "def", "concatenate_matrices", "(", "*", "matrices", ")", ":", "M", "=", "numpy", ".", "identity", "(", "4", ")", "for", "i", "in", "matrices", ":", "M", "=", "numpy", ".", "dot", "(", "M", ",", "i", ")", "return", "M" ]
https://github.com/hcdth011/ROS-Hydro-SLAM/blob/629448eecd2c9a3511158115fa53ea9e4ae41359/rpg_vikit/vikit_py/src/vikit_py/transformations.py#L1653-L1666
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/summary_writer_cache.py
python
SummaryWriterCache.clear
()
Clear cached summary writers. Currently only used for unit tests.
Clear cached summary writers. Currently only used for unit tests.
[ "Clear", "cached", "summary", "writers", ".", "Currently", "only", "used", "for", "unit", "tests", "." ]
def clear(): """Clear cached summary writers. Currently only used for unit tests.""" with SummaryWriterCache._lock: SummaryWriterCache._cache = {}
[ "def", "clear", "(", ")", ":", "with", "SummaryWriterCache", ".", "_lock", ":", "SummaryWriterCache", ".", "_cache", "=", "{", "}" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/summary_writer_cache.py#L41-L44
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TStrV_SwapI
(*args)
return _snap.TStrV_SwapI(*args)
TStrV_SwapI(TStr LVal, TStr RVal) Parameters: LVal: TVec< TStr,int >::TIter RVal: TVec< TStr,int >::TIter
TStrV_SwapI(TStr LVal, TStr RVal)
[ "TStrV_SwapI", "(", "TStr", "LVal", "TStr", "RVal", ")" ]
def TStrV_SwapI(*args): """ TStrV_SwapI(TStr LVal, TStr RVal) Parameters: LVal: TVec< TStr,int >::TIter RVal: TVec< TStr,int >::TIter """ return _snap.TStrV_SwapI(*args)
[ "def", "TStrV_SwapI", "(", "*", "args", ")", ":", "return", "_snap", ".", "TStrV_SwapI", "(", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L20126-L20135
infinit/elle
a8154593c42743f45b9df09daf62b44630c24a02
drake/src/drake/__init__.py
python
Dictionary.__init__
(self, name, content={})
Build a dictionary with given content. name -- The node name. content -- The content, as a dictionary.
Build a dictionary with given content.
[ "Build", "a", "dictionary", "with", "given", "content", "." ]
def __init__(self, name, content={}): """Build a dictionary with given content. name -- The node name. content -- The content, as a dictionary. """ VirtualNode.__init__(self, '%s' % name) self.content = content
[ "def", "__init__", "(", "self", ",", "name", ",", "content", "=", "{", "}", ")", ":", "VirtualNode", ".", "__init__", "(", "self", ",", "'%s'", "%", "name", ")", "self", ".", "content", "=", "content" ]
https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L2614-L2621
pristineio/webrtc-mirror
7a5bcdffaab90a05bc1146b2b1ea71c004e54d71
tools_webrtc/android/build_aar.py
python
_EncodeForGN
(value)
Encodes value as a GN literal.
Encodes value as a GN literal.
[ "Encodes", "value", "as", "a", "GN", "literal", "." ]
def _EncodeForGN(value): """Encodes value as a GN literal.""" if type(value) is str: return '"' + value + '"' elif type(value) is bool: return repr(value).lower() else: return repr(value)
[ "def", "_EncodeForGN", "(", "value", ")", ":", "if", "type", "(", "value", ")", "is", "str", ":", "return", "'\"'", "+", "value", "+", "'\"'", "elif", "type", "(", "value", ")", "is", "bool", ":", "return", "repr", "(", "value", ")", ".", "lower", ...
https://github.com/pristineio/webrtc-mirror/blob/7a5bcdffaab90a05bc1146b2b1ea71c004e54d71/tools_webrtc/android/build_aar.py#L82-L89
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/processor/conversion/swgbcc/processor.py
python
SWGBCCProcessor.create_extra_unit_lines
(full_data_set)
Create additional units that are not in the unit connections. :param full_data_set: GenieObjectContainer instance that contains all relevant data for the conversion process. :type full_data_set: class: ...dataformat.aoc.genie_object_container....
Create additional units that are not in the unit connections.
[ "Create", "additional", "units", "that", "are", "not", "in", "the", "unit", "connections", "." ]
def create_extra_unit_lines(full_data_set): """ Create additional units that are not in the unit connections. :param full_data_set: GenieObjectContainer instance that contains all relevant data for the conversion process. :type...
[ "def", "create_extra_unit_lines", "(", "full_data_set", ")", ":", "# Wildlife", "extra_units", "=", "(", "48", ",", "594", ",", "822", ",", "833", ",", "1203", ",", "1249", ",", "1363", ",", "1364", ",", "1365", ",", "1366", ",", "1367", ",", "1469", ...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/swgbcc/processor.py#L312-L329
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/signal/ltisys.py
python
StateSpace.D
(self)
return self._D
Feedthrough matrix of the `StateSpace` system.
Feedthrough matrix of the `StateSpace` system.
[ "Feedthrough", "matrix", "of", "the", "StateSpace", "system", "." ]
def D(self): """Feedthrough matrix of the `StateSpace` system.""" return self._D
[ "def", "D", "(", "self", ")", ":", "return", "self", ".", "_D" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/ltisys.py#L1540-L1542
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/framework/meta_graph.py
python
_get_scope
(node_name)
return ""
Extract the scope name from a node name. The scope name is everything before the final slash, not including any ^ prefix denoting a control dependency. Args: node_name: the full name of an Op or a Tensor in the graph. Returns: The deepest named scope containing the node. Raises: ValueError: if t...
Extract the scope name from a node name.
[ "Extract", "the", "scope", "name", "from", "a", "node", "name", "." ]
def _get_scope(node_name): """Extract the scope name from a node name. The scope name is everything before the final slash, not including any ^ prefix denoting a control dependency. Args: node_name: the full name of an Op or a Tensor in the graph. Returns: The deepest named scope containing the node...
[ "def", "_get_scope", "(", "node_name", ")", ":", "if", "not", "node_name", ":", "raise", "ValueError", "(", "\"Node name cannot be empty or None.\"", ")", "# Control dependency inputs start with ^.", "if", "node_name", ".", "startswith", "(", "\"^\"", ")", ":", "node_...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/meta_graph.py#L259-L282
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py
python
DCCConnection.privmsg
(self, string)
Send data to DCC peer. The string will be padded with appropriate LF if it's a DCC CHAT session.
Send data to DCC peer.
[ "Send", "data", "to", "DCC", "peer", "." ]
def privmsg(self, string): """Send data to DCC peer. The string will be padded with appropriate LF if it's a DCC CHAT session. """ try: self.socket.send(string) if self.dcctype == "chat": self.socket.send("\n") if DEBUG: ...
[ "def", "privmsg", "(", "self", ",", "string", ")", ":", "try", ":", "self", ".", "socket", ".", "send", "(", "string", ")", "if", "self", ".", "dcctype", "==", "\"chat\"", ":", "self", ".", "socket", ".", "send", "(", "\"\\n\"", ")", "if", "DEBUG",...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py#L1001-L1015
springer13/hptt
9fecf0c41f889beebea970387f2a4971d7b84736
pythonAPI/hptt/hptt.py
python
transpose
(a, axes=None)
return tensorTranspose(axes, 1.0, a)
Drop-in for ``numpy.transpose``. Permute the dimensions of an array. Parameters ---------- a : array_like Input array. axes : list of ints, optional By default, reverse the dimensions, otherwise permute the axes according to the values given. Returns ------- p : nda...
Drop-in for ``numpy.transpose``. Permute the dimensions of an array.
[ "Drop", "-", "in", "for", "numpy", ".", "transpose", ".", "Permute", "the", "dimensions", "of", "an", "array", "." ]
def transpose(a, axes=None): """Drop-in for ``numpy.transpose``. Permute the dimensions of an array. Parameters ---------- a : array_like Input array. axes : list of ints, optional By default, reverse the dimensions, otherwise permute the axes according to the values given. ...
[ "def", "transpose", "(", "a", ",", "axes", "=", "None", ")", ":", "if", "axes", "is", "None", ":", "axes", "=", "reversed", "(", "range", "(", "a", ".", "ndim", ")", ")", "return", "tensorTranspose", "(", "axes", ",", "1.0", ",", "a", ")" ]
https://github.com/springer13/hptt/blob/9fecf0c41f889beebea970387f2a4971d7b84736/pythonAPI/hptt/hptt.py#L154-L173
google/google-api-cpp-client
3df15df632bef43eb320645ac3329d872aabf5ad
prepare_dependencies.py
python
CMakeExeInstaller.__init__
(self, config, url)
Standard PackageInstaller initializer.
Standard PackageInstaller initializer.
[ "Standard", "PackageInstaller", "initializer", "." ]
def __init__(self, config, url): """Standard PackageInstaller initializer.""" super(CMakeExeInstaller, self).__init__(config, url, package_name='ignore')
[ "def", "__init__", "(", "self", ",", "config", ",", "url", ")", ":", "super", "(", "CMakeExeInstaller", ",", "self", ")", ".", "__init__", "(", "config", ",", "url", ",", "package_name", "=", "'ignore'", ")" ]
https://github.com/google/google-api-cpp-client/blob/3df15df632bef43eb320645ac3329d872aabf5ad/prepare_dependencies.py#L767-L769
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/third_party/png/png.py
python
Test.testFlat
(self)
Test read_flat.
Test read_flat.
[ "Test", "read_flat", "." ]
def testFlat(self): """Test read_flat.""" import hashlib r = Reader(bytes=_pngsuite['basn0g02']) x,y,pixel,meta = r.read_flat() d = hashlib.md5(seqtobytes(pixel)).digest() self.assertEqual(_enhex(d), '255cd971ab8cd9e7275ff906e5041aa0')
[ "def", "testFlat", "(", "self", ")", ":", "import", "hashlib", "r", "=", "Reader", "(", "bytes", "=", "_pngsuite", "[", "'basn0g02'", "]", ")", "x", ",", "y", ",", "pixel", ",", "meta", "=", "r", ".", "read_flat", "(", ")", "d", "=", "hashlib", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/png/png.py#L2848-L2855
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/nn/functional/pooling.py
python
max_unpool1d
(x, indices, kernel_size, stride=None, padding=0, data_format="NCL", output_size=None, name=None)
return squeeze(unpool_out, [2])
This API implements max unpooling 1d opereation. `max_unpool1d` accepts the output of `max_pool1d` as input, including the indices of the maximum value and calculate the partial inverse. All non-maximum values ​​are set to zero. - Input: :math:`(N, C, L_{in})` - Output: :math:`(N, C, L_{out})`, w...
This API implements max unpooling 1d opereation. `max_unpool1d` accepts the output of `max_pool1d` as input, including the indices of the maximum value and calculate the partial inverse. All non-maximum values ​​are set to zero.
[ "This", "API", "implements", "max", "unpooling", "1d", "opereation", ".", "max_unpool1d", "accepts", "the", "output", "of", "max_pool1d", "as", "input", "including", "the", "indices", "of", "the", "maximum", "value", "and", "calculate", "the", "partial", "invers...
def max_unpool1d(x, indices, kernel_size, stride=None, padding=0, data_format="NCL", output_size=None, name=None): """ This API implements max unpooling 1d opereation. `max_unpool1d` accept...
[ "def", "max_unpool1d", "(", "x", ",", "indices", ",", "kernel_size", ",", "stride", "=", "None", ",", "padding", "=", "0", ",", "data_format", "=", "\"NCL\"", ",", "output_size", "=", "None", ",", "name", "=", "None", ")", ":", "\"\"\"NCL to NCHW\"\"\"", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/nn/functional/pooling.py#L667-L773
facebookresearch/habitat-sim
63b6c71d9ca8adaefb140b198196f5d0ca1f1e34
examples/fairmotion_interface.py
python
FairmotionInterface.point_at_path_t
( self, path_points: List[mn.Vector3], t: float )
return point, direction
Function that give a point on the path at time t.
Function that give a point on the path at time t.
[ "Function", "that", "give", "a", "point", "on", "the", "path", "at", "time", "t", "." ]
def point_at_path_t( self, path_points: List[mn.Vector3], t: float ) -> Tuple[mn.Vector3, mn.Vector3]: """ Function that give a point on the path at time t. """ covered: float = 0.0 i: int = 0 j: int = 0 while i < len(path_points): progre...
[ "def", "point_at_path_t", "(", "self", ",", "path_points", ":", "List", "[", "mn", ".", "Vector3", "]", ",", "t", ":", "float", ")", "->", "Tuple", "[", "mn", ".", "Vector3", ",", "mn", ".", "Vector3", "]", ":", "covered", ":", "float", "=", "0.0",...
https://github.com/facebookresearch/habitat-sim/blob/63b6c71d9ca8adaefb140b198196f5d0ca1f1e34/examples/fairmotion_interface.py#L1055-L1083
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py
python
FlagValues.RemoveFlagValues
(self, flag_values)
Remove flags that were previously appended from another FlagValues. Args: flag_values: registry containing flags to remove.
Remove flags that were previously appended from another FlagValues.
[ "Remove", "flags", "that", "were", "previously", "appended", "from", "another", "FlagValues", "." ]
def RemoveFlagValues(self, flag_values): """Remove flags that were previously appended from another FlagValues. Args: flag_values: registry containing flags to remove. """ for flag_name in flag_values.FlagDict(): self.__delattr__(flag_name)
[ "def", "RemoveFlagValues", "(", "self", ",", "flag_values", ")", ":", "for", "flag_name", "in", "flag_values", ".", "FlagDict", "(", ")", ":", "self", ".", "__delattr__", "(", "flag_name", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L1011-L1018
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
clang/bindings/python/clang/cindex.py
python
Cursor.enum_value
(self)
return self._enum_value
Return the value of an enum constant.
Return the value of an enum constant.
[ "Return", "the", "value", "of", "an", "enum", "constant", "." ]
def enum_value(self): """Return the value of an enum constant.""" if not hasattr(self, '_enum_value'): assert self.kind == CursorKind.ENUM_CONSTANT_DECL # Figure out the underlying type of the enum to know if it # is a signed or unsigned quantity. underlyi...
[ "def", "enum_value", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_enum_value'", ")", ":", "assert", "self", ".", "kind", "==", "CursorKind", ".", "ENUM_CONSTANT_DECL", "# Figure out the underlying type of the enum to know if it", "# is a signed ...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/clang/bindings/python/clang/cindex.py#L1715-L1737
chihyaoma/regretful-agent
5caf7b500667981bc7064e4d31b49e83db64c95a
tasks/R2R-pano/agents/pano_agent.py
python
PanoSeq2SeqAgent.get_value_loss_from_start_sigmoid
(self, traj, predicted_value, ended)
This loss forces the agent to estimate how good is the current state, i.e. how far away I am from the goal?
This loss forces the agent to estimate how good is the current state, i.e. how far away I am from the goal?
[ "This", "loss", "forces", "the", "agent", "to", "estimate", "how", "good", "is", "the", "current", "state", "i", ".", "e", ".", "how", "far", "away", "I", "am", "from", "the", "goal?" ]
def get_value_loss_from_start_sigmoid(self, traj, predicted_value, ended): """ This loss forces the agent to estimate how good is the current state, i.e. how far away I am from the goal? """ value_target = [] for i, _traj in enumerate(traj): original_dist = _traj['dis...
[ "def", "get_value_loss_from_start_sigmoid", "(", "self", ",", "traj", ",", "predicted_value", ",", "ended", ")", ":", "value_target", "=", "[", "]", "for", "i", ",", "_traj", "in", "enumerate", "(", "traj", ")", ":", "original_dist", "=", "_traj", "[", "'d...
https://github.com/chihyaoma/regretful-agent/blob/5caf7b500667981bc7064e4d31b49e83db64c95a/tasks/R2R-pano/agents/pano_agent.py#L270-L296
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/_abcoll.py
python
MutableMapping.popitem
(self)
return key, value
D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty.
D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty.
[ "D", ".", "popitem", "()", "-", ">", "(", "k", "v", ")", "remove", "and", "return", "some", "(", "key", "value", ")", "pair", "as", "a", "2", "-", "tuple", ";", "but", "raise", "KeyError", "if", "D", "is", "empty", "." ]
def popitem(self): '''D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty. ''' try: key = next(iter(self)) except StopIteration: raise KeyError value = self[key] del self[key] ...
[ "def", "popitem", "(", "self", ")", ":", "try", ":", "key", "=", "next", "(", "iter", "(", "self", ")", ")", "except", "StopIteration", ":", "raise", "KeyError", "value", "=", "self", "[", "key", "]", "del", "self", "[", "key", "]", "return", "key"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/_abcoll.py#L506-L516
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/xcode_emulation.py
python
XcodeSettings.GetExecutablePath
(self)
Returns the qualified path to the primary executable of the bundle represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.
Returns the qualified path to the primary executable of the bundle represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.
[ "Returns", "the", "qualified", "path", "to", "the", "primary", "executable", "of", "the", "bundle", "represented", "by", "this", "target", ".", "E", ".", "g", ".", "Chromium", ".", "app", "/", "Contents", "/", "MacOS", "/", "Chromium", "." ]
def GetExecutablePath(self): """Returns the qualified path to the primary executable of the bundle represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.""" if self._IsBundle(): return self._GetBundleBinaryPath() else: return self._GetStandaloneBinaryPath()
[ "def", "GetExecutablePath", "(", "self", ")", ":", "if", "self", ".", "_IsBundle", "(", ")", ":", "return", "self", ".", "_GetBundleBinaryPath", "(", ")", "else", ":", "return", "self", ".", "_GetStandaloneBinaryPath", "(", ")" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/xcode_emulation.py#L475-L481
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Alignment/OfflineValidation/python/TkAlAllInOneTool/helperFunctions.py
python
getCommandOutput2
(command)
return data
This function executes `command` and returns it output. Arguments: - `command`: Shell command to be invoked by this function.
This function executes `command` and returns it output.
[ "This", "function", "executes", "command", "and", "returns", "it", "output", "." ]
def getCommandOutput2(command): """This function executes `command` and returns it output. Arguments: - `command`: Shell command to be invoked by this function. """ child = os.popen(command) data = child.read() err = child.close() if err: raise RuntimeError('%s failed w/ exit c...
[ "def", "getCommandOutput2", "(", "command", ")", ":", "child", "=", "os", ".", "popen", "(", "command", ")", "data", "=", "child", ".", "read", "(", ")", "err", "=", "child", ".", "close", "(", ")", "if", "err", ":", "raise", "RuntimeError", "(", "...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/OfflineValidation/python/TkAlAllInOneTool/helperFunctions.py#L51-L63
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/urllib3/contrib/pyopenssl.py
python
_validate_dependencies_met
()
Verifies that PyOpenSSL's package-level dependencies have been met. Throws `ImportError` if they are not met.
Verifies that PyOpenSSL's package-level dependencies have been met. Throws `ImportError` if they are not met.
[ "Verifies", "that", "PyOpenSSL", "s", "package", "-", "level", "dependencies", "have", "been", "met", ".", "Throws", "ImportError", "if", "they", "are", "not", "met", "." ]
def _validate_dependencies_met(): """ Verifies that PyOpenSSL's package-level dependencies have been met. Throws `ImportError` if they are not met. """ # Method added in `cryptography==1.1`; not available in older versions from cryptography.x509.extensions import Extensions if getattr(Extens...
[ "def", "_validate_dependencies_met", "(", ")", ":", "# Method added in `cryptography==1.1`; not available in older versions", "from", "cryptography", ".", "x509", ".", "extensions", "import", "Extensions", "if", "getattr", "(", "Extensions", ",", "\"get_extension_for_class\"", ...
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/urllib3/contrib/pyopenssl.py#L137-L154
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/boxing.py
python
unbox_slice
(typ, obj, c)
return NativeValue(sli._getvalue(), is_error=c.builder.not_(ok))
Convert object *obj* to a native slice structure.
Convert object *obj* to a native slice structure.
[ "Convert", "object", "*", "obj", "*", "to", "a", "native", "slice", "structure", "." ]
def unbox_slice(typ, obj, c): """ Convert object *obj* to a native slice structure. """ from . import slicing ok, start, stop, step = c.pyapi.slice_as_ints(obj) sli = c.context.make_helper(c.builder, typ) sli.start = start sli.stop = stop sli.step = step return NativeValue(sli._g...
[ "def", "unbox_slice", "(", "typ", ",", "obj", ",", "c", ")", ":", "from", ".", "import", "slicing", "ok", ",", "start", ",", "stop", ",", "step", "=", "c", ".", "pyapi", ".", "slice_as_ints", "(", "obj", ")", "sli", "=", "c", ".", "context", ".",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/boxing.py#L369-L379
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/index.py
python
PackageFinder._candidate_sort_key
(self, candidate)
return (candidate.version, pri)
Function used to generate link sort key for link tuples. The greater the return value, the more preferred it is. If not finding wheels, then sorted by version only. If finding wheels, then the sort order is by version, then: 1. existing installs 2. wheels ordered via Wheel.su...
Function used to generate link sort key for link tuples. The greater the return value, the more preferred it is. If not finding wheels, then sorted by version only. If finding wheels, then the sort order is by version, then: 1. existing installs 2. wheels ordered via Wheel.su...
[ "Function", "used", "to", "generate", "link", "sort", "key", "for", "link", "tuples", ".", "The", "greater", "the", "return", "value", "the", "more", "preferred", "it", "is", ".", "If", "not", "finding", "wheels", "then", "sorted", "by", "version", "only",...
def _candidate_sort_key(self, candidate): """ Function used to generate link sort key for link tuples. The greater the return value, the more preferred it is. If not finding wheels, then sorted by version only. If finding wheels, then the sort order is by version, then: ...
[ "def", "_candidate_sort_key", "(", "self", ",", "candidate", ")", ":", "support_num", "=", "len", "(", "supported_tags", ")", "if", "candidate", ".", "location", "==", "INSTALLED_VERSION", ":", "pri", "=", "1", "elif", "candidate", ".", "location", ".", "is_...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/index.py#L244-L271
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/dataview.py
python
DataViewToggleRenderer.__init__
(self, *args, **kwargs)
__init__(self, String varianttype="bool", int mode=DATAVIEW_CELL_INERT, int align=DVR_DEFAULT_ALIGNMENT) -> DataViewToggleRenderer DataViewToggleRenderer
__init__(self, String varianttype="bool", int mode=DATAVIEW_CELL_INERT, int align=DVR_DEFAULT_ALIGNMENT) -> DataViewToggleRenderer
[ "__init__", "(", "self", "String", "varianttype", "=", "bool", "int", "mode", "=", "DATAVIEW_CELL_INERT", "int", "align", "=", "DVR_DEFAULT_ALIGNMENT", ")", "-", ">", "DataViewToggleRenderer" ]
def __init__(self, *args, **kwargs): """ __init__(self, String varianttype="bool", int mode=DATAVIEW_CELL_INERT, int align=DVR_DEFAULT_ALIGNMENT) -> DataViewToggleRenderer DataViewToggleRenderer """ _dataview.DataViewToggleRenderer_swiginit(self,_dataview.new_DataV...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_dataview", ".", "DataViewToggleRenderer_swiginit", "(", "self", ",", "_dataview", ".", "new_DataViewToggleRenderer", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1338-L1345
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/dateutil/utils.py
python
default_tzinfo
(dt, tzinfo)
Sets the ``tzinfo`` parameter on naive datetimes only This is useful for example when you are provided a datetime that may have either an implicit or explicit time zone, such as when parsing a time zone string. .. doctest:: >>> from dateutil.tz import tzoffset >>> from dateutil.parser...
Sets the ``tzinfo`` parameter on naive datetimes only
[ "Sets", "the", "tzinfo", "parameter", "on", "naive", "datetimes", "only" ]
def default_tzinfo(dt, tzinfo): """ Sets the ``tzinfo`` parameter on naive datetimes only This is useful for example when you are provided a datetime that may have either an implicit or explicit time zone, such as when parsing a time zone string. .. doctest:: >>> from dateutil.tz impo...
[ "def", "default_tzinfo", "(", "dt", ",", "tzinfo", ")", ":", "if", "dt", ".", "tzinfo", "is", "not", "None", ":", "return", "dt", "else", ":", "return", "dt", ".", "replace", "(", "tzinfo", "=", "tzinfo", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/dateutil/utils.py#L29-L61
mldbai/mldb
69994bd879bf592d03374bf43870457384fbae93
jml-build/jmlbuild.py
python
Parser.parse_func_sub_make
(self, line)
return line
Parses the include_submake function and recursively parses the makefiles it points to.
Parses the include_submake function and recursively parses the makefiles it points to.
[ "Parses", "the", "include_submake", "function", "and", "recursively", "parses", "the", "makefiles", "it", "points", "to", "." ]
def parse_func_sub_make(self, line): """ Parses the include_submake function and recursively parses the makefiles it points to. """ print_dbg("\tsub_make: " + line) params, line = self.parse_func_params(line) assert len(params) > 0 if len(params) == 1: ...
[ "def", "parse_func_sub_make", "(", "self", ",", "line", ")", ":", "print_dbg", "(", "\"\\tsub_make: \"", "+", "line", ")", "params", ",", "line", "=", "self", ".", "parse_func_params", "(", "line", ")", "assert", "len", "(", "params", ")", ">", "0", "if"...
https://github.com/mldbai/mldb/blob/69994bd879bf592d03374bf43870457384fbae93/jml-build/jmlbuild.py#L263-L288
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
SysErrorCode
(*args)
return _misc_.SysErrorCode(*args)
SysErrorCode() -> unsigned long
SysErrorCode() -> unsigned long
[ "SysErrorCode", "()", "-", ">", "unsigned", "long" ]
def SysErrorCode(*args): """SysErrorCode() -> unsigned long""" return _misc_.SysErrorCode(*args)
[ "def", "SysErrorCode", "(", "*", "args", ")", ":", "return", "_misc_", ".", "SysErrorCode", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L1839-L1841
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/macpath.py
python
split
(s)
return path, file
Split a pathname into two parts: the directory leading up to the final bit, and the basename (the filename, without colons, in that directory). The result (s, t) is such that join(s, t) yields the original argument.
Split a pathname into two parts: the directory leading up to the final bit, and the basename (the filename, without colons, in that directory). The result (s, t) is such that join(s, t) yields the original argument.
[ "Split", "a", "pathname", "into", "two", "parts", ":", "the", "directory", "leading", "up", "to", "the", "final", "bit", "and", "the", "basename", "(", "the", "filename", "without", "colons", "in", "that", "directory", ")", ".", "The", "result", "(", "s"...
def split(s): """Split a pathname into two parts: the directory leading up to the final bit, and the basename (the filename, without colons, in that directory). The result (s, t) is such that join(s, t) yields the original argument.""" if ':' not in s: return '', s colon = 0 for i in range(len(...
[ "def", "split", "(", "s", ")", ":", "if", "':'", "not", "in", "s", ":", "return", "''", ",", "s", "colon", "=", "0", "for", "i", "in", "range", "(", "len", "(", "s", ")", ")", ":", "if", "s", "[", "i", "]", "==", "':'", ":", "colon", "=",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/macpath.py#L58-L70
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/Editra.py
python
Editra.OnCommandReceived
(self, evt)
Receive commands from the IPC server @todo: move command processing into own module
Receive commands from the IPC server @todo: move command processing into own module
[ "Receive", "commands", "from", "the", "IPC", "server", "@todo", ":", "move", "command", "processing", "into", "own", "module" ]
def OnCommandReceived(self, evt): """Receive commands from the IPC server @todo: move command processing into own module """ # Guard against events that come in after shutdown # from server thread. if not self or self._isexiting or not self.IsMainLoopRunning(): ...
[ "def", "OnCommandReceived", "(", "self", ",", "evt", ")", ":", "# Guard against events that come in after shutdown", "# from server thread.", "if", "not", "self", "or", "self", ".", "_isexiting", "or", "not", "self", ".", "IsMainLoopRunning", "(", ")", ":", "return"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/Editra.py#L567-L597
kungfu-origin/kungfu
90c84b2b590855654cb9a6395ed050e0f7763512
core/deps/SQLiteCpp-2.3.0/cpplint.py
python
_BlockInfo.CheckEnd
(self, filename, clean_lines, linenum, error)
Run checks that applies to text after the closing brace. This is mostly used for checking end of namespace comments. 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...
Run checks that applies to text after the closing brace.
[ "Run", "checks", "that", "applies", "to", "text", "after", "the", "closing", "brace", "." ]
def CheckEnd(self, filename, clean_lines, linenum, error): """Run checks that applies to text after the closing brace. This is mostly used for checking end of namespace comments. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. line...
[ "def", "CheckEnd", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "pass" ]
https://github.com/kungfu-origin/kungfu/blob/90c84b2b590855654cb9a6395ed050e0f7763512/core/deps/SQLiteCpp-2.3.0/cpplint.py#L1706-L1717
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/series.py
python
Series.reorder_levels
(self, order)
return result
Rearrange index levels using input order. May not drop or duplicate levels. Parameters ---------- order : list of int representing new level order Reference level by number or key. Returns ------- type of caller (new object)
Rearrange index levels using input order.
[ "Rearrange", "index", "levels", "using", "input", "order", "." ]
def reorder_levels(self, order): """ Rearrange index levels using input order. May not drop or duplicate levels. Parameters ---------- order : list of int representing new level order Reference level by number or key. Returns ------- ...
[ "def", "reorder_levels", "(", "self", ",", "order", ")", ":", "if", "not", "isinstance", "(", "self", ".", "index", ",", "MultiIndex", ")", ":", "# pragma: no cover", "raise", "Exception", "(", "\"Can only reorder levels on a hierarchical axis.\"", ")", "result", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/series.py#L3431-L3451
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/_parseaddr.py
python
parsedate
(data)
Convert a time string to a time tuple.
Convert a time string to a time tuple.
[ "Convert", "a", "time", "string", "to", "a", "time", "tuple", "." ]
def parsedate(data): """Convert a time string to a time tuple.""" t = parsedate_tz(data) if isinstance(t, tuple): return t[:9] else: return t
[ "def", "parsedate", "(", "data", ")", ":", "t", "=", "parsedate_tz", "(", "data", ")", "if", "isinstance", "(", "t", ",", "tuple", ")", ":", "return", "t", "[", ":", "9", "]", "else", ":", "return", "t" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/_parseaddr.py#L143-L149
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings.IsUseLibraryDependencyInputs
(self, config)
return uldi == 'true'
Returns whether the target should be linked via Use Library Dependency Inputs (using component .objs of a given .lib).
Returns whether the target should be linked via Use Library Dependency Inputs (using component .objs of a given .lib).
[ "Returns", "whether", "the", "target", "should", "be", "linked", "via", "Use", "Library", "Dependency", "Inputs", "(", "using", "component", ".", "objs", "of", "a", "given", ".", "lib", ")", "." ]
def IsUseLibraryDependencyInputs(self, config): """Returns whether the target should be linked via Use Library Dependency Inputs (using component .objs of a given .lib).""" config = self._TargetConfig(config) uldi = self._Setting(('VCLinkerTool', 'UseLibraryDependencyInputs'), config) return uldi ==...
[ "def", "IsUseLibraryDependencyInputs", "(", "self", ",", "config", ")", ":", "config", "=", "self", ".", "_TargetConfig", "(", "config", ")", "uldi", "=", "self", ".", "_Setting", "(", "(", "'VCLinkerTool'", ",", "'UseLibraryDependencyInputs'", ")", ",", "conf...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/msvs_emulation.py#L757-L762
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py
python
StoppedCommandPane.get_highlights
(self)
return ret
Highlight the line under the cursor. Users moving the cursor has no effect on the selected line.
Highlight the line under the cursor. Users moving the cursor has no effect on the selected line.
[ "Highlight", "the", "line", "under", "the", "cursor", ".", "Users", "moving", "the", "cursor", "has", "no", "effect", "on", "the", "selected", "line", "." ]
def get_highlights(self): """ Highlight the line under the cursor. Users moving the cursor has no effect on the selected line. """ ret = {} line = self.get_selected_line() if line is not None: ret[self.selectedHighlight] = [line] return ret ...
[ "def", "get_highlights", "(", "self", ")", ":", "ret", "=", "{", "}", "line", "=", "self", ".", "get_selected_line", "(", ")", "if", "line", "is", "not", "None", ":", "ret", "[", "self", ".", "selectedHighlight", "]", "=", "[", "line", "]", "return",...
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py#L587-L596
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/webapp2/webapp2_extras/appengine/auth/models.py
python
UserToken.get_key
(cls, user, subject, token)
return model.Key(cls, '%s.%s.%s' % (str(user), subject, token))
Returns a token key. :param user: User unique ID. :param subject: The subject of the key. Examples: - 'auth' - 'signup' :param token: Randomly generated token. :returns: ``model.Key`` containing a string id in the ...
Returns a token key.
[ "Returns", "a", "token", "key", "." ]
def get_key(cls, user, subject, token): """Returns a token key. :param user: User unique ID. :param subject: The subject of the key. Examples: - 'auth' - 'signup' :param token: Randomly generated token. :returns: ...
[ "def", "get_key", "(", "cls", ",", "user", ",", "subject", ",", "token", ")", ":", "return", "model", ".", "Key", "(", "cls", ",", "'%s.%s.%s'", "%", "(", "str", "(", "user", ")", ",", "subject", ",", "token", ")", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2_extras/appengine/auth/models.py#L138-L154
NASA-Tensegrity-Robotics-Toolkit/NTRTsim
0443cbd542e12e23c04adf79ea0d8d003c428baa
bin/python_scripts/src/configuration/config_generator.py
python
ConfigGenerator.generateMissing
(self)
Generates all missing conf files.
Generates all missing conf files.
[ "Generates", "all", "missing", "conf", "files", "." ]
def generateMissing(self): """ Generates all missing conf files. """ # Get the list of missing files. missingList = self.getMissing() # Loop over the missing list. For each one copy it. for missing in missingList: srcPath = "%s/%s" % (self.defaultDir,...
[ "def", "generateMissing", "(", "self", ")", ":", "# Get the list of missing files.", "missingList", "=", "self", ".", "getMissing", "(", ")", "# Loop over the missing list. For each one copy it.", "for", "missing", "in", "missingList", ":", "srcPath", "=", "\"%s/%s\"", ...
https://github.com/NASA-Tensegrity-Robotics-Toolkit/NTRTsim/blob/0443cbd542e12e23c04adf79ea0d8d003c428baa/bin/python_scripts/src/configuration/config_generator.py#L49-L61
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/softwareupdate.py
python
SoftwareUpdate.AutoCheckForUpdate
(self, frequencyInDays, parentWindow=None, cfg=None)
If it has been frequencyInDays since the last auto-check then check if a software update is available and prompt the user to download and install it. This can be called after a application has started up, and if there is no update available the user will not be bothered.
If it has been frequencyInDays since the last auto-check then check if a software update is available and prompt the user to download and install it. This can be called after a application has started up, and if there is no update available the user will not be bothered.
[ "If", "it", "has", "been", "frequencyInDays", "since", "the", "last", "auto", "-", "check", "then", "check", "if", "a", "software", "update", "is", "available", "and", "prompt", "the", "user", "to", "download", "and", "install", "it", ".", "This", "can", ...
def AutoCheckForUpdate(self, frequencyInDays, parentWindow=None, cfg=None): """ If it has been frequencyInDays since the last auto-check then check if a software update is available and prompt the user to download and install it. This can be called after a application has started up, and...
[ "def", "AutoCheckForUpdate", "(", "self", ",", "frequencyInDays", ",", "parentWindow", "=", "None", ",", "cfg", "=", "None", ")", ":", "if", "not", "isFrozenApp", ":", "return", "if", "cfg", "is", "None", ":", "cfg", "=", "wx", ".", "Config", ".", "Get...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/softwareupdate.py#L101-L122
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/mem/slicc/parser.py
python
SLICC.p_declsx__list
(self, p)
declsx : decl declsx
declsx : decl declsx
[ "declsx", ":", "decl", "declsx" ]
def p_declsx__list(self, p): "declsx : decl declsx" if isinstance(p[1], ast.DeclListAST): decls = p[1].decls elif p[1] is None: decls = [] else: decls = [ p[1] ] p[0] = decls + p[2]
[ "def", "p_declsx__list", "(", "self", ",", "p", ")", ":", "if", "isinstance", "(", "p", "[", "1", "]", ",", "ast", ".", "DeclListAST", ")", ":", "decls", "=", "p", "[", "1", "]", ".", "decls", "elif", "p", "[", "1", "]", "is", "None", ":", "d...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/mem/slicc/parser.py#L244-L252
ouster-lidar/ouster_example
13ea8e8b8a4951fb630dbc9108666995c8443bf6
python/src/ouster/pcap/pcap.py
python
_replay
(pcap_path: str, info: SensorInfo, dst_ip: str, dst_lidar_port: int, dst_imu_port: int)
Replay UDP packets out over the network. Todo: Not really sure about this interface Args: pcap_path: Path to the pcap file to replay info: The sensor metadata dst_ip: IP to send packets to dst_lidar_port: Destination port for lidar packets dst_imu_port: Destinat...
Replay UDP packets out over the network.
[ "Replay", "UDP", "packets", "out", "over", "the", "network", "." ]
def _replay(pcap_path: str, info: SensorInfo, dst_ip: str, dst_lidar_port: int, dst_imu_port: int) -> Iterator[bool]: """Replay UDP packets out over the network. Todo: Not really sure about this interface Args: pcap_path: Path to the pcap file to replay info: The sensor...
[ "def", "_replay", "(", "pcap_path", ":", "str", ",", "info", ":", "SensorInfo", ",", "dst_ip", ":", "str", ",", "dst_lidar_port", ":", "int", ",", "dst_imu_port", ":", "int", ")", "->", "Iterator", "[", "bool", "]", ":", "try", ":", "socket_out", "=", ...
https://github.com/ouster-lidar/ouster_example/blob/13ea8e8b8a4951fb630dbc9108666995c8443bf6/python/src/ouster/pcap/pcap.py#L263-L298
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
v8_5_1/tools/release/common_includes.py
python
MakeChangeLogBugReference
(body)
Grep for "BUG=xxxx" lines in the commit message and convert them to "(issue xxxx)".
Grep for "BUG=xxxx" lines in the commit message and convert them to "(issue xxxx)".
[ "Grep", "for", "BUG", "=", "xxxx", "lines", "in", "the", "commit", "message", "and", "convert", "them", "to", "(", "issue", "xxxx", ")", "." ]
def MakeChangeLogBugReference(body): """Grep for "BUG=xxxx" lines in the commit message and convert them to "(issue xxxx)". """ crbugs = [] v8bugs = [] def AddIssues(text): ref = re.match(r"^BUG[ \t]*=[ \t]*(.+)$", text.strip()) if not ref: return for bug in ref.group(1).split(","): ...
[ "def", "MakeChangeLogBugReference", "(", "body", ")", ":", "crbugs", "=", "[", "]", "v8bugs", "=", "[", "]", "def", "AddIssues", "(", "text", ")", ":", "ref", "=", "re", ".", "match", "(", "r\"^BUG[ \\t]*=[ \\t]*(.+)$\"", ",", "text", ".", "strip", "(", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_5_1/tools/release/common_includes.py#L137-L175
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/symsrc/pefile.py
python
PE.get_section_by_offset
(self, offset)
return None
Get the section containing the given file offset.
Get the section containing the given file offset.
[ "Get", "the", "section", "containing", "the", "given", "file", "offset", "." ]
def get_section_by_offset(self, offset): """Get the section containing the given file offset.""" sections = [s for s in self.sections if s.contains_offset(offset)] if sections: return sections[0] return None
[ "def", "get_section_by_offset", "(", "self", ",", "offset", ")", ":", "sections", "=", "[", "s", "for", "s", "in", "self", ".", "sections", "if", "s", ".", "contains_offset", "(", "offset", ")", "]", "if", "sections", ":", "return", "sections", "[", "0...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/symsrc/pefile.py#L3076-L3084