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
HyeonwooNoh/caffe
d9e8494a2832d67b25dee37194c7bcb9d52d0e42
python/caffe/pycaffe.py
python
_Net_params
(self)
return OrderedDict([(name, lr.blobs) for name, lr in zip(self._layer_names, self.layers) if len(lr.blobs) > 0])
An OrderedDict (bottom to top, i.e., input to output) of network parameters indexed by name; each is a list of multiple blobs (e.g., weights and biases)
An OrderedDict (bottom to top, i.e., input to output) of network parameters indexed by name; each is a list of multiple blobs (e.g., weights and biases)
[ "An", "OrderedDict", "(", "bottom", "to", "top", "i", ".", "e", ".", "input", "to", "output", ")", "of", "network", "parameters", "indexed", "by", "name", ";", "each", "is", "a", "list", "of", "multiple", "blobs", "(", "e", ".", "g", ".", "weights", ...
def _Net_params(self): """ An OrderedDict (bottom to top, i.e., input to output) of network parameters indexed by name; each is a list of multiple blobs (e.g., weights and biases) """ return OrderedDict([(name, lr.blobs) for name, lr in zip(self._layer_names, self.layers)...
[ "def", "_Net_params", "(", "self", ")", ":", "return", "OrderedDict", "(", "[", "(", "name", ",", "lr", ".", "blobs", ")", "for", "name", ",", "lr", "in", "zip", "(", "self", ".", "_layer_names", ",", "self", ".", "layers", ")", "if", "len", "(", ...
https://github.com/HyeonwooNoh/caffe/blob/d9e8494a2832d67b25dee37194c7bcb9d52d0e42/python/caffe/pycaffe.py#L28-L36
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/encoding.py
python
auto_decode
(data)
return data.decode( locale.getpreferredencoding(False) or sys.getdefaultencoding(), )
Check a bytes string for a BOM to correctly detect the encoding Fallback to locale.getpreferredencoding(False) like open() on Python3
Check a bytes string for a BOM to correctly detect the encoding
[ "Check", "a", "bytes", "string", "for", "a", "BOM", "to", "correctly", "detect", "the", "encoding" ]
def auto_decode(data): # type: (bytes) -> str """Check a bytes string for a BOM to correctly detect the encoding Fallback to locale.getpreferredencoding(False) like open() on Python3""" for bom, encoding in BOMS: if data.startswith(bom): return data[len(bom):].decode(encoding...
[ "def", "auto_decode", "(", "data", ")", ":", "# type: (bytes) -> str", "for", "bom", ",", "encoding", "in", "BOMS", ":", "if", "data", ".", "startswith", "(", "bom", ")", ":", "return", "data", "[", "len", "(", "bom", ")", ":", "]", ".", "decode", "(...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/encoding.py#L47-L81
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py
python
Decimal.__str__
(self, eng=False, context=None)
return sign + intpart + fracpart + exp
Return string representation of the number in scientific notation. Captures all of the information in the underlying representation.
Return string representation of the number in scientific notation.
[ "Return", "string", "representation", "of", "the", "number", "in", "scientific", "notation", "." ]
def __str__(self, eng=False, context=None): """Return string representation of the number in scientific notation. Captures all of the information in the underlying representation. """ sign = ['', '-'][self._sign] if self._is_special: if self._exp == 'F': ...
[ "def", "__str__", "(", "self", ",", "eng", "=", "False", ",", "context", "=", "None", ")", ":", "sign", "=", "[", "''", ",", "'-'", "]", "[", "self", ".", "_sign", "]", "if", "self", ".", "_is_special", ":", "if", "self", ".", "_exp", "==", "'F...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py#L999-L1049
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/buffer.py
python
Buffer.apply_completion
(self, completion)
Insert a given completion.
Insert a given completion.
[ "Insert", "a", "given", "completion", "." ]
def apply_completion(self, completion): """ Insert a given completion. """ assert isinstance(completion, Completion) # If there was already a completion active, cancel that one. if self.complete_state: self.go_to_completion(None) self.complete_state =...
[ "def", "apply_completion", "(", "self", ",", "completion", ")", ":", "assert", "isinstance", "(", "completion", ",", "Completion", ")", "# If there was already a completion active, cancel that one.", "if", "self", ".", "complete_state", ":", "self", ".", "go_to_completi...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/buffer.py#L833-L846
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py
python
AppleScript_Suite_Events._b3_
(self, _object, _attributes={}, **_arguments)
\xb3: Greater than or equal to Required argument: an AE object reference Keyword argument _attributes: AppleEvent attribute dictionary Returns: anything
\xb3: Greater than or equal to Required argument: an AE object reference Keyword argument _attributes: AppleEvent attribute dictionary Returns: anything
[ "\\", "xb3", ":", "Greater", "than", "or", "equal", "to", "Required", "argument", ":", "an", "AE", "object", "reference", "Keyword", "argument", "_attributes", ":", "AppleEvent", "attribute", "dictionary", "Returns", ":", "anything" ]
def _b3_(self, _object, _attributes={}, **_arguments): """\xb3: Greater than or equal to Required argument: an AE object reference Keyword argument _attributes: AppleEvent attribute dictionary Returns: anything """ _code = 'ascr' _subcode = '>= ' if _arg...
[ "def", "_b3_", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'ascr'", "_subcode", "=", "'>= '", "if", "_arguments", ":", "raise", "TypeError", ",", "'No optional args expected'", "_ar...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py#L700-L719
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
examples/rfcn/lib/roi_data_layer/minibatch.py
python
get_minibatch
(roidb, num_classes)
return blobs
Given a roidb, construct a minibatch sampled from it.
Given a roidb, construct a minibatch sampled from it.
[ "Given", "a", "roidb", "construct", "a", "minibatch", "sampled", "from", "it", "." ]
def get_minibatch(roidb, num_classes): """Given a roidb, construct a minibatch sampled from it.""" num_images = len(roidb) num_reg_class = 2 if cfg.TRAIN.AGNOSTIC else num_classes # Sample random scales to use for each image in this batch random_scale_inds = npr.randint(0, high=len(cfg.TRAIN.SCALES)...
[ "def", "get_minibatch", "(", "roidb", ",", "num_classes", ")", ":", "num_images", "=", "len", "(", "roidb", ")", "num_reg_class", "=", "2", "if", "cfg", ".", "TRAIN", ".", "AGNOSTIC", "else", "num_classes", "# Sample random scales to use for each image in this batch...
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/rfcn/lib/roi_data_layer/minibatch.py#L18-L84
PaddlePaddle/PaddleOCR
b756bf5f8c90142e0d89d3db0163965c686b6ffe
ppocr/modeling/architectures/base_model.py
python
BaseModel.__init__
(self, config)
the module for OCR. args: config (dict): the super parameters for module.
the module for OCR. args: config (dict): the super parameters for module.
[ "the", "module", "for", "OCR", ".", "args", ":", "config", "(", "dict", ")", ":", "the", "super", "parameters", "for", "module", "." ]
def __init__(self, config): """ the module for OCR. args: config (dict): the super parameters for module. """ super(BaseModel, self).__init__() in_channels = config.get('in_channels', 3) model_type = config['model_type'] # build transfrom, ...
[ "def", "__init__", "(", "self", ",", "config", ")", ":", "super", "(", "BaseModel", ",", "self", ")", ".", "__init__", "(", ")", "in_channels", "=", "config", ".", "get", "(", "'in_channels'", ",", "3", ")", "model_type", "=", "config", "[", "'model_ty...
https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppocr/modeling/architectures/base_model.py#L27-L69
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/sping/WX/pidWxDc.py
python
PiddleWxDc._getWXfont
(self, font)
return wxFont(font.size, family, style, weight, underline)
Returns a wxFont roughly equivalent to the requested PIDDLE font
Returns a wxFont roughly equivalent to the requested PIDDLE font
[ "Returns", "a", "wxFont", "roughly", "equivalent", "to", "the", "requested", "PIDDLE", "font" ]
def _getWXfont(self, font): '''Returns a wxFont roughly equivalent to the requested PIDDLE font''' if font is None: font = self.defaultFont # PIDDLE fonts are matched to wxFont families. While it is possible to # match them to individual fonts, this is difficult to do in a platform # indep...
[ "def", "_getWXfont", "(", "self", ",", "font", ")", ":", "if", "font", "is", "None", ":", "font", "=", "self", ".", "defaultFont", "# PIDDLE fonts are matched to wxFont families. While it is possible to", "# match them to individual fonts, this is difficult to do in a platfo...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/WX/pidWxDc.py#L86-L112
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
samples/python/yolov3_onnx/data_processing.py
python
PreprocessYOLO._shuffle_and_normalize
(self, image)
return image
Normalize a NumPy array representing an image to the range [0, 1], and convert it from HWC format ("channels last") to NCHW format ("channels first" with leading batch dimension). Keyword arguments: image -- image as three-dimensional NumPy float array, in HWC format
Normalize a NumPy array representing an image to the range [0, 1], and convert it from HWC format ("channels last") to NCHW format ("channels first" with leading batch dimension).
[ "Normalize", "a", "NumPy", "array", "representing", "an", "image", "to", "the", "range", "[", "0", "1", "]", "and", "convert", "it", "from", "HWC", "format", "(", "channels", "last", ")", "to", "NCHW", "format", "(", "channels", "first", "with", "leading...
def _shuffle_and_normalize(self, image): """Normalize a NumPy array representing an image to the range [0, 1], and convert it from HWC format ("channels last") to NCHW format ("channels first" with leading batch dimension). Keyword arguments: image -- image as three-dimensional ...
[ "def", "_shuffle_and_normalize", "(", "self", ",", "image", ")", ":", "image", "/=", "255.0", "# HWC to CHW format:", "image", "=", "np", ".", "transpose", "(", "image", ",", "[", "2", ",", "0", ",", "1", "]", ")", "# CHW to NCHW format", "image", "=", "...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/samples/python/yolov3_onnx/data_processing.py#L85-L100
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/instrument.py
python
Instrument.impact_bid_price
(self, impact_bid_price)
Sets the impact_bid_price of this Instrument. :param impact_bid_price: The impact_bid_price of this Instrument. # noqa: E501 :type: float
Sets the impact_bid_price of this Instrument.
[ "Sets", "the", "impact_bid_price", "of", "this", "Instrument", "." ]
def impact_bid_price(self, impact_bid_price): """Sets the impact_bid_price of this Instrument. :param impact_bid_price: The impact_bid_price of this Instrument. # noqa: E501 :type: float """ self._impact_bid_price = impact_bid_price
[ "def", "impact_bid_price", "(", "self", ",", "impact_bid_price", ")", ":", "self", ".", "_impact_bid_price", "=", "impact_bid_price" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/instrument.py#L2378-L2386
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/common/api.py
python
_CellGraphExecutor.init_dataset
(self, queue_name, dataset_size, batch_size, dataset_types, dataset_shapes, input_indexs, phase='dataset')
return True
Initialization interface for calling data subgraph. Args: queue_name (str): The name of tdt queue on the device. dataset_size (int): The size of dataset. batch_size (int): The size of batch. dataset_types (list): The output types of element in dataset. ...
Initialization interface for calling data subgraph.
[ "Initialization", "interface", "for", "calling", "data", "subgraph", "." ]
def init_dataset(self, queue_name, dataset_size, batch_size, dataset_types, dataset_shapes, input_indexs, phase='dataset'): """ Initialization interface for calling data subgraph. Args: queue_name (str): The name of tdt queue on the device. dataset_s...
[ "def", "init_dataset", "(", "self", ",", "queue_name", ",", "dataset_size", ",", "batch_size", ",", "dataset_types", ",", "dataset_shapes", ",", "input_indexs", ",", "phase", "=", "'dataset'", ")", ":", "if", "not", "init_exec_dataset", "(", "queue_name", "=", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/common/api.py#L525-L551
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/rpm.py
python
build_specfile_filesection
(spec, files)
return str
builds the %file section of the specfile
builds the %file section of the specfile
[ "builds", "the", "%file", "section", "of", "the", "specfile" ]
def build_specfile_filesection(spec, files): """ builds the %file section of the specfile """ str = '%files\n' if 'X_RPM_DEFATTR' not in spec: spec['X_RPM_DEFATTR'] = '(-,root,root)' str = str + '%%defattr %s\n' % spec['X_RPM_DEFATTR'] supported_tags = { 'PACKAGING_CONFIG' ...
[ "def", "build_specfile_filesection", "(", "spec", ",", "files", ")", ":", "str", "=", "'%files\\n'", "if", "'X_RPM_DEFATTR'", "not", "in", "spec", ":", "spec", "[", "'X_RPM_DEFATTR'", "]", "=", "'(-,root,root)'", "str", "=", "str", "+", "'%%defattr %s\\n'", "%...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/rpm.py#L263-L302
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/transaction.py
python
Transaction.transact_status
(self, transact_status)
Sets the transact_status of this Transaction. :param transact_status: The transact_status of this Transaction. # noqa: E501 :type: str
Sets the transact_status of this Transaction.
[ "Sets", "the", "transact_status", "of", "this", "Transaction", "." ]
def transact_status(self, transact_status): """Sets the transact_status of this Transaction. :param transact_status: The transact_status of this Transaction. # noqa: E501 :type: str """ self._transact_status = transact_status
[ "def", "transact_status", "(", "self", ",", "transact_status", ")", ":", "self", ".", "_transact_status", "=", "transact_status" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/transaction.py#L243-L251
OpenChemistry/tomviz
0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a
tomviz/python/BinaryOpen.py
python
BinaryOpen.transform
(self, dataset, structuring_element_id=0, radius=1, object_label=1, background_label=0)
Perform morphological opening on segmented objects with a given label by a spherically symmetric structuring element with a given radius.
Perform morphological opening on segmented objects with a given label by a spherically symmetric structuring element with a given radius.
[ "Perform", "morphological", "opening", "on", "segmented", "objects", "with", "a", "given", "label", "by", "a", "spherically", "symmetric", "structuring", "element", "with", "a", "given", "radius", "." ]
def transform(self, dataset, structuring_element_id=0, radius=1, object_label=1, background_label=0): """Perform morphological opening on segmented objects with a given label by a spherically symmetric structuring element with a given radius. """ # Initial progress ...
[ "def", "transform", "(", "self", ",", "dataset", ",", "structuring_element_id", "=", "0", ",", "radius", "=", "1", ",", "object_label", "=", "1", ",", "background_label", "=", "0", ")", ":", "# Initial progress", "self", ".", "progress", ".", "value", "=",...
https://github.com/OpenChemistry/tomviz/blob/0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a/tomviz/python/BinaryOpen.py#L6-L86
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/array_ops.py
python
_BatchToSpaceShape
(op)
return [tensor_shape.TensorShape([batch, height, width, depth])]
Shape function for the BatchToSpace op. The output shape is determined by the following inputs/ attributes: * input: A rank-4 tensor with shape [B*block_size*block_size, Hp/block_size, Wp/block_size, D] Note that the batch size of the input tensor must be divisible by `block_size * block_size`. ...
Shape function for the BatchToSpace op.
[ "Shape", "function", "for", "the", "BatchToSpace", "op", "." ]
def _BatchToSpaceShape(op): """Shape function for the BatchToSpace op. The output shape is determined by the following inputs/ attributes: * input: A rank-4 tensor with shape [B*block_size*block_size, Hp/block_size, Wp/block_size, D] Note that the batch size of the input tensor must be divisible b...
[ "def", "_BatchToSpaceShape", "(", "op", ")", ":", "# Check that the input tensor is 4-D.", "try", ":", "input_shape", "=", "op", ".", "inputs", "[", "0", "]", ".", "get_shape", "(", ")", ".", "with_rank", "(", "4", ")", "except", "ValueError", ":", "raise", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/array_ops.py#L2379-L2453
xbmc/xbmc
091211a754589fc40a2a1f239b0ce9f4ee138268
tools/EventClients/lib/python/xbmcclient.py
python
XBMCClient.ping
(self)
Send a PING packet
Send a PING packet
[ "Send", "a", "PING", "packet" ]
def ping(self): """Send a PING packet""" packet = PacketPING() packet.send(self.sock, self.addr, self.uid)
[ "def", "ping", "(", "self", ")", ":", "packet", "=", "PacketPING", "(", ")", "packet", ".", "send", "(", "self", ".", "sock", ",", "self", ".", "addr", ",", "self", ".", "uid", ")" ]
https://github.com/xbmc/xbmc/blob/091211a754589fc40a2a1f239b0ce9f4ee138268/tools/EventClients/lib/python/xbmcclient.py#L511-L514
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/dateutil/dateutil/parser/_parser.py
python
_ymd._resolve_from_stridxs
(self, strids)
return (out.get('y'), out.get('m'), out.get('d'))
Try to resolve the identities of year/month/day elements using ystridx, mstridx, and dstridx, if enough of these are specified.
Try to resolve the identities of year/month/day elements using ystridx, mstridx, and dstridx, if enough of these are specified.
[ "Try", "to", "resolve", "the", "identities", "of", "year", "/", "month", "/", "day", "elements", "using", "ystridx", "mstridx", "and", "dstridx", "if", "enough", "of", "these", "are", "specified", "." ]
def _resolve_from_stridxs(self, strids): """ Try to resolve the identities of year/month/day elements using ystridx, mstridx, and dstridx, if enough of these are specified. """ if len(self) == 3 and len(strids) == 2: # we can back out the remaining stridx value ...
[ "def", "_resolve_from_stridxs", "(", "self", ",", "strids", ")", ":", "if", "len", "(", "self", ")", "==", "3", "and", "len", "(", "strids", ")", "==", "2", ":", "# we can back out the remaining stridx value", "missing", "=", "[", "x", "for", "x", "in", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/dateutil/dateutil/parser/_parser.py#L456-L472
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBAttachInfo.GetParentProcessID
(self)
return _lldb.SBAttachInfo_GetParentProcessID(self)
GetParentProcessID(self) -> pid_t
GetParentProcessID(self) -> pid_t
[ "GetParentProcessID", "(", "self", ")", "-", ">", "pid_t" ]
def GetParentProcessID(self): """GetParentProcessID(self) -> pid_t""" return _lldb.SBAttachInfo_GetParentProcessID(self)
[ "def", "GetParentProcessID", "(", "self", ")", ":", "return", "_lldb", ".", "SBAttachInfo_GetParentProcessID", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L1130-L1132
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/wsgiref/handlers.py
python
BaseHandler.handle_error
(self)
Log current error, and send error output to client if possible
Log current error, and send error output to client if possible
[ "Log", "current", "error", "and", "send", "error", "output", "to", "client", "if", "possible" ]
def handle_error(self): """Log current error, and send error output to client if possible""" self.log_exception(sys.exc_info()) if not self.headers_sent: self.result = self.error_output(self.environ, self.start_response) self.finish_response()
[ "def", "handle_error", "(", "self", ")", ":", "self", ".", "log_exception", "(", "sys", ".", "exc_info", "(", ")", ")", "if", "not", "self", ".", "headers_sent", ":", "self", ".", "result", "=", "self", ".", "error_output", "(", "self", ".", "environ",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/wsgiref/handlers.py#L376-L381
nci/drishti
89cd8b740239c5b2c8222dffd4e27432fde170a1
bin/assets/scripts/unet++/unet_collection/keras_vision_transformer/utils.py
python
freeze_model
(model, freeze_batch_norm=False)
return model
freeze a keras model Input ---------- model: a keras model freeze_batch_norm: False for not freezing batch notmalization layers
freeze a keras model Input ---------- model: a keras model freeze_batch_norm: False for not freezing batch notmalization layers
[ "freeze", "a", "keras", "model", "Input", "----------", "model", ":", "a", "keras", "model", "freeze_batch_norm", ":", "False", "for", "not", "freezing", "batch", "notmalization", "layers" ]
def freeze_model(model, freeze_batch_norm=False): ''' freeze a keras model Input ---------- model: a keras model freeze_batch_norm: False for not freezing batch notmalization layers ''' if freeze_batch_norm: for layer in model.layers: layer.trainable = Fa...
[ "def", "freeze_model", "(", "model", ",", "freeze_batch_norm", "=", "False", ")", ":", "if", "freeze_batch_norm", ":", "for", "layer", "in", "model", ".", "layers", ":", "layer", ".", "trainable", "=", "False", "else", ":", "from", "tensorflow", ".", "kera...
https://github.com/nci/drishti/blob/89cd8b740239c5b2c8222dffd4e27432fde170a1/bin/assets/scripts/unet++/unet_collection/keras_vision_transformer/utils.py#L75-L94
tensorflow/ngraph-bridge
ea6422491ec75504e78a63db029e7f74ec3479a5
diagnostics/remove_protobuf_class_attribute.py
python
get_args
()
return parser.parse_args()
Argument parser initialization
Argument parser initialization
[ "Argument", "parser", "initialization" ]
def get_args(): """ Argument parser initialization """ parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) group.add_argument( "-f", "--file", help="pbtxt from tensorflow", default=None) group.add_argument( "-d", "--directory", help="...
[ "def", "get_args", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "group", "=", "parser", ".", "add_mutually_exclusive_group", "(", "required", "=", "True", ")", "group", ".", "add_argument", "(", "\"-f\"", ",", "\"--file\"", ",",...
https://github.com/tensorflow/ngraph-bridge/blob/ea6422491ec75504e78a63db029e7f74ec3479a5/diagnostics/remove_protobuf_class_attribute.py#L120-L137
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/losses/python/losses/loss_ops.py
python
_scale_losses
(losses, weight)
return math_ops.reduce_sum(reduced_losses)
Computes the scaled loss. Args: losses: A `Tensor` of size [batch_size, d1, ... dN]. weight: A `Tensor` of size [1], [batch_size] or [batch_size, d1, ... dN]. The `losses` are reduced (tf.reduce_sum) until its dimension matches that of `weight` at which point the reduced `losses` are element-wise...
Computes the scaled loss.
[ "Computes", "the", "scaled", "loss", "." ]
def _scale_losses(losses, weight): """Computes the scaled loss. Args: losses: A `Tensor` of size [batch_size, d1, ... dN]. weight: A `Tensor` of size [1], [batch_size] or [batch_size, d1, ... dN]. The `losses` are reduced (tf.reduce_sum) until its dimension matches that of `weight` at which poi...
[ "def", "_scale_losses", "(", "losses", ",", "weight", ")", ":", "# First, compute the sum of the losses over all elements:", "start_index", "=", "max", "(", "0", ",", "weight", ".", "get_shape", "(", ")", ".", "ndims", ")", "reduction_indices", "=", "list", "(", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/losses/python/losses/loss_ops.py#L51-L74
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/database.py
python
EggInfoDistribution.list_installed_files
(self)
return result
Iterates over the ``installed-files.txt`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: a list of (path, hash, size)
Iterates over the ``installed-files.txt`` entries and returns a tuple ``(path, hash, size)`` for each line.
[ "Iterates", "over", "the", "installed", "-", "files", ".", "txt", "entries", "and", "returns", "a", "tuple", "(", "path", "hash", "size", ")", "for", "each", "line", "." ]
def list_installed_files(self): """ Iterates over the ``installed-files.txt`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: a list of (path, hash, size) """ def _md5(path): f = open(path, 'rb') try: c...
[ "def", "list_installed_files", "(", "self", ")", ":", "def", "_md5", "(", "path", ")", ":", "f", "=", "open", "(", "path", ",", "'rb'", ")", "try", ":", "content", "=", "f", ".", "read", "(", ")", "finally", ":", "f", ".", "close", "(", ")", "r...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/database.py#L1003-L1039
s9xie/DSN
065e49898d239f5c96be558616b2556eabc50351
scripts/cpp_lint.py
python
CheckForNonStandardConstructs
(filename, clean_lines, linenum, nesting_state, error)
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint is one way to ease the transition to new compilers. - put storage class first (e.g. "static const" instead of "const stat...
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
[ "r", "Logs", "an", "error", "if", "we", "see", "certain", "non", "-", "ANSI", "constructs", "ignored", "by", "gcc", "-", "2", "." ]
def CheckForNonStandardConstructs(filename, clean_lines, linenum, nesting_state, error): r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint ...
[ "def", "CheckForNonStandardConstructs", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Remove comments from the line, but leave in strings for now.", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "i...
https://github.com/s9xie/DSN/blob/065e49898d239f5c96be558616b2556eabc50351/scripts/cpp_lint.py#L2089-L2193
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/train/distributed.py
python
Communicator.num_workers
()
return cntk_py.number_of_workers()
Returns information about all MPI workers.
Returns information about all MPI workers.
[ "Returns", "information", "about", "all", "MPI", "workers", "." ]
def num_workers(): ''' Returns information about all MPI workers. ''' return cntk_py.number_of_workers()
[ "def", "num_workers", "(", ")", ":", "return", "cntk_py", ".", "number_of_workers", "(", ")" ]
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/train/distributed.py#L87-L91
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/serialize.py
python
_rebuild_reduction
(cls, *args)
return cls._rebuild(*args)
Global hook to rebuild a given class from its __reduce__ arguments.
Global hook to rebuild a given class from its __reduce__ arguments.
[ "Global", "hook", "to", "rebuild", "a", "given", "class", "from", "its", "__reduce__", "arguments", "." ]
def _rebuild_reduction(cls, *args): """ Global hook to rebuild a given class from its __reduce__ arguments. """ return cls._rebuild(*args)
[ "def", "_rebuild_reduction", "(", "cls", ",", "*", "args", ")", ":", "return", "cls", ".", "_rebuild", "(", "*", "args", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/serialize.py#L27-L31
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/numerictypes.py
python
sctype2char
(sctype)
return dtype(sctype).char
Return the string representation of a scalar dtype. Parameters ---------- sctype : scalar dtype or object If a scalar dtype, the corresponding string character is returned. If an object, `sctype2char` tries to infer its scalar type and then return the corresponding string character....
Return the string representation of a scalar dtype.
[ "Return", "the", "string", "representation", "of", "a", "scalar", "dtype", "." ]
def sctype2char(sctype): """ Return the string representation of a scalar dtype. Parameters ---------- sctype : scalar dtype or object If a scalar dtype, the corresponding string character is returned. If an object, `sctype2char` tries to infer its scalar type and then retur...
[ "def", "sctype2char", "(", "sctype", ")", ":", "sctype", "=", "obj2sctype", "(", "sctype", ")", "if", "sctype", "is", "None", ":", "raise", "ValueError", "(", "\"unrecognized type\"", ")", "if", "sctype", "not", "in", "_concrete_types", ":", "# for compatibili...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/numerictypes.py#L461-L509
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/op_def_library.py
python
_Restructure
(l, structure)
Returns the elements of list l structured according to the given structure. A structure is represented by a list whose elements are either `None` or a non-negative integer. `None` corresponds to a single element in the output list, and an integer N corresponds to a nested list of length N. The function retu...
Returns the elements of list l structured according to the given structure.
[ "Returns", "the", "elements", "of", "list", "l", "structured", "according", "to", "the", "given", "structure", "." ]
def _Restructure(l, structure): """Returns the elements of list l structured according to the given structure. A structure is represented by a list whose elements are either `None` or a non-negative integer. `None` corresponds to a single element in the output list, and an integer N corresponds to a nested l...
[ "def", "_Restructure", "(", "l", ",", "structure", ")", ":", "result", "=", "[", "]", "current_index", "=", "0", "for", "element", "in", "structure", ":", "if", "element", "is", "None", ":", "result", ".", "append", "(", "l", "[", "current_index", "]",...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/op_def_library.py#L91-L137
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
Simulator.contactForce
(self, aid: "int", bid: "int")
return _robotsim.Simulator_contactForce(self, aid, bid)
r""" contactForce(Simulator self, int aid, int bid) Returns the contact force on object a at the last time step. You can set bid to -1 to get the overall contact force on object a.
r""" contactForce(Simulator self, int aid, int bid)
[ "r", "contactForce", "(", "Simulator", "self", "int", "aid", "int", "bid", ")" ]
def contactForce(self, aid: "int", bid: "int") -> "void": r""" contactForce(Simulator self, int aid, int bid) Returns the contact force on object a at the last time step. You can set bid to -1 to get the overall contact force on object a. """ return _robotsim.Simulat...
[ "def", "contactForce", "(", "self", ",", "aid", ":", "\"int\"", ",", "bid", ":", "\"int\"", ")", "->", "\"void\"", ":", "return", "_robotsim", ".", "Simulator_contactForce", "(", "self", ",", "aid", ",", "bid", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L8413-L8422
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py
python
obj_analysis.is_result_map
(self)
return (self.result_type == 'map' or self.result_type == 'multimap')
Returns true if this is a map type.
Returns true if this is a map type.
[ "Returns", "true", "if", "this", "is", "a", "map", "type", "." ]
def is_result_map(self): """ Returns true if this is a map type. """ return (self.result_type == 'map' or self.result_type == 'multimap')
[ "def", "is_result_map", "(", "self", ")", ":", "return", "(", "self", ".", "result_type", "==", "'map'", "or", "self", ".", "result_type", "==", "'multimap'", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py#L1958-L1960
appcelerator-archive/titanium_desktop
37dbaab5664e595115e2fcdc348ed125cd50b48d
site_scons/simplejson/__init__.py
python
load
(fp, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, **kw)
return loads(fp.read(), encoding=encoding, cls=cls, object_hook=object_hook, parse_float=parse_float, parse_int=parse_int, parse_constant=parse_constant, **kw)
Deserialize ``fp`` (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. If the contents of ``fp`` is encoded with an ASCII based encoding other than utf-8 (e.g. latin-1), then an appropriate ``encoding`` name must be specified. Encodings that are not ASCII based (s...
Deserialize ``fp`` (a ``.read()``-supporting file-like object containing a JSON document) to a Python object.
[ "Deserialize", "fp", "(", "a", ".", "read", "()", "-", "supporting", "file", "-", "like", "object", "containing", "a", "JSON", "document", ")", "to", "a", "Python", "object", "." ]
def load(fp, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, **kw): """Deserialize ``fp`` (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. If the contents of ``fp`` is encoded with an ASCII based encoding ot...
[ "def", "load", "(", "fp", ",", "encoding", "=", "None", ",", "cls", "=", "None", ",", "object_hook", "=", "None", ",", "parse_float", "=", "None", ",", "parse_int", "=", "None", ",", "parse_constant", "=", "None", ",", "*", "*", "kw", ")", ":", "re...
https://github.com/appcelerator-archive/titanium_desktop/blob/37dbaab5664e595115e2fcdc348ed125cd50b48d/site_scons/simplejson/__init__.py#L243-L267
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
ListCtrl.InsertImageItem
(*args, **kwargs)
return _controls_.ListCtrl_InsertImageItem(*args, **kwargs)
InsertImageItem(self, long index, int imageIndex) -> long
InsertImageItem(self, long index, int imageIndex) -> long
[ "InsertImageItem", "(", "self", "long", "index", "int", "imageIndex", ")", "-", ">", "long" ]
def InsertImageItem(*args, **kwargs): """InsertImageItem(self, long index, int imageIndex) -> long""" return _controls_.ListCtrl_InsertImageItem(*args, **kwargs)
[ "def", "InsertImageItem", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ListCtrl_InsertImageItem", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L4708-L4710
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
lldb/examples/python/file_extract.py
python
FileExtract.get_n_uint64
(self, n, fail_value=0)
Extract "n" uint64_t integers from the binary file at the current file position, returns a list of integers
Extract "n" uint64_t integers from the binary file at the current file position, returns a list of integers
[ "Extract", "n", "uint64_t", "integers", "from", "the", "binary", "file", "at", "the", "current", "file", "position", "returns", "a", "list", "of", "integers" ]
def get_n_uint64(self, n, fail_value=0): '''Extract "n" uint64_t integers from the binary file at the current file position, returns a list of integers''' s = self.read_size(8 * n) if s: return struct.unpack(self.byte_order + ("%u" % n) + 'Q', s) else: return (fai...
[ "def", "get_n_uint64", "(", "self", ",", "n", ",", "fail_value", "=", "0", ")", ":", "s", "=", "self", ".", "read_size", "(", "8", "*", "n", ")", "if", "s", ":", "return", "struct", ".", "unpack", "(", "self", ".", "byte_order", "+", "(", "\"%u\"...
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/examples/python/file_extract.py#L220-L226
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/aui.py
python
AuiMDIChildFrame.IsFullScreen
(*args, **kwargs)
return _aui.AuiMDIChildFrame_IsFullScreen(*args, **kwargs)
IsFullScreen(self) -> bool
IsFullScreen(self) -> bool
[ "IsFullScreen", "(", "self", ")", "-", ">", "bool" ]
def IsFullScreen(*args, **kwargs): """IsFullScreen(self) -> bool""" return _aui.AuiMDIChildFrame_IsFullScreen(*args, **kwargs)
[ "def", "IsFullScreen", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiMDIChildFrame_IsFullScreen", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1586-L1588
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/feather_format.py
python
to_feather
( df: DataFrame, path: FilePathOrBuffer[AnyStr], storage_options: StorageOptions = None, **kwargs, )
Write a DataFrame to the binary Feather format. Parameters ---------- df : DataFrame path : string file path, or file-like object {storage_options} .. versionadded:: 1.2.0 **kwargs : Additional keywords passed to `pyarrow.feather.write_feather`. .. versionadded:: 1.1....
Write a DataFrame to the binary Feather format.
[ "Write", "a", "DataFrame", "to", "the", "binary", "Feather", "format", "." ]
def to_feather( df: DataFrame, path: FilePathOrBuffer[AnyStr], storage_options: StorageOptions = None, **kwargs, ): """ Write a DataFrame to the binary Feather format. Parameters ---------- df : DataFrame path : string file path, or file-like object {storage_options} ...
[ "def", "to_feather", "(", "df", ":", "DataFrame", ",", "path", ":", "FilePathOrBuffer", "[", "AnyStr", "]", ",", "storage_options", ":", "StorageOptions", "=", "None", ",", "*", "*", "kwargs", ",", ")", ":", "import_optional_dependency", "(", "\"pyarrow\"", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/feather_format.py#L23-L87
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-digital/python/digital/qa_constellation_receiver.py
python
test_constellation_receiver.test_basic
(self)
Tests a bunch of different constellations by using generic modulation, a channel, and generic demodulation. The generic demodulation uses constellation_receiver which is what we're really trying to test.
Tests a bunch of different constellations by using generic modulation, a channel, and generic demodulation. The generic demodulation uses constellation_receiver which is what we're really trying to test.
[ "Tests", "a", "bunch", "of", "different", "constellations", "by", "using", "generic", "modulation", "a", "channel", "and", "generic", "demodulation", ".", "The", "generic", "demodulation", "uses", "constellation_receiver", "which", "is", "what", "we", "re", "reall...
def test_basic(self): """ Tests a bunch of different constellations by using generic modulation, a channel, and generic demodulation. The generic demodulation uses constellation_receiver which is what we're really trying to test. """ rndm = random.Random() ...
[ "def", "test_basic", "(", "self", ")", ":", "rndm", "=", "random", ".", "Random", "(", ")", "rndm", ".", "seed", "(", "SEED", ")", "# Assumes not more than 64 points in a constellation", "# Generates some random input data to use.", "self", ".", "src_data", "=", "tu...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/qa_constellation_receiver.py#L79-L133
apache/impala
8ddac48f3428c86f2cbd037ced89cfb903298b12
shell/impala_client.py
python
ImpalaHS2Client._transpose
(self, col_value_converters, columns)
return rows
Transpose the columns from a TFetchResultsResp into the row format returned by fetch() with all the values converted into their string representations for display. Uses the getters and stringifiers provided in col_value_converters[i] for column i.
Transpose the columns from a TFetchResultsResp into the row format returned by fetch() with all the values converted into their string representations for display. Uses the getters and stringifiers provided in col_value_converters[i] for column i.
[ "Transpose", "the", "columns", "from", "a", "TFetchResultsResp", "into", "the", "row", "format", "returned", "by", "fetch", "()", "with", "all", "the", "values", "converted", "into", "their", "string", "representations", "for", "display", ".", "Uses", "the", "...
def _transpose(self, col_value_converters, columns): """Transpose the columns from a TFetchResultsResp into the row format returned by fetch() with all the values converted into their string representations for display. Uses the getters and stringifiers provided in col_value_converters[i] for column i."...
[ "def", "_transpose", "(", "self", ",", "col_value_converters", ",", "columns", ")", ":", "tcols", "=", "[", "col_value_converters", "[", "i", "]", "[", "0", "]", "(", "col", ")", "for", "i", ",", "col", "in", "enumerate", "(", "columns", ")", "]", "n...
https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/impala_client.py#L836-L865
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/xcode_emulation.py
python
XcodeSettings.GetCflagsObjC
(self, configname)
return cflags_objc
Returns flags that need to be added to .m compilations.
Returns flags that need to be added to .m compilations.
[ "Returns", "flags", "that", "need", "to", "be", "added", "to", ".", "m", "compilations", "." ]
def GetCflagsObjC(self, configname): """Returns flags that need to be added to .m compilations.""" self.configname = configname cflags_objc = [] self._AddObjectiveCGarbageCollectionFlags(cflags_objc) self._AddObjectiveCARCFlags(cflags_objc) self._AddObjectiveCMissingPropertySynthesisFlags(cflags...
[ "def", "GetCflagsObjC", "(", "self", ",", "configname", ")", ":", "self", ".", "configname", "=", "configname", "cflags_objc", "=", "[", "]", "self", ".", "_AddObjectiveCGarbageCollectionFlags", "(", "cflags_objc", ")", "self", ".", "_AddObjectiveCARCFlags", "(", ...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/xcode_emulation.py#L668-L676
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/auto_bisect/bisect_perf_regression.py
python
BisectPerformanceMetrics.GetRevisionList
(self, depot, bad_revision, good_revision)
return source_control.GetRevisionList(bad_revision, good_revision, cwd=cwd)
Retrieves a list of all the commits between the bad revision and last known good revision.
Retrieves a list of all the commits between the bad revision and last known good revision.
[ "Retrieves", "a", "list", "of", "all", "the", "commits", "between", "the", "bad", "revision", "and", "last", "known", "good", "revision", "." ]
def GetRevisionList(self, depot, bad_revision, good_revision): """Retrieves a list of all the commits between the bad revision and last known good revision.""" cwd = self.depot_registry.GetDepotDir(depot) return source_control.GetRevisionList(bad_revision, good_revision, cwd=cwd)
[ "def", "GetRevisionList", "(", "self", ",", "depot", ",", "bad_revision", ",", "good_revision", ")", ":", "cwd", "=", "self", ".", "depot_registry", ".", "GetDepotDir", "(", "depot", ")", "return", "source_control", ".", "GetRevisionList", "(", "bad_revision", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/auto_bisect/bisect_perf_regression.py#L695-L700
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/grassprovider/ext/r_null.py
python
processInputs
(alg, parameters, context, feedback)
Prepare the GRASS import commands
Prepare the GRASS import commands
[ "Prepare", "the", "GRASS", "import", "commands" ]
def processInputs(alg, parameters, context, feedback): """Prepare the GRASS import commands""" if 'map' in alg.exportedLayers: return # We need to import without r.external alg.loadRasterLayerFromParameter('map', parameters, context, False) alg.postInputs(context)
[ "def", "processInputs", "(", "alg", ",", "parameters", ",", "context", ",", "feedback", ")", ":", "if", "'map'", "in", "alg", ".", "exportedLayers", ":", "return", "# We need to import without r.external", "alg", ".", "loadRasterLayerFromParameter", "(", "'map'", ...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/grassprovider/ext/r_null.py#L34-L41
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/generator/msvs.py
python
_GenerateNativeRulesForMSVS
(p, rules, output_dir, spec, options)
Generate a native rules file. Arguments: p: the target project rules: the set of rules to include output_dir: the directory in which the project/gyp resides spec: the project dict options: global generator options
Generate a native rules file.
[ "Generate", "a", "native", "rules", "file", "." ]
def _GenerateNativeRulesForMSVS(p, rules, output_dir, spec, options): """Generate a native rules file. Arguments: p: the target project rules: the set of rules to include output_dir: the directory in which the project/gyp resides spec: the project dict options: global generator options """ ...
[ "def", "_GenerateNativeRulesForMSVS", "(", "p", ",", "rules", ",", "output_dir", ",", "spec", ",", "options", ")", ":", "rules_filename", "=", "'%s%s.rules'", "%", "(", "spec", "[", "'target_name'", "]", ",", "options", ".", "suffix", ")", "rules_file", "=",...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/generator/msvs.py#L524-L559
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
kratos/python_scripts/from_json_check_result_process.py
python
FromJsonCheckResultProcess.__init__
(self, model, params)
The default constructor of the class Keyword arguments: self -- It signifies an instance of a class. model -- the model contaning the model_parts settings -- Kratos parameters containing solver settings.
The default constructor of the class
[ "The", "default", "constructor", "of", "the", "class" ]
def __init__(self, model, params): """ The default constructor of the class Keyword arguments: self -- It signifies an instance of a class. model -- the model contaning the model_parts settings -- Kratos parameters containing solver settings. """ KratosMultiphysi...
[ "def", "__init__", "(", "self", ",", "model", ",", "params", ")", ":", "KratosMultiphysics", ".", "Process", ".", "__init__", "(", "self", ")", "self", ".", "process", "=", "KratosMultiphysics", ".", "FromJSONCheckResultProcess", "(", "model", ",", "params", ...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/from_json_check_result_process.py#L26-L35
HyeonwooNoh/caffe
d9e8494a2832d67b25dee37194c7bcb9d52d0e42
scripts/cpp_lint.py
python
CheckSpacingForFunctionCall
(filename, line, linenum, error)
Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. line: The text of the line to check. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for the correctness of various spacing around function calls.
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "around", "function", "calls", "." ]
def CheckSpacingForFunctionCall(filename, line, linenum, error): """Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. line: The text of the line to check. linenum: The number of the line to check. error: The function to call with any ...
[ "def", "CheckSpacingForFunctionCall", "(", "filename", ",", "line", ",", "linenum", ",", "error", ")", ":", "# Since function calls often occur inside if/for/while/switch", "# expressions - which have their own, more liberal conventions - we", "# first see if we should be looking inside ...
https://github.com/HyeonwooNoh/caffe/blob/d9e8494a2832d67b25dee37194c7bcb9d52d0e42/scripts/cpp_lint.py#L2301-L2366
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/spatial/_plotutils.py
python
voronoi_plot_2d
(vor, ax=None, **kw)
return ax.figure
Plot the given Voronoi diagram in 2-D Parameters ---------- vor : scipy.spatial.Voronoi instance Diagram to plot ax : matplotlib.axes.Axes instance, optional Axes to plot on show_points: bool, optional Add the Voronoi points to the plot. show_vertices : bool, optional ...
Plot the given Voronoi diagram in 2-D
[ "Plot", "the", "given", "Voronoi", "diagram", "in", "2", "-", "D" ]
def voronoi_plot_2d(vor, ax=None, **kw): """ Plot the given Voronoi diagram in 2-D Parameters ---------- vor : scipy.spatial.Voronoi instance Diagram to plot ax : matplotlib.axes.Axes instance, optional Axes to plot on show_points: bool, optional Add the Voronoi poin...
[ "def", "voronoi_plot_2d", "(", "vor", ",", "ax", "=", "None", ",", "*", "*", "kw", ")", ":", "from", "matplotlib", ".", "collections", "import", "LineCollection", "if", "vor", ".", "points", ".", "shape", "[", "1", "]", "!=", "2", ":", "raise", "Valu...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/spatial/_plotutils.py#L115-L204
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
ext/ply/example/optcalc/calc.py
python
p_expression_binop
(t)
expression : expression PLUS expression | expression MINUS expression | expression TIMES expression | expression DIVIDE expression
expression : expression PLUS expression | expression MINUS expression | expression TIMES expression | expression DIVIDE expression
[ "expression", ":", "expression", "PLUS", "expression", "|", "expression", "MINUS", "expression", "|", "expression", "TIMES", "expression", "|", "expression", "DIVIDE", "expression" ]
def p_expression_binop(t): '''expression : expression PLUS expression | expression MINUS expression | expression TIMES expression | expression DIVIDE expression''' if t[2] == '+' : t[0] = t[1] + t[3] elif t[2] == '-': t[0] = t[1] - t[3] elif t[2] ==...
[ "def", "p_expression_binop", "(", "t", ")", ":", "if", "t", "[", "2", "]", "==", "'+'", ":", "t", "[", "0", "]", "=", "t", "[", "1", "]", "+", "t", "[", "3", "]", "elif", "t", "[", "2", "]", "==", "'-'", ":", "t", "[", "0", "]", "=", ...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/optcalc/calc.py#L73-L82
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sarray.py
python
SArray.__has_size__
(self)
return self.__proxy__.has_size()
Returns whether or not the size of the SArray is known.
Returns whether or not the size of the SArray is known.
[ "Returns", "whether", "or", "not", "the", "size", "of", "the", "SArray", "is", "known", "." ]
def __has_size__(self): """ Returns whether or not the size of the SArray is known. """ return self.__proxy__.has_size()
[ "def", "__has_size__", "(", "self", ")", ":", "return", "self", ".", "__proxy__", ".", "has_size", "(", ")" ]
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sarray.py#L1199-L1203
freelan-developers/freelan
779a1421adbbfa35568cea9b212d1ba0635570e1
packaging/osx/productbuild.py
python
productbuild_emitter
(target, source, env)
return (target, source)
The emitter
The emitter
[ "The", "emitter" ]
def productbuild_emitter(target, source, env): """The emitter""" env.Depends(target, env['PRODUCTBUILD_OPTIONS']) env.Depends(target, env['PRODUCTBUILD_RESOURCES']) return (target, source)
[ "def", "productbuild_emitter", "(", "target", ",", "source", ",", "env", ")", ":", "env", ".", "Depends", "(", "target", ",", "env", "[", "'PRODUCTBUILD_OPTIONS'", "]", ")", "env", ".", "Depends", "(", "target", ",", "env", "[", "'PRODUCTBUILD_RESOURCES'", ...
https://github.com/freelan-developers/freelan/blob/779a1421adbbfa35568cea9b212d1ba0635570e1/packaging/osx/productbuild.py#L56-L62
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
ImageHandler.CanReadStream
(*args, **kwargs)
return _core_.ImageHandler_CanReadStream(*args, **kwargs)
CanReadStream(self, InputStream stream) -> bool
CanReadStream(self, InputStream stream) -> bool
[ "CanReadStream", "(", "self", "InputStream", "stream", ")", "-", ">", "bool" ]
def CanReadStream(*args, **kwargs): """CanReadStream(self, InputStream stream) -> bool""" return _core_.ImageHandler_CanReadStream(*args, **kwargs)
[ "def", "CanReadStream", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "ImageHandler_CanReadStream", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L2644-L2646
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/compiler.py
python
CUDAKernel.inspect_asm
(self)
return self._func.ptx.get().decode('ascii')
Returns the PTX code for this kernel.
Returns the PTX code for this kernel.
[ "Returns", "the", "PTX", "code", "for", "this", "kernel", "." ]
def inspect_asm(self): ''' Returns the PTX code for this kernel. ''' return self._func.ptx.get().decode('ascii')
[ "def", "inspect_asm", "(", "self", ")", ":", "return", "self", ".", "_func", ".", "ptx", ".", "get", "(", ")", ".", "decode", "(", "'ascii'", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/compiler.py#L570-L574
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/distributions/distribution.py
python
_copy_fn
(fn)
return types.FunctionType( code=fn.__code__, globals=fn.__globals__, name=fn.__name__, argdefs=fn.__defaults__, closure=fn.__closure__)
Create a deep copy of fn. Args: fn: a callable Returns: A `FunctionType`: a deep copy of fn. Raises: TypeError: if `fn` is not a callable.
Create a deep copy of fn.
[ "Create", "a", "deep", "copy", "of", "fn", "." ]
def _copy_fn(fn): """Create a deep copy of fn. Args: fn: a callable Returns: A `FunctionType`: a deep copy of fn. Raises: TypeError: if `fn` is not a callable. """ if not callable(fn): raise TypeError("fn is not callable: %s" % fn) # The blessed way to copy a function. copy.deepcopy fai...
[ "def", "_copy_fn", "(", "fn", ")", ":", "if", "not", "callable", "(", "fn", ")", ":", "raise", "TypeError", "(", "\"fn is not callable: %s\"", "%", "fn", ")", "# The blessed way to copy a function. copy.deepcopy fails to create a", "# non-reference copy. Since:", "# typ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/distributions/distribution.py#L72-L101
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBEvent.Clear
(self)
return _lldb.SBEvent_Clear(self)
Clear(SBEvent self)
Clear(SBEvent self)
[ "Clear", "(", "SBEvent", "self", ")" ]
def Clear(self): """Clear(SBEvent self)""" return _lldb.SBEvent_Clear(self)
[ "def", "Clear", "(", "self", ")", ":", "return", "_lldb", ".", "SBEvent_Clear", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L4822-L4824
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBBlock.get_ranges_access_object
(self)
return self.ranges_access (self)
An accessor function that returns a ranges_access() object which allows lazy block address ranges access.
An accessor function that returns a ranges_access() object which allows lazy block address ranges access.
[ "An", "accessor", "function", "that", "returns", "a", "ranges_access", "()", "object", "which", "allows", "lazy", "block", "address", "ranges", "access", "." ]
def get_ranges_access_object(self): '''An accessor function that returns a ranges_access() object which allows lazy block address ranges access.''' return self.ranges_access (self)
[ "def", "get_ranges_access_object", "(", "self", ")", ":", "return", "self", ".", "ranges_access", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L1308-L1310
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/sparse/bsr.py
python
bsr_matrix.sum_duplicates
(self)
Eliminate duplicate matrix entries by adding them together The is an *in place* operation
Eliminate duplicate matrix entries by adding them together
[ "Eliminate", "duplicate", "matrix", "entries", "by", "adding", "them", "together" ]
def sum_duplicates(self): """Eliminate duplicate matrix entries by adding them together The is an *in place* operation """ if self.has_canonical_format: return self.sort_indices() R, C = self.blocksize M, N = self.shape # port of _sparsetools...
[ "def", "sum_duplicates", "(", "self", ")", ":", "if", "self", ".", "has_canonical_format", ":", "return", "self", ".", "sort_indices", "(", ")", "R", ",", "C", "=", "self", ".", "blocksize", "M", ",", "N", "=", "self", ".", "shape", "# port of _sparsetoo...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/sparse/bsr.py#L527-L558
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/catkin/cmake/parse_package_xml.py
python
main
(argv=sys.argv[1:])
Reads given package_xml and writes extracted variables to outfile.
Reads given package_xml and writes extracted variables to outfile.
[ "Reads", "given", "package_xml", "and", "writes", "extracted", "variables", "to", "outfile", "." ]
def main(argv=sys.argv[1:]): """ Reads given package_xml and writes extracted variables to outfile. """ parser = argparse.ArgumentParser(description="Read package.xml and write extracted variables to stdout") parser.add_argument('package_xml') parser.add_argument('outfile') args = parser.par...
[ "def", "main", "(", "argv", "=", "sys", ".", "argv", "[", "1", ":", "]", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "\"Read package.xml and write extracted variables to stdout\"", ")", "parser", ".", "add_argument", "(",...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/catkin/cmake/parse_package_xml.py#L91-L103
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/ma/core.py
python
make_mask
(m, copy=False, shrink=True, dtype=MaskType)
return result
Create a boolean mask from an array. Return `m` as a boolean mask, creating a copy if necessary or requested. The function can accept any sequence that is convertible to integers, or ``nomask``. Does not require that contents must be 0s and 1s, values of 0 are interepreted as False, everything else as...
Create a boolean mask from an array.
[ "Create", "a", "boolean", "mask", "from", "an", "array", "." ]
def make_mask(m, copy=False, shrink=True, dtype=MaskType): """ Create a boolean mask from an array. Return `m` as a boolean mask, creating a copy if necessary or requested. The function can accept any sequence that is convertible to integers, or ``nomask``. Does not require that contents must be 0...
[ "def", "make_mask", "(", "m", ",", "copy", "=", "False", ",", "shrink", "=", "True", ",", "dtype", "=", "MaskType", ")", ":", "if", "m", "is", "nomask", ":", "return", "nomask", "# Make sure the input dtype is valid.", "dtype", "=", "make_mask_descr", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L1558-L1644
BVLC/caffe
9b891540183ddc834a02b2bd81b31afae71b2153
python/caffe/draw.py
python
get_layer_label
(layer, rankdir, display_lrm=False)
return node_label
Define node label based on layer type. Parameters ---------- layer : caffe_pb2.LayerParameter rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. display_lrm : boolean, optional If True include the learning rate multipliers in the label (default is False). Returns ...
Define node label based on layer type.
[ "Define", "node", "label", "based", "on", "layer", "type", "." ]
def get_layer_label(layer, rankdir, display_lrm=False): """Define node label based on layer type. Parameters ---------- layer : caffe_pb2.LayerParameter rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. display_lrm : boolean, optional If True include the learning rate mult...
[ "def", "get_layer_label", "(", "layer", ",", "rankdir", ",", "display_lrm", "=", "False", ")", ":", "if", "rankdir", "in", "(", "'TB'", ",", "'BT'", ")", ":", "# If graph orientation is vertical, horizontal space is free and", "# vertical space is not; separate words with...
https://github.com/BVLC/caffe/blob/9b891540183ddc834a02b2bd81b31afae71b2153/python/caffe/draw.py#L101-L174
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/input.py
python
DependencyGraphNode.DependenciesToLinkAgainst
(self, targets)
return self._LinkDependenciesInternal(targets, True)
Returns a list of dependency targets that are linked into this target.
Returns a list of dependency targets that are linked into this target.
[ "Returns", "a", "list", "of", "dependency", "targets", "that", "are", "linked", "into", "this", "target", "." ]
def DependenciesToLinkAgainst(self, targets): """ Returns a list of dependency targets that are linked into this target. """ return self._LinkDependenciesInternal(targets, True)
[ "def", "DependenciesToLinkAgainst", "(", "self", ",", "targets", ")", ":", "return", "self", ".", "_LinkDependenciesInternal", "(", "targets", ",", "True", ")" ]
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/input.py#L1544-L1548
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/parsers.py
python
PythonParser._is_line_empty
(self, line)
return not line or all(not x for x in line)
Check if a line is empty or not. Parameters ---------- line : str, array-like The line of data to check. Returns ------- boolean : Whether or not the line is empty.
Check if a line is empty or not.
[ "Check", "if", "a", "line", "is", "empty", "or", "not", "." ]
def _is_line_empty(self, line): """ Check if a line is empty or not. Parameters ---------- line : str, array-like The line of data to check. Returns ------- boolean : Whether or not the line is empty. """ return not line or al...
[ "def", "_is_line_empty", "(", "self", ",", "line", ")", ":", "return", "not", "line", "or", "all", "(", "not", "x", "for", "x", "in", "line", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/parsers.py#L2789-L2802
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py
python
Menu.insert
(self, index, itemType, cnf={}, **kw)
Internal function.
Internal function.
[ "Internal", "function", "." ]
def insert(self, index, itemType, cnf={}, **kw): """Internal function.""" self.tk.call((self._w, 'insert', index, itemType) + self._options(cnf, kw))
[ "def", "insert", "(", "self", ",", "index", ",", "itemType", ",", "cnf", "=", "{", "}", ",", "*", "*", "kw", ")", ":", "self", ".", "tk", ".", "call", "(", "(", "self", ".", "_w", ",", "'insert'", ",", "index", ",", "itemType", ")", "+", "sel...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L2894-L2897
apache/qpid-proton
6bcdfebb55ea3554bc29b1901422532db331a591
python/proton/_transport.py
python
Transport.remote_channel_max
(self)
return pn_transport_remote_channel_max(self._impl)
The maximum allowed channel number of a transport's remote peer.
The maximum allowed channel number of a transport's remote peer.
[ "The", "maximum", "allowed", "channel", "number", "of", "a", "transport", "s", "remote", "peer", "." ]
def remote_channel_max(self) -> int: """ The maximum allowed channel number of a transport's remote peer. """ return pn_transport_remote_channel_max(self._impl)
[ "def", "remote_channel_max", "(", "self", ")", "->", "int", ":", "return", "pn_transport_remote_channel_max", "(", "self", ".", "_impl", ")" ]
https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_transport.py#L421-L425
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Tool/mssdk.py
python
generate
(env)
Add construction variables for an MS SDK to an Environment.
Add construction variables for an MS SDK to an Environment.
[ "Add", "construction", "variables", "for", "an", "MS", "SDK", "to", "an", "Environment", "." ]
def generate(env): """Add construction variables for an MS SDK to an Environment.""" mssdk_setup_env(env)
[ "def", "generate", "(", "env", ")", ":", "mssdk_setup_env", "(", "env", ")" ]
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/mssdk.py#L39-L41
rsocket/rsocket-cpp
45ed594ebd6701f40795c31ec922d784ec7fc921
build/fbcode_builder/getdeps/manifest.py
python
ManifestParser.get_required_system_packages
(self, ctx)
return { "rpm": self.get_section_as_args("rpms", ctx), "deb": self.get_section_as_args("debs", ctx), }
Returns dictionary of packager system -> list of packages
Returns dictionary of packager system -> list of packages
[ "Returns", "dictionary", "of", "packager", "system", "-", ">", "list", "of", "packages" ]
def get_required_system_packages(self, ctx): """Returns dictionary of packager system -> list of packages""" return { "rpm": self.get_section_as_args("rpms", ctx), "deb": self.get_section_as_args("debs", ctx), }
[ "def", "get_required_system_packages", "(", "self", ",", "ctx", ")", ":", "return", "{", "\"rpm\"", ":", "self", ".", "get_section_as_args", "(", "\"rpms\"", ",", "ctx", ")", ",", "\"deb\"", ":", "self", ".", "get_section_as_args", "(", "\"debs\"", ",", "ctx...
https://github.com/rsocket/rsocket-cpp/blob/45ed594ebd6701f40795c31ec922d784ec7fc921/build/fbcode_builder/getdeps/manifest.py#L337-L342
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/closure_linter/closure_linter/ecmametadatapass.py
python
EcmaMetaDataPass._EndStatement
(self)
Process the end of a statement.
Process the end of a statement.
[ "Process", "the", "end", "of", "a", "statement", "." ]
def _EndStatement(self): """Process the end of a statement.""" self._PopContextType(EcmaContext.STATEMENT) if self._context.type == EcmaContext.IMPLIED_BLOCK: self._token.metadata.is_implied_block_close = True self._PopContext()
[ "def", "_EndStatement", "(", "self", ")", ":", "self", ".", "_PopContextType", "(", "EcmaContext", ".", "STATEMENT", ")", "if", "self", ".", "_context", ".", "type", "==", "EcmaContext", ".", "IMPLIED_BLOCK", ":", "self", ".", "_token", ".", "metadata", "....
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/ecmametadatapass.py#L293-L298
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/cpplint.py
python
_IncludeState.ResetSection
(self, directive)
Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else").
Reset section checking for preprocessor directive.
[ "Reset", "section", "checking", "for", "preprocessor", "directive", "." ]
def ResetSection(self, directive): """Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else"). """ # The name of the current section. self._section = self._INITIAL_SECTION # The path of last found header. self._last_header = '' ...
[ "def", "ResetSection", "(", "self", ",", "directive", ")", ":", "# The name of the current section.", "self", ".", "_section", "=", "self", ".", "_INITIAL_SECTION", "# The path of last found header.", "self", ".", "_last_header", "=", "''", "# Update list of includes. No...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/cpplint.py#L641-L657
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PropertyGridInterface.SetColumnProportion
(*args, **kwargs)
return _propgrid.PropertyGridInterface_SetColumnProportion(*args, **kwargs)
SetColumnProportion(self, int column, int proportion) -> bool
SetColumnProportion(self, int column, int proportion) -> bool
[ "SetColumnProportion", "(", "self", "int", "column", "int", "proportion", ")", "-", ">", "bool" ]
def SetColumnProportion(*args, **kwargs): """SetColumnProportion(self, int column, int proportion) -> bool""" return _propgrid.PropertyGridInterface_SetColumnProportion(*args, **kwargs)
[ "def", "SetColumnProportion", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGridInterface_SetColumnProportion", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L1370-L1372
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/engine/functional.py
python
Functional._insert_layers
(self, layers, relevant_nodes=None)
Inserts Layers into the Network after Network creation. This is only valid for Keras Graph Networks. Layers added via this function will be included in the `call` computation and `get_config` of this Network. They will not be added to the Network's outputs. Args: layers: Arbitrary nested struc...
Inserts Layers into the Network after Network creation.
[ "Inserts", "Layers", "into", "the", "Network", "after", "Network", "creation", "." ]
def _insert_layers(self, layers, relevant_nodes=None): """Inserts Layers into the Network after Network creation. This is only valid for Keras Graph Networks. Layers added via this function will be included in the `call` computation and `get_config` of this Network. They will not be added to the Netwo...
[ "def", "_insert_layers", "(", "self", ",", "layers", ",", "relevant_nodes", "=", "None", ")", ":", "layers", "=", "nest", ".", "flatten", "(", "layers", ")", "tf_utils", ".", "assert_no_legacy_layers", "(", "layers", ")", "node_to_depth", "=", "{", "}", "f...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/functional.py#L730-L809
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/estimator/canned/head.py
python
_RegressionHeadWithMeanSquaredErrorLoss.create_estimator_spec
( self, features, mode, logits, labels=None, train_op_fn=None)
return model_fn.EstimatorSpec( mode=model_fn.ModeKeys.TRAIN, predictions=predictions, loss=training_loss, train_op=train_op_fn(training_loss))
See `Head`.
See `Head`.
[ "See", "Head", "." ]
def create_estimator_spec( self, features, mode, logits, labels=None, train_op_fn=None): """See `Head`.""" # Predict. with ops.name_scope(self._name, 'head'): logits = _check_logits(logits, self._logits_dimension) predictions = {prediction_keys.PredictionKeys.PREDICTIONS: logits} if ...
[ "def", "create_estimator_spec", "(", "self", ",", "features", ",", "mode", ",", "logits", ",", "labels", "=", "None", ",", "train_op_fn", "=", "None", ")", ":", "# Predict.", "with", "ops", ".", "name_scope", "(", "self", ".", "_name", ",", "'head'", ")"...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/estimator/canned/head.py#L836-L888
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/processor/conversion/aoc/upgrade_attribute_subprocessor.py
python
AoCUpgradeAttributeSubprocessor.work_rate_upgrade
(converter_group, line, value, operator, team=False)
return patches
Creates a patch for the work rate modify effect (ID: 13). :param converter_group: Tech/Civ that gets the patch. :type converter_group: ...dataformat.converter_object.ConverterObjectGroup :param line: Unit/Building line that has the ability. :type line: ...dataformat.converter_object.Con...
Creates a patch for the work rate modify effect (ID: 13).
[ "Creates", "a", "patch", "for", "the", "work", "rate", "modify", "effect", "(", "ID", ":", "13", ")", "." ]
def work_rate_upgrade(converter_group, line, value, operator, team=False): """ Creates a patch for the work rate modify effect (ID: 13). :param converter_group: Tech/Civ that gets the patch. :type converter_group: ...dataformat.converter_object.ConverterObjectGroup :param line: ...
[ "def", "work_rate_upgrade", "(", "converter_group", ",", "line", ",", "value", ",", "operator", ",", "team", "=", "False", ")", ":", "patches", "=", "[", "]", "# TODO: Implement", "return", "patches" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/upgrade_attribute_subprocessor.py#L2415-L2434
mamba-org/mamba
9379389d9732ea0002b62565e5cf8f5a934b6722
docs/source/tools/mermaid_inheritance.py
python
MermaidGraph.generate_dot
( self, name: str, urls: Dict = {}, # noqa env: BuildEnvironment = None, graph_attrs: Dict = {}, # noqa node_attrs: Dict = {}, # noqa edge_attrs: Dict = {}, # noqa )
return "".join(res)
Generate a mermaid graph from the classes that were passed in to __init__. *name* is the name of the graph. *urls* is a dictionary mapping class names to HTTP URLs. *graph_attrs*, *node_attrs*, *edge_attrs* are dictionaries containing key/value pairs to pass on as graphviz proper...
Generate a mermaid graph from the classes that were passed in to __init__. *name* is the name of the graph. *urls* is a dictionary mapping class names to HTTP URLs. *graph_attrs*, *node_attrs*, *edge_attrs* are dictionaries containing key/value pairs to pass on as graphviz proper...
[ "Generate", "a", "mermaid", "graph", "from", "the", "classes", "that", "were", "passed", "in", "to", "__init__", ".", "*", "name", "*", "is", "the", "name", "of", "the", "graph", ".", "*", "urls", "*", "is", "a", "dictionary", "mapping", "class", "name...
def generate_dot( self, name: str, urls: Dict = {}, # noqa env: BuildEnvironment = None, graph_attrs: Dict = {}, # noqa node_attrs: Dict = {}, # noqa edge_attrs: Dict = {}, # noqa ) -> str: """Generate a mermaid graph from the classes that were pas...
[ "def", "generate_dot", "(", "self", ",", "name", ":", "str", ",", "urls", ":", "Dict", "=", "{", "}", ",", "# noqa", "env", ":", "BuildEnvironment", "=", "None", ",", "graph_attrs", ":", "Dict", "=", "{", "}", ",", "# noqa", "node_attrs", ":", "Dict"...
https://github.com/mamba-org/mamba/blob/9379389d9732ea0002b62565e5cf8f5a934b6722/docs/source/tools/mermaid_inheritance.py#L91-L135
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/lib/grpc_debug_server.py
python
EventListenerBaseStreamHandler.on_value_event
(self, event)
Callback for Event proto received through the gRPC stream. This Event proto carries a Tensor in its summary.value[0] field. Args: event: The Event proto from the stream to be processed.
Callback for Event proto received through the gRPC stream.
[ "Callback", "for", "Event", "proto", "received", "through", "the", "gRPC", "stream", "." ]
def on_value_event(self, event): """Callback for Event proto received through the gRPC stream. This Event proto carries a Tensor in its summary.value[0] field. Args: event: The Event proto from the stream to be processed. """ raise NotImplementedError( "on_value_event() is not implem...
[ "def", "on_value_event", "(", "self", ",", "event", ")", ":", "raise", "NotImplementedError", "(", "\"on_value_event() is not implemented in the base servicer class\"", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/grpc_debug_server.py#L91-L100
ppizarro/coursera
b39847928df4d9d5986b801085c025e8e9122b6a
Learn to Program: Crafting Quality Code/assignment 1/a1-pizarro.py
python
stock_price_summary
(price_changes)
return round(gains, 2), round(losses, 2)
(list of number) -> (number, number) tuple price_changes contains a list of stock price changes. Return a 2-item tuple where the first item is the sum of the gains in price_changes and the second is the sum of the losses in price_changes. >>> stock_price_summary([0.01, 0.03, -0.02, -0.14, 0, 0, 0.10, ...
(list of number) -> (number, number) tuple
[ "(", "list", "of", "number", ")", "-", ">", "(", "number", "number", ")", "tuple" ]
def stock_price_summary(price_changes): """ (list of number) -> (number, number) tuple price_changes contains a list of stock price changes. Return a 2-item tuple where the first item is the sum of the gains in price_changes and the second is the sum of the losses in price_changes. >>> stock_price...
[ "def", "stock_price_summary", "(", "price_changes", ")", ":", "gains", "=", "0.0", "losses", "=", "0.0", "for", "value", "in", "price_changes", ":", "if", "value", ">=", "0", ":", "gains", "+=", "value", "else", ":", "losses", "+=", "value", "return", "r...
https://github.com/ppizarro/coursera/blob/b39847928df4d9d5986b801085c025e8e9122b6a/Learn to Program: Crafting Quality Code/assignment 1/a1-pizarro.py#L28-L58
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/random_ops.py
python
RandomCategorical.__init__
(self, dtype=mstype.int64)
Initialize RandomCategorical
Initialize RandomCategorical
[ "Initialize", "RandomCategorical" ]
def __init__(self, dtype=mstype.int64): """Initialize RandomCategorical""" self.dtype = dtype valid_values = (mstype.int32, mstype.int16, mstype.int64) Validator.check_type_name("dtype", dtype, valid_values, self.name) self.init_prim_io_names(inputs=['logits', 'num_samples', 'se...
[ "def", "__init__", "(", "self", ",", "dtype", "=", "mstype", ".", "int64", ")", ":", "self", ".", "dtype", "=", "dtype", "valid_values", "=", "(", "mstype", ".", "int32", ",", "mstype", ".", "int16", ",", "mstype", ".", "int64", ")", "Validator", "."...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/random_ops.py#L484-L492
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
armoryd.py
python
Armory_Json_Rpc_Server.jsonrpc_getarmorydinfo
(self)
return info
DESCRIPTION: Get information on the version of armoryd running on the server. PARAMETERS: None RETURN: A dictionary listing version of armoryd running on the server.
DESCRIPTION: Get information on the version of armoryd running on the server. PARAMETERS: None RETURN: A dictionary listing version of armoryd running on the server.
[ "DESCRIPTION", ":", "Get", "information", "on", "the", "version", "of", "armoryd", "running", "on", "the", "server", ".", "PARAMETERS", ":", "None", "RETURN", ":", "A", "dictionary", "listing", "version", "of", "armoryd", "running", "on", "the", "server", "....
def jsonrpc_getarmorydinfo(self): """ DESCRIPTION: Get information on the version of armoryd running on the server. PARAMETERS: None RETURN: A dictionary listing version of armoryd running on the server. """ isReady = TheBDM.getState() == BDM_BLOCKCHAIN_READY ...
[ "def", "jsonrpc_getarmorydinfo", "(", "self", ")", ":", "isReady", "=", "TheBDM", ".", "getState", "(", ")", "==", "BDM_BLOCKCHAIN_READY", "info", "=", "{", "'versionstr'", ":", "getVersionString", "(", "BTCARMORY_VERSION", ")", ",", "'version'", ":", "getVersio...
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryd.py#L1618-L1649
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
xmlNode.setListDoc
(self, doc)
update all nodes in the list to point to the right document
update all nodes in the list to point to the right document
[ "update", "all", "nodes", "in", "the", "list", "to", "point", "to", "the", "right", "document" ]
def setListDoc(self, doc): """update all nodes in the list to point to the right document """ if doc is None: doc__o = None else: doc__o = doc._o libxml2mod.xmlSetListDoc(self._o, doc__o)
[ "def", "setListDoc", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "libxml2mod", ".", "xmlSetListDoc", "(", "self", ".", "_o", ",", "doc__o", ")" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L3505-L3509
freesurfer/freesurfer
6dbe527d43ffa611acb2cd112e9469f9bfec8e36
python/freesurfer/subfields/thalamus.py
python
ThalamicNuclei.get_label_groups
(self)
return labelGroups
Return a group (list of lists) of label names that determine the class reductions for the primary image-fitting stage.
Return a group (list of lists) of label names that determine the class reductions for the primary image-fitting stage.
[ "Return", "a", "group", "(", "list", "of", "lists", ")", "of", "label", "names", "that", "determine", "the", "class", "reductions", "for", "the", "primary", "image", "-", "fitting", "stage", "." ]
def get_label_groups(self): """ Return a group (list of lists) of label names that determine the class reductions for the primary image-fitting stage. """ labelGroups = [ ['Unknown'], ['Left-Cerebral-White-Matter', 'Left-R', 'Right-R'], ['Left-...
[ "def", "get_label_groups", "(", "self", ")", ":", "labelGroups", "=", "[", "[", "'Unknown'", "]", ",", "[", "'Left-Cerebral-White-Matter'", ",", "'Left-R'", ",", "'Right-R'", "]", ",", "[", "'Left-Cerebral-Cortex'", "]", ",", "[", "'Left-Cerebellum-Cortex'", "]"...
https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/python/freesurfer/subfields/thalamus.py#L218-L246
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/configparser.py
python
RawConfigParser.read_dict
(self, dictionary, source='<dict>')
Read configuration from a dictionary. Keys are section names, values are dictionaries with keys and values that should be present in the section. If the used dictionary type preserves order, sections and their keys will be added in order. All types held in the dictionary are converted ...
Read configuration from a dictionary.
[ "Read", "configuration", "from", "a", "dictionary", "." ]
def read_dict(self, dictionary, source='<dict>'): """Read configuration from a dictionary. Keys are section names, values are dictionaries with keys and values that should be present in the section. If the used dictionary type preserves order, sections and their keys will be added in or...
[ "def", "read_dict", "(", "self", ",", "dictionary", ",", "source", "=", "'<dict>'", ")", ":", "elements_added", "=", "set", "(", ")", "for", "section", ",", "keys", "in", "dictionary", ".", "items", "(", ")", ":", "section", "=", "str", "(", "section",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/configparser.py#L725-L754
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_collections_abc.py
python
Iterator.__next__
(self)
Return the next item from the iterator. When exhausted, raise StopIteration
Return the next item from the iterator. When exhausted, raise StopIteration
[ "Return", "the", "next", "item", "from", "the", "iterator", ".", "When", "exhausted", "raise", "StopIteration" ]
def __next__(self): 'Return the next item from the iterator. When exhausted, raise StopIteration' raise StopIteration
[ "def", "__next__", "(", "self", ")", ":", "raise", "StopIteration" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_collections_abc.py#L264-L266
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/turtle.py
python
read_docstrings
(lang)
Read in docstrings from lang-specific docstring dictionary. Transfer docstrings, translated to lang, from a dictionary-file to the methods of classes Screen and Turtle and - in revised form - to the corresponding functions.
Read in docstrings from lang-specific docstring dictionary.
[ "Read", "in", "docstrings", "from", "lang", "-", "specific", "docstring", "dictionary", "." ]
def read_docstrings(lang): """Read in docstrings from lang-specific docstring dictionary. Transfer docstrings, translated to lang, from a dictionary-file to the methods of classes Screen and Turtle and - in revised form - to the corresponding functions. """ modname = "turtle_docstringdict_%(lan...
[ "def", "read_docstrings", "(", "lang", ")", ":", "modname", "=", "\"turtle_docstringdict_%(language)s\"", "%", "{", "'language'", ":", "lang", ".", "lower", "(", ")", "}", "module", "=", "__import__", "(", "modname", ")", "docsdict", "=", "module", ".", "doc...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/turtle.py#L3856-L3871
PrincetonUniversity/athena-public-version
9c266692b9423743d8e23509b3ab266a232a92d2
tst/style/cpplint.py
python
FileInfo.FullName
(self)
return os.path.abspath(self._filename).replace('\\', '/')
Make Windows paths like Unix.
Make Windows paths like Unix.
[ "Make", "Windows", "paths", "like", "Unix", "." ]
def FullName(self): """Make Windows paths like Unix.""" return os.path.abspath(self._filename).replace('\\', '/')
[ "def", "FullName", "(", "self", ")", ":", "return", "os", ".", "path", ".", "abspath", "(", "self", ".", "_filename", ")", ".", "replace", "(", "'\\\\'", ",", "'/'", ")" ]
https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/tst/style/cpplint.py#L1320-L1322
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/lib/histograms.py
python
_hist_bin_auto
(x, range)
Histogram bin estimator that uses the minimum width of the Freedman-Diaconis and Sturges estimators if the FD bandwidth is non zero and the Sturges estimator if the FD bandwidth is 0. The FD estimator is usually the most robust method, but its width estimate tends to be too large for small `x` and bad ...
Histogram bin estimator that uses the minimum width of the Freedman-Diaconis and Sturges estimators if the FD bandwidth is non zero and the Sturges estimator if the FD bandwidth is 0.
[ "Histogram", "bin", "estimator", "that", "uses", "the", "minimum", "width", "of", "the", "Freedman", "-", "Diaconis", "and", "Sturges", "estimators", "if", "the", "FD", "bandwidth", "is", "non", "zero", "and", "the", "Sturges", "estimator", "if", "the", "FD"...
def _hist_bin_auto(x, range): """ Histogram bin estimator that uses the minimum width of the Freedman-Diaconis and Sturges estimators if the FD bandwidth is non zero and the Sturges estimator if the FD bandwidth is 0. The FD estimator is usually the most robust method, but its width estimate te...
[ "def", "_hist_bin_auto", "(", "x", ",", "range", ")", ":", "fd_bw", "=", "_hist_bin_fd", "(", "x", ",", "range", ")", "sturges_bw", "=", "_hist_bin_sturges", "(", "x", ",", "range", ")", "del", "range", "# unused", "if", "fd_bw", ":", "return", "min", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/histograms.py#L230-L271
facebook/openr
ed38bdfd6bf290084bfab4821b59f83e7b59315d
openr/py/openr/cli/clis/fib.py
python
FibRoutesInstalledCli.routes
( cli_opts: Bunch, # noqa: B902 prefixes: List[str], labels: List[int], client_id: int, json: bool, )
Get and print all the routes on fib agent
Get and print all the routes on fib agent
[ "Get", "and", "print", "all", "the", "routes", "on", "fib", "agent" ]
def routes( cli_opts: Bunch, # noqa: B902 prefixes: List[str], labels: List[int], client_id: int, json: bool, ): """Get and print all the routes on fib agent""" return_code = fib.FibRoutesInstalledCmd(cli_opts).run( prefixes, labels, json, client...
[ "def", "routes", "(", "cli_opts", ":", "Bunch", ",", "# noqa: B902", "prefixes", ":", "List", "[", "str", "]", ",", "labels", ":", "List", "[", "int", "]", ",", "client_id", ":", "int", ",", "json", ":", "bool", ",", ")", ":", "return_code", "=", "...
https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/openr/py/openr/cli/clis/fib.py#L79-L91
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/eager/lift_to_graph.py
python
_copy_non_source
(op, graph, op_map, base_graph)
return ([mutation._replace(copied_op=copied_op) for mutation in input_mutations], [mutation._replace(copied_op=copied_op) for mutation in control_mutations])
Copy an op directly to a given graph. Generally `op`'s inputs should already have been copied. If this is not the case, for example with v1 while_loops, then `_copy_non_source` inserts placeholders for the unavailable Tensors and returns a list of required mutations. Args: op: The op to be copied. g...
Copy an op directly to a given graph.
[ "Copy", "an", "op", "directly", "to", "a", "given", "graph", "." ]
def _copy_non_source(op, graph, op_map, base_graph): """Copy an op directly to a given graph. Generally `op`'s inputs should already have been copied. If this is not the case, for example with v1 while_loops, then `_copy_non_source` inserts placeholders for the unavailable Tensors and returns a list of require...
[ "def", "_copy_non_source", "(", "op", ",", "graph", ",", "op_map", ",", "base_graph", ")", ":", "input_mutations", "=", "[", "]", "control_mutations", "=", "[", "]", "copied_inputs", "=", "[", "]", "for", "input_index", ",", "original_input", "in", "enumerat...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/lift_to_graph.py#L59-L139
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/lib/io/file_io.py
python
FileIO.readline
(self)
return self._prepare_value(self._read_buf.ReadLineAsString())
r"""Reads the next line from the file. Leaves the '\n' at the end.
r"""Reads the next line from the file. Leaves the '\n' at the end.
[ "r", "Reads", "the", "next", "line", "from", "the", "file", ".", "Leaves", "the", "\\", "n", "at", "the", "end", "." ]
def readline(self): r"""Reads the next line from the file. Leaves the '\n' at the end.""" self._preread_check() return self._prepare_value(self._read_buf.ReadLineAsString())
[ "def", "readline", "(", "self", ")", ":", "self", ".", "_preread_check", "(", ")", "return", "self", ".", "_prepare_value", "(", "self", ".", "_read_buf", ".", "ReadLineAsString", "(", ")", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/lib/io/file_io.py#L176-L179
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/lib/source_utils.py
python
annotate_source
(dump, source_file_path, do_dumped_tensors=False, file_stack_top=False, min_line=None, max_line=None)
return line_to_op_names
Annotate a Python source file with a list of ops created at each line. (The annotation doesn't change the source file itself.) Args: dump: (`DebugDumpDir`) A `DebugDumpDir` object of which the Python graph has been loaded. source_file_path: (`str`) Path to the source file being annotated. do_dum...
Annotate a Python source file with a list of ops created at each line.
[ "Annotate", "a", "Python", "source", "file", "with", "a", "list", "of", "ops", "created", "at", "each", "line", "." ]
def annotate_source(dump, source_file_path, do_dumped_tensors=False, file_stack_top=False, min_line=None, max_line=None): """Annotate a Python source file with a list of ops created at each line. (The annotation doe...
[ "def", "annotate_source", "(", "dump", ",", "source_file_path", ",", "do_dumped_tensors", "=", "False", ",", "file_stack_top", "=", "False", ",", "min_line", "=", "None", ",", "max_line", "=", "None", ")", ":", "py_graph", "=", "dump", ".", "python_graph", "...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/source_utils.py#L93-L157
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/cgi.py
python
FieldStorage.__init__
(self, fp=None, headers=None, outerboundary=b'', environ=os.environ, keep_blank_values=0, strict_parsing=0, limit=None, encoding='utf-8', errors='replace', max_num_fields=None, separator='&')
Constructor. Read multipart/* until last part. Arguments, all optional: fp : file pointer; default: sys.stdin.buffer (not used when the request method is GET) Can be : 1. a TextIOWrapper object 2. an object whose read() and readline() metho...
Constructor. Read multipart/* until last part.
[ "Constructor", ".", "Read", "multipart", "/", "*", "until", "last", "part", "." ]
def __init__(self, fp=None, headers=None, outerboundary=b'', environ=os.environ, keep_blank_values=0, strict_parsing=0, limit=None, encoding='utf-8', errors='replace', max_num_fields=None, separator='&'): """Constructor. Read multipart/* until last part. ...
[ "def", "__init__", "(", "self", ",", "fp", "=", "None", ",", "headers", "=", "None", ",", "outerboundary", "=", "b''", ",", "environ", "=", "os", ".", "environ", ",", "keep_blank_values", "=", "0", ",", "strict_parsing", "=", "0", ",", "limit", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/cgi.py#L319-L482
peterljq/OpenMMD
795d4dd660cf7e537ceb599fdb038c5388b33390
VMD 3D Pose Baseline Multi-Objects/applications/vmdlifting.py
python
display_results
(in_image, data_2d, joint_visibility, data_3d)
Plot 2D and 3D poses for each of the people in the image.
Plot 2D and 3D poses for each of the people in the image.
[ "Plot", "2D", "and", "3D", "poses", "for", "each", "of", "the", "people", "in", "the", "image", "." ]
def display_results(in_image, data_2d, joint_visibility, data_3d): """Plot 2D and 3D poses for each of the people in the image.""" plt.figure() draw_limbs(in_image, data_2d, joint_visibility) plt.imshow(in_image) plt.axis('off') # Show 3D poses for single_3D in data_3d: # or plot_po...
[ "def", "display_results", "(", "in_image", ",", "data_2d", ",", "joint_visibility", ",", "data_3d", ")", ":", "plt", ".", "figure", "(", ")", "draw_limbs", "(", "in_image", ",", "data_2d", ",", "joint_visibility", ")", "plt", ".", "imshow", "(", "in_image", ...
https://github.com/peterljq/OpenMMD/blob/795d4dd660cf7e537ceb599fdb038c5388b33390/VMD 3D Pose Baseline Multi-Objects/applications/vmdlifting.py#L67-L79
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/updater.py
python
DownloadDialog.CalcDownRate
(self)
return round((float(sum(dlist) / len(self._proghist)) / 1024), 2)
Calculates and returns the approximate download rate in Kb/s @return: current downlaod rate in Kb/s @rtype: float
Calculates and returns the approximate download rate in Kb/s @return: current downlaod rate in Kb/s @rtype: float
[ "Calculates", "and", "returns", "the", "approximate", "download", "rate", "in", "Kb", "/", "s", "@return", ":", "current", "downlaod", "rate", "in", "Kb", "/", "s", "@rtype", ":", "float" ]
def CalcDownRate(self): """Calculates and returns the approximate download rate in Kb/s @return: current downlaod rate in Kb/s @rtype: float """ dlist = list() last = 0 for item in self._proghist: val = item - last dlist.append(val...
[ "def", "CalcDownRate", "(", "self", ")", ":", "dlist", "=", "list", "(", ")", "last", "=", "0", "for", "item", "in", "self", ".", "_proghist", ":", "val", "=", "item", "-", "last", "dlist", ".", "append", "(", "val", ")", "last", "=", "item", "re...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/updater.py#L637-L650
facebook/openr
ed38bdfd6bf290084bfab4821b59f83e7b59315d
build/fbcode_builder/shell_quoting.py
python
ShellQuoted.format
(self, **kwargs)
return ShellQuoted( self.do_not_use_raw_str.format( **dict( (k, shell_quote(v).do_not_use_raw_str) for k, v in kwargs.items() ) ) )
Use instead of str.format() when the arguments are either `ShellQuoted()` or raw strings needing to be `shell_quote()`d. Positional args are deliberately not supported since they are more error-prone.
[]
def format(self, **kwargs): """ Use instead of str.format() when the arguments are either `ShellQuoted()` or raw strings needing to be `shell_quote()`d. Positional args are deliberately not supported since they are more error-prone. """ return ShellQuoted( ...
[ "def", "format", "(", "self", ",", "*", "*", "kwargs", ")", ":", "return", "ShellQuoted", "(", "self", ".", "do_not_use_raw_str", ".", "format", "(", "*", "*", "dict", "(", "(", "k", ",", "shell_quote", "(", "v", ")", ".", "do_not_use_raw_str", ")", ...
https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/build/fbcode_builder/shell_quoting.py#L49-L65
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
Cursor.__init__
(self, *args, **kwargs)
__init__(self, String cursorName, int type, int hotSpotX=0, int hotSpotY=0) -> Cursor Construct a Cursor from a file. Specify the type of file using wx.BITMAP_TYPE* constants, and specify the hotspot if not using a .cur file.
__init__(self, String cursorName, int type, int hotSpotX=0, int hotSpotY=0) -> Cursor
[ "__init__", "(", "self", "String", "cursorName", "int", "type", "int", "hotSpotX", "=", "0", "int", "hotSpotY", "=", "0", ")", "-", ">", "Cursor" ]
def __init__(self, *args, **kwargs): """ __init__(self, String cursorName, int type, int hotSpotX=0, int hotSpotY=0) -> Cursor Construct a Cursor from a file. Specify the type of file using wx.BITMAP_TYPE* constants, and specify the hotspot if not using a .cur file. ""...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gdi_", ".", "Cursor_swiginit", "(", "self", ",", "_gdi_", ".", "new_Cursor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L1502-L1510
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/locators.py
python
Locator._get_project
(self, name)
For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None.
For a given project, get a dictionary mapping available versions to Distribution instances.
[ "For", "a", "given", "project", "get", "a", "dictionary", "mapping", "available", "versions", "to", "Distribution", "instances", "." ]
def _get_project(self, name): """ For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisf...
[ "def", "_get_project", "(", "self", ",", "name", ")", ":", "raise", "NotImplementedError", "(", "'Please implement in the subclass'", ")" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/locators.py#L128-L138
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py2/google/protobuf/service.py
python
RpcController.NotifyOnCancel
(self, callback)
Sets a callback to invoke on cancel. Asks that the given callback be called when the RPC is canceled. The callback will always be called exactly once. If the RPC completes without being canceled, the callback will be called after completion. If the RPC has already been canceled when NotifyOnCancel()...
Sets a callback to invoke on cancel.
[ "Sets", "a", "callback", "to", "invoke", "on", "cancel", "." ]
def NotifyOnCancel(self, callback): """Sets a callback to invoke on cancel. Asks that the given callback be called when the RPC is canceled. The callback will always be called exactly once. If the RPC completes without being canceled, the callback will be called after completion. If the RPC has ...
[ "def", "NotifyOnCancel", "(", "self", ",", "callback", ")", ":", "raise", "NotImplementedError" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/service.py#L189-L200
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/binomial.py
python
Binomial.name
(self)
return self._name
Name to prepend to all ops.
Name to prepend to all ops.
[ "Name", "to", "prepend", "to", "all", "ops", "." ]
def name(self): """Name to prepend to all ops.""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/binomial.py#L153-L155
adventuregamestudio/ags
efa89736d868e9dfda4200149d33ba8637746399
Common/libsrc/freetype-2.1.3/src/tools/docmaker/content.py
python
ContentProcessor.__init__
( self )
initialize a block content processor
initialize a block content processor
[ "initialize", "a", "block", "content", "processor" ]
def __init__( self ): """initialize a block content processor""" self.reset() self.sections = {} # dictionary of documentation sections self.section = None # current documentation section self.chapters = []
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "reset", "(", ")", "self", ".", "sections", "=", "{", "}", "# dictionary of documentation sections", "self", ".", "section", "=", "None", "# current documentation section", "self", ".", "chapters", "=", "[...
https://github.com/adventuregamestudio/ags/blob/efa89736d868e9dfda4200149d33ba8637746399/Common/libsrc/freetype-2.1.3/src/tools/docmaker/content.py#L300-L307
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/distributions/transformed_distribution.py
python
_ndims_from_shape
(shape)
return array_ops.shape(shape)[0]
Returns `Tensor`'s `rank` implied by a `Tensor` shape.
Returns `Tensor`'s `rank` implied by a `Tensor` shape.
[ "Returns", "Tensor", "s", "rank", "implied", "by", "a", "Tensor", "shape", "." ]
def _ndims_from_shape(shape): """Returns `Tensor`'s `rank` implied by a `Tensor` shape.""" if shape.get_shape().ndims not in (None, 1): raise ValueError("input is not a valid shape: not 1D") if not shape.dtype.is_integer: raise TypeError("input is not a valid shape: wrong dtype") if shape.get_shape().is...
[ "def", "_ndims_from_shape", "(", "shape", ")", ":", "if", "shape", ".", "get_shape", "(", ")", ".", "ndims", "not", "in", "(", "None", ",", "1", ")", ":", "raise", "ValueError", "(", "\"input is not a valid shape: not 1D\"", ")", "if", "not", "shape", ".",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/distributions/transformed_distribution.py#L107-L115
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/balancer/module.py
python
Module.plan_show
(self, plan: str)
return (0, plan_.show(), '')
Show details of an optimization plan
Show details of an optimization plan
[ "Show", "details", "of", "an", "optimization", "plan" ]
def plan_show(self, plan: str) -> Tuple[int, str, str]: """ Show details of an optimization plan """ plan_ = self.plans.get(plan) if not plan_: return (-errno.ENOENT, '', f'plan {plan} not found') return (0, plan_.show(), '')
[ "def", "plan_show", "(", "self", ",", "plan", ":", "str", ")", "->", "Tuple", "[", "int", ",", "str", ",", "str", "]", ":", "plan_", "=", "self", ".", "plans", ".", "get", "(", "plan", ")", "if", "not", "plan_", ":", "return", "(", "-", "errno"...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/balancer/module.py#L551-L558
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/pyserial/setup.py
python
read
(*names, **kwargs)
Python 2 and Python 3 compatible text file reading. Required for single-sourcing the version string.
Python 2 and Python 3 compatible text file reading.
[ "Python", "2", "and", "Python", "3", "compatible", "text", "file", "reading", "." ]
def read(*names, **kwargs): """Python 2 and Python 3 compatible text file reading. Required for single-sourcing the version string. """ with io.open( os.path.join(os.path.dirname(__file__), *names), encoding=kwargs.get("encoding", "utf8") ) as fp: return fp.read()
[ "def", "read", "(", "*", "names", ",", "*", "*", "kwargs", ")", ":", "with", "io", ".", "open", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ",", "*", "names", ")", ",", "encoding", "=", "...
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/setup.py#L22-L31
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/stc.py
python
StyledTextCtrl.AutoCompSetChooseSingle
(*args, **kwargs)
return _stc.StyledTextCtrl_AutoCompSetChooseSingle(*args, **kwargs)
AutoCompSetChooseSingle(self, bool chooseSingle) Should a single item auto-completion list automatically choose the item.
AutoCompSetChooseSingle(self, bool chooseSingle)
[ "AutoCompSetChooseSingle", "(", "self", "bool", "chooseSingle", ")" ]
def AutoCompSetChooseSingle(*args, **kwargs): """ AutoCompSetChooseSingle(self, bool chooseSingle) Should a single item auto-completion list automatically choose the item. """ return _stc.StyledTextCtrl_AutoCompSetChooseSingle(*args, **kwargs)
[ "def", "AutoCompSetChooseSingle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_AutoCompSetChooseSingle", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L3129-L3135
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/clip_ops.py
python
global_norm
(t_list, name=None)
return norm
Computes the global norm of multiple tensors. Given a tuple or list of tensors `t_list`, this operation returns the global norm of the elements in all tensors in `t_list`. The global norm is computed as: `global_norm = sqrt(sum([l2norm(t)**2 for t in t_list]))` Any entries in `t_list` that are of type None...
Computes the global norm of multiple tensors.
[ "Computes", "the", "global", "norm", "of", "multiple", "tensors", "." ]
def global_norm(t_list, name=None): """Computes the global norm of multiple tensors. Given a tuple or list of tensors `t_list`, this operation returns the global norm of the elements in all tensors in `t_list`. The global norm is computed as: `global_norm = sqrt(sum([l2norm(t)**2 for t in t_list]))` Any ...
[ "def", "global_norm", "(", "t_list", ",", "name", "=", "None", ")", ":", "if", "(", "not", "isinstance", "(", "t_list", ",", "collections", ".", "Sequence", ")", "or", "isinstance", "(", "t_list", ",", "six", ".", "string_types", ")", ")", ":", "raise"...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/clip_ops.py#L122-L167
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/database.py
python
make_dist
(name, version, **kwargs)
return Distribution(md)
A convenience method for making a dist given just a name and version.
A convenience method for making a dist given just a name and version.
[ "A", "convenience", "method", "for", "making", "a", "dist", "given", "just", "a", "name", "and", "version", "." ]
def make_dist(name, version, **kwargs): """ A convenience method for making a dist given just a name and version. """ summary = kwargs.pop('summary', 'Placeholder for summary') md = Metadata(**kwargs) md.name = name md.version = version md.summary = summary or 'Placeholder for summary' ...
[ "def", "make_dist", "(", "name", ",", "version", ",", "*", "*", "kwargs", ")", ":", "summary", "=", "kwargs", ".", "pop", "(", "'summary'", ",", "'Placeholder for summary'", ")", "md", "=", "Metadata", "(", "*", "*", "kwargs", ")", "md", ".", "name", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/database.py#L1330-L1339
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/mox.py
python
MockObject.__setitem__
(self, key, value)
return self._CreateMockMethod('__setitem__')(key, value)
Provide custom logic for mocking classes that support item assignment. Args: key: Key to set the value for. value: Value to set. Returns: Expected return value in replay mode. A MockMethod object for the __setitem__ method that has already been called if not in replay mode. Raise...
Provide custom logic for mocking classes that support item assignment.
[ "Provide", "custom", "logic", "for", "mocking", "classes", "that", "support", "item", "assignment", "." ]
def __setitem__(self, key, value): """Provide custom logic for mocking classes that support item assignment. Args: key: Key to set the value for. value: Value to set. Returns: Expected return value in replay mode. A MockMethod object for the __setitem__ method that has already bee...
[ "def", "__setitem__", "(", "self", ",", "key", ",", "value", ")", ":", "setitem", "=", "self", ".", "_class_to_mock", ".", "__dict__", ".", "get", "(", "'__setitem__'", ",", "None", ")", "# Verify the class supports item assignment.", "if", "setitem", "is", "N...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/mox.py#L427-L457