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
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py
python
Context.create_decimal_from_float
(self, f)
return d._fix(self)
Creates a new Decimal instance from a float but rounding using self as the context. >>> context = Context(prec=5, rounding=ROUND_DOWN) >>> context.create_decimal_from_float(3.1415926535897932) Decimal('3.1415') >>> context = Context(prec=5, traps=[Inexact]) >>> context.c...
Creates a new Decimal instance from a float but rounding using self as the context.
[ "Creates", "a", "new", "Decimal", "instance", "from", "a", "float", "but", "rounding", "using", "self", "as", "the", "context", "." ]
def create_decimal_from_float(self, f): """Creates a new Decimal instance from a float but rounding using self as the context. >>> context = Context(prec=5, rounding=ROUND_DOWN) >>> context.create_decimal_from_float(3.1415926535897932) Decimal('3.1415') >>> context = Con...
[ "def", "create_decimal_from_float", "(", "self", ",", "f", ")", ":", "d", "=", "Decimal", ".", "from_float", "(", "f", ")", "# An exact conversion", "return", "d", ".", "_fix", "(", "self", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py#L4111-L4126
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/eclib/finddlg.py
python
FindPanel.ShowOptionsBox
(self, show=True)
Show the find options group box @keyword show: bool
Show the find options group box @keyword show: bool
[ "Show", "the", "find", "options", "group", "box", "@keyword", "show", ":", "bool" ]
def ShowOptionsBox(self, show=True): """Show the find options group box @keyword show: bool """ if 'opt' in self._sizers: self._sizers['opt'].ShowItems(show) self.Layout()
[ "def", "ShowOptionsBox", "(", "self", ",", "show", "=", "True", ")", ":", "if", "'opt'", "in", "self", ".", "_sizers", ":", "self", ".", "_sizers", "[", "'opt'", "]", ".", "ShowItems", "(", "show", ")", "self", ".", "Layout", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/finddlg.py#L1324-L1331
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/array_ops.py
python
_compute_size_of_strided_dim
(shrink, spec, size)
Computes the size of a single strided slice dimension.
Computes the size of a single strided slice dimension.
[ "Computes", "the", "size", "of", "a", "single", "strided", "slice", "dimension", "." ]
def _compute_size_of_strided_dim(shrink, spec, size): """Computes the size of a single strided slice dimension.""" unknown = None # Document what None means here. use_full_range = None # Document other use of None. # if this is a shrink axis (i.e. a non-range index) # it either will produce an error or ret...
[ "def", "_compute_size_of_strided_dim", "(", "shrink", ",", "spec", ",", "size", ")", ":", "unknown", "=", "None", "# Document what None means here.", "use_full_range", "=", "None", "# Document other use of None.", "# if this is a shrink axis (i.e. a non-range index)", "# it eit...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/array_ops.py#L3768-L3805
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/tpu/client/client.py
python
_utcnow
()
return datetime.datetime.utcnow()
A wrapper function around datetime.datetime.utcnow. This function is created for unit testing purpose. It's not easy to do StubOutWithMock with datetime.datetime package. Returns: datetime.datetime
A wrapper function around datetime.datetime.utcnow.
[ "A", "wrapper", "function", "around", "datetime", ".", "datetime", ".", "utcnow", "." ]
def _utcnow(): """A wrapper function around datetime.datetime.utcnow. This function is created for unit testing purpose. It's not easy to do StubOutWithMock with datetime.datetime package. Returns: datetime.datetime """ return datetime.datetime.utcnow()
[ "def", "_utcnow", "(", ")", ":", "return", "datetime", ".", "datetime", ".", "utcnow", "(", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/client/client.py#L53-L62
simon-anders/htseq
5ba0507ea237e2e067ea79fb28febbc56a37f0d4
python2/HTSeq/__init__.py
python
pair_SAM_alignments
( alignments, bundle=False, primary_only=False)
Iterate over SAM aligments, name-sorted paired-end Args: alignments (iterator of SAM/BAM alignments): the alignments to wrap bundle (bool): if True, bundle all alignments from one read pair into a single yield. If False (default), each pair of alignments is yielded separatel...
Iterate over SAM aligments, name-sorted paired-end
[ "Iterate", "over", "SAM", "aligments", "name", "-", "sorted", "paired", "-", "end" ]
def pair_SAM_alignments( alignments, bundle=False, primary_only=False): '''Iterate over SAM aligments, name-sorted paired-end Args: alignments (iterator of SAM/BAM alignments): the alignments to wrap bundle (bool): if True, bundle all alignments from one read pair into a...
[ "def", "pair_SAM_alignments", "(", "alignments", ",", "bundle", "=", "False", ",", "primary_only", "=", "False", ")", ":", "mate_missing_count", "=", "[", "0", "]", "def", "process_list", "(", "almnt_list", ")", ":", "'''Transform a list of alignment with the same r...
https://github.com/simon-anders/htseq/blob/5ba0507ea237e2e067ea79fb28febbc56a37f0d4/python2/HTSeq/__init__.py#L634-L736
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/shutil.py
python
_make_zipfile
(base_name, base_dir, verbose=0, dry_run=0, logger=None)
return zip_filename
Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_name' + ".zip". Returns the name of the output zip file.
Create a zip file from all the files under 'base_dir'.
[ "Create", "a", "zip", "file", "from", "all", "the", "files", "under", "base_dir", "." ]
def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_name' + ".zip". Returns the name of the output zip file. """ import zipfile # late import for breaking circular dependency ...
[ "def", "_make_zipfile", "(", "base_name", ",", "base_dir", ",", "verbose", "=", "0", ",", "dry_run", "=", "0", ",", "logger", "=", "None", ")", ":", "import", "zipfile", "# late import for breaking circular dependency", "zip_filename", "=", "base_name", "+", "\"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/shutil.py#L942-L984
JoseExposito/touchegg
1f3fda214358d071c05da4bf17c070c33d67b5eb
cmake/cpplint.py
python
_FunctionState.Check
(self, error, filename, linenum)
Report if too many lines in function body. Args: error: The function to call with any errors found. filename: The name of the current file. linenum: The number of the line to check.
Report if too many lines in function body.
[ "Report", "if", "too", "many", "lines", "in", "function", "body", "." ]
def Check(self, error, filename, linenum): """Report if too many lines in function body. Args: error: The function to call with any errors found. filename: The name of the current file. linenum: The number of the line to check. """ if not self.in_a_function: return if Match...
[ "def", "Check", "(", "self", ",", "error", ",", "filename", ",", "linenum", ")", ":", "if", "not", "self", ".", "in_a_function", ":", "return", "if", "Match", "(", "r'T(EST|est)'", ",", "self", ".", "current_function", ")", ":", "base_trigger", "=", "sel...
https://github.com/JoseExposito/touchegg/blob/1f3fda214358d071c05da4bf17c070c33d67b5eb/cmake/cpplint.py#L1059-L1085
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/google/protobuf/internal/encoder.py
python
MessageEncoder
(field_number, is_repeated, is_packed)
Returns an encoder for a message field.
Returns an encoder for a message field.
[ "Returns", "an", "encoder", "for", "a", "message", "field", "." ]
def MessageEncoder(field_number, is_repeated, is_packed): """Returns an encoder for a message field.""" tag = TagBytes(field_number, wire_format.WIRETYPE_LENGTH_DELIMITED) local_EncodeVarint = _EncodeVarint assert not is_packed if is_repeated: def EncodeRepeatedField(write, value): for element in v...
[ "def", "MessageEncoder", "(", "field_number", ",", "is_repeated", ",", "is_packed", ")", ":", "tag", "=", "TagBytes", "(", "field_number", ",", "wire_format", ".", "WIRETYPE_LENGTH_DELIMITED", ")", "local_EncodeVarint", "=", "_EncodeVarint", "assert", "not", "is_pac...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/encoder.py#L718-L736
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/mox.py
python
Or.__init__
(self, *args)
Initialize. Args: *args: One or more Mox comparators
Initialize.
[ "Initialize", "." ]
def __init__(self, *args): """Initialize. Args: *args: One or more Mox comparators """ self._comparators = args
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "self", ".", "_comparators", "=", "args" ]
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/mox.py#L1083-L1090
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/session_ops.py
python
_get_handle_mover
(graph, feeder, handle)
return result
Return a move subgraph for this pair of feeder and handle.
Return a move subgraph for this pair of feeder and handle.
[ "Return", "a", "move", "subgraph", "for", "this", "pair", "of", "feeder", "and", "handle", "." ]
def _get_handle_mover(graph, feeder, handle): """Return a move subgraph for this pair of feeder and handle.""" dtype = _get_handle_feeder(graph, feeder) if dtype is None: return None handle_device = TensorHandle._get_device_name(handle) if feeder.op.device == handle_device: return None # Now we know...
[ "def", "_get_handle_mover", "(", "graph", ",", "feeder", ",", "handle", ")", ":", "dtype", "=", "_get_handle_feeder", "(", "graph", ",", "feeder", ")", "if", "dtype", "is", "None", ":", "return", "None", "handle_device", "=", "TensorHandle", ".", "_get_devic...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/session_ops.py#L271-L289
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/examples/image_retraining/retrain.py
python
add_final_training_ops
(class_count, final_tensor_name, bottleneck_tensor)
return (train_step, cross_entropy_mean, bottleneck_input, ground_truth_input, final_tensor)
Adds a new softmax and fully-connected layer for training. We need to retrain the top layer to identify our new classes, so this function adds the right operations to the graph, along with some variables to hold the weights, and then sets up all the gradients for the backward pass. The set up for the softmax ...
Adds a new softmax and fully-connected layer for training.
[ "Adds", "a", "new", "softmax", "and", "fully", "-", "connected", "layer", "for", "training", "." ]
def add_final_training_ops(class_count, final_tensor_name, bottleneck_tensor): """Adds a new softmax and fully-connected layer for training. We need to retrain the top layer to identify our new classes, so this function adds the right operations to the graph, along with some variables to hold the weights, and ...
[ "def", "add_final_training_ops", "(", "class_count", ",", "final_tensor_name", ",", "bottleneck_tensor", ")", ":", "with", "tf", ".", "name_scope", "(", "'input'", ")", ":", "bottleneck_input", "=", "tf", ".", "placeholder_with_default", "(", "bottleneck_tensor", ",...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/examples/image_retraining/retrain.py#L678-L736
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/dataview.py
python
DataViewListCtrl.GetItemData
(*args, **kwargs)
return _dataview.DataViewListCtrl_GetItemData(*args, **kwargs)
GetItemData(self, DataViewItem item) -> UIntPtr
GetItemData(self, DataViewItem item) -> UIntPtr
[ "GetItemData", "(", "self", "DataViewItem", "item", ")", "-", ">", "UIntPtr" ]
def GetItemData(*args, **kwargs): """GetItemData(self, DataViewItem item) -> UIntPtr""" return _dataview.DataViewListCtrl_GetItemData(*args, **kwargs)
[ "def", "GetItemData", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewListCtrl_GetItemData", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L2205-L2207
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/handlers.py
python
ControllerCallbackHandler._update_state_from_shard_states
(self, state, shard_states, control)
Update mr state by examing shard states. Args: state: current mapreduce state as MapreduceState. shard_states: an iterator over shard states. control: model.MapreduceControl entity.
Update mr state by examing shard states.
[ "Update", "mr", "state", "by", "examing", "shard", "states", "." ]
def _update_state_from_shard_states(self, state, shard_states, control): """Update mr state by examing shard states. Args: state: current mapreduce state as MapreduceState. shard_states: an iterator over shard states. control: model.MapreduceControl entity. """ # Initialize vars. ...
[ "def", "_update_state_from_shard_states", "(", "self", ",", "state", ",", "shard_states", ",", "control", ")", ":", "# Initialize vars.", "state", ".", "active_shards", ",", "state", ".", "aborted_shards", ",", "state", ".", "failed_shards", "=", "0", ",", "0", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/handlers.py#L1127-L1210
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/mantid/simpleapi.py
python
_merge_keywords_with_lhs
(keywords, lhs_args)
return final_keywords
Merges the arguments from the two dictionaries specified by the keywords passed to a function and the lhs arguments that have been parsed. Any value in keywords overrides on in lhs_args. :param keywords: A dictionary of keywords that has been passed to the function call :param l...
Merges the arguments from the two dictionaries specified by the keywords passed to a function and the lhs arguments that have been parsed. Any value in keywords overrides on in lhs_args.
[ "Merges", "the", "arguments", "from", "the", "two", "dictionaries", "specified", "by", "the", "keywords", "passed", "to", "a", "function", "and", "the", "lhs", "arguments", "that", "have", "been", "parsed", ".", "Any", "value", "in", "keywords", "overrides", ...
def _merge_keywords_with_lhs(keywords, lhs_args): """ Merges the arguments from the two dictionaries specified by the keywords passed to a function and the lhs arguments that have been parsed. Any value in keywords overrides on in lhs_args. :param keywords: A dictionary of k...
[ "def", "_merge_keywords_with_lhs", "(", "keywords", ",", "lhs_args", ")", ":", "final_keywords", "=", "lhs_args", "final_keywords", ".", "update", "(", "keywords", ")", "return", "final_keywords" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/simpleapi.py#L776-L788
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/structures.py
python
CaseInsensitiveDict.lower_items
(self)
return ( (lowerkey, keyval[1]) for (lowerkey, keyval) in self._store.items() )
Like iteritems(), but with all lowercase keys.
Like iteritems(), but with all lowercase keys.
[ "Like", "iteritems", "()", "but", "with", "all", "lowercase", "keys", "." ]
def lower_items(self): """Like iteritems(), but with all lowercase keys.""" return ( (lowerkey, keyval[1]) for (lowerkey, keyval) in self._store.items() )
[ "def", "lower_items", "(", "self", ")", ":", "return", "(", "(", "lowerkey", ",", "keyval", "[", "1", "]", ")", "for", "(", "lowerkey", ",", "keyval", ")", "in", "self", ".", "_store", ".", "items", "(", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/structures.py#L65-L71
vnpy/vnpy
f50f2535ed39dd33272e0985ed40c7078e4c19f6
vnpy/trader/engine.py
python
OmsEngine.get_account
(self, vt_accountid: str)
return self.accounts.get(vt_accountid, None)
Get latest account data by vt_accountid.
Get latest account data by vt_accountid.
[ "Get", "latest", "account", "data", "by", "vt_accountid", "." ]
def get_account(self, vt_accountid: str) -> Optional[AccountData]: """ Get latest account data by vt_accountid. """ return self.accounts.get(vt_accountid, None)
[ "def", "get_account", "(", "self", ",", "vt_accountid", ":", "str", ")", "->", "Optional", "[", "AccountData", "]", ":", "return", "self", ".", "accounts", ".", "get", "(", "vt_accountid", ",", "None", ")" ]
https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/trader/engine.py#L462-L466
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/image.py
python
Image.show
(self)
Displays the image. Requires PIL/Pillow. Alternatively, you can create an :class:`graphlab.SArray` of this image and use py:func:`graphlab.SArray.show()` See Also -------- graphlab.image_analysis.resize Examples -------- >>> img = graphlab.Image('https...
Displays the image. Requires PIL/Pillow.
[ "Displays", "the", "image", ".", "Requires", "PIL", "/", "Pillow", "." ]
def show(self): """ Displays the image. Requires PIL/Pillow. Alternatively, you can create an :class:`graphlab.SArray` of this image and use py:func:`graphlab.SArray.show()` See Also -------- graphlab.image_analysis.resize Examples -------- ...
[ "def", "show", "(", "self", ")", ":", "from", ".", ".", "visualization", ".", "show", "import", "show", "show", "(", "self", ")" ]
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/image.py#L224-L243
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/google/protobuf/internal/encoder.py
python
_ModifiedEncoder
(wire_type, encode_value, compute_value_size, modify_value)
return SpecificEncoder
Like SimpleEncoder but additionally invokes modify_value on every value before passing it to encode_value. Usually modify_value is ZigZagEncode.
Like SimpleEncoder but additionally invokes modify_value on every value before passing it to encode_value. Usually modify_value is ZigZagEncode.
[ "Like", "SimpleEncoder", "but", "additionally", "invokes", "modify_value", "on", "every", "value", "before", "passing", "it", "to", "encode_value", ".", "Usually", "modify_value", "is", "ZigZagEncode", "." ]
def _ModifiedEncoder(wire_type, encode_value, compute_value_size, modify_value): """Like SimpleEncoder but additionally invokes modify_value on every value before passing it to encode_value. Usually modify_value is ZigZagEncode.""" def SpecificEncoder(field_number, is_repeated, is_packed): if is_packed: ...
[ "def", "_ModifiedEncoder", "(", "wire_type", ",", "encode_value", ",", "compute_value_size", ",", "modify_value", ")", ":", "def", "SpecificEncoder", "(", "field_number", ",", "is_repeated", ",", "is_packed", ")", ":", "if", "is_packed", ":", "tag_bytes", "=", "...
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/internal/encoder.py#L471-L502
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/core/code_generators/genapi.py
python
find_functions
(filename, tag='API')
return functions
Scan the file, looking for tagged functions. Assuming ``tag=='API'``, a tagged function looks like:: /*API*/ static returntype* function_name(argtype1 arg1, argtype2 arg2) { } where the return type must be on a separate line, the function name must start the line, ...
Scan the file, looking for tagged functions.
[ "Scan", "the", "file", "looking", "for", "tagged", "functions", "." ]
def find_functions(filename, tag='API'): """ Scan the file, looking for tagged functions. Assuming ``tag=='API'``, a tagged function looks like:: /*API*/ static returntype* function_name(argtype1 arg1, argtype2 arg2) { } where the return type must be on a separ...
[ "def", "find_functions", "(", "filename", ",", "tag", "=", "'API'", ")", ":", "fo", "=", "open", "(", "filename", ",", "'r'", ")", "functions", "=", "[", "]", "return_type", "=", "None", "function_name", "=", "None", "function_args", "=", "[", "]", "do...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/code_generators/genapi.py#L196-L278
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/grid.py
python
GridEvent.ControlDown
(*args, **kwargs)
return _grid.GridEvent_ControlDown(*args, **kwargs)
ControlDown(self) -> bool
ControlDown(self) -> bool
[ "ControlDown", "(", "self", ")", "-", ">", "bool" ]
def ControlDown(*args, **kwargs): """ControlDown(self) -> bool""" return _grid.GridEvent_ControlDown(*args, **kwargs)
[ "def", "ControlDown", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridEvent_ControlDown", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L2321-L2323
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/solver/solver.py
python
RungeKutta.run
(self, u0, dt, tMax=1)
return self.u
TODO DOCUMENT_ME
TODO DOCUMENT_ME
[ "TODO", "DOCUMENT_ME" ]
def run(self, u0, dt, tMax=1): """TODO DOCUMENT_ME""" self.start(u0, dt, tMax) for _ in range(self.nSteps): self.step() return self.u
[ "def", "run", "(", "self", ",", "u0", ",", "dt", ",", "tMax", "=", "1", ")", ":", "self", ".", "start", "(", "u0", ",", "dt", ",", "tMax", ")", "for", "_", "in", "range", "(", "self", ".", "nSteps", ")", ":", "self", ".", "step", "(", ")", ...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/solver/solver.py#L2700-L2707
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/osx_carbon/gizmos.py
python
TreeListCtrl.GetNextVisible
(*args, **kwargs)
return _gizmos.TreeListCtrl_GetNextVisible(*args, **kwargs)
GetNextVisible(self, TreeItemId item, bool fullRow=False) -> TreeItemId
GetNextVisible(self, TreeItemId item, bool fullRow=False) -> TreeItemId
[ "GetNextVisible", "(", "self", "TreeItemId", "item", "bool", "fullRow", "=", "False", ")", "-", ">", "TreeItemId" ]
def GetNextVisible(*args, **kwargs): """GetNextVisible(self, TreeItemId item, bool fullRow=False) -> TreeItemId""" return _gizmos.TreeListCtrl_GetNextVisible(*args, **kwargs)
[ "def", "GetNextVisible", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_GetNextVisible", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_carbon/gizmos.py#L818-L820
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/pydocview.py
python
DocOptionsService.OnOptions
(self, event)
Shows the options dialog, called when the "Options" menu item is selected.
Shows the options dialog, called when the "Options" menu item is selected.
[ "Shows", "the", "options", "dialog", "called", "when", "the", "Options", "menu", "item", "is", "selected", "." ]
def OnOptions(self, event): """ Shows the options dialog, called when the "Options" menu item is selected. """ if len(self._optionsPanels) == 0: return optionsDialog = OptionsDialog(wx.GetApp().GetTopWindow(), self._optionsPanels, self._docManager) optionsDial...
[ "def", "OnOptions", "(", "self", ",", "event", ")", ":", "if", "len", "(", "self", ".", "_optionsPanels", ")", "==", "0", ":", "return", "optionsDialog", "=", "OptionsDialog", "(", "wx", ".", "GetApp", "(", ")", ".", "GetTopWindow", "(", ")", ",", "s...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pydocview.py#L1463-L1473
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/index/collector.py
python
_clean_link
(url)
return urllib.parse.urlunparse(result._replace(path=path))
Make sure a link is fully quoted. For example, if ' ' occurs in the URL, it will be replaced with "%20", and without double-quoting other characters.
Make sure a link is fully quoted. For example, if ' ' occurs in the URL, it will be replaced with "%20", and without double-quoting other characters.
[ "Make", "sure", "a", "link", "is", "fully", "quoted", ".", "For", "example", "if", "occurs", "in", "the", "URL", "it", "will", "be", "replaced", "with", "%20", "and", "without", "double", "-", "quoting", "other", "characters", "." ]
def _clean_link(url): # type: (str) -> str """ Make sure a link is fully quoted. For example, if ' ' occurs in the URL, it will be replaced with "%20", and without double-quoting other characters. """ # Split the URL into parts according to the general structure # `scheme://netloc/path;p...
[ "def", "_clean_link", "(", "url", ")", ":", "# type: (str) -> str", "# Split the URL into parts according to the general structure", "# `scheme://netloc/path;parameters?query#fragment`.", "result", "=", "urllib", ".", "parse", ".", "urlparse", "(", "url", ")", "# If the netloc ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/index/collector.py#L239-L252
xiaohaoChen/rrc_detection
4f2b110cd122da7f55e8533275a9b4809a88785a
scripts/cpp_lint.py
python
_CppLintState.SetOutputFormat
(self, output_format)
Sets the output format for errors.
Sets the output format for errors.
[ "Sets", "the", "output", "format", "for", "errors", "." ]
def SetOutputFormat(self, output_format): """Sets the output format for errors.""" self.output_format = output_format
[ "def", "SetOutputFormat", "(", "self", ",", "output_format", ")", ":", "self", ".", "output_format", "=", "output_format" ]
https://github.com/xiaohaoChen/rrc_detection/blob/4f2b110cd122da7f55e8533275a9b4809a88785a/scripts/cpp_lint.py#L703-L705
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
IsDragResultOk
(*args, **kwargs)
return _misc_.IsDragResultOk(*args, **kwargs)
IsDragResultOk(int res) -> bool
IsDragResultOk(int res) -> bool
[ "IsDragResultOk", "(", "int", "res", ")", "-", ">", "bool" ]
def IsDragResultOk(*args, **kwargs): """IsDragResultOk(int res) -> bool""" return _misc_.IsDragResultOk(*args, **kwargs)
[ "def", "IsDragResultOk", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "IsDragResultOk", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L5491-L5493
PyMesh/PyMesh
384ba882b7558ba6e8653ed263c419226c22bddf
python/pymesh/meshutils/attribute_utils.py
python
convert_to_vertex_attribute_from_name
(mesh, name)
return PyMesh.convert_to_vertex_attribute_from_name(mesh.raw_mesh, name)
Same as :py:func:`convert_to_vertex_attribute` except looking up attribute values from the input ``mesh`` using ``name``.
Same as :py:func:`convert_to_vertex_attribute` except looking up attribute values from the input ``mesh`` using ``name``.
[ "Same", "as", ":", "py", ":", "func", ":", "convert_to_vertex_attribute", "except", "looking", "up", "attribute", "values", "from", "the", "input", "mesh", "using", "name", "." ]
def convert_to_vertex_attribute_from_name(mesh, name): """ Same as :py:func:`convert_to_vertex_attribute` except looking up attribute values from the input ``mesh`` using ``name``. """ return PyMesh.convert_to_vertex_attribute_from_name(mesh.raw_mesh, name)
[ "def", "convert_to_vertex_attribute_from_name", "(", "mesh", ",", "name", ")", ":", "return", "PyMesh", ".", "convert_to_vertex_attribute_from_name", "(", "mesh", ".", "raw_mesh", ",", "name", ")" ]
https://github.com/PyMesh/PyMesh/blob/384ba882b7558ba6e8653ed263c419226c22bddf/python/pymesh/meshutils/attribute_utils.py#L18-L22
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
uCSIsCatPe
(code)
return ret
Check whether the character is part of Pe UCS Category
Check whether the character is part of Pe UCS Category
[ "Check", "whether", "the", "character", "is", "part", "of", "Pe", "UCS", "Category" ]
def uCSIsCatPe(code): """Check whether the character is part of Pe UCS Category """ ret = libxml2mod.xmlUCSIsCatPe(code) return ret
[ "def", "uCSIsCatPe", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsCatPe", "(", "code", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L2354-L2357
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py
python
TPen.speed
(self, speed=None)
Return or set the turtle's speed. Optional argument: speed -- an integer in the range 0..10 or a speedstring (see below) Set the turtle's speed to an integer value in the range 0 .. 10. If no argument is given: return current speed. If input is a number greater than 10 or smal...
Return or set the turtle's speed.
[ "Return", "or", "set", "the", "turtle", "s", "speed", "." ]
def speed(self, speed=None): """ Return or set the turtle's speed. Optional argument: speed -- an integer in the range 0..10 or a speedstring (see below) Set the turtle's speed to an integer value in the range 0 .. 10. If no argument is given: return current speed. If ...
[ "def", "speed", "(", "self", ",", "speed", "=", "None", ")", ":", "speeds", "=", "{", "'fastest'", ":", "0", ",", "'fast'", ":", "10", ",", "'normal'", ":", "6", ",", "'slow'", ":", "3", ",", "'slowest'", ":", "1", "}", "if", "speed", "is", "No...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py#L2052-L2088
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/internetcontent/nv_python_libs/mtv/mtv_api.py
python
Videos.getVideos
(self, dir_dict, dictionaries)
return dictionaries
Parse a list made of genres/artists ... etc lists and retrieve video meta data return a dictionary of directory names and categories video metadata
Parse a list made of genres/artists ... etc lists and retrieve video meta data return a dictionary of directory names and categories video metadata
[ "Parse", "a", "list", "made", "of", "genres", "/", "artists", "...", "etc", "lists", "and", "retrieve", "video", "meta", "data", "return", "a", "dictionary", "of", "directory", "names", "and", "categories", "video", "metadata" ]
def getVideos(self, dir_dict, dictionaries): '''Parse a list made of genres/artists ... etc lists and retrieve video meta data return a dictionary of directory names and categories video metadata ''' for sets in dir_dict: if not isinstance(sets[1], list): if s...
[ "def", "getVideos", "(", "self", ",", "dir_dict", ",", "dictionaries", ")", ":", "for", "sets", "in", "dir_dict", ":", "if", "not", "isinstance", "(", "sets", "[", "1", "]", ",", "list", ")", ":", "if", "sets", "[", "0", "]", "!=", "''", ":", "# ...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/mtv/mtv_api.py#L622-L653
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/futures.py
python
TransferCoordinator.announce_done
(self)
Announce that future is done running and run associated callbacks This will run any failure cleanups if the transfer failed if not they have not been run, allows the result() to be unblocked, and will run any done callbacks associated to the TransferFuture if they have not already been ...
Announce that future is done running and run associated callbacks
[ "Announce", "that", "future", "is", "done", "running", "and", "run", "associated", "callbacks" ]
def announce_done(self): """Announce that future is done running and run associated callbacks This will run any failure cleanups if the transfer failed if not they have not been run, allows the result() to be unblocked, and will run any done callbacks associated to the TransferFuture if...
[ "def", "announce_done", "(", "self", ")", ":", "if", "self", ".", "status", "!=", "'success'", ":", "self", ".", "_run_failure_cleanups", "(", ")", "self", ".", "_done_event", ".", "set", "(", ")", "self", ".", "_run_done_callbacks", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/futures.py#L359-L370
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/gyp/pylib/gyp/generator/msvs.py
python
_GenerateRulesForMSVS
(p, output_dir, options, spec, sources, excluded_sources, actions_to_add)
Generate all the rules for a particular project. Arguments: p: the project output_dir: directory to emit rules to options: global options passed to the generator spec: the specification for this project sources: the set of all known source files in this project excluded_sources: the set of so...
Generate all the rules for a particular project.
[ "Generate", "all", "the", "rules", "for", "a", "particular", "project", "." ]
def _GenerateRulesForMSVS(p, output_dir, options, spec, sources, excluded_sources, actions_to_add): """Generate all the rules for a particular project. Arguments: p: the project output_dir: directory to emit rules to options: global options passed to ...
[ "def", "_GenerateRulesForMSVS", "(", "p", ",", "output_dir", ",", "options", ",", "spec", ",", "sources", ",", "excluded_sources", ",", "actions_to_add", ")", ":", "rules", "=", "spec", ".", "get", "(", "'rules'", ",", "[", "]", ")", "rules_native", "=", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/generator/msvs.py#L843-L869
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/loading/emulation.py
python
BandwidthToString
(bandwidth)
return '{}Mbit/s'.format(bandwidth_kbps / 1024)
Converts a bandwidth to string. Args: bandwidth: The bandwidth to convert in byte/s. Must be a multiple of 1024/8. Returns: A string compatible with wpr --{up,down} command line flags.
Converts a bandwidth to string.
[ "Converts", "a", "bandwidth", "to", "string", "." ]
def BandwidthToString(bandwidth): """Converts a bandwidth to string. Args: bandwidth: The bandwidth to convert in byte/s. Must be a multiple of 1024/8. Returns: A string compatible with wpr --{up,down} command line flags. """ assert bandwidth % (1024/8) == 0 bandwidth_kbps = (int(bandwidth) * 8) /...
[ "def", "BandwidthToString", "(", "bandwidth", ")", ":", "assert", "bandwidth", "%", "(", "1024", "/", "8", ")", "==", "0", "bandwidth_kbps", "=", "(", "int", "(", "bandwidth", ")", "*", "8", ")", "/", "1024", "if", "bandwidth_kbps", "%", "1024", ":", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/emulation.py#L102-L115
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/phactori.py
python
PhactoriPlaneOpBase.CalculateUpdatedOriginAndNormal
( self, inIncomingPvFilter, outCalculatedOrigin, outCalculatedNormal)
find a point on the plane and a normal to the plane, allowing for need to update location of points due to the point or points on the plane being relative points or data points
find a point on the plane and a normal to the plane, allowing for need to update location of points due to the point or points on the plane being relative points or data points
[ "find", "a", "point", "on", "the", "plane", "and", "a", "normal", "to", "the", "plane", "allowing", "for", "need", "to", "update", "location", "of", "points", "due", "to", "the", "point", "or", "points", "on", "the", "plane", "being", "relative", "points...
def CalculateUpdatedOriginAndNormal( self, inIncomingPvFilter, outCalculatedOrigin, outCalculatedNormal): """find a point on the plane and a normal to the plane, allowing for need to update location of points due to the point or points on the plane being relative points or data points""" ...
[ "def", "CalculateUpdatedOriginAndNormal", "(", "self", ",", "inIncomingPvFilter", ",", "outCalculatedOrigin", ",", "outCalculatedNormal", ")", ":", "if", "PhactoriDbg", "(", ")", ":", "myDebugPrint3", "(", "\"PhactoriPlaneOpBase::CalculateUpdatedOriginAndNormal entered\\n\"", ...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/phactori.py#L7934-L7986
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
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/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/bindings/python/llvm/disassembler.py#L67-L82
google-coral/edgetpu
5020de9386ff370dcc1f63291a2d0f98eeb98adb
edgetpu/basic/basic_engine.py
python
BasicEngine.run_inference
(self, input, size=None)
return (latency, result)
Performs inference with a raw input tensor. Args: input: (:obj:`numpy.ndarray`): A 1-D array as the input tensor. You can query the required size for this array with :func:`required_input_array_size`. size (int): input buffer size. When size is not None, it will throw exception if ...
Performs inference with a raw input tensor.
[ "Performs", "inference", "with", "a", "raw", "input", "tensor", "." ]
def run_inference(self, input, size=None): """Performs inference with a raw input tensor. Args: input: (:obj:`numpy.ndarray`): A 1-D array as the input tensor. You can query the required size for this array with :func:`required_input_array_size`. size (int): input buffer size. When ...
[ "def", "run_inference", "(", "self", ",", "input", ",", "size", "=", "None", ")", ":", "expected_input_size", "=", "self", ".", "required_input_array_size", "(", ")", "if", "size", ":", "assert", "size", "==", "expected_input_size", ",", "'Wrong input size={}, e...
https://github.com/google-coral/edgetpu/blob/5020de9386ff370dcc1f63291a2d0f98eeb98adb/edgetpu/basic/basic_engine.py#L94-L138
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/configprovider.py
python
InstanceVarProvider.__init__
(self, instance_var, session)
Initialize InstanceVarProvider. :type instance_var: str :param instance_var: The instance variable to load from the session. :type session: :class:`botocore.session.Session` :param session: The botocore session to get the loaded configuration file variables from.
Initialize InstanceVarProvider.
[ "Initialize", "InstanceVarProvider", "." ]
def __init__(self, instance_var, session): """Initialize InstanceVarProvider. :type instance_var: str :param instance_var: The instance variable to load from the session. :type session: :class:`botocore.session.Session` :param session: The botocore session to get the loaded con...
[ "def", "__init__", "(", "self", ",", "instance_var", ",", "session", ")", ":", "self", ".", "_instance_var", "=", "instance_var", "self", ".", "_session", "=", "session" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/configprovider.py#L406-L417
etternagame/etterna
8775f74ac9c353320128609d4b4150672e9a6d04
extern/discord-rpc/build.py
python
unreal
(ctx)
build libs and copy them into the unreal project
build libs and copy them into the unreal project
[ "build", "libs", "and", "copy", "them", "into", "the", "unreal", "project" ]
def unreal(ctx): """ build libs and copy them into the unreal project """ ctx.invoke(libs, clean=False, static=False, shared=True, skip_formatter=True, just_release=True) BUILDS = [] click.echo('--- Copying libs and header into unreal example') UNREAL_PROJECT_PATH = os.path.join(SCRIPT_PATH, 'examp...
[ "def", "unreal", "(", "ctx", ")", ":", "ctx", ".", "invoke", "(", "libs", ",", "clean", "=", "False", ",", "static", "=", "False", ",", "shared", "=", "True", ",", "skip_formatter", "=", "True", ",", "just_release", "=", "True", ")", "BUILDS", "=", ...
https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/discord-rpc/build.py#L117-L158
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/style/checkers/cpp.py
python
check_invalid_increment
(clean_lines, line_number, error)
Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1. Args: clean_lines: A CleansedL...
Checks for invalid increment *count++.
[ "Checks", "for", "invalid", "increment", "*", "count", "++", "." ]
def check_invalid_increment(clean_lines, line_number, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count,...
[ "def", "check_invalid_increment", "(", "clean_lines", ",", "line_number", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "line_number", "]", "if", "_RE_PATTERN_INVALID_INCREMENT", ".", "match", "(", "line", ")", ":", "error", "(", "lin...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/style/checkers/cpp.py#L1107-L1125
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings._Setting
(self, path, config, default=None, prefix='', append=None, map=None)
return self._GetAndMunge( self.msvs_settings[config], path, default, prefix, append, map)
_GetAndMunge for msvs_settings.
_GetAndMunge for msvs_settings.
[ "_GetAndMunge", "for", "msvs_settings", "." ]
def _Setting(self, path, config, default=None, prefix='', append=None, map=None): """_GetAndMunge for msvs_settings.""" config = self._RealConfig(config) return self._GetAndMunge( self.msvs_settings[config], path, default, prefix, append, map)
[ "def", "_Setting", "(", "self", ",", "path", ",", "config", ",", "default", "=", "None", ",", "prefix", "=", "''", ",", "append", "=", "None", ",", "map", "=", "None", ")", ":", "config", "=", "self", ".", "_RealConfig", "(", "config", ")", "return...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/msvs_emulation.py#L230-L235
shogun-toolbox/shogun
9b8d856971af5a295dd6ad70623ae45647a6334c
examples/meta/generator/translate.py
python
getDependencies
(program)
return allClasses, interfaceClasses, enums, globalFunctions
Traverses the program AST and extracts all dependencies
Traverses the program AST and extracts all dependencies
[ "Traverses", "the", "program", "AST", "and", "extracts", "all", "dependencies" ]
def getDependencies(program): """ Traverses the program AST and extracts all dependencies """ allClasses = set() interfaceClasses = set() enums = set() globalFunctions = set() # All classes used for objectType in find("ObjectType", program): allClasses.add(objectType) for shogu...
[ "def", "getDependencies", "(", "program", ")", ":", "allClasses", "=", "set", "(", ")", "interfaceClasses", "=", "set", "(", ")", "enums", "=", "set", "(", ")", "globalFunctions", "=", "set", "(", ")", "# All classes used", "for", "objectType", "in", "find...
https://github.com/shogun-toolbox/shogun/blob/9b8d856971af5a295dd6ad70623ae45647a6334c/examples/meta/generator/translate.py#L31-L70
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/tools/scan-build-py/lib/libear/__init__.py
python
Toolset.set_compiler
(self, compiler)
part of public interface
part of public interface
[ "part", "of", "public", "interface" ]
def set_compiler(self, compiler): """ part of public interface """ self.compiler = compiler
[ "def", "set_compiler", "(", "self", ",", "compiler", ")", ":", "self", ".", "compiler", "=", "compiler" ]
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/tools/scan-build-py/lib/libear/__init__.py#L86-L88
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/generator/msvs.py
python
_GetIncludeDirs
(config)
return include_dirs, resource_include_dirs
Returns the list of directories to be used for #include directives. Arguments: config: The dictionnary that defines the special processing to be done for this configuration. Returns: The list of directory paths.
Returns the list of directories to be used for #include directives.
[ "Returns", "the", "list", "of", "directories", "to", "be", "used", "for", "#include", "directives", "." ]
def _GetIncludeDirs(config): """Returns the list of directories to be used for #include directives. Arguments: config: The dictionnary that defines the special processing to be done for this configuration. Returns: The list of directory paths. """ # TODO(bradnelson): include_dirs should r...
[ "def", "_GetIncludeDirs", "(", "config", ")", ":", "# TODO(bradnelson): include_dirs should really be flexible enough not to", "# require this sort of thing.", "include_dirs", "=", "(", "config", ".", "get", "(", "'include_dirs'", ",", "[", "]", ")", "+", ...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/generator/msvs.py#L1089-L1106
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/layers/python/layers/target_column.py
python
binary_svm_target
(label_name=None, weight_column_name=None)
return _BinarySvmTargetColumn(label_name=label_name, weight_column_name=weight_column_name)
Creates a _TargetColumn for binary classification with SVMs. The target column uses binary hinge loss. Args: label_name: String, name of the key in label dict. Can be null if label is a tensor (single headed models). weight_column_name: A string defining feature column name representing weight...
Creates a _TargetColumn for binary classification with SVMs.
[ "Creates", "a", "_TargetColumn", "for", "binary", "classification", "with", "SVMs", "." ]
def binary_svm_target(label_name=None, weight_column_name=None): """Creates a _TargetColumn for binary classification with SVMs. The target column uses binary hinge loss. Args: label_name: String, name of the key in label dict. Can be null if label is a tensor (single headed models). weight_column...
[ "def", "binary_svm_target", "(", "label_name", "=", "None", ",", "weight_column_name", "=", "None", ")", ":", "return", "_BinarySvmTargetColumn", "(", "label_name", "=", "label_name", ",", "weight_column_name", "=", "weight_column_name", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/layers/python/layers/target_column.py#L90-L107
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/eager/function_cache.py
python
FunctionCache.add_call_context
(self, call_context: ExecutionContext)
Adds a new ExcutionContext observation.
Adds a new ExcutionContext observation.
[ "Adds", "a", "new", "ExcutionContext", "observation", "." ]
def add_call_context(self, call_context: ExecutionContext) -> None: """Adds a new ExcutionContext observation.""" self._missed.add(call_context)
[ "def", "add_call_context", "(", "self", ",", "call_context", ":", "ExecutionContext", ")", "->", "None", ":", "self", ".", "_missed", ".", "add", "(", "call_context", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/function_cache.py#L207-L209
schwehr/libais
1e19605942c8e155cd02fde6d1acde75ecd15d75
third_party/gmock/scripts/gmock_doctor.py
python
_OverloadedFunctionMatcherDiagnoser
(msg)
return _GenericDiagnoser('OFM', 'Overloaded Function Matcher', [(gcc_regex, diagnosis), (clang_regex, diagnosis)], msg)
Diagnoses the OFM disease, given the error messages by the compiler.
Diagnoses the OFM disease, given the error messages by the compiler.
[ "Diagnoses", "the", "OFM", "disease", "given", "the", "error", "messages", "by", "the", "compiler", "." ]
def _OverloadedFunctionMatcherDiagnoser(msg): """Diagnoses the OFM disease, given the error messages by the compiler.""" gcc_regex = (_GCC_FILE_LINE_RE + r'error: no matching function for ' r'call to \'Truly\(<unresolved overloaded function type>\)') clang_regex = (_CLANG_FILE_LINE_RE + r'error: n...
[ "def", "_OverloadedFunctionMatcherDiagnoser", "(", "msg", ")", ":", "gcc_regex", "=", "(", "_GCC_FILE_LINE_RE", "+", "r'error: no matching function for '", "r'call to \\'Truly\\(<unresolved overloaded function type>\\)'", ")", "clang_regex", "=", "(", "_CLANG_FILE_LINE_RE", "+", ...
https://github.com/schwehr/libais/blob/1e19605942c8e155cd02fde6d1acde75ecd15d75/third_party/gmock/scripts/gmock_doctor.py#L282-L300
pgRouting/osm2pgrouting
8491929fc4037d308f271e84d59bb96da3c28aa2
tools/cpplint.py
python
_Filters
()
return _cpplint_state.filters
Returns the module's list of output filters, as a list.
Returns the module's list of output filters, as a list.
[ "Returns", "the", "module", "s", "list", "of", "output", "filters", "as", "a", "list", "." ]
def _Filters(): """Returns the module's list of output filters, as a list.""" return _cpplint_state.filters
[ "def", "_Filters", "(", ")", ":", "return", "_cpplint_state", ".", "filters" ]
https://github.com/pgRouting/osm2pgrouting/blob/8491929fc4037d308f271e84d59bb96da3c28aa2/tools/cpplint.py#L874-L876
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/core/_dtype.py
python
_is_packed
(dtype)
return True
Checks whether the structured data type in 'dtype' has a simple layout, where all the fields are in order, and follow each other with no alignment padding. When this returns true, the dtype can be reconstructed from a list of the field names and dtypes with no additional dtype parameters. Dupl...
Checks whether the structured data type in 'dtype' has a simple layout, where all the fields are in order, and follow each other with no alignment padding.
[ "Checks", "whether", "the", "structured", "data", "type", "in", "dtype", "has", "a", "simple", "layout", "where", "all", "the", "fields", "are", "in", "order", "and", "follow", "each", "other", "with", "no", "alignment", "padding", "." ]
def _is_packed(dtype): """ Checks whether the structured data type in 'dtype' has a simple layout, where all the fields are in order, and follow each other with no alignment padding. When this returns true, the dtype can be reconstructed from a list of the field names and dtypes with no additio...
[ "def", "_is_packed", "(", "dtype", ")", ":", "total_offset", "=", "0", "for", "name", "in", "dtype", ".", "names", ":", "fld_dtype", ",", "fld_offset", ",", "title", "=", "_unpack_field", "(", "*", "dtype", ".", "fields", "[", "name", "]", ")", "if", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/_dtype.py#L245-L265
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_vim.py
python
EditraCommander.SetFindCharCmd
(self, *args)
Remember last find-char command (raw unparsed command, e.g. 'f') for repeating later on.
Remember last find-char command (raw unparsed command, e.g. 'f') for repeating later on.
[ "Remember", "last", "find", "-", "char", "command", "(", "raw", "unparsed", "command", "e", ".", "g", ".", "f", ")", "for", "repeating", "later", "on", "." ]
def SetFindCharCmd(self, *args): """Remember last find-char command (raw unparsed command, e.g. 'f') for repeating later on. """ self.LastFindChar = args
[ "def", "SetFindCharCmd", "(", "self", ",", "*", "args", ")", ":", "self", ".", "LastFindChar", "=", "args" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_vim.py#L744-L749
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/python/google/process_utils.py
python
RunCommand
(command, verbose=True)
return RunCommandFull(command, verbose)[0]
Runs the command list, printing its output and returning its exit status. Prints the given command (which should be a list of one or more strings), then runs it and prints its stderr (and optionally stdout) to stdout, line-buffered, converting line endings to CRLF. Waits for the command to terminate and retur...
Runs the command list, printing its output and returning its exit status.
[ "Runs", "the", "command", "list", "printing", "its", "output", "and", "returning", "its", "exit", "status", "." ]
def RunCommand(command, verbose=True): """Runs the command list, printing its output and returning its exit status. Prints the given command (which should be a list of one or more strings), then runs it and prints its stderr (and optionally stdout) to stdout, line-buffered, converting line endings to CRLF. Wa...
[ "def", "RunCommand", "(", "command", ",", "verbose", "=", "True", ")", ":", "return", "RunCommandFull", "(", "command", ",", "verbose", ")", "[", "0", "]" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/python/google/process_utils.py#L115-L134
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/cell.py
python
Cell.cast_inputs
(self, inputs, dst_type)
return tuple(res)
Cast inputs to specified type. Args: inputs (tuple[Tensor]): The cell inputs. dst_type (mindspore.dtype): The specified data type. returns: tuple[Tensor], the result with destination data type.
Cast inputs to specified type.
[ "Cast", "inputs", "to", "specified", "type", "." ]
def cast_inputs(self, inputs, dst_type): """ Cast inputs to specified type. Args: inputs (tuple[Tensor]): The cell inputs. dst_type (mindspore.dtype): The specified data type. returns: tuple[Tensor], the result with destination data type. """...
[ "def", "cast_inputs", "(", "self", ",", "inputs", ",", "dst_type", ")", ":", "res", "=", "list", "(", ")", "for", "item", "in", "inputs", ":", "if", "isinstance", "(", "item", ",", "tuple", ")", ":", "res", ".", "append", "(", "self", ".", "cast_in...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/cell.py#L356-L373
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
VarHScrollHelper.SetColumnCount
(*args, **kwargs)
return _windows_.VarHScrollHelper_SetColumnCount(*args, **kwargs)
SetColumnCount(self, size_t columnCount)
SetColumnCount(self, size_t columnCount)
[ "SetColumnCount", "(", "self", "size_t", "columnCount", ")" ]
def SetColumnCount(*args, **kwargs): """SetColumnCount(self, size_t columnCount)""" return _windows_.VarHScrollHelper_SetColumnCount(*args, **kwargs)
[ "def", "SetColumnCount", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "VarHScrollHelper_SetColumnCount", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L2320-L2322
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/physics/SIP/models.py
python
ColeColeComplex.response
(self, par)
return pg.cat(np.abs(spec), -np.angle(spec))
phase angle of the model
phase angle of the model
[ "phase", "angle", "of", "the", "model" ]
def response(self, par): """phase angle of the model""" spec = modelColeColeRho(self.f_, *par) return pg.cat(np.abs(spec), -np.angle(spec))
[ "def", "response", "(", "self", ",", "par", ")", ":", "spec", "=", "modelColeColeRho", "(", "self", ".", "f_", ",", "*", "par", ")", "return", "pg", ".", "cat", "(", "np", ".", "abs", "(", "spec", ")", ",", "-", "np", ".", "angle", "(", "spec",...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/SIP/models.py#L274-L277
p4lang/p4c
3272e79369f20813cc1a555a5eb26f44432f84a4
tools/cpplint.py
python
_BlockInfo.CheckBegin
(self, filename, clean_lines, linenum, error)
Run checks that applies to text up to the opening brace. This is mostly for checking the text after the class identifier and the "{", usually where the base class is specified. For other blocks, there isn't much to check, so we always pass. Args: filename: The name of the current file. cl...
Run checks that applies to text up to the opening brace.
[ "Run", "checks", "that", "applies", "to", "text", "up", "to", "the", "opening", "brace", "." ]
def CheckBegin(self, filename, clean_lines, linenum, error): """Run checks that applies to text up to the opening brace. This is mostly for checking the text after the class identifier and the "{", usually where the base class is specified. For other blocks, there isn't much to check, so we always pas...
[ "def", "CheckBegin", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "pass" ]
https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/cpplint.py#L2714-L2727
HKUST-Aerial-Robotics/Teach-Repeat-Replan
98505a7f74b13c8b501176ff838a38423dbef536
utils/quadrotor_msgs/src/quadrotor_msgs/msg/_StatusData.py
python
StatusData._get_types
(self)
return self._slot_types
internal API method
internal API method
[ "internal", "API", "method" ]
def _get_types(self): """ internal API method """ return self._slot_types
[ "def", "_get_types", "(", "self", ")", ":", "return", "self", ".", "_slot_types" ]
https://github.com/HKUST-Aerial-Robotics/Teach-Repeat-Replan/blob/98505a7f74b13c8b501176ff838a38423dbef536/utils/quadrotor_msgs/src/quadrotor_msgs/msg/_StatusData.py#L71-L75
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/numpy/_symbol.py
python
eye
(N, M=None, k=0, dtype=float, **kwargs)
return _npi.eye(N, M, k, ctx, dtype)
Return a 2-D array with ones on the diagonal and zeros elsewhere. Parameters ---------- N : int Number of rows in the output. M : int, optional Number of columns in the output. If None, defaults to N. k : int, optional Index of the diagonal: 0 (the default) refers to the mai...
Return a 2-D array with ones on the diagonal and zeros elsewhere.
[ "Return", "a", "2", "-", "D", "array", "with", "ones", "on", "the", "diagonal", "and", "zeros", "elsewhere", "." ]
def eye(N, M=None, k=0, dtype=float, **kwargs): """ Return a 2-D array with ones on the diagonal and zeros elsewhere. Parameters ---------- N : int Number of rows in the output. M : int, optional Number of columns in the output. If None, defaults to N. k : int, optional ...
[ "def", "eye", "(", "N", ",", "M", "=", "None", ",", "k", "=", "0", ",", "dtype", "=", "float", ",", "*", "*", "kwargs", ")", ":", "_sanity_check_params", "(", "'eye'", ",", "[", "'order'", "]", ",", "kwargs", ")", "ctx", "=", "kwargs", ".", "po...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L2035-L2066
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/server/wsgi/serve/http_io.py
python
Request.GetMultiPartParameter
(self, name)
return parameter_list
Gets multi-part parameter values as sequence. Args: name: name of parameter. Returns: sequence of parameter values, empty list if not.
Gets multi-part parameter values as sequence.
[ "Gets", "multi", "-", "part", "parameter", "values", "as", "sequence", "." ]
def GetMultiPartParameter(self, name): """Gets multi-part parameter values as sequence. Args: name: name of parameter. Returns: sequence of parameter values, empty list if not. """ params = self.GetParameter(name) if not params: return [] if isinstance(params, str): ...
[ "def", "GetMultiPartParameter", "(", "self", ",", "name", ")", ":", "params", "=", "self", ".", "GetParameter", "(", "name", ")", "if", "not", "params", ":", "return", "[", "]", "if", "isinstance", "(", "params", ",", "str", ")", ":", "# Try to parse as ...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/http_io.py#L99-L119
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/buttonpanel.py
python
ButtonPanel.RemoveAllButtons
(self)
Remove all the buttons from :class:`ButtonPanel`. :note: This function is for internal use only. If you are interested in manipulating a :class:`ButtonPanel` in real time (ie. removing things on it) have a look at the :meth:`~ButtonPanel.Clear` method.
Remove all the buttons from :class:`ButtonPanel`. :note: This function is for internal use only. If you are interested in manipulating a :class:`ButtonPanel` in real time (ie. removing things on it) have a look at the :meth:`~ButtonPanel.Clear` method.
[ "Remove", "all", "the", "buttons", "from", ":", "class", ":", "ButtonPanel", ".", ":", "note", ":", "This", "function", "is", "for", "internal", "use", "only", ".", "If", "you", "are", "interested", "in", "manipulating", "a", ":", "class", ":", "ButtonPa...
def RemoveAllButtons(self): """ Remove all the buttons from :class:`ButtonPanel`. :note: This function is for internal use only. If you are interested in manipulating a :class:`ButtonPanel` in real time (ie. removing things on it) have a look at the :meth:`~ButtonPanel...
[ "def", "RemoveAllButtons", "(", "self", ")", ":", "self", ".", "_vButtons", "=", "[", "]" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/buttonpanel.py#L1993-L2002
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/polynomial/polyutils.py
python
_vander_nd_flat
(vander_fs, points, degrees)
return v.reshape(v.shape[:-len(degrees)] + (-1,))
Like `_vander_nd`, but flattens the last ``len(degrees)`` axes into a single axis Used to implement the public ``<type>vander<n>d`` functions.
Like `_vander_nd`, but flattens the last ``len(degrees)`` axes into a single axis
[ "Like", "_vander_nd", "but", "flattens", "the", "last", "len", "(", "degrees", ")", "axes", "into", "a", "single", "axis" ]
def _vander_nd_flat(vander_fs, points, degrees): """ Like `_vander_nd`, but flattens the last ``len(degrees)`` axes into a single axis Used to implement the public ``<type>vander<n>d`` functions. """ v = _vander_nd(vander_fs, points, degrees) return v.reshape(v.shape[:-len(degrees)] + (-1,))
[ "def", "_vander_nd_flat", "(", "vander_fs", ",", "points", ",", "degrees", ")", ":", "v", "=", "_vander_nd", "(", "vander_fs", ",", "points", ",", "degrees", ")", "return", "v", ".", "reshape", "(", "v", ".", "shape", "[", ":", "-", "len", "(", "degr...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/polyutils.py#L446-L453
dmlc/treelite
df56babb6a4a2d7c29d719c28ce53acfa7dbab3c
python/treelite/frontend.py
python
Model.load
(cls, filename, model_format)
return Model(handle)
Load a tree ensemble model from a file Parameters ---------- filename : :py:class:`str <python:str>` path to model file model_format : :py:class:`str <python:str>` model file format. Must be 'xgboost', 'xgboost_json', or 'lightgbm' Returns ------...
Load a tree ensemble model from a file
[ "Load", "a", "tree", "ensemble", "model", "from", "a", "file" ]
def load(cls, filename, model_format): """ Load a tree ensemble model from a file Parameters ---------- filename : :py:class:`str <python:str>` path to model file model_format : :py:class:`str <python:str>` model file format. Must be 'xgboost', 'x...
[ "def", "load", "(", "cls", ",", "filename", ",", "model_format", ")", ":", "handle", "=", "ctypes", ".", "c_void_p", "(", ")", "if", "not", "_isascii", "(", "model_format", ")", ":", "raise", "ValueError", "(", "'model_format parameter must be an ASCII string'",...
https://github.com/dmlc/treelite/blob/df56babb6a4a2d7c29d719c28ce53acfa7dbab3c/python/treelite/frontend.py#L474-L513
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/cython/Cython/Compiler/ParseTreeTransforms.py
python
AnalyseExpressionsTransform.visit_IndexNode
(self, node)
return node
Replace index nodes used to specialize cdef functions with fused argument types with the Attribute- or NameNode referring to the function. We then need to copy over the specialization properties to the attribute or name node. Because the indexing might be a Python indexing operation on ...
Replace index nodes used to specialize cdef functions with fused argument types with the Attribute- or NameNode referring to the function. We then need to copy over the specialization properties to the attribute or name node.
[ "Replace", "index", "nodes", "used", "to", "specialize", "cdef", "functions", "with", "fused", "argument", "types", "with", "the", "Attribute", "-", "or", "NameNode", "referring", "to", "the", "function", ".", "We", "then", "need", "to", "copy", "over", "the...
def visit_IndexNode(self, node): """ Replace index nodes used to specialize cdef functions with fused argument types with the Attribute- or NameNode referring to the function. We then need to copy over the specialization properties to the attribute or name node. Because ...
[ "def", "visit_IndexNode", "(", "self", ",", "node", ")", ":", "self", ".", "visit_Node", "(", "node", ")", "if", "node", ".", "is_fused_index", "and", "not", "node", ".", "type", ".", "is_error", ":", "node", "=", "node", ".", "base", "return", "node" ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Compiler/ParseTreeTransforms.py#L2229-L2243
wyrover/book-code
7f4883d9030d553bc6bcfa3da685e34789839900
3rdparty/protobuf/python/google/protobuf/message_factory.py
python
MessageFactory.GetMessages
(self, files)
return result
Gets all the messages from a specified file. This will find and resolve dependencies, failing if the descriptor pool cannot satisfy them. Args: files: The file names to extract messages from. Returns: A dictionary mapping proto names to the message classes. This will include any dep...
Gets all the messages from a specified file.
[ "Gets", "all", "the", "messages", "from", "a", "specified", "file", "." ]
def GetMessages(self, files): """Gets all the messages from a specified file. This will find and resolve dependencies, failing if the descriptor pool cannot satisfy them. Args: files: The file names to extract messages from. Returns: A dictionary mapping proto names to the message cla...
[ "def", "GetMessages", "(", "self", ",", "files", ")", ":", "result", "=", "{", "}", "for", "file_name", "in", "files", ":", "file_desc", "=", "self", ".", "pool", ".", "FindFileByName", "(", "file_name", ")", "for", "name", ",", "msg", "in", "file_desc...
https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/message_factory.py#L89-L128
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py
python
Standard_Suite_Events.set
(self, _object, _attributes={}, **_arguments)
set: Set an object's data. Required argument: the object for the command Keyword argument to: The new value. Keyword argument _attributes: AppleEvent attribute dictionary
set: Set an object's data. Required argument: the object for the command Keyword argument to: The new value. Keyword argument _attributes: AppleEvent attribute dictionary
[ "set", ":", "Set", "an", "object", "s", "data", ".", "Required", "argument", ":", "the", "object", "for", "the", "command", "Keyword", "argument", "to", ":", "The", "new", "value", ".", "Keyword", "argument", "_attributes", ":", "AppleEvent", "attribute", ...
def set(self, _object, _attributes={}, **_arguments): """set: Set an object's data. Required argument: the object for the command Keyword argument to: The new value. Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'core' _subcode = 'setd'...
[ "def", "set", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'core'", "_subcode", "=", "'setd'", "aetools", ".", "keysubst", "(", "_arguments", ",", "self", ".", "_argmap_set", ")",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py#L311-L330
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
ToolBarBase.GetToolLongHelp
(*args, **kwargs)
return _controls_.ToolBarBase_GetToolLongHelp(*args, **kwargs)
GetToolLongHelp(self, int id) -> String
GetToolLongHelp(self, int id) -> String
[ "GetToolLongHelp", "(", "self", "int", "id", ")", "-", ">", "String" ]
def GetToolLongHelp(*args, **kwargs): """GetToolLongHelp(self, int id) -> String""" return _controls_.ToolBarBase_GetToolLongHelp(*args, **kwargs)
[ "def", "GetToolLongHelp", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ToolBarBase_GetToolLongHelp", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L3835-L3837
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/ao/quantization/_equalize.py
python
max_over_ndim
(input, axis_list, keepdim=False)
return input
Applies 'torch.max' over the given axises
Applies 'torch.max' over the given axises
[ "Applies", "torch", ".", "max", "over", "the", "given", "axises" ]
def max_over_ndim(input, axis_list, keepdim=False): ''' Applies 'torch.max' over the given axises ''' axis_list.sort(reverse=True) for axis in axis_list: input, _ = input.max(axis, keepdim) return input
[ "def", "max_over_ndim", "(", "input", ",", "axis_list", ",", "keepdim", "=", "False", ")", ":", "axis_list", ".", "sort", "(", "reverse", "=", "True", ")", "for", "axis", "in", "axis_list", ":", "input", ",", "_", "=", "input", ".", "max", "(", "axis...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/quantization/_equalize.py#L33-L39
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/series.py
python
Series.rename
( self, index=None, *, axis=None, copy=True, inplace=False, level=None, errors="ignore", )
Alter Series index labels or name. Function / dict values must be unique (1-to-1). Labels not contained in a dict / Series will be left as-is. Extra labels listed don't throw an error. Alternatively, change ``Series.name`` with a scalar value. See the :ref:`user guide <basics....
Alter Series index labels or name.
[ "Alter", "Series", "index", "labels", "or", "name", "." ]
def rename( self, index=None, *, axis=None, copy=True, inplace=False, level=None, errors="ignore", ): """ Alter Series index labels or name. Function / dict values must be unique (1-to-1). Labels not contained in a dict...
[ "def", "rename", "(", "self", ",", "index", "=", "None", ",", "*", ",", "axis", "=", "None", ",", "copy", "=", "True", ",", "inplace", "=", "False", ",", "level", "=", "None", ",", "errors", "=", "\"ignore\"", ",", ")", ":", "if", "callable", "("...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/series.py#L3951-L4025
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mpl2dgraphicsview.py
python
Qt4Mpl2dCanvas.y_max
(self)
return self._yLimit[1]
maximum y :return:
maximum y :return:
[ "maximum", "y", ":", "return", ":" ]
def y_max(self): """ maximum y :return: """ return self._yLimit[1]
[ "def", "y_max", "(", "self", ")", ":", "return", "self", ".", "_yLimit", "[", "1", "]" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mpl2dgraphicsview.py#L374-L378
apache/singa
93fd9da72694e68bfe3fb29d0183a65263d238a1
python/singa/opt.py
python
DistOpt.backward_and_sparse_update
(self, loss, threshold=2097152, spars=0.05, topK=False, corr=True)
Performs backward propagation from the loss and parameter update with sparsification. THIS IS A EXPERIMENTAL FUNCTION FOR RESEARCH PURPOSE: From the loss, it performs backward propagation to get the gradients and do the parameter update. It fuses the tensors with size smaller than the threshold...
Performs backward propagation from the loss and parameter update with sparsification.
[ "Performs", "backward", "propagation", "from", "the", "loss", "and", "parameter", "update", "with", "sparsification", "." ]
def backward_and_sparse_update(self, loss, threshold=2097152, spars=0.05, topK=False, corr=True): """ Performs backward propagation from ...
[ "def", "backward_and_sparse_update", "(", "self", ",", "loss", ",", "threshold", "=", "2097152", ",", "spars", "=", "0.05", ",", "topK", "=", "False", ",", "corr", "=", "True", ")", ":", "if", "(", "(", "not", "hasattr", "(", "self", ",", "\"sparsInit\...
https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/opt.py#L994-L1094
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/mox.py
python
Mox.CreateMockAnything
(self)
return new_mock
Create a mock that will accept any method calls. This does not enforce an interface.
Create a mock that will accept any method calls.
[ "Create", "a", "mock", "that", "will", "accept", "any", "method", "calls", "." ]
def CreateMockAnything(self): """Create a mock that will accept any method calls. This does not enforce an interface. """ new_mock = MockAnything() self._mock_objects.append(new_mock) return new_mock
[ "def", "CreateMockAnything", "(", "self", ")", ":", "new_mock", "=", "MockAnything", "(", ")", "self", ".", "_mock_objects", ".", "append", "(", "new_mock", ")", "return", "new_mock" ]
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/mox.py#L179-L187
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/desmonddmsfile.py
python
DesmondDMSFile.getVelocities
(self)
return self.velocities
Get the positions of each atom in the system
Get the positions of each atom in the system
[ "Get", "the", "positions", "of", "each", "atom", "in", "the", "system" ]
def getVelocities(self): """Get the positions of each atom in the system """ return self.velocities
[ "def", "getVelocities", "(", "self", ")", ":", "return", "self", ".", "velocities" ]
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/desmonddmsfile.py#L118-L121
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/v8/third_party/jinja2/ext.py
python
babel_extract
(fileobj, keywords, comment_tags, options)
Babel extraction method for Jinja templates. .. versionchanged:: 2.3 Basic support for translation comments was added. If `comment_tags` is now set to a list of keywords for extraction, the extractor will try to find the best preceeding comment that begins with one of the keywords. Fo...
Babel extraction method for Jinja templates.
[ "Babel", "extraction", "method", "for", "Jinja", "templates", "." ]
def babel_extract(fileobj, keywords, comment_tags, options): """Babel extraction method for Jinja templates. .. versionchanged:: 2.3 Basic support for translation comments was added. If `comment_tags` is now set to a list of keywords for extraction, the extractor will try to find the best...
[ "def", "babel_extract", "(", "fileobj", ",", "keywords", ",", "comment_tags", ",", "options", ")", ":", "extensions", "=", "set", "(", ")", "for", "extension", "in", "options", ".", "get", "(", "'extensions'", ",", "''", ")", ".", "split", "(", "','", ...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/ext.py#L542-L619
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py
python
Categorical.size
(self)
return self._codes.size
Return the len of myself.
Return the len of myself.
[ "Return", "the", "len", "of", "myself", "." ]
def size(self) -> int: """ Return the len of myself. """ return self._codes.size
[ "def", "size", "(", "self", ")", "->", "int", ":", "return", "self", ".", "_codes", ".", "size" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py#L505-L509
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/cgi.py
python
FieldStorage.make_file
(self, binary=None)
return tempfile.TemporaryFile("w+b")
Overridable: return a readable & writable file. The file will be used as follows: - data is written to it - seek(0) - data is read from it The 'binary' argument is unused -- the file is always opened in binary mode. This version opens a temporary file for readi...
Overridable: return a readable & writable file.
[ "Overridable", ":", "return", "a", "readable", "&", "writable", "file", "." ]
def make_file(self, binary=None): """Overridable: return a readable & writable file. The file will be used as follows: - data is written to it - seek(0) - data is read from it The 'binary' argument is unused -- the file is always opened in binary mode. ...
[ "def", "make_file", "(", "self", ",", "binary", "=", "None", ")", ":", "import", "tempfile", "return", "tempfile", ".", "TemporaryFile", "(", "\"w+b\"", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/cgi.py#L743-L768
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/ttk.py
python
Treeview.heading
(self, column, option=None, **kw)
return _val_or_dict(kw, self.tk.call, self._w, 'heading', column)
Query or modify the heading options for the specified column. If kw is not given, returns a dict of the heading option values. If option is specified then the value for that option is returned. Otherwise, sets the options to the corresponding values. Valid options/values are: ...
Query or modify the heading options for the specified column.
[ "Query", "or", "modify", "the", "heading", "options", "for", "the", "specified", "column", "." ]
def heading(self, column, option=None, **kw): """Query or modify the heading options for the specified column. If kw is not given, returns a dict of the heading option values. If option is specified then the value for that option is returned. Otherwise, sets the options to the correspon...
[ "def", "heading", "(", "self", ",", "column", ",", "option", "=", "None", ",", "*", "*", "kw", ")", ":", "cmd", "=", "kw", ".", "get", "(", "'command'", ")", "if", "cmd", "and", "not", "isinstance", "(", "cmd", ",", "basestring", ")", ":", "# cal...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/ttk.py#L1241-L1270
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListCtrl.GetUserLineHeight
(self)
Returns the custom value for the :class:`UltimateListCtrl` item height, if previously set with :meth:`~UltimateListCtrl.SetUserLineHeight`. :note: This method can be used only with ``ULC_REPORT`` and ``ULC_USER_ROW_HEIGHT`` styles set.
Returns the custom value for the :class:`UltimateListCtrl` item height, if previously set with :meth:`~UltimateListCtrl.SetUserLineHeight`.
[ "Returns", "the", "custom", "value", "for", "the", ":", "class", ":", "UltimateListCtrl", "item", "height", "if", "previously", "set", "with", ":", "meth", ":", "~UltimateListCtrl", ".", "SetUserLineHeight", "." ]
def GetUserLineHeight(self): """ Returns the custom value for the :class:`UltimateListCtrl` item height, if previously set with :meth:`~UltimateListCtrl.SetUserLineHeight`. :note: This method can be used only with ``ULC_REPORT`` and ``ULC_USER_ROW_HEIGHT`` styles set. """ ...
[ "def", "GetUserLineHeight", "(", "self", ")", ":", "if", "self", ".", "_mainWin", ":", "return", "self", ".", "_mainWin", ".", "GetUserLineHeight", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L11229-L11238
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/memory_inspector/memory_inspector/data/file_storage.py
python
Storage.StoreSettings
(self, name, settings)
Stores a key-value dict into /settings-name.json file.
Stores a key-value dict into /settings-name.json file.
[ "Stores", "a", "key", "-", "value", "dict", "into", "/", "settings", "-", "name", ".", "json", "file", "." ]
def StoreSettings(self, name, settings): """Stores a key-value dict into /settings-name.json file.""" assert(isinstance(settings, dict)) file_path = os.path.join(self._root, Storage._SETTINGS_FILE % name) if not settings: if os.path.exists(file_path): os.unlink(file_path) return ...
[ "def", "StoreSettings", "(", "self", ",", "name", ",", "settings", ")", ":", "assert", "(", "isinstance", "(", "settings", ",", "dict", ")", ")", "file_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "_root", ",", "Storage", ".", "_SETT...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/memory_inspector/memory_inspector/data/file_storage.py#L46-L55
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/mercurial.py
python
Mercurial.is_commit_id_equal
(cls, dest, name)
return False
Always assume the versions don't match
Always assume the versions don't match
[ "Always", "assume", "the", "versions", "don", "t", "match" ]
def is_commit_id_equal(cls, dest, name): """Always assume the versions don't match""" return False
[ "def", "is_commit_id_equal", "(", "cls", ",", "dest", ",", "name", ")", ":", "return", "False" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/mercurial.py#L259-L263
apache/arrow
af33dd1157eb8d7d9bfac25ebf61445b793b7943
python/benchmarks/common.py
python
BuiltinsGenerator.generate_object_list
(self, n, none_prob=DEFAULT_NONE_PROB)
return data
Generate a list of generic Python objects with *none_prob* probability of an entry being None.
Generate a list of generic Python objects with *none_prob* probability of an entry being None.
[ "Generate", "a", "list", "of", "generic", "Python", "objects", "with", "*", "none_prob", "*", "probability", "of", "an", "entry", "being", "None", "." ]
def generate_object_list(self, n, none_prob=DEFAULT_NONE_PROB): """ Generate a list of generic Python objects with *none_prob* probability of an entry being None. """ data = [object() for i in range(n)] self.sprinkle_nones(data, none_prob) return data
[ "def", "generate_object_list", "(", "self", ",", "n", ",", "none_prob", "=", "DEFAULT_NONE_PROB", ")", ":", "data", "=", "[", "object", "(", ")", "for", "i", "in", "range", "(", "n", ")", "]", "self", ".", "sprinkle_nones", "(", "data", ",", "none_prob...
https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/python/benchmarks/common.py#L172-L179
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/torch/internal_graph.py
python
_make_ssa_name
(name)
return "%" + name
Converts a symbol name (string) into an SSA name, by prepending '%'. Only used for pretty printing the graph.
Converts a symbol name (string) into an SSA name, by prepending '%'. Only used for pretty printing the graph.
[ "Converts", "a", "symbol", "name", "(", "string", ")", "into", "an", "SSA", "name", "by", "prepending", "%", ".", "Only", "used", "for", "pretty", "printing", "the", "graph", "." ]
def _make_ssa_name(name): """Converts a symbol name (string) into an SSA name, by prepending '%'. Only used for pretty printing the graph. """ return "%" + name
[ "def", "_make_ssa_name", "(", "name", ")", ":", "return", "\"%\"", "+", "name" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/torch/internal_graph.py#L12-L16
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
tools/caffe_converter/caffe_parser.py
python
read_prototxt
(fname)
return proto
Return a caffe_pb2.NetParameter object that defined in a prototxt file
Return a caffe_pb2.NetParameter object that defined in a prototxt file
[ "Return", "a", "caffe_pb2", ".", "NetParameter", "object", "that", "defined", "in", "a", "prototxt", "file" ]
def read_prototxt(fname): """Return a caffe_pb2.NetParameter object that defined in a prototxt file """ proto = caffe_pb2.NetParameter() with open(fname, 'r') as f: text_format.Merge(str(f.read()), proto) return proto
[ "def", "read_prototxt", "(", "fname", ")", ":", "proto", "=", "caffe_pb2", ".", "NetParameter", "(", ")", "with", "open", "(", "fname", ",", "'r'", ")", "as", "f", ":", "text_format", ".", "Merge", "(", "str", "(", "f", ".", "read", "(", ")", ")", ...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/tools/caffe_converter/caffe_parser.py#L34-L40
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/extras/codelite.py
python
codelite_generator.init
(self)
Some data that needs to be present
Some data that needs to be present
[ "Some", "data", "that", "needs", "to", "be", "present" ]
def init(self): """ Some data that needs to be present """ if not getattr(self, 'configurations', None): self.configurations = ['Release'] # LocalRelease, RemoteDebug, etc if not getattr(self, 'platforms', None): ...
[ "def", "init", "(", "self", ")", ":", "if", "not", "getattr", "(", "self", ",", "'configurations'", ",", "None", ")", ":", "self", ".", "configurations", "=", "[", "'Release'", "]", "# LocalRelease, RemoteDebug, etc", "if", "not", "getattr", "(", "self", "...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/extras/codelite.py#L679-L708
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/cubecolourdialog.py
python
HSVWheel.TrackPoint
(self, pt)
Track a mouse event inside the HSV colour wheel. :param `pt`: an instance of :class:`Point`.
Track a mouse event inside the HSV colour wheel.
[ "Track", "a", "mouse", "event", "inside", "the", "HSV", "colour", "wheel", "." ]
def TrackPoint(self, pt): """ Track a mouse event inside the HSV colour wheel. :param `pt`: an instance of :class:`Point`. """ if not self._mouseIn: return dc = wx.ClientDC(self) self.DrawMarkers(dc) mainDialog = self._mainDialog col...
[ "def", "TrackPoint", "(", "self", ",", "pt", ")", ":", "if", "not", "self", ".", "_mouseIn", ":", "return", "dc", "=", "wx", ".", "ClientDC", "(", "self", ")", "self", ".", "DrawMarkers", "(", "dc", ")", "mainDialog", "=", "self", ".", "_mainDialog",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/cubecolourdialog.py#L2091-L2122
facebook/ThreatExchange
31914a51820c73c8a0daffe62ccca29a6e3d359e
hasher-matcher-actioner/hmalib/aws_secrets.py
python
AWSSecrets._get_str_secret
(self, secret_name: str)
return str_response
For secerts stored in AWS Secrets Manager as strings
For secerts stored in AWS Secrets Manager as strings
[ "For", "secerts", "stored", "in", "AWS", "Secrets", "Manager", "as", "strings" ]
def _get_str_secret(self, secret_name: str) -> str: """ For secerts stored in AWS Secrets Manager as strings """ response = self._get_secret_value_response(secret_name) str_response = response["SecretString"] return str_response
[ "def", "_get_str_secret", "(", "self", ",", "secret_name", ":", "str", ")", "->", "str", ":", "response", "=", "self", ".", "_get_secret_value_response", "(", "secret_name", ")", "str_response", "=", "response", "[", "\"SecretString\"", "]", "return", "str_respo...
https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/hasher-matcher-actioner/hmalib/aws_secrets.py#L80-L86
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py
python
CodeWarrior_suite_Events.check
(self, _object=None, _attributes={}, **_arguments)
check: check the syntax of a file in a project or target Required argument: the file or files to be checked Keyword argument _attributes: AppleEvent attribute dictionary
check: check the syntax of a file in a project or target Required argument: the file or files to be checked Keyword argument _attributes: AppleEvent attribute dictionary
[ "check", ":", "check", "the", "syntax", "of", "a", "file", "in", "a", "project", "or", "target", "Required", "argument", ":", "the", "file", "or", "files", "to", "be", "checked", "Keyword", "argument", "_attributes", ":", "AppleEvent", "attribute", "dictiona...
def check(self, _object=None, _attributes={}, **_arguments): """check: check the syntax of a file in a project or target Required argument: the file or files to be checked Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'CWIE' _subcode = 'CHEK' ...
[ "def", "check", "(", "self", ",", "_object", "=", "None", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'CWIE'", "_subcode", "=", "'CHEK'", "if", "_arguments", ":", "raise", "TypeError", ",", "'No optional args ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py#L65-L83
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/linalg/decomp.py
python
eigh_tridiagonal
(d, e, eigvals_only=False, select='a', select_range=None, check_finite=True, tol=0., lapack_driver='auto')
Solve eigenvalue problem for a real symmetric tridiagonal matrix. Find eigenvalues `w` and optionally right eigenvectors `v` of ``a``:: a v[:,i] = w[i] v[:,i] v.H v = identity For a real symmetric matrix ``a`` with diagonal elements `d` and off-diagonal elements `e`. Parameters ...
Solve eigenvalue problem for a real symmetric tridiagonal matrix.
[ "Solve", "eigenvalue", "problem", "for", "a", "real", "symmetric", "tridiagonal", "matrix", "." ]
def eigh_tridiagonal(d, e, eigvals_only=False, select='a', select_range=None, check_finite=True, tol=0., lapack_driver='auto'): """ Solve eigenvalue problem for a real symmetric tridiagonal matrix. Find eigenvalues `w` and optionally right eigenvectors `v` of ``a``:: a v[:,i] ...
[ "def", "eigh_tridiagonal", "(", "d", ",", "e", ",", "eigvals_only", "=", "False", ",", "select", "=", "'a'", ",", "select_range", "=", "None", ",", "check_finite", "=", "True", ",", "tol", "=", "0.", ",", "lapack_driver", "=", "'auto'", ")", ":", "d", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/decomp.py#L1036-L1194
zeroc-ice/ice
6df7df6039674d58fb5ab9a08e46f28591a210f7
python/python/Ice/__init__.py
python
Application.destroyOnInterrupt
(self)
Configures the application to destroy its communicator when interrupted by a signal.
Configures the application to destroy its communicator when interrupted by a signal.
[ "Configures", "the", "application", "to", "destroy", "its", "communicator", "when", "interrupted", "by", "a", "signal", "." ]
def destroyOnInterrupt(self): '''Configures the application to destroy its communicator when interrupted by a signal.''' if Application._signalPolicy == Application.HandleSignals: self._condVar.acquire() if self._ctrlCHandler.getCallback() == self._holdInterruptCallback: ...
[ "def", "destroyOnInterrupt", "(", "self", ")", ":", "if", "Application", ".", "_signalPolicy", "==", "Application", ".", "HandleSignals", ":", "self", ".", "_condVar", ".", "acquire", "(", ")", "if", "self", ".", "_ctrlCHandler", ".", "getCallback", "(", ")"...
https://github.com/zeroc-ice/ice/blob/6df7df6039674d58fb5ab9a08e46f28591a210f7/python/python/Ice/__init__.py#L1610-L1622
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
toolkit/crashreporter/tools/symbolstore.py
python
Dumper.RunFileCommand
(self, file)
Utility function, returns the output of file(1)
Utility function, returns the output of file(1)
[ "Utility", "function", "returns", "the", "output", "of", "file", "(", "1", ")" ]
def RunFileCommand(self, file): """Utility function, returns the output of file(1)""" try: # we use -L to read the targets of symlinks, # and -b to print just the content, not the filename return os.popen("file -Lb " + file).read() except: return "...
[ "def", "RunFileCommand", "(", "self", ",", "file", ")", ":", "try", ":", "# we use -L to read the targets of symlinks,", "# and -b to print just the content, not the filename", "return", "os", ".", "popen", "(", "\"file -Lb \"", "+", "file", ")", ".", "read", "(", ")"...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/toolkit/crashreporter/tools/symbolstore.py#L519-L526
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.SetStatus
(*args, **kwargs)
return _stc.StyledTextCtrl_SetStatus(*args, **kwargs)
SetStatus(self, int statusCode) Change error status - 0 = OK.
SetStatus(self, int statusCode)
[ "SetStatus", "(", "self", "int", "statusCode", ")" ]
def SetStatus(*args, **kwargs): """ SetStatus(self, int statusCode) Change error status - 0 = OK. """ return _stc.StyledTextCtrl_SetStatus(*args, **kwargs)
[ "def", "SetStatus", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetStatus", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L5038-L5044
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextCtrl.SaveFile
(*args, **kwargs)
return _richtext.RichTextCtrl_SaveFile(*args, **kwargs)
SaveFile(self, String file=EmptyString, int type=RICHTEXT_TYPE_ANY) -> bool Save the contents of the document to the given filename, or if the empty string is passed then to the filename set with `SetFilename`.
SaveFile(self, String file=EmptyString, int type=RICHTEXT_TYPE_ANY) -> bool
[ "SaveFile", "(", "self", "String", "file", "=", "EmptyString", "int", "type", "=", "RICHTEXT_TYPE_ANY", ")", "-", ">", "bool" ]
def SaveFile(*args, **kwargs): """ SaveFile(self, String file=EmptyString, int type=RICHTEXT_TYPE_ANY) -> bool Save the contents of the document to the given filename, or if the empty string is passed then to the filename set with `SetFilename`. """ return _richtext.Rich...
[ "def", "SaveFile", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_SaveFile", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L3089-L3096
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/engine/functional.py
python
connect_ancillary_layers
(model, created_layers)
return model
Adds layers that are not connected to the outputs to the model.
Adds layers that are not connected to the outputs to the model.
[ "Adds", "layers", "that", "are", "not", "connected", "to", "the", "outputs", "to", "the", "model", "." ]
def connect_ancillary_layers(model, created_layers): """Adds layers that are not connected to the outputs to the model.""" # Layers not connected to outputs, such as those added in `add_loss`. ancillary_layers = [ layer for layer in created_layers.values() if layer not in model.layers ] if ancillary_lay...
[ "def", "connect_ancillary_layers", "(", "model", ",", "created_layers", ")", ":", "# Layers not connected to outputs, such as those added in `add_loss`.", "ancillary_layers", "=", "[", "layer", "for", "layer", "in", "created_layers", ".", "values", "(", ")", "if", "layer"...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/functional.py#L1098-L1111
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftobjects/dimension.py
python
AngularDimension.onDocumentRestored
(self, obj)
Execute code when the document is restored. It calls the parent class to add missing dimension properties.
Execute code when the document is restored.
[ "Execute", "code", "when", "the", "document", "is", "restored", "." ]
def onDocumentRestored(self, obj): """Execute code when the document is restored. It calls the parent class to add missing dimension properties. """ super(AngularDimension, self).onDocumentRestored(obj)
[ "def", "onDocumentRestored", "(", "self", ",", "obj", ")", ":", "super", "(", "AngularDimension", ",", "self", ")", ".", "onDocumentRestored", "(", "obj", ")" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftobjects/dimension.py#L553-L558
tzutalin/dlib-android
989627cb7fe81cd1d41d73434b0e91ce1dd2683f
tools/lint/cpplint.py
python
PrintUsage
(message)
Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message.
Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message.
[ "Prints", "a", "brief", "usage", "string", "and", "exits", "optionally", "with", "an", "error", "message", ".", "Args", ":", "message", ":", "The", "optional", "error", "message", "." ]
def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message. """ sys.stderr.write(_USAGE) if message: sys.exit('\nFATAL ERROR: ' + message) else: sys.exit(1)
[ "def", "PrintUsage", "(", "message", ")", ":", "sys", ".", "stderr", ".", "write", "(", "_USAGE", ")", "if", "message", ":", "sys", ".", "exit", "(", "'\\nFATAL ERROR: '", "+", "message", ")", "else", ":", "sys", ".", "exit", "(", "1", ")" ]
https://github.com/tzutalin/dlib-android/blob/989627cb7fe81cd1d41d73434b0e91ce1dd2683f/tools/lint/cpplint.py#L5821-L5830
bumptop/BumpTop
466d23597a07ae738f4265262fa01087fc6e257c
trunk/win/Source/bin/jinja2/compiler.py
python
FrameIdentifierVisitor.visit_Name
(self, node)
All assignments to names go through this function.
All assignments to names go through this function.
[ "All", "assignments", "to", "names", "go", "through", "this", "function", "." ]
def visit_Name(self, node): """All assignments to names go through this function.""" if node.ctx == 'store': self.identifiers.declared_locally.add(node.name) elif node.ctx == 'param': self.identifiers.declared_parameter.add(node.name) elif node.ctx == 'load' and n...
[ "def", "visit_Name", "(", "self", ",", "node", ")", ":", "if", "node", ".", "ctx", "==", "'store'", ":", "self", ".", "identifiers", ".", "declared_locally", ".", "add", "(", "node", ".", "name", ")", "elif", "node", ".", "ctx", "==", "'param'", ":",...
https://github.com/bumptop/BumpTop/blob/466d23597a07ae738f4265262fa01087fc6e257c/trunk/win/Source/bin/jinja2/compiler.py#L258-L266
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py
python
MacroDefinition.parsenewcommand
(self, pos)
return 'unknown'
Parse the name of the new command.
Parse the name of the new command.
[ "Parse", "the", "name", "of", "the", "new", "command", "." ]
def parsenewcommand(self, pos): "Parse the name of the new command." self.factory.clearskipped(pos) if self.factory.detecttype(Bracket, pos): return self.parseliteral(pos) if self.factory.detecttype(FormulaCommand, pos): return self.factory.create(FormulaCommand).extractcommand(pos) Trac...
[ "def", "parsenewcommand", "(", "self", ",", "pos", ")", ":", "self", ".", "factory", ".", "clearskipped", "(", "pos", ")", "if", "self", ".", "factory", ".", "detecttype", "(", "Bracket", ",", "pos", ")", ":", "return", "self", ".", "parseliteral", "("...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L5212-L5220
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/distutils/misc_util.py
python
all_strings
(lst)
return True
Return True if all items in lst are string objects.
Return True if all items in lst are string objects.
[ "Return", "True", "if", "all", "items", "in", "lst", "are", "string", "objects", "." ]
def all_strings(lst): """Return True if all items in lst are string objects. """ for item in lst: if not is_string(item): return False return True
[ "def", "all_strings", "(", "lst", ")", ":", "for", "item", "in", "lst", ":", "if", "not", "is_string", "(", "item", ")", ":", "return", "False", "return", "True" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/distutils/misc_util.py#L450-L455
tomahawk-player/tomahawk-resolvers
7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d
archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/python_message.py
python
_AddPropertiesForFields
(descriptor, cls)
Adds properties for all fields in this protocol message type.
Adds properties for all fields in this protocol message type.
[ "Adds", "properties", "for", "all", "fields", "in", "this", "protocol", "message", "type", "." ]
def _AddPropertiesForFields(descriptor, cls): """Adds properties for all fields in this protocol message type.""" for field in descriptor.fields: _AddPropertiesForField(field, cls) if descriptor.is_extendable: # _ExtensionDict is just an adaptor with no state so we allocate a new one # every time it ...
[ "def", "_AddPropertiesForFields", "(", "descriptor", ",", "cls", ")", ":", "for", "field", "in", "descriptor", ".", "fields", ":", "_AddPropertiesForField", "(", "field", ",", "cls", ")", "if", "descriptor", ".", "is_extendable", ":", "# _ExtensionDict is just an ...
https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/python_message.py#L333-L341
vgteam/vg
cf4d516a5e9ee5163c783e4437ddf16b18a4b561
scripts/giraffe-facts.py
python
main
(args)
Parses command line arguments and do the work of the program. "args" specifies the program arguments, with args[0] being the executable name. The return value should be used as the program's exit code.
Parses command line arguments and do the work of the program. "args" specifies the program arguments, with args[0] being the executable name. The return value should be used as the program's exit code.
[ "Parses", "command", "line", "arguments", "and", "do", "the", "work", "of", "the", "program", ".", "args", "specifies", "the", "program", "arguments", "with", "args", "[", "0", "]", "being", "the", "executable", "name", ".", "The", "return", "value", "shou...
def main(args): """ Parses command line arguments and do the work of the program. "args" specifies the program arguments, with args[0] being the executable name. The return value should be used as the program's exit code. """ print(random.choice(FACTS), file = sys.stderr) options = ...
[ "def", "main", "(", "args", ")", ":", "print", "(", "random", ".", "choice", "(", "FACTS", ")", ",", "file", "=", "sys", ".", "stderr", ")", "options", "=", "parse_args", "(", "args", ")", "# This holds the nicely-parsed options object", "# Make the output dir...
https://github.com/vgteam/vg/blob/cf4d516a5e9ee5163c783e4437ddf16b18a4b561/scripts/giraffe-facts.py#L873-L919
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/series.py
python
Series.sort_values
( self, axis=0, ascending: bool | int | Sequence[bool | int] = True, inplace: bool = False, kind: str = "quicksort", na_position: str = "last", ignore_index: bool = False, key: ValueKeyFunc = None, )
Sort by the values. Sort a Series in ascending or descending order by some criterion. Parameters ---------- axis : {0 or 'index'}, default 0 Axis to direct sorting. The value 'index' is accepted for compatibility with DataFrame.sort_values. ascen...
Sort by the values.
[ "Sort", "by", "the", "values", "." ]
def sort_values( self, axis=0, ascending: bool | int | Sequence[bool | int] = True, inplace: bool = False, kind: str = "quicksort", na_position: str = "last", ignore_index: bool = False, key: ValueKeyFunc = None, ): """ Sort by the valu...
[ "def", "sort_values", "(", "self", ",", "axis", "=", "0", ",", "ascending", ":", "bool", "|", "int", "|", "Sequence", "[", "bool", "|", "int", "]", "=", "True", ",", "inplace", ":", "bool", "=", "False", ",", "kind", ":", "str", "=", "\"quicksort\"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/series.py#L3259-L3467
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_grad/grad_implementations.py
python
bprop_scalar_lt
(x, y, out, dout)
return C.zeros_like(x), C.zeros_like(y)
Backpropagator for primitive `scalar_lt`.
Backpropagator for primitive `scalar_lt`.
[ "Backpropagator", "for", "primitive", "scalar_lt", "." ]
def bprop_scalar_lt(x, y, out, dout): """Backpropagator for primitive `scalar_lt`.""" return C.zeros_like(x), C.zeros_like(y)
[ "def", "bprop_scalar_lt", "(", "x", ",", "y", ",", "out", ",", "dout", ")", ":", "return", "C", ".", "zeros_like", "(", "x", ")", ",", "C", ".", "zeros_like", "(", "y", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_implementations.py#L101-L103
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/loading/processing.py
python
SitesFromDir
(directory)
return sites
Extract sites from a data directory. Based on ./analyze.py fetch file name conventions. We assume each site corresponds to two files, <site>.json and <site>.json.cold, and that no other kind of file appears in the data directory. Args: directory: the directory to process. Returns: A list of sites a...
Extract sites from a data directory.
[ "Extract", "sites", "from", "a", "data", "directory", "." ]
def SitesFromDir(directory): """Extract sites from a data directory. Based on ./analyze.py fetch file name conventions. We assume each site corresponds to two files, <site>.json and <site>.json.cold, and that no other kind of file appears in the data directory. Args: directory: the directory to process....
[ "def", "SitesFromDir", "(", "directory", ")", ":", "files", "=", "set", "(", "os", ".", "listdir", "(", "directory", ")", ")", "assert", "files", "sites", "=", "[", "]", "for", "f", "in", "files", ":", "if", "f", ".", "endswith", "(", "'.png'", ")"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/processing.py#L14-L41