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
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/entity_object/conversion/aoc/genie_unit.py
python
GenieBuildingLineGroup.get_enabling_research_id
(self)
return enabling_research_id
Returns the enabling tech id of the unit
Returns the enabling tech id of the unit
[ "Returns", "the", "enabling", "tech", "id", "of", "the", "unit" ]
def get_enabling_research_id(self): """ Returns the enabling tech id of the unit """ head_unit = self.get_head_unit() head_unit_id = head_unit["id0"].get_value() if head_unit_id in self.data.building_connections.keys(): head_unit_connection = self.data.buildin...
[ "def", "get_enabling_research_id", "(", "self", ")", ":", "head_unit", "=", "self", ".", "get_head_unit", "(", ")", "head_unit_id", "=", "head_unit", "[", "\"id0\"", "]", ".", "get_value", "(", ")", "if", "head_unit_id", "in", "self", ".", "data", ".", "bu...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/aoc/genie_unit.py#L678-L692
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/lib2to3/pytree.py
python
WildcardPattern._iterative_matches
(self, nodes)
Helper to iteratively yield the matches.
Helper to iteratively yield the matches.
[ "Helper", "to", "iteratively", "yield", "the", "matches", "." ]
def _iterative_matches(self, nodes): """Helper to iteratively yield the matches.""" nodelen = len(nodes) if 0 >= self.min: yield 0, {} results = [] # generate matches that use just one alt from self.content for alt in self.content: for c, r in gen...
[ "def", "_iterative_matches", "(", "self", ",", "nodes", ")", ":", "nodelen", "=", "len", "(", "nodes", ")", "if", "0", ">=", "self", ".", "min", ":", "yield", "0", ",", "{", "}", "results", "=", "[", "]", "# generate matches that use just one alt from self...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/lib2to3/pytree.py#L733-L760
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
PreButton
(*args, **kwargs)
return val
PreButton() -> Button Precreate a Button for 2-phase creation.
PreButton() -> Button
[ "PreButton", "()", "-", ">", "Button" ]
def PreButton(*args, **kwargs): """ PreButton() -> Button Precreate a Button for 2-phase creation. """ val = _controls_.new_PreButton(*args, **kwargs) return val
[ "def", "PreButton", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_controls_", ".", "new_PreButton", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L252-L259
google/certificate-transparency
2588562fd306a447958471b6f06c1069619c1641
python/ct/client/db/log_db.py
python
LogDB.scan_latest_sth_range
(self, log_server, start=0, end=timestamp_max, limit=0)
Scan STHs by timestamp Args: logid: CT log to scan start: earliest timestamp end: latest timestamp limit: maximum number of entries to return. Default is no limit. Yields: the AuditedSth protos in descending order of timestamps Note the...
Scan STHs by timestamp Args: logid: CT log to scan start: earliest timestamp end: latest timestamp limit: maximum number of entries to return. Default is no limit. Yields: the AuditedSth protos in descending order of timestamps Note the...
[ "Scan", "STHs", "by", "timestamp", "Args", ":", "logid", ":", "CT", "log", "to", "scan", "start", ":", "earliest", "timestamp", "end", ":", "latest", "timestamp", "limit", ":", "maximum", "number", "of", "entries", "to", "return", ".", "Default", "is", "...
def scan_latest_sth_range(self, log_server, start=0, end=timestamp_max, limit=0): """Scan STHs by timestamp Args: logid: CT log to scan start: earliest timestamp end: latest timestamp limit: maximum number of entries to return...
[ "def", "scan_latest_sth_range", "(", "self", ",", "log_server", ",", "start", "=", "0", ",", "end", "=", "timestamp_max", ",", "limit", "=", "0", ")", ":" ]
https://github.com/google/certificate-transparency/blob/2588562fd306a447958471b6f06c1069619c1641/python/ct/client/db/log_db.py#L42-L54
Slicer/SlicerGitSVNArchive
65e92bb16c2b32ea47a1a66bee71f238891ee1ca
Base/Python/slicer/util.py
python
downloadFile
(url, targetFilePath, checksum=None, reDownloadIfChecksumInvalid=True)
return True
Download ``url`` to local storage as ``targetFilePath`` Target file path needs to indicate the file name and extension as well If specified, the ``checksum`` is used to verify that the downloaded file is the expected one. It must be specified as ``<algo>:<digest>``. For example, ``SHA256:cc211f0dfd9a05ca3841ce1...
Download ``url`` to local storage as ``targetFilePath``
[ "Download", "url", "to", "local", "storage", "as", "targetFilePath" ]
def downloadFile(url, targetFilePath, checksum=None, reDownloadIfChecksumInvalid=True): """ Download ``url`` to local storage as ``targetFilePath`` Target file path needs to indicate the file name and extension as well If specified, the ``checksum`` is used to verify that the downloaded file is the expected one...
[ "def", "downloadFile", "(", "url", ",", "targetFilePath", ",", "checksum", "=", "None", ",", "reDownloadIfChecksumInvalid", "=", "True", ")", ":", "import", "os", "import", "logging", "try", ":", "(", "algo", ",", "digest", ")", "=", "extractAlgoAndDigest", ...
https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Base/Python/slicer/util.py#L1744-L1796
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/frameworks/methodManager.py
python
MeshMethodManager.__init__
(self, **kwargs)
Constructor. Attribute --------- mesh: pg.Mesh Copy of the main mesh to be distributed to inversion and the fop. You can overwrite it with invert(mesh=mesh).
Constructor.
[ "Constructor", "." ]
def __init__(self, **kwargs): """Constructor. Attribute --------- mesh: pg.Mesh Copy of the main mesh to be distributed to inversion and the fop. You can overwrite it with invert(mesh=mesh). """ super(MeshMethodManager, self).__init__(**kwargs) ...
[ "def", "__init__", "(", "self", ",", "*", "*", "kwargs", ")", ":", "super", "(", "MeshMethodManager", ",", "self", ")", ".", "__init__", "(", "*", "*", "kwargs", ")", "self", ".", "mesh", "=", "None" ]
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/frameworks/methodManager.py#L642-L652
sfzhang15/FaceBoxes
b52cc92f9362d3adc08d54666aeb9ebb62fdb7da
python/caffe/net_spec.py
python
Top.to_proto
(self)
return to_proto(self)
Generate a NetParameter that contains all layers needed to compute this top.
Generate a NetParameter that contains all layers needed to compute this top.
[ "Generate", "a", "NetParameter", "that", "contains", "all", "layers", "needed", "to", "compute", "this", "top", "." ]
def to_proto(self): """Generate a NetParameter that contains all layers needed to compute this top.""" return to_proto(self)
[ "def", "to_proto", "(", "self", ")", ":", "return", "to_proto", "(", "self", ")" ]
https://github.com/sfzhang15/FaceBoxes/blob/b52cc92f9362d3adc08d54666aeb9ebb62fdb7da/python/caffe/net_spec.py#L90-L94
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mutex.py
python
mutex.test
(self)
return self.locked
Test the locked bit of the mutex.
Test the locked bit of the mutex.
[ "Test", "the", "locked", "bit", "of", "the", "mutex", "." ]
def test(self): """Test the locked bit of the mutex.""" return self.locked
[ "def", "test", "(", "self", ")", ":", "return", "self", ".", "locked" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mutex.py#L26-L28
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/input_lib.py
python
MultiStepContext.last_step_outputs
(self)
return self._last_step_outputs
A dictionary consisting of outputs to be captured on last step. Keys in the dictionary are names of tensors to be captured, as specified when `set_last_step_output` is called. Values in the dictionary are the tensors themselves. If `set_last_step_output` was called with a `reduce_op` for this output, ...
A dictionary consisting of outputs to be captured on last step.
[ "A", "dictionary", "consisting", "of", "outputs", "to", "be", "captured", "on", "last", "step", "." ]
def last_step_outputs(self): """A dictionary consisting of outputs to be captured on last step. Keys in the dictionary are names of tensors to be captured, as specified when `set_last_step_output` is called. Values in the dictionary are the tensors themselves. If `set_last_step_output` was called w...
[ "def", "last_step_outputs", "(", "self", ")", ":", "return", "self", ".", "_last_step_outputs" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/input_lib.py#L1071-L1083
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py
python
copyfileobj
(fsrc, fdst, length=16*1024)
copy data from file-like object fsrc to file-like object fdst
copy data from file-like object fsrc to file-like object fdst
[ "copy", "data", "from", "file", "-", "like", "object", "fsrc", "to", "file", "-", "like", "object", "fdst" ]
def copyfileobj(fsrc, fdst, length=16*1024): """copy data from file-like object fsrc to file-like object fdst""" while 1: buf = fsrc.read(length) if not buf: break fdst.write(buf)
[ "def", "copyfileobj", "(", "fsrc", ",", "fdst", ",", "length", "=", "16", "*", "1024", ")", ":", "while", "1", ":", "buf", "=", "fsrc", ".", "read", "(", "length", ")", "if", "not", "buf", ":", "break", "fdst", ".", "write", "(", "buf", ")" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py#L67-L73
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/dtypes/common.py
python
is_integer_dtype
(arr_or_dtype)
return _is_dtype_type(arr_or_dtype, classes_and_not_datetimelike(np.integer))
Check whether the provided array or dtype is of an integer dtype. Unlike in `in_any_int_dtype`, timedelta64 instances will return False. The nullable Integer dtypes (e.g. pandas.Int64Dtype) are also considered as integer by this function. Parameters ---------- arr_or_dtype : array-like ...
Check whether the provided array or dtype is of an integer dtype.
[ "Check", "whether", "the", "provided", "array", "or", "dtype", "is", "of", "an", "integer", "dtype", "." ]
def is_integer_dtype(arr_or_dtype) -> bool: """ Check whether the provided array or dtype is of an integer dtype. Unlike in `in_any_int_dtype`, timedelta64 instances will return False. The nullable Integer dtypes (e.g. pandas.Int64Dtype) are also considered as integer by this function. Parame...
[ "def", "is_integer_dtype", "(", "arr_or_dtype", ")", "->", "bool", ":", "return", "_is_dtype_type", "(", "arr_or_dtype", ",", "classes_and_not_datetimelike", "(", "np", ".", "integer", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/dtypes/common.py#L673-L722
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/middle/UnsqueezeTileReshapeBlockToInterpolate.py
python
UnsqueezeTileReshapeBlockToInterpolate.is_applicable
(match: dict)
return True
This function checks whether this transformation is applicable. :param match: dictionary with nodes from the found pattern :return: True, if the transformation is applicable False, otherwise
This function checks whether this transformation is applicable. :param match: dictionary with nodes from the found pattern :return: True, if the transformation is applicable False, otherwise
[ "This", "function", "checks", "whether", "this", "transformation", "is", "applicable", ".", ":", "param", "match", ":", "dictionary", "with", "nodes", "from", "the", "found", "pattern", ":", "return", ":", "True", "if", "the", "transformation", "is", "applicab...
def is_applicable(match: dict) -> bool: """ This function checks whether this transformation is applicable. :param match: dictionary with nodes from the found pattern :return: True, if the transformation is applicable False, otherwise """ unsqueeze_node =...
[ "def", "is_applicable", "(", "match", ":", "dict", ")", "->", "bool", ":", "unsqueeze_node", "=", "match", "[", "'unsqueeze'", "]", "second_input_of_unsqueeze", "=", "unsqueeze_node", ".", "in_port", "(", "1", ")", ".", "get_connection", "(", ")", ".", "get_...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/middle/UnsqueezeTileReshapeBlockToInterpolate.py#L94-L133
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/re2/lib/codereview/codereview.py
python
MercurialVCS.GetUnknownFiles
(self)
return unknown_files
Return a list of files unknown to the VCS.
Return a list of files unknown to the VCS.
[ "Return", "a", "list", "of", "files", "unknown", "to", "the", "VCS", "." ]
def GetUnknownFiles(self): """Return a list of files unknown to the VCS.""" args = [] status = RunShell(["hg", "status", "--rev", self.base_rev, "-u", "."], silent_ok=True) unknown_files = [] for line in status.splitlines(): st, fn = line.split(" ", 1) if st == "?": unknown_files.append(fn) re...
[ "def", "GetUnknownFiles", "(", "self", ")", ":", "args", "=", "[", "]", "status", "=", "RunShell", "(", "[", "\"hg\"", ",", "\"status\"", ",", "\"--rev\"", ",", "self", ".", "base_rev", ",", "\"-u\"", ",", "\".\"", "]", ",", "silent_ok", "=", "True", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/re2/lib/codereview/codereview.py#L3420-L3430
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/sessions.py
python
Session.merge_environment_settings
(self, url, proxies, stream, verify, cert)
return {'verify': verify, 'proxies': proxies, 'stream': stream, 'cert': cert}
Check the environment and merge it with some settings.
Check the environment and merge it with some settings.
[ "Check", "the", "environment", "and", "merge", "it", "with", "some", "settings", "." ]
def merge_environment_settings(self, url, proxies, stream, verify, cert): """Check the environment and merge it with some settings.""" # Gather clues from the surrounding environment. if self.trust_env: # Set environment's proxies. env_proxies = get_environ_proxies(url) o...
[ "def", "merge_environment_settings", "(", "self", ",", "url", ",", "proxies", ",", "stream", ",", "verify", ",", "cert", ")", ":", "# Gather clues from the surrounding environment.", "if", "self", ".", "trust_env", ":", "# Set environment's proxies.", "env_proxies", "...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/sessions.py#L609-L631
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/maximum-number-of-groups-getting-fresh-donuts.py
python
Solution2.maxHappyGroups
(self, batchSize, groups)
return result+dp[-1]
:type batchSize: int :type groups: List[int] :rtype: int
:type batchSize: int :type groups: List[int] :rtype: int
[ ":", "type", "batchSize", ":", "int", ":", "type", "groups", ":", "List", "[", "int", "]", ":", "rtype", ":", "int" ]
def maxHappyGroups(self, batchSize, groups): """ :type batchSize: int :type groups: List[int] :rtype: int """ count = [0]*batchSize for i in groups: count[i%len(count)] += 1 result = count[0] count[0] = 0 for i in xrange(1, len(...
[ "def", "maxHappyGroups", "(", "self", ",", "batchSize", ",", "groups", ")", ":", "count", "=", "[", "0", "]", "*", "batchSize", "for", "i", "in", "groups", ":", "count", "[", "i", "%", "len", "(", "count", ")", "]", "+=", "1", "result", "=", "cou...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/maximum-number-of-groups-getting-fresh-donuts.py#L56-L87
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/markers.py
python
Evaluator.evaluate
(self, node, filename=None)
return handler(node)
Evaluate a source string or node, using ``filename`` when displaying errors.
Evaluate a source string or node, using ``filename`` when displaying errors.
[ "Evaluate", "a", "source", "string", "or", "node", "using", "filename", "when", "displaying", "errors", "." ]
def evaluate(self, node, filename=None): """ Evaluate a source string or node, using ``filename`` when displaying errors. """ if isinstance(node, string_types): self.source = node kwargs = {'mode': 'eval'} if filename: kwargs['f...
[ "def", "evaluate", "(", "self", ",", "node", ",", "filename", "=", "None", ")", ":", "if", "isinstance", "(", "node", ",", "string_types", ")", ":", "self", ".", "source", "=", "node", "kwargs", "=", "{", "'mode'", ":", "'eval'", "}", "if", "filename...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/markers.py#L74-L98
gemrb/gemrb
730206eed8d1dd358ca5e69a62f9e099aa22ffc6
gemrb/GUIScripts/GUIOPTControls.py
python
OptDone
(action, window, button_id)
Standard `Done' button for option windows
Standard `Done' button for option windows
[ "Standard", "Done", "button", "for", "option", "windows" ]
def OptDone (action, window, button_id): """Standard `Done' button for option windows""" button = window.GetControl (button_id) button.SetText (STR_OPT_DONE) # Done button.SetEvent (IE_GUI_BUTTON_ON_PRESS, action) button.MakeDefault() if GameCheck.IsPST(): button.SetVarAssoc ("Cancel", 0)
[ "def", "OptDone", "(", "action", ",", "window", ",", "button_id", ")", ":", "button", "=", "window", ".", "GetControl", "(", "button_id", ")", "button", ".", "SetText", "(", "STR_OPT_DONE", ")", "# Done", "button", ".", "SetEvent", "(", "IE_GUI_BUTTON_ON_PRE...
https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/GUIOPTControls.py#L108-L117
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/image/image.py
python
CreateAugmenter
(data_shape, resize=0, rand_crop=False, rand_resize=False, rand_mirror=False, mean=None, std=None, brightness=0, contrast=0, saturation=0, hue=0, pca_noise=0, rand_gray=0, inter_method=2)
return auglist
Creates an augmenter list. Parameters ---------- data_shape : tuple of int Shape for output data resize : int Resize shorter edge if larger than 0 at the begining rand_crop : bool Whether to enable random cropping other than center crop rand_resize : bool Whether...
Creates an augmenter list.
[ "Creates", "an", "augmenter", "list", "." ]
def CreateAugmenter(data_shape, resize=0, rand_crop=False, rand_resize=False, rand_mirror=False, mean=None, std=None, brightness=0, contrast=0, saturation=0, hue=0, pca_noise=0, rand_gray=0, inter_method=2): """Creates an augmenter list. Parameters ---------- dat...
[ "def", "CreateAugmenter", "(", "data_shape", ",", "resize", "=", "0", ",", "rand_crop", "=", "False", ",", "rand_resize", "=", "False", ",", "rand_mirror", "=", "False", ",", "mean", "=", "None", ",", "std", "=", "None", ",", "brightness", "=", "0", ",...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/image/image.py#L1171-L1282
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/losses/python/losses/loss_ops.py
python
sigmoid_cross_entropy
(logits, multi_class_labels, weight=1.0, label_smoothing=0, scope=None)
Creates a cross-entropy loss using tf.nn.sigmoid_cross_entropy_with_logits. `weight` acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the given value. If `weight` is a tensor of size [`batch_size`], then the loss weights apply to each corresponding sample. If `l...
Creates a cross-entropy loss using tf.nn.sigmoid_cross_entropy_with_logits.
[ "Creates", "a", "cross", "-", "entropy", "loss", "using", "tf", ".", "nn", ".", "sigmoid_cross_entropy_with_logits", "." ]
def sigmoid_cross_entropy(logits, multi_class_labels, weight=1.0, label_smoothing=0, scope=None): """Creates a cross-entropy loss using tf.nn.sigmoid_cross_entropy_with_logits. `weight` acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the gi...
[ "def", "sigmoid_cross_entropy", "(", "logits", ",", "multi_class_labels", ",", "weight", "=", "1.0", ",", "label_smoothing", "=", "0", ",", "scope", "=", "None", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "logits", ",", "multi_class_labels", "]", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/losses/python/losses/loss_ops.py#L286-L326
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/cli/curses_ui.py
python
CursesUI._screen_draw_text_line
(self, row, line, attr=curses.A_NORMAL, color=None)
Render a line of text on the screen. Args: row: (int) Row index. line: (str) The line content. attr: curses font attribute. color: (str) font foreground color name. Raises: TypeError: If row is not of type int.
Render a line of text on the screen.
[ "Render", "a", "line", "of", "text", "on", "the", "screen", "." ]
def _screen_draw_text_line(self, row, line, attr=curses.A_NORMAL, color=None): """Render a line of text on the screen. Args: row: (int) Row index. line: (str) The line content. attr: curses font attribute. color: (str) font foreground color name. Raises: TypeError: If row is ...
[ "def", "_screen_draw_text_line", "(", "self", ",", "row", ",", "line", ",", "attr", "=", "curses", ".", "A_NORMAL", ",", "color", "=", "None", ")", ":", "if", "not", "isinstance", "(", "row", ",", "int", ")", ":", "raise", "TypeError", "(", "\"Invalid ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/cli/curses_ui.py#L946-L969
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/fields.py
python
RequestField._render_part
(self, name, value)
return format_header_param(name, value)
Overridable helper function to format a single header parameter. :param name: The name of the parameter, a string expected to be ASCII only. :param value: The value of the parameter, provided as a unicode string.
Overridable helper function to format a single header parameter.
[ "Overridable", "helper", "function", "to", "format", "a", "single", "header", "parameter", "." ]
def _render_part(self, name, value): """ Overridable helper function to format a single header parameter. :param name: The name of the parameter, a string expected to be ASCII only. :param value: The value of the parameter, provided as a unicode string. "...
[ "def", "_render_part", "(", "self", ",", "name", ",", "value", ")", ":", "return", "format_header_param", "(", "name", ",", "value", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/fields.py#L105-L114
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/aui.py
python
AuiToolBar.FindControl
(*args, **kwargs)
return _aui.AuiToolBar_FindControl(*args, **kwargs)
FindControl(self, int windowId) -> Control
FindControl(self, int windowId) -> Control
[ "FindControl", "(", "self", "int", "windowId", ")", "-", ">", "Control" ]
def FindControl(*args, **kwargs): """FindControl(self, int windowId) -> Control""" return _aui.AuiToolBar_FindControl(*args, **kwargs)
[ "def", "FindControl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiToolBar_FindControl", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L2054-L2056
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/jar.py
python
generate
(env)
Add Builders and construction variables for jar to an Environment.
Add Builders and construction variables for jar to an Environment.
[ "Add", "Builders", "and", "construction", "variables", "for", "jar", "to", "an", "Environment", "." ]
def generate(env): """Add Builders and construction variables for jar to an Environment.""" SCons.Tool.CreateJarBuilder(env) env['JAR'] = 'jar' env['JARFLAGS'] = SCons.Util.CLVar('cf') env['_JARFLAGS'] = jarFlags env['_JARMANIFEST'] = jarManifest env['_JARSOURCES'] = jarSources ...
[ "def", "generate", "(", "env", ")", ":", "SCons", ".", "Tool", ".", "CreateJarBuilder", "(", "env", ")", "env", "[", "'JAR'", "]", "=", "'jar'", "env", "[", "'JARFLAGS'", "]", "=", "SCons", ".", "Util", ".", "CLVar", "(", "'cf'", ")", "env", "[", ...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/jar.py#L90-L101
cinder/Cinder
e83f5bb9c01a63eec20168d02953a0879e5100f7
docs/libs/markdown/extensions/extra.py
python
ExtraExtension.__init__
(self, *args, **kwargs)
config is a dumb holder which gets passed to actual ext later.
config is a dumb holder which gets passed to actual ext later.
[ "config", "is", "a", "dumb", "holder", "which", "gets", "passed", "to", "actual", "ext", "later", "." ]
def __init__(self, *args, **kwargs): """ config is a dumb holder which gets passed to actual ext later. """ self.config = kwargs.pop('configs', {}) self.config.update(kwargs)
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "config", "=", "kwargs", ".", "pop", "(", "'configs'", ",", "{", "}", ")", "self", ".", "config", ".", "update", "(", "kwargs", ")" ]
https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/libs/markdown/extensions/extra.py#L53-L56
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/indexes/multi.py
python
MultiIndex._should_fallback_to_positional
(self)
return self.levels[0]._should_fallback_to_positional()
Should integer key(s) be treated as positional?
Should integer key(s) be treated as positional?
[ "Should", "integer", "key", "(", "s", ")", "be", "treated", "as", "positional?" ]
def _should_fallback_to_positional(self) -> bool: """ Should integer key(s) be treated as positional? """ # GH#33355 return self.levels[0]._should_fallback_to_positional()
[ "def", "_should_fallback_to_positional", "(", "self", ")", "->", "bool", ":", "# GH#33355", "return", "self", ".", "levels", "[", "0", "]", ".", "_should_fallback_to_positional", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/multi.py#L2557-L2562
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/emr/connection.py
python
EmrConnection._build_instance_group_list_args
(self, instance_groups)
return params
Takes a list of InstanceGroups, or a single InstanceGroup. Returns a comparable dict for use in making a RunJobFlow or AddInstanceGroups request.
Takes a list of InstanceGroups, or a single InstanceGroup. Returns a comparable dict for use in making a RunJobFlow or AddInstanceGroups request.
[ "Takes", "a", "list", "of", "InstanceGroups", "or", "a", "single", "InstanceGroup", ".", "Returns", "a", "comparable", "dict", "for", "use", "in", "making", "a", "RunJobFlow", "or", "AddInstanceGroups", "request", "." ]
def _build_instance_group_list_args(self, instance_groups): """ Takes a list of InstanceGroups, or a single InstanceGroup. Returns a comparable dict for use in making a RunJobFlow or AddInstanceGroups request. """ if not isinstance(instance_groups, list): inst...
[ "def", "_build_instance_group_list_args", "(", "self", ",", "instance_groups", ")", ":", "if", "not", "isinstance", "(", "instance_groups", ",", "list", ")", ":", "instance_groups", "=", "[", "instance_groups", "]", "params", "=", "{", "}", "for", "i", ",", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/emr/connection.py#L740-L754
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/attrs/attr/_make.py
python
_ClassBuilder.build_class
(self)
Finalize class based on the accumulated configuration. Builder cannot be used after calling this method.
Finalize class based on the accumulated configuration.
[ "Finalize", "class", "based", "on", "the", "accumulated", "configuration", "." ]
def build_class(self): """ Finalize class based on the accumulated configuration. Builder cannot be used after calling this method. """ if self._slots is True: return self._create_slots_class() else: return self._patch_original_class()
[ "def", "build_class", "(", "self", ")", ":", "if", "self", ".", "_slots", "is", "True", ":", "return", "self", ".", "_create_slots_class", "(", ")", "else", ":", "return", "self", ".", "_patch_original_class", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/attrs/attr/_make.py#L723-L732
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/cachecontrol/controller.py
python
CacheController.cached_request
(self, request)
return False
Return a cached response if it exists in the cache, otherwise return False.
Return a cached response if it exists in the cache, otherwise return False.
[ "Return", "a", "cached", "response", "if", "it", "exists", "in", "the", "cache", "otherwise", "return", "False", "." ]
def cached_request(self, request): """ Return a cached response if it exists in the cache, otherwise return False. """ cache_url = self.cache_url(request.url) cc = self.parse_cache_control(request.headers) # non-caching states no_cache = True if 'no-cache...
[ "def", "cached_request", "(", "self", ",", "request", ")", ":", "cache_url", "=", "self", ".", "cache_url", "(", "request", ".", "url", ")", "cc", "=", "self", ".", "parse_cache_control", "(", "request", ".", "headers", ")", "# non-caching states", "no_cache...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/cachecontrol/controller.py#L83-L179
geemaple/leetcode
68bc5032e1ee52c22ef2f2e608053484c487af54
leetcode/141.linked-list-cycle.py
python
Solution.hasCycle
(self, head)
return False
:type head: ListNode :rtype: bool
:type head: ListNode :rtype: bool
[ ":", "type", "head", ":", "ListNode", ":", "rtype", ":", "bool" ]
def hasCycle(self, head): """ :type head: ListNode :rtype: bool """ slow = head fast = head while fast is not None and fast.next is not None: slow = slow.next fast = fast.next.next if slow == fast: ...
[ "def", "hasCycle", "(", "self", ",", "head", ")", ":", "slow", "=", "head", "fast", "=", "head", "while", "fast", "is", "not", "None", "and", "fast", ".", "next", "is", "not", "None", ":", "slow", "=", "slow", ".", "next", "fast", "=", "fast", "....
https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/141.linked-list-cycle.py#L8-L23
ablab/spades
3a754192b88540524ce6fb69eef5ea9273a38465
assembler/ext/src/python_libs/pyyaml2/__init__.py
python
YAMLObject.to_yaml
(cls, dumper, data)
return dumper.represent_yaml_object(cls.yaml_tag, data, cls, flow_style=cls.yaml_flow_style)
Convert a Python object to a representation node.
Convert a Python object to a representation node.
[ "Convert", "a", "Python", "object", "to", "a", "representation", "node", "." ]
def to_yaml(cls, dumper, data): """ Convert a Python object to a representation node. """ return dumper.represent_yaml_object(cls.yaml_tag, data, cls, flow_style=cls.yaml_flow_style)
[ "def", "to_yaml", "(", "cls", ",", "dumper", ",", "data", ")", ":", "return", "dumper", ".", "represent_yaml_object", "(", "cls", ".", "yaml_tag", ",", "data", ",", "cls", ",", "flow_style", "=", "cls", ".", "yaml_flow_style", ")" ]
https://github.com/ablab/spades/blob/3a754192b88540524ce6fb69eef5ea9273a38465/assembler/ext/src/python_libs/pyyaml2/__init__.py#L316-L321
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py
python
DEFINE_list
(name, default, help, flag_values=FLAGS, **args)
Registers a flag whose value is a comma-separated list of strings.
Registers a flag whose value is a comma-separated list of strings.
[ "Registers", "a", "flag", "whose", "value", "is", "a", "comma", "-", "separated", "list", "of", "strings", "." ]
def DEFINE_list(name, default, help, flag_values=FLAGS, **args): """Registers a flag whose value is a comma-separated list of strings.""" parser = ListParser() serializer = ListSerializer(',') DEFINE(parser, name, default, help, flag_values, serializer, **args)
[ "def", "DEFINE_list", "(", "name", ",", "default", ",", "help", ",", "flag_values", "=", "FLAGS", ",", "*", "*", "args", ")", ":", "parser", "=", "ListParser", "(", ")", "serializer", "=", "ListSerializer", "(", "','", ")", "DEFINE", "(", "parser", ","...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L2691-L2695
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/data/ops/dataset_ops.py
python
Dataset.flat_map
(self, map_func)
return FlatMapDataset(self, map_func)
Maps `map_func` across this dataset and flattens the result. Args: map_func: A function mapping a nested structure of tensors (having shapes and types defined by `self.output_shapes` and `self.output_types`) to a `Dataset`. Returns: A `Dataset`.
Maps `map_func` across this dataset and flattens the result.
[ "Maps", "map_func", "across", "this", "dataset", "and", "flattens", "the", "result", "." ]
def flat_map(self, map_func): """Maps `map_func` across this dataset and flattens the result. Args: map_func: A function mapping a nested structure of tensors (having shapes and types defined by `self.output_shapes` and `self.output_types`) to a `Dataset`. Returns: A `Dataset`....
[ "def", "flat_map", "(", "self", ",", "map_func", ")", ":", "return", "FlatMapDataset", "(", "self", ",", "map_func", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/data/ops/dataset_ops.py#L716-L727
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/pyreadline/rlmain.py
python
Readline.set_startup_hook
(self, function=None)
Set or remove the startup_hook function. If function is specified, it will be used as the new startup_hook function; if omitted or None, any hook function already installed is removed. The startup_hook function is called with no arguments just before readline prints the first prompt.
Set or remove the startup_hook function.
[ "Set", "or", "remove", "the", "startup_hook", "function", "." ]
def set_startup_hook(self, function=None): '''Set or remove the startup_hook function. If function is specified, it will be used as the new startup_hook function; if omitted or None, any hook function already installed is removed. The startup_hook function is called with no arguments j...
[ "def", "set_startup_hook", "(", "self", ",", "function", "=", "None", ")", ":", "self", ".", "startup_hook", "=", "function" ]
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/rlmain.py#L224-L233
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
PointerArgument.WriteValidationCode
(self, file, func)
Overridden from Argument.
Overridden from Argument.
[ "Overridden", "from", "Argument", "." ]
def WriteValidationCode(self, file, func): """Overridden from Argument.""" file.Write(" if (%s == NULL) {\n" % self.name) file.Write(" return error::kOutOfBounds;\n") file.Write(" }\n")
[ "def", "WriteValidationCode", "(", "self", ",", "file", ",", "func", ")", ":", "file", ".", "Write", "(", "\" if (%s == NULL) {\\n\"", "%", "self", ".", "name", ")", "file", ".", "Write", "(", "\" return error::kOutOfBounds;\\n\"", ")", "file", ".", "Write...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L6196-L6200
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/blocks.py
python
Block.convert
( self, copy: bool = True, datetime: bool = True, numeric: bool = True, timedelta: bool = True, coerce: bool = False, )
return self.copy() if copy else self
attempt to coerce any object types to better types return a copy of the block (if copy = True) by definition we are not an ObjectBlock here!
attempt to coerce any object types to better types return a copy of the block (if copy = True) by definition we are not an ObjectBlock here!
[ "attempt", "to", "coerce", "any", "object", "types", "to", "better", "types", "return", "a", "copy", "of", "the", "block", "(", "if", "copy", "=", "True", ")", "by", "definition", "we", "are", "not", "an", "ObjectBlock", "here!" ]
def convert( self, copy: bool = True, datetime: bool = True, numeric: bool = True, timedelta: bool = True, coerce: bool = False, ): """ attempt to coerce any object types to better types return a copy of the block (if copy = True) by definition we are ...
[ "def", "convert", "(", "self", ",", "copy", ":", "bool", "=", "True", ",", "datetime", ":", "bool", "=", "True", ",", "numeric", ":", "bool", "=", "True", ",", "timedelta", ":", "bool", "=", "True", ",", "coerce", ":", "bool", "=", "False", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/blocks.py#L650-L663
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/importDAE.py
python
checkCollada
()
checks if collada if available
checks if collada if available
[ "checks", "if", "collada", "if", "available" ]
def checkCollada(): "checks if collada if available" global collada COLLADA = None try: import collada except ImportError: FreeCAD.Console.PrintError(translate("Arch","pycollada not found, collada support is disabled.")+"\n") return False else: return True
[ "def", "checkCollada", "(", ")", ":", "global", "collada", "COLLADA", "=", "None", "try", ":", "import", "collada", "except", "ImportError", ":", "FreeCAD", ".", "Console", ".", "PrintError", "(", "translate", "(", "\"Arch\"", ",", "\"pycollada not found, collad...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/importDAE.py#L49-L61
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/nntplib.py
python
_NNTPBase.quit
(self)
return resp
Process a QUIT command and close the socket. Returns: - resp: server response if successful
Process a QUIT command and close the socket. Returns: - resp: server response if successful
[ "Process", "a", "QUIT", "command", "and", "close", "the", "socket", ".", "Returns", ":", "-", "resp", ":", "server", "response", "if", "successful" ]
def quit(self): """Process a QUIT command and close the socket. Returns: - resp: server response if successful""" try: resp = self._shortcmd('QUIT') finally: self._close() return resp
[ "def", "quit", "(", "self", ")", ":", "try", ":", "resp", "=", "self", ".", "_shortcmd", "(", "'QUIT'", ")", "finally", ":", "self", ".", "_close", "(", ")", "return", "resp" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/nntplib.py#L931-L938
christinaa/LLVM-VideoCore4
7773c3c9e5d22b785d4b96ed0acea37c8aa9c183
utils/lit/lit/util.py
python
which
(command, paths = None)
return None
which(command, [paths]) - Look up the given command in the paths string (or the PATH environment variable, if unspecified).
which(command, [paths]) - Look up the given command in the paths string (or the PATH environment variable, if unspecified).
[ "which", "(", "command", "[", "paths", "]", ")", "-", "Look", "up", "the", "given", "command", "in", "the", "paths", "string", "(", "or", "the", "PATH", "environment", "variable", "if", "unspecified", ")", "." ]
def which(command, paths = None): """which(command, [paths]) - Look up the given command in the paths string (or the PATH environment variable, if unspecified).""" if paths is None: paths = os.environ.get('PATH','') # Check for absolute match first. if os.path.isfile(command): retu...
[ "def", "which", "(", "command", ",", "paths", "=", "None", ")", ":", "if", "paths", "is", "None", ":", "paths", "=", "os", ".", "environ", ".", "get", "(", "'PATH'", ",", "''", ")", "# Check for absolute match first.", "if", "os", ".", "path", ".", "...
https://github.com/christinaa/LLVM-VideoCore4/blob/7773c3c9e5d22b785d4b96ed0acea37c8aa9c183/utils/lit/lit/util.py#L56-L85
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/gtk/gizmos.py
python
TreeListCtrl.GetColumnCount
(*args, **kwargs)
return _gizmos.TreeListCtrl_GetColumnCount(*args, **kwargs)
GetColumnCount(self) -> size_t
GetColumnCount(self) -> size_t
[ "GetColumnCount", "(", "self", ")", "-", ">", "size_t" ]
def GetColumnCount(*args, **kwargs): """GetColumnCount(self) -> size_t""" return _gizmos.TreeListCtrl_GetColumnCount(*args, **kwargs)
[ "def", "GetColumnCount", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_GetColumnCount", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/gtk/gizmos.py#L582-L584
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextEvent.SetLParam
(*args, **kwargs)
return _stc.StyledTextEvent_SetLParam(*args, **kwargs)
SetLParam(self, int val)
SetLParam(self, int val)
[ "SetLParam", "(", "self", "int", "val", ")" ]
def SetLParam(*args, **kwargs): """SetLParam(self, int val)""" return _stc.StyledTextEvent_SetLParam(*args, **kwargs)
[ "def", "SetLParam", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextEvent_SetLParam", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L7078-L7080
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
tools/harness-thci/OpenThread.py
python
OpenThreadTHCI._onCommissionStop
(self)
Called when commissioning stops.
Called when commissioning stops.
[ "Called", "when", "commissioning", "stops", "." ]
def _onCommissionStop(self): """Called when commissioning stops."""
[ "def", "_onCommissionStop", "(", "self", ")", ":" ]
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread.py#L264-L265
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/quantize/python/fold_batch_norms.py
python
_ComputeBatchNormCorrections
(context, match, freeze_batch_norm_delay)
return correction_scale, correction_recip, correction_offset
Computes batch norm correction params. Before batch normalization is frozen: We use batch statistics for batch norm. correction_scale = sigma_b/sigma_mv correction_recip = 1/correction_scale correction_offset = 0 After batch normalization is frozen: correction_scale = sigma_b...
Computes batch norm correction params.
[ "Computes", "batch", "norm", "correction", "params", "." ]
def _ComputeBatchNormCorrections(context, match, freeze_batch_norm_delay): """Computes batch norm correction params. Before batch normalization is frozen: We use batch statistics for batch norm. correction_scale = sigma_b/sigma_mv correction_recip = 1/correction_scale correction_offset...
[ "def", "_ComputeBatchNormCorrections", "(", "context", ",", "match", ",", "freeze_batch_norm_delay", ")", ":", "g", "=", "ops", ".", "get_default_graph", "(", ")", "prefix", "=", "''", "if", "not", "context", "else", "context", "with", "g", ".", "name_scope", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/quantize/python/fold_batch_norms.py#L344-L443
PaddlePaddle/PaddleOCR
b756bf5f8c90142e0d89d3db0163965c686b6ffe
ppocr/data/imaug/rec_img_aug.py
python
get_crop
(image)
return crop_img
random crop
random crop
[ "random", "crop" ]
def get_crop(image): """ random crop """ h, w, _ = image.shape top_min = 1 top_max = 8 top_crop = int(random.randint(top_min, top_max)) top_crop = min(top_crop, h - 1) crop_img = image.copy() ratio = random.randint(0, 1) if ratio: crop_img = crop_img[top_crop:h, :, :]...
[ "def", "get_crop", "(", "image", ")", ":", "h", ",", "w", ",", "_", "=", "image", ".", "shape", "top_min", "=", "1", "top_max", "=", "8", "top_crop", "=", "int", "(", "random", ".", "randint", "(", "top_min", ",", "top_max", ")", ")", "top_crop", ...
https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppocr/data/imaug/rec_img_aug.py#L344-L359
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/skia_gold_common/skia_gold_session.py
python
SkiaGoldSession.GetDiffImageLink
(self, name)
return self._comparison_results[name].local_diff_diff_image
Gets the link to the diff between the given and closest images. Args: name: The name of the image that was diffed. Returns: A string containing the link to where the image is saved, or None if it does not exist.
Gets the link to the diff between the given and closest images.
[ "Gets", "the", "link", "to", "the", "diff", "between", "the", "given", "and", "closest", "images", "." ]
def GetDiffImageLink(self, name): """Gets the link to the diff between the given and closest images. Args: name: The name of the image that was diffed. Returns: A string containing the link to where the image is saved, or None if it does not exist. """ assert name in self._compar...
[ "def", "GetDiffImageLink", "(", "self", ",", "name", ")", ":", "assert", "name", "in", "self", ".", "_comparison_results", "return", "self", ".", "_comparison_results", "[", "name", "]", ".", "local_diff_diff_image" ]
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/skia_gold_common/skia_gold_session.py#L472-L483
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/cgi.py
python
initlog
(*allargs)
Write a log message, if there is a log file. Even though this function is called initlog(), you should always use log(); log is a variable that is set either to initlog (initially), to dolog (once the log file has been opened), or to nolog (when logging is disabled). The first argument is a format...
Write a log message, if there is a log file.
[ "Write", "a", "log", "message", "if", "there", "is", "a", "log", "file", "." ]
def initlog(*allargs): """Write a log message, if there is a log file. Even though this function is called initlog(), you should always use log(); log is a variable that is set either to initlog (initially), to dolog (once the log file has been opened), or to nolog (when logging is disabled). ...
[ "def", "initlog", "(", "*", "allargs", ")", ":", "global", "log", ",", "logfile", ",", "logfp", "if", "logfile", "and", "not", "logfp", ":", "try", ":", "logfp", "=", "open", "(", "logfile", ",", "\"a\"", ")", "except", "OSError", ":", "pass", "if", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/cgi.py#L58-L91
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/python_gflags/gflags.py
python
DEFINE_multi
(parser, serializer, name, default, help, flag_values=FLAGS, **args)
Registers a generic MultiFlag that parses its args with a given parser. Auxiliary function. Normal users should NOT use it directly. Developers who need to create their own 'Parser' classes for options which can appear multiple times can call this module function to register their flags.
Registers a generic MultiFlag that parses its args with a given parser.
[ "Registers", "a", "generic", "MultiFlag", "that", "parses", "its", "args", "with", "a", "given", "parser", "." ]
def DEFINE_multi(parser, serializer, name, default, help, flag_values=FLAGS, **args): """Registers a generic MultiFlag that parses its args with a given parser. Auxiliary function. Normal users should NOT use it directly. Developers who need to create their own 'Parser' classes for options w...
[ "def", "DEFINE_multi", "(", "parser", ",", "serializer", ",", "name", ",", "default", ",", "help", ",", "flag_values", "=", "FLAGS", ",", "*", "*", "args", ")", ":", "DEFINE_flag", "(", "MultiFlag", "(", "parser", ",", "serializer", ",", "name", ",", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/python_gflags/gflags.py#L2785-L2796
alexozer/jankdrone
c4b403eb254b41b832ab2bdfade12ba59c99e5dc
drone/lib/nanopb/generator/nanopb_generator.py
python
main_cli
()
Main function when invoked directly from the command line.
Main function when invoked directly from the command line.
[ "Main", "function", "when", "invoked", "directly", "from", "the", "command", "line", "." ]
def main_cli(): '''Main function when invoked directly from the command line.''' options, filenames = optparser.parse_args() if not filenames: optparser.print_help() sys.exit(1) if options.quiet: options.verbose = False if options.output_dir and not os.path.exists(options...
[ "def", "main_cli", "(", ")", ":", "options", ",", "filenames", "=", "optparser", ".", "parse_args", "(", ")", "if", "not", "filenames", ":", "optparser", ".", "print_help", "(", ")", "sys", ".", "exit", "(", "1", ")", "if", "options", ".", "quiet", "...
https://github.com/alexozer/jankdrone/blob/c4b403eb254b41b832ab2bdfade12ba59c99e5dc/drone/lib/nanopb/generator/nanopb_generator.py#L1513-L1547
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/opencv-git/doc/ocv.py
python
DefExpr.get_id
(self)
return u''
Returns the id for the node
Returns the id for the node
[ "Returns", "the", "id", "for", "the", "node" ]
def get_id(self): """Returns the id for the node""" return u''
[ "def", "get_id", "(", "self", ")", ":", "return", "u''" ]
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/doc/ocv.py#L408-L410
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/sparse/construct.py
python
kron
(A, B, format=None)
kronecker product of sparse matrices A and B Parameters ---------- A : sparse or dense matrix first matrix of the product B : sparse or dense matrix second matrix of the product format : str, optional format of the result (e.g. "csr") Returns ------- kronecker p...
kronecker product of sparse matrices A and B
[ "kronecker", "product", "of", "sparse", "matrices", "A", "and", "B" ]
def kron(A, B, format=None): """kronecker product of sparse matrices A and B Parameters ---------- A : sparse or dense matrix first matrix of the product B : sparse or dense matrix second matrix of the product format : str, optional format of the result (e.g. "csr") ...
[ "def", "kron", "(", "A", ",", "B", ",", "format", "=", "None", ")", ":", "B", "=", "coo_matrix", "(", "B", ")", "if", "(", "format", "is", "None", "or", "format", "==", "\"bsr\"", ")", "and", "2", "*", "B", ".", "nnz", ">=", "B", ".", "shape"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/sparse/construct.py#L276-L355
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
FileHistory.GetHistoryFile
(*args, **kwargs)
return _misc_.FileHistory_GetHistoryFile(*args, **kwargs)
GetHistoryFile(self, int i) -> String
GetHistoryFile(self, int i) -> String
[ "GetHistoryFile", "(", "self", "int", "i", ")", "-", ">", "String" ]
def GetHistoryFile(*args, **kwargs): """GetHistoryFile(self, int i) -> String""" return _misc_.FileHistory_GetHistoryFile(*args, **kwargs)
[ "def", "GetHistoryFile", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "FileHistory_GetHistoryFile", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L950-L952
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/auto_bisect/source_control.py
python
RevertFileToHead
(file_name)
return not return_code
Un-stages a file and resets the file's state to HEAD. Returns: True if successful.
Un-stages a file and resets the file's state to HEAD.
[ "Un", "-", "stages", "a", "file", "and", "resets", "the", "file", "s", "state", "to", "HEAD", "." ]
def RevertFileToHead(file_name): """Un-stages a file and resets the file's state to HEAD. Returns: True if successful. """ # Reset doesn't seem to return 0 on success. bisect_utils.RunGit(['reset', 'HEAD', file_name]) _, return_code = bisect_utils.RunGit( ['checkout', bisect_utils.FILE_DEPS_GIT])...
[ "def", "RevertFileToHead", "(", "file_name", ")", ":", "# Reset doesn't seem to return 0 on success.", "bisect_utils", ".", "RunGit", "(", "[", "'reset'", ",", "'HEAD'", ",", "file_name", "]", ")", "_", ",", "return_code", "=", "bisect_utils", ".", "RunGit", "(", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/auto_bisect/source_control.py#L199-L209
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros/roslib/src/roslib/names.py
python
resolve_name
(name, namespace_, remappings=None)
Resolve a ROS name to its global, canonical form. Private ~names are resolved relative to the node name. @param name: name to resolve. @type name: str @param namespace_: node name to resolve relative to. @type namespace_: str @param remappings: Map of resolved remappings. Use None to indicat...
Resolve a ROS name to its global, canonical form. Private ~names are resolved relative to the node name.
[ "Resolve", "a", "ROS", "name", "to", "its", "global", "canonical", "form", ".", "Private", "~names", "are", "resolved", "relative", "to", "the", "node", "name", "." ]
def resolve_name(name, namespace_, remappings=None): """ Resolve a ROS name to its global, canonical form. Private ~names are resolved relative to the node name. @param name: name to resolve. @type name: str @param namespace_: node name to resolve relative to. @type namespace_: str @...
[ "def", "resolve_name", "(", "name", ",", "namespace_", ",", "remappings", "=", "None", ")", ":", "if", "not", "name", ":", "#empty string resolves to parent of the namespace_", "return", "namespace", "(", "namespace_", ")", "name", "=", "canonicalize_name", "(", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/roslib/src/roslib/names.py#L362-L394
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/oldnumeric/ma.py
python
sort
(x, axis = -1, fill_value=None)
return masked_values(s, fill_value, copy=0)
If x does not have a mask, return a masked array formed from the result of numeric.sort(x, axis). Otherwise, fill x with fill_value. Sort it. Set a mask where the result is equal to fill_value. Note that this may have unintended consequences if the data contains the fill value at a no...
If x does not have a mask, return a masked array formed from the result of numeric.sort(x, axis). Otherwise, fill x with fill_value. Sort it. Set a mask where the result is equal to fill_value. Note that this may have unintended consequences if the data contains the fill value at a no...
[ "If", "x", "does", "not", "have", "a", "mask", "return", "a", "masked", "array", "formed", "from", "the", "result", "of", "numeric", ".", "sort", "(", "x", "axis", ")", ".", "Otherwise", "fill", "x", "with", "fill_value", ".", "Sort", "it", ".", "Set...
def sort (x, axis = -1, fill_value=None): """If x does not have a mask, return a masked array formed from the result of numeric.sort(x, axis). Otherwise, fill x with fill_value. Sort it. Set a mask where the result is equal to fill_value. Note that this may have unintended consequences i...
[ "def", "sort", "(", "x", ",", "axis", "=", "-", "1", ",", "fill_value", "=", "None", ")", ":", "if", "fill_value", "is", "None", ":", "fill_value", "=", "default_fill_value", "(", "x", ")", "d", "=", "filled", "(", "x", ",", "fill_value", ")", "s",...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/oldnumeric/ma.py#L2050-L2067
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/compat/_inspect.py
python
ismethod
(object)
return isinstance(object, types.MethodType)
Return true if the object is an instance method. Instance method objects provide these attributes: __doc__ documentation string __name__ name with which this method was defined im_class class object in which this method belongs im_func function object c...
Return true if the object is an instance method.
[ "Return", "true", "if", "the", "object", "is", "an", "instance", "method", "." ]
def ismethod(object): """Return true if the object is an instance method. Instance method objects provide these attributes: __doc__ documentation string __name__ name with which this method was defined im_class class object in which this method belongs im_f...
[ "def", "ismethod", "(", "object", ")", ":", "return", "isinstance", "(", "object", ",", "types", ".", "MethodType", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/compat/_inspect.py#L15-L26
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py
python
Mailbox.lock
(self)
Lock the mailbox.
Lock the mailbox.
[ "Lock", "the", "mailbox", "." ]
def lock(self): """Lock the mailbox.""" raise NotImplementedError('Method must be implemented by subclass')
[ "def", "lock", "(", "self", ")", ":", "raise", "NotImplementedError", "(", "'Method must be implemented by subclass'", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py#L188-L190
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/nccl/python/ops/nccl_ops.py
python
_apply_all_reduce
(reduction, tensors)
return res
Helper function for all_* functions.
Helper function for all_* functions.
[ "Helper", "function", "for", "all_", "*", "functions", "." ]
def _apply_all_reduce(reduction, tensors): """Helper function for all_* functions.""" if not tensors: raise ValueError('Must pass >0 tensors to all reduce operations') _check_graph_mode() shared_name = _get_shared_name() res = [] for t in tensors: _check_device(t) with ops.device(t.device): ...
[ "def", "_apply_all_reduce", "(", "reduction", ",", "tensors", ")", ":", "if", "not", "tensors", ":", "raise", "ValueError", "(", "'Must pass >0 tensors to all reduce operations'", ")", "_check_graph_mode", "(", ")", "shared_name", "=", "_get_shared_name", "(", ")", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/nccl/python/ops/nccl_ops.py#L211-L230
zeakey/DeepSkeleton
dc70170f8fd2ec8ca1157484ce66129981104486
tools/extra/parse_log.py
python
save_csv_files
(logfile_path, output_dir, train_dict_list, test_dict_list, delimiter=',', verbose=False)
Save CSV files to output_dir If the input log file is, e.g., caffe.INFO, the names will be caffe.INFO.train and caffe.INFO.test
Save CSV files to output_dir
[ "Save", "CSV", "files", "to", "output_dir" ]
def save_csv_files(logfile_path, output_dir, train_dict_list, test_dict_list, delimiter=',', verbose=False): """Save CSV files to output_dir If the input log file is, e.g., caffe.INFO, the names will be caffe.INFO.train and caffe.INFO.test """ log_basename = os.path.basename(log...
[ "def", "save_csv_files", "(", "logfile_path", ",", "output_dir", ",", "train_dict_list", ",", "test_dict_list", ",", "delimiter", "=", "','", ",", "verbose", "=", "False", ")", ":", "log_basename", "=", "os", ".", "path", ".", "basename", "(", "logfile_path", ...
https://github.com/zeakey/DeepSkeleton/blob/dc70170f8fd2ec8ca1157484ce66129981104486/tools/extra/parse_log.py#L132-L145
alibaba/graph-learn
54cafee9db3054dc310a28b856be7f97c7d5aee9
graphlearn/python/server.py
python
Server.start
(self)
Start the server. It will not return until all servers are started.
Start the server. It will not return until all servers are started.
[ "Start", "the", "server", ".", "It", "will", "not", "return", "until", "all", "servers", "are", "started", "." ]
def start(self): """ Start the server. It will not return until all servers are started. """ self._server.start()
[ "def", "start", "(", "self", ")", ":", "self", ".", "_server", ".", "start", "(", ")" ]
https://github.com/alibaba/graph-learn/blob/54cafee9db3054dc310a28b856be7f97c7d5aee9/graphlearn/python/server.py#L60-L63
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/robotsim.py
python
RobotModel.distance
(self, a, b)
return _robotsim.RobotModel_distance(self, a, b)
distance(RobotModel self, doubleVector a, doubleVector b) -> double Computes a distance between two configurations, properly taking into account nonstandard joints.
distance(RobotModel self, doubleVector a, doubleVector b) -> double
[ "distance", "(", "RobotModel", "self", "doubleVector", "a", "doubleVector", "b", ")", "-", ">", "double" ]
def distance(self, a, b): """ distance(RobotModel self, doubleVector a, doubleVector b) -> double Computes a distance between two configurations, properly taking into account nonstandard joints. """ return _robotsim.RobotModel_distance(self, a, b)
[ "def", "distance", "(", "self", ",", "a", ",", "b", ")", ":", "return", "_robotsim", ".", "RobotModel_distance", "(", "self", ",", "a", ",", "b", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L5071-L5081
xhzdeng/crpn
a5aef0f80dbe486103123f740c634fb01e6cc9a1
caffe-fast-rcnn/scripts/cpp_lint.py
python
FileInfo.Split
(self)
return (project,) + os.path.splitext(rest)
Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension).
Splits the file into the directory, basename, and extension.
[ "Splits", "the", "file", "into", "the", "directory", "basename", "and", "extension", "." ]
def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os...
[ "def", "Split", "(", "self", ")", ":", "googlename", "=", "self", ".", "RepositoryName", "(", ")", "project", ",", "rest", "=", "os", ".", "path", ".", "split", "(", "googlename", ")", "return", "(", "project", ",", ")", "+", "os", ".", "path", "."...
https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/caffe-fast-rcnn/scripts/cpp_lint.py#L934-L946
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/genericpath.py
python
samestat
(s1, s2)
return (s1.st_ino == s2.st_ino and s1.st_dev == s2.st_dev)
Test whether two stat buffers reference the same file
Test whether two stat buffers reference the same file
[ "Test", "whether", "two", "stat", "buffers", "reference", "the", "same", "file" ]
def samestat(s1, s2): """Test whether two stat buffers reference the same file""" return (s1.st_ino == s2.st_ino and s1.st_dev == s2.st_dev)
[ "def", "samestat", "(", "s1", ",", "s2", ")", ":", "return", "(", "s1", ".", "st_ino", "==", "s2", ".", "st_ino", "and", "s1", ".", "st_dev", "==", "s2", ".", "st_dev", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/genericpath.py#L87-L90
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/futures.py
python
BoundedExecutor.submit
(self, task, tag=None, block=True)
return future
Submit a task to complete :type task: s3transfer.tasks.Task :param task: The task to run __call__ on :type tag: s3transfer.futures.TaskTag :param tag: An optional tag to associate to the task. This is used to override which semaphore to use. :type block: boolean ...
Submit a task to complete
[ "Submit", "a", "task", "to", "complete" ]
def submit(self, task, tag=None, block=True): """Submit a task to complete :type task: s3transfer.tasks.Task :param task: The task to run __call__ on :type tag: s3transfer.futures.TaskTag :param tag: An optional tag to associate to the task. This is used to overrid...
[ "def", "submit", "(", "self", ",", "task", ",", "tag", "=", "None", ",", "block", "=", "True", ")", ":", "semaphore", "=", "self", ".", "_semaphore", "# If a tag was provided, use the semaphore associated to that", "# tag.", "if", "tag", ":", "semaphore", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/futures.py#L436-L471
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/applications/workbench/workbench/plugins/workspacewidget.py
python
WorkspaceWidget._do_superplot_bins
(self, names)
Open an empty plot with the superplot started on bins mode. :param names: A list of workspace names
Open an empty plot with the superplot started on bins mode.
[ "Open", "an", "empty", "plot", "with", "the", "superplot", "started", "on", "bins", "mode", "." ]
def _do_superplot_bins(self, names): """ Open an empty plot with the superplot started on bins mode. :param names: A list of workspace names """ plot_kwargs = {"axis": MantidAxType.BIN} superplot_from_names(names, plot_kwargs=plot_kwargs)
[ "def", "_do_superplot_bins", "(", "self", ",", "names", ")", ":", "plot_kwargs", "=", "{", "\"axis\"", ":", "MantidAxType", ".", "BIN", "}", "superplot_from_names", "(", "names", ",", "plot_kwargs", "=", "plot_kwargs", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/plugins/workspacewidget.py#L136-L143
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextObject.SetMargins
(*args, **kwargs)
return _richtext.RichTextObject_SetMargins(*args, **kwargs)
SetMargins(self, int leftMargin, int rightMargin, int topMargin, int bottomMargin)
SetMargins(self, int leftMargin, int rightMargin, int topMargin, int bottomMargin)
[ "SetMargins", "(", "self", "int", "leftMargin", "int", "rightMargin", "int", "topMargin", "int", "bottomMargin", ")" ]
def SetMargins(*args, **kwargs): """SetMargins(self, int leftMargin, int rightMargin, int topMargin, int bottomMargin)""" return _richtext.RichTextObject_SetMargins(*args, **kwargs)
[ "def", "SetMargins", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextObject_SetMargins", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1333-L1335
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/third_party/png/png.py
python
Reader.asFloat
(self, maxval=1.0)
return x,y,iterfloat(),info
Return image pixels as per :meth:`asDirect` method, but scale all pixel values to be floating point values between 0.0 and *maxval*.
Return image pixels as per :meth:`asDirect` method, but scale all pixel values to be floating point values between 0.0 and *maxval*.
[ "Return", "image", "pixels", "as", "per", ":", "meth", ":", "asDirect", "method", "but", "scale", "all", "pixel", "values", "to", "be", "floating", "point", "values", "between", "0", ".", "0", "and", "*", "maxval", "*", "." ]
def asFloat(self, maxval=1.0): """Return image pixels as per :meth:`asDirect` method, but scale all pixel values to be floating point values between 0.0 and *maxval*. """ x,y,pixels,info = self.asDirect() sourcemaxval = 2**info['bitdepth']-1 del info['bitdepth'] ...
[ "def", "asFloat", "(", "self", ",", "maxval", "=", "1.0", ")", ":", "x", ",", "y", ",", "pixels", ",", "info", "=", "self", ".", "asDirect", "(", ")", "sourcemaxval", "=", "2", "**", "info", "[", "'bitdepth'", "]", "-", "1", "del", "info", "[", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/png/png.py#L2084-L2098
MhLiao/TextBoxes_plusplus
39d4898de1504c53a2ed3d67966a57b3595836d0
scripts/cpp_lint.py
python
_NestingState.SeenOpenBrace
(self)
return (not self.stack) or self.stack[-1].seen_open_brace
Check if we have seen the opening brace for the innermost block. Returns: True if we have seen the opening brace, False if the innermost block is still expecting an opening brace.
Check if we have seen the opening brace for the innermost block.
[ "Check", "if", "we", "have", "seen", "the", "opening", "brace", "for", "the", "innermost", "block", "." ]
def SeenOpenBrace(self): """Check if we have seen the opening brace for the innermost block. Returns: True if we have seen the opening brace, False if the innermost block is still expecting an opening brace. """ return (not self.stack) or self.stack[-1].seen_open_brace
[ "def", "SeenOpenBrace", "(", "self", ")", ":", "return", "(", "not", "self", ".", "stack", ")", "or", "self", ".", "stack", "[", "-", "1", "]", ".", "seen_open_brace" ]
https://github.com/MhLiao/TextBoxes_plusplus/blob/39d4898de1504c53a2ed3d67966a57b3595836d0/scripts/cpp_lint.py#L1935-L1942
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/msvs_emulation.py
python
_AddPrefix
(element, prefix)
Add |prefix| to |element| or each subelement if element is iterable.
Add |prefix| to |element| or each subelement if element is iterable.
[ "Add", "|prefix|", "to", "|element|", "or", "each", "subelement", "if", "element", "is", "iterable", "." ]
def _AddPrefix(element, prefix): """Add |prefix| to |element| or each subelement if element is iterable.""" if element is None: return element # Note, not Iterable because we don't want to handle strings like that. if isinstance(element, list) or isinstance(element, tuple): return [prefix + e for e in e...
[ "def", "_AddPrefix", "(", "element", ",", "prefix", ")", ":", "if", "element", "is", "None", ":", "return", "element", "# Note, not Iterable because we don't want to handle strings like that.", "if", "isinstance", "(", "element", ",", "list", ")", "or", "isinstance", ...
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/msvs_emulation.py#L75-L83
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PropertyGrid.SetCaptionTextColour
(*args, **kwargs)
return _propgrid.PropertyGrid_SetCaptionTextColour(*args, **kwargs)
SetCaptionTextColour(self, Colour col)
SetCaptionTextColour(self, Colour col)
[ "SetCaptionTextColour", "(", "self", "Colour", "col", ")" ]
def SetCaptionTextColour(*args, **kwargs): """SetCaptionTextColour(self, Colour col)""" return _propgrid.PropertyGrid_SetCaptionTextColour(*args, **kwargs)
[ "def", "SetCaptionTextColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_SetCaptionTextColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2231-L2233
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/arraypad.py
python
_get_stats
(padded, axis, width_pair, length_pair, stat_func)
return left_stat, right_stat
Calculate statistic for the empty-padded array in given dimnsion. Parameters ---------- padded : ndarray Empty-padded array. axis : int Dimension in which the statistic is calculated. width_pair : (int, int) Pair of widths that mark the pad area on both sides in the given ...
Calculate statistic for the empty-padded array in given dimnsion.
[ "Calculate", "statistic", "for", "the", "empty", "-", "padded", "array", "in", "given", "dimnsion", "." ]
def _get_stats(padded, axis, width_pair, length_pair, stat_func): """ Calculate statistic for the empty-padded array in given dimnsion. Parameters ---------- padded : ndarray Empty-padded array. axis : int Dimension in which the statistic is calculated. width_pair : (int, in...
[ "def", "_get_stats", "(", "padded", ",", "axis", ",", "width_pair", ",", "length_pair", ",", "stat_func", ")", ":", "# Calculate indices of the edges of the area with original values", "left_index", "=", "width_pair", "[", "0", "]", "right_index", "=", "padded", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/arraypad.py#L235-L298
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/json_schema_compiler/model.py
python
Property.GetUnixName
(self)
return self._unix_name
Gets the property's unix_name. Raises AttributeError if not set.
Gets the property's unix_name. Raises AttributeError if not set.
[ "Gets", "the", "property", "s", "unix_name", ".", "Raises", "AttributeError", "if", "not", "set", "." ]
def GetUnixName(self): """Gets the property's unix_name. Raises AttributeError if not set. """ if not self._unix_name: raise AttributeError('No unix_name set on %s' % self.name) self._unix_name_used = True return self._unix_name
[ "def", "GetUnixName", "(", "self", ")", ":", "if", "not", "self", ".", "_unix_name", ":", "raise", "AttributeError", "(", "'No unix_name set on %s'", "%", "self", ".", "name", ")", "self", ".", "_unix_name_used", "=", "True", "return", "self", ".", "_unix_na...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/json_schema_compiler/model.py#L376-L382
potassco/clingo
e0c91d8f95cc28de1c480a871f9c97c30de83d40
libpyclingo/clingo/solving.py
python
Model.thread_id
(self)
return _c_call('clingo_id_t', _lib.clingo_model_thread_id, self._rep)
The id of the thread which found the model.
The id of the thread which found the model.
[ "The", "id", "of", "the", "thread", "which", "found", "the", "model", "." ]
def thread_id(self) -> int: ''' The id of the thread which found the model. ''' return _c_call('clingo_id_t', _lib.clingo_model_thread_id, self._rep)
[ "def", "thread_id", "(", "self", ")", "->", "int", ":", "return", "_c_call", "(", "'clingo_id_t'", ",", "_lib", ".", "clingo_model_thread_id", ",", "self", ".", "_rep", ")" ]
https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/solving.py#L422-L426
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py
python
File.has_src_builder
(self)
return scb is not None
Return whether this Node has a source builder or not. If this Node doesn't have an explicit source code builder, this is where we figure out, on the fly, if there's a transparent source code builder for it. Note that if we found a source builder, we also set the self.builder at...
Return whether this Node has a source builder or not.
[ "Return", "whether", "this", "Node", "has", "a", "source", "builder", "or", "not", "." ]
def has_src_builder(self): """Return whether this Node has a source builder or not. If this Node doesn't have an explicit source code builder, this is where we figure out, on the fly, if there's a transparent source code builder for it. Note that if we found a source builder, w...
[ "def", "has_src_builder", "(", "self", ")", ":", "try", ":", "scb", "=", "self", ".", "sbuilder", "except", "AttributeError", ":", "scb", "=", "self", ".", "sbuilder", "=", "self", ".", "find_src_builder", "(", ")", "return", "scb", "is", "not", "None" ]
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py#L3041-L3056
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/telemetry/core/platform/power_monitor/android_ds2784_power_monitor.py
python
DS2784PowerMonitor.ParseSamplingOutput
(powermonitor_output)
return out_dict
Parse output of powermonitor command line utility. Returns: Dictionary in the format returned by StopMonitoringPowerAsync().
Parse output of powermonitor command line utility.
[ "Parse", "output", "of", "powermonitor", "command", "line", "utility", "." ]
def ParseSamplingOutput(powermonitor_output): """Parse output of powermonitor command line utility. Returns: Dictionary in the format returned by StopMonitoringPowerAsync(). """ power_samples = [] total_energy_consumption_mwh = 0 def ParseSample(sample): values = [float(x) for x i...
[ "def", "ParseSamplingOutput", "(", "powermonitor_output", ")", ":", "power_samples", "=", "[", "]", "total_energy_consumption_mwh", "=", "0", "def", "ParseSample", "(", "sample", ")", ":", "values", "=", "[", "float", "(", "x", ")", "for", "x", "in", "sample...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/platform/power_monitor/android_ds2784_power_monitor.py#L70-L133
InsightSoftwareConsortium/ITK
87acfce9a93d928311c38bc371b666b515b9f19d
Modules/ThirdParty/pygccxml/src/pygccxml/declarations/declarations_matchers.py
python
variable_matcher_t.__init__
( self, name=None, decl_type=None, header_dir=None, header_file=None)
:param decl_type: variable type :type decl_type: string or instance of :class:`type_t` derived class
:param decl_type: variable type :type decl_type: string or instance of :class:`type_t` derived class
[ ":", "param", "decl_type", ":", "variable", "type", ":", "type", "decl_type", ":", "string", "or", "instance", "of", ":", "class", ":", "type_t", "derived", "class" ]
def __init__( self, name=None, decl_type=None, header_dir=None, header_file=None): """ :param decl_type: variable type :type decl_type: string or instance of :class:`type_t` derived class """ declaration_matcher_t.__ini...
[ "def", "__init__", "(", "self", ",", "name", "=", "None", ",", "decl_type", "=", "None", ",", "header_dir", "=", "None", ",", "header_file", "=", "None", ")", ":", "declaration_matcher_t", ".", "__init__", "(", "self", ",", "name", "=", "name", ",", "d...
https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/declarations_matchers.py#L190-L207
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/data/util/structure.py
python
from_compatible_tensor_list
(element_spec, tensor_list)
return _from_tensor_list_helper( lambda spec, value: spec._from_compatible_tensor_list(value), element_spec, tensor_list)
Returns an element constructed from the given spec and tensor list. Args: element_spec: A nested structure of `tf.TypeSpec` objects representing to element type specification. tensor_list: A list of tensors to use for constructing the value. Returns: An element constructed from the given spec an...
Returns an element constructed from the given spec and tensor list.
[ "Returns", "an", "element", "constructed", "from", "the", "given", "spec", "and", "tensor", "list", "." ]
def from_compatible_tensor_list(element_spec, tensor_list): """Returns an element constructed from the given spec and tensor list. Args: element_spec: A nested structure of `tf.TypeSpec` objects representing to element type specification. tensor_list: A list of tensors to use for constructing the val...
[ "def", "from_compatible_tensor_list", "(", "element_spec", ",", "tensor_list", ")", ":", "# pylint: disable=protected-access", "# pylint: disable=g-long-lambda", "return", "_from_tensor_list_helper", "(", "lambda", "spec", ",", "value", ":", "spec", ".", "_from_compatible_ten...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/data/util/structure.py#L223-L243
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiMDIChildFrame.GetIcon
(*args, **kwargs)
return _aui.AuiMDIChildFrame_GetIcon(*args, **kwargs)
GetIcon(self) -> Icon
GetIcon(self) -> Icon
[ "GetIcon", "(", "self", ")", "-", ">", "Icon" ]
def GetIcon(*args, **kwargs): """GetIcon(self) -> Icon""" return _aui.AuiMDIChildFrame_GetIcon(*args, **kwargs)
[ "def", "GetIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiMDIChildFrame_GetIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L1554-L1556
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/utils/cpp_extension/extension_utils.py
python
_generate_python_module
(module_name, op_names, build_directory, verbose=False)
return custom_module
Automatically generate python file to allow import or load into as module
Automatically generate python file to allow import or load into as module
[ "Automatically", "generate", "python", "file", "to", "allow", "import", "or", "load", "into", "as", "module" ]
def _generate_python_module(module_name, op_names, build_directory, verbose=False): """ Automatically generate python file to allow import or load into as module """ def remove_if_exit(filepath): if os.path.exis...
[ "def", "_generate_python_module", "(", "module_name", ",", "op_names", ",", "build_directory", ",", "verbose", "=", "False", ")", ":", "def", "remove_if_exit", "(", "filepath", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "filepath", ")", ":", "o...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/utils/cpp_extension/extension_utils.py#L881-L910
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py
python
OrderedDict.__eq__
(self, other)
return dict.__eq__(self, other)
od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive.
od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive.
[ "od", ".", "__eq__", "(", "y", ")", "<", "==", ">", "od", "==", "y", ".", "Comparison", "to", "another", "OD", "is", "order", "-", "sensitive", "while", "comparison", "to", "a", "regular", "mapping", "is", "order", "-", "insensitive", "." ]
def __eq__(self, other): '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. ''' if isinstance(other, OrderedDict): return len(self)==len(other) and self.items() == other.items() return ...
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "OrderedDict", ")", ":", "return", "len", "(", "self", ")", "==", "len", "(", "other", ")", "and", "self", ".", "items", "(", ")", "==", "other", ".", "i...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py#L264-L271
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextFileHandler.IsVisible
(*args, **kwargs)
return _richtext.RichTextFileHandler_IsVisible(*args, **kwargs)
IsVisible(self) -> bool
IsVisible(self) -> bool
[ "IsVisible", "(", "self", ")", "-", ">", "bool" ]
def IsVisible(*args, **kwargs): """IsVisible(self) -> bool""" return _richtext.RichTextFileHandler_IsVisible(*args, **kwargs)
[ "def", "IsVisible", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextFileHandler_IsVisible", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L2780-L2782
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/aui.py
python
AuiManager._GetPaneByName
(*args, **kwargs)
return _aui.AuiManager__GetPaneByName(*args, **kwargs)
_GetPaneByName(self, String name) -> AuiPaneInfo
_GetPaneByName(self, String name) -> AuiPaneInfo
[ "_GetPaneByName", "(", "self", "String", "name", ")", "-", ">", "AuiPaneInfo" ]
def _GetPaneByName(*args, **kwargs): """_GetPaneByName(self, String name) -> AuiPaneInfo""" return _aui.AuiManager__GetPaneByName(*args, **kwargs)
[ "def", "_GetPaneByName", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiManager__GetPaneByName", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L631-L633
google/filament
d21f092645b8e1e312307cbf89f1484891347c63
third_party/libassimp/port/PyAssimp/pyassimp/helper.py
python
hasattr_silent
(object, name)
Calls hasttr() with the given parameters and preserves the legacy (pre-Python 3.2) functionality of silently catching exceptions. Returns the result of hasatter() or False if an exception was raised.
Calls hasttr() with the given parameters and preserves the legacy (pre-Python 3.2) functionality of silently catching exceptions.
[ "Calls", "hasttr", "()", "with", "the", "given", "parameters", "and", "preserves", "the", "legacy", "(", "pre", "-", "Python", "3", ".", "2", ")", "functionality", "of", "silently", "catching", "exceptions", "." ]
def hasattr_silent(object, name): """ Calls hasttr() with the given parameters and preserves the legacy (pre-Python 3.2) functionality of silently catching exceptions. Returns the result of hasatter() or False if an exception was raised. """ try: if not object: ...
[ "def", "hasattr_silent", "(", "object", ",", "name", ")", ":", "try", ":", "if", "not", "object", ":", "return", "False", "return", "hasattr", "(", "object", ",", "name", ")", "except", "AttributeError", ":", "return", "False" ]
https://github.com/google/filament/blob/d21f092645b8e1e312307cbf89f1484891347c63/third_party/libassimp/port/PyAssimp/pyassimp/helper.py#L268-L281
manutdzou/KITTI_SSD
5b620c2f291d36a0fe14489214f22a992f173f44
scripts/cpp_lint.py
python
FileInfo.NoExtension
(self)
return '/'.join(self.Split()[0:2])
File has no source file extension.
File has no source file extension.
[ "File", "has", "no", "source", "file", "extension", "." ]
def NoExtension(self): """File has no source file extension.""" return '/'.join(self.Split()[0:2])
[ "def", "NoExtension", "(", "self", ")", ":", "return", "'/'", ".", "join", "(", "self", ".", "Split", "(", ")", "[", "0", ":", "2", "]", ")" ]
https://github.com/manutdzou/KITTI_SSD/blob/5b620c2f291d36a0fe14489214f22a992f173f44/scripts/cpp_lint.py#L952-L954
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/lib/format.py
python
write_array_header_1_0
(fp, d)
Write the header for an array using the 1.0 format. Parameters ---------- fp : filelike object d : dict This has the appropriate entries for writing its string representation to the header of the file.
Write the header for an array using the 1.0 format.
[ "Write", "the", "header", "for", "an", "array", "using", "the", "1", ".", "0", "format", "." ]
def write_array_header_1_0(fp, d): """ Write the header for an array using the 1.0 format. Parameters ---------- fp : filelike object d : dict This has the appropriate entries for writing its string representation to the header of the file. """ import struct header = ["{...
[ "def", "write_array_header_1_0", "(", "fp", ",", "d", ")", ":", "import", "struct", "header", "=", "[", "\"{\"", "]", "for", "key", ",", "value", "in", "sorted", "(", "d", ".", "items", "(", ")", ")", ":", "# Need to use repr here, since we eval these when r...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/format.py#L258-L286
root-project/root
fcd3583bb14852bf2e8cd2415717cbaac0e75896
bindings/pyroot/cppyy/cppyy/python/cppyy/__init__.py
python
c_include
(header)
Load (and JIT) header file <header> into Cling.
Load (and JIT) header file <header> into Cling.
[ "Load", "(", "and", "JIT", ")", "header", "file", "<header", ">", "into", "Cling", "." ]
def c_include(header): """Load (and JIT) header file <header> into Cling.""" gbl.gInterpreter.Declare("""extern "C" { #include "%s" }""" % header)
[ "def", "c_include", "(", "header", ")", ":", "gbl", ".", "gInterpreter", ".", "Declare", "(", "\"\"\"extern \"C\" {\n#include \"%s\"\n}\"\"\"", "%", "header", ")" ]
https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/pyroot/cppyy/cppyy/python/cppyy/__init__.py#L212-L216
mitsuba-renderer/mitsuba2
4e7628c6eed365904ca2ba536b795d1b03410344
src/python/python/util.py
python
ParameterMap.set_dirty
(self, key: str)
return item
Marks a specific parameter and its parent objects as dirty. A subsequent call to :py:meth:`~mitsuba.python.util.ParameterMap.update()` will refresh their internal state. This function is automatically called when overwriting a parameter using :py:meth:`~mitsuba.python.util.ParameterMap.__setitem...
Marks a specific parameter and its parent objects as dirty. A subsequent call to :py:meth:`~mitsuba.python.util.ParameterMap.update()` will refresh their internal state. This function is automatically called when overwriting a parameter using :py:meth:`~mitsuba.python.util.ParameterMap.__setitem...
[ "Marks", "a", "specific", "parameter", "and", "its", "parent", "objects", "as", "dirty", ".", "A", "subsequent", "call", "to", ":", "py", ":", "meth", ":", "~mitsuba", ".", "python", ".", "util", ".", "ParameterMap", ".", "update", "()", "will", "refresh...
def set_dirty(self, key: str): """ Marks a specific parameter and its parent objects as dirty. A subsequent call to :py:meth:`~mitsuba.python.util.ParameterMap.update()` will refresh their internal state. This function is automatically called when overwriting a parameter using :p...
[ "def", "set_dirty", "(", "self", ",", "key", ":", "str", ")", ":", "item", "=", "self", ".", "properties", "[", "key", "]", "node", "=", "item", "[", "2", "]", "while", "node", "is", "not", "None", ":", "parent", ",", "depth", "=", "self", ".", ...
https://github.com/mitsuba-renderer/mitsuba2/blob/4e7628c6eed365904ca2ba536b795d1b03410344/src/python/python/util.py#L92-L113
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/unit/quantity.py
python
Quantity.sqrt
(self)
return Quantity(value=new_value, unit=new_unit)
Returns square root of a Quantity. Raises ArithmeticError if component exponents are not even. This behavior can be changed if you present a reasonable real life case to me.
Returns square root of a Quantity.
[ "Returns", "square", "root", "of", "a", "Quantity", "." ]
def sqrt(self): """ Returns square root of a Quantity. Raises ArithmeticError if component exponents are not even. This behavior can be changed if you present a reasonable real life case to me. """ # There might be a conversion factor from taking the square root of the u...
[ "def", "sqrt", "(", "self", ")", ":", "# There might be a conversion factor from taking the square root of the unit", "new_value", "=", "math", ".", "sqrt", "(", "self", ".", "_value", ")", "new_unit", "=", "self", ".", "unit", ".", "sqrt", "(", ")", "unit_factor"...
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/unit/quantity.py#L442-L455
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
ext/ply/example/ansic/cparse.py
python
p_struct_declarator_list_1
(t)
struct_declarator_list : struct_declarator
struct_declarator_list : struct_declarator
[ "struct_declarator_list", ":", "struct_declarator" ]
def p_struct_declarator_list_1(t): 'struct_declarator_list : struct_declarator' pass
[ "def", "p_struct_declarator_list_1", "(", "t", ")", ":", "pass" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/ansic/cparse.py#L207-L209
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py
python
make_place_holder_tensors_for_base_features
(feature_columns)
return placeholders
Returns placeholder tensors for inference. Args: feature_columns: An iterable containing all the feature columns. All items should be instances of classes derived from _FeatureColumn. Returns: A dict mapping feature keys to SparseTensors (sparse columns) or placeholder Tensors (dense columns).
Returns placeholder tensors for inference.
[ "Returns", "placeholder", "tensors", "for", "inference", "." ]
def make_place_holder_tensors_for_base_features(feature_columns): """Returns placeholder tensors for inference. Args: feature_columns: An iterable containing all the feature columns. All items should be instances of classes derived from _FeatureColumn. Returns: A dict mapping feature keys to Sparse...
[ "def", "make_place_holder_tensors_for_base_features", "(", "feature_columns", ")", ":", "# Get dict mapping features to FixedLenFeature or VarLenFeature values.", "dict_for_parse_example", "=", "create_feature_spec_for_parsing", "(", "feature_columns", ")", "placeholders", "=", "{", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py#L1506-L1531
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/v8/third_party/jinja2/sandbox.py
python
SandboxedEnvironment.unsafe_undefined
(self, obj, attribute)
return self.undefined('access to attribute %r of %r ' 'object is unsafe.' % ( attribute, obj.__class__.__name__ ), name=attribute, obj=obj, exc=SecurityError)
Return an undefined object for unsafe attributes.
Return an undefined object for unsafe attributes.
[ "Return", "an", "undefined", "object", "for", "unsafe", "attributes", "." ]
def unsafe_undefined(self, obj, attribute): """Return an undefined object for unsafe attributes.""" return self.undefined('access to attribute %r of %r ' 'object is unsafe.' % ( attribute, obj.__class__.__name__ ), name=attribute, obj=obj, ex...
[ "def", "unsafe_undefined", "(", "self", ",", "obj", ",", "attribute", ")", ":", "return", "self", ".", "undefined", "(", "'access to attribute %r of %r '", "'object is unsafe.'", "%", "(", "attribute", ",", "obj", ".", "__class__", ".", "__name__", ")", ",", "...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/sandbox.py#L397-L403
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
PhysicsTools/Heppy/python/analyzers/examples/DiLeptonAnalyzer.py
python
DiLeptonAnalyzer.testLegKine
(self, leg, ptcut, etacut )
return leg.pt() > ptcut and \ abs(leg.eta()) < etacut
Tests pt and eta.
Tests pt and eta.
[ "Tests", "pt", "and", "eta", "." ]
def testLegKine(self, leg, ptcut, etacut ): '''Tests pt and eta.''' return leg.pt() > ptcut and \ abs(leg.eta()) < etacut
[ "def", "testLegKine", "(", "self", ",", "leg", ",", "ptcut", ",", "etacut", ")", ":", "return", "leg", ".", "pt", "(", ")", ">", "ptcut", "and", "abs", "(", "leg", ".", "eta", "(", ")", ")", "<", "etacut" ]
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/Heppy/python/analyzers/examples/DiLeptonAnalyzer.py#L246-L249
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/fcn-xs/data.py
python
FileIter._read
(self)
return list(data.items()), list(label.items())
get two list, each list contains two elements: name and nd.array value
get two list, each list contains two elements: name and nd.array value
[ "get", "two", "list", "each", "list", "contains", "two", "elements", ":", "name", "and", "nd", ".", "array", "value" ]
def _read(self): """get two list, each list contains two elements: name and nd.array value""" _, data_img_name, label_img_name = self.f.readline().strip('\n').split("\t") data = {} label = {} data[self.data_name], label[self.label_name] = self._read_img(data_img_name, label_img_n...
[ "def", "_read", "(", "self", ")", ":", "_", ",", "data_img_name", ",", "label_img_name", "=", "self", ".", "f", ".", "readline", "(", ")", ".", "strip", "(", "'\\n'", ")", ".", "split", "(", "\"\\t\"", ")", "data", "=", "{", "}", "label", "=", "{...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/fcn-xs/data.py#L64-L70
msftguy/ssh-rd
a5f3a79daeac5844edebf01916c9613563f1c390
_3rd/boost_1_48_0/tools/build/v2/build/virtual_target.py
python
Subvariant.implicit_includes
(self, feature, target_type)
return result
Returns the properties which specify implicit include paths to generated headers. This traverses all targets in this subvariant, and subvariants referred by <implcit-dependecy>properties. For all targets which are of type 'target-type' (or for all targets, if 'target_type...
Returns the properties which specify implicit include paths to generated headers. This traverses all targets in this subvariant, and subvariants referred by <implcit-dependecy>properties. For all targets which are of type 'target-type' (or for all targets, if 'target_type...
[ "Returns", "the", "properties", "which", "specify", "implicit", "include", "paths", "to", "generated", "headers", ".", "This", "traverses", "all", "targets", "in", "this", "subvariant", "and", "subvariants", "referred", "by", "<implcit", "-", "dependecy", ">", "...
def implicit_includes (self, feature, target_type): """ Returns the properties which specify implicit include paths to generated headers. This traverses all targets in this subvariant, and subvariants referred by <implcit-dependecy>properties. For all targets which are of typ...
[ "def", "implicit_includes", "(", "self", ",", "feature", ",", "target_type", ")", ":", "if", "not", "target_type", ":", "key", "=", "feature", "else", ":", "key", "=", "feature", "+", "\"-\"", "+", "target_type", "result", "=", "self", ".", "implicit_inclu...
https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/virtual_target.py#L1077-L1099
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/control_flow_ops.py
python
WhileContext.loop_enters
(self)
return self._loop_enters
The list of enter tensors for loop variables.
The list of enter tensors for loop variables.
[ "The", "list", "of", "enter", "tensors", "for", "loop", "variables", "." ]
def loop_enters(self): """The list of enter tensors for loop variables.""" return self._loop_enters
[ "def", "loop_enters", "(", "self", ")", ":", "return", "self", ".", "_loop_enters" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/control_flow_ops.py#L1554-L1556
faasm/faasm
b3bc196d887adbd0bb9802bcb93323543bad59cb
faasmcli/faasmcli/tasks/codegen.py
python
user
(ctx, user)
Generates machine for all the functions belonging to the given user
Generates machine for all the functions belonging to the given user
[ "Generates", "machine", "for", "all", "the", "functions", "belonging", "to", "the", "given", "user" ]
def user(ctx, user): """ Generates machine for all the functions belonging to the given user """ _do_codegen_user(user)
[ "def", "user", "(", "ctx", ",", "user", ")", ":", "_do_codegen_user", "(", "user", ")" ]
https://github.com/faasm/faasm/blob/b3bc196d887adbd0bb9802bcb93323543bad59cb/faasmcli/faasmcli/tasks/codegen.py#L73-L77
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/graph_editor/transform.py
python
Transformer._connect_ops
(self, info)
Connect the previously copied ops.
Connect the previously copied ops.
[ "Connect", "the", "previously", "copied", "ops", "." ]
def _connect_ops(self, info): """Connect the previously copied ops.""" for op in info.sgv.ops: logging.debug("Finalizing op: %s", op.name) op_ = info.transformed_ops[op] # pylint: disable=protected-access if op_.inputs: raise ValueError("The newly transformed op should not have ...
[ "def", "_connect_ops", "(", "self", ",", "info", ")", ":", "for", "op", "in", "info", ".", "sgv", ".", "ops", ":", "logging", ".", "debug", "(", "\"Finalizing op: %s\"", ",", "op", ".", "name", ")", "op_", "=", "info", ".", "transformed_ops", "[", "o...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/graph_editor/transform.py#L459-L485
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/cookielib.py
python
FileCookieJar.revert
(self, filename=None, ignore_discard=False, ignore_expires=False)
Clear all cookies and reload cookies from a saved file. Raises LoadError (or IOError) if reversion is not successful; the object's state will not be altered if this happens.
Clear all cookies and reload cookies from a saved file.
[ "Clear", "all", "cookies", "and", "reload", "cookies", "from", "a", "saved", "file", "." ]
def revert(self, filename=None, ignore_discard=False, ignore_expires=False): """Clear all cookies and reload cookies from a saved file. Raises LoadError (or IOError) if reversion is not successful; the object's state will not be altered if this happens. """ if fi...
[ "def", "revert", "(", "self", ",", "filename", "=", "None", ",", "ignore_discard", "=", "False", ",", "ignore_expires", "=", "False", ")", ":", "if", "filename", "is", "None", ":", "if", "self", ".", "filename", "is", "not", "None", ":", "filename", "=...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/cookielib.py#L1783-L1807
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rospy/src/rospy/client.py
python
init_node
(name, argv=None, anonymous=False, log_level=None, disable_rostime=False, disable_rosout=False, disable_signals=False, xmlrpc_port=0, tcpros_port=0)
Register client node with the master under the specified name. This MUST be called from the main Python thread unless disable_signals is set to True. Duplicate calls to init_node are only allowed if the arguments are identical as the side-effects of this method are not reversible. @param name: Node...
Register client node with the master under the specified name. This MUST be called from the main Python thread unless disable_signals is set to True. Duplicate calls to init_node are only allowed if the arguments are identical as the side-effects of this method are not reversible.
[ "Register", "client", "node", "with", "the", "master", "under", "the", "specified", "name", ".", "This", "MUST", "be", "called", "from", "the", "main", "Python", "thread", "unless", "disable_signals", "is", "set", "to", "True", ".", "Duplicate", "calls", "to...
def init_node(name, argv=None, anonymous=False, log_level=None, disable_rostime=False, disable_rosout=False, disable_signals=False, xmlrpc_port=0, tcpros_port=0): """ Register client node with the master under the specified name. This MUST be called from the main Python thread unless disable_signals is ...
[ "def", "init_node", "(", "name", ",", "argv", "=", "None", ",", "anonymous", "=", "False", ",", "log_level", "=", "None", ",", "disable_rostime", "=", "False", ",", "disable_rosout", "=", "False", ",", "disable_signals", "=", "False", ",", "xmlrpc_port", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/client.py#L190-L340
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/l2_normalize.py
python
_l2_normalize_tbe
()
return
L2Normalize TBE register
L2Normalize TBE register
[ "L2Normalize", "TBE", "register" ]
def _l2_normalize_tbe(): """L2Normalize TBE register""" return
[ "def", "_l2_normalize_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/l2_normalize.py#L36-L38
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py
python
ModuleMakefile.generate_target_clean
(self, mfile)
Generate the clean target. mfile is the file object.
Generate the clean target.
[ "Generate", "the", "clean", "target", "." ]
def generate_target_clean(self, mfile): """Generate the clean target. mfile is the file object. """ mfile.write("\nclean:\n") self.clean_build_file_objects(mfile, self._build) if self._manifest and not self.static: mfile.write("\t-%s $(TARGET).manifest\n" % ...
[ "def", "generate_target_clean", "(", "self", ",", "mfile", ")", ":", "mfile", ".", "write", "(", "\"\\nclean:\\n\"", ")", "self", ".", "clean_build_file_objects", "(", "mfile", ",", "self", ".", "_build", ")", "if", "self", ".", "_manifest", "and", "not", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py#L1818-L1833
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fsspec/spec.py
python
AbstractFileSystem.get_mapper
(self, root, check=False, create=False)
return FSMap(root, self, check, create)
Create key/value store based on this file-system Makes a MutibleMapping interface to the FS at the given root path. See ``fsspec.mapping.FSMap`` for further details.
Create key/value store based on this file-system
[ "Create", "key", "/", "value", "store", "based", "on", "this", "file", "-", "system" ]
def get_mapper(self, root, check=False, create=False): """Create key/value store based on this file-system Makes a MutibleMapping interface to the FS at the given root path. See ``fsspec.mapping.FSMap`` for further details. """ from .mapping import FSMap return FSMap(ro...
[ "def", "get_mapper", "(", "self", ",", "root", ",", "check", "=", "False", ",", "create", "=", "False", ")", ":", "from", ".", "mapping", "import", "FSMap", "return", "FSMap", "(", "root", ",", "self", ",", "check", ",", "create", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fsspec/spec.py#L906-L914