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
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/utils/generic_utils.py
python
get_custom_objects_by_name
(item, custom_objects=None)
return None
Returns the item if it is in either local or global custom objects.
Returns the item if it is in either local or global custom objects.
[ "Returns", "the", "item", "if", "it", "is", "in", "either", "local", "or", "global", "custom", "objects", "." ]
def get_custom_objects_by_name(item, custom_objects=None): """Returns the item if it is in either local or global custom objects.""" if item in _GLOBAL_CUSTOM_OBJECTS: return _GLOBAL_CUSTOM_OBJECTS[item] elif custom_objects and item in custom_objects: return custom_objects[item] return None
[ "def", "get_custom_objects_by_name", "(", "item", ",", "custom_objects", "=", "None", ")", ":", "if", "item", "in", "_GLOBAL_CUSTOM_OBJECTS", ":", "return", "_GLOBAL_CUSTOM_OBJECTS", "[", "item", "]", "elif", "custom_objects", "and", "item", "in", "custom_objects", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/utils/generic_utils.py#L533-L539
livecode/livecode
4606a10ea10b16d5071d0f9f263ccdd7ede8b31d
gyp/pylib/gyp/ordered_dict.py
python
OrderedDict.__init__
(self, *args, **kwds)
Initialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary.
Initialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary.
[ "Initialize", "an", "ordered", "dictionary", ".", "Signature", "is", "the", "same", "as", "for", "regular", "dictionaries", "but", "keyword", "arguments", "are", "not", "recommended", "because", "their", "insertion", "order", "is", "arbitrary", "." ]
def __init__(self, *args, **kwds): '''Initialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. ''' if len(args) > 1: raise TypeError('expected at most 1...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwds", ")", ":", "if", "len", "(", "args", ")", ">", "1", ":", "raise", "TypeError", "(", "'expected at most 1 arguments, got %d'", "%", "len", "(", "args", ")", ")", "try", ":", "self...
https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/ordered_dict.py#L55-L69
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
PCR_ReadResponse.initFromTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def initFromTpm(self, buf): """ TpmMarshaller method """ self.pcrUpdateCounter = buf.readInt() self.pcrSelectionOut = buf.readObjArr(TPMS_PCR_SELECTION) self.pcrValues = buf.readObjArr(TPM2B_DIGEST)
[ "def", "initFromTpm", "(", "self", ",", "buf", ")", ":", "self", ".", "pcrUpdateCounter", "=", "buf", ".", "readInt", "(", ")", "self", ".", "pcrSelectionOut", "=", "buf", ".", "readObjArr", "(", "TPMS_PCR_SELECTION", ")", "self", ".", "pcrValues", "=", ...
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L13870-L13874
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
samples/python/tensorflow_object_detection_api/onnx_utils.py
python
slice
(self, name, input, starts, ends, axes)
return self.layer(name=name, op="Slice", inputs=[input_tensor, const_start, const_end, const_axes], outputs=[name + ":0"])
Add Slice operation to the graph which will operate on the input tensor with the value(s) given. :param op: The ONNX operation to perform, i.e. "Add" or "Mul". :param input: The tensor to operate on. :param name: The name to use for the node. :param starts: Value at which Slice starts. :param ends: ...
Add Slice operation to the graph which will operate on the input tensor with the value(s) given. :param op: The ONNX operation to perform, i.e. "Add" or "Mul". :param input: The tensor to operate on. :param name: The name to use for the node. :param starts: Value at which Slice starts. :param ends: ...
[ "Add", "Slice", "operation", "to", "the", "graph", "which", "will", "operate", "on", "the", "input", "tensor", "with", "the", "value", "(", "s", ")", "given", ".", ":", "param", "op", ":", "The", "ONNX", "operation", "to", "perform", "i", ".", "e", "...
def slice(self, name, input, starts, ends, axes): """ Add Slice operation to the graph which will operate on the input tensor with the value(s) given. :param op: The ONNX operation to perform, i.e. "Add" or "Mul". :param input: The tensor to operate on. :param name: The name to use for the node. ...
[ "def", "slice", "(", "self", ",", "name", ",", "input", ",", "starts", ",", "ends", ",", "axes", ")", ":", "input_tensor", "=", "input", "if", "type", "(", "input", ")", "is", "gs", ".", "Variable", "else", "input", "[", "0", "]", "log", ".", "de...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/samples/python/tensorflow_object_detection_api/onnx_utils.py#L68-L84
zerollzeng/tiny-tensorrt
e7bdb8f82934342a0f22ce68dfefdb8e15eb72b2
third_party/pybind11/tools/clang/cindex.py
python
SourceLocation.offset
(self)
return self._get_instantiation()[3]
Get the file offset represented by this source location.
Get the file offset represented by this source location.
[ "Get", "the", "file", "offset", "represented", "by", "this", "source", "location", "." ]
def offset(self): """Get the file offset represented by this source location.""" return self._get_instantiation()[3]
[ "def", "offset", "(", "self", ")", ":", "return", "self", ".", "_get_instantiation", "(", ")", "[", "3", "]" ]
https://github.com/zerollzeng/tiny-tensorrt/blob/e7bdb8f82934342a0f22ce68dfefdb8e15eb72b2/third_party/pybind11/tools/clang/cindex.py#L213-L215
fengbingchun/NN_Test
d6305825d5273e4569ccd1eda9ffa2a9c72e18d2
src/tiny-dnn/third_party/gemmlowp/meta/generators/qnt_Nx8_neon.py
python
GenerateQntLanes
(emitter, registers, qnt_lanes, source, stride, destination, destination_stride, offsets)
return lanes
Prepare lanes for reading unquantized multiplication results.
Prepare lanes for reading unquantized multiplication results.
[ "Prepare", "lanes", "for", "reading", "unquantized", "multiplication", "results", "." ]
def GenerateQntLanes(emitter, registers, qnt_lanes, source, stride, destination, destination_stride, offsets): """Prepare lanes for reading unquantized multiplication results.""" offset_registers = LoadAndDuplicateOffsets(emitter, registers, qnt_lanes, ...
[ "def", "GenerateQntLanes", "(", "emitter", ",", "registers", ",", "qnt_lanes", ",", "source", ",", "stride", ",", "destination", ",", "destination_stride", ",", "offsets", ")", ":", "offset_registers", "=", "LoadAndDuplicateOffsets", "(", "emitter", ",", "register...
https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/gemmlowp/meta/generators/qnt_Nx8_neon.py#L44-L72
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
Choicebook.GetChoiceCtrl
(*args, **kwargs)
return _controls_.Choicebook_GetChoiceCtrl(*args, **kwargs)
GetChoiceCtrl(self) -> Choice
GetChoiceCtrl(self) -> Choice
[ "GetChoiceCtrl", "(", "self", ")", "-", ">", "Choice" ]
def GetChoiceCtrl(*args, **kwargs): """GetChoiceCtrl(self) -> Choice""" return _controls_.Choicebook_GetChoiceCtrl(*args, **kwargs)
[ "def", "GetChoiceCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Choicebook_GetChoiceCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L3278-L3280
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/sync_replicas_optimizer.py
python
SyncReplicasOptimizerV2.apply_gradients
(self, grads_and_vars, global_step=None, name=None)
Apply gradients to variables. This contains most of the synchronization implementation and also wraps the apply_gradients() from the real optimizer. Args: grads_and_vars: List of (gradient, variable) pairs as returned by compute_gradients(). global_step: Optional Variable to increment ...
Apply gradients to variables.
[ "Apply", "gradients", "to", "variables", "." ]
def apply_gradients(self, grads_and_vars, global_step=None, name=None): """Apply gradients to variables. This contains most of the synchronization implementation and also wraps the apply_gradients() from the real optimizer. Args: grads_and_vars: List of (gradient, variable) pairs as returned by ...
[ "def", "apply_gradients", "(", "self", ",", "grads_and_vars", ",", "global_step", "=", "None", ",", "name", "=", "None", ")", ":", "if", "not", "grads_and_vars", ":", "raise", "ValueError", "(", "\"Must supply at least one variable\"", ")", "if", "global_step", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/sync_replicas_optimizer.py#L222-L346
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/importOCA.py
python
getarc
(data)
Turn an OCA arc definition into a FreeCAD Part.Edge. Parameters ---------- data : list Different types of data. Returns ------- Part.Edge An edge object from the points in `data`.
Turn an OCA arc definition into a FreeCAD Part.Edge.
[ "Turn", "an", "OCA", "arc", "definition", "into", "a", "FreeCAD", "Part", ".", "Edge", "." ]
def getarc(data): """Turn an OCA arc definition into a FreeCAD Part.Edge. Parameters ---------- data : list Different types of data. Returns ------- Part.Edge An edge object from the points in `data`. """ FCC.PrintMessage("found arc %s \n" % data) c = None i...
[ "def", "getarc", "(", "data", ")", ":", "FCC", ".", "PrintMessage", "(", "\"found arc %s \\n\"", "%", "data", ")", "c", "=", "None", "if", "data", "[", "0", "]", "==", "\"ARC\"", ":", "# 3-points arc", "pts", "=", "data", "[", "1", ":", "]", "verts",...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/importOCA.py#L126-L189
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/pyreadline/modes/basemode.py
python
BaseMode.forward_char_extend_selection
(self, e)
Move forward a character.
Move forward a character.
[ "Move", "forward", "a", "character", "." ]
def forward_char_extend_selection(self, e): # '''Move forward a character. ''' self.l_buffer.forward_char_extend_selection(self.argument_reset)
[ "def", "forward_char_extend_selection", "(", "self", ",", "e", ")", ":", "# ", "self", ".", "l_buffer", ".", "forward_char_extend_selection", "(", "self", ".", "argument_reset", ")" ]
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/basemode.py#L282-L284
nginnever/zogminer
3c2bc925c833d57c758872e747d5d51fd7185611
contrib/linearize/linearize-data.py
python
BlockDataCopier.fetchBlock
(self, extent)
Fetch block contents from disk given extents
Fetch block contents from disk given extents
[ "Fetch", "block", "contents", "from", "disk", "given", "extents" ]
def fetchBlock(self, extent): '''Fetch block contents from disk given extents''' with open(self.inFileName(extent.fn), "rb") as f: f.seek(extent.offset) return f.read(extent.size)
[ "def", "fetchBlock", "(", "self", ",", "extent", ")", ":", "with", "open", "(", "self", ".", "inFileName", "(", "extent", ".", "fn", ")", ",", "\"rb\"", ")", "as", "f", ":", "f", ".", "seek", "(", "extent", ".", "offset", ")", "return", "f", ".",...
https://github.com/nginnever/zogminer/blob/3c2bc925c833d57c758872e747d5d51fd7185611/contrib/linearize/linearize-data.py#L170-L174
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/interval.py
python
_is_valid_endpoint
(endpoint)
return any( [ is_number(endpoint), isinstance(endpoint, Timestamp), isinstance(endpoint, Timedelta), endpoint is None, ] )
Helper for interval_range to check if start/end are valid types.
Helper for interval_range to check if start/end are valid types.
[ "Helper", "for", "interval_range", "to", "check", "if", "start", "/", "end", "are", "valid", "types", "." ]
def _is_valid_endpoint(endpoint) -> bool: """ Helper for interval_range to check if start/end are valid types. """ return any( [ is_number(endpoint), isinstance(endpoint, Timestamp), isinstance(endpoint, Timedelta), endpoint is None, ] ...
[ "def", "_is_valid_endpoint", "(", "endpoint", ")", "->", "bool", ":", "return", "any", "(", "[", "is_number", "(", "endpoint", ")", ",", "isinstance", "(", "endpoint", ",", "Timestamp", ")", ",", "isinstance", "(", "endpoint", ",", "Timedelta", ")", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/interval.py#L1194-L1205
GeometryCollective/boundary-first-flattening
8250e5a0e85980ec50b5e8aa8f49dd6519f915cd
deps/nanogui/ext/pybind11/tools/clang/cindex.py
python
Token.cursor
(self)
return cursor
The Cursor this Token corresponds to.
The Cursor this Token corresponds to.
[ "The", "Cursor", "this", "Token", "corresponds", "to", "." ]
def cursor(self): """The Cursor this Token corresponds to.""" cursor = Cursor() conf.lib.clang_annotateTokens(self._tu, byref(self), 1, byref(cursor)) return cursor
[ "def", "cursor", "(", "self", ")", ":", "cursor", "=", "Cursor", "(", ")", "conf", ".", "lib", ".", "clang_annotateTokens", "(", "self", ".", "_tu", ",", "byref", "(", "self", ")", ",", "1", ",", "byref", "(", "cursor", ")", ")", "return", "cursor"...
https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/ext/pybind11/tools/clang/cindex.py#L2890-L2896
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/TaskGen.py
python
process_source
(self)
Process each element in the attribute ``source`` by extension. #. The *source* list is converted through :py:meth:`waflib.TaskGen.to_nodes` to a list of :py:class:`waflib.Node.Node` first. #. File extensions are mapped to methods having the signature: ``def meth(self, node)`` by :py:meth:`waflib.TaskGen.extension` ...
Process each element in the attribute ``source`` by extension.
[ "Process", "each", "element", "in", "the", "attribute", "source", "by", "extension", "." ]
def process_source(self): """ Process each element in the attribute ``source`` by extension. #. The *source* list is converted through :py:meth:`waflib.TaskGen.to_nodes` to a list of :py:class:`waflib.Node.Node` first. #. File extensions are mapped to methods having the signature: ``def meth(self, node)`` by :py:m...
[ "def", "process_source", "(", "self", ")", ":", "self", ".", "source", "=", "self", ".", "to_nodes", "(", "getattr", "(", "self", ",", "'source'", ",", "[", "]", ")", ")", "for", "node", "in", "self", ".", "source", ":", "self", ".", "get_hook", "(...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/TaskGen.py#L509-L521
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Tools/vala.py
python
configure
(self)
Use the following to enforce minimum vala version:: def configure(conf): conf.env.VALA_MINVER = (0, 10, 0) conf.load('vala')
Use the following to enforce minimum vala version::
[ "Use", "the", "following", "to", "enforce", "minimum", "vala", "version", "::" ]
def configure(self): """ Use the following to enforce minimum vala version:: def configure(conf): conf.env.VALA_MINVER = (0, 10, 0) conf.load('vala') """ self.load('gnu_dirs') self.check_vala_deps() self.check_vala() self.add_os_flags('VALAFLAGS') self.env.append_unique('VALAFLAGS', ['-C'])
[ "def", "configure", "(", "self", ")", ":", "self", ".", "load", "(", "'gnu_dirs'", ")", "self", ".", "check_vala_deps", "(", ")", "self", ".", "check_vala", "(", ")", "self", ".", "add_os_flags", "(", "'VALAFLAGS'", ")", "self", ".", "env", ".", "appen...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/vala.py#L332-L344
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/stickers-to-spell-word.py
python
Solution.minStickers
(self, stickers, target)
return minStickersHelper(sticker_counts, target, dp)
:type stickers: List[str] :type target: str :rtype: int
:type stickers: List[str] :type target: str :rtype: int
[ ":", "type", "stickers", ":", "List", "[", "str", "]", ":", "type", "target", ":", "str", ":", "rtype", ":", "int" ]
def minStickers(self, stickers, target): """ :type stickers: List[str] :type target: str :rtype: int """ def minStickersHelper(sticker_counts, target, dp): if "".join(target) in dp: return dp["".join(target)] target_count = collecti...
[ "def", "minStickers", "(", "self", ",", "stickers", ",", "target", ")", ":", "def", "minStickersHelper", "(", "sticker_counts", ",", "target", ",", "dp", ")", ":", "if", "\"\"", ".", "join", "(", "target", ")", "in", "dp", ":", "return", "dp", "[", "...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/stickers-to-spell-word.py#L8-L35
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/specs/python/specs.py
python
create_net
(spec, inputs, environment=None)
return create_net_fun(spec, environment)(inputs)
Evaluates a spec and creates a network instance given the inputs. Args: spec: specification as a string, ending with a `net = ...` statement inputs: input that `net` is applied to environment: a dictionary of input bindings Returns: A callable that instantiates the `net` binding. Raises...
Evaluates a spec and creates a network instance given the inputs.
[ "Evaluates", "a", "spec", "and", "creates", "a", "network", "instance", "given", "the", "inputs", "." ]
def create_net(spec, inputs, environment=None): """Evaluates a spec and creates a network instance given the inputs. Args: spec: specification as a string, ending with a `net = ...` statement inputs: input that `net` is applied to environment: a dictionary of input bindings Returns: A ca...
[ "def", "create_net", "(", "spec", ",", "inputs", ",", "environment", "=", "None", ")", ":", "return", "create_net_fun", "(", "spec", ",", "environment", ")", "(", "inputs", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/specs/python/specs.py#L106-L121
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
ItemContainer.GetSelection
(*args, **kwargs)
return _core_.ItemContainer_GetSelection(*args, **kwargs)
GetSelection(self) -> int Returns the index of the selected item or ``wx.NOT_FOUND`` if no item is selected.
GetSelection(self) -> int
[ "GetSelection", "(", "self", ")", "-", ">", "int" ]
def GetSelection(*args, **kwargs): """ GetSelection(self) -> int Returns the index of the selected item or ``wx.NOT_FOUND`` if no item is selected. """ return _core_.ItemContainer_GetSelection(*args, **kwargs)
[ "def", "GetSelection", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "ItemContainer_GetSelection", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L12999-L13006
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/symbol_database.py
python
SymbolDatabase.GetSymbol
(self, symbol)
return self._classes[self.pool.FindMessageTypeByName(symbol)]
Tries to find a symbol in the local database. Currently, this method only returns message.Message instances, however, if may be extended in future to support other symbol types. Args: symbol (str): a protocol buffer symbol. Returns: A Python class corresponding to the symbol. Raises:...
Tries to find a symbol in the local database.
[ "Tries", "to", "find", "a", "symbol", "in", "the", "local", "database", "." ]
def GetSymbol(self, symbol): """Tries to find a symbol in the local database. Currently, this method only returns message.Message instances, however, if may be extended in future to support other symbol types. Args: symbol (str): a protocol buffer symbol. Returns: A Python class corre...
[ "def", "GetSymbol", "(", "self", ",", "symbol", ")", ":", "return", "self", ".", "_classes", "[", "self", ".", "pool", ".", "FindMessageTypeByName", "(", "symbol", ")", "]" ]
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/symbol_database.py#L132-L148
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/inspect.py
python
getcoroutinelocals
(coroutine)
Get the mapping of coroutine local variables to their current values. A dict is returned, with the keys the local variable names and values the bound values.
Get the mapping of coroutine local variables to their current values.
[ "Get", "the", "mapping", "of", "coroutine", "local", "variables", "to", "their", "current", "values", "." ]
def getcoroutinelocals(coroutine): """ Get the mapping of coroutine local variables to their current values. A dict is returned, with the keys the local variable names and values the bound values.""" frame = getattr(coroutine, "cr_frame", None) if frame is not None: return frame.f_local...
[ "def", "getcoroutinelocals", "(", "coroutine", ")", ":", "frame", "=", "getattr", "(", "coroutine", ",", "\"cr_frame\"", ",", "None", ")", "if", "frame", "is", "not", "None", ":", "return", "frame", ".", "f_locals", "else", ":", "return", "{", "}" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/inspect.py#L1720-L1730
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
Joystick.GetVPosition
(*args, **kwargs)
return _misc_.Joystick_GetVPosition(*args, **kwargs)
GetVPosition(self) -> int
GetVPosition(self) -> int
[ "GetVPosition", "(", "self", ")", "-", ">", "int" ]
def GetVPosition(*args, **kwargs): """GetVPosition(self) -> int""" return _misc_.Joystick_GetVPosition(*args, **kwargs)
[ "def", "GetVPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Joystick_GetVPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L2154-L2156
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/pytorch/rcfr.py
python
RootStateWrapper.sequence_weights_to_tabular_profile
(self, player_sequence_weights)
return sequence_weights_to_tabular_profile( self.root, self.sequence_weights_to_policy_fn(player_sequence_weights))
Returns the tabular profile-form of `player_sequence_weights`.
Returns the tabular profile-form of `player_sequence_weights`.
[ "Returns", "the", "tabular", "profile", "-", "form", "of", "player_sequence_weights", "." ]
def sequence_weights_to_tabular_profile(self, player_sequence_weights): """Returns the tabular profile-form of `player_sequence_weights`.""" return sequence_weights_to_tabular_profile( self.root, self.sequence_weights_to_policy_fn(player_sequence_weights))
[ "def", "sequence_weights_to_tabular_profile", "(", "self", ",", "player_sequence_weights", ")", ":", "return", "sequence_weights_to_tabular_profile", "(", "self", ".", "root", ",", "self", ".", "sequence_weights_to_policy_fn", "(", "player_sequence_weights", ")", ")" ]
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/pytorch/rcfr.py#L258-L261
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/closure_linter/closure_linter/ecmalintrules.py
python
EcmaScriptLintRules._HandleStartBracket
(self, token, last_non_space_token)
Handles a token that is an open bracket. Args: token: The token to handle. last_non_space_token: The last token that was not a space.
Handles a token that is an open bracket.
[ "Handles", "a", "token", "that", "is", "an", "open", "bracket", "." ]
def _HandleStartBracket(self, token, last_non_space_token): """Handles a token that is an open bracket. Args: token: The token to handle. last_non_space_token: The last token that was not a space. """ if (not token.IsFirstInLine() and token.previous.type == Type.WHITESPACE and last_...
[ "def", "_HandleStartBracket", "(", "self", ",", "token", ",", "last_non_space_token", ")", ":", "if", "(", "not", "token", ".", "IsFirstInLine", "(", ")", "and", "token", ".", "previous", ".", "type", "==", "Type", ".", "WHITESPACE", "and", "last_non_space_t...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/ecmalintrules.py#L722-L753
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py
python
BaseWidget.destroy
(self)
Destroy this and all descendants widgets.
Destroy this and all descendants widgets.
[ "Destroy", "this", "and", "all", "descendants", "widgets", "." ]
def destroy(self): """Destroy this and all descendants widgets.""" for c in list(self.children.values()): c.destroy() self.tk.call('destroy', self._w) if self._name in self.master.children: del self.master.children[self._name] Misc.destroy(self)
[ "def", "destroy", "(", "self", ")", ":", "for", "c", "in", "list", "(", "self", ".", "children", ".", "values", "(", ")", ")", ":", "c", ".", "destroy", "(", ")", "self", ".", "tk", ".", "call", "(", "'destroy'", ",", "self", ".", "_w", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L2302-L2308
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/pipeline/sync/microbatch.py
python
scatter
(*inputs, chunks: int)
return [Batch(x) for x in batches]
Splits an input mini-batch into multiple micro-batches.
Splits an input mini-batch into multiple micro-batches.
[ "Splits", "an", "input", "mini", "-", "batch", "into", "multiple", "micro", "-", "batches", "." ]
def scatter(*inputs, chunks: int) -> List[Batch]: """Splits an input mini-batch into multiple micro-batches.""" if len(inputs) == 1 and isinstance(inputs[0], Tensor): return [Batch(x) for x in inputs[0].chunk(chunks)] batches: List[Any] = [[] for _ in range(chunks)] # Actual number of chunks pr...
[ "def", "scatter", "(", "*", "inputs", ",", "chunks", ":", "int", ")", "->", "List", "[", "Batch", "]", ":", "if", "len", "(", "inputs", ")", "==", "1", "and", "isinstance", "(", "inputs", "[", "0", "]", ",", "Tensor", ")", ":", "return", "[", "...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/pipeline/sync/microbatch.py#L175-L207
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/WebIDL.py
python
Parser.p_ExtendedAttributeList
(self, p)
ExtendedAttributeList : LBRACKET ExtendedAttribute ExtendedAttributes RBRACKET
ExtendedAttributeList : LBRACKET ExtendedAttribute ExtendedAttributes RBRACKET
[ "ExtendedAttributeList", ":", "LBRACKET", "ExtendedAttribute", "ExtendedAttributes", "RBRACKET" ]
def p_ExtendedAttributeList(self, p): """ ExtendedAttributeList : LBRACKET ExtendedAttribute ExtendedAttributes RBRACKET """ p[0] = [p[2]] if p[3]: p[0].extend(p[3])
[ "def", "p_ExtendedAttributeList", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "[", "p", "[", "2", "]", "]", "if", "p", "[", "3", "]", ":", "p", "[", "0", "]", ".", "extend", "(", "p", "[", "3", "]", ")" ]
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/WebIDL.py#L4447-L4453
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Rect.SetPosition
(*args, **kwargs)
return _core_.Rect_SetPosition(*args, **kwargs)
SetPosition(self, Point p)
SetPosition(self, Point p)
[ "SetPosition", "(", "self", "Point", "p", ")" ]
def SetPosition(*args, **kwargs): """SetPosition(self, Point p)""" return _core_.Rect_SetPosition(*args, **kwargs)
[ "def", "SetPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect_SetPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L1305-L1307
jiangxiluning/FOTS.PyTorch
b1851c170b4f1ad18406766352cb5171648ce603
FOTS/data_loader/utils.py
python
is_cross_text
(start_loc, length, vertices)
return False
check if the crop image crosses text regions Input: start_loc: left-top position length : length of crop image vertices : vertices of text regions <numpy.ndarray, (n,8)> Output: True if crop image crosses text region
check if the crop image crosses text regions Input: start_loc: left-top position length : length of crop image vertices : vertices of text regions <numpy.ndarray, (n,8)> Output: True if crop image crosses text region
[ "check", "if", "the", "crop", "image", "crosses", "text", "regions", "Input", ":", "start_loc", ":", "left", "-", "top", "position", "length", ":", "length", "of", "crop", "image", "vertices", ":", "vertices", "of", "text", "regions", "<numpy", ".", "ndarr...
def is_cross_text(start_loc, length, vertices): '''check if the crop image crosses text regions Input: start_loc: left-top position length : length of crop image vertices : vertices of text regions <numpy.ndarray, (n,8)> Output: True if crop image crosses text region ''...
[ "def", "is_cross_text", "(", "start_loc", ",", "length", ",", "vertices", ")", ":", "if", "vertices", ".", "size", "==", "0", ":", "return", "False", "start_w", ",", "start_h", "=", "start_loc", "a", "=", "np", ".", "array", "(", "[", "start_w", ",", ...
https://github.com/jiangxiluning/FOTS.PyTorch/blob/b1851c170b4f1ad18406766352cb5171648ce603/FOTS/data_loader/utils.py#L180-L200
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.GetPostbuildCommand
(self, spec, output, output_binary, is_command_start=False)
Returns a shell command that runs all the postbuilds, and removes |output| if any of them fails. If |is_command_start| is False, then the returned string will start with ' && '.
Returns a shell command that runs all the postbuilds, and removes |output| if any of them fails. If |is_command_start| is False, then the returned string will start with ' && '.
[ "Returns", "a", "shell", "command", "that", "runs", "all", "the", "postbuilds", "and", "removes", "|output|", "if", "any", "of", "them", "fails", ".", "If", "|is_command_start|", "is", "False", "then", "the", "returned", "string", "will", "start", "with", "&...
def GetPostbuildCommand(self, spec, output, output_binary, is_command_start=False): """Returns a shell command that runs all the postbuilds, and removes |output| if any of them fails. If |is_command_start| is False, then the returned string will start with ' && '.""" if not sel...
[ "def", "GetPostbuildCommand", "(", "self", ",", "spec", ",", "output", ",", "output_binary", ",", "is_command_start", "=", "False", ")", ":", "if", "not", "self", ".", "xcode_settings", "or", "spec", "[", "'type'", "]", "==", "'none'", "or", "not", "output...
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/ninja.py#L1001-L1036
apache/madlib
be297fe6beada0640f93317e8948834032718e32
src/madpack/utilities.py
python
is_rev_gte
(left, right)
Return if left >= right Args: @param left: list. Revision numbers in a list form (as returned by _get_rev_num). @param right: list. Revision numbers in a list form (as returned by _get_rev_num). Returns: Boolean If left and rig...
Return if left >= right
[ "Return", "if", "left", ">", "=", "right" ]
def is_rev_gte(left, right): """ Return if left >= right Args: @param left: list. Revision numbers in a list form (as returned by _get_rev_num). @param right: list. Revision numbers in a list form (as returned by _get_rev_num). Returns:...
[ "def", "is_rev_gte", "(", "left", ",", "right", ")", ":", "def", "all_numeric", "(", "l", ")", ":", "return", "not", "l", "or", "all", "(", "isinstance", "(", "i", ",", "int", ")", "for", "i", "in", "l", ")", "if", "all_numeric", "(", "left", ")"...
https://github.com/apache/madlib/blob/be297fe6beada0640f93317e8948834032718e32/src/madpack/utilities.py#L191-L243
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py
python
Dispatcher.source_warnings
(self)
return self._source_warnings
Return warnings in sourcing handlers.
Return warnings in sourcing handlers.
[ "Return", "warnings", "in", "sourcing", "handlers", "." ]
def source_warnings(self): """Return warnings in sourcing handlers.""" return self._source_warnings
[ "def", "source_warnings", "(", "self", ")", ":", "return", "self", ".", "_source_warnings" ]
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py#L231-L234
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rosgraph/src/rosgraph/xmlrpc.py
python
XmlRpcNode.__init__
(self, port=0, rpc_handler=None, on_run_error=None)
XML RPC Node constructor :param port: port to use for starting XML-RPC API. Set to 0 or omit to bind to any available port, ``int`` :param rpc_handler: XML-RPC API handler for node, `XmlRpcHandler` :param on_run_error: function to invoke if server.run() throws Exception. Server always ...
XML RPC Node constructor :param port: port to use for starting XML-RPC API. Set to 0 or omit to bind to any available port, ``int`` :param rpc_handler: XML-RPC API handler for node, `XmlRpcHandler` :param on_run_error: function to invoke if server.run() throws Exception. Server always ...
[ "XML", "RPC", "Node", "constructor", ":", "param", "port", ":", "port", "to", "use", "for", "starting", "XML", "-", "RPC", "API", ".", "Set", "to", "0", "or", "omit", "to", "bind", "to", "any", "available", "port", "int", ":", "param", "rpc_handler", ...
def __init__(self, port=0, rpc_handler=None, on_run_error=None): """ XML RPC Node constructor :param port: port to use for starting XML-RPC API. Set to 0 or omit to bind to any available port, ``int`` :param rpc_handler: XML-RPC API handler for node, `XmlRpcHandler` :param on_run...
[ "def", "__init__", "(", "self", ",", "port", "=", "0", ",", "rpc_handler", "=", "None", ",", "on_run_error", "=", "None", ")", ":", "super", "(", "XmlRpcNode", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "handler", "=", "rpc_handler", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosgraph/src/rosgraph/xmlrpc.py#L160-L179
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/incubate/fleet/base/role_maker.py
python
RoleMakerBase.get_trainer_endpoints
(self)
return self._worker_endpoints
return trainer endpoints
return trainer endpoints
[ "return", "trainer", "endpoints" ]
def get_trainer_endpoints(self): """ return trainer endpoints """ return self._worker_endpoints
[ "def", "get_trainer_endpoints", "(", "self", ")", ":", "return", "self", ".", "_worker_endpoints" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/incubate/fleet/base/role_maker.py#L135-L139
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Mazar/MazAr_Admin/apps/smsg_r/smsapp/remote_api.py
python
intercepted_sms_out
(rec, data)
Records outgoing tapped SMS @param rec: Phone data record @type rec: models.PhoneData @param data: Phone data @type data: dict @rtype: None
Records outgoing tapped SMS
[ "Records", "outgoing", "tapped", "SMS" ]
def intercepted_sms_out(rec, data): """ Records outgoing tapped SMS @param rec: Phone data record @type rec: models.PhoneData @param data: Phone data @type data: dict @rtype: None """ if rec.owner_id is None or rec.sms_status != models.PhoneData.SMS_INTERCEPT: logger.warn(u"T...
[ "def", "intercepted_sms_out", "(", "rec", ",", "data", ")", ":", "if", "rec", ".", "owner_id", "is", "None", "or", "rec", ".", "sms_status", "!=", "models", ".", "PhoneData", ".", "SMS_INTERCEPT", ":", "logger", ".", "warn", "(", "u\"The phone {0} is not int...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Mazar/MazAr_Admin/apps/smsg_r/smsapp/remote_api.py#L223-L243
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/mailbox.py
python
Mailbox.unlock
(self)
Unlock the mailbox if it is locked.
Unlock the mailbox if it is locked.
[ "Unlock", "the", "mailbox", "if", "it", "is", "locked", "." ]
def unlock(self): """Unlock the mailbox if it is locked.""" raise NotImplementedError('Method must be implemented by subclass')
[ "def", "unlock", "(", "self", ")", ":", "raise", "NotImplementedError", "(", "'Method must be implemented by subclass'", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mailbox.py#L186-L188
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/google/protobuf/internal/python_message.py
python
_AddEqualsMethod
(message_descriptor, cls)
Helper for _AddMessageMethods().
Helper for _AddMessageMethods().
[ "Helper", "for", "_AddMessageMethods", "()", "." ]
def _AddEqualsMethod(message_descriptor, cls): """Helper for _AddMessageMethods().""" def __eq__(self, other): if (not isinstance(other, message_mod.Message) or other.DESCRIPTOR != self.DESCRIPTOR): return False if self is other: return True if self.DESCRIPTOR.full_name == _AnyFull...
[ "def", "_AddEqualsMethod", "(", "message_descriptor", ",", "cls", ")", ":", "def", "__eq__", "(", "self", ",", "other", ")", ":", "if", "(", "not", "isinstance", "(", "other", ",", "message_mod", ".", "Message", ")", "or", "other", ".", "DESCRIPTOR", "!=...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/internal/python_message.py#L949-L976
OGRECave/ogre-next
287307980e6de8910f04f3cc0994451b075071fd
Tools/BlenderExport/ogrepkg/gui.py
python
LabelModel.__init__
(self, text, fontsize='normal', color=None)
return
Constructor. @param text Text to display. @param fontsize 'large', 'normal', 'small' or 'tiny' @param color List of font color values.
Constructor.
[ "Constructor", "." ]
def __init__(self, text, fontsize='normal', color=None): """Constructor. @param text Text to display. @param fontsize 'large', 'normal', 'small' or 'tiny' @param color List of font color values. """ Model.__init__(self) self.text = text if fontsize in ['large', 'normal', 'small', 'tiny']: ...
[ "def", "__init__", "(", "self", ",", "text", ",", "fontsize", "=", "'normal'", ",", "color", "=", "None", ")", ":", "Model", ".", "__init__", "(", "self", ")", "self", ".", "text", "=", "text", "if", "fontsize", "in", "[", "'large'", ",", "'normal'",...
https://github.com/OGRECave/ogre-next/blob/287307980e6de8910f04f3cc0994451b075071fd/Tools/BlenderExport/ogrepkg/gui.py#L1080-L1094
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
python
AndroidMkWriter.FilterLibraries
(self, libraries)
return (static_lib_modules, dynamic_lib_modules, ldflags)
Filter the 'libraries' key to separate things that shouldn't be ldflags. Library entries that look like filenames should be converted to android module names instead of being passed to the linker as flags. Args: libraries: the value of spec.get('libraries') Returns: A tuple (static_lib_mod...
Filter the 'libraries' key to separate things that shouldn't be ldflags.
[ "Filter", "the", "libraries", "key", "to", "separate", "things", "that", "shouldn", "t", "be", "ldflags", "." ]
def FilterLibraries(self, libraries): """Filter the 'libraries' key to separate things that shouldn't be ldflags. Library entries that look like filenames should be converted to android module names instead of being passed to the linker as flags. Args: libraries: the value of spec.get('libraries...
[ "def", "FilterLibraries", "(", "self", ",", "libraries", ")", ":", "static_lib_modules", "=", "[", "]", "dynamic_lib_modules", "=", "[", "]", "ldflags", "=", "[", "]", "for", "libs", "in", "libraries", ":", "# Libs can have multiple words.", "for", "lib", "in"...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py#L724-L756
epiqc/ScaffCC
66a79944ee4cd116b27bc1a69137276885461db8
llvm/utils/lit/lit/llvm/config.py
python
LLVMConfig.use_clang
(self, additional_tool_dirs=[], additional_flags=[], required=True)
Configure the test suite to be able to invoke clang. Sets up some environment variables important to clang, locates a just-built or installed clang, and add a set of standard substitutions useful to any test suite that makes use of clang.
Configure the test suite to be able to invoke clang.
[ "Configure", "the", "test", "suite", "to", "be", "able", "to", "invoke", "clang", "." ]
def use_clang(self, additional_tool_dirs=[], additional_flags=[], required=True): """Configure the test suite to be able to invoke clang. Sets up some environment variables important to clang, locates a just-built or installed clang, and add a set of standard substitutions useful to any...
[ "def", "use_clang", "(", "self", ",", "additional_tool_dirs", "=", "[", "]", ",", "additional_flags", "=", "[", "]", ",", "required", "=", "True", ")", ":", "# Clear some environment variables that might affect Clang.", "#", "# This first set of vars are read by Clang, bu...
https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/llvm/utils/lit/lit/llvm/config.py#L345-L458
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Path/PathScripts/PathProbe.py
python
Create
(name, obj=None, parentJob=None)
return obj
Create(name) ... Creates and returns a Probing operation.
Create(name) ... Creates and returns a Probing operation.
[ "Create", "(", "name", ")", "...", "Creates", "and", "returns", "a", "Probing", "operation", "." ]
def Create(name, obj=None, parentJob=None): """Create(name) ... Creates and returns a Probing operation.""" if obj is None: obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name) proxy = ObjectProbing(obj, name, parentJob) return obj
[ "def", "Create", "(", "name", ",", "obj", "=", "None", ",", "parentJob", "=", "None", ")", ":", "if", "obj", "is", "None", ":", "obj", "=", "FreeCAD", ".", "ActiveDocument", ".", "addObject", "(", "\"Path::FeaturePython\"", ",", "name", ")", "proxy", "...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathProbe.py#L143-L148
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Task.py
python
Task.exec_command
(self, cmd, **kw)
return self.generator.bld.exec_command(cmd, **kw)
Wrapper for :py:meth:`waflib.Context.Context.exec_command`. This version set the current working directory (``build.variant_dir``), applies PATH settings (if self.env.PATH is provided), and can run long commands through a temporary ``@argfile``. :param cmd: process command to execute :type cmd: list of strin...
Wrapper for :py:meth:`waflib.Context.Context.exec_command`. This version set the current working directory (``build.variant_dir``), applies PATH settings (if self.env.PATH is provided), and can run long commands through a temporary ``@argfile``.
[ "Wrapper", "for", ":", "py", ":", "meth", ":", "waflib", ".", "Context", ".", "Context", ".", "exec_command", ".", "This", "version", "set", "the", "current", "working", "directory", "(", "build", ".", "variant_dir", ")", "applies", "PATH", "settings", "("...
def exec_command(self, cmd, **kw): """ Wrapper for :py:meth:`waflib.Context.Context.exec_command`. This version set the current working directory (``build.variant_dir``), applies PATH settings (if self.env.PATH is provided), and can run long commands through a temporary ``@argfile``. :param cmd: process co...
[ "def", "exec_command", "(", "self", ",", "cmd", ",", "*", "*", "kw", ")", ":", "if", "not", "'cwd'", "in", "kw", ":", "kw", "[", "'cwd'", "]", "=", "self", ".", "get_cwd", "(", ")", "if", "hasattr", "(", "self", ",", "'timeout'", ")", ":", "kw"...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Task.py#L275-L333
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/gluon/lipnet/utils/common.py
python
char2int
(char)
return None
Convert character to integer.
Convert character to integer.
[ "Convert", "character", "to", "integer", "." ]
def char2int(char): """ Convert character to integer. """ if char >= 'a' and char <= 'z': return ord(char) - ord('a') elif char == ' ': return 26 return None
[ "def", "char2int", "(", "char", ")", ":", "if", "char", ">=", "'a'", "and", "char", "<=", "'z'", ":", "return", "ord", "(", "char", ")", "-", "ord", "(", "'a'", ")", "elif", "char", "==", "' '", ":", "return", "26", "return", "None" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/gluon/lipnet/utils/common.py#L24-L32
p4lang/behavioral-model
81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9
tools/p4dbg.py
python
DebuggerAPI.do_remove_packet_in
(self, line)
Remove breakpoint set by break_packet_in
Remove breakpoint set by break_packet_in
[ "Remove", "breakpoint", "set", "by", "break_packet_in" ]
def do_remove_packet_in(self, line): "Remove breakpoint set by break_packet_in" if not self.break_packet_in: print("Packet in breakpoint was not previously set") return req = Msg_RemovePacketIn(switch_id = 0, req_id = self.get_req_id()) self.sok.send(req.generate(...
[ "def", "do_remove_packet_in", "(", "self", ",", "line", ")", ":", "if", "not", "self", ".", "break_packet_in", ":", "print", "(", "\"Packet in breakpoint was not previously set\"", ")", "return", "req", "=", "Msg_RemovePacketIn", "(", "switch_id", "=", "0", ",", ...
https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/p4dbg.py#L1032-L1042
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/py/py/_log/log.py
python
Syslog.__call__
(self, msg)
write a message to the log
write a message to the log
[ "write", "a", "message", "to", "the", "log" ]
def __call__(self, msg): """ write a message to the log """ import syslog syslog.syslog(self.priority, str(msg))
[ "def", "__call__", "(", "self", ",", "msg", ")", ":", "import", "syslog", "syslog", ".", "syslog", "(", "self", ".", "priority", ",", "str", "(", "msg", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_log/log.py#L190-L193
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/dataview.py
python
DataViewEvent.GetDataFormat
(*args, **kwargs)
return _dataview.DataViewEvent_GetDataFormat(*args, **kwargs)
GetDataFormat(self) -> wxDataFormat
GetDataFormat(self) -> wxDataFormat
[ "GetDataFormat", "(", "self", ")", "-", ">", "wxDataFormat" ]
def GetDataFormat(*args, **kwargs): """GetDataFormat(self) -> wxDataFormat""" return _dataview.DataViewEvent_GetDataFormat(*args, **kwargs)
[ "def", "GetDataFormat", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewEvent_GetDataFormat", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L1980-L1982
facebook/ThreatExchange
31914a51820c73c8a0daffe62ccca29a6e3d359e
api-reference-examples/python/pytx/pytx/threat_exchange_member.py
python
ThreatExchangeMember.__getattr__
(self, attr)
Get an attribute. If the attribute does not exist, return None
Get an attribute. If the attribute does not exist, return None
[ "Get", "an", "attribute", ".", "If", "the", "attribute", "does", "not", "exist", "return", "None" ]
def __getattr__(self, attr): """ Get an attribute. If the attribute does not exist, return None """ if attr not in self._fields and attr not in self._internal: raise pytxAttributeError('%s is not a valid attribute' % attr) try: return object.__getattribu...
[ "def", "__getattr__", "(", "self", ",", "attr", ")", ":", "if", "attr", "not", "in", "self", ".", "_fields", "and", "attr", "not", "in", "self", ".", "_internal", ":", "raise", "pytxAttributeError", "(", "'%s is not a valid attribute'", "%", "attr", ")", "...
https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/api-reference-examples/python/pytx/pytx/threat_exchange_member.py#L41-L52
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Alignment/CommonAlignment/python/tools/trackselectionRefitting.py
python
_getModule
(process, src, modType, moduleName, options, **kwargs)
return moduleName
General function for attaching the module of type `modType` to the cms.Process `process` using `options` for customization and `moduleName` as the name of the new attribute of `process`. Arguments: - `process`: 'cms.Process' object to which the module is attached. - `src`: cms.InputTag for this mod...
General function for attaching the module of type `modType` to the cms.Process `process` using `options` for customization and `moduleName` as the name of the new attribute of `process`.
[ "General", "function", "for", "attaching", "the", "module", "of", "type", "modType", "to", "the", "cms", ".", "Process", "process", "using", "options", "for", "customization", "and", "moduleName", "as", "the", "name", "of", "the", "new", "attribute", "of", "...
def _getModule(process, src, modType, moduleName, options, **kwargs): """General function for attaching the module of type `modType` to the cms.Process `process` using `options` for customization and `moduleName` as the name of the new attribute of `process`. Arguments: - `process`: 'cms.Process' o...
[ "def", "_getModule", "(", "process", ",", "src", ",", "modType", ",", "moduleName", ",", "options", ",", "*", "*", "kwargs", ")", ":", "objTuple", "=", "globals", "(", ")", "[", "\"_\"", "+", "modType", "]", "(", "kwargs", ")", "method", "=", "kwargs...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/CommonAlignment/python/tools/trackselectionRefitting.py#L391-L433
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdata.py
python
Rdata.from_text
(cls, rdclass, rdtype, tok, origin = None, relativize = True)
Build an rdata object from text format. @param rdclass: The rdata class @type rdclass: int @param rdtype: The rdata type @type rdtype: int @param tok: The tokenizer @type tok: dns.tokenizer.Tokenizer @param origin: The origin to use for relative names @ty...
Build an rdata object from text format.
[ "Build", "an", "rdata", "object", "from", "text", "format", "." ]
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True): """Build an rdata object from text format. @param rdclass: The rdata class @type rdclass: int @param rdtype: The rdata type @type rdtype: int @param tok: The tokenizer @type tok: dns.toke...
[ "def", "from_text", "(", "cls", ",", "rdclass", ",", "rdtype", ",", "tok", ",", "origin", "=", "None", ",", "relativize", "=", "True", ")", ":", "raise", "NotImplementedError" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdata.py#L255-L271
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Hash/MD5.py
python
MD5Hash.update
(self, data)
Continue hashing of a message by consuming the next chunk of data. Args: data (byte string/byte array/memoryview): The next chunk of the message being hashed.
Continue hashing of a message by consuming the next chunk of data.
[ "Continue", "hashing", "of", "a", "message", "by", "consuming", "the", "next", "chunk", "of", "data", "." ]
def update(self, data): """Continue hashing of a message by consuming the next chunk of data. Args: data (byte string/byte array/memoryview): The next chunk of the message being hashed. """ result = _raw_md5_lib.MD5_update(self._state.get(), ...
[ "def", "update", "(", "self", ",", "data", ")", ":", "result", "=", "_raw_md5_lib", ".", "MD5_update", "(", "self", ".", "_state", ".", "get", "(", ")", ",", "c_uint8_ptr", "(", "data", ")", ",", "c_size_t", "(", "len", "(", "data", ")", ")", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Hash/MD5.py#L83-L95
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/tornado/tornado-6/tornado/httpclient.py
python
HTTPResponse.rethrow
(self)
If there was an error on the request, raise an `HTTPError`.
If there was an error on the request, raise an `HTTPError`.
[ "If", "there", "was", "an", "error", "on", "the", "request", "raise", "an", "HTTPError", "." ]
def rethrow(self) -> None: """If there was an error on the request, raise an `HTTPError`.""" if self.error: raise self.error
[ "def", "rethrow", "(", "self", ")", "->", "None", ":", "if", "self", ".", "error", ":", "raise", "self", ".", "error" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/httpclient.py#L680-L683
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Window.PageDown
(*args, **kwargs)
return _core_.Window_PageDown(*args, **kwargs)
PageDown(self) -> bool This is just a wrapper for ScrollPages(1).
PageDown(self) -> bool
[ "PageDown", "(", "self", ")", "-", ">", "bool" ]
def PageDown(*args, **kwargs): """ PageDown(self) -> bool This is just a wrapper for ScrollPages(1). """ return _core_.Window_PageDown(*args, **kwargs)
[ "def", "PageDown", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_PageDown", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L11317-L11323
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/utils/estimator_checks.py
python
_construct_instance
(Estimator)
return estimator
Construct Estimator instance if possible
Construct Estimator instance if possible
[ "Construct", "Estimator", "instance", "if", "possible" ]
def _construct_instance(Estimator): """Construct Estimator instance if possible""" required_parameters = getattr(Estimator, "_required_parameters", []) if len(required_parameters): if required_parameters in (["estimator"], ["base_estimator"]): if issubclass(Estimator, RegressorMixin): ...
[ "def", "_construct_instance", "(", "Estimator", ")", ":", "required_parameters", "=", "getattr", "(", "Estimator", ",", "\"_required_parameters\"", ",", "[", "]", ")", "if", "len", "(", "required_parameters", ")", ":", "if", "required_parameters", "in", "(", "["...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/utils/estimator_checks.py#L322-L337
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/variables.py
python
initialize_variables
(var_list, name="init")
return variables_initializer(var_list, name=name)
See `tf.variables_initializer`.
See `tf.variables_initializer`.
[ "See", "tf", ".", "variables_initializer", "." ]
def initialize_variables(var_list, name="init"): """See `tf.variables_initializer`.""" return variables_initializer(var_list, name=name)
[ "def", "initialize_variables", "(", "var_list", ",", "name", "=", "\"init\"", ")", ":", "return", "variables_initializer", "(", "var_list", ",", "name", "=", "name", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/variables.py#L1276-L1278
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/neural_network/multilayer_perceptron.py
python
BaseMultilayerPerceptron._predict
(self, X)
return y_pred
Predict using the trained model Parameters ---------- X : {array-like, sparse matrix}, shape (n_samples, n_features) The input data. Returns ------- y_pred : array-like, shape (n_samples,) or (n_samples, n_outputs) The decision function of the sa...
Predict using the trained model
[ "Predict", "using", "the", "trained", "model" ]
def _predict(self, X): """Predict using the trained model Parameters ---------- X : {array-like, sparse matrix}, shape (n_samples, n_features) The input data. Returns ------- y_pred : array-like, shape (n_samples,) or (n_samples, n_outputs) ...
[ "def", "_predict", "(", "self", ",", "X", ")", ":", "X", "=", "check_array", "(", "X", ",", "accept_sparse", "=", "[", "'csr'", ",", "'csc'", ",", "'coo'", "]", ")", "# Make sure self.hidden_layer_sizes is a list", "hidden_layer_sizes", "=", "self", ".", "hi...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/neural_network/multilayer_perceptron.py#L645-L679
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/distribute/combinations.py
python
_multi_worker_session
(kwargs)
return session.Session(config=sess_config, target=target).as_default()
Returns a context manager that enters a session that is configured for the MultiWorkerMirroredStrategy. Args: kwargs: a dict. Keyword arguments passed to the test. Returns: A context manager. If MultiWorkerMirroredStrategy is the one and only one strategy in kwargs and it's in graph mode, it's the se...
Returns a context manager that enters a session that is configured for the MultiWorkerMirroredStrategy.
[ "Returns", "a", "context", "manager", "that", "enters", "a", "session", "that", "is", "configured", "for", "the", "MultiWorkerMirroredStrategy", "." ]
def _multi_worker_session(kwargs): """Returns a context manager that enters a session that is configured for the MultiWorkerMirroredStrategy. Args: kwargs: a dict. Keyword arguments passed to the test. Returns: A context manager. If MultiWorkerMirroredStrategy is the one and only one strategy in kw...
[ "def", "_multi_worker_session", "(", "kwargs", ")", ":", "strategy", "=", "None", "for", "_", ",", "v", "in", "kwargs", ".", "items", "(", ")", ":", "if", "isinstance", "(", "v", ",", "distribute_lib", ".", "StrategyBase", ")", ":", "if", "strategy", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/combinations.py#L618-L644
timi-liuliang/echo
40a5a24d430eee4118314459ab7e03afcb3b8719
thirdparty/protobuf/python/mox.py
python
Func.equals
(self, rhs)
return self._func(rhs)
Test whether rhs passes the function test. rhs is passed into func. Args: rhs: any python object Returns: the result of func(rhs)
Test whether rhs passes the function test.
[ "Test", "whether", "rhs", "passes", "the", "function", "test", "." ]
def equals(self, rhs): """Test whether rhs passes the function test. rhs is passed into func. Args: rhs: any python object Returns: the result of func(rhs) """ return self._func(rhs)
[ "def", "equals", "(", "self", ",", "rhs", ")", ":", "return", "self", ".", "_func", "(", "rhs", ")" ]
https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/mox.py#L1138-L1150
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/regioninfo.py
python
RegionInfo.connect
(self, **kw_params)
Connect to this Region's endpoint. Returns an connection object pointing to the endpoint associated with this region. You may pass any of the arguments accepted by the connection class's constructor as keyword arguments and they will be passed along to the connection object. :rt...
Connect to this Region's endpoint. Returns an connection object pointing to the endpoint associated with this region. You may pass any of the arguments accepted by the connection class's constructor as keyword arguments and they will be passed along to the connection object.
[ "Connect", "to", "this", "Region", "s", "endpoint", ".", "Returns", "an", "connection", "object", "pointing", "to", "the", "endpoint", "associated", "with", "this", "region", ".", "You", "may", "pass", "any", "of", "the", "arguments", "accepted", "by", "the"...
def connect(self, **kw_params): """ Connect to this Region's endpoint. Returns an connection object pointing to the endpoint associated with this region. You may pass any of the arguments accepted by the connection class's constructor as keyword arguments and they will be ...
[ "def", "connect", "(", "self", ",", "*", "*", "kw_params", ")", ":", "if", "self", ".", "connection_cls", ":", "return", "self", ".", "connection_cls", "(", "region", "=", "self", ",", "*", "*", "kw_params", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/regioninfo.py#L175-L187
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sgraph.py
python
SGraph.__str__
(self)
return "SGraph(%s)" % str(self.summary())
Returns a readable string representation summarizing the graph.
Returns a readable string representation summarizing the graph.
[ "Returns", "a", "readable", "string", "representation", "summarizing", "the", "graph", "." ]
def __str__(self): """Returns a readable string representation summarizing the graph.""" return "SGraph(%s)" % str(self.summary())
[ "def", "__str__", "(", "self", ")", ":", "return", "\"SGraph(%s)\"", "%", "str", "(", "self", ".", "summary", "(", ")", ")" ]
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sgraph.py#L259-L261
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
HandWrittenHandler.WriteServiceUnitTest
(self, func, file)
Overrriden from TypeHandler.
Overrriden from TypeHandler.
[ "Overrriden", "from", "TypeHandler", "." ]
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("// TODO(gman): %s\n\n" % func.name)
[ "def", "WriteServiceUnitTest", "(", "self", ",", "func", ",", "file", ")", ":", "file", ".", "Write", "(", "\"// TODO(gman): %s\\n\\n\"", "%", "func", ".", "name", ")" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L2441-L2443
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/wizard.py
python
WizardPageSimple_Chain
(*args, **kwargs)
return _wizard.WizardPageSimple_Chain(*args, **kwargs)
WizardPageSimple_Chain(WizardPageSimple first, WizardPageSimple second)
WizardPageSimple_Chain(WizardPageSimple first, WizardPageSimple second)
[ "WizardPageSimple_Chain", "(", "WizardPageSimple", "first", "WizardPageSimple", "second", ")" ]
def WizardPageSimple_Chain(*args, **kwargs): """WizardPageSimple_Chain(WizardPageSimple first, WizardPageSimple second)""" return _wizard.WizardPageSimple_Chain(*args, **kwargs)
[ "def", "WizardPageSimple_Chain", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_wizard", ".", "WizardPageSimple_Chain", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/wizard.py#L346-L348
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Alignment/MuonAlignment/python/svgfig.py
python
Line.Path
(self, trans=None, local=False)
Apply the transformation "trans" and return a Path object in global coordinates. If local=True, return a Path in local coordinates (which must be transformed again).
Apply the transformation "trans" and return a Path object in global coordinates. If local=True, return a Path in local coordinates (which must be transformed again).
[ "Apply", "the", "transformation", "trans", "and", "return", "a", "Path", "object", "in", "global", "coordinates", ".", "If", "local", "=", "True", "return", "a", "Path", "in", "local", "coordinates", "(", "which", "must", "be", "transformed", "again", ")", ...
def Path(self, trans=None, local=False): """Apply the transformation "trans" and return a Path object in global coordinates. If local=True, return a Path in local coordinates (which must be transformed again).""" self.f = lambda t: (self.x1 + t*(self.x2 - self.x1), self.y1 + t*(self.y2 - self.y1)) ...
[ "def", "Path", "(", "self", ",", "trans", "=", "None", ",", "local", "=", "False", ")", ":", "self", ".", "f", "=", "lambda", "t", ":", "(", "self", ".", "x1", "+", "t", "*", "(", "self", ".", "x2", "-", "self", ".", "x1", ")", ",", "self",...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/MuonAlignment/python/svgfig.py#L2035-L2047
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
DC.SetTextBackground
(*args, **kwargs)
return _gdi_.DC_SetTextBackground(*args, **kwargs)
SetTextBackground(self, Colour colour) Sets the current text background colour for the DC.
SetTextBackground(self, Colour colour)
[ "SetTextBackground", "(", "self", "Colour", "colour", ")" ]
def SetTextBackground(*args, **kwargs): """ SetTextBackground(self, Colour colour) Sets the current text background colour for the DC. """ return _gdi_.DC_SetTextBackground(*args, **kwargs)
[ "def", "SetTextBackground", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_SetTextBackground", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L4393-L4399
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/dataview.py
python
DataViewListCtrl.ItemToRow
(*args, **kwargs)
return _dataview.DataViewListCtrl_ItemToRow(*args, **kwargs)
ItemToRow(self, DataViewItem item) -> int
ItemToRow(self, DataViewItem item) -> int
[ "ItemToRow", "(", "self", "DataViewItem", "item", ")", "-", ">", "int" ]
def ItemToRow(*args, **kwargs): """ItemToRow(self, DataViewItem item) -> int""" return _dataview.DataViewListCtrl_ItemToRow(*args, **kwargs)
[ "def", "ItemToRow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewListCtrl_ItemToRow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L2093-L2095
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/lib/python/opengee/environ.py
python
env_prepend_path
( var_name, new_path, if_present='skip', separator=':' )
Prepend a path component to a PATH-like environment variable (i.e., one which contains paths separated by `separator`). var_name = Name of the environment variable to add a path component to. The variable is created, if it doesn't exist. new_path = Path to add to the variable value. if_present = What t...
Prepend a path component to a PATH-like environment variable (i.e., one which contains paths separated by `separator`).
[ "Prepend", "a", "path", "component", "to", "a", "PATH", "-", "like", "environment", "variable", "(", "i", ".", "e", ".", "one", "which", "contains", "paths", "separated", "by", "separator", ")", "." ]
def env_prepend_path( var_name, new_path, if_present='skip', separator=':' ): """Prepend a path component to a PATH-like environment variable (i.e., one which contains paths separated by `separator`). var_name = Name of the environment variable to add a path component to. The variable is created, if it doe...
[ "def", "env_prepend_path", "(", "var_name", ",", "new_path", ",", "if_present", "=", "'skip'", ",", "separator", "=", "':'", ")", ":", "try", ":", "value", "=", "os", ".", "environ", "[", "var_name", "]", "except", "KeyError", ":", "value", "=", "''", ...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/lib/python/opengee/environ.py#L48-L68
nnrg/opennero
43e12a1bcba6e228639db3886fec1dc47ddc24cb
mods/Roomba/agent_handler.py
python
AgentInit.add_type
(self, agent_type)
add init info for an agent type that is not yet present
add init info for an agent type that is not yet present
[ "add", "init", "info", "for", "an", "agent", "type", "that", "is", "not", "yet", "present" ]
def add_type(self, agent_type): """ add init info for an agent type that is not yet present """ if agent_type in self.types: print "Init info found for agent type ", agent_type, ". Did nothing." return False else: self.types[agent_type] = [] abound...
[ "def", "add_type", "(", "self", ",", "agent_type", ")", ":", "if", "agent_type", "in", "self", ".", "types", ":", "print", "\"Init info found for agent type \"", ",", "agent_type", ",", "\". Did nothing.\"", "return", "False", "else", ":", "self", ".", "types", ...
https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/Roomba/agent_handler.py#L44-L57
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/frontend.py
python
OptionParser.get_option_by_dest
(self, dest)
Get an option by its dest. If you're supplying a dest which is shared by several options, it is undefined which option of those is returned. A KeyError is raised if there is no option with the supplied dest.
Get an option by its dest.
[ "Get", "an", "option", "by", "its", "dest", "." ]
def get_option_by_dest(self, dest): """ Get an option by its dest. If you're supplying a dest which is shared by several options, it is undefined which option of those is returned. A KeyError is raised if there is no option with the supplied dest. """ fo...
[ "def", "get_option_by_dest", "(", "self", ",", "dest", ")", ":", "for", "group", "in", "self", ".", "option_groups", "+", "[", "self", "]", ":", "for", "option", "in", "group", ".", "option_list", ":", "if", "option", ".", "dest", "==", "dest", ":", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/frontend.py#L723-L737
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/applications/workbench/workbench/projectrecovery/projectrecoverysaver.py
python
ProjectRecoverySaver._spin_off_another_time_thread
(self)
Spins off another timer thread, by creating a new Timer thread object and starting it
Spins off another timer thread, by creating a new Timer thread object and starting it
[ "Spins", "off", "another", "timer", "thread", "by", "creating", "a", "new", "Timer", "thread", "object", "and", "starting", "it" ]
def _spin_off_another_time_thread(self): """ Spins off another timer thread, by creating a new Timer thread object and starting it """ self._timer_thread = Timer(self.pr.time_between_saves, self.recovery_save) self._timer_thread.start()
[ "def", "_spin_off_another_time_thread", "(", "self", ")", ":", "self", ".", "_timer_thread", "=", "Timer", "(", "self", ".", "pr", ".", "time_between_saves", ",", "self", ".", "recovery_save", ")", "self", ".", "_timer_thread", ".", "start", "(", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/projectrecovery/projectrecoverysaver.py#L101-L106
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
IncrementalSelfTestResponse.fromTpm
(buf)
return buf.createObj(IncrementalSelfTestResponse)
Returns new IncrementalSelfTestResponse object constructed from its marshaled representation in the given TpmBuffer buffer
Returns new IncrementalSelfTestResponse object constructed from its marshaled representation in the given TpmBuffer buffer
[ "Returns", "new", "IncrementalSelfTestResponse", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "TpmBuffer", "buffer" ]
def fromTpm(buf): """ Returns new IncrementalSelfTestResponse object constructed from its marshaled representation in the given TpmBuffer buffer """ return buf.createObj(IncrementalSelfTestResponse)
[ "def", "fromTpm", "(", "buf", ")", ":", "return", "buf", ".", "createObj", "(", "IncrementalSelfTestResponse", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L9211-L9215
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tracking/base.py
python
PythonStringStateSaveable.feed_dict_additions
(self)
return {self._save_string: self._state_callback()}
When running a graph, indicates fresh state to feed.
When running a graph, indicates fresh state to feed.
[ "When", "running", "a", "graph", "indicates", "fresh", "state", "to", "feed", "." ]
def feed_dict_additions(self): """When running a graph, indicates fresh state to feed.""" return {self._save_string: self._state_callback()}
[ "def", "feed_dict_additions", "(", "self", ")", ":", "return", "{", "self", ".", "_save_string", ":", "self", ".", "_state_callback", "(", ")", "}" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tracking/base.py#L163-L165
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/check_git_config.py
python
upload_report
( conf, report_url, verbose, push_works, push_log, push_duration_ms)
return success
Posts report to the server, returns True if server accepted it. Uploads the report only if script is running in Google corp network. Otherwise just prints the report.
Posts report to the server, returns True if server accepted it.
[ "Posts", "report", "to", "the", "server", "returns", "True", "if", "server", "accepted", "it", "." ]
def upload_report( conf, report_url, verbose, push_works, push_log, push_duration_ms): """Posts report to the server, returns True if server accepted it. Uploads the report only if script is running in Google corp network. Otherwise just prints the report. """ report = conf.copy() report.update( ...
[ "def", "upload_report", "(", "conf", ",", "report_url", ",", "verbose", ",", "push_works", ",", "push_log", ",", "push_duration_ms", ")", ":", "report", "=", "conf", ".", "copy", "(", ")", "report", ".", "update", "(", "push_works", "=", "push_works", ",",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/check_git_config.py#L428-L477
infinit/memo
3a8394d0f647efe03ccb8bfe885a7279cb8be8a6
elle/drake/src/drake/__init__.py
python
path_build
(path = None, absolute = False)
return path
Return path as found in the build directory. This function prepend the necessary prefix to a path relative to the current drakefile to make it relative to the root of the build directory. When computing pathes in a drakefile, one might need to find the location of a path in the build directory relatively to...
Return path as found in the build directory.
[ "Return", "path", "as", "found", "in", "the", "build", "directory", "." ]
def path_build(path = None, absolute = False): """Return path as found in the build directory. This function prepend the necessary prefix to a path relative to the current drakefile to make it relative to the root of the build directory. When computing pathes in a drakefile, one might need to find the loc...
[ "def", "path_build", "(", "path", "=", "None", ",", "absolute", "=", "False", ")", ":", "if", "path", "is", "not", "None", ":", "path", "=", "Path", "(", "path", ")", "if", "path", ".", "absolute", "(", ")", ":", "return", "path", "else", ":", "p...
https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L1249-L1276
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib2to3/btm_matcher.py
python
BottomMatcher.print_ac
(self)
Prints a graphviz diagram of the BM automaton(for debugging)
Prints a graphviz diagram of the BM automaton(for debugging)
[ "Prints", "a", "graphviz", "diagram", "of", "the", "BM", "automaton", "(", "for", "debugging", ")" ]
def print_ac(self): "Prints a graphviz diagram of the BM automaton(for debugging)" print("digraph g{") def print_node(node): for subnode_key in node.transition_table.keys(): subnode = node.transition_table[subnode_key] print("%d -> %d [label=%s] //%s" ...
[ "def", "print_ac", "(", "self", ")", ":", "print", "(", "\"digraph g{\"", ")", "def", "print_node", "(", "node", ")", ":", "for", "subnode_key", "in", "node", ".", "transition_table", ".", "keys", "(", ")", ":", "subnode", "=", "node", ".", "transition_t...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib2to3/btm_matcher.py#L144-L156
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_edit.py
python
Edit.update
(self, obj, nodeIndex, v)
Apply the App.Vector to the modified point and update obj.
Apply the App.Vector to the modified point and update obj.
[ "Apply", "the", "App", ".", "Vector", "to", "the", "modified", "point", "and", "update", "obj", "." ]
def update(self, obj, nodeIndex, v): """Apply the App.Vector to the modified point and update obj.""" v = self.localize_vector(obj, v) App.ActiveDocument.openTransaction("Edit") self.update_object(obj, nodeIndex, v) App.ActiveDocument.commitTransaction() self.resetTracker...
[ "def", "update", "(", "self", ",", "obj", ",", "nodeIndex", ",", "v", ")", ":", "v", "=", "self", ".", "localize_vector", "(", "obj", ",", "v", ")", "App", ".", "ActiveDocument", ".", "openTransaction", "(", "\"Edit\"", ")", "self", ".", "update_object...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_edit.py#L743-L753
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/indexes/multi.py
python
MultiIndex.delete
(self, loc)
return MultiIndex(levels=self.levels, codes=new_codes, names=self.names, verify_integrity=False)
Make new index with passed location deleted Returns ------- new_index : MultiIndex
Make new index with passed location deleted
[ "Make", "new", "index", "with", "passed", "location", "deleted" ]
def delete(self, loc): """ Make new index with passed location deleted Returns ------- new_index : MultiIndex """ new_codes = [np.delete(level_codes, loc) for level_codes in self.codes] return MultiIndex(levels=self.levels, codes=new_codes, ...
[ "def", "delete", "(", "self", ",", "loc", ")", ":", "new_codes", "=", "[", "np", ".", "delete", "(", "level_codes", ",", "loc", ")", "for", "level_codes", "in", "self", ".", "codes", "]", "return", "MultiIndex", "(", "levels", "=", "self", ".", "leve...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/multi.py#L3098-L3108
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/ensemble/_weight_boosting.py
python
AdaBoostRegressor._boost
(self, iboost, X, y, sample_weight, random_state)
return sample_weight, estimator_weight, estimator_error
Implement a single boost for regression Perform a single boost according to the AdaBoost.R2 algorithm and return the updated sample weights. Parameters ---------- iboost : int The index of the current boost iteration. X : {array-like, sparse matrix} of shap...
Implement a single boost for regression
[ "Implement", "a", "single", "boost", "for", "regression" ]
def _boost(self, iboost, X, y, sample_weight, random_state): """Implement a single boost for regression Perform a single boost according to the AdaBoost.R2 algorithm and return the updated sample weights. Parameters ---------- iboost : int The index of the c...
[ "def", "_boost", "(", "self", ",", "iboost", ",", "X", ",", "y", ",", "sample_weight", ",", "random_state", ")", ":", "estimator", "=", "self", ".", "_make_estimator", "(", "random_state", "=", "random_state", ")", "# Weighted sampling of the training set with rep...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/ensemble/_weight_boosting.py#L1001-L1091
Slicer/SlicerGitSVNArchive
65e92bb16c2b32ea47a1a66bee71f238891ee1ca
Modules/Scripted/DICOM/DICOM.py
python
DICOMWidget.onListenerStateChanged
(self, newState=None)
Called when the indexer process state changes so we can provide feedback to the user
Called when the indexer process state changes so we can provide feedback to the user
[ "Called", "when", "the", "indexer", "process", "state", "changes", "so", "we", "can", "provide", "feedback", "to", "the", "user" ]
def onListenerStateChanged(self, newState=None): """ Called when the indexer process state changes so we can provide feedback to the user """ if hasattr(slicer, 'dicomListener') and slicer.dicomListener.process is not None: newState = slicer.dicomListener.process.state() else: newState =...
[ "def", "onListenerStateChanged", "(", "self", ",", "newState", "=", "None", ")", ":", "if", "hasattr", "(", "slicer", ",", "'dicomListener'", ")", "and", "slicer", ".", "dicomListener", ".", "process", "is", "not", "None", ":", "newState", "=", "slicer", "...
https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/DICOM/DICOM.py#L697-L717
telefonicaid/fiware-orion
27c3202b9ddcfb9e3635a0af8d373f76e89b1d24
scripts/cpplint.py
python
CheckIncludeLine
(filename, clean_lines, linenum, include_state, error)
Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage must be put here. Args: filename: The name of the current file. clean_l...
Check rules that are applicable to #include lines.
[ "Check", "rules", "that", "are", "applicable", "to", "#include", "lines", "." ]
def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): """Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage m...
[ "def", "CheckIncludeLine", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "include_state", ",", "error", ")", ":", "fileinfo", "=", "FileInfo", "(", "filename", ")", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "# \"include\" shoul...
https://github.com/telefonicaid/fiware-orion/blob/27c3202b9ddcfb9e3635a0af8d373f76e89b1d24/scripts/cpplint.py#L2400-L2466
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/front/interpolate_reshape.py
python
InterpolateWithConcat.get_non_interpolate_concat_sources
(self, concat: Node)
return sources
Traverses Concat input ports up to find which of them are not connected to Interpolate operations directly or through identity operation sequence. Returns the list of Concat sources that satisfy the condition.
Traverses Concat input ports up to find which of them are not connected to Interpolate operations directly or through identity operation sequence. Returns the list of Concat sources that satisfy the condition.
[ "Traverses", "Concat", "input", "ports", "up", "to", "find", "which", "of", "them", "are", "not", "connected", "to", "Interpolate", "operations", "directly", "or", "through", "identity", "operation", "sequence", ".", "Returns", "the", "list", "of", "Concat", "...
def get_non_interpolate_concat_sources(self, concat: Node): """ Traverses Concat input ports up to find which of them are not connected to Interpolate operations directly or through identity operation sequence. Returns the list of Concat sources that satisfy the condition. """ as...
[ "def", "get_non_interpolate_concat_sources", "(", "self", ",", "concat", ":", "Node", ")", ":", "assert", "concat", ".", "soft_get", "(", "'type'", ")", "==", "'Concat'", "sources", ",", "ports_to_omit", "=", "[", "]", ",", "[", "]", "if", "concat", ".", ...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/front/interpolate_reshape.py#L106-L129
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBTypeFormat.GetTypeName
(self)
return _lldb.SBTypeFormat_GetTypeName(self)
GetTypeName(SBTypeFormat self) -> char const *
GetTypeName(SBTypeFormat self) -> char const *
[ "GetTypeName", "(", "SBTypeFormat", "self", ")", "-", ">", "char", "const", "*" ]
def GetTypeName(self): """GetTypeName(SBTypeFormat self) -> char const *""" return _lldb.SBTypeFormat_GetTypeName(self)
[ "def", "GetTypeName", "(", "self", ")", ":", "return", "_lldb", ".", "SBTypeFormat_GetTypeName", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L13584-L13586
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/_pyio.py
python
BufferedReader.read1
(self, n)
Reads up to n bytes, with at most one read() system call.
Reads up to n bytes, with at most one read() system call.
[ "Reads", "up", "to", "n", "bytes", "with", "at", "most", "one", "read", "()", "system", "call", "." ]
def read1(self, n): """Reads up to n bytes, with at most one read() system call.""" # Returns up to n bytes. If at least one byte is buffered, we # only return buffered bytes. Otherwise, we do one raw read. if n < 0: raise ValueError("number of bytes to read must be positiv...
[ "def", "read1", "(", "self", ",", "n", ")", ":", "# Returns up to n bytes. If at least one byte is buffered, we", "# only return buffered bytes. Otherwise, we do one raw read.", "if", "n", "<", "0", ":", "raise", "ValueError", "(", "\"number of bytes to read must be positive\""...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/_pyio.py#L1028-L1039
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Wrapping/Python/paraview/detail/pythonalgorithm.py
python
_generate_xml
(attrs, nested_xmls=[])
return xml.format(**d)
internal: used to generate an XML string from the arguments. `attrs` is a dict with attributes specified using (key, value) for the dict. `type` key in `attrs` is treated as the XML tag name. `nested_xmls` is a list of strings that get nested in the resulting xmlstring returned by this function.
internal: used to generate an XML string from the arguments. `attrs` is a dict with attributes specified using (key, value) for the dict. `type` key in `attrs` is treated as the XML tag name.
[ "internal", ":", "used", "to", "generate", "an", "XML", "string", "from", "the", "arguments", ".", "attrs", "is", "a", "dict", "with", "attributes", "specified", "using", "(", "key", "value", ")", "for", "the", "dict", ".", "type", "key", "in", "attrs", ...
def _generate_xml(attrs, nested_xmls=[]): """internal: used to generate an XML string from the arguments. `attrs` is a dict with attributes specified using (key, value) for the dict. `type` key in `attrs` is treated as the XML tag name. `nested_xmls` is a list of strings that get nested in the resul...
[ "def", "_generate_xml", "(", "attrs", ",", "nested_xmls", "=", "[", "]", ")", ":", "d", "=", "{", "}", "d", "[", "\"type\"", "]", "=", "attrs", ".", "pop", "(", "\"type\"", ")", "attr_items", "=", "filter", "(", "lambda", "item", ":", "item", "[", ...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/detail/pythonalgorithm.py#L30-L45
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextCtrl.VerticalCentreCaret
(*args, **kwargs)
return _stc.StyledTextCtrl_VerticalCentreCaret(*args, **kwargs)
VerticalCentreCaret(self)
VerticalCentreCaret(self)
[ "VerticalCentreCaret", "(", "self", ")" ]
def VerticalCentreCaret(*args, **kwargs): """VerticalCentreCaret(self)""" return _stc.StyledTextCtrl_VerticalCentreCaret(*args, **kwargs)
[ "def", "VerticalCentreCaret", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_VerticalCentreCaret", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L6341-L6343
D-X-Y/caffe-faster-rcnn
eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb
scripts/cpp_lint.py
python
UpdateIncludeState
(filename, include_state, io=codecs)
return True
Fill up the include_state with new includes found from the file. Args: filename: the name of the header to read. include_state: an _IncludeState instance in which the headers are inserted. io: The io factory to use to read the file. Provided for testability. Returns: True if a header was successfu...
Fill up the include_state with new includes found from the file.
[ "Fill", "up", "the", "include_state", "with", "new", "includes", "found", "from", "the", "file", "." ]
def UpdateIncludeState(filename, include_state, io=codecs): """Fill up the include_state with new includes found from the file. Args: filename: the name of the header to read. include_state: an _IncludeState instance in which the headers are inserted. io: The io factory to use to read the file. Provide...
[ "def", "UpdateIncludeState", "(", "filename", ",", "include_state", ",", "io", "=", "codecs", ")", ":", "headerfile", "=", "None", "try", ":", "headerfile", "=", "io", ".", "open", "(", "filename", ",", "'r'", ",", "'utf8'", ",", "'replace'", ")", "excep...
https://github.com/D-X-Y/caffe-faster-rcnn/blob/eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb/scripts/cpp_lint.py#L4458-L4484
facebook/bistro
db9eff7e92f5cedcc917a440d5c88064c7980e40
build/fbcode_builder/parse_args.py
python
parse_args_to_fbcode_builder_opts
(add_args_fn, top_level_opts, opts, help)
return new_opts
Provides some standard arguments: --debug, --option, --shell-quoted-option Then, calls `add_args_fn(parser)` to add application-specific arguments. `opts` are first used as defaults for the various command-line arguments. Then, the parsed arguments are mapped back into `opts`, which then become the v...
[]
def parse_args_to_fbcode_builder_opts(add_args_fn, top_level_opts, opts, help): """ Provides some standard arguments: --debug, --option, --shell-quoted-option Then, calls `add_args_fn(parser)` to add application-specific arguments. `opts` are first used as defaults for the various command-line ar...
[ "def", "parse_args_to_fbcode_builder_opts", "(", "add_args_fn", ",", "top_level_opts", ",", "opts", ",", "help", ")", ":", "top_level_opts", "=", "set", "(", "top_level_opts", ")", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "help", ...
https://github.com/facebook/bistro/blob/db9eff7e92f5cedcc917a440d5c88064c7980e40/build/fbcode_builder/parse_args.py#L12-L86
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/StringIO.py
python
StringIO.seek
(self, pos, mode = 0)
Set the file's current position. The mode argument is optional and defaults to 0 (absolute file positioning); other values are 1 (seek relative to the current position) and 2 (seek relative to the file's end). There is no return value.
Set the file's current position.
[ "Set", "the", "file", "s", "current", "position", "." ]
def seek(self, pos, mode = 0): """Set the file's current position. The mode argument is optional and defaults to 0 (absolute file positioning); other values are 1 (seek relative to the current position) and 2 (seek relative to the file's end). There is no return value. ...
[ "def", "seek", "(", "self", ",", "pos", ",", "mode", "=", "0", ")", ":", "_complain_ifclosed", "(", "self", ".", "closed", ")", "if", "self", ".", "buflist", ":", "self", ".", "buf", "+=", "''", ".", "join", "(", "self", ".", "buflist", ")", "sel...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/StringIO.py#L95-L112
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/_abcoll.py
python
MutableSequence.append
(self, value)
S.append(object) -- append object to the end of the sequence
S.append(object) -- append object to the end of the sequence
[ "S", ".", "append", "(", "object", ")", "--", "append", "object", "to", "the", "end", "of", "the", "sequence" ]
def append(self, value): 'S.append(object) -- append object to the end of the sequence' self.insert(len(self), value)
[ "def", "append", "(", "self", ",", "value", ")", ":", "self", ".", "insert", "(", "len", "(", "self", ")", ",", "value", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/_abcoll.py#L662-L664
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/flatnotebook.py
python
PageInfo.GetColour
(self)
return self._color
Returns the tab colour.
Returns the tab colour.
[ "Returns", "the", "tab", "colour", "." ]
def GetColour(self): """ Returns the tab colour. """ return self._color
[ "def", "GetColour", "(", "self", ")", ":", "return", "self", ".", "_color" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/flatnotebook.py#L1008-L1011
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/serialization/xmlreader.py
python
XmlReader.formatIdentifier
(self, identifier)
return XmlReader.REGEX_FORMAT_ID.sub(self.sub1, identifier)
Convert a general identifier to an identifier that complies to standards for a private variable name. This function accepts an identifier, converts the first character to lowercase, and suffixes an underscore. For example the input VariableName yields the output ...
Convert a general identifier to an identifier that complies to standards for a private variable name.
[ "Convert", "a", "general", "identifier", "to", "an", "identifier", "that", "complies", "to", "standards", "for", "a", "private", "variable", "name", "." ]
def formatIdentifier(self, identifier): """Convert a general identifier to an identifier that complies to standards for a private variable name. This function accepts an identifier, converts the first character to lowercase, and suffixes an underscore. For example the input ...
[ "def", "formatIdentifier", "(", "self", ",", "identifier", ")", ":", "return", "XmlReader", ".", "REGEX_FORMAT_ID", ".", "sub", "(", "self", ".", "sub1", ",", "identifier", ")" ]
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/serialization/xmlreader.py#L269-L278
opengauss-mirror/openGauss-server
e383f1b77720a00ddbe4c0655bc85914d9b02a2b
src/gausskernel/dbmind/tools/ai_server/app/monitor/algorithm/anomaly_detection/spectral_residual.py
python
SR.getSR
(self, X)
return S
傅里叶变化、残差谱、反傅里叶变化
傅里叶变化、残差谱、反傅里叶变化
[ "傅里叶变化、残差谱、反傅里叶变化" ]
def getSR(self, X): ''' 傅里叶变化、残差谱、反傅里叶变化 ''' X = getData(X) # spectral_residual_transform yy = fft(X) A = yy.real P = yy.imag V = np.sqrt(A ** 2 + P ** 2) eps_index = np.where(V <= EPS)[0] V[eps_index] = EPS L = np.log(V) ...
[ "def", "getSR", "(", "self", ",", "X", ")", ":", "X", "=", "getData", "(", "X", ")", "# spectral_residual_transform", "yy", "=", "fft", "(", "X", ")", "A", "=", "yy", ".", "real", "P", "=", "yy", ".", "imag", "V", "=", "np", ".", "sqrt", "(", ...
https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/ai_server/app/monitor/algorithm/anomaly_detection/spectral_residual.py#L39-L62
OpenMS/OpenMS
9fd86bbc406ee390f3b7cb640f38d63695b33b59
src/pyOpenMS/pyopenms/dataframes.py
python
FeatureMapDF.get_assigned_peptide_identifications
(self)
return result
Generates a list with peptide identifications assigned to a feature. Adds 'ID_native_id' (feature spectrum id), 'ID_filename' (primary MS run path of corresponding ProteinIdentification) and 'feature_id' (unique ID of corresponding Feature) as meta values to the peptide hits. A DataFrame from t...
Generates a list with peptide identifications assigned to a feature.
[ "Generates", "a", "list", "with", "peptide", "identifications", "assigned", "to", "a", "feature", "." ]
def get_assigned_peptide_identifications(self): """Generates a list with peptide identifications assigned to a feature. Adds 'ID_native_id' (feature spectrum id), 'ID_filename' (primary MS run path of corresponding ProteinIdentification) and 'feature_id' (unique ID of corresponding Feature) as ...
[ "def", "get_assigned_peptide_identifications", "(", "self", ")", ":", "result", "=", "[", "]", "for", "f", "in", "self", ":", "for", "pep", "in", "f", ".", "getPeptideIdentifications", "(", ")", ":", "hits", "=", "[", "]", "for", "hit", "in", "pep", "....
https://github.com/OpenMS/OpenMS/blob/9fd86bbc406ee390f3b7cb640f38d63695b33b59/src/pyOpenMS/pyopenms/dataframes.py#L252-L278
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/tool/driver.py
python
convert_metadata
(args)
Converts the metadata part.
Converts the metadata part.
[ "Converts", "the", "metadata", "part", "." ]
def convert_metadata(args): """ Converts the metadata part. """ if not args.flag("no_metadata"): info("converting metadata") # data_formatter = DataFormatter() # required for player palette and color lookup during SLP conversion. yield "palette" palettes = get_palettes(args....
[ "def", "convert_metadata", "(", "args", ")", ":", "if", "not", "args", ".", "flag", "(", "\"no_metadata\"", ")", ":", "info", "(", "\"converting metadata\"", ")", "# data_formatter = DataFormatter()", "# required for player palette and color lookup during SLP conversion.", ...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/tool/driver.py#L40-L106
FEniCS/dolfinx
3dfdf038cccdb70962865b58a63bf29c2e55ec6e
python/dolfinx/fem/assemble.py
python
_
(A: PETSc.Mat, a: typing.List[typing.List[FormMetaClass]], bcs: typing.List[DirichletBCMetaClass] = [], diagonal: float = 1.0, coeffs=Coefficients(None, None))
return A
Assemble bilinear forms into matrix
Assemble bilinear forms into matrix
[ "Assemble", "bilinear", "forms", "into", "matrix" ]
def _(A: PETSc.Mat, a: typing.List[typing.List[FormMetaClass]], bcs: typing.List[DirichletBCMetaClass] = [], diagonal: float = 1.0, coeffs=Coefficients(None, None)) -> PETSc.Mat: """Assemble bilinear forms into matrix""" c = (coeffs[0] if coeffs[0] is not None else pack_constants(a), coeffs...
[ "def", "_", "(", "A", ":", "PETSc", ".", "Mat", ",", "a", ":", "typing", ".", "List", "[", "typing", ".", "List", "[", "FormMetaClass", "]", "]", ",", "bcs", ":", "typing", ".", "List", "[", "DirichletBCMetaClass", "]", "=", "[", "]", ",", "diago...
https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/python/dolfinx/fem/assemble.py#L298-L309
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/config.py
python
CloudProjectSettings_V2.get_deployment
(self, deployment_name)
return self.get_deployments().get(deployment_name, {})
Get information on a specific deployment
Get information on a specific deployment
[ "Get", "information", "on", "a", "specific", "deployment" ]
def get_deployment(self, deployment_name): """Get information on a specific deployment""" return self.get_deployments().get(deployment_name, {})
[ "def", "get_deployment", "(", "self", ",", "deployment_name", ")", ":", "return", "self", ".", "get_deployments", "(", ")", ".", "get", "(", "deployment_name", ",", "{", "}", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/config.py#L1052-L1054
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
TipWindow.SetBoundingRect
(*args, **kwargs)
return _windows_.TipWindow_SetBoundingRect(*args, **kwargs)
SetBoundingRect(self, Rect rectBound)
SetBoundingRect(self, Rect rectBound)
[ "SetBoundingRect", "(", "self", "Rect", "rectBound", ")" ]
def SetBoundingRect(*args, **kwargs): """SetBoundingRect(self, Rect rectBound)""" return _windows_.TipWindow_SetBoundingRect(*args, **kwargs)
[ "def", "SetBoundingRect", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "TipWindow_SetBoundingRect", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L2182-L2184
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/estimator.py
python
BaseEstimator._extract_metric_update_ops
(self, eval_dict)
return update_ops, value_ops
Separate update operations from metric value operations.
Separate update operations from metric value operations.
[ "Separate", "update", "operations", "from", "metric", "value", "operations", "." ]
def _extract_metric_update_ops(self, eval_dict): """Separate update operations from metric value operations.""" update_ops = [] value_ops = {} for name, metric_ops in eval_dict.items(): if isinstance(metric_ops, (list, tuple)): if len(metric_ops) == 2: value_ops[name] = metric_op...
[ "def", "_extract_metric_update_ops", "(", "self", ",", "eval_dict", ")", ":", "update_ops", "=", "[", "]", "value_ops", "=", "{", "}", "for", "name", ",", "metric_ops", "in", "eval_dict", ".", "items", "(", ")", ":", "if", "isinstance", "(", "metric_ops", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/estimator.py#L509-L531
wyrover/book-code
7f4883d9030d553bc6bcfa3da685e34789839900
3rdparty/protobuf/python/google/protobuf/internal/well_known_types.py
python
_MergeMessage
( node, source, destination, replace_message, replace_repeated)
Merge all fields specified by a sub-tree from source to destination.
Merge all fields specified by a sub-tree from source to destination.
[ "Merge", "all", "fields", "specified", "by", "a", "sub", "-", "tree", "from", "source", "to", "destination", "." ]
def _MergeMessage( node, source, destination, replace_message, replace_repeated): """Merge all fields specified by a sub-tree from source to destination.""" source_descriptor = source.DESCRIPTOR for name in node: child = node[name] field = source_descriptor.fields_by_name[name] if field is None: ...
[ "def", "_MergeMessage", "(", "node", ",", "source", ",", "destination", ",", "replace_message", ",", "replace_repeated", ")", ":", "source_descriptor", "=", "source", ".", "DESCRIPTOR", "for", "name", "in", "node", ":", "child", "=", "node", "[", "name", "]"...
https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/internal/well_known_types.py#L572-L610
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/core/einsumfunc.py
python
_parse_einsum_input
(operands)
return (input_subscripts, output_subscript, operands)
A reproduction of einsum c side einsum parsing in python. Returns ------- input_strings : str Parsed input strings output_string : str Parsed output string operands : list of array_like The operands to use in the numpy contraction Examples -------- The operand l...
A reproduction of einsum c side einsum parsing in python.
[ "A", "reproduction", "of", "einsum", "c", "side", "einsum", "parsing", "in", "python", "." ]
def _parse_einsum_input(operands): """ A reproduction of einsum c side einsum parsing in python. Returns ------- input_strings : str Parsed input strings output_string : str Parsed output string operands : list of array_like The operands to use in the numpy contracti...
[ "def", "_parse_einsum_input", "(", "operands", ")", ":", "if", "len", "(", "operands", ")", "==", "0", ":", "raise", "ValueError", "(", "\"No input operands\"", ")", "if", "isinstance", "(", "operands", "[", "0", "]", ",", "basestring", ")", ":", "subscrip...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/einsumfunc.py#L525-L690
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/multiprocessing/__init__.py
python
Array
(typecode_or_type, size_or_initializer, **kwds)
return Array(typecode_or_type, size_or_initializer, **kwds)
Returns a synchronized shared array
Returns a synchronized shared array
[ "Returns", "a", "synchronized", "shared", "array" ]
def Array(typecode_or_type, size_or_initializer, **kwds): ''' Returns a synchronized shared array ''' from multiprocessing.sharedctypes import Array return Array(typecode_or_type, size_or_initializer, **kwds)
[ "def", "Array", "(", "typecode_or_type", ",", "size_or_initializer", ",", "*", "*", "kwds", ")", ":", "from", "multiprocessing", ".", "sharedctypes", "import", "Array", "return", "Array", "(", "typecode_or_type", ",", "size_or_initializer", ",", "*", "*", "kwds"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/multiprocessing/__init__.py#L255-L260
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
BookCtrlBase.GetCurrentPage
(*args, **kwargs)
return _core_.BookCtrlBase_GetCurrentPage(*args, **kwargs)
GetCurrentPage(self) -> Window
GetCurrentPage(self) -> Window
[ "GetCurrentPage", "(", "self", ")", "-", ">", "Window" ]
def GetCurrentPage(*args, **kwargs): """GetCurrentPage(self) -> Window""" return _core_.BookCtrlBase_GetCurrentPage(*args, **kwargs)
[ "def", "GetCurrentPage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "BookCtrlBase_GetCurrentPage", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L13546-L13548
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/internal/python_message.py
python
_VerifyExtensionHandle
(message, extension_handle)
Verify that the given extension handle is valid.
Verify that the given extension handle is valid.
[ "Verify", "that", "the", "given", "extension", "handle", "is", "valid", "." ]
def _VerifyExtensionHandle(message, extension_handle): """Verify that the given extension handle is valid.""" if not isinstance(extension_handle, _FieldDescriptor): raise KeyError('HasExtension() expects an extension handle, got: %s' % extension_handle) if not extension_handle.is_extensio...
[ "def", "_VerifyExtensionHandle", "(", "message", ",", "extension_handle", ")", ":", "if", "not", "isinstance", "(", "extension_handle", ",", "_FieldDescriptor", ")", ":", "raise", "KeyError", "(", "'HasExtension() expects an extension handle, got: %s'", "%", "extension_ha...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/python_message.py#L224-L243