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
Cisco-Talos/moflow
ed71dfb0540d9e0d7a4c72f0881b58958d573728
BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/encoder.py
python
StringEncoder
(field_number, is_repeated, is_packed)
Returns an encoder for a string field.
Returns an encoder for a string field.
[ "Returns", "an", "encoder", "for", "a", "string", "field", "." ]
def StringEncoder(field_number, is_repeated, is_packed): """Returns an encoder for a string field.""" tag = TagBytes(field_number, wire_format.WIRETYPE_LENGTH_DELIMITED) local_EncodeVarint = _EncodeVarint local_len = len assert not is_packed if is_repeated: def EncodeRepeatedField(write, value): ...
[ "def", "StringEncoder", "(", "field_number", ",", "is_repeated", ",", "is_packed", ")", ":", "tag", "=", "TagBytes", "(", "field_number", ",", "wire_format", ".", "WIRETYPE_LENGTH_DELIMITED", ")", "local_EncodeVarint", "=", "_EncodeVarint", "local_len", "=", "len", ...
https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/encoder.py#L652-L673
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/function_base.py
python
blackman
(M)
return 0.42 - 0.5*cos(2.0*pi*n/(M-1)) + 0.08*cos(4.0*pi*n/(M-1))
Return the Blackman window. The Blackman window is a taper formed by using the first three terms of a summation of cosines. It was designed to have close to the minimal leakage possible. It is close to optimal, only slightly worse than a Kaiser window. Parameters ---------- M : int ...
Return the Blackman window.
[ "Return", "the", "Blackman", "window", "." ]
def blackman(M): """ Return the Blackman window. The Blackman window is a taper formed by using the first three terms of a summation of cosines. It was designed to have close to the minimal leakage possible. It is close to optimal, only slightly worse than a Kaiser window. Parameters ...
[ "def", "blackman", "(", "M", ")", ":", "if", "M", "<", "1", ":", "return", "array", "(", "[", "]", ")", "if", "M", "==", "1", ":", "return", "ones", "(", "1", ",", "float", ")", "n", "=", "arange", "(", "0", ",", "M", ")", "return", "0.42",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/function_base.py#L2548-L2644
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/model_selection/_split.py
python
LeaveOneGroupOut.get_n_splits
(self, X, y, groups)
return len(np.unique(groups))
Returns the number of splitting iterations in the cross-validator Parameters ---------- X : object Always ignored, exists for compatibility. y : object Always ignored, exists for compatibility. groups : array-like, with shape (n_samples,), optional ...
Returns the number of splitting iterations in the cross-validator
[ "Returns", "the", "number", "of", "splitting", "iterations", "in", "the", "cross", "-", "validator" ]
def get_n_splits(self, X, y, groups): """Returns the number of splitting iterations in the cross-validator Parameters ---------- X : object Always ignored, exists for compatibility. y : object Always ignored, exists for compatibility. groups : a...
[ "def", "get_n_splits", "(", "self", ",", "X", ",", "y", ",", "groups", ")", ":", "if", "groups", "is", "None", ":", "raise", "ValueError", "(", "\"The groups parameter should not be None\"", ")", "return", "len", "(", "np", ".", "unique", "(", "groups", ")...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/model_selection/_split.py#L789-L811
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PGCell.GetBitmap
(*args, **kwargs)
return _propgrid.PGCell_GetBitmap(*args, **kwargs)
GetBitmap(self) -> Bitmap
GetBitmap(self) -> Bitmap
[ "GetBitmap", "(", "self", ")", "-", ">", "Bitmap" ]
def GetBitmap(*args, **kwargs): """GetBitmap(self) -> Bitmap""" return _propgrid.PGCell_GetBitmap(*args, **kwargs)
[ "def", "GetBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGCell_GetBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L175-L177
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py
python
Decimal.is_finite
(self)
return not self._is_special
Return True if self is finite; otherwise return False. A Decimal instance is considered finite if it is neither infinite nor a NaN.
Return True if self is finite; otherwise return False.
[ "Return", "True", "if", "self", "is", "finite", ";", "otherwise", "return", "False", "." ]
def is_finite(self): """Return True if self is finite; otherwise return False. A Decimal instance is considered finite if it is neither infinite nor a NaN. """ return not self._is_special
[ "def", "is_finite", "(", "self", ")", ":", "return", "not", "self", ".", "_is_special" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py#L3119-L3125
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/neurd.py
python
CounterfactualNeurdSolver._sequence_weights
(self, player=None)
Returns exponentiated weights for each sequence as an `np.array`.
Returns exponentiated weights for each sequence as an `np.array`.
[ "Returns", "exponentiated", "weights", "for", "each", "sequence", "as", "an", "np", ".", "array", "." ]
def _sequence_weights(self, player=None): """Returns exponentiated weights for each sequence as an `np.array`.""" if player is None: return [ self._sequence_weights(player) for player in range(self._game.num_players()) ] else: tensor = tf.squeeze(self._models[player]( ...
[ "def", "_sequence_weights", "(", "self", ",", "player", "=", "None", ")", ":", "if", "player", "is", "None", ":", "return", "[", "self", ".", "_sequence_weights", "(", "player", ")", "for", "player", "in", "range", "(", "self", ".", "_game", ".", "num_...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/neurd.py#L215-L227
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/probability/distribution/poisson.py
python
Poisson.extend_repr
(self)
return s
Display instance object as string.
Display instance object as string.
[ "Display", "instance", "object", "as", "string", "." ]
def extend_repr(self): """Display instance object as string.""" if self.is_scalar_batch: s = 'rate = {}'.format(self.rate) else: s = 'batch_shape = {}'.format(self._broadcast_shape) return s
[ "def", "extend_repr", "(", "self", ")", ":", "if", "self", ".", "is_scalar_batch", ":", "s", "=", "'rate = {}'", ".", "format", "(", "self", ".", "rate", ")", "else", ":", "s", "=", "'batch_shape = {}'", ".", "format", "(", "self", ".", "_broadcast_shape...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/poisson.py#L180-L186
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextPrintout.SetMargins
(*args, **kwargs)
return _richtext.RichTextPrintout_SetMargins(*args, **kwargs)
SetMargins(self, int top=254, int bottom=254, int left=254, int right=254)
SetMargins(self, int top=254, int bottom=254, int left=254, int right=254)
[ "SetMargins", "(", "self", "int", "top", "=", "254", "int", "bottom", "=", "254", "int", "left", "=", "254", "int", "right", "=", "254", ")" ]
def SetMargins(*args, **kwargs): """SetMargins(self, int top=254, int bottom=254, int left=254, int right=254)""" return _richtext.RichTextPrintout_SetMargins(*args, **kwargs)
[ "def", "SetMargins", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextPrintout_SetMargins", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L4465-L4467
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
samples/python/tensorflow_object_detection_api/build_engine.py
python
EngineCalibrator.write_calibration_cache
(self, cache)
Overrides from trt.IInt8EntropyCalibrator2. Store the calibration cache to a file on disk. :param cache: The contents of the calibration cache to store.
Overrides from trt.IInt8EntropyCalibrator2. Store the calibration cache to a file on disk. :param cache: The contents of the calibration cache to store.
[ "Overrides", "from", "trt", ".", "IInt8EntropyCalibrator2", ".", "Store", "the", "calibration", "cache", "to", "a", "file", "on", "disk", ".", ":", "param", "cache", ":", "The", "contents", "of", "the", "calibration", "cache", "to", "store", "." ]
def write_calibration_cache(self, cache): """ Overrides from trt.IInt8EntropyCalibrator2. Store the calibration cache to a file on disk. :param cache: The contents of the calibration cache to store. """ with open(self.cache_file, "wb") as f: log.info("Writing ...
[ "def", "write_calibration_cache", "(", "self", ",", "cache", ")", ":", "with", "open", "(", "self", ".", "cache_file", ",", "\"wb\"", ")", "as", "f", ":", "log", ".", "info", "(", "\"Writing calibration cache data to: {}\"", ".", "format", "(", "self", ".", ...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/samples/python/tensorflow_object_detection_api/build_engine.py#L99-L107
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/jinja2/parser.py
python
Parser.parse_statement
(self)
Parse a single statement.
Parse a single statement.
[ "Parse", "a", "single", "statement", "." ]
def parse_statement(self): """Parse a single statement.""" token = self.stream.current if token.type != 'name': self.fail('tag name expected', token.lineno) self._tag_stack.append(token.value) pop_tag = True try: if token.value in _statement_keywor...
[ "def", "parse_statement", "(", "self", ")", ":", "token", "=", "self", ".", "stream", ".", "current", "if", "token", ".", "type", "!=", "'name'", ":", "self", ".", "fail", "(", "'tag name expected'", ",", "token", ".", "lineno", ")", "self", ".", "_tag...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/parser.py#L113-L139
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/makegw/makegwparse.py
python
ArgFormatter.GetInterfaceArgCleanup
(self)
Return cleanup code for C++ args passed to the interface method.
Return cleanup code for C++ args passed to the interface method.
[ "Return", "cleanup", "code", "for", "C", "++", "args", "passed", "to", "the", "interface", "method", "." ]
def GetInterfaceArgCleanup(self): "Return cleanup code for C++ args passed to the interface method." if DEBUG: return "/* GetInterfaceArgCleanup output goes here: %s */\n" % self.arg.name else: return ""
[ "def", "GetInterfaceArgCleanup", "(", "self", ")", ":", "if", "DEBUG", ":", "return", "\"/* GetInterfaceArgCleanup output goes here: %s */\\n\"", "%", "self", ".", "arg", ".", "name", "else", ":", "return", "\"\"" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/makegw/makegwparse.py#L105-L110
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-analog/python/analog/qa_agc.py
python
test_agc.test_006
(self)
Test the complex AGC loop (attack and decay rate inputs)
Test the complex AGC loop (attack and decay rate inputs)
[ "Test", "the", "complex", "AGC", "loop", "(", "attack", "and", "decay", "rate", "inputs", ")" ]
def test_006(self): ''' Test the complex AGC loop (attack and decay rate inputs) ''' tb = self.tb sampling_freq = 100 # N must by a multiple of the volk_alignment of the system for this test to work. # For a machine with 512-bit registers, that would be 8 complex-floats. ...
[ "def", "test_006", "(", "self", ")", ":", "tb", "=", "self", ".", "tb", "sampling_freq", "=", "100", "# N must by a multiple of the volk_alignment of the system for this test to work.", "# For a machine with 512-bit registers, that would be 8 complex-floats.", "N", "=", "int", ...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-analog/python/analog/qa_agc.py#L452-L476
smilehao/xlua-framework
a03801538be2b0e92d39332d445b22caca1ef61f
ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/enum_type_wrapper.py
python
EnumTypeWrapper.keys
(self)
return [value_descriptor.name for value_descriptor in self._enum_type.values]
Return a list of the string names in the enum. These are returned in the order they were defined in the .proto file.
Return a list of the string names in the enum.
[ "Return", "a", "list", "of", "the", "string", "names", "in", "the", "enum", "." ]
def keys(self): """Return a list of the string names in the enum. These are returned in the order they were defined in the .proto file. """ return [value_descriptor.name for value_descriptor in self._enum_type.values]
[ "def", "keys", "(", "self", ")", ":", "return", "[", "value_descriptor", ".", "name", "for", "value_descriptor", "in", "self", ".", "_enum_type", ".", "values", "]" ]
https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/enum_type_wrapper.py#L65-L72
danxuhk/ContinuousCRF-CNN
2b6dcaf179620f118b225ed12c890414ca828e21
python/caffe/draw.py
python
get_edge_label
(layer)
return edge_label
Define edge label based on layer type.
Define edge label based on layer type.
[ "Define", "edge", "label", "based", "on", "layer", "type", "." ]
def get_edge_label(layer): """Define edge label based on layer type. """ if layer.type == 'Data': edge_label = 'Batch ' + str(layer.data_param.batch_size) elif layer.type == 'Convolution' or layer.type == 'Deconvolution': edge_label = str(layer.convolution_param.num_output) elif lay...
[ "def", "get_edge_label", "(", "layer", ")", ":", "if", "layer", ".", "type", "==", "'Data'", ":", "edge_label", "=", "'Batch '", "+", "str", "(", "layer", ".", "data_param", ".", "batch_size", ")", "elif", "layer", ".", "type", "==", "'Convolution'", "or...
https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/python/caffe/draw.py#L46-L59
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tracking/util.py
python
TrackableSaver.save
(self, file_prefix, checkpoint_number=None, session=None)
Save a training checkpoint. The saved checkpoint includes variables created by this object and any Trackable objects it depends on at the time `Saver.save()` is called. Args: file_prefix: A prefix to use for the checkpoint filenames (/path/to/directory/and_a_prefix). Names are generated base...
Save a training checkpoint.
[ "Save", "a", "training", "checkpoint", "." ]
def save(self, file_prefix, checkpoint_number=None, session=None): """Save a training checkpoint. The saved checkpoint includes variables created by this object and any Trackable objects it depends on at the time `Saver.save()` is called. Args: file_prefix: A prefix to use for the checkpoint fil...
[ "def", "save", "(", "self", ",", "file_prefix", ",", "checkpoint_number", "=", "None", ",", "session", "=", "None", ")", ":", "feed_dict", "=", "{", "}", "use_session", "=", "(", "not", "context", ".", "executing_eagerly", "(", ")", "and", "not", "ops", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tracking/util.py#L1110-L1166
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/virtualenv/files/virtualenv_support/site.py
python
addsitepackages
(known_paths, sys_prefix=sys.prefix, exec_prefix=sys.exec_prefix)
return None
Add site-packages (and possibly site-python) to sys.path
Add site-packages (and possibly site-python) to sys.path
[ "Add", "site", "-", "packages", "(", "and", "possibly", "site", "-", "python", ")", "to", "sys", ".", "path" ]
def addsitepackages(known_paths, sys_prefix=sys.prefix, exec_prefix=sys.exec_prefix): """Add site-packages (and possibly site-python) to sys.path""" prefixes = [os.path.join(sys_prefix, "local"), sys_prefix] if exec_prefix != sys_prefix: prefixes.append(os.path.join(exec_prefix, "local")) for p...
[ "def", "addsitepackages", "(", "known_paths", ",", "sys_prefix", "=", "sys", ".", "prefix", ",", "exec_prefix", "=", "sys", ".", "exec_prefix", ")", ":", "prefixes", "=", "[", "os", ".", "path", ".", "join", "(", "sys_prefix", ",", "\"local\"", ")", ",",...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/virtualenv/files/virtualenv_support/site.py#L208-L274
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/control/robotinterface.py
python
RobotInterfaceBase.sensedTorque
(self)
Retrieves the currently sensed joint torque.
Retrieves the currently sensed joint torque.
[ "Retrieves", "the", "currently", "sensed", "joint", "torque", "." ]
def sensedTorque(self) -> Vector: """Retrieves the currently sensed joint torque. """ raise NotImplementedError()
[ "def", "sensedTorque", "(", "self", ")", "->", "Vector", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/robotinterface.py#L439-L442
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/VBox/Main/glue/vboxapi.py
python
PlatformMSCOM.flushGenPyCache
(self, oGenCache)
return oGenCache.EnsureModule(self.VBOX_TLB_GUID, self.VBOX_TLB_LCID, self.VBOX_TLB_MAJOR, self.VBOX_TLB_MINOR)
Flushes VBox related files in the win32com gen_py cache. This is necessary since we don't follow the typelib versioning rules that everyeone else seems to subscribe to.
Flushes VBox related files in the win32com gen_py cache.
[ "Flushes", "VBox", "related", "files", "in", "the", "win32com", "gen_py", "cache", "." ]
def flushGenPyCache(self, oGenCache): """ Flushes VBox related files in the win32com gen_py cache. This is necessary since we don't follow the typelib versioning rules that everyeone else seems to subscribe to. """ # # The EnsureModule method have broken validati...
[ "def", "flushGenPyCache", "(", "self", ",", "oGenCache", ")", ":", "#", "# The EnsureModule method have broken validation code, it doesn't take", "# typelib module directories into account. So we brute force them here.", "# (It's possible the directory approach is from some older pywin", "#...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Main/glue/vboxapi.py#L489-L515
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pbr/version.py
python
SemanticVersion.rpm_string
(self)
return self._long_version(None)
Return the version number to use when building an RPM package. This translates the PEP440/semver precedence rules into RPM version sorting operators. Because RPM has no sort-before operator (such as the ~ operator in dpkg), we show all prerelease versions as being versions of the relea...
Return the version number to use when building an RPM package.
[ "Return", "the", "version", "number", "to", "use", "when", "building", "an", "RPM", "package", "." ]
def rpm_string(self): """Return the version number to use when building an RPM package. This translates the PEP440/semver precedence rules into RPM version sorting operators. Because RPM has no sort-before operator (such as the ~ operator in dpkg), we show all prerelease versions as be...
[ "def", "rpm_string", "(", "self", ")", ":", "return", "self", ".", "_long_version", "(", "None", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pbr/version.py#L352-L360
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/graph/port.py
python
Port._get_data_type
(self)
Internal method which does not raise with error if the data type is not known. Check value of the data node to determine input port data type as well as the respective value in the '_out_port_data_type' dictionary. :return: The data type or None if it is not defined
Internal method which does not raise with error if the data type is not known. Check value of the data node to determine input port data type as well as the respective value in the '_out_port_data_type' dictionary. :return: The data type or None if it is not defined
[ "Internal", "method", "which", "does", "not", "raise", "with", "error", "if", "the", "data", "type", "is", "not", "known", ".", "Check", "value", "of", "the", "data", "node", "to", "determine", "input", "port", "data", "type", "as", "well", "as", "the", ...
def _get_data_type(self): """ Internal method which does not raise with error if the data type is not known. Check value of the data node to determine input port data type as well as the respective value in the '_out_port_data_type' dictionary. :return: The data type or None if i...
[ "def", "_get_data_type", "(", "self", ")", ":", "node", "=", "self", ".", "node", "if", "self", ".", "type", "==", "'out'", ":", "if", "node", ".", "has_valid", "(", "'_out_port_data_type'", ")", "and", "self", ".", "idx", "in", "node", ".", "_out_port...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/graph/port.py#L426-L473
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/auibook.py
python
AuiNotebook.GetDefaultBorder
(self)
return wx.BORDER_NONE
Returns the default border style for :class:`AuiNotebook`.
Returns the default border style for :class:`AuiNotebook`.
[ "Returns", "the", "default", "border", "style", "for", ":", "class", ":", "AuiNotebook", "." ]
def GetDefaultBorder(self): """ Returns the default border style for :class:`AuiNotebook`. """ return wx.BORDER_NONE
[ "def", "GetDefaultBorder", "(", "self", ")", ":", "return", "wx", ".", "BORDER_NONE" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L5738-L5741
hakuna-m/wubiuefi
caec1af0a09c78fd5a345180ada1fe45e0c63493
src/pypack/modulegraph/pkg_resources.py
python
IMetadataProvider.metadata_listdir
(name)
List of metadata names in the directory (like ``os.listdir()``)
List of metadata names in the directory (like ``os.listdir()``)
[ "List", "of", "metadata", "names", "in", "the", "directory", "(", "like", "os", ".", "listdir", "()", ")" ]
def metadata_listdir(name): """List of metadata names in the directory (like ``os.listdir()``)"""
[ "def", "metadata_listdir", "(", "name", ")", ":" ]
https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/modulegraph/pkg_resources.py#L265-L266
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py
python
SpawnBase.read
(self, size=-1)
return self.before
This reads at most "size" bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached. The bytes are returned as a string object. An empty string is returned when EOF is encountered immediate...
This reads at most "size" bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached. The bytes are returned as a string object. An empty string is returned when EOF is encountered immediate...
[ "This", "reads", "at", "most", "size", "bytes", "from", "the", "file", "(", "less", "if", "the", "read", "hits", "EOF", "before", "obtaining", "size", "bytes", ")", ".", "If", "the", "size", "argument", "is", "negative", "or", "omitted", "read", "all", ...
def read(self, size=-1): '''This reads at most "size" bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached. The bytes are returned as a string object. An empty string is returned when ...
[ "def", "read", "(", "self", ",", "size", "=", "-", "1", ")", ":", "if", "size", "==", "0", ":", "return", "self", ".", "string_type", "(", ")", "if", "size", "<", "0", ":", "# delimiter default is EOF", "self", ".", "expect", "(", "self", ".", "del...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py#L430-L457
p4lang/p4c
3272e79369f20813cc1a555a5eb26f44432f84a4
tools/cpplint.py
python
_ExpandDirectories
(filenames)
return filtered
Searches a list of filenames and replaces directories in the list with all files descending from those directories. Files with extensions not in the valid extensions list are excluded. Args: filenames: A list of files or directories Returns: A list of all files that are members of filenames or descend...
Searches a list of filenames and replaces directories in the list with all files descending from those directories. Files with extensions not in the valid extensions list are excluded.
[ "Searches", "a", "list", "of", "filenames", "and", "replaces", "directories", "in", "the", "list", "with", "all", "files", "descending", "from", "those", "directories", ".", "Files", "with", "extensions", "not", "in", "the", "valid", "extensions", "list", "are...
def _ExpandDirectories(filenames): """Searches a list of filenames and replaces directories in the list with all files descending from those directories. Files with extensions not in the valid extensions list are excluded. Args: filenames: A list of files or directories Returns: A list of all files ...
[ "def", "_ExpandDirectories", "(", "filenames", ")", ":", "expanded", "=", "set", "(", ")", "for", "filename", "in", "filenames", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "filename", ")", ":", "expanded", ".", "add", "(", "filename", ")",...
https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/cpplint.py#L6852-L6881
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
examples/faster-rcnn/lib/datasets/coco.py
python
coco._load_proposals
(self, method, gt_roidb)
return self.create_roidb_from_box_list(box_list, gt_roidb)
Load pre-computed proposals in the format provided by Jan Hosang: http://www.mpi-inf.mpg.de/departments/computer-vision-and-multimodal- computing/research/object-recognition-and-scene-understanding/how- good-are-detection-proposals-really/ For MCG, use boxes from http://www.eecs.berk...
Load pre-computed proposals in the format provided by Jan Hosang: http://www.mpi-inf.mpg.de/departments/computer-vision-and-multimodal- computing/research/object-recognition-and-scene-understanding/how- good-are-detection-proposals-really/ For MCG, use boxes from http://www.eecs.berk...
[ "Load", "pre", "-", "computed", "proposals", "in", "the", "format", "provided", "by", "Jan", "Hosang", ":", "http", ":", "//", "www", ".", "mpi", "-", "inf", ".", "mpg", ".", "de", "/", "departments", "/", "computer", "-", "vision", "-", "and", "-", ...
def _load_proposals(self, method, gt_roidb): """ Load pre-computed proposals in the format provided by Jan Hosang: http://www.mpi-inf.mpg.de/departments/computer-vision-and-multimodal- computing/research/object-recognition-and-scene-understanding/how- good-are-detection-propo...
[ "def", "_load_proposals", "(", "self", ",", "method", ",", "gt_roidb", ")", ":", "box_list", "=", "[", "]", "top_k", "=", "self", ".", "config", "[", "'top_k'", "]", "valid_methods", "=", "[", "'MCG'", ",", "'selective_search'", ",", "'edge_boxes_AR'", ","...
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/faster-rcnn/lib/datasets/coco.py#L161-L206
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
wrap/gtwrap/pybind_wrapper.py
python
PybindWrapper.wrap_instantiated_declaration
( self, instantiated_decl: instantiator.InstantiatedDeclaration)
return res
Wrap the class.
Wrap the class.
[ "Wrap", "the", "class", "." ]
def wrap_instantiated_declaration( self, instantiated_decl: instantiator.InstantiatedDeclaration): """Wrap the class.""" module_var = self._gen_module_var(instantiated_decl.namespaces()) cpp_class = instantiated_decl.to_cpp() if cpp_class in self.ignore_classes: r...
[ "def", "wrap_instantiated_declaration", "(", "self", ",", "instantiated_decl", ":", "instantiator", ".", "InstantiatedDeclaration", ")", ":", "module_var", "=", "self", ".", "_gen_module_var", "(", "instantiated_decl", ".", "namespaces", "(", ")", ")", "cpp_class", ...
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/wrap/gtwrap/pybind_wrapper.py#L413-L428
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/docs/tools/dump_ast_matchers.py
python
esc
(text)
return text
Escape any html in the given text.
Escape any html in the given text.
[ "Escape", "any", "html", "in", "the", "given", "text", "." ]
def esc(text): """Escape any html in the given text.""" text = re.sub(r'&', '&amp;', text) text = re.sub(r'<', '&lt;', text) text = re.sub(r'>', '&gt;', text) def link_if_exists(m): """Wrap a likely AST node name in a link to its clang docs. We want to do this only if the page exists, in which cas...
[ "def", "esc", "(", "text", ")", ":", "text", "=", "re", ".", "sub", "(", "r'&'", ",", "'&amp;'", ",", "text", ")", "text", "=", "re", ".", "sub", "(", "r'<'", ",", "'&lt;'", ",", "text", ")", "text", "=", "re", ".", "sub", "(", "r'>'", ",", ...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/docs/tools/dump_ast_matchers.py#L43-L67
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/imghdr.py
python
test_rast
(h, f)
Sun raster file
Sun raster file
[ "Sun", "raster", "file" ]
def test_rast(h, f): """Sun raster file""" if h[:4] == '\x59\xA6\x6A\x95': return 'rast'
[ "def", "test_rast", "(", "h", ",", "f", ")", ":", "if", "h", "[", ":", "4", "]", "==", "'\\x59\\xA6\\x6A\\x95'", ":", "return", "'rast'" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/imghdr.py#L100-L103
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
TimeSpan.__lt__
(*args, **kwargs)
return _misc_.TimeSpan___lt__(*args, **kwargs)
__lt__(self, TimeSpan other) -> bool
__lt__(self, TimeSpan other) -> bool
[ "__lt__", "(", "self", "TimeSpan", "other", ")", "-", ">", "bool" ]
def __lt__(*args, **kwargs): """__lt__(self, TimeSpan other) -> bool""" return _misc_.TimeSpan___lt__(*args, **kwargs)
[ "def", "__lt__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "TimeSpan___lt__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L4466-L4468
commaai/openpilot
4416c21b1e738ab7d04147c5ae52b5135e0cdb40
pyextra/acados_template/acados_ocp.py
python
AcadosOcpOptions.qp_solver_tol_ineq
(self)
return self.__qp_solver_tol_ineq
QP solver inequality. Default: :code:`None`
QP solver inequality. Default: :code:`None`
[ "QP", "solver", "inequality", ".", "Default", ":", ":", "code", ":", "None" ]
def qp_solver_tol_ineq(self): """ QP solver inequality. Default: :code:`None` """ return self.__qp_solver_tol_ineq
[ "def", "qp_solver_tol_ineq", "(", "self", ")", ":", "return", "self", ".", "__qp_solver_tol_ineq" ]
https://github.com/commaai/openpilot/blob/4416c21b1e738ab7d04147c5ae52b5135e0cdb40/pyextra/acados_template/acados_ocp.py#L2288-L2293
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/package_index.py
python
parse_bdist_wininst
(name)
return base, py_ver, plat
Return (base,pyversion) or (None,None) for possible .exe name
Return (base,pyversion) or (None,None) for possible .exe name
[ "Return", "(", "base", "pyversion", ")", "or", "(", "None", "None", ")", "for", "possible", ".", "exe", "name" ]
def parse_bdist_wininst(name): """Return (base,pyversion) or (None,None) for possible .exe name""" lower = name.lower() base, py_ver, plat = None, None, None if lower.endswith('.exe'): if lower.endswith('.win32.exe'): base = name[:-10] plat = 'win32' elif lower....
[ "def", "parse_bdist_wininst", "(", "name", ")", ":", "lower", "=", "name", ".", "lower", "(", ")", "base", ",", "py_ver", ",", "plat", "=", "None", ",", "None", ",", "None", "if", "lower", ".", "endswith", "(", "'.exe'", ")", ":", "if", "lower", "....
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/package_index.py#L63-L84
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/apps/groups/service.py
python
GroupsService.RetrieveAllGroups
(self)
return self._GetPropertiesList(uri)
Retrieve all groups in the domain. Args: None. Returns: A list containing the result of the retrieve operation.
Retrieve all groups in the domain.
[ "Retrieve", "all", "groups", "in", "the", "domain", "." ]
def RetrieveAllGroups(self): """Retrieve all groups in the domain. Args: None. Returns: A list containing the result of the retrieve operation. """ uri = self._ServiceUrl('group', True, '', '', '', '', '') return self._GetPropertiesList(uri)
[ "def", "RetrieveAllGroups", "(", "self", ")", ":", "uri", "=", "self", ".", "_ServiceUrl", "(", "'group'", ",", "True", ",", "''", ",", "''", ",", "''", ",", "''", ",", "''", ")", "return", "self", ".", "_GetPropertiesList", "(", "uri", ")" ]
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/apps/groups/service.py#L143-L153
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
RendererNative.GetSplitterParams
(*args, **kwargs)
return _gdi_.RendererNative_GetSplitterParams(*args, **kwargs)
GetSplitterParams(self, Window win) -> SplitterRenderParams Get the splitter parameters, see `wx.SplitterRenderParams`.
GetSplitterParams(self, Window win) -> SplitterRenderParams
[ "GetSplitterParams", "(", "self", "Window", "win", ")", "-", ">", "SplitterRenderParams" ]
def GetSplitterParams(*args, **kwargs): """ GetSplitterParams(self, Window win) -> SplitterRenderParams Get the splitter parameters, see `wx.SplitterRenderParams`. """ return _gdi_.RendererNative_GetSplitterParams(*args, **kwargs)
[ "def", "GetSplitterParams", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "RendererNative_GetSplitterParams", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L7405-L7411
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/xcodeproj_file.py
python
XCConfigurationList.ConfigurationNamed
(self, name)
Convenience accessor to obtain an XCBuildConfiguration by name.
Convenience accessor to obtain an XCBuildConfiguration by name.
[ "Convenience", "accessor", "to", "obtain", "an", "XCBuildConfiguration", "by", "name", "." ]
def ConfigurationNamed(self, name): """Convenience accessor to obtain an XCBuildConfiguration by name.""" for configuration in self._properties['buildConfigurations']: if configuration._properties['name'] == name: return configuration raise KeyError(name)
[ "def", "ConfigurationNamed", "(", "self", ",", "name", ")", ":", "for", "configuration", "in", "self", ".", "_properties", "[", "'buildConfigurations'", "]", ":", "if", "configuration", ".", "_properties", "[", "'name'", "]", "==", "name", ":", "return", "co...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/xcodeproj_file.py#L1604-L1610
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/generator/msvs.py
python
_GenerateMSBuildRuleTargetsFile
(targets_path, msbuild_rules)
Generate the .targets file.
Generate the .targets file.
[ "Generate", "the", ".", "targets", "file", "." ]
def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules): """Generate the .targets file.""" content = ['Project', {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003' } ] item_group = [ 'ItemGroup', ['PropertyPageSchema', {'Include': '$(M...
[ "def", "_GenerateMSBuildRuleTargetsFile", "(", "targets_path", ",", "msbuild_rules", ")", ":", "content", "=", "[", "'Project'", ",", "{", "'xmlns'", ":", "'http://schemas.microsoft.com/developer/msbuild/2003'", "}", "]", "item_group", "=", "[", "'ItemGroup'", ",", "[...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/generator/msvs.py#L2317-L2479
alexgkendall/caffe-posenet
62aafbd7c45df91acdba14f5d1406d8295c2bc6f
python/caffe/net_spec.py
python
param_name_dict
()
return dict(zip(param_type_names, param_names))
Find out the correspondence between layer names and parameter names.
Find out the correspondence between layer names and parameter names.
[ "Find", "out", "the", "correspondence", "between", "layer", "names", "and", "parameter", "names", "." ]
def param_name_dict(): """Find out the correspondence between layer names and parameter names.""" layer = caffe_pb2.LayerParameter() # get all parameter names (typically underscore case) and corresponding # type names (typically camel case), which contain the layer names # (note that not all parame...
[ "def", "param_name_dict", "(", ")", ":", "layer", "=", "caffe_pb2", ".", "LayerParameter", "(", ")", "# get all parameter names (typically underscore case) and corresponding", "# type names (typically camel case), which contain the layer names", "# (note that not all parameters correspon...
https://github.com/alexgkendall/caffe-posenet/blob/62aafbd7c45df91acdba14f5d1406d8295c2bc6f/python/caffe/net_spec.py#L28-L40
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
Log_EnableLogging
(*args, **kwargs)
return _misc_.Log_EnableLogging(*args, **kwargs)
Log_EnableLogging(bool enable=True) -> bool
Log_EnableLogging(bool enable=True) -> bool
[ "Log_EnableLogging", "(", "bool", "enable", "=", "True", ")", "-", ">", "bool" ]
def Log_EnableLogging(*args, **kwargs): """Log_EnableLogging(bool enable=True) -> bool""" return _misc_.Log_EnableLogging(*args, **kwargs)
[ "def", "Log_EnableLogging", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Log_EnableLogging", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L1628-L1630
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap_external.py
python
FileFinder.invalidate_caches
(self)
Invalidate the directory mtime.
Invalidate the directory mtime.
[ "Invalidate", "the", "directory", "mtime", "." ]
def invalidate_caches(self): """Invalidate the directory mtime.""" self._path_mtime = -1
[ "def", "invalidate_caches", "(", "self", ")", ":", "self", ".", "_path_mtime", "=", "-", "1" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap_external.py#L1333-L1335
kungfu-origin/kungfu
90c84b2b590855654cb9a6395ed050e0f7763512
core/deps/SQLiteCpp-2.3.0/cpplint.py
python
_GetTextInside
(text, start_pattern)
return text[start_position:position - 1]
r"""Retrieves all the text between matching open and close parentheses. Given a string of lines and a regular expression string, retrieve all the text following the expression and between opening punctuation symbols like (, [, or {, and the matching close-punctuation symbol. This properly nested occurrences of...
r"""Retrieves all the text between matching open and close parentheses.
[ "r", "Retrieves", "all", "the", "text", "between", "matching", "open", "and", "close", "parentheses", "." ]
def _GetTextInside(text, start_pattern): r"""Retrieves all the text between matching open and close parentheses. Given a string of lines and a regular expression string, retrieve all the text following the expression and between opening punctuation symbols like (, [, or {, and the matching close-punctuation sy...
[ "def", "_GetTextInside", "(", "text", ",", "start_pattern", ")", ":", "# TODO(sugawarayu): Audit cpplint.py to see what places could be profitably", "# rewritten to use _GetTextInside (and use inferior regexp matching today).", "# Give opening punctuations to get the matching close-punctuations....
https://github.com/kungfu-origin/kungfu/blob/90c84b2b590855654cb9a6395ed050e0f7763512/core/deps/SQLiteCpp-2.3.0/cpplint.py#L3681-L3734
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/physics/ert/ertScheme.py
python
DataSchemeManager.scheme
(self, name)
return DataSchemeBase()
Return DataScheme for a given name if registered. Parameters ---------- name : str | int Name or prefix name of a known data scheme. If the name is unknown all known data schemes are listed. Name can be a integer number that represents the intern...
Return DataScheme for a given name if registered.
[ "Return", "DataScheme", "for", "a", "given", "name", "if", "registered", "." ]
def scheme(self, name): """ Return DataScheme for a given name if registered. Parameters ---------- name : str | int Name or prefix name of a known data scheme. If the name is unknown all known data schemes are listed. Name can be a integ...
[ "def", "scheme", "(", "self", ",", "name", ")", ":", "if", "type", "(", "name", ")", "==", "int", ":", "s", "=", "self", ".", "schemeFromTyp", "(", "name", ")", "if", "s", ":", "return", "s", "elif", "type", "(", "name", ")", "==", "str", ":", ...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/ert/ertScheme.py#L177-L218
cksystemsgroup/scal
fa2208a97a77d65f4e90f85fef3404c27c1f2ac2
tools/cpplint.py
python
IsRValueType
(typenames, clean_lines, nesting_state, linenum, column)
return False
Check if the token ending on (linenum, column) is a type. Assumes that text to the right of the column is "&&" or a function name. Args: typenames: set of type names from template-argument-list. clean_lines: A CleansedLines instance containing the file. nesting_state: A NestingState instance which m...
Check if the token ending on (linenum, column) is a type.
[ "Check", "if", "the", "token", "ending", "on", "(", "linenum", "column", ")", "is", "a", "type", "." ]
def IsRValueType(typenames, clean_lines, nesting_state, linenum, column): """Check if the token ending on (linenum, column) is a type. Assumes that text to the right of the column is "&&" or a function name. Args: typenames: set of type names from template-argument-list. clean_lines: A CleansedLines i...
[ "def", "IsRValueType", "(", "typenames", ",", "clean_lines", ",", "nesting_state", ",", "linenum", ",", "column", ")", ":", "prefix", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "[", "0", ":", "column", "]", "# Get one word to the left. If we failed...
https://github.com/cksystemsgroup/scal/blob/fa2208a97a77d65f4e90f85fef3404c27c1f2ac2/tools/cpplint.py#L3431-L3632
Ifsttar/I-Simpa
2283385f4cac769a92e265edabb9c79cb6c42d03
currentRelease/ExperimentalCore/md_octave/kdtree.py
python
KDNode.is_valid
(self)
return all(c.is_valid() for c, _ in self.children) or self.is_leaf
Checks recursively if the tree is valid It is valid if each node splits correctly
Checks recursively if the tree is valid
[ "Checks", "recursively", "if", "the", "tree", "is", "valid" ]
def is_valid(self): """ Checks recursively if the tree is valid It is valid if each node splits correctly """ if not self: return True if self.left and self.data[self.axis] < self.left.data[self.axis]: return False if self.right and self.data[self.axis...
[ "def", "is_valid", "(", "self", ")", ":", "if", "not", "self", ":", "return", "True", "if", "self", ".", "left", "and", "self", ".", "data", "[", "self", ".", "axis", "]", "<", "self", ".", "left", ".", "data", "[", "self", ".", "axis", "]", ":...
https://github.com/Ifsttar/I-Simpa/blob/2283385f4cac769a92e265edabb9c79cb6c42d03/currentRelease/ExperimentalCore/md_octave/kdtree.py#L534-L548
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/pycollapsiblepane.py
python
PyCollapsiblePane.OnDrawGTKText
(self, dc)
Overridable method to draw the :class:`PyCollapsiblePane` text in the expander. :param `dc`: an instance of :class:`DC`.
Overridable method to draw the :class:`PyCollapsiblePane` text in the expander.
[ "Overridable", "method", "to", "draw", "the", ":", "class", ":", "PyCollapsiblePane", "text", "in", "the", "expander", "." ]
def OnDrawGTKText(self, dc): """ Overridable method to draw the :class:`PyCollapsiblePane` text in the expander. :param `dc`: an instance of :class:`DC`. """ self._pButton.OnDrawGTKText(dc)
[ "def", "OnDrawGTKText", "(", "self", ",", "dc", ")", ":", "self", ".", "_pButton", ".", "OnDrawGTKText", "(", "dc", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/pycollapsiblepane.py#L853-L860
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/monitored_session.py
python
_HookedSession.__init__
(self, sess, hooks)
Initializes a _HookedSession object. Args: sess: A `tf.Session` or a `_WrappedSession` object. hooks: An iterable of `SessionRunHook' objects.
Initializes a _HookedSession object.
[ "Initializes", "a", "_HookedSession", "object", "." ]
def __init__(self, sess, hooks): """Initializes a _HookedSession object. Args: sess: A `tf.Session` or a `_WrappedSession` object. hooks: An iterable of `SessionRunHook' objects. """ _WrappedSession.__init__(self, sess) self._hooks = hooks self._should_stop = False
[ "def", "__init__", "(", "self", ",", "sess", ",", "hooks", ")", ":", "_WrappedSession", ".", "__init__", "(", "self", ",", "sess", ")", "self", ".", "_hooks", "=", "hooks", "self", ".", "_should_stop", "=", "False" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/monitored_session.py#L650-L660
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Node/__init__.py
python
Node.children_are_up_to_date
(self)
return (state == 0 or state == SCons.Node.up_to_date)
Alternate check for whether the Node is current: If all of our children were up-to-date, then this Node was up-to-date, too. The SCons.Node.Alias and SCons.Node.Python.Value subclasses rebind their current() method to this method.
Alternate check for whether the Node is current: If all of our children were up-to-date, then this Node was up-to-date, too.
[ "Alternate", "check", "for", "whether", "the", "Node", "is", "current", ":", "If", "all", "of", "our", "children", "were", "up", "-", "to", "-", "date", "then", "this", "Node", "was", "up", "-", "to", "-", "date", "too", "." ]
def children_are_up_to_date(self): """Alternate check for whether the Node is current: If all of our children were up-to-date, then this Node was up-to-date, too. The SCons.Node.Alias and SCons.Node.Python.Value subclasses rebind their current() method to this method.""" # Allo...
[ "def", "children_are_up_to_date", "(", "self", ")", ":", "# Allow the children to calculate their signatures.", "self", ".", "binfo", "=", "self", ".", "get_binfo", "(", ")", "if", "self", ".", "always_build", ":", "return", "None", "state", "=", "0", "for", "ki...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Node/__init__.py#L1516-L1531
quantOS-org/DataCore
e2ef9bd2c22ee9e2845675b6435a14fa607f3551
mdlink/deps/windows/protobuf-2.5.0/python/mox.py
python
MockAnything.__ne__
(self, rhs)
return not self == rhs
Provide custom logic to compare objects.
Provide custom logic to compare objects.
[ "Provide", "custom", "logic", "to", "compare", "objects", "." ]
def __ne__(self, rhs): """Provide custom logic to compare objects.""" return not self == rhs
[ "def", "__ne__", "(", "self", ",", "rhs", ")", ":", "return", "not", "self", "==", "rhs" ]
https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/mox.py#L321-L324
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/android.py
python
AndroidMkWriter.LocalPathify
(self, path)
return local_path
Convert a subdirectory-relative path into a normalized path which starts with the make variable $(LOCAL_PATH) (i.e. the top of the project tree). Absolute paths, or paths that contain variables, are just normalized.
Convert a subdirectory-relative path into a normalized path which starts with the make variable $(LOCAL_PATH) (i.e. the top of the project tree). Absolute paths, or paths that contain variables, are just normalized.
[ "Convert", "a", "subdirectory", "-", "relative", "path", "into", "a", "normalized", "path", "which", "starts", "with", "the", "make", "variable", "$", "(", "LOCAL_PATH", ")", "(", "i", ".", "e", ".", "the", "top", "of", "the", "project", "tree", ")", "...
def LocalPathify(self, path): """Convert a subdirectory-relative path into a normalized path which starts with the make variable $(LOCAL_PATH) (i.e. the top of the project tree). Absolute paths, or paths that contain variables, are just normalized.""" if '$(' in path or os.path.isabs(path): # path...
[ "def", "LocalPathify", "(", "self", ",", "path", ")", ":", "if", "'$('", "in", "path", "or", "os", ".", "path", ".", "isabs", "(", "path", ")", ":", "# path is not a file in the project tree in this case, but calling", "# normpath is still important for trimming trailin...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/android.py#L914-L930
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
external_tools/ply_info/example/ansic/cparse.py
python
p_postfix_expression_4
(t)
postfix_expression : postfix_expression LPAREN RPAREN
postfix_expression : postfix_expression LPAREN RPAREN
[ "postfix_expression", ":", "postfix_expression", "LPAREN", "RPAREN" ]
def p_postfix_expression_4(t): 'postfix_expression : postfix_expression LPAREN RPAREN' pass
[ "def", "p_postfix_expression_4", "(", "t", ")", ":", "pass" ]
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/cparse.py#L805-L807
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/depends.py
python
Require.get_version
(self, paths=None, default="unknown")
return v
Get version number of installed module, 'None', or 'default' Search 'paths' for module. If not found, return 'None'. If found, return the extracted version attribute, or 'default' if no version attribute was specified, or the value cannot be determined without importing the module. T...
Get version number of installed module, 'None', or 'default'
[ "Get", "version", "number", "of", "installed", "module", "None", "or", "default" ]
def get_version(self, paths=None, default="unknown"): """Get version number of installed module, 'None', or 'default' Search 'paths' for module. If not found, return 'None'. If found, return the extracted version attribute, or 'default' if no version attribute was specified, or the va...
[ "def", "get_version", "(", "self", ",", "paths", "=", "None", ",", "default", "=", "\"unknown\"", ")", ":", "if", "self", ".", "attribute", "is", "None", ":", "try", ":", "f", ",", "p", ",", "i", "=", "find_module", "(", "self", ".", "module", ",",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/depends.py#L46-L71
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cookielib.py
python
is_HDN
(text)
return True
Return True if text is a host domain name.
Return True if text is a host domain name.
[ "Return", "True", "if", "text", "is", "a", "host", "domain", "name", "." ]
def is_HDN(text): """Return True if text is a host domain name.""" # XXX # This may well be wrong. Which RFC is HDN defined in, if any (for # the purposes of RFC 2965)? # For the current implementation, what about IPv6? Remember to look # at other uses of IPV4_RE also, if change this. if...
[ "def", "is_HDN", "(", "text", ")", ":", "# XXX", "# This may well be wrong. Which RFC is HDN defined in, if any (for", "# the purposes of RFC 2965)?", "# For the current implementation, what about IPv6? Remember to look", "# at other uses of IPV4_RE also, if change this.", "if", "IPV4_RE...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cookielib.py#L497-L510
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchCurtainWall.py
python
CurtainWall.makePanel
(self,verts,thickness)
return panel
creates a panel from face points and thickness
creates a panel from face points and thickness
[ "creates", "a", "panel", "from", "face", "points", "and", "thickness" ]
def makePanel(self,verts,thickness): """creates a panel from face points and thickness""" import Part panel = Part.Face(Part.makePolygon(verts+[verts[0]])) n = panel.normalAt(0,0) n.multiply(thickness) panel = panel.extrude(n) return panel
[ "def", "makePanel", "(", "self", ",", "verts", ",", "thickness", ")", ":", "import", "Part", "panel", "=", "Part", ".", "Face", "(", "Part", ".", "makePolygon", "(", "verts", "+", "[", "verts", "[", "0", "]", "]", ")", ")", "n", "=", "panel", "."...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchCurtainWall.py#L487-L497
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/conversion.py
python
IConversion.TextToChatMessageStatus
(self, Text)
return self._TextTo('cms', Text)
Returns message status code. @param Text: Text, one of L{Chat message status<enums.cmsUnknown>}. @type Text: unicode @return: Chat message status. @rtype: L{Chat message status<enums.cmsUnknown>} @note: Currently, this method only checks if the given string is one of the allowed...
Returns message status code.
[ "Returns", "message", "status", "code", "." ]
def TextToChatMessageStatus(self, Text): '''Returns message status code. @param Text: Text, one of L{Chat message status<enums.cmsUnknown>}. @type Text: unicode @return: Chat message status. @rtype: L{Chat message status<enums.cmsUnknown>} @note: Currently, this method o...
[ "def", "TextToChatMessageStatus", "(", "self", ",", "Text", ")", ":", "return", "self", ".", "_TextTo", "(", "'cms'", ",", "Text", ")" ]
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/conversion.py#L281-L291
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/p4util/python_helpers.py
python
pcm_helper
(block: str)
Passes multiline string *block* to PCMSolver parser. Parameters ---------- block multiline string with PCM input in PCMSolver syntax.
Passes multiline string *block* to PCMSolver parser.
[ "Passes", "multiline", "string", "*", "block", "*", "to", "PCMSolver", "parser", "." ]
def pcm_helper(block: str): """ Passes multiline string *block* to PCMSolver parser. Parameters ---------- block multiline string with PCM input in PCMSolver syntax. """ import pcmsolver with NamedTemporaryFile(mode="w+t", delete=True) as fl: fl.write(block) fl....
[ "def", "pcm_helper", "(", "block", ":", "str", ")", ":", "import", "pcmsolver", "with", "NamedTemporaryFile", "(", "mode", "=", "\"w+t\"", ",", "delete", "=", "True", ")", "as", "fl", ":", "fl", ".", "write", "(", "block", ")", "fl", ".", "flush", "(...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/p4util/python_helpers.py#L492-L510
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/_shgo.py
python
SHGO.fun_ref
(self)
return self.F
Find the objective function output reference table
Find the objective function output reference table
[ "Find", "the", "objective", "function", "output", "reference", "table" ]
def fun_ref(self): """ Find the objective function output reference table """ # TODO: Replace with cached wrapper # Note: This process can be pooled easily # Obj. function returns to be used as reference table.: f_cache_bool = False if self.fn > 0...
[ "def", "fun_ref", "(", "self", ")", ":", "# TODO: Replace with cached wrapper", "# Note: This process can be pooled easily", "# Obj. function returns to be used as reference table.:", "f_cache_bool", "=", "False", "if", "self", ".", "fn", ">", "0", ":", "# Store old function ev...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_shgo.py#L1407-L1442
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/MooseDocs/common/mixins.py
python
ConfigObject.__contains__
(self, name)
return name in self.__config
Check for config item.
Check for config item.
[ "Check", "for", "config", "item", "." ]
def __contains__(self, name): """ Check for config item. """ return name in self.__config
[ "def", "__contains__", "(", "self", ",", "name", ")", ":", "return", "name", "in", "self", ".", "__config" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/common/mixins.py#L117-L121
mamedev/mame
02cd26d37ee11191f3e311e19e805d872cb1e3a4
3rdparty/bgfx/3rdparty/glslang/build_info.py
python
command_output
(cmd, directory)
return stdout
Runs a command in a directory and returns its standard output stream. Captures the standard error stream. Raises a RuntimeError if the command fails to launch or otherwise fails.
Runs a command in a directory and returns its standard output stream.
[ "Runs", "a", "command", "in", "a", "directory", "and", "returns", "its", "standard", "output", "stream", "." ]
def command_output(cmd, directory): """Runs a command in a directory and returns its standard output stream. Captures the standard error stream. Raises a RuntimeError if the command fails to launch or otherwise fails. """ p = subprocess.Popen(cmd, cwd=directory, ...
[ "def", "command_output", "(", "cmd", ",", "directory", ")", ":", "p", "=", "subprocess", ".", "Popen", "(", "cmd", ",", "cwd", "=", "directory", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess", ".", "PIPE", ")", "(", "...
https://github.com/mamedev/mame/blob/02cd26d37ee11191f3e311e19e805d872cb1e3a4/3rdparty/bgfx/3rdparty/glslang/build_info.py#L69-L83
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
RobotModel.getName
(self)
return _robotsim.RobotModel_getName(self)
r"""
r"""
[ "r" ]
def getName(self) ->str: r""" """ return _robotsim.RobotModel_getName(self)
[ "def", "getName", "(", "self", ")", "->", "str", ":", "return", "_robotsim", ".", "RobotModel_getName", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L4649-L4652
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/futures.py
python
_copy_future_state
(source, dest)
Internal helper to copy state from another Future. The other Future may be a concurrent.futures.Future.
Internal helper to copy state from another Future.
[ "Internal", "helper", "to", "copy", "state", "from", "another", "Future", "." ]
def _copy_future_state(source, dest): """Internal helper to copy state from another Future. The other Future may be a concurrent.futures.Future. """ assert source.done() if dest.cancelled(): return assert not dest.done() if source.cancelled(): dest.cancel() else: ...
[ "def", "_copy_future_state", "(", "source", ",", "dest", ")", ":", "assert", "source", ".", "done", "(", ")", "if", "dest", ".", "cancelled", "(", ")", ":", "return", "assert", "not", "dest", ".", "done", "(", ")", "if", "source", ".", "cancelled", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/futures.py#L309-L326
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/plat-mac/findertools.py
python
sleep
()
Put the mac to sleep
Put the mac to sleep
[ "Put", "the", "mac", "to", "sleep" ]
def sleep(): """Put the mac to sleep""" finder = _getfinder() finder.sleep()
[ "def", "sleep", "(", ")", ":", "finder", "=", "_getfinder", "(", ")", "finder", ".", "sleep", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/findertools.py#L81-L84
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/compiler/mlir/mlir.py
python
convert_graph_def
(graph_def, pass_pipeline='tf-standard-pipeline', show_debug_info=False)
return pywrap_mlir.import_graphdef(graph_def, pass_pipeline, show_debug_info)
Import a GraphDef and convert it to a textual MLIR module. This API is only intended for inspecting the internals of TensorFlow and the string returned is at the moment intended for debugging purposes. Args: graph_def: An object of type graph_pb2.GraphDef or a textual proto representation of a valid G...
Import a GraphDef and convert it to a textual MLIR module.
[ "Import", "a", "GraphDef", "and", "convert", "it", "to", "a", "textual", "MLIR", "module", "." ]
def convert_graph_def(graph_def, pass_pipeline='tf-standard-pipeline', show_debug_info=False): """Import a GraphDef and convert it to a textual MLIR module. This API is only intended for inspecting the internals of TensorFlow and the string returned is at the moment in...
[ "def", "convert_graph_def", "(", "graph_def", ",", "pass_pipeline", "=", "'tf-standard-pipeline'", ",", "show_debug_info", "=", "False", ")", ":", "return", "pywrap_mlir", ".", "import_graphdef", "(", "graph_def", ",", "pass_pipeline", ",", "show_debug_info", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/compiler/mlir/mlir.py#L22-L46
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/applications/workbench/workbench/app/mainwindow.py
python
MainWindow.prep_window_for_reset
(self)
Function to reset all dock widgets to a state where they can be ordered by setup_default_layout
Function to reset all dock widgets to a state where they can be ordered by setup_default_layout
[ "Function", "to", "reset", "all", "dock", "widgets", "to", "a", "state", "where", "they", "can", "be", "ordered", "by", "setup_default_layout" ]
def prep_window_for_reset(self): """Function to reset all dock widgets to a state where they can be ordered by setup_default_layout""" for widget in self.widgets: widget.dockwidget.setFloating(False) # Bring back any floating windows self.addDockWidget(Qt.LeftDockWidgetA...
[ "def", "prep_window_for_reset", "(", "self", ")", ":", "for", "widget", "in", "self", ".", "widgets", ":", "widget", ".", "dockwidget", ".", "setFloating", "(", "False", ")", "# Bring back any floating windows", "self", ".", "addDockWidget", "(", "Qt", ".", "L...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/app/mainwindow.py#L497-L503
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
uCSIsCatSm
(code)
return ret
Check whether the character is part of Sm UCS Category
Check whether the character is part of Sm UCS Category
[ "Check", "whether", "the", "character", "is", "part", "of", "Sm", "UCS", "Category" ]
def uCSIsCatSm(code): """Check whether the character is part of Sm UCS Category """ ret = libxml2mod.xmlUCSIsCatSm(code) return ret
[ "def", "uCSIsCatSm", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsCatSm", "(", "code", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L2394-L2397
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/descriptor_pool.py
python
DescriptorPool._ConvertMessageDescriptor
(self, desc_proto, package=None, file_desc=None, scope=None, syntax=None)
return desc
Adds the proto to the pool in the specified package. Args: desc_proto: The descriptor_pb2.DescriptorProto protobuf message. package: The package the proto should be located in. file_desc: The file containing this message. scope: Dict mapping short and full symbols to message and enum types....
Adds the proto to the pool in the specified package.
[ "Adds", "the", "proto", "to", "the", "pool", "in", "the", "specified", "package", "." ]
def _ConvertMessageDescriptor(self, desc_proto, package=None, file_desc=None, scope=None, syntax=None): """Adds the proto to the pool in the specified package. Args: desc_proto: The descriptor_pb2.DescriptorProto protobuf message. package: The package the proto shoul...
[ "def", "_ConvertMessageDescriptor", "(", "self", ",", "desc_proto", ",", "package", "=", "None", ",", "file_desc", "=", "None", ",", "scope", "=", "None", ",", "syntax", "=", "None", ")", ":", "if", "package", ":", "desc_name", "=", "'.'", ".", "join", ...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/descriptor_pool.py#L828-L920
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/docs/bcdoc/restdoc.py
python
ReSTDocument.writeln
(self, content)
Write content on a newline.
Write content on a newline.
[ "Write", "content", "on", "a", "newline", "." ]
def writeln(self, content): """ Write content on a newline. """ self._write('%s%s\n' % (self.style.spaces(), content))
[ "def", "writeln", "(", "self", ",", "content", ")", ":", "self", ".", "_write", "(", "'%s%s\\n'", "%", "(", "self", ".", "style", ".", "spaces", "(", ")", ",", "content", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/docs/bcdoc/restdoc.py#L45-L49
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/loading/network_cpu_activity_view.py
python
GraphTimelines
(trace)
return figure
Creates a figure of Network and CPU activity for a trace. Args: trace: (LoadingTrace) Returns: A matplotlib.pylab.figure.
Creates a figure of Network and CPU activity for a trace.
[ "Creates", "a", "figure", "of", "Network", "and", "CPU", "activity", "for", "a", "trace", "." ]
def GraphTimelines(trace): """Creates a figure of Network and CPU activity for a trace. Args: trace: (LoadingTrace) Returns: A matplotlib.pylab.figure. """ cpu_lens = activity_lens.ActivityLens(trace) network_lens = network_activity_lens.NetworkActivityLens(trace) matplotlib.rc('font', size=14) ...
[ "def", "GraphTimelines", "(", "trace", ")", ":", "cpu_lens", "=", "activity_lens", ".", "ActivityLens", "(", "trace", ")", "network_lens", "=", "network_activity_lens", ".", "NetworkActivityLens", "(", "trace", ")", "matplotlib", ".", "rc", "(", "'font'", ",", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/network_cpu_activity_view.py#L30-L61
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/speedmeter.py
python
BufferedWindow.__init__
(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_FULL_REPAINT_ON_RESIZE, bufferedstyle=SM_BUFFERED_DC)
Default class constructor. :param `parent`: parent window. Must not be ``None``; :param `id`: window identifier. A value of -1 indicates a default value; :param `pos`: the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPyt...
Default class constructor.
[ "Default", "class", "constructor", "." ]
def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_FULL_REPAINT_ON_RESIZE, bufferedstyle=SM_BUFFERED_DC): """ Default class constructor. :param `parent`: parent window. Must not be ``None``; :param `id`: window identifier. ...
[ "def", "__init__", "(", "self", ",", "parent", ",", "id", "=", "wx", ".", "ID_ANY", ",", "pos", "=", "wx", ".", "DefaultPosition", ",", "size", "=", "wx", ".", "DefaultSize", ",", "style", "=", "wx", ".", "NO_FULL_REPAINT_ON_RESIZE", ",", "bufferedstyle"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/speedmeter.py#L304-L329
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/eager/function.py
python
_forward_name
(n)
return "%s%s_%s" % (_FORWARD_PREFIX, n, ops.uid())
The name of a generated forward defun named n.
The name of a generated forward defun named n.
[ "The", "name", "of", "a", "generated", "forward", "defun", "named", "n", "." ]
def _forward_name(n): """The name of a generated forward defun named n.""" return "%s%s_%s" % (_FORWARD_PREFIX, n, ops.uid())
[ "def", "_forward_name", "(", "n", ")", ":", "return", "\"%s%s_%s\"", "%", "(", "_FORWARD_PREFIX", ",", "n", ",", "ops", ".", "uid", "(", ")", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/function.py#L289-L291
GoSSIP-SJTU/TripleDoggy
03648d6b19c812504b14e8b98c8c7b3f443f4e54
tools/clang/tools/scan-build-py/libscanbuild/arguments.py
python
validate_args_for_analyze
(parser, args, from_build_command)
Command line parsing is done by the argparse module, but semantic validation still needs to be done. This method is doing it for analyze-build and scan-build commands. :param parser: The command line parser object. :param args: Parsed argument object. :param from_build_command: Boolean value tells ...
Command line parsing is done by the argparse module, but semantic validation still needs to be done. This method is doing it for analyze-build and scan-build commands.
[ "Command", "line", "parsing", "is", "done", "by", "the", "argparse", "module", "but", "semantic", "validation", "still", "needs", "to", "be", "done", ".", "This", "method", "is", "doing", "it", "for", "analyze", "-", "build", "and", "scan", "-", "build", ...
def validate_args_for_analyze(parser, args, from_build_command): """ Command line parsing is done by the argparse module, but semantic validation still needs to be done. This method is doing it for analyze-build and scan-build commands. :param parser: The command line parser object. :param args: Pa...
[ "def", "validate_args_for_analyze", "(", "parser", ",", "args", ",", "from_build_command", ")", ":", "if", "args", ".", "help_checkers_verbose", ":", "print_checkers", "(", "get_checkers", "(", "args", ".", "clang", ",", "args", ".", "plugins", ")", ")", "pars...
https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/tools/clang/tools/scan-build-py/libscanbuild/arguments.py#L107-L140
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py
python
FlagValues.RemoveFlagValues
(self, flag_values)
Remove flags that were previously appended from another FlagValues. Args: flag_values: registry containing flags to remove.
Remove flags that were previously appended from another FlagValues.
[ "Remove", "flags", "that", "were", "previously", "appended", "from", "another", "FlagValues", "." ]
def RemoveFlagValues(self, flag_values): """Remove flags that were previously appended from another FlagValues. Args: flag_values: registry containing flags to remove. """ for flag_name in flag_values.FlagDict(): self.__delattr__(flag_name)
[ "def", "RemoveFlagValues", "(", "self", ",", "flag_values", ")", ":", "for", "flag_name", "in", "flag_values", ".", "FlagDict", "(", ")", ":", "self", ".", "__delattr__", "(", "flag_name", ")" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L1011-L1018
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/absorption.py
python
invert_matrix
(matrix)
return inv_matrix
invert a matrix :param matrix: :return:
invert a matrix
[ "invert", "a", "matrix" ]
def invert_matrix(matrix): """invert a matrix :param matrix: :return: """ # check assert isinstance(matrix, numpy.ndarray), 'Input must be a numpy array but not %s.' % type(matrix) assert matrix.shape == (3, 3) # invert matrix inv_matrix = numpy.linalg.inv(matrix) # test a...
[ "def", "invert_matrix", "(", "matrix", ")", ":", "# check", "assert", "isinstance", "(", "matrix", ",", "numpy", ".", "ndarray", ")", ",", "'Input must be a numpy array but not %s.'", "%", "type", "(", "matrix", ")", "assert", "matrix", ".", "shape", "==", "("...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/absorption.py#L202-L218
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py
python
MaskedArray.tostring
(self, fill_value=None, order='C')
return self.filled(fill_value).tostring(order=order)
Return the array data as a string containing the raw bytes in the array. The array is filled with a fill value before the string conversion. Parameters ---------- fill_value : scalar, optional Value used to fill in the masked values. Deafult is None, in which ca...
Return the array data as a string containing the raw bytes in the array.
[ "Return", "the", "array", "data", "as", "a", "string", "containing", "the", "raw", "bytes", "in", "the", "array", "." ]
def tostring(self, fill_value=None, order='C'): """ Return the array data as a string containing the raw bytes in the array. The array is filled with a fill value before the string conversion. Parameters ---------- fill_value : scalar, optional Value used to...
[ "def", "tostring", "(", "self", ",", "fill_value", "=", "None", ",", "order", "=", "'C'", ")", ":", "return", "self", ".", "filled", "(", "fill_value", ")", ".", "tostring", "(", "order", "=", "order", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L5388-L5424
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBWatchpoint.GetWatchpointFromEvent
(event)
return _lldb.SBWatchpoint_GetWatchpointFromEvent(event)
GetWatchpointFromEvent(SBEvent event) -> SBWatchpoint
GetWatchpointFromEvent(SBEvent event) -> SBWatchpoint
[ "GetWatchpointFromEvent", "(", "SBEvent", "event", ")", "-", ">", "SBWatchpoint" ]
def GetWatchpointFromEvent(event): """GetWatchpointFromEvent(SBEvent event) -> SBWatchpoint""" return _lldb.SBWatchpoint_GetWatchpointFromEvent(event)
[ "def", "GetWatchpointFromEvent", "(", "event", ")", ":", "return", "_lldb", ".", "SBWatchpoint_GetWatchpointFromEvent", "(", "event", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L15263-L15265
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_data.py
python
device_name_to_device_path
(device_name)
return METADATA_FILE_PREFIX + DEVICE_TAG + ",".join(device_name_items)
Convert device name to device path.
Convert device name to device path.
[ "Convert", "device", "name", "to", "device", "path", "." ]
def device_name_to_device_path(device_name): """Convert device name to device path.""" device_name_items = compat.as_text(device_name).split("/") device_name_items = [item.replace(":", "_") for item in device_name_items] return METADATA_FILE_PREFIX + DEVICE_TAG + ",".join(device_name_items)
[ "def", "device_name_to_device_path", "(", "device_name", ")", ":", "device_name_items", "=", "compat", ".", "as_text", "(", "device_name", ")", ".", "split", "(", "\"/\"", ")", "device_name_items", "=", "[", "item", ".", "replace", "(", "\":\"", ",", "\"_\"", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_data.py#L250-L254
google/mysql-protobuf
467cda676afaa49e762c5c9164a43f6ad31a1fbf
protobuf/python/google/protobuf/descriptor.py
python
FieldDescriptor.__init__
(self, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options=None, has_default_value=True, containing_oneof=None)
The arguments are as described in the description of FieldDescriptor attributes above. Note that containing_type may be None, and may be set later if necessary (to deal with circular references between message types, for example). Likewise for extension_scope.
The arguments are as described in the description of FieldDescriptor attributes above.
[ "The", "arguments", "are", "as", "described", "in", "the", "description", "of", "FieldDescriptor", "attributes", "above", "." ]
def __init__(self, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options=None, has_default_value=True, containing_oneof=None): """The arguments are as described in the descri...
[ "def", "__init__", "(", "self", ",", "name", ",", "full_name", ",", "index", ",", "number", ",", "type", ",", "cpp_type", ",", "label", ",", "default_value", ",", "message_type", ",", "enum_type", ",", "containing_type", ",", "is_extension", ",", "extension_...
https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/google/protobuf/descriptor.py#L499-L532
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
clang/docs/tools/dump_ast_matchers.py
python
esc
(text)
return text
Escape any html in the given text.
Escape any html in the given text.
[ "Escape", "any", "html", "in", "the", "given", "text", "." ]
def esc(text): """Escape any html in the given text.""" text = re.sub(r'&', '&amp;', text) text = re.sub(r'<', '&lt;', text) text = re.sub(r'>', '&gt;', text) def link_if_exists(m): """Wrap a likely AST node name in a link to its clang docs. We want to do this only if the page exists, in which cas...
[ "def", "esc", "(", "text", ")", ":", "text", "=", "re", ".", "sub", "(", "r'&'", ",", "'&amp;'", ",", "text", ")", "text", "=", "re", ".", "sub", "(", "r'<'", ",", "'&lt;'", ",", "text", ")", "text", "=", "re", ".", "sub", "(", "r'>'", ",", ...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/docs/tools/dump_ast_matchers.py#L43-L67
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/traitlets/py3/traitlets/traitlets.py
python
Container.item_from_string
(self, s, index=None)
Cast a single item from a string Evaluated when parsing CLI configuration from a string
Cast a single item from a string
[ "Cast", "a", "single", "item", "from", "a", "string" ]
def item_from_string(self, s, index=None): """Cast a single item from a string Evaluated when parsing CLI configuration from a string """ if self._trait: return self._trait.from_string(s) else: return s
[ "def", "item_from_string", "(", "self", ",", "s", ",", "index", "=", "None", ")", ":", "if", "self", ".", "_trait", ":", "return", "self", ".", "_trait", ".", "from_string", "(", "s", ")", "else", ":", "return", "s" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py3/traitlets/traitlets.py#L2580-L2588
leanprover/lean
72a965986fa5aeae54062e98efb3140b2c4e79fd
src/cmake/Modules/cpplint.py
python
_SetVerboseLevel
(level)
return _cpplint_state.SetVerboseLevel(level)
Sets the module's verbosity, and returns the previous setting.
Sets the module's verbosity, and returns the previous setting.
[ "Sets", "the", "module", "s", "verbosity", "and", "returns", "the", "previous", "setting", "." ]
def _SetVerboseLevel(level): """Sets the module's verbosity, and returns the previous setting.""" return _cpplint_state.SetVerboseLevel(level)
[ "def", "_SetVerboseLevel", "(", "level", ")", ":", "return", "_cpplint_state", ".", "SetVerboseLevel", "(", "level", ")" ]
https://github.com/leanprover/lean/blob/72a965986fa5aeae54062e98efb3140b2c4e79fd/src/cmake/Modules/cpplint.py#L716-L718
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TStr.GetMemUsed
(self)
return _snap.TStr_GetMemUsed(self)
GetMemUsed(TStr self) -> int Parameters: self: TStr const *
GetMemUsed(TStr self) -> int
[ "GetMemUsed", "(", "TStr", "self", ")", "-", ">", "int" ]
def GetMemUsed(self): """ GetMemUsed(TStr self) -> int Parameters: self: TStr const * """ return _snap.TStr_GetMemUsed(self)
[ "def", "GetMemUsed", "(", "self", ")", ":", "return", "_snap", ".", "TStr_GetMemUsed", "(", "self", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L9621-L9629
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/framework/ops.py
python
device
(device_name_or_function)
Wrapper for `Graph.device()` using the default graph. See @{tf.Graph.device} for more details. Args: device_name_or_function: The device name or function to use in the context. Returns: A context manager that specifies the default device to use for newly created ops.
Wrapper for `Graph.device()` using the default graph.
[ "Wrapper", "for", "Graph", ".", "device", "()", "using", "the", "default", "graph", "." ]
def device(device_name_or_function): """Wrapper for `Graph.device()` using the default graph. See @{tf.Graph.device} for more details. Args: device_name_or_function: The device name or function to use in the context. Returns: A context manager that specifies the default device to use for ne...
[ "def", "device", "(", "device_name_or_function", ")", ":", "if", "context", ".", "in_graph_mode", "(", ")", ":", "return", "get_default_graph", "(", ")", ".", "device", "(", "device_name_or_function", ")", "else", ":", "# TODO(agarwal): support device functions in EAG...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/ops.py#L4291-L4310
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/interpolate/_bsplines.py
python
BSpline._ensure_c_contiguous
(self)
c and t may be modified by the user. The Cython code expects that they are C contiguous.
c and t may be modified by the user. The Cython code expects that they are C contiguous.
[ "c", "and", "t", "may", "be", "modified", "by", "the", "user", ".", "The", "Cython", "code", "expects", "that", "they", "are", "C", "contiguous", "." ]
def _ensure_c_contiguous(self): """ c and t may be modified by the user. The Cython code expects that they are C contiguous. """ if not self.t.flags.c_contiguous: self.t = self.t.copy() if not self.c.flags.c_contiguous: self.c = self.c.copy()
[ "def", "_ensure_c_contiguous", "(", "self", ")", ":", "if", "not", "self", ".", "t", ".", "flags", ".", "c_contiguous", ":", "self", ".", "t", "=", "self", ".", "t", ".", "copy", "(", ")", "if", "not", "self", ".", "c", ".", "flags", ".", "c_cont...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/interpolate/_bsplines.py#L361-L370
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/logging/config.py
python
fileConfig
(fname, defaults=None, disable_existing_loggers=True)
Read the logging configuration from a ConfigParser-format file. This can be called several times from an application, allowing an end user the ability to select from various pre-canned configurations (if the developer provides a mechanism to present the choices and load the chosen configuration).
Read the logging configuration from a ConfigParser-format file.
[ "Read", "the", "logging", "configuration", "from", "a", "ConfigParser", "-", "format", "file", "." ]
def fileConfig(fname, defaults=None, disable_existing_loggers=True): """ Read the logging configuration from a ConfigParser-format file. This can be called several times from an application, allowing an end user the ability to select from various pre-canned configurations (if the developer provides...
[ "def", "fileConfig", "(", "fname", ",", "defaults", "=", "None", ",", "disable_existing_loggers", "=", "True", ")", ":", "import", "ConfigParser", "cp", "=", "ConfigParser", ".", "ConfigParser", "(", "defaults", ")", "if", "hasattr", "(", "fname", ",", "'rea...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/logging/config.py#L53-L81
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib.py
python
URLopener.open_file
(self, url)
Use local file or FTP depending on form of URL.
Use local file or FTP depending on form of URL.
[ "Use", "local", "file", "or", "FTP", "depending", "on", "form", "of", "URL", "." ]
def open_file(self, url): """Use local file or FTP depending on form of URL.""" if not isinstance(url, str): raise IOError, ('file error', 'proxy support for file protocol currently not implemented') if url[:2] == '//' and url[2:3] != '/' and url[2:12].lower() != 'localhost/': ...
[ "def", "open_file", "(", "self", ",", "url", ")", ":", "if", "not", "isinstance", "(", "url", ",", "str", ")", ":", "raise", "IOError", ",", "(", "'file error'", ",", "'proxy support for file protocol currently not implemented'", ")", "if", "url", "[", ":", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib.py#L456-L463
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py
python
mbox.__init__
(self, path, factory=None, create=True)
Initialize an mbox mailbox.
Initialize an mbox mailbox.
[ "Initialize", "an", "mbox", "mailbox", "." ]
def __init__(self, path, factory=None, create=True): """Initialize an mbox mailbox.""" self._message_factory = mboxMessage _mboxMMDF.__init__(self, path, factory, create)
[ "def", "__init__", "(", "self", ",", "path", ",", "factory", "=", "None", ",", "create", "=", "True", ")", ":", "self", ".", "_message_factory", "=", "mboxMessage", "_mboxMMDF", ".", "__init__", "(", "self", ",", "path", ",", "factory", ",", "create", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L819-L822
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/exports.py
python
Export2Html.tree_links_text_iter
(self, tree_iter)
Creating the Tree Links Text - iter
Creating the Tree Links Text - iter
[ "Creating", "the", "Tree", "Links", "Text", "-", "iter" ]
def tree_links_text_iter(self, tree_iter): """Creating the Tree Links Text - iter""" if(not tree_iter): return "" href = self.get_html_filename(tree_iter) node_name = clean_text_to_utf8(self.dad.treestore[tree_iter][1]) child_tree_iter = self.dad.treestore.iter_children(tree_iter...
[ "def", "tree_links_text_iter", "(", "self", ",", "tree_iter", ")", ":", "if", "(", "not", "tree_iter", ")", ":", "return", "\"\"", "href", "=", "self", ".", "get_html_filename", "(", "tree_iter", ")", "node_name", "=", "clean_text_to_utf8", "(", "self", ".",...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/exports.py#L647-L670
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/cy_elements.py
python
CyElements.add_node
(self, obj, label=None, classes=[], short_info='', long_info='', events=[], actions=[], locked=True, cluster=None, shape='ellipse')
Add a node. See class docstring for details.
Add a node. See class docstring for details.
[ "Add", "a", "node", ".", "See", "class", "docstring", "for", "details", "." ]
def add_node(self, obj, label=None, classes=[], short_info='', long_info='', events=[], actions=[], locked=True, cluster=None, shape='ellipse'): """ Add a node. See class docstring for details. """ assert self.elements is not None, "This object us not reusable" i...
[ "def", "add_node", "(", "self", ",", "obj", ",", "label", "=", "None", ",", "classes", "=", "[", "]", ",", "short_info", "=", "''", ",", "long_info", "=", "''", ",", "events", "=", "[", "]", ",", "actions", "=", "[", "]", ",", "locked", "=", "T...
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/cy_elements.py#L47-L75
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2_PolicyCommandCode_REQUEST.fromTpm
(buf)
return buf.createObj(TPM2_PolicyCommandCode_REQUEST)
Returns new TPM2_PolicyCommandCode_REQUEST object constructed from its marshaled representation in the given TpmBuffer buffer
Returns new TPM2_PolicyCommandCode_REQUEST object constructed from its marshaled representation in the given TpmBuffer buffer
[ "Returns", "new", "TPM2_PolicyCommandCode_REQUEST", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "TpmBuffer", "buffer" ]
def fromTpm(buf): """ Returns new TPM2_PolicyCommandCode_REQUEST object constructed from its marshaled representation in the given TpmBuffer buffer """ return buf.createObj(TPM2_PolicyCommandCode_REQUEST)
[ "def", "fromTpm", "(", "buf", ")", ":", "return", "buf", ".", "createObj", "(", "TPM2_PolicyCommandCode_REQUEST", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L14710-L14714
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/turtle.py
python
TNavigator.right
(self, angle)
Turn turtle right by angle units. Aliases: right | rt Argument: angle -- a number (integer or float) Turn turtle right by angle units. (Units are by default degrees, but can be set via the degrees() and radians() functions.) Angle orientation depends on mode. (See this...
Turn turtle right by angle units.
[ "Turn", "turtle", "right", "by", "angle", "units", "." ]
def right(self, angle): """Turn turtle right by angle units. Aliases: right | rt Argument: angle -- a number (integer or float) Turn turtle right by angle units. (Units are by default degrees, but can be set via the degrees() and radians() functions.) Angle ori...
[ "def", "right", "(", "self", ",", "angle", ")", ":", "self", ".", "_rotate", "(", "-", "angle", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/turtle.py#L1659-L1678
ucbrise/confluo
578883a4f7fbbb4aea78c342d366f5122ef598f7
pyclient/confluo/rpc/rpc_service.py
python
Client.alerts_by_trigger_and_time
(self, mid, trigger_id, beg_ms, end_ms)
return self.recv_alerts_by_trigger_and_time()
Parameters: - mid - trigger_id - beg_ms - end_ms
Parameters: - mid - trigger_id - beg_ms - end_ms
[ "Parameters", ":", "-", "mid", "-", "trigger_id", "-", "beg_ms", "-", "end_ms" ]
def alerts_by_trigger_and_time(self, mid, trigger_id, beg_ms, end_ms): """ Parameters: - mid - trigger_id - beg_ms - end_ms """ self.send_alerts_by_trigger_and_time(mid, trigger_id, beg_ms, end_ms) return self.recv_alerts_by_trigger_and_time()
[ "def", "alerts_by_trigger_and_time", "(", "self", ",", "mid", ",", "trigger_id", ",", "beg_ms", ",", "end_ms", ")", ":", "self", ".", "send_alerts_by_trigger_and_time", "(", "mid", ",", "trigger_id", ",", "beg_ms", ",", "end_ms", ")", "return", "self", ".", ...
https://github.com/ucbrise/confluo/blob/578883a4f7fbbb4aea78c342d366f5122ef598f7/pyclient/confluo/rpc/rpc_service.py#L1131-L1141
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
llvm/bindings/python/llvm/disassembler.py
python
Disassembler.__init__
(self, triple)
Create a new disassembler instance. The triple argument is the triple to create the disassembler for. This is something like 'i386-apple-darwin9'.
Create a new disassembler instance.
[ "Create", "a", "new", "disassembler", "instance", "." ]
def __init__(self, triple): """Create a new disassembler instance. The triple argument is the triple to create the disassembler for. This is something like 'i386-apple-darwin9'. """ _ensure_initialized() ptr = lib.LLVMCreateDisasm(c_char_p(triple), c_void_p(None), c_in...
[ "def", "__init__", "(", "self", ",", "triple", ")", ":", "_ensure_initialized", "(", ")", "ptr", "=", "lib", ".", "LLVMCreateDisasm", "(", "c_char_p", "(", "triple", ")", ",", "c_void_p", "(", "None", ")", ",", "c_int", "(", "0", ")", ",", "callbacks",...
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/llvm/bindings/python/llvm/disassembler.py#L66-L81
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/data/experimental/ops/grouping.py
python
group_by_window
(key_func, reduce_func, window_size=None, window_size_func=None)
return _apply_fn
A transformation that groups windows of elements by key and reduces them. This transformation maps each consecutive element in a dataset to a key using `key_func` and groups the elements by key. It then applies `reduce_func` to at most `window_size_func(key)` elements matching the same key. All except the fina...
A transformation that groups windows of elements by key and reduces them.
[ "A", "transformation", "that", "groups", "windows", "of", "elements", "by", "key", "and", "reduces", "them", "." ]
def group_by_window(key_func, reduce_func, window_size=None, window_size_func=None): """A transformation that groups windows of elements by key and reduces them. This transformation maps each consecutive element in a dataset to a key using `key_func` an...
[ "def", "group_by_window", "(", "key_func", ",", "reduce_func", ",", "window_size", "=", "None", ",", "window_size_func", "=", "None", ")", ":", "def", "_apply_fn", "(", "dataset", ")", ":", "\"\"\"Function from `Dataset` to `Dataset` that applies the transformation.\"\"\"...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/data/experimental/ops/grouping.py#L60-L107
RegrowthStudios/SoACode-Public
c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe
utils/git-hooks/pep8.py
python
StandardReport.get_file_results
(self)
return self.file_errors
Print the result and return the overall count for this file.
Print the result and return the overall count for this file.
[ "Print", "the", "result", "and", "return", "the", "overall", "count", "for", "this", "file", "." ]
def get_file_results(self): """Print the result and return the overall count for this file.""" self._deferred_print.sort() for line_number, offset, code, text, doc in self._deferred_print: print(self._fmt % { 'path': self.filename, 'row': self.line_off...
[ "def", "get_file_results", "(", "self", ")", ":", "self", ".", "_deferred_print", ".", "sort", "(", ")", "for", "line_number", ",", "offset", ",", "code", ",", "text", ",", "doc", "in", "self", ".", "_deferred_print", ":", "print", "(", "self", ".", "_...
https://github.com/RegrowthStudios/SoACode-Public/blob/c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe/utils/git-hooks/pep8.py#L1532-L1550
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Tools/fc_config.py
python
_parse_flink_line
(line, final_flags)
return final_flags
private
private
[ "private" ]
def _parse_flink_line(line, final_flags): """private""" lexer = shlex.shlex(line, posix = True) lexer.whitespace_split = True t = lexer.get_token() tmp_flags = [] while t: def parse(token): # Here we go (convention for wildcard is shell, not regex !) # 1 TODO: we first get some root .a libraries # ...
[ "def", "_parse_flink_line", "(", "line", ",", "final_flags", ")", ":", "lexer", "=", "shlex", ".", "shlex", "(", "line", ",", "posix", "=", "True", ")", "lexer", ".", "whitespace_split", "=", "True", "t", "=", "lexer", ".", "get_token", "(", ")", "tmp_...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/fc_config.py#L253-L302
google/swiftshader
8ccc63f045d5975fb67f9dfd3d2b8235b0526990
third_party/SPIRV-Tools/utils/generate_grammar_tables.py
python
generate_instruction_table
(inst_table)
return '{}\n\n{}\n\n{}'.format(caps_arrays, exts_arrays, '\n'.join(insts))
Returns the info table containing all SPIR-V instructions, sorted by opcode, and prefixed by capability arrays. Note: - the built-in sorted() function is guaranteed to be stable. https://docs.python.org/3/library/functions.html#sorted Arguments: - inst_table: a list containing all SPIR...
Returns the info table containing all SPIR-V instructions, sorted by opcode, and prefixed by capability arrays.
[ "Returns", "the", "info", "table", "containing", "all", "SPIR", "-", "V", "instructions", "sorted", "by", "opcode", "and", "prefixed", "by", "capability", "arrays", "." ]
def generate_instruction_table(inst_table): """Returns the info table containing all SPIR-V instructions, sorted by opcode, and prefixed by capability arrays. Note: - the built-in sorted() function is guaranteed to be stable. https://docs.python.org/3/library/functions.html#sorted Argume...
[ "def", "generate_instruction_table", "(", "inst_table", ")", ":", "inst_table", "=", "sorted", "(", "inst_table", ",", "key", "=", "lambda", "k", ":", "(", "k", "[", "'opcode'", "]", ",", "k", "[", "'opname'", "]", ")", ")", "caps_arrays", "=", "generate...
https://github.com/google/swiftshader/blob/8ccc63f045d5975fb67f9dfd3d2b8235b0526990/third_party/SPIRV-Tools/utils/generate_grammar_tables.py#L338-L360
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py
python
WorldWideWeb_suite_Events.register_protocol
(self, _object=None, _attributes={}, **_arguments)
register protocol: Registers application as a \xd2handler\xd3 for this protocol with a given prefix. The handler will receive \xd2OpenURL\xd3, or if that fails, \xd2GetURL\xd3 event. Required argument: Application sig Keyword argument for_protocol: protocol prefix: \xd2finger:\xd3, \xd2file\xd3, ...
register protocol: Registers application as a \xd2handler\xd3 for this protocol with a given prefix. The handler will receive \xd2OpenURL\xd3, or if that fails, \xd2GetURL\xd3 event. Required argument: Application sig Keyword argument for_protocol: protocol prefix: \xd2finger:\xd3, \xd2file\xd3, ...
[ "register", "protocol", ":", "Registers", "application", "as", "a", "\\", "xd2handler", "\\", "xd3", "for", "this", "protocol", "with", "a", "given", "prefix", ".", "The", "handler", "will", "receive", "\\", "xd2OpenURL", "\\", "xd3", "or", "if", "that", "...
def register_protocol(self, _object=None, _attributes={}, **_arguments): """register protocol: Registers application as a \xd2handler\xd3 for this protocol with a given prefix. The handler will receive \xd2OpenURL\xd3, or if that fails, \xd2GetURL\xd3 event. Required argument: Application sig Ke...
[ "def", "register_protocol", "(", "self", ",", "_object", "=", "None", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'WWW!'", "_subcode", "=", "'RGPR'", "aetools", ".", "keysubst", "(", "_arguments", ",", "self",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py#L218-L238
Tom94/practical-path-guiding
fcf01afb436184e8a74bf300aa89f69b03ab25a2
visualizer/nanogui/docs/exhale.py
python
ExhaleRoot.generateNamespaceNodeDocuments
(self)
Generates the reStructuredText document for every namespace, including nested namespaces that were removed from ``self.namespaces`` (but added as children to one of the namespaces in ``self.namespaces``). The documents generated do not use the Breathe namespace directive, but instead li...
Generates the reStructuredText document for every namespace, including nested namespaces that were removed from ``self.namespaces`` (but added as children to one of the namespaces in ``self.namespaces``).
[ "Generates", "the", "reStructuredText", "document", "for", "every", "namespace", "including", "nested", "namespaces", "that", "were", "removed", "from", "self", ".", "namespaces", "(", "but", "added", "as", "children", "to", "one", "of", "the", "namespaces", "in...
def generateNamespaceNodeDocuments(self): ''' Generates the reStructuredText document for every namespace, including nested namespaces that were removed from ``self.namespaces`` (but added as children to one of the namespaces in ``self.namespaces``). The documents generated do n...
[ "def", "generateNamespaceNodeDocuments", "(", "self", ")", ":", "# go through all of the top level namespaces", "for", "n", "in", "self", ".", "namespaces", ":", "# find any nested namespaces", "nested_namespaces", "=", "[", "]", "for", "child", "in", "n", ".", "child...
https://github.com/Tom94/practical-path-guiding/blob/fcf01afb436184e8a74bf300aa89f69b03ab25a2/visualizer/nanogui/docs/exhale.py#L2275-L2294
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/subprocess.py
python
list2cmdline
(seq)
return ''.join(result)
Translate a sequence of arguments into a command line string, using the same rules as the MS C runtime: 1) Arguments are delimited by white space, which is either a space or a tab. 2) A string surrounded by double quotation marks is interpreted as a single argument, regardless of white space...
Translate a sequence of arguments into a command line string, using the same rules as the MS C runtime:
[ "Translate", "a", "sequence", "of", "arguments", "into", "a", "command", "line", "string", "using", "the", "same", "rules", "as", "the", "MS", "C", "runtime", ":" ]
def list2cmdline(seq): """ Translate a sequence of arguments into a command line string, using the same rules as the MS C runtime: 1) Arguments are delimited by white space, which is either a space or a tab. 2) A string surrounded by double quotation marks is interpreted as a single ...
[ "def", "list2cmdline", "(", "seq", ")", ":", "# See", "# http://msdn.microsoft.com/en-us/library/17w5ykft.aspx", "# or search http://msdn.microsoft.com for", "# \"Parsing C++ Command-Line Arguments\"", "result", "=", "[", "]", "needquote", "=", "False", "for", "arg", "in", "s...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/subprocess.py#L516-L583
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/Resources/Python/Override/Lib/multiprocessing/__init__.py
python
cpu_count
()
Returns the number of CPUs in the system
Returns the number of CPUs in the system
[ "Returns", "the", "number", "of", "CPUs", "in", "the", "system" ]
def cpu_count(): ''' Returns the number of CPUs in the system ''' if sys.platform == 'win32': try: num = int(os.environ['NUMBER_OF_PROCESSORS']) except (ValueError, KeyError): num = 0 elif 'bsd' in sys.platform or sys.platform == 'darwin': comm = '/sbi...
[ "def", "cpu_count", "(", ")", ":", "if", "sys", ".", "platform", "==", "'win32'", ":", "try", ":", "num", "=", "int", "(", "os", ".", "environ", "[", "'NUMBER_OF_PROCESSORS'", "]", ")", "except", "(", "ValueError", ",", "KeyError", ")", ":", "num", "...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/Resources/Python/Override/Lib/multiprocessing/__init__.py#L109-L136
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exodus2.in.py
python
exodus.close
(self)
exo.close() -> close the exodus file NOTE: Can only be called once for an exodus object, and once called all methods for that object become inoperable
exo.close()
[ "exo", ".", "close", "()" ]
def close(self): """ exo.close() -> close the exodus file NOTE: Can only be called once for an exodus object, and once called all methods for that object become inoperable """ print("Closing exodus file: " + self.fileName) errorInt = ...
[ "def", "close", "(", "self", ")", ":", "print", "(", "\"Closing exodus file: \"", "+", "self", ".", "fileName", ")", "errorInt", "=", "EXODUS_LIB", ".", "ex_close", "(", "self", ".", "fileId", ")", "if", "errorInt", "!=", "0", ":", "raise", "Exception", ...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus2.in.py#L3496-L3512
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/probability/distribution/geometric.py
python
Geometric._kl_loss
(self, dist, probs1_b, probs1=None)
return self.log(probs1_a / probs1_b) + (probs0_a / probs1_a) * self.log(probs0_a / probs0_b)
r""" Evaluate Geometric-Geometric kl divergence, i.e. KL(a||b). Args: dist (str): The type of the distributions. Should be "Geometric" in this case. probs1_b (Tensor): The probability of success of distribution b. probs1_a (Tensor): The probability of success of dist...
r""" Evaluate Geometric-Geometric kl divergence, i.e. KL(a||b).
[ "r", "Evaluate", "Geometric", "-", "Geometric", "kl", "divergence", "i", ".", "e", ".", "KL", "(", "a||b", ")", "." ]
def _kl_loss(self, dist, probs1_b, probs1=None): r""" Evaluate Geometric-Geometric kl divergence, i.e. KL(a||b). Args: dist (str): The type of the distributions. Should be "Geometric" in this case. probs1_b (Tensor): The probability of success of distribution b. ...
[ "def", "_kl_loss", "(", "self", ",", "dist", ",", "probs1_b", ",", "probs1", "=", "None", ")", ":", "check_distribution_name", "(", "dist", ",", "'Geometric'", ")", "probs1_b", "=", "self", ".", "_check_value", "(", "probs1_b", ",", "'probs1_b'", ")", "pro...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/geometric.py#L301-L319
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/lib/recfunctions.py
python
require_fields
(array, required_dtype)
return out
Casts a structured array to a new dtype using assignment by field-name. This function assigns from the old to the new array by name, so the value of a field in the output array is the value of the field with the same name in the source array. This has the effect of creating a new ndarray containing onl...
Casts a structured array to a new dtype using assignment by field-name.
[ "Casts", "a", "structured", "array", "to", "a", "new", "dtype", "using", "assignment", "by", "field", "-", "name", "." ]
def require_fields(array, required_dtype): """ Casts a structured array to a new dtype using assignment by field-name. This function assigns from the old to the new array by name, so the value of a field in the output array is the value of the field with the same name in the source array. This has ...
[ "def", "require_fields", "(", "array", ",", "required_dtype", ")", ":", "out", "=", "np", ".", "empty", "(", "array", ".", "shape", ",", "dtype", "=", "required_dtype", ")", "assign_fields_by_name", "(", "out", ",", "array", ")", "return", "out" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/recfunctions.py#L1204-L1244