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
mldbai/mldb
69994bd879bf592d03374bf43870457384fbae93
ext/googleurl/PRESUBMIT.py
python
ReadFile
(path)
return contents
Given a path, returns the full contents of the file. Reads files in binary format.
Given a path, returns the full contents of the file.
[ "Given", "a", "path", "returns", "the", "full", "contents", "of", "the", "file", "." ]
def ReadFile(path): """Given a path, returns the full contents of the file. Reads files in binary format. """ fo = open(path, 'rb') try: contents = fo.read() finally: fo.close() return contents
[ "def", "ReadFile", "(", "path", ")", ":", "fo", "=", "open", "(", "path", ",", "'rb'", ")", "try", ":", "contents", "=", "fo", ".", "read", "(", ")", "finally", ":", "fo", ".", "close", "(", ")", "return", "contents" ]
https://github.com/mldbai/mldb/blob/69994bd879bf592d03374bf43870457384fbae93/ext/googleurl/PRESUBMIT.py#L20-L30
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/py/sliceshell.py
python
SlicesShell.getMultilineCommand
(self, rstrip=True)
return command
Extract a multi-line command from the editor. The command may not necessarily be valid Python syntax.
Extract a multi-line command from the editor.
[ "Extract", "a", "multi", "-", "line", "command", "from", "the", "editor", "." ]
def getMultilineCommand(self, rstrip=True): """Extract a multi-line command from the editor. The command may not necessarily be valid Python syntax.""" # DNM # XXX Need to extract real prompts here. Need to keep track of # the prompt every time a command is issued. text ...
[ "def", "getMultilineCommand", "(", "self", ",", "rstrip", "=", "True", ")", ":", "# DNM", "# XXX Need to extract real prompts here. Need to keep track of", "# the prompt every time a command is issued.", "text", "=", "self", ".", "GetCurLine", "(", ")", "[", "0", "]", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/sliceshell.py#L2362-L2394
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
TextAttrBorder.__init__
(self, *args, **kwargs)
__init__(self) -> TextAttrBorder
__init__(self) -> TextAttrBorder
[ "__init__", "(", "self", ")", "-", ">", "TextAttrBorder" ]
def __init__(self, *args, **kwargs): """__init__(self) -> TextAttrBorder""" _richtext.TextAttrBorder_swiginit(self,_richtext.new_TextAttrBorder(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_richtext", ".", "TextAttrBorder_swiginit", "(", "self", ",", "_richtext", ".", "new_TextAttrBorder", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L322-L324
tiny-dnn/tiny-dnn
c0f576f5cb7b35893f62127cb7aec18f77a3bcc5
third_party/cpplint.py
python
_IncludeState.FindHeader
(self, header)
return -1
Check if a header has already been included. Args: header: header to check. Returns: Line number of previous occurrence, or -1 if the header has not been seen before.
Check if a header has already been included.
[ "Check", "if", "a", "header", "has", "already", "been", "included", "." ]
def FindHeader(self, header): """Check if a header has already been included. Args: header: header to check. Returns: Line number of previous occurrence, or -1 if the header has not been seen before. """ for section_list in self.include_list: for f in section_list: i...
[ "def", "FindHeader", "(", "self", ",", "header", ")", ":", "for", "section_list", "in", "self", ".", "include_list", ":", "for", "f", "in", "section_list", ":", "if", "f", "[", "0", "]", "==", "header", ":", "return", "f", "[", "1", "]", "return", ...
https://github.com/tiny-dnn/tiny-dnn/blob/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5/third_party/cpplint.py#L838-L851
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/external/bazel_tools/tools/android/incremental_install.py
python
VerifyInstallTimestamp
(adb, app_package)
Verifies that the app is unchanged since the last mobile-install.
Verifies that the app is unchanged since the last mobile-install.
[ "Verifies", "that", "the", "app", "is", "unchanged", "since", "the", "last", "mobile", "-", "install", "." ]
def VerifyInstallTimestamp(adb, app_package): """Verifies that the app is unchanged since the last mobile-install.""" expected_timestamp = adb.Pull("%s/%s/install_timestamp" % ( DEVICE_DIRECTORY, app_package)) if not expected_timestamp: raise TimestampException( "Cannot verify last mobile instal...
[ "def", "VerifyInstallTimestamp", "(", "adb", ",", "app_package", ")", ":", "expected_timestamp", "=", "adb", ".", "Pull", "(", "\"%s/%s/install_timestamp\"", "%", "(", "DEVICE_DIRECTORY", ",", "app_package", ")", ")", "if", "not", "expected_timestamp", ":", "raise...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/tools/android/incremental_install.py#L582-L601
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/linalg_grad.py
python
_CholeskyGrad
(op, grad)
return grad_a * 0.5
Gradient for Cholesky.
Gradient for Cholesky.
[ "Gradient", "for", "Cholesky", "." ]
def _CholeskyGrad(op, grad): """Gradient for Cholesky.""" # Gradient is l^{-H} @ ((l^{H} @ grad) * (tril(ones)-1/2*eye)) @ l^{-1} l = op.outputs[0] num_rows = array_ops.shape(l)[-1] batch_shape = array_ops.shape(l)[:-2] l_inverse = linalg_ops.matrix_triangular_solve(l, ...
[ "def", "_CholeskyGrad", "(", "op", ",", "grad", ")", ":", "# Gradient is l^{-H} @ ((l^{H} @ grad) * (tril(ones)-1/2*eye)) @ l^{-1}", "l", "=", "op", ".", "outputs", "[", "0", "]", "num_rows", "=", "array_ops", ".", "shape", "(", "l", ")", "[", "-", "1", "]", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/linalg_grad.py#L59-L81
msftguy/ssh-rd
a5f3a79daeac5844edebf01916c9613563f1c390
_3rd/boost_1_48_0/tools/build/v2/build/targets.py
python
BasicTarget.sources
(self)
return self.source_targets_
Returns the list of AbstractTargets which are used as sources. The extra properties specified for sources are not represented. The only used of this rule at the moment is the '--dump-tests' feature of the test system.
Returns the list of AbstractTargets which are used as sources. The extra properties specified for sources are not represented. The only used of this rule at the moment is the '--dump-tests' feature of the test system.
[ "Returns", "the", "list", "of", "AbstractTargets", "which", "are", "used", "as", "sources", ".", "The", "extra", "properties", "specified", "for", "sources", "are", "not", "represented", ".", "The", "only", "used", "of", "this", "rule", "at", "the", "moment"...
def sources (self): """ Returns the list of AbstractTargets which are used as sources. The extra properties specified for sources are not represented. The only used of this rule at the moment is the '--dump-tests' feature of the test system. """ if...
[ "def", "sources", "(", "self", ")", ":", "if", "self", ".", "source_targets_", "==", "None", ":", "self", ".", "source_targets_", "=", "[", "]", "for", "s", "in", "self", ".", "sources_", ":", "self", ".", "source_targets_", ".", "append", "(", "resolv...
https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/targets.py#L868-L879
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/generator/analyzer.py
python
TargetCalculator.is_build_impacted
(self)
return self._changed_targets
Returns true if the supplied files impact the build at all.
Returns true if the supplied files impact the build at all.
[ "Returns", "true", "if", "the", "supplied", "files", "impact", "the", "build", "at", "all", "." ]
def is_build_impacted(self): """Returns true if the supplied files impact the build at all.""" return self._changed_targets
[ "def", "is_build_impacted", "(", "self", ")", ":", "return", "self", ".", "_changed_targets" ]
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/generator/analyzer.py#L617-L619
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/parso/py3/parso/python/tree.py
python
_create_params
(parent, argslist_list)
`argslist_list` is a list that can contain an argslist as a first item, but most not. It's basically the items between the parameter brackets (which is at most one item). This function modifies the parser structure. It generates `Param` objects from the normal ast. Those param objects do not exist in a ...
`argslist_list` is a list that can contain an argslist as a first item, but most not. It's basically the items between the parameter brackets (which is at most one item). This function modifies the parser structure. It generates `Param` objects from the normal ast. Those param objects do not exist in a ...
[ "argslist_list", "is", "a", "list", "that", "can", "contain", "an", "argslist", "as", "a", "first", "item", "but", "most", "not", ".", "It", "s", "basically", "the", "items", "between", "the", "parameter", "brackets", "(", "which", "is", "at", "most", "o...
def _create_params(parent, argslist_list): """ `argslist_list` is a list that can contain an argslist as a first item, but most not. It's basically the items between the parameter brackets (which is at most one item). This function modifies the parser structure. It generates `Param` objects from...
[ "def", "_create_params", "(", "parent", ",", "argslist_list", ")", ":", "try", ":", "first", "=", "argslist_list", "[", "0", "]", "except", "IndexError", ":", "return", "[", "]", "if", "first", ".", "type", "in", "(", "'name'", ",", "'fpdef'", ")", ":"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/parso/py3/parso/python/tree.py#L487-L529
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextCtrl.SearchPrev
(*args, **kwargs)
return _stc.StyledTextCtrl_SearchPrev(*args, **kwargs)
SearchPrev(self, int flags, String text) -> int Find some text starting at the search anchor and moving backwards. Does not ensure the selection is visible.
SearchPrev(self, int flags, String text) -> int
[ "SearchPrev", "(", "self", "int", "flags", "String", "text", ")", "-", ">", "int" ]
def SearchPrev(*args, **kwargs): """ SearchPrev(self, int flags, String text) -> int Find some text starting at the search anchor and moving backwards. Does not ensure the selection is visible. """ return _stc.StyledTextCtrl_SearchPrev(*args, **kwargs)
[ "def", "SearchPrev", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SearchPrev", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L4938-L4945
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Diffraction/isis_powder/routines/common.py
python
_load_list_of_files
(run_numbers_list, instrument, file_ext=None)
return read_ws_list
Loads files based on the list passed to it. If the list is greater than the maximum range it will raise an exception see _check_load_range for more details :param run_numbers_list: The list of runs to load :param instrument: The instrument to generate the prefix for :return: The loaded workspaces as...
Loads files based on the list passed to it. If the list is greater than the maximum range it will raise an exception see _check_load_range for more details :param run_numbers_list: The list of runs to load :param instrument: The instrument to generate the prefix for :return: The loaded workspaces as...
[ "Loads", "files", "based", "on", "the", "list", "passed", "to", "it", ".", "If", "the", "list", "is", "greater", "than", "the", "maximum", "range", "it", "will", "raise", "an", "exception", "see", "_check_load_range", "for", "more", "details", ":", "param"...
def _load_list_of_files(run_numbers_list, instrument, file_ext=None): """ Loads files based on the list passed to it. If the list is greater than the maximum range it will raise an exception see _check_load_range for more details :param run_numbers_list: The list of runs to load :param instrumen...
[ "def", "_load_list_of_files", "(", "run_numbers_list", ",", "instrument", ",", "file_ext", "=", "None", ")", ":", "read_ws_list", "=", "[", "]", "_check_load_range", "(", "list_of_runs_to_load", "=", "run_numbers_list", ")", "for", "run_number", "in", "run_numbers_l...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Diffraction/isis_powder/routines/common.py#L647-L664
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TFltRect.IsXYIn
(self, *args)
return _snap.TFltRect_IsXYIn(self, *args)
IsXYIn(TFltRect self, double const & X, double const & Y) -> bool Parameters: X: double const & Y: double const &
IsXYIn(TFltRect self, double const & X, double const & Y) -> bool
[ "IsXYIn", "(", "TFltRect", "self", "double", "const", "&", "X", "double", "const", "&", "Y", ")", "-", ">", "bool" ]
def IsXYIn(self, *args): """ IsXYIn(TFltRect self, double const & X, double const & Y) -> bool Parameters: X: double const & Y: double const & """ return _snap.TFltRect_IsXYIn(self, *args)
[ "def", "IsXYIn", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TFltRect_IsXYIn", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L15278-L15287
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/learn/python/learn/preprocessing/categorical.py
python
CategoricalProcessor.fit_transform
(self, x, unused_y=None)
return self.transform(x)
Learn the vocabulary dictionary and return indexies of categories. Args: x: numpy matrix or iterable of lists/numpy arrays. unused_y: to match fit_transform signature of estimators. Returns: x: iterable, [n_samples]. Category-id matrix.
Learn the vocabulary dictionary and return indexies of categories.
[ "Learn", "the", "vocabulary", "dictionary", "and", "return", "indexies", "of", "categories", "." ]
def fit_transform(self, x, unused_y=None): """Learn the vocabulary dictionary and return indexies of categories. Args: x: numpy matrix or iterable of lists/numpy arrays. unused_y: to match fit_transform signature of estimators. Returns: x: iterable, [n_samples]. Category-id matrix. "...
[ "def", "fit_transform", "(", "self", ",", "x", ",", "unused_y", "=", "None", ")", ":", "self", ".", "fit", "(", "x", ")", "return", "self", ".", "transform", "(", "x", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/preprocessing/categorical.py#L96-L107
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
sp/src/thirdparty/protobuf-2.3.0/python/mox.py
python
Mox.ReplayAll
(self)
Set all mock objects to replay mode.
Set all mock objects to replay mode.
[ "Set", "all", "mock", "objects", "to", "replay", "mode", "." ]
def ReplayAll(self): """Set all mock objects to replay mode.""" for mock_obj in self._mock_objects: mock_obj._Replay()
[ "def", "ReplayAll", "(", "self", ")", ":", "for", "mock_obj", "in", "self", ".", "_mock_objects", ":", "mock_obj", ".", "_Replay", "(", ")" ]
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/mox.py#L189-L193
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/utils.py
python
IsProcessRunningForGlobe
(tool_name, base_dir)
return False
Checks whether specified job is running for portable. Checks if process is running by detecting it in the output returned by executing "ps -ef | grep base_dir". Args: tool_name: tool name to check if it is present in list of running processes. base_dir: base directory for corresponding po...
Checks whether specified job is running for portable.
[ "Checks", "whether", "specified", "job", "is", "running", "for", "portable", "." ]
def IsProcessRunningForGlobe(tool_name, base_dir): """Checks whether specified job is running for portable. Checks if process is running by detecting it in the output returned by executing "ps -ef | grep base_dir". Args: tool_name: tool name to check if it is present in list of running proc...
[ "def", "IsProcessRunningForGlobe", "(", "tool_name", ",", "base_dir", ")", ":", "ps_cmd", "=", "\"ps -ef\"", "grep_cmd", "=", "\"grep \\\"%s\\\"\"", "%", "base_dir", "ps_subprocess", "=", "subprocess", ".", "Popen", "(", "shlex", ".", "split", "(", "ps_cmd", ")"...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/utils.py#L428-L460
MhLiao/TextBoxes_plusplus
39d4898de1504c53a2ed3d67966a57b3595836d0
tools/extra/parse_log.py
python
save_csv_files
(logfile_path, output_dir, train_dict_list, test_dict_list, delimiter=',', verbose=False)
Save CSV files to output_dir If the input log file is, e.g., caffe.INFO, the names will be caffe.INFO.train and caffe.INFO.test
Save CSV files to output_dir
[ "Save", "CSV", "files", "to", "output_dir" ]
def save_csv_files(logfile_path, output_dir, train_dict_list, test_dict_list, delimiter=',', verbose=False): """Save CSV files to output_dir If the input log file is, e.g., caffe.INFO, the names will be caffe.INFO.train and caffe.INFO.test """ log_basename = os.path.basename(log...
[ "def", "save_csv_files", "(", "logfile_path", ",", "output_dir", ",", "train_dict_list", ",", "test_dict_list", ",", "delimiter", "=", "','", ",", "verbose", "=", "False", ")", ":", "log_basename", "=", "os", ".", "path", ".", "basename", "(", "logfile_path", ...
https://github.com/MhLiao/TextBoxes_plusplus/blob/39d4898de1504c53a2ed3d67966a57b3595836d0/tools/extra/parse_log.py#L134-L147
google/swiftshader
8ccc63f045d5975fb67f9dfd3d2b8235b0526990
third_party/SPIRV-Tools/utils/generate_grammar_tables.py
python
generate_operand_kind_table
(enums)
return '\n\n'.join((caps_arrays,) + (exts_arrays,) + enum_entries + (table,))
Returns the info table containing all SPIR-V operand kinds.
Returns the info table containing all SPIR-V operand kinds.
[ "Returns", "the", "info", "table", "containing", "all", "SPIR", "-", "V", "operand", "kinds", "." ]
def generate_operand_kind_table(enums): """Returns the info table containing all SPIR-V operand kinds.""" # We only need to output info tables for those operand kinds that are enums. enums = [e for e in enums if e.get('category') in ['ValueEnum', 'BitEnum']] caps = [entry.get('capabilities', []) ...
[ "def", "generate_operand_kind_table", "(", "enums", ")", ":", "# We only need to output info tables for those operand kinds that are enums.", "enums", "=", "[", "e", "for", "e", "in", "enums", "if", "e", ".", "get", "(", "'category'", ")", "in", "[", "'ValueEnum'", ...
https://github.com/google/swiftshader/blob/8ccc63f045d5975fb67f9dfd3d2b8235b0526990/third_party/SPIRV-Tools/utils/generate_grammar_tables.py#L510-L549
blackberry/Boost
fc90c3fde129c62565c023f091eddc4a7ed9902b
tools/build/v2/build/feature.py
python
attributes
(feature)
return __all_features[feature].attributes_string_list()
Returns the attributes of the given feature.
Returns the attributes of the given feature.
[ "Returns", "the", "attributes", "of", "the", "given", "feature", "." ]
def attributes (feature): """ Returns the attributes of the given feature. """ return __all_features[feature].attributes_string_list()
[ "def", "attributes", "(", "feature", ")", ":", "return", "__all_features", "[", "feature", "]", ".", "attributes_string_list", "(", ")" ]
https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/build/feature.py#L231-L234
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/opt/python/training/external_optimizer.py
python
ExternalOptimizerInterface.__init__
(self, loss, var_list=None, equalities=None, inequalities=None, **optimizer_kwargs)
Initialize a new interface instance. Args: loss: A scalar `Tensor` to be minimized. var_list: Optional list of `Variable` objects to update to minimize `loss`. Defaults to the list of variables collected in the graph under the key `GraphKeys.TRAINABLE_VARIABLES`. equalities: Opti...
Initialize a new interface instance.
[ "Initialize", "a", "new", "interface", "instance", "." ]
def __init__(self, loss, var_list=None, equalities=None, inequalities=None, **optimizer_kwargs): """Initialize a new interface instance. Args: loss: A scalar `Tensor` to be minimized. var_list: Optional list of `Variable` objects to update to minimize `loss`. Defaults to the...
[ "def", "__init__", "(", "self", ",", "loss", ",", "var_list", "=", "None", ",", "equalities", "=", "None", ",", "inequalities", "=", "None", ",", "*", "*", "optimizer_kwargs", ")", ":", "self", ".", "_loss", "=", "loss", "self", ".", "_equalities", "="...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/opt/python/training/external_optimizer.py#L46-L100
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/layers/python/layers/layers.py
python
legacy_fully_connected
(x, num_output_units, activation_fn=None, weight_init=initializers.xavier_initializer(), bias_init=init_ops.zeros_initializer(), name=None, weight_collections...
r"""Adds the parameters for a fully connected layer and returns the output. A fully connected layer is generally defined as a matrix multiply: `y = f(w * x + b)` where `f` is given by `activation_fn`. If `activation_fn` is `None`, the result of `y = w * x + b` is returned. If `x` has shape [\\\(\\text{dim}_...
r"""Adds the parameters for a fully connected layer and returns the output.
[ "r", "Adds", "the", "parameters", "for", "a", "fully", "connected", "layer", "and", "returns", "the", "output", "." ]
def legacy_fully_connected(x, num_output_units, activation_fn=None, weight_init=initializers.xavier_initializer(), bias_init=init_ops.zeros_initializer(), name=None, ...
[ "def", "legacy_fully_connected", "(", "x", ",", "num_output_units", ",", "activation_fn", "=", "None", ",", "weight_init", "=", "initializers", ".", "xavier_initializer", "(", ")", ",", "bias_init", "=", "init_ops", ".", "zeros_initializer", "(", ")", ",", "name...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/layers/python/layers/layers.py#L2425-L2552
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
src/bindings/python/src/compatibility/ngraph/opset8/ops.py
python
matrix_nms
( boxes: NodeInput, scores: NodeInput, sort_result_type: str = "none", sort_result_across_batch: bool = False, output_type: str = "i64", score_threshold: float = 0.0, nms_top_k: int = -1, keep_top_k: int = -1, background_class: int = -1, de...
return _get_node_factory_opset8().create("MatrixNms", inputs, attributes)
Return a node which performs MatrixNms. @param boxes: Tensor with box coordinates. @param scores: Tensor with box scores. @param sort_result_type: Specifies order of output elements, possible values: 'class': sort selected boxes by class id (ascending) ...
Return a node which performs MatrixNms.
[ "Return", "a", "node", "which", "performs", "MatrixNms", "." ]
def matrix_nms( boxes: NodeInput, scores: NodeInput, sort_result_type: str = "none", sort_result_across_batch: bool = False, output_type: str = "i64", score_threshold: float = 0.0, nms_top_k: int = -1, keep_top_k: int = -1, background_class: int = ...
[ "def", "matrix_nms", "(", "boxes", ":", "NodeInput", ",", "scores", ":", "NodeInput", ",", "sort_result_type", ":", "str", "=", "\"none\"", ",", "sort_result_across_batch", ":", "bool", "=", "False", ",", "output_type", ":", "str", "=", "\"i64\"", ",", "scor...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/compatibility/ngraph/opset8/ops.py#L186-L243
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/asyncio/sslproto.py
python
SSLProtocol.eof_received
(self)
Called when the other end of the low-level stream is half-closed. If this returns a false value (including None), the transport will close itself. If it returns a true value, closing the transport is up to the protocol.
Called when the other end of the low-level stream is half-closed.
[ "Called", "when", "the", "other", "end", "of", "the", "low", "-", "level", "stream", "is", "half", "-", "closed", "." ]
def eof_received(self): """Called when the other end of the low-level stream is half-closed. If this returns a false value (including None), the transport will close itself. If it returns a true value, closing the transport is up to the protocol. """ try: ...
[ "def", "eof_received", "(", "self", ")", ":", "try", ":", "if", "self", ".", "_loop", ".", "get_debug", "(", ")", ":", "logger", ".", "debug", "(", "\"%r received EOF\"", ",", "self", ")", "self", ".", "_wakeup_waiter", "(", "ConnectionResetError", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/sslproto.py#L554-L574
google/mysql-protobuf
467cda676afaa49e762c5c9164a43f6ad31a1fbf
storage/ndb/mcc/request_handler.py
python
handle_executeCommandReq
(req, body)
return make_rep(req, {'out': start_proc(body['command'], body) })
Handler function for execCommandReq messages. Runs the process specified in by the command property.
Handler function for execCommandReq messages. Runs the process specified in by the command property.
[ "Handler", "function", "for", "execCommandReq", "messages", ".", "Runs", "the", "process", "specified", "in", "by", "the", "command", "property", "." ]
def handle_executeCommandReq(req, body): """Handler function for execCommandReq messages. Runs the process specified in by the command property.""" if body['command'].has_key('isCommand'): return make_rep(req, start_proc(body['command'], body)) return make_rep(req, {'out': start_proc(body['command'...
[ "def", "handle_executeCommandReq", "(", "req", ",", "body", ")", ":", "if", "body", "[", "'command'", "]", ".", "has_key", "(", "'isCommand'", ")", ":", "return", "make_rep", "(", "req", ",", "start_proc", "(", "body", "[", "'command'", "]", ",", "body",...
https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/storage/ndb/mcc/request_handler.py#L165-L170
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/pywxrc.py
python
XmlResourceCompiler.ReplaceFilenamesInXRC
(self, node, files, resourcePath)
Finds all files mentioned in resource file, e.g. <bitmap>filename</bitmap> and replaces them with the memory filenames. Fills a list of the filenames found.
Finds all files mentioned in resource file, e.g. <bitmap>filename</bitmap> and replaces them with the memory filenames. Fills a list of the filenames found.
[ "Finds", "all", "files", "mentioned", "in", "resource", "file", "e", ".", "g", ".", "<bitmap", ">", "filename<", "/", "bitmap", ">", "and", "replaces", "them", "with", "the", "memory", "filenames", ".", "Fills", "a", "list", "of", "the", "filenames", "fo...
def ReplaceFilenamesInXRC(self, node, files, resourcePath): """ Finds all files mentioned in resource file, e.g. <bitmap>filename</bitmap> and replaces them with the memory filenames. Fills a list of the filenames found.""" # Is 'node' XML node element? if node...
[ "def", "ReplaceFilenamesInXRC", "(", "self", ",", "node", ",", "files", ",", "resourcePath", ")", ":", "# Is 'node' XML node element?", "if", "node", "is", "None", ":", "return", "if", "node", ".", "nodeType", "!=", "minidom", ".", "Document", ".", "ELEMENT_NO...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/pywxrc.py#L684-L711
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/SConf.py
python
SConfBase.__init__
(self, env, custom_tests = {}, conf_dir='$CONFIGUREDIR', log_file='$CONFIGURELOG', config_h = None, _depth = 0)
Constructor. Pass additional tests in the custom_tests-dictionary, e.g. custom_tests={'CheckPrivate':MyPrivateTest}, where MyPrivateTest defines a custom test. Note also the conf_dir and log_file arguments (you may want to build tests in the VariantDir, not in the SourceDir)
Constructor. Pass additional tests in the custom_tests-dictionary, e.g. custom_tests={'CheckPrivate':MyPrivateTest}, where MyPrivateTest defines a custom test. Note also the conf_dir and log_file arguments (you may want to build tests in the VariantDir, not in the SourceDir)
[ "Constructor", ".", "Pass", "additional", "tests", "in", "the", "custom_tests", "-", "dictionary", "e", ".", "g", ".", "custom_tests", "=", "{", "CheckPrivate", ":", "MyPrivateTest", "}", "where", "MyPrivateTest", "defines", "a", "custom", "test", ".", "Note",...
def __init__(self, env, custom_tests = {}, conf_dir='$CONFIGUREDIR', log_file='$CONFIGURELOG', config_h = None, _depth = 0): """Constructor. Pass additional tests in the custom_tests-dictionary, e.g. custom_tests={'CheckPrivate':MyPrivateTest}, where MyPrivateTest defines a cust...
[ "def", "__init__", "(", "self", ",", "env", ",", "custom_tests", "=", "{", "}", ",", "conf_dir", "=", "'$CONFIGUREDIR'", ",", "log_file", "=", "'$CONFIGURELOG'", ",", "config_h", "=", "None", ",", "_depth", "=", "0", ")", ":", "global", "SConfFS", "# Now...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/SConf.py#L387-L462
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/google/protobuf/internal/well_known_types.py
python
Struct.get_or_create_list
(self, key)
return self.fields[key].list_value
Returns a list for this key, creating if it didn't exist already.
Returns a list for this key, creating if it didn't exist already.
[ "Returns", "a", "list", "for", "this", "key", "creating", "if", "it", "didn", "t", "exist", "already", "." ]
def get_or_create_list(self, key): """Returns a list for this key, creating if it didn't exist already.""" return self.fields[key].list_value
[ "def", "get_or_create_list", "(", "self", ",", "key", ")", ":", "return", "self", ".", "fields", "[", "key", "]", ".", "list_value" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/internal/well_known_types.py#L673-L675
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
deprecated/algorithms/sfm/OpenSfM/opensfm/multiview.py
python
vector_angle
(u, v)
Angle between two vectors. >>> u = [ 0.99500417, -0.33333333, -0.09983342] >>> v = [ 0.99500417, -0.33333333, -0.09983342] >>> vector_angle(u, v) 0.0
Angle between two vectors.
[ "Angle", "between", "two", "vectors", "." ]
def vector_angle(u, v): """Angle between two vectors. >>> u = [ 0.99500417, -0.33333333, -0.09983342] >>> v = [ 0.99500417, -0.33333333, -0.09983342] >>> vector_angle(u, v) 0.0 """ cos = np.dot(u, v) / math.sqrt(np.dot(u, u) * np.dot(v, v)) if cos >= 1.0: return 0.0 else: ...
[ "def", "vector_angle", "(", "u", ",", "v", ")", ":", "cos", "=", "np", ".", "dot", "(", "u", ",", "v", ")", "/", "math", ".", "sqrt", "(", "np", ".", "dot", "(", "u", ",", "u", ")", "*", "np", ".", "dot", "(", "v", ",", "v", ")", ")", ...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/multiview.py#L108-L120
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usdImaging/usdviewq/selectionDataModel.py
python
SelectionDataModel.getPrimInstances
(self)
return OrderedDict( (self._rootDataModel.stage.GetPrimAtPath(path), instance) for path, instance in self.getPrimPathInstances().items())
Get a dictionary which maps each prim whose path is selected to a set of its selected instances. If all of a path's instances are selected, the value is ALL_INSTANCES rather than a set.
Get a dictionary which maps each prim whose path is selected to a set of its selected instances. If all of a path's instances are selected, the value is ALL_INSTANCES rather than a set.
[ "Get", "a", "dictionary", "which", "maps", "each", "prim", "whose", "path", "is", "selected", "to", "a", "set", "of", "its", "selected", "instances", ".", "If", "all", "of", "a", "path", "s", "instances", "are", "selected", "the", "value", "is", "ALL_INS...
def getPrimInstances(self): """Get a dictionary which maps each prim whose path is selected to a set of its selected instances. If all of a path's instances are selected, the value is ALL_INSTANCES rather than a set. """ return OrderedDict( (self._rootDataModel.stage...
[ "def", "getPrimInstances", "(", "self", ")", ":", "return", "OrderedDict", "(", "(", "self", ".", "_rootDataModel", ".", "stage", ".", "GetPrimAtPath", "(", "path", ")", ",", "instance", ")", "for", "path", ",", "instance", "in", "self", ".", "getPrimPathI...
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/selectionDataModel.py#L736-L744
BUSEC/TumbleBit
55829dc75c36554e710e723dedb510d62a57ca0c
reference_implementation/tumblebit/ec.py
python
EC.load_private_key
(self, key_path)
Loads a private key from file at `key_path`
Loads a private key from file at `key_path`
[ "Loads", "a", "private", "key", "from", "file", "at", "key_path" ]
def load_private_key(self, key_path): """ Loads a private key from file at `key_path` """ with open(key_path, 'rb') as f: temp_key = f.read() self.key.set_privkey(temp_key) self.init = True self.is_private = True
[ "def", "load_private_key", "(", "self", ",", "key_path", ")", ":", "with", "open", "(", "key_path", ",", "'rb'", ")", "as", "f", ":", "temp_key", "=", "f", ".", "read", "(", ")", "self", ".", "key", ".", "set_privkey", "(", "temp_key", ")", "self", ...
https://github.com/BUSEC/TumbleBit/blob/55829dc75c36554e710e723dedb510d62a57ca0c/reference_implementation/tumblebit/ec.py#L39-L48
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/engine/data_adapter.py
python
DataAdapter.get_size
(self)
Return the size (number of batches) for the dataset created. For certain type of the data input, the number of batches is known, eg for Numpy data, the size is same as (number_of_element / batch_size). Whereas for dataset or python generator, the size is unknown since it may or may not have a end state...
Return the size (number of batches) for the dataset created.
[ "Return", "the", "size", "(", "number", "of", "batches", ")", "for", "the", "dataset", "created", "." ]
def get_size(self): """Return the size (number of batches) for the dataset created. For certain type of the data input, the number of batches is known, eg for Numpy data, the size is same as (number_of_element / batch_size). Whereas for dataset or python generator, the size is unknown since it may or m...
[ "def", "get_size", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/data_adapter.py#L139-L152
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
PySizer._setCallbackInfo
(*args, **kwargs)
return _core_.PySizer__setCallbackInfo(*args, **kwargs)
_setCallbackInfo(self, PyObject self, PyObject _class)
_setCallbackInfo(self, PyObject self, PyObject _class)
[ "_setCallbackInfo", "(", "self", "PyObject", "self", "PyObject", "_class", ")" ]
def _setCallbackInfo(*args, **kwargs): """_setCallbackInfo(self, PyObject self, PyObject _class)""" return _core_.PySizer__setCallbackInfo(*args, **kwargs)
[ "def", "_setCallbackInfo", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "PySizer__setCallbackInfo", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L15064-L15066
vslavik/poedit
f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a
deps/boost/tools/build/src/build/project.py
python
ProjectRegistry.module_name
(self, jamfile_location)
return module
Returns the name of module corresponding to 'jamfile-location'. If no module corresponds to location yet, associates default module name with that location.
Returns the name of module corresponding to 'jamfile-location'. If no module corresponds to location yet, associates default module name with that location.
[ "Returns", "the", "name", "of", "module", "corresponding", "to", "jamfile", "-", "location", ".", "If", "no", "module", "corresponds", "to", "location", "yet", "associates", "default", "module", "name", "with", "that", "location", "." ]
def module_name(self, jamfile_location): """Returns the name of module corresponding to 'jamfile-location'. If no module corresponds to location yet, associates default module name with that location.""" assert isinstance(jamfile_location, basestring) module = self.location2modul...
[ "def", "module_name", "(", "self", ",", "jamfile_location", ")", ":", "assert", "isinstance", "(", "jamfile_location", ",", "basestring", ")", "module", "=", "self", ".", "location2module", ".", "get", "(", "jamfile_location", ")", "if", "not", "module", ":", ...
https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/project.py#L221-L235
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/refactor.py
python
RefactoringTool.write_file
(self, new_text, filename, old_text, encoding=None)
Writes a string to a file. It first shows a unified diff between the old text and the new text, and then rewrites the file; the latter is only done if the write option is set.
Writes a string to a file.
[ "Writes", "a", "string", "to", "a", "file", "." ]
def write_file(self, new_text, filename, old_text, encoding=None): """Writes a string to a file. It first shows a unified diff between the old text and the new text, and then rewrites the file; the latter is only done if the write option is set. """ try: f = ...
[ "def", "write_file", "(", "self", ",", "new_text", ",", "filename", ",", "old_text", ",", "encoding", "=", "None", ")", ":", "try", ":", "f", "=", "_open_with_encoding", "(", "filename", ",", "\"w\"", ",", "encoding", "=", "encoding", ")", "except", "os"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/refactor.py#L528-L547
rsocket/rsocket-cpp
45ed594ebd6701f40795c31ec922d784ec7fc921
build/fbcode_builder/getdeps/cache.py
python
ArtifactCache.download_to_file
(self, name, dest_file_name)
return False
If `name` exists in the cache, download it and place it in the specified `dest_file_name` location on the filesystem. If a transient issue was encountered a TransientFailure shall be raised. If `name` doesn't exist in the cache `False` shall be returned. If `dest_file_name` was s...
If `name` exists in the cache, download it and place it in the specified `dest_file_name` location on the filesystem. If a transient issue was encountered a TransientFailure shall be raised. If `name` doesn't exist in the cache `False` shall be returned. If `dest_file_name` was s...
[ "If", "name", "exists", "in", "the", "cache", "download", "it", "and", "place", "it", "in", "the", "specified", "dest_file_name", "location", "on", "the", "filesystem", ".", "If", "a", "transient", "issue", "was", "encountered", "a", "TransientFailure", "shall...
def download_to_file(self, name, dest_file_name): """If `name` exists in the cache, download it and place it in the specified `dest_file_name` location on the filesystem. If a transient issue was encountered a TransientFailure shall be raised. If `name` doesn't exist in the cache...
[ "def", "download_to_file", "(", "self", ",", "name", ",", "dest_file_name", ")", ":", "return", "False" ]
https://github.com/rsocket/rsocket-cpp/blob/45ed594ebd6701f40795c31ec922d784ec7fc921/build/fbcode_builder/getdeps/cache.py#L15-L24
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/plugin.py
python
PluginData.Enable
(self, enable=True)
Enable the plugin @param enable: bool
Enable the plugin @param enable: bool
[ "Enable", "the", "plugin", "@param", "enable", ":", "bool" ]
def Enable(self, enable=True): """Enable the plugin @param enable: bool """ self._enabled = enabled
[ "def", "Enable", "(", "self", ",", "enable", "=", "True", ")", ":", "self", ".", "_enabled", "=", "enabled" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/plugin.py#L309-L314
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/gammaspec.py
python
GammaSpectrum.calc_ebins
(self)
Calculate the energy value for each channel.
Calculate the energy value for each channel.
[ "Calculate", "the", "energy", "value", "for", "each", "channel", "." ]
def calc_ebins(self): """Calculate the energy value for each channel.""" channels = self.channels = np.asarray(self.channels, float) self.ebin = self.calib_e_fit[0] + (self.calib_e_fit[1] * channels) + \ (self.calib_e_fit[2] * channels ** 2)
[ "def", "calc_ebins", "(", "self", ")", ":", "channels", "=", "self", ".", "channels", "=", "np", ".", "asarray", "(", "self", ".", "channels", ",", "float", ")", "self", ".", "ebin", "=", "self", ".", "calib_e_fit", "[", "0", "]", "+", "(", "self",...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/gammaspec.py#L35-L39
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
site_scons/site_tools/ninja.py
python
SConsToNinjaTranslator.action_to_ninja_build
(self, node, action=None)
return build
Generate build arguments dictionary for node.
Generate build arguments dictionary for node.
[ "Generate", "build", "arguments", "dictionary", "for", "node", "." ]
def action_to_ninja_build(self, node, action=None): """Generate build arguments dictionary for node.""" if not self.loaded_custom: self.func_handlers.update(self.env[NINJA_CUSTOM_HANDLERS]) self.loaded_custom = True if node.builder is None: return None ...
[ "def", "action_to_ninja_build", "(", "self", ",", "node", ",", "action", "=", "None", ")", ":", "if", "not", "self", ".", "loaded_custom", ":", "self", ".", "func_handlers", ".", "update", "(", "self", ".", "env", "[", "NINJA_CUSTOM_HANDLERS", "]", ")", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/site_scons/site_tools/ninja.py#L263-L308
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
BookCtrlBase.SetPageText
(*args, **kwargs)
return _core_.BookCtrlBase_SetPageText(*args, **kwargs)
SetPageText(self, size_t n, String strText) -> bool
SetPageText(self, size_t n, String strText) -> bool
[ "SetPageText", "(", "self", "size_t", "n", "String", "strText", ")", "-", ">", "bool" ]
def SetPageText(*args, **kwargs): """SetPageText(self, size_t n, String strText) -> bool""" return _core_.BookCtrlBase_SetPageText(*args, **kwargs)
[ "def", "SetPageText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "BookCtrlBase_SetPageText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L13554-L13556
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/iam/connection.py
python
IAMConnection.delete_account_alias
(self, alias)
return self.get_response('DeleteAccountAlias', params)
Deletes an alias for the AWS account. For more information on account id aliases, please see http://goo.gl/ToB7G :type alias: string :param alias: The alias to remove from the account.
Deletes an alias for the AWS account.
[ "Deletes", "an", "alias", "for", "the", "AWS", "account", "." ]
def delete_account_alias(self, alias): """ Deletes an alias for the AWS account. For more information on account id aliases, please see http://goo.gl/ToB7G :type alias: string :param alias: The alias to remove from the account. """ params = {'AccountAlia...
[ "def", "delete_account_alias", "(", "self", ",", "alias", ")", ":", "params", "=", "{", "'AccountAlias'", ":", "alias", "}", "return", "self", ".", "get_response", "(", "'DeleteAccountAlias'", ",", "params", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/iam/connection.py#L995-L1006
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
external_tools/ply_info/example/ansic/cparse.py
python
p_declaration_specifiers_1
(t)
declaration_specifiers : storage_class_specifier declaration_specifiers
declaration_specifiers : storage_class_specifier declaration_specifiers
[ "declaration_specifiers", ":", "storage_class_specifier", "declaration_specifiers" ]
def p_declaration_specifiers_1(t): 'declaration_specifiers : storage_class_specifier declaration_specifiers' pass
[ "def", "p_declaration_specifiers_1", "(", "t", ")", ":", "pass" ]
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/cparse.py#L73-L75
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
Argument.GetValidClientSideCmdArg
(self, func, offset, index)
return str(offset + 1)
Gets a valid value for this argument.
Gets a valid value for this argument.
[ "Gets", "a", "valid", "value", "for", "this", "argument", "." ]
def GetValidClientSideCmdArg(self, func, offset, index): """Gets a valid value for this argument.""" return str(offset + 1)
[ "def", "GetValidClientSideCmdArg", "(", "self", ",", "func", ",", "offset", ",", "index", ")", ":", "return", "str", "(", "offset", "+", "1", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L5793-L5795
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/script_ops.py
python
FuncRegistry._next_unique_token
(self)
return "pyfunc_%d" % uid
Returns a unique token.
Returns a unique token.
[ "Returns", "a", "unique", "token", "." ]
def _next_unique_token(self): """Returns a unique token.""" uid = self._unique_id self._unique_id += 1 return "pyfunc_%d" % uid
[ "def", "_next_unique_token", "(", "self", ")", ":", "uid", "=", "self", ".", "_unique_id", "self", ".", "_unique_id", "+=", "1", "return", "\"pyfunc_%d\"", "%", "uid" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/script_ops.py#L93-L97
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextParagraphLayoutBox.Invalidate
(*args, **kwargs)
return _richtext.RichTextParagraphLayoutBox_Invalidate(*args, **kwargs)
Invalidate(self, RichTextRange invalidRange=wxRICHTEXT_ALL)
Invalidate(self, RichTextRange invalidRange=wxRICHTEXT_ALL)
[ "Invalidate", "(", "self", "RichTextRange", "invalidRange", "=", "wxRICHTEXT_ALL", ")" ]
def Invalidate(*args, **kwargs): """Invalidate(self, RichTextRange invalidRange=wxRICHTEXT_ALL)""" return _richtext.RichTextParagraphLayoutBox_Invalidate(*args, **kwargs)
[ "def", "Invalidate", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextParagraphLayoutBox_Invalidate", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1850-L1852
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/common.py
python
title_case
(name)
return name[0:1].upper() + name[1:]
Return a CapitalCased version of a string.
Return a CapitalCased version of a string.
[ "Return", "a", "CapitalCased", "version", "of", "a", "string", "." ]
def title_case(name): # type: (str) -> str """Return a CapitalCased version of a string.""" # Only capitalize the last part of a fully-qualified name pos = name.rfind("::") if pos > -1: return name[:pos + 2] + name[pos + 2:pos + 3].upper() + name[pos + 3:] return name[0:1].upper() + na...
[ "def", "title_case", "(", "name", ")", ":", "# type: (str) -> str", "# Only capitalize the last part of a fully-qualified name", "pos", "=", "name", ".", "rfind", "(", "\"::\"", ")", "if", "pos", ">", "-", "1", ":", "return", "name", "[", ":", "pos", "+", "2",...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/common.py#L44-L53
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_distutils/core.py
python
run_commands
(dist)
return dist
Given a Distribution object run all the commands, raising ``SystemExit`` errors in the case of failure. This function assumes that either ``sys.argv`` or ``dist.script_args`` is already set accordingly.
Given a Distribution object run all the commands, raising ``SystemExit`` errors in the case of failure.
[ "Given", "a", "Distribution", "object", "run", "all", "the", "commands", "raising", "SystemExit", "errors", "in", "the", "case", "of", "failure", "." ]
def run_commands (dist): """Given a Distribution object run all the commands, raising ``SystemExit`` errors in the case of failure. This function assumes that either ``sys.argv`` or ``dist.script_args`` is already set accordingly. """ try: dist.run_commands() except KeyboardInterrup...
[ "def", "run_commands", "(", "dist", ")", ":", "try", ":", "dist", ".", "run_commands", "(", ")", "except", "KeyboardInterrupt", ":", "raise", "SystemExit", "(", "\"interrupted\"", ")", "except", "OSError", "as", "exc", ":", "if", "DEBUG", ":", "sys", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/core.py#L155-L180
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/trade_bin.py
python
TradeBin.turnover
(self, turnover)
Sets the turnover of this TradeBin. :param turnover: The turnover of this TradeBin. # noqa: E501 :type: float
Sets the turnover of this TradeBin.
[ "Sets", "the", "turnover", "of", "this", "TradeBin", "." ]
def turnover(self, turnover): """Sets the turnover of this TradeBin. :param turnover: The turnover of this TradeBin. # noqa: E501 :type: float """ self._turnover = turnover
[ "def", "turnover", "(", "self", ",", "turnover", ")", ":", "self", ".", "_turnover", "=", "turnover" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/trade_bin.py#L333-L341
baidu/AnyQ
d94d450d2aaa5f7ed73424b10aa4539835b97527
tools/simnet/preprocess/op_out.py
python
OperationOut.get_infos
(self)
return { 'qid': self._qid, 'query': self._query, 'title': self._title, 'label': self._label, 'query_token': self._query_tokens, 'title_token': self._title_tokens, 'data_type': self._data_type ...
Return all information
Return all information
[ "Return", "all", "information" ]
def get_infos(self): """ Return all information """ return { 'qid': self._qid, 'query': self._query, 'title': self._title, 'label': self._label, 'query_token': self._query_tokens, 'title_token...
[ "def", "get_infos", "(", "self", ")", ":", "return", "{", "'qid'", ":", "self", ".", "_qid", ",", "'query'", ":", "self", ".", "_query", ",", "'title'", ":", "self", ".", "_title", ",", "'label'", ":", "self", ".", "_label", ",", "'query_token'", ":"...
https://github.com/baidu/AnyQ/blob/d94d450d2aaa5f7ed73424b10aa4539835b97527/tools/simnet/preprocess/op_out.py#L74-L86
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mach/mach/commands/settings.py
python
Settings.create
(self)
Create an empty settings file with full documentation.
Create an empty settings file with full documentation.
[ "Create", "an", "empty", "settings", "file", "with", "full", "documentation", "." ]
def create(self): """Create an empty settings file with full documentation.""" wrapper = TextWrapper(initial_indent='# ', subsequent_indent='# ') for section in sorted(self.settings): print('[%s]' % section) print('') for option in sorted(self.settings[secti...
[ "def", "create", "(", "self", ")", ":", "wrapper", "=", "TextWrapper", "(", "initial_indent", "=", "'# '", ",", "subsequent_indent", "=", "'# '", ")", "for", "section", "in", "sorted", "(", "self", ".", "settings", ")", ":", "print", "(", "'[%s]'", "%", ...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mach/mach/commands/settings.py#L37-L50
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Explorer/Required_Suite.py
python
Required_Suite_Events.run
(self, _no_object=None, _attributes={}, **_arguments)
run: Keyword argument _attributes: AppleEvent attribute dictionary
run: Keyword argument _attributes: AppleEvent attribute dictionary
[ "run", ":", "Keyword", "argument", "_attributes", ":", "AppleEvent", "attribute", "dictionary" ]
def run(self, _no_object=None, _attributes={}, **_arguments): """run: Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'aevt' _subcode = 'oapp' if _arguments: raise TypeError, 'No optional args expected' if _no_object is not None: raise T...
[ "def", "run", "(", "self", ",", "_no_object", "=", "None", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'aevt'", "_subcode", "=", "'oapp'", "if", "_arguments", ":", "raise", "TypeError", ",", "'No optional args...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Explorer/Required_Suite.py#L75-L92
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/jinja2/filters.py
python
do_replace
(eval_ctx, s, old, new, count=None)
return s.replace(soft_unicode(old), soft_unicode(new), count)
Return a copy of the value with all occurrences of a substring replaced with a new one. The first argument is the substring that should be replaced, the second is the replacement string. If the optional third argument ``count`` is given, only the first ``count`` occurrences are replaced: .. sourcec...
Return a copy of the value with all occurrences of a substring replaced with a new one. The first argument is the substring that should be replaced, the second is the replacement string. If the optional third argument ``count`` is given, only the first ``count`` occurrences are replaced:
[ "Return", "a", "copy", "of", "the", "value", "with", "all", "occurrences", "of", "a", "substring", "replaced", "with", "a", "new", "one", ".", "The", "first", "argument", "is", "the", "substring", "that", "should", "be", "replaced", "the", "second", "is", ...
def do_replace(eval_ctx, s, old, new, count=None): """Return a copy of the value with all occurrences of a substring replaced with a new one. The first argument is the substring that should be replaced, the second is the replacement string. If the optional third argument ``count`` is given, only the fir...
[ "def", "do_replace", "(", "eval_ctx", ",", "s", ",", "old", ",", "new", ",", "count", "=", "None", ")", ":", "if", "count", "is", "None", ":", "count", "=", "-", "1", "if", "not", "eval_ctx", ".", "autoescape", ":", "return", "unicode", "(", "s", ...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/filters.py#L74-L98
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/config.py
python
MultiversionOptions.all_options
(cls)
return [cls.LAST_LTS, cls.LAST_CONTINUOUS]
Return available version options for multiversion.
Return available version options for multiversion.
[ "Return", "available", "version", "options", "for", "multiversion", "." ]
def all_options(cls): """Return available version options for multiversion.""" return [cls.LAST_LTS, cls.LAST_CONTINUOUS]
[ "def", "all_options", "(", "cls", ")", ":", "return", "[", "cls", ".", "LAST_LTS", ",", "cls", ".", "LAST_CONTINUOUS", "]" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/config.py#L263-L266
sigmaai/self-driving-golf-cart
8d891600af3d851add27a10ae45cf3c2108bb87c
ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/transforms.py
python
carla_rotation_to_numpy_rotation_matrix
(carla_rotation)
return rotation_matrix
Convert a carla rotation to a ROS quaternion Considers the conversion from left-handed system (unreal) to right-handed system (ROS). Considers the conversion from degrees (carla) to radians (ROS). :param carla_rotation: the carla rotation :type carla_rotation: carla.Rotation :return: a numpy.a...
Convert a carla rotation to a ROS quaternion
[ "Convert", "a", "carla", "rotation", "to", "a", "ROS", "quaternion" ]
def carla_rotation_to_numpy_rotation_matrix(carla_rotation): """ Convert a carla rotation to a ROS quaternion Considers the conversion from left-handed system (unreal) to right-handed system (ROS). Considers the conversion from degrees (carla) to radians (ROS). :param carla_rotation: the carla...
[ "def", "carla_rotation_to_numpy_rotation_matrix", "(", "carla_rotation", ")", ":", "roll", ",", "pitch", ",", "yaw", "=", "carla_rotation_to_RPY", "(", "carla_rotation", ")", "numpy_array", "=", "tf", ".", "transformations", ".", "euler_matrix", "(", "roll", ",", ...
https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/transforms.py#L154-L170
zhaoweicai/hwgq
ebc706bee3e2d145de1da4be446ce8de8740738f
scripts/cpp_lint.py
python
_SetVerboseLevel
(level)
return _cpplint_state.SetVerboseLevel(level)
Sets the module's verbosity, and returns the previous setting.
Sets the module's verbosity, and returns the previous setting.
[ "Sets", "the", "module", "s", "verbosity", "and", "returns", "the", "previous", "setting", "." ]
def _SetVerboseLevel(level): """Sets the module's verbosity, and returns the previous setting.""" return _cpplint_state.SetVerboseLevel(level)
[ "def", "_SetVerboseLevel", "(", "level", ")", ":", "return", "_cpplint_state", ".", "SetVerboseLevel", "(", "level", ")" ]
https://github.com/zhaoweicai/hwgq/blob/ebc706bee3e2d145de1da4be446ce8de8740738f/scripts/cpp_lint.py#L782-L784
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/logging/__init__.py
python
PercentStyle.validate
(self)
Validate the input format, ensure it matches the correct style
Validate the input format, ensure it matches the correct style
[ "Validate", "the", "input", "format", "ensure", "it", "matches", "the", "correct", "style" ]
def validate(self): """Validate the input format, ensure it matches the correct style""" if not self.validation_pattern.search(self._fmt): raise ValueError("Invalid format '%s' for '%s' style" % (self._fmt, self.default_format[0]))
[ "def", "validate", "(", "self", ")", ":", "if", "not", "self", ".", "validation_pattern", ".", "search", "(", "self", ".", "_fmt", ")", ":", "raise", "ValueError", "(", "\"Invalid format '%s' for '%s' style\"", "%", "(", "self", ".", "_fmt", ",", "self", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/logging/__init__.py#L424-L427
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/yaml/__init__.py
python
safe_dump_all
(documents, stream=None, **kwds)
return dump_all(documents, stream, Dumper=SafeDumper, **kwds)
Serialize a sequence of Python objects into a YAML stream. Produce only basic YAML tags. If stream is None, return the produced string instead.
Serialize a sequence of Python objects into a YAML stream. Produce only basic YAML tags. If stream is None, return the produced string instead.
[ "Serialize", "a", "sequence", "of", "Python", "objects", "into", "a", "YAML", "stream", ".", "Produce", "only", "basic", "YAML", "tags", ".", "If", "stream", "is", "None", "return", "the", "produced", "string", "instead", "." ]
def safe_dump_all(documents, stream=None, **kwds): """ Serialize a sequence of Python objects into a YAML stream. Produce only basic YAML tags. If stream is None, return the produced string instead. """ return dump_all(documents, stream, Dumper=SafeDumper, **kwds)
[ "def", "safe_dump_all", "(", "documents", ",", "stream", "=", "None", ",", "*", "*", "kwds", ")", ":", "return", "dump_all", "(", "documents", ",", "stream", ",", "Dumper", "=", "SafeDumper", ",", "*", "*", "kwds", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/yaml/__init__.py#L292-L298
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/training/supervisor.py
python
Supervisor._write_graph
(self)
Writes graph_def to `logdir` and adds it to summary if applicable.
Writes graph_def to `logdir` and adds it to summary if applicable.
[ "Writes", "graph_def", "to", "logdir", "and", "adds", "it", "to", "summary", "if", "applicable", "." ]
def _write_graph(self): """Writes graph_def to `logdir` and adds it to summary if applicable.""" assert self._is_chief if self._logdir: training_util.write_graph(self._graph.as_graph_def(add_shapes=True), self._logdir, "graph.pbtxt") if self._summary_writer and not ...
[ "def", "_write_graph", "(", "self", ")", ":", "assert", "self", ".", "_is_chief", "if", "self", ".", "_logdir", ":", "training_util", ".", "write_graph", "(", "self", ".", "_graph", ".", "as_graph_def", "(", "add_shapes", "=", "True", ")", ",", "self", "...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/supervisor.py#L607-L616
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/YouCompleteMe/third_party/jedi/jedi/parser/representation.py
python
SubModule.add_global
(self, name)
Global means in these context a function (subscope) which has a global statement. This is only relevant for the top scope. :param name: The name of the global. :type name: Name
Global means in these context a function (subscope) which has a global statement. This is only relevant for the top scope.
[ "Global", "means", "in", "these", "context", "a", "function", "(", "subscope", ")", "which", "has", "a", "global", "statement", ".", "This", "is", "only", "relevant", "for", "the", "top", "scope", "." ]
def add_global(self, name): """ Global means in these context a function (subscope) which has a global statement. This is only relevant for the top scope. :param name: The name of the global. :type name: Name """ # set no parent here, because globals are ...
[ "def", "add_global", "(", "self", ",", "name", ")", ":", "# set no parent here, because globals are not defined in this scope.", "self", ".", "global_vars", ".", "append", "(", "name", ")" ]
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/jedi/jedi/parser/representation.py#L342-L352
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextPrinting.GetHeaderText
(*args, **kwargs)
return _richtext.RichTextPrinting_GetHeaderText(*args, **kwargs)
GetHeaderText(self, int page=RICHTEXT_PAGE_EVEN, int location=RICHTEXT_PAGE_CENTRE) -> String
GetHeaderText(self, int page=RICHTEXT_PAGE_EVEN, int location=RICHTEXT_PAGE_CENTRE) -> String
[ "GetHeaderText", "(", "self", "int", "page", "=", "RICHTEXT_PAGE_EVEN", "int", "location", "=", "RICHTEXT_PAGE_CENTRE", ")", "-", ">", "String" ]
def GetHeaderText(*args, **kwargs): """GetHeaderText(self, int page=RICHTEXT_PAGE_EVEN, int location=RICHTEXT_PAGE_CENTRE) -> String""" return _richtext.RichTextPrinting_GetHeaderText(*args, **kwargs)
[ "def", "GetHeaderText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextPrinting_GetHeaderText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L4524-L4526
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py
python
Maildir.get_bytes
(self, key)
Return a bytes representation or raise a KeyError.
Return a bytes representation or raise a KeyError.
[ "Return", "a", "bytes", "representation", "or", "raise", "a", "KeyError", "." ]
def get_bytes(self, key): """Return a bytes representation or raise a KeyError.""" with open(os.path.join(self._path, self._lookup(key)), 'rb') as f: return f.read().replace(linesep, b'\n')
[ "def", "get_bytes", "(", "self", ",", "key", ")", ":", "with", "open", "(", "os", ".", "path", ".", "join", "(", "self", ".", "_path", ",", "self", ".", "_lookup", "(", "key", ")", ")", ",", "'rb'", ")", "as", "f", ":", "return", "f", ".", "r...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py#L385-L388
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/tools/gyp/pylib/gyp/mac_tool.py
python
MacTool.ExecCodeSignBundle
(self, key, entitlements, provisioning, path, preserve)
Code sign a bundle. This function tries to code sign an iOS bundle, following the same algorithm as Xcode: 1. pick the provisioning profile that best match the bundle identifier, and copy it into the bundle as embedded.mobileprovision, 2. copy Entitlements.plist from user or SDK next to th...
Code sign a bundle.
[ "Code", "sign", "a", "bundle", "." ]
def ExecCodeSignBundle(self, key, entitlements, provisioning, path, preserve): """Code sign a bundle. This function tries to code sign an iOS bundle, following the same algorithm as Xcode: 1. pick the provisioning profile that best match the bundle identifier, and copy it into the bundle as ...
[ "def", "ExecCodeSignBundle", "(", "self", ",", "key", ",", "entitlements", ",", "provisioning", ",", "path", ",", "preserve", ")", ":", "substitutions", ",", "overrides", "=", "self", ".", "_InstallProvisioningProfile", "(", "provisioning", ",", "self", ".", "...
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/mac_tool.py#L413-L434
H-uru/Plasma
c2140ea046e82e9c199e257a7f2e7edb42602871
Scripts/Python/plasma/Plasma.py
python
PtDebugPrint
(*msgs, **kwargs)
Prints msgs to the Python log given the message's level
Prints msgs to the Python log given the message's level
[ "Prints", "msgs", "to", "the", "Python", "log", "given", "the", "message", "s", "level" ]
def PtDebugPrint(*msgs, **kwargs): """Prints msgs to the Python log given the message's level""" pass
[ "def", "PtDebugPrint", "(", "*", "msgs", ",", "*", "*", "kwargs", ")", ":", "pass" ]
https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/plasma/Plasma.py#L175-L177
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
ManualHandler.WriteImmediateCmdGetTotalSize
(self, func, file)
Overrriden from TypeHandler.
Overrriden from TypeHandler.
[ "Overrriden", "from", "TypeHandler", "." ]
def WriteImmediateCmdGetTotalSize(self, func, file): """Overrriden from TypeHandler.""" # TODO(gman): Move this data to _FUNCTION_INFO? CustomHandler.WriteImmediateCmdGetTotalSize(self, func, file)
[ "def", "WriteImmediateCmdGetTotalSize", "(", "self", ",", "func", ",", "file", ")", ":", "# TODO(gman): Move this data to _FUNCTION_INFO?", "CustomHandler", ".", "WriteImmediateCmdGetTotalSize", "(", "self", ",", "func", ",", "file", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L3641-L3644
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/fusion/portableglobe/tools/check_crc.py
python
main
()
Main for check crc.
Main for check crc.
[ "Main", "for", "check", "crc", "." ]
def main(): """Main for check crc.""" if len(sys.argv) != 5: print ("usage: %s <globe_path> <num_imagery_packets> <num_terrain_packets>" " <num_vector_packets>") % sys.argv[0] print (" Packet numbers are first line of output from " "geportableglobebuilder.") print " E.g. %s globe...
[ "def", "main", "(", ")", ":", "if", "len", "(", "sys", ".", "argv", ")", "!=", "5", ":", "print", "(", "\"usage: %s <globe_path> <num_imagery_packets> <num_terrain_packets>\"", "\" <num_vector_packets>\"", ")", "%", "sys", ".", "argv", "[", "0", "]", "print", ...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/tools/check_crc.py#L98-L113
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/optimize/_minimize.py
python
minimize_scalar
(fun, bracket=None, bounds=None, args=(), method='brent', tol=None, options=None)
Minimization of scalar function of one variable. Parameters ---------- fun : callable Objective function. Scalar function, must return a scalar. bracket : sequence, optional For methods 'brent' and 'golden', `bracket` defines the bracketing interval and can either have t...
Minimization of scalar function of one variable.
[ "Minimization", "of", "scalar", "function", "of", "one", "variable", "." ]
def minimize_scalar(fun, bracket=None, bounds=None, args=(), method='brent', tol=None, options=None): """Minimization of scalar function of one variable. Parameters ---------- fun : callable Objective function. Scalar function, must return a scalar. bracket : seq...
[ "def", "minimize_scalar", "(", "fun", ",", "bracket", "=", "None", ",", "bounds", "=", "None", ",", "args", "=", "(", ")", ",", "method", "=", "'brent'", ",", "tol", "=", "None", ",", "options", "=", "None", ")", ":", "if", "not", "isinstance", "("...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/optimize/_minimize.py#L469-L618
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
CleanseComments
(line)
return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line)
Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed.
Removes //-comments and single-line C-style /* */ comments.
[ "Removes", "//", "-", "comments", "and", "single", "-", "line", "C", "-", "style", "/", "*", "*", "/", "comments", "." ]
def CleanseComments(line): """Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed. """ commentpos = line.find('//') if commentpos != -1 and not IsCppString(line[:commentpos]): line = line[:commentpos]...
[ "def", "CleanseComments", "(", "line", ")", ":", "commentpos", "=", "line", ".", "find", "(", "'//'", ")", "if", "commentpos", "!=", "-", "1", "and", "not", "IsCppString", "(", "line", "[", ":", "commentpos", "]", ")", ":", "line", "=", "line", "[", ...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L1408-L1421
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/yapf/yapf/yapflib/format_decision_state.py
python
FormatDecisionState._AddTokenOnNewline
(self, dry_run, must_split)
return penalty + 10
Adds a line break and necessary indentation. Appends the next token to the state and updates information necessary for indentation. Arguments: dry_run: (bool) Don't commit whitespace changes to the FormatToken if True. must_split: (bool) A newline was required before this token. R...
Adds a line break and necessary indentation.
[ "Adds", "a", "line", "break", "and", "necessary", "indentation", "." ]
def _AddTokenOnNewline(self, dry_run, must_split): """Adds a line break and necessary indentation. Appends the next token to the state and updates information necessary for indentation. Arguments: dry_run: (bool) Don't commit whitespace changes to the FormatToken if True. must_spli...
[ "def", "_AddTokenOnNewline", "(", "self", ",", "dry_run", ",", "must_split", ")", ":", "current", "=", "self", ".", "next_token", "previous", "=", "current", ".", "previous_token", "self", ".", "column", "=", "self", ".", "_GetNewlineColumn", "(", ")", "if",...
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/yapf/yapf/yapflib/format_decision_state.py#L472-L537
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Position.SetRow
(*args, **kwargs)
return _core_.Position_SetRow(*args, **kwargs)
SetRow(self, int row)
SetRow(self, int row)
[ "SetRow", "(", "self", "int", "row", ")" ]
def SetRow(*args, **kwargs): """SetRow(self, int row)""" return _core_.Position_SetRow(*args, **kwargs)
[ "def", "SetRow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Position_SetRow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L2098-L2100
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/google/protobuf/descriptor.py
python
OneofDescriptor.__init__
(self, name, full_name, index, containing_type, fields)
Arguments are as described in the attribute description above.
Arguments are as described in the attribute description above.
[ "Arguments", "are", "as", "described", "in", "the", "attribute", "description", "above", "." ]
def __init__(self, name, full_name, index, containing_type, fields): """Arguments are as described in the attribute description above.""" self.name = name self.full_name = full_name self.index = index self.containing_type = containing_type self.fields = fields
[ "def", "__init__", "(", "self", ",", "name", ",", "full_name", ",", "index", ",", "containing_type", ",", "fields", ")", ":", "self", ".", "name", "=", "name", "self", ".", "full_name", "=", "full_name", "self", ".", "index", "=", "index", "self", ".",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/descriptor.py#L689-L695
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/boost_1.75.0/tools/build/src/build/property_set.py
python
PropertySet.dependency
(self)
return self.dependency_
Returns dependency properties.
Returns dependency properties.
[ "Returns", "dependency", "properties", "." ]
def dependency (self): """ Returns dependency properties. """ result = [p for p in self.lazy_properties if p.feature.dependency] result.extend(self.dependency_) return self.dependency_
[ "def", "dependency", "(", "self", ")", ":", "result", "=", "[", "p", "for", "p", "in", "self", ".", "lazy_properties", "if", "p", ".", "feature", ".", "dependency", "]", "result", ".", "extend", "(", "self", ".", "dependency_", ")", "return", "self", ...
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/build/property_set.py#L283-L288
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/aui.py
python
AuiManager.__init__
(self, *args, **kwargs)
__init__(self, Window managedWnd=None, int flags=AUI_MGR_DEFAULT) -> AuiManager
__init__(self, Window managedWnd=None, int flags=AUI_MGR_DEFAULT) -> AuiManager
[ "__init__", "(", "self", "Window", "managedWnd", "=", "None", "int", "flags", "=", "AUI_MGR_DEFAULT", ")", "-", ">", "AuiManager" ]
def __init__(self, *args, **kwargs): """__init__(self, Window managedWnd=None, int flags=AUI_MGR_DEFAULT) -> AuiManager""" _aui.AuiManager_swiginit(self,_aui.new_AuiManager(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_aui", ".", "AuiManager_swiginit", "(", "self", ",", "_aui", ".", "new_AuiManager", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L589-L591
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
OutputStream.LastWrite
(*args, **kwargs)
return _core_.OutputStream_LastWrite(*args, **kwargs)
LastWrite(self) -> size_t
LastWrite(self) -> size_t
[ "LastWrite", "(", "self", ")", "-", ">", "size_t" ]
def LastWrite(*args, **kwargs): """LastWrite(self) -> size_t""" return _core_.OutputStream_LastWrite(*args, **kwargs)
[ "def", "LastWrite", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "OutputStream_LastWrite", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L2263-L2265
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/function_base.py
python
angle
(z, deg=False)
return a
Return the angle of the complex argument. Parameters ---------- z : array_like A complex number or sequence of complex numbers. deg : bool, optional Return angle in degrees if True, radians if False (default). Returns ------- angle : ndarray or scalar The counterclo...
Return the angle of the complex argument.
[ "Return", "the", "angle", "of", "the", "complex", "argument", "." ]
def angle(z, deg=False): """ Return the angle of the complex argument. Parameters ---------- z : array_like A complex number or sequence of complex numbers. deg : bool, optional Return angle in degrees if True, radians if False (default). Returns ------- angle : nda...
[ "def", "angle", "(", "z", ",", "deg", "=", "False", ")", ":", "z", "=", "asanyarray", "(", "z", ")", "if", "issubclass", "(", "z", ".", "dtype", ".", "type", ",", "_nx", ".", "complexfloating", ")", ":", "zimag", "=", "z", ".", "imag", "zreal", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/function_base.py#L1420-L1464
tzutalin/dlib-android
989627cb7fe81cd1d41d73434b0e91ce1dd2683f
tools/lint/cpplint.py
python
CheckInvalidIncrement
(filename, clean_lines, linenum, 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: filename: The name of the current file. ...
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: filename: The name of the current file. ...
[ "Checks", "for", "invalid", "increment", "*", "count", "++", ".", "For", "example", "following", "function", ":", "void", "increment_counter", "(", "int", "*", "count", ")", "{", "*", "count", "++", ";", "}", "is", "invalid", "because", "it", "effectively"...
def CheckInvalidIncrement(filename, clean_lines, linenum, 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)++ o...
[ "def", "CheckInvalidIncrement", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "_RE_PATTERN_INVALID_INCREMENT", ".", "match", "(", "line", ")", ":", "error", ...
https://github.com/tzutalin/dlib-android/blob/989627cb7fe81cd1d41d73434b0e91ce1dd2683f/tools/lint/cpplint.py#L1959-L1976
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/textwrap.py
python
TextWrapper.wrap
(self, text)
return self._wrap_chunks(chunks)
wrap(text : string) -> [string] Reformat the single paragraph in 'text' so it fits in lines of no more than 'self.width' columns, and return a list of wrapped lines. Tabs in 'text' are expanded with string.expandtabs(), and all other whitespace characters (including newline) are ...
wrap(text : string) -> [string]
[ "wrap", "(", "text", ":", "string", ")", "-", ">", "[", "string", "]" ]
def wrap(self, text): """wrap(text : string) -> [string] Reformat the single paragraph in 'text' so it fits in lines of no more than 'self.width' columns, and return a list of wrapped lines. Tabs in 'text' are expanded with string.expandtabs(), and all other whitespace characte...
[ "def", "wrap", "(", "self", ",", "text", ")", ":", "chunks", "=", "self", ".", "_split_chunks", "(", "text", ")", "if", "self", ".", "fix_sentence_endings", ":", "self", ".", "_fix_sentence_endings", "(", "chunks", ")", "return", "self", ".", "_wrap_chunks...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/textwrap.py#L342-L354
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillModel.py
python
DrillModel.importRundexData
(self)
Import data.
Import data.
[ "Import", "data", "." ]
def importRundexData(self): """ Import data. """ if self.rundexIO: self.rundexIO.load()
[ "def", "importRundexData", "(", "self", ")", ":", "if", "self", ".", "rundexIO", ":", "self", ".", "rundexIO", ".", "load", "(", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillModel.py#L566-L571
lilypond/lilypond
2a14759372979f5b796ee802b0ee3bc15d28b06b
scripts/build/output-distance.py
python
SystemLink.__init__
(self, system1: SystemSignature, system2: SystemSignature)
Init from two SystemSignature instances
Init from two SystemSignature instances
[ "Init", "from", "two", "SystemSignature", "instances" ]
def __init__(self, system1: SystemSignature, system2: SystemSignature): """Init from two SystemSignature instances""" self.system1 = system1 self.system2 = system2 self.link_list_dict: Dict[Optional[GrobSignature], List[GrobSignature]] = {} # ...
[ "def", "__init__", "(", "self", ",", "system1", ":", "SystemSignature", ",", "system2", ":", "SystemSignature", ")", ":", "self", ".", "system1", "=", "system1", "self", ".", "system2", "=", "system2", "self", ".", "link_list_dict", ":", "Dict", "[", "Opti...
https://github.com/lilypond/lilypond/blob/2a14759372979f5b796ee802b0ee3bc15d28b06b/scripts/build/output-distance.py#L305-L357
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
tools/pytorch-quantization/pytorch_quantization/quant_modules.py
python
initialize
(float_module_list=None, custom_quant_modules=None)
Dynamic module replacement using monkey patching. Dynamically monkey patches the modules with their quantized versions. Internally, the state is maintained by a helper class object which helps in replacing the original modules back. Args: float_module_list: A list. User supplied list which ind...
Dynamic module replacement using monkey patching.
[ "Dynamic", "module", "replacement", "using", "monkey", "patching", "." ]
def initialize(float_module_list=None, custom_quant_modules=None): """Dynamic module replacement using monkey patching. Dynamically monkey patches the modules with their quantized versions. Internally, the state is maintained by a helper class object which helps in replacing the original modules back. ...
[ "def", "initialize", "(", "float_module_list", "=", "None", ",", "custom_quant_modules", "=", "None", ")", ":", "_quant_module_helper_object", ".", "prepare_state", "(", "float_module_list", ",", "custom_quant_modules", ")", "_quant_module_helper_object", ".", "apply_quan...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/tools/pytorch-quantization/pytorch_quantization/quant_modules.py#L116-L142
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PGProperty.IsRoot
(*args, **kwargs)
return _propgrid.PGProperty_IsRoot(*args, **kwargs)
IsRoot(self) -> bool
IsRoot(self) -> bool
[ "IsRoot", "(", "self", ")", "-", ">", "bool" ]
def IsRoot(*args, **kwargs): """IsRoot(self) -> bool""" return _propgrid.PGProperty_IsRoot(*args, **kwargs)
[ "def", "IsRoot", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_IsRoot", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L588-L590
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Variable.__eq__
(self, other)
return self.__class__.__name__ == other.__class__.__name__ \ and self._name == other._name
Comparison for equality (==). Note: if the Variable's master matters to behavior also compare self._master == other._master
Comparison for equality (==).
[ "Comparison", "for", "equality", "(", "==", ")", "." ]
def __eq__(self, other): """Comparison for equality (==). Note: if the Variable's master matters to behavior also compare self._master == other._master """ return self.__class__.__name__ == other.__class__.__name__ \ and self._name == other._name
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "return", "self", ".", "__class__", ".", "__name__", "==", "other", ".", "__class__", ".", "__name__", "and", "self", ".", "_name", "==", "other", ".", "_name" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L265-L272
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urlparse.py
python
parse_qs
(qs, keep_blank_values=0, strict_parsing=0)
return dict
Parse a query given as a string argument. Arguments: qs: percent-encoded query string to be parsed keep_blank_values: flag indicating whether blank values in percent-encoded queries should be treated as blank strings. A true value indicates that blanks should be retain...
Parse a query given as a string argument.
[ "Parse", "a", "query", "given", "as", "a", "string", "argument", "." ]
def parse_qs(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument. Arguments: qs: percent-encoded query string to be parsed keep_blank_values: flag indicating whether blank values in percent-encoded queries should be treated as blank strings....
[ "def", "parse_qs", "(", "qs", ",", "keep_blank_values", "=", "0", ",", "strict_parsing", "=", "0", ")", ":", "dict", "=", "{", "}", "for", "name", ",", "value", "in", "parse_qsl", "(", "qs", ",", "keep_blank_values", ",", "strict_parsing", ")", ":", "i...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urlparse.py#L363-L387
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py
python
PrecompiledHeader._PchOutput
(self)
return '${pchprefix}.' + self._PchHeader() + '.pch'
Get the name of the output of the compiled pch data.
Get the name of the output of the compiled pch data.
[ "Get", "the", "name", "of", "the", "output", "of", "the", "compiled", "pch", "data", "." ]
def _PchOutput(self): """Get the name of the output of the compiled pch data.""" return '${pchprefix}.' + self._PchHeader() + '.pch'
[ "def", "_PchOutput", "(", "self", ")", ":", "return", "'${pchprefix}.'", "+", "self", ".", "_PchHeader", "(", ")", "+", "'.pch'" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py#L573-L575
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMS_TIME_ATTEST_INFO.initFromTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def initFromTpm(self, buf): """ TpmMarshaller method """ self.time = TPMS_TIME_INFO.fromTpm(buf) self.firmwareVersion = buf.readInt64()
[ "def", "initFromTpm", "(", "self", ",", "buf", ")", ":", "self", ".", "time", "=", "TPMS_TIME_INFO", ".", "fromTpm", "(", "buf", ")", "self", ".", "firmwareVersion", "=", "buf", ".", "readInt64", "(", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L5085-L5088
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/keras/python/keras/wrappers/scikit_learn.py
python
KerasRegressor.score
(self, x, y, **kwargs)
return loss
Returns the mean loss on the given test data and labels. Arguments: x: array-like, shape `(n_samples, n_features)` Test samples where n_samples in the number of samples and n_features is the number of features. y: array-like, shape `(n_samples,)` True labels for ...
Returns the mean loss on the given test data and labels.
[ "Returns", "the", "mean", "loss", "on", "the", "given", "test", "data", "and", "labels", "." ]
def score(self, x, y, **kwargs): """Returns the mean loss on the given test data and labels. Arguments: x: array-like, shape `(n_samples, n_features)` Test samples where n_samples in the number of samples and n_features is the number of features. y: array-like, shape `(n...
[ "def", "score", "(", "self", ",", "x", ",", "y", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "self", ".", "filter_sk_params", "(", "Sequential", ".", "evaluate", ",", "kwargs", ")", "loss", "=", "self", ".", "model", ".", "evaluate", "(", "x"...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/wrappers/scikit_learn.py#L336-L356
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/vcs/__init__.py
python
VcsSupport.get_backend_type
(self, location)
return None
Return the type of the version control backend if found at given location, e.g. vcs.get_backend_type('/path/to/vcs/checkout')
Return the type of the version control backend if found at given location, e.g. vcs.get_backend_type('/path/to/vcs/checkout')
[ "Return", "the", "type", "of", "the", "version", "control", "backend", "if", "found", "at", "given", "location", "e", ".", "g", ".", "vcs", ".", "get_backend_type", "(", "/", "path", "/", "to", "/", "vcs", "/", "checkout", ")" ]
def get_backend_type(self, location): # type: (str) -> Optional[Type[VersionControl]] """ Return the type of the version control backend if found at given location, e.g. vcs.get_backend_type('/path/to/vcs/checkout') """ for vc_type in self._registry.values(): ...
[ "def", "get_backend_type", "(", "self", ",", "location", ")", ":", "# type: (str) -> Optional[Type[VersionControl]]", "for", "vc_type", "in", "self", ".", "_registry", ".", "values", "(", ")", ":", "if", "vc_type", ".", "controls_location", "(", "location", ")", ...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/vcs/__init__.py#L155-L166
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
DateTime.GetMonth
(*args, **kwargs)
return _misc_.DateTime_GetMonth(*args, **kwargs)
GetMonth(self, wxDateTime::TimeZone tz=LOCAL_TZ) -> int
GetMonth(self, wxDateTime::TimeZone tz=LOCAL_TZ) -> int
[ "GetMonth", "(", "self", "wxDateTime", "::", "TimeZone", "tz", "=", "LOCAL_TZ", ")", "-", ">", "int" ]
def GetMonth(*args, **kwargs): """GetMonth(self, wxDateTime::TimeZone tz=LOCAL_TZ) -> int""" return _misc_.DateTime_GetMonth(*args, **kwargs)
[ "def", "GetMonth", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_GetMonth", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L3981-L3983
dicecco1/fpga_caffe
7a191704efd7873071cfef35772d7e7bf3e3cfd6
python/caffe/io.py
python
Transformer.set_raw_scale
(self, in_, scale)
Set the scale of raw features s.t. the input blob = input * scale. While Python represents images in [0, 1], certain Caffe models like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale of these models must be 255. Parameters ---------- in_ : which input ...
Set the scale of raw features s.t. the input blob = input * scale. While Python represents images in [0, 1], certain Caffe models like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale of these models must be 255.
[ "Set", "the", "scale", "of", "raw", "features", "s", ".", "t", ".", "the", "input", "blob", "=", "input", "*", "scale", ".", "While", "Python", "represents", "images", "in", "[", "0", "1", "]", "certain", "Caffe", "models", "like", "CaffeNet", "and", ...
def set_raw_scale(self, in_, scale): """ Set the scale of raw features s.t. the input blob = input * scale. While Python represents images in [0, 1], certain Caffe models like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale of these models must be 255. ...
[ "def", "set_raw_scale", "(", "self", ",", "in_", ",", "scale", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "self", ".", "raw_scale", "[", "in_", "]", "=", "scale" ]
https://github.com/dicecco1/fpga_caffe/blob/7a191704efd7873071cfef35772d7e7bf3e3cfd6/python/caffe/io.py#L221-L234
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/mesh.py
python
_structured_find_idx
(dims, ijk)
return n
Helper method fo structured_get_vertex and structured_get_hex. For tuple (i,j,k), return the number N in the appropriate iterator.
Helper method fo structured_get_vertex and structured_get_hex.
[ "Helper", "method", "fo", "structured_get_vertex", "and", "structured_get_hex", "." ]
def _structured_find_idx(dims, ijk): """Helper method fo structured_get_vertex and structured_get_hex. For tuple (i,j,k), return the number N in the appropriate iterator. """ dim0 = [0] * 3 for i in range(0, 3): if (dims[i] > ijk[i] or dims[i + 3] <= ijk[i]): raise MeshError(st...
[ "def", "_structured_find_idx", "(", "dims", ",", "ijk", ")", ":", "dim0", "=", "[", "0", "]", "*", "3", "for", "i", "in", "range", "(", "0", ",", "3", ")", ":", "if", "(", "dims", "[", "i", "]", ">", "ijk", "[", "i", "]", "or", "dims", "[",...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/mesh.py#L1768-L1783
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
DC.GetSizeTuple
(*args, **kwargs)
return _gdi_.DC_GetSizeTuple(*args, **kwargs)
GetSizeTuple() -> (width, height) This gets the horizontal and vertical resolution in device units. It can be used to scale graphics to fit the page. For example, if *maxX* and *maxY* represent the maximum horizontal and vertical 'pixel' values used in your application, the following co...
GetSizeTuple() -> (width, height)
[ "GetSizeTuple", "()", "-", ">", "(", "width", "height", ")" ]
def GetSizeTuple(*args, **kwargs): """ GetSizeTuple() -> (width, height) This gets the horizontal and vertical resolution in device units. It can be used to scale graphics to fit the page. For example, if *maxX* and *maxY* represent the maximum horizontal and vertical 'pixel' va...
[ "def", "GetSizeTuple", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_GetSizeTuple", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L4173-L4189
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
QueryLayoutInfoEvent.SetAlignment
(*args, **kwargs)
return _windows_.QueryLayoutInfoEvent_SetAlignment(*args, **kwargs)
SetAlignment(self, int align)
SetAlignment(self, int align)
[ "SetAlignment", "(", "self", "int", "align", ")" ]
def SetAlignment(*args, **kwargs): """SetAlignment(self, int align)""" return _windows_.QueryLayoutInfoEvent_SetAlignment(*args, **kwargs)
[ "def", "SetAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "QueryLayoutInfoEvent_SetAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L1989-L1991
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/bz2.py
python
BZ2File.close
(self)
Flush and close the file. May be called more than once without error. Once the file is closed, any other operation on it will raise a ValueError.
Flush and close the file.
[ "Flush", "and", "close", "the", "file", "." ]
def close(self): """Flush and close the file. May be called more than once without error. Once the file is closed, any other operation on it will raise a ValueError. """ with self._lock: if self._mode == _MODE_CLOSED: return try: ...
[ "def", "close", "(", "self", ")", ":", "with", "self", ".", "_lock", ":", "if", "self", ".", "_mode", "==", "_MODE_CLOSED", ":", "return", "try", ":", "if", "self", ".", "_mode", "==", "_MODE_READ", ":", "self", ".", "_buffer", ".", "close", "(", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/bz2.py#L108-L131
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/cookies.py
python
merge_cookies
(cookiejar, cookies)
return cookiejar
Add cookies to cookiejar and returns a merged CookieJar. :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. :rtype: CookieJar
Add cookies to cookiejar and returns a merged CookieJar.
[ "Add", "cookies", "to", "cookiejar", "and", "returns", "a", "merged", "CookieJar", "." ]
def merge_cookies(cookiejar, cookies): """Add cookies to cookiejar and returns a merged CookieJar. :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. :rtype: CookieJar """ if not isinstance(cookiejar, cookielib.CookieJar): ...
[ "def", "merge_cookies", "(", "cookiejar", ",", "cookies", ")", ":", "if", "not", "isinstance", "(", "cookiejar", ",", "cookielib", ".", "CookieJar", ")", ":", "raise", "ValueError", "(", "'You can only merge into CookieJar'", ")", "if", "isinstance", "(", "cooki...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/cookies.py#L529-L549
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
cd/utils/artifact_repository.py
python
probe_commit_id
()
return commit_id
Probes the system in an attempt to ascertain the mxnet commit id :return: The commit id, or None if not found
Probes the system in an attempt to ascertain the mxnet commit id :return: The commit id, or None if not found
[ "Probes", "the", "system", "in", "an", "attempt", "to", "ascertain", "the", "mxnet", "commit", "id", ":", "return", ":", "The", "commit", "id", "or", "None", "if", "not", "found" ]
def probe_commit_id() -> str: """ Probes the system in an attempt to ascertain the mxnet commit id :return: The commit id, or None if not found """ logger.debug('Probing for commit id') commit_id = os.environ.get('MXNET_SHA') if not commit_id: logger.debug('MXNET_SHA environment vari...
[ "def", "probe_commit_id", "(", ")", "->", "str", ":", "logger", ".", "debug", "(", "'Probing for commit id'", ")", "commit_id", "=", "os", ".", "environ", ".", "get", "(", "'MXNET_SHA'", ")", "if", "not", "commit_id", ":", "logger", ".", "debug", "(", "'...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/cd/utils/artifact_repository.py#L144-L161
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/data/ops/dataset_ops.py
python
CacheDataset.__init__
(self, input_dataset, filename)
See `Dataset.cache()` for details.
See `Dataset.cache()` for details.
[ "See", "Dataset", ".", "cache", "()", "for", "details", "." ]
def __init__(self, input_dataset, filename): """See `Dataset.cache()` for details.""" super(CacheDataset, self).__init__() self._input_dataset = input_dataset self._filename = ops.convert_to_tensor( filename, dtype=dtypes.string, name="filename")
[ "def", "__init__", "(", "self", ",", "input_dataset", ",", "filename", ")", ":", "super", "(", "CacheDataset", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "_input_dataset", "=", "input_dataset", "self", ".", "_filename", "=", "ops", ".", "c...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/data/ops/dataset_ops.py#L1096-L1101
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py
python
SpawnBase.expect_exact
(self, pattern_list, timeout=-1, searchwindowsize=-1, async_=False, **kw)
This is similar to expect(), but uses plain string matching instead of compiled regular expressions in 'pattern_list'. The 'pattern_list' may be a string; a list or other sequence of strings; or TIMEOUT and EOF. This call might be faster than expect() for two reasons: string sea...
This is similar to expect(), but uses plain string matching instead of compiled regular expressions in 'pattern_list'. The 'pattern_list' may be a string; a list or other sequence of strings; or TIMEOUT and EOF.
[ "This", "is", "similar", "to", "expect", "()", "but", "uses", "plain", "string", "matching", "instead", "of", "compiled", "regular", "expressions", "in", "pattern_list", ".", "The", "pattern_list", "may", "be", "a", "string", ";", "a", "list", "or", "other",...
def expect_exact(self, pattern_list, timeout=-1, searchwindowsize=-1, async_=False, **kw): '''This is similar to expect(), but uses plain string matching instead of compiled regular expressions in 'pattern_list'. The 'pattern_list' may be a string; a list or other sequence ...
[ "def", "expect_exact", "(", "self", ",", "pattern_list", ",", "timeout", "=", "-", "1", ",", "searchwindowsize", "=", "-", "1", ",", "async_", "=", "False", ",", "*", "*", "kw", ")", ":", "if", "timeout", "==", "-", "1", ":", "timeout", "=", "self"...
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py#L371-L418
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/v7.9.317/third_party/jinja2/nativetypes.py
python
NativeCodeGenerator.visit_Output
(self, node, frame)
Same as :meth:`CodeGenerator.visit_Output`, but do not call ``to_string`` on output nodes in generated code.
Same as :meth:`CodeGenerator.visit_Output`, but do not call ``to_string`` on output nodes in generated code.
[ "Same", "as", ":", "meth", ":", "CodeGenerator", ".", "visit_Output", "but", "do", "not", "call", "to_string", "on", "output", "nodes", "in", "generated", "code", "." ]
def visit_Output(self, node, frame): """Same as :meth:`CodeGenerator.visit_Output`, but do not call ``to_string`` on output nodes in generated code. """ if self.has_known_extends and frame.require_output_check: return finalize = self.environment.finalize fina...
[ "def", "visit_Output", "(", "self", ",", "node", ",", "frame", ")", ":", "if", "self", ".", "has_known_extends", "and", "frame", ".", "require_output_check", ":", "return", "finalize", "=", "self", ".", "environment", ".", "finalize", "finalize_context", "=", ...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/nativetypes.py#L39-L195
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/traitlets/py2/traitlets/config/loader.py
python
KeyValueConfigLoader.load_config
(self, argv=None, aliases=None, flags=None)
return self.config
Parse the configuration and generate the Config object. After loading, any arguments that are not key-value or flags will be stored in self.extra_args - a list of unparsed command-line arguments. This is used for arguments such as input files or subcommands. Parameters ...
Parse the configuration and generate the Config object.
[ "Parse", "the", "configuration", "and", "generate", "the", "Config", "object", "." ]
def load_config(self, argv=None, aliases=None, flags=None): """Parse the configuration and generate the Config object. After loading, any arguments that are not key-value or flags will be stored in self.extra_args - a list of unparsed command-line arguments. This is used for ar...
[ "def", "load_config", "(", "self", ",", "argv", "=", "None", ",", "aliases", "=", "None", ",", "flags", "=", "None", ")", ":", "self", ".", "clear", "(", ")", "if", "argv", "is", "None", ":", "argv", "=", "self", ".", "argv", "if", "aliases", "is...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py2/traitlets/config/loader.py#L613-L686
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/distributions/uniform.py
python
Uniform.high
(self)
return self._high
Upper boundary of the output interval.
Upper boundary of the output interval.
[ "Upper", "boundary", "of", "the", "output", "interval", "." ]
def high(self): """Upper boundary of the output interval.""" return self._high
[ "def", "high", "(", "self", ")", ":", "return", "self", ".", "_high" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/distributions/uniform.py#L133-L135
JavierIH/zowi
830c1284154b8167c9131deb9c45189fd9e67b54
code/python-client/Oscillator.py
python
Oscillator.stop
(self)
Stop de oscillator
Stop de oscillator
[ "Stop", "de", "oscillator" ]
def stop(self): """Stop de oscillator""" #-- Build the frame frame = self.dir + CMD_STOP + CMD_END #-- Debug print(frame) #-- Send the frame self.sp.write(frame)
[ "def", "stop", "(", "self", ")", ":", "#-- Build the frame", "frame", "=", "self", ".", "dir", "+", "CMD_STOP", "+", "CMD_END", "#-- Debug", "print", "(", "frame", ")", "#-- Send the frame", "self", ".", "sp", ".", "write", "(", "frame", ")" ]
https://github.com/JavierIH/zowi/blob/830c1284154b8167c9131deb9c45189fd9e67b54/code/python-client/Oscillator.py#L55-L65
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
build/android/pylib/android_commands.py
python
AndroidCommands.ExtractPid
(self, process_name)
return pids
Extracts Process Ids for a given process name from Android Shell. Args: process_name: name of the process on the device. Returns: List of all the process ids (as strings) that match the given name. If the name of a process exactly matches the given name, the pid of that process will be...
Extracts Process Ids for a given process name from Android Shell.
[ "Extracts", "Process", "Ids", "for", "a", "given", "process", "name", "from", "Android", "Shell", "." ]
def ExtractPid(self, process_name): """Extracts Process Ids for a given process name from Android Shell. Args: process_name: name of the process on the device. Returns: List of all the process ids (as strings) that match the given name. If the name of a process exactly matches the given ...
[ "def", "ExtractPid", "(", "self", ",", "process_name", ")", ":", "pids", "=", "[", "]", "for", "line", "in", "self", ".", "RunShellCommand", "(", "'ps'", ",", "log_result", "=", "False", ")", ":", "data", "=", "line", ".", "split", "(", ")", "try", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/android_commands.py#L1446-L1468
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/tape.py
python
could_possibly_record
()
return not pywrap_tensorflow.TFE_Py_TapeSetIsEmpty()
Returns True if any tape is active.
Returns True if any tape is active.
[ "Returns", "True", "if", "any", "tape", "is", "active", "." ]
def could_possibly_record(): """Returns True if any tape is active.""" return not pywrap_tensorflow.TFE_Py_TapeSetIsEmpty()
[ "def", "could_possibly_record", "(", ")", ":", "return", "not", "pywrap_tensorflow", ".", "TFE_Py_TapeSetIsEmpty", "(", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/tape.py#L146-L148