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
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/metrics/python/ops/metric_ops.py
python
streaming_mean_tensor
(values, weights=None, metrics_collections=None, updates_collections=None, name=None)
Computes the element-wise (weighted) mean of the given tensors. In contrast to the `streaming_mean` function which returns a scalar with the mean, this function returns an average tensor with the same shape as the input tensors. The `streaming_mean_tensor` function creates two local variables, `total_tenso...
Computes the element-wise (weighted) mean of the given tensors.
[ "Computes", "the", "element", "-", "wise", "(", "weighted", ")", "mean", "of", "the", "given", "tensors", "." ]
def streaming_mean_tensor(values, weights=None, metrics_collections=None, updates_collections=None, name=None): """Computes the element-wise (weighted) mean of the given tensors. In contrast to the `streaming_mean` function which returns a scalar with the mean, this function returns an...
[ "def", "streaming_mean_tensor", "(", "values", ",", "weights", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ")", ":", "with", "variable_scope", ".", "variable_op_scope", "(", "[", "val...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/metrics/python/ops/metric_ops.py#L307-L380
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/ragged/ragged_conversion_ops.py
python
_ragged_tensor_from_variant_grad
(op, *grads)
return [ gen_ragged_conversion_ops.ragged_tensor_to_variant( rt_nested_splits=op.outputs[:-1], rt_dense_values=grads[-1], batched_input=batched_input) ]
Gradient for RaggedTensorFromVariant op.
Gradient for RaggedTensorFromVariant op.
[ "Gradient", "for", "RaggedTensorFromVariant", "op", "." ]
def _ragged_tensor_from_variant_grad(op, *grads): """Gradient for RaggedTensorFromVariant op.""" variant_rank = op.inputs[0].shape.rank if variant_rank == 0: batched_input = False elif variant_rank == 1: batched_input = True elif variant_rank is None: batched_input = (op.get_attr("output_ragged_r...
[ "def", "_ragged_tensor_from_variant_grad", "(", "op", ",", "*", "grads", ")", ":", "variant_rank", "=", "op", ".", "inputs", "[", "0", "]", ".", "shape", ".", "rank", "if", "variant_rank", "==", "0", ":", "batched_input", "=", "False", "elif", "variant_ran...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ragged/ragged_conversion_ops.py#L145-L165
facebook/folly
744a0a698074d1b013813065fe60f545aa2c9b94
build/fbcode_builder/CMake/make_fbpy_archive.py
python
build_zipapp
(args, path_map)
Create a self executing python binary using Python 3's built-in zipapp module. This type of Python binary is relatively simple, as zipapp is part of the standard library, but it does not support native language extensions (.so/.dll files).
Create a self executing python binary using Python 3's built-in zipapp module.
[ "Create", "a", "self", "executing", "python", "binary", "using", "Python", "3", "s", "built", "-", "in", "zipapp", "module", "." ]
def build_zipapp(args, path_map): """Create a self executing python binary using Python 3's built-in zipapp module. This type of Python binary is relatively simple, as zipapp is part of the standard library, but it does not support native language extensions (.so/.dll files). """ dest_dir =...
[ "def", "build_zipapp", "(", "args", ",", "path_map", ")", ":", "dest_dir", "=", "os", ".", "path", ".", "dirname", "(", "args", ".", "output", ")", "with", "tempfile", ".", "TemporaryDirectory", "(", "prefix", "=", "\"make_fbpy.\"", ",", "dir", "=", "des...
https://github.com/facebook/folly/blob/744a0a698074d1b013813065fe60f545aa2c9b94/build/fbcode_builder/CMake/make_fbpy_archive.py#L126-L143
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/plat-mac/findertools.py
python
filesharing
()
return status
return the current status of filesharing and whether it is starting up or not: -1 file sharing is off and not starting up 0 file sharing is off and starting up 1 file sharing is on
return the current status of filesharing and whether it is starting up or not: -1 file sharing is off and not starting up 0 file sharing is off and starting up 1 file sharing is on
[ "return", "the", "current", "status", "of", "filesharing", "and", "whether", "it", "is", "starting", "up", "or", "not", ":", "-", "1", "file", "sharing", "is", "off", "and", "not", "starting", "up", "0", "file", "sharing", "is", "off", "and", "starting",...
def filesharing(): """return the current status of filesharing and whether it is starting up or not: -1 file sharing is off and not starting up 0 file sharing is off and starting up 1 file sharing is on""" status = -1 finder = _getfinder() # see if it is on args = {} ...
[ "def", "filesharing", "(", ")", ":", "status", "=", "-", "1", "finder", "=", "_getfinder", "(", ")", "# see if it is on", "args", "=", "{", "}", "attrs", "=", "{", "}", "args", "[", "'----'", "]", "=", "aetypes", ".", "ObjectSpecifier", "(", "want", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/findertools.py#L652-L681
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/docs/service.py
python
DocsService.CreateFolder
(self, title, folder_or_uri=None)
return folder_entry
Creates a folder in the Document List feed. Args: title: string The title of the folder on the server after being created. folder_or_uri: DocumentListEntry or string (optional) An object with a link to a folder or a uri to a folder to upload to. Note: A valid uri for a folder is of ...
Creates a folder in the Document List feed.
[ "Creates", "a", "folder", "in", "the", "Document", "List", "feed", "." ]
def CreateFolder(self, title, folder_or_uri=None): """Creates a folder in the Document List feed. Args: title: string The title of the folder on the server after being created. folder_or_uri: DocumentListEntry or string (optional) An object with a link to a folder or a uri to a folder to ...
[ "def", "CreateFolder", "(", "self", ",", "title", ",", "folder_or_uri", "=", "None", ")", ":", "if", "folder_or_uri", ":", "try", ":", "uri", "=", "folder_or_uri", ".", "content", ".", "src", "except", "AttributeError", ":", "uri", "=", "folder_or_uri", "e...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/docs/service.py#L363-L391
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/utils/comhack.py
python
_myimport
(name, globals=None, locals=None, fromlist=None)
Tell all modules to imported by McMillan's (or Python's) import.method, besides win32com modules automatically genrated by win32com.gencache
Tell all modules to imported by McMillan's (or Python's) import.method, besides win32com modules automatically genrated by win32com.gencache
[ "Tell", "all", "modules", "to", "imported", "by", "McMillan", "s", "(", "or", "Python", "s", ")", "import", ".", "method", "besides", "win32com", "modules", "automatically", "genrated", "by", "win32com", ".", "gencache" ]
def _myimport(name, globals=None, locals=None, fromlist=None): """ Tell all modules to imported by McMillan's (or Python's) import.method, besides win32com modules automatically genrated by win32com.gencache """ try: #fails with ImportError, if McMillan has overwritten Python's native import #an...
[ "def", "_myimport", "(", "name", ",", "globals", "=", "None", ",", "locals", "=", "None", ",", "fromlist", "=", "None", ")", ":", "try", ":", "#fails with ImportError, if McMillan has overwritten Python's native import", "#and win32com.gen_py tries to generate a module", ...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/utils/comhack.py#L33-L48
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/ao/quantization/fx/utils.py
python
node_return_type_is_int
(node: Node)
return node.op == 'call_method' and node.target == 'size'
Returns true if this node results in an integer, even if some of the args are Tensors.
Returns true if this node results in an integer, even if some of the args are Tensors.
[ "Returns", "true", "if", "this", "node", "results", "in", "an", "integer", "even", "if", "some", "of", "the", "args", "are", "Tensors", "." ]
def node_return_type_is_int(node: Node) -> bool: """ Returns true if this node results in an integer, even if some of the args are Tensors. """ return node.op == 'call_method' and node.target == 'size'
[ "def", "node_return_type_is_int", "(", "node", ":", "Node", ")", "->", "bool", ":", "return", "node", ".", "op", "==", "'call_method'", "and", "node", ".", "target", "==", "'size'" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/quantization/fx/utils.py#L459-L464
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/share/gdb/python/gdb/types.py
python
deep_items
(type_)
Return an iterator that recursively traverses anonymous fields. Arguments: type_: The type to traverse. It should be one of gdb.TYPE_CODE_STRUCT or gdb.TYPE_CODE_UNION. Returns: an iterator similar to gdb.Type.iteritems(), i.e., it returns pairs of key, value, but for any anon...
Return an iterator that recursively traverses anonymous fields.
[ "Return", "an", "iterator", "that", "recursively", "traverses", "anonymous", "fields", "." ]
def deep_items (type_): """Return an iterator that recursively traverses anonymous fields. Arguments: type_: The type to traverse. It should be one of gdb.TYPE_CODE_STRUCT or gdb.TYPE_CODE_UNION. Returns: an iterator similar to gdb.Type.iteritems(), i.e., it returns pairs ...
[ "def", "deep_items", "(", "type_", ")", ":", "for", "k", ",", "v", "in", "type_", ".", "iteritems", "(", ")", ":", "if", "k", ":", "yield", "k", ",", "v", "else", ":", "for", "i", "in", "deep_items", "(", "v", ".", "type", ")", ":", "yield", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/share/gdb/python/gdb/types.py#L94-L111
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/Netscape/Standard_Suite.py
python
Standard_Suite_Events.close
(self, _object, _attributes={}, **_arguments)
close: Close an object Required argument: the objects to close Keyword argument _attributes: AppleEvent attribute dictionary
close: Close an object Required argument: the objects to close Keyword argument _attributes: AppleEvent attribute dictionary
[ "close", ":", "Close", "an", "object", "Required", "argument", ":", "the", "objects", "to", "close", "Keyword", "argument", "_attributes", ":", "AppleEvent", "attribute", "dictionary" ]
def close(self, _object, _attributes={}, **_arguments): """close: Close an object Required argument: the objects to close Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'core' _subcode = 'clos' if _arguments: raise TypeError, 'No option...
[ "def", "close", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'core'", "_subcode", "=", "'clos'", "if", "_arguments", ":", "raise", "TypeError", ",", "'No optional args expected'", "_a...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/Netscape/Standard_Suite.py#L16-L34
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/processing/script/ScriptTemplate.py
python
ExampleProcessingAlgorithm.shortHelpString
(self)
return self.tr("Example algorithm short description")
Returns a localised short helper string for the algorithm. This string should provide a basic description about what the algorithm does and the parameters and outputs associated with it..
Returns a localised short helper string for the algorithm. This string should provide a basic description about what the algorithm does and the parameters and outputs associated with it..
[ "Returns", "a", "localised", "short", "helper", "string", "for", "the", "algorithm", ".", "This", "string", "should", "provide", "a", "basic", "description", "about", "what", "the", "algorithm", "does", "and", "the", "parameters", "and", "outputs", "associated",...
def shortHelpString(self): """ Returns a localised short helper string for the algorithm. This string should provide a basic description about what the algorithm does and the parameters and outputs associated with it.. """ return self.tr("Example algorithm short descripti...
[ "def", "shortHelpString", "(", "self", ")", ":", "return", "self", ".", "tr", "(", "\"Example algorithm short description\"", ")" ]
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/processing/script/ScriptTemplate.py#L88-L94
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
URI.setAuthority
(self, authority)
Set the authority part of an URI.
Set the authority part of an URI.
[ "Set", "the", "authority", "part", "of", "an", "URI", "." ]
def setAuthority(self, authority): """Set the authority part of an URI. """ libxml2mod.xmlURISetAuthority(self._o, authority)
[ "def", "setAuthority", "(", "self", ",", "authority", ")", ":", "libxml2mod", ".", "xmlURISetAuthority", "(", "self", ".", "_o", ",", "authority", ")" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L7015-L7017
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Environment.py
python
Base.NoClean
(self, *targets)
return tlist
Tags a target so that it will not be cleaned by -c
Tags a target so that it will not be cleaned by -c
[ "Tags", "a", "target", "so", "that", "it", "will", "not", "be", "cleaned", "by", "-", "c" ]
def NoClean(self, *targets): """Tags a target so that it will not be cleaned by -c""" tlist = [] for t in targets: tlist.extend(self.arg2nodes(t, self.fs.Entry)) for t in tlist: t.set_noclean() return tlist
[ "def", "NoClean", "(", "self", ",", "*", "targets", ")", ":", "tlist", "=", "[", "]", "for", "t", "in", "targets", ":", "tlist", ".", "extend", "(", "self", ".", "arg2nodes", "(", "t", ",", "self", ".", "fs", ".", "Entry", ")", ")", "for", "t",...
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Environment.py#L1995-L2002
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sarray.py
python
SArray.cumulative_std
(self)
return SArray(_proxy = self.__proxy__.builtin_cumulative_aggregate(agg_op))
Return the cumulative standard deviation of the elements in the SArray. Returns an SArray where each element in the output corresponds to the standard deviation of all the elements preceding and including it. The SArray is expected to be of numeric type, or a numeric vector type. Retur...
Return the cumulative standard deviation of the elements in the SArray.
[ "Return", "the", "cumulative", "standard", "deviation", "of", "the", "elements", "in", "the", "SArray", "." ]
def cumulative_std(self): """ Return the cumulative standard deviation of the elements in the SArray. Returns an SArray where each element in the output corresponds to the standard deviation of all the elements preceding and including it. The SArray is expected to be of numeric ...
[ "def", "cumulative_std", "(", "self", ")", ":", "from", ".", ".", "import", "extensions", "agg_op", "=", "\"__builtin__cum_std__\"", "return", "SArray", "(", "_proxy", "=", "self", ".", "__proxy__", ".", "builtin_cumulative_aggregate", "(", "agg_op", ")", ")" ]
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sarray.py#L4114-L4141
cksystemsgroup/scal
fa2208a97a77d65f4e90f85fef3404c27c1f2ac2
tools/cpplint.py
python
Error
(filename, linenum, category, confidence, message)
Logs the fact we've found a lint error. We log where the error was found, and also our confidence in the error, that is, how certain we are this is a legitimate style regression, and not a misidentification or a use that's sometimes justified. False positives can be suppressed by the use of "cpplint(categor...
Logs the fact we've found a lint error.
[ "Logs", "the", "fact", "we", "ve", "found", "a", "lint", "error", "." ]
def Error(filename, linenum, category, confidence, message): """Logs the fact we've found a lint error. We log where the error was found, and also our confidence in the error, that is, how certain we are this is a legitimate style regression, and not a misidentification or a use that's sometimes justified. ...
[ "def", "Error", "(", "filename", ",", "linenum", ",", "category", ",", "confidence", ",", "message", ")", ":", "if", "_ShouldPrintError", "(", "category", ",", "confidence", ",", "linenum", ")", ":", "_cpplint_state", ".", "IncrementErrorCount", "(", "category...
https://github.com/cksystemsgroup/scal/blob/fa2208a97a77d65f4e90f85fef3404c27c1f2ac2/tools/cpplint.py#L1092-L1124
vgough/encfs
c444f9b9176beea1ad41a7b2e29ca26e709b57f7
vendor/github.com/muflihun/easyloggingpp/tools/cpplint.py
python
FileInfo.IsSource
(self)
return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx')
File has a source file extension.
File has a source file extension.
[ "File", "has", "a", "source", "file", "extension", "." ]
def IsSource(self): """File has a source file extension.""" return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx')
[ "def", "IsSource", "(", "self", ")", ":", "return", "self", ".", "Extension", "(", ")", "[", "1", ":", "]", "in", "(", "'c'", ",", "'cc'", ",", "'cpp'", ",", "'cxx'", ")" ]
https://github.com/vgough/encfs/blob/c444f9b9176beea1ad41a7b2e29ca26e709b57f7/vendor/github.com/muflihun/easyloggingpp/tools/cpplint.py#L933-L935
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/parso/py3/parso/pgen2/generator.py
python
_calculate_tree_traversal
(nonterminal_to_dfas)
By this point we know how dfas can move around within a stack node, but we don't know how we can add a new stack node (nonterminal transitions).
By this point we know how dfas can move around within a stack node, but we don't know how we can add a new stack node (nonterminal transitions).
[ "By", "this", "point", "we", "know", "how", "dfas", "can", "move", "around", "within", "a", "stack", "node", "but", "we", "don", "t", "know", "how", "we", "can", "add", "a", "new", "stack", "node", "(", "nonterminal", "transitions", ")", "." ]
def _calculate_tree_traversal(nonterminal_to_dfas): """ By this point we know how dfas can move around within a stack node, but we don't know how we can add a new stack node (nonterminal transitions). """ # Map from grammar rule (nonterminal) name to a set of tokens. first_plans = {} nonter...
[ "def", "_calculate_tree_traversal", "(", "nonterminal_to_dfas", ")", ":", "# Map from grammar rule (nonterminal) name to a set of tokens.", "first_plans", "=", "{", "}", "nonterminals", "=", "list", "(", "nonterminal_to_dfas", ".", "keys", "(", ")", ")", "nonterminals", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/parso/py3/parso/pgen2/generator.py#L302-L349
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
parserCtxt.parseXMLDecl
(self)
parse an XML declaration header [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
parse an XML declaration header [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
[ "parse", "an", "XML", "declaration", "header", "[", "23", "]", "XMLDecl", "::", "=", "<?xml", "VersionInfo", "EncodingDecl?", "SDDecl?", "S?", "?", ">" ]
def parseXMLDecl(self): """parse an XML declaration header [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' """ libxml2mod.xmlParseXMLDecl(self._o)
[ "def", "parseXMLDecl", "(", "self", ")", ":", "libxml2mod", ".", "xmlParseXMLDecl", "(", "self", ".", "_o", ")" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L5485-L5488
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/nfs/module.py
python
Module._cmd_nfs_cluster_config_get
(self, cluster_id: str)
return self.nfs.get_nfs_cluster_config(cluster_id=cluster_id)
Fetch NFS-Ganesha config
Fetch NFS-Ganesha config
[ "Fetch", "NFS", "-", "Ganesha", "config" ]
def _cmd_nfs_cluster_config_get(self, cluster_id: str) -> Tuple[int, str, str]: """Fetch NFS-Ganesha config""" return self.nfs.get_nfs_cluster_config(cluster_id=cluster_id)
[ "def", "_cmd_nfs_cluster_config_get", "(", "self", ",", "cluster_id", ":", "str", ")", "->", "Tuple", "[", "int", ",", "str", ",", "str", "]", ":", "return", "self", ".", "nfs", ".", "get_nfs_cluster_config", "(", "cluster_id", "=", "cluster_id", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/nfs/module.py#L126-L128
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/pathlib.py
python
Path.glob
(self, pattern)
Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern.
Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern.
[ "Iterate", "over", "this", "subtree", "and", "yield", "all", "existing", "files", "(", "of", "any", "kind", "including", "directories", ")", "matching", "the", "given", "relative", "pattern", "." ]
def glob(self, pattern): """Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern. """ if not pattern: raise ValueError("Unacceptable pattern: {!r}".format(pattern)) drv, root, pattern_parts = s...
[ "def", "glob", "(", "self", ",", "pattern", ")", ":", "if", "not", "pattern", ":", "raise", "ValueError", "(", "\"Unacceptable pattern: {!r}\"", ".", "format", "(", "pattern", ")", ")", "drv", ",", "root", ",", "pattern_parts", "=", "self", ".", "_flavour"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pathlib.py#L1115-L1126
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/tlslite/tlslite/utils/RSAKey.py
python
RSAKey.hash
(self)
Return the cryptoID <keyHash> value corresponding to this key. @rtype: str
Return the cryptoID <keyHash> value corresponding to this key.
[ "Return", "the", "cryptoID", "<keyHash", ">", "value", "corresponding", "to", "this", "key", "." ]
def hash(self): """Return the cryptoID <keyHash> value corresponding to this key. @rtype: str """ raise NotImplementedError()
[ "def", "hash", "(", "self", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/tlslite/tlslite/utils/RSAKey.py#L47-L53
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/dataview.py
python
DataViewRenderer.SetOwner
(*args, **kwargs)
return _dataview.DataViewRenderer_SetOwner(*args, **kwargs)
SetOwner(self, DataViewColumn owner)
SetOwner(self, DataViewColumn owner)
[ "SetOwner", "(", "self", "DataViewColumn", "owner", ")" ]
def SetOwner(*args, **kwargs): """SetOwner(self, DataViewColumn owner)""" return _dataview.DataViewRenderer_SetOwner(*args, **kwargs)
[ "def", "SetOwner", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewRenderer_SetOwner", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1149-L1151
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/html.py
python
HtmlWinParser.GetContainer
(*args, **kwargs)
return _html.HtmlWinParser_GetContainer(*args, **kwargs)
GetContainer(self) -> HtmlContainerCell
GetContainer(self) -> HtmlContainerCell
[ "GetContainer", "(", "self", ")", "-", ">", "HtmlContainerCell" ]
def GetContainer(*args, **kwargs): """GetContainer(self) -> HtmlContainerCell""" return _html.HtmlWinParser_GetContainer(*args, **kwargs)
[ "def", "GetContainer", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlWinParser_GetContainer", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L272-L274
RobotLocomotion/drake
0e18a34604c45ed65bc9018a54f7610f91cdad5b
tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/show_hydroelastic_contact.py
python
HydroelasticContactVisualizer.update_uv_transform
(self, xform: vtk.vtkTransformTextureCoords)
Updates the uv transform to reflect the current pressure range settings. Args: xform: The transform to apply to the texture coordinates.
Updates the uv transform to reflect the current pressure range settings.
[ "Updates", "the", "uv", "transform", "to", "reflect", "the", "current", "pressure", "range", "settings", "." ]
def update_uv_transform(self, xform: vtk.vtkTransformTextureCoords): """Updates the uv transform to reflect the current pressure range settings. Args: xform: The transform to apply to the texture coordinates.""" # Conceptually, we map the interval [min, max] -> [0, 1]. To ac...
[ "def", "update_uv_transform", "(", "self", ",", "xform", ":", "vtk", ".", "vtkTransformTextureCoords", ")", ":", "# Conceptually, we map the interval [min, max] -> [0, 1]. To achieve", "# this we simply translate and scale the pressure domain to the texture", "# coordinate domain. We use...
https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/show_hydroelastic_contact.py#L967-L990
PyMesh/PyMesh
384ba882b7558ba6e8653ed263c419226c22bddf
python/pymesh/wires/WireNetwork.py
python
WireNetwork.create_empty
(cls)
return cls()
Handy factory method to create an empty wire network.
Handy factory method to create an empty wire network.
[ "Handy", "factory", "method", "to", "create", "an", "empty", "wire", "network", "." ]
def create_empty(cls): """ Handy factory method to create an empty wire network. """ return cls()
[ "def", "create_empty", "(", "cls", ")", ":", "return", "cls", "(", ")" ]
https://github.com/PyMesh/PyMesh/blob/384ba882b7558ba6e8653ed263c419226c22bddf/python/pymesh/wires/WireNetwork.py#L48-L51
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/median-of-two-sorted-arrays.py
python
Solution.findMedianSortedArrays
(self, nums1, nums2)
:type nums1: List[int] :type nums2: List[int] :rtype: float
:type nums1: List[int] :type nums2: List[int] :rtype: float
[ ":", "type", "nums1", ":", "List", "[", "int", "]", ":", "type", "nums2", ":", "List", "[", "int", "]", ":", "rtype", ":", "float" ]
def findMedianSortedArrays(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: float """ len1, len2 = len(nums1), len(nums2) if (len1 + len2) % 2 == 1: return self.getKth(nums1, nums2, (len1 + len2)/2 + 1) else: ...
[ "def", "findMedianSortedArrays", "(", "self", ",", "nums1", ",", "nums2", ")", ":", "len1", ",", "len2", "=", "len", "(", "nums1", ")", ",", "len", "(", "nums2", ")", "if", "(", "len1", "+", "len2", ")", "%", "2", "==", "1", ":", "return", "self"...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/median-of-two-sorted-arrays.py#L5-L16
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
src/icebox/icebox_py/__init__.py
python
Thread.process
(self)
return Process(libicebox.thread_process(self.thread))
Return thread processus.
Return thread processus.
[ "Return", "thread", "processus", "." ]
def process(self): """Return thread processus.""" return Process(libicebox.thread_process(self.thread))
[ "def", "process", "(", "self", ")", ":", "return", "Process", "(", "libicebox", ".", "thread_process", "(", "self", ".", "thread", ")", ")" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/src/icebox/icebox_py/__init__.py#L431-L433
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/thumbnailctrl.py
python
ScrolledThumbnail.Rotate
(self, angle=90)
Rotates the selected thumbnails by the angle specified by `angle`. :param `angle`: the rotation angle for the thumbnail, in degrees.
Rotates the selected thumbnails by the angle specified by `angle`.
[ "Rotates", "the", "selected", "thumbnails", "by", "the", "angle", "specified", "by", "angle", "." ]
def Rotate(self, angle=90): """ Rotates the selected thumbnails by the angle specified by `angle`. :param `angle`: the rotation angle for the thumbnail, in degrees. """ wx.BeginBusyCursor() count = 0 selected = [] for ii in xrange(len(s...
[ "def", "Rotate", "(", "self", ",", "angle", "=", "90", ")", ":", "wx", ".", "BeginBusyCursor", "(", ")", "count", "=", "0", "selected", "=", "[", "]", "for", "ii", "in", "xrange", "(", "len", "(", "self", ".", "_items", ")", ")", ":", "if", "se...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/thumbnailctrl.py#L2442-L2485
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/window/rolling.py
python
BaseWindow._get_window_indexer
(self)
return FixedWindowIndexer(window_size=self.window)
Return an indexer class that will compute the window start and end bounds
Return an indexer class that will compute the window start and end bounds
[ "Return", "an", "indexer", "class", "that", "will", "compute", "the", "window", "start", "and", "end", "bounds" ]
def _get_window_indexer(self) -> BaseIndexer: """ Return an indexer class that will compute the window start and end bounds """ if isinstance(self.window, BaseIndexer): return self.window if self._win_freq_i8 is not None: return VariableWindowIndexer( ...
[ "def", "_get_window_indexer", "(", "self", ")", "->", "BaseIndexer", ":", "if", "isinstance", "(", "self", ".", "window", ",", "BaseIndexer", ")", ":", "return", "self", ".", "window", "if", "self", ".", "_win_freq_i8", "is", "not", "None", ":", "return", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/window/rolling.py#L378-L390
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/gan/python/features/python/virtual_batchnorm_impl.py
python
VBN.__call__
(self, inputs)
Run virtual batch normalization on inputs. Args: inputs: Tensor input. Returns: A virtual batch normalized version of `inputs`. Raises: ValueError: If `inputs` shape isn't compatible with the reference batch.
Run virtual batch normalization on inputs.
[ "Run", "virtual", "batch", "normalization", "on", "inputs", "." ]
def __call__(self, inputs): """Run virtual batch normalization on inputs. Args: inputs: Tensor input. Returns: A virtual batch normalized version of `inputs`. Raises: ValueError: If `inputs` shape isn't compatible with the reference batch. """ _validate_call_input([inputs,...
[ "def", "__call__", "(", "self", ",", "inputs", ")", ":", "_validate_call_input", "(", "[", "inputs", ",", "self", ".", "_reference_batch", "]", ",", "self", ".", "_batch_axis", ")", "with", "ops", ".", "name_scope", "(", "self", ".", "_vs", ".", "name", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/gan/python/features/python/virtual_batchnorm_impl.py#L274-L306
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/generators/visitors/InstanceEventVisitor.py
python
InstanceEventVisitor.DictBodyVisit
(self, obj, topology_model)
Defined to generate the body of the Python event class @param obj: the instance of the event model to operation on.
Defined to generate the body of the Python event class
[ "Defined", "to", "generate", "the", "body", "of", "the", "Python", "event", "class" ]
def DictBodyVisit(self, obj, topology_model): """ Defined to generate the body of the Python event class @param obj: the instance of the event model to operation on. """ try: instance_obj_list = topology_model.get_base_id_dict()[ obj.get_component_bas...
[ "def", "DictBodyVisit", "(", "self", ",", "obj", ",", "topology_model", ")", ":", "try", ":", "instance_obj_list", "=", "topology_model", ".", "get_base_id_dict", "(", ")", "[", "obj", ".", "get_component_base_name", "(", ")", "]", "except", "Exception", ":", ...
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/InstanceEventVisitor.py#L150-L236
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextBuffer.AddHandler
(*args, **kwargs)
return _richtext.RichTextBuffer_AddHandler(*args, **kwargs)
AddHandler(RichTextFileHandler handler)
AddHandler(RichTextFileHandler handler)
[ "AddHandler", "(", "RichTextFileHandler", "handler", ")" ]
def AddHandler(*args, **kwargs): """AddHandler(RichTextFileHandler handler)""" return _richtext.RichTextBuffer_AddHandler(*args, **kwargs)
[ "def", "AddHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextBuffer_AddHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L2549-L2551
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/showutil/TexMemWatcher.py
python
TexPlacement.intersects
(self, other)
return (tl < mr and tr > ml and tb < mt and tt > mb)
Returns True if the placements intersect, False otherwise.
Returns True if the placements intersect, False otherwise.
[ "Returns", "True", "if", "the", "placements", "intersect", "False", "otherwise", "." ]
def intersects(self, other): """ Returns True if the placements intersect, False otherwise. """ ml, mr, mb, mt = self.p tl, tr, tb, tt = other.p return (tl < mr and tr > ml and tb < mt and tt > mb)
[ "def", "intersects", "(", "self", ",", "other", ")", ":", "ml", ",", "mr", ",", "mb", ",", "mt", "=", "self", ".", "p", "tl", ",", "tr", ",", "tb", ",", "tt", "=", "other", ".", "p", "return", "(", "tl", "<", "mr", "and", "tr", ">", "ml", ...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showutil/TexMemWatcher.py#L1226-L1234
mysql/mysql-router
cc0179f982bb9739a834eb6fd205a56224616133
ext/gmock/scripts/upload.py
python
SplitPatch
(data)
return patches
Splits a patch into separate pieces for each file. Args: data: A string containing the output of svn diff. Returns: A list of 2-tuple (filename, text) where text is the svn diff output pertaining to filename.
Splits a patch into separate pieces for each file.
[ "Splits", "a", "patch", "into", "separate", "pieces", "for", "each", "file", "." ]
def SplitPatch(data): """Splits a patch into separate pieces for each file. Args: data: A string containing the output of svn diff. Returns: A list of 2-tuple (filename, text) where text is the svn diff output pertaining to filename. """ patches = [] filename = None diff = [] for line in...
[ "def", "SplitPatch", "(", "data", ")", ":", "patches", "=", "[", "]", "filename", "=", "None", "diff", "=", "[", "]", "for", "line", "in", "data", ".", "splitlines", "(", "True", ")", ":", "new_filename", "=", "None", "if", "line", ".", "startswith",...
https://github.com/mysql/mysql-router/blob/cc0179f982bb9739a834eb6fd205a56224616133/ext/gmock/scripts/upload.py#L1141-L1178
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/client/timeline.py
python
Timeline._alloc_pid
(self)
return pid
Allocate a process Id.
Allocate a process Id.
[ "Allocate", "a", "process", "Id", "." ]
def _alloc_pid(self): """Allocate a process Id.""" pid = self._next_pid self._next_pid += 1 return pid
[ "def", "_alloc_pid", "(", "self", ")", ":", "pid", "=", "self", ".", "_next_pid", "self", ".", "_next_pid", "+=", "1", "return", "pid" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/client/timeline.py#L375-L379
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
FWCore/ParameterSet/python/VarParsing.py
python
VarParsing.setNoCommaSplit
(self, name, value=True)
Tells lists to not split up values by commas.
Tells lists to not split up values by commas.
[ "Tells", "lists", "to", "not", "split", "up", "values", "by", "commas", "." ]
def setNoCommaSplit (self, name, value=True): """Tells lists to not split up values by commas.""" if name not in self._register: print("Error: '%s' not registered." \ % name) raise RuntimeError("Unknown variable") if self._register[name] != VarParsing.m...
[ "def", "setNoCommaSplit", "(", "self", ",", "name", ",", "value", "=", "True", ")", ":", "if", "name", "not", "in", "self", ".", "_register", ":", "print", "(", "\"Error: '%s' not registered.\"", "%", "name", ")", "raise", "RuntimeError", "(", "\"Unknown va...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/FWCore/ParameterSet/python/VarParsing.py#L328-L337
zerollzeng/tiny-tensorrt
e7bdb8f82934342a0f22ce68dfefdb8e15eb72b2
third_party/pybind11/tools/clang/cindex.py
python
TranslationUnit.cursor
(self)
return conf.lib.clang_getTranslationUnitCursor(self)
Retrieve the cursor that represents the given translation unit.
Retrieve the cursor that represents the given translation unit.
[ "Retrieve", "the", "cursor", "that", "represents", "the", "given", "translation", "unit", "." ]
def cursor(self): """Retrieve the cursor that represents the given translation unit.""" return conf.lib.clang_getTranslationUnitCursor(self)
[ "def", "cursor", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getTranslationUnitCursor", "(", "self", ")" ]
https://github.com/zerollzeng/tiny-tensorrt/blob/e7bdb8f82934342a0f22ce68dfefdb8e15eb72b2/third_party/pybind11/tools/clang/cindex.py#L2576-L2578
NeoGeographyToolkit/StereoPipeline
eedf54a919fb5cce1ab0e280bb0df4050763aa11
src/asp/IceBridge/icebridge_common.py
python
xmlFile
(filename)
return filename + '.xml'
Return the matching xml file path for the input file.
Return the matching xml file path for the input file.
[ "Return", "the", "matching", "xml", "file", "path", "for", "the", "input", "file", "." ]
def xmlFile(filename): '''Return the matching xml file path for the input file.''' if (len(filename) >= 8 and filename[-7:-4] == 'DEM'): # DEM.tif and DEM.tfw #file_DEM.tif and file_DEM.tfw becomes file.xml return filename[:-8] + '.xml' # For other types return filename + '.xml...
[ "def", "xmlFile", "(", "filename", ")", ":", "if", "(", "len", "(", "filename", ")", ">=", "8", "and", "filename", "[", "-", "7", ":", "-", "4", "]", "==", "'DEM'", ")", ":", "# DEM.tif and DEM.tfw", "#file_DEM.tif and file_DEM.tfw becomes file.xml", "return...
https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/icebridge_common.py#L745-L753
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/debug/wrappers/framework.py
python
_check_type
(obj, expected_type)
Check if an object is of the expected type. Args: obj: The object being checked. expected_type: (type) The expected type of obj. Raises: TypeError: If obj is not an instance of expected_type.
Check if an object is of the expected type.
[ "Check", "if", "an", "object", "is", "of", "the", "expected", "type", "." ]
def _check_type(obj, expected_type): """Check if an object is of the expected type. Args: obj: The object being checked. expected_type: (type) The expected type of obj. Raises: TypeError: If obj is not an instance of expected_type. """ if not isinstance(obj, expected_type): raise TypeError...
[ "def", "_check_type", "(", "obj", ",", "expected_type", ")", ":", "if", "not", "isinstance", "(", "obj", ",", "expected_type", ")", ":", "raise", "TypeError", "(", "\"Expected type %s; got type %s\"", "%", "(", "expected_type", ",", "type", "(", "obj", ")", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/wrappers/framework.py#L127-L139
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py
python
easy_install.expand_dirs
(self)
Calls `os.path.expanduser` on install dirs.
Calls `os.path.expanduser` on install dirs.
[ "Calls", "os", ".", "path", ".", "expanduser", "on", "install", "dirs", "." ]
def expand_dirs(self): """Calls `os.path.expanduser` on install dirs.""" dirs = [ 'install_purelib', 'install_platlib', 'install_lib', 'install_headers', 'install_scripts', 'install_data', ] self._expand_attrs(dirs)
[ "def", "expand_dirs", "(", "self", ")", ":", "dirs", "=", "[", "'install_purelib'", ",", "'install_platlib'", ",", "'install_lib'", ",", "'install_headers'", ",", "'install_scripts'", ",", "'install_data'", ",", "]", "self", ".", "_expand_attrs", "(", "dirs", ")...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py#L401-L411
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py
python
TimeSeriesReader.read
(self)
Parses one or more records into a feature dictionary. This method is expected to be called by a `TimeSeriesInputFn` object, and is not for use with models directly. A `TimeSeriesReader` object reads multiple records at a single time for efficiency; the size of these batches is an implementation detail...
Parses one or more records into a feature dictionary.
[ "Parses", "one", "or", "more", "records", "into", "a", "feature", "dictionary", "." ]
def read(self): """Parses one or more records into a feature dictionary. This method is expected to be called by a `TimeSeriesInputFn` object, and is not for use with models directly. A `TimeSeriesReader` object reads multiple records at a single time for efficiency; the size of these batches is a...
[ "def", "read", "(", "self", ")", ":", "pass" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py#L186-L202
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py
python
Standard_Suite_Events.print_
(self, _object=None, _attributes={}, **_arguments)
print: Print an object. Required argument: list of objects Keyword argument _attributes: AppleEvent attribute dictionary
print: Print an object. Required argument: list of objects Keyword argument _attributes: AppleEvent attribute dictionary
[ "print", ":", "Print", "an", "object", ".", "Required", "argument", ":", "list", "of", "objects", "Keyword", "argument", "_attributes", ":", "AppleEvent", "attribute", "dictionary" ]
def print_(self, _object=None, _attributes={}, **_arguments): """print: Print an object. Required argument: list of objects Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'aevt' _subcode = 'pdoc' if _arguments: raise TypeError, 'No opti...
[ "def", "print_", "(", "self", ",", "_object", "=", "None", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'aevt'", "_subcode", "=", "'pdoc'", "if", "_arguments", ":", "raise", "TypeError", ",", "'No optional args...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py#L234-L252
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/tkFont.py
python
Font.actual
(self, option=None)
Return actual font attributes
Return actual font attributes
[ "Return", "actual", "font", "attributes" ]
def actual(self, option=None): "Return actual font attributes" if option: return self._call("font", "actual", self.name, "-"+option) else: return self._mkdict( self._split(self._call("font", "actual", self.name)) )
[ "def", "actual", "(", "self", ",", "option", "=", "None", ")", ":", "if", "option", ":", "return", "self", ".", "_call", "(", "\"font\"", ",", "\"actual\"", ",", "self", ".", "name", ",", "\"-\"", "+", "option", ")", "else", ":", "return", "self", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/tkFont.py#L120-L127
zhaoweicai/mscnn
534bcac5710a579d60827f192035f7eef6d8c585
scripts/cpp_lint.py
python
_IsTestFilename
(filename)
Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise.
Determines if the given filename has a suffix that identifies it as a test.
[ "Determines", "if", "the", "given", "filename", "has", "a", "suffix", "that", "identifies", "it", "as", "a", "test", "." ]
def _IsTestFilename(filename): """Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise. """ if (filename.endswith('_test.cc') or filename.endswith('_unittest.cc') or ...
[ "def", "_IsTestFilename", "(", "filename", ")", ":", "if", "(", "filename", ".", "endswith", "(", "'_test.cc'", ")", "or", "filename", ".", "endswith", "(", "'_unittest.cc'", ")", "or", "filename", ".", "endswith", "(", "'_regtest.cc'", ")", ")", ":", "ret...
https://github.com/zhaoweicai/mscnn/blob/534bcac5710a579d60827f192035f7eef6d8c585/scripts/cpp_lint.py#L3603-L3617
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/osr.py
python
SpatialReference.ExportToProj4
(self, *args)
return _osr.SpatialReference_ExportToProj4(self, *args)
r"""ExportToProj4(SpatialReference self) -> OGRErr
r"""ExportToProj4(SpatialReference self) -> OGRErr
[ "r", "ExportToProj4", "(", "SpatialReference", "self", ")", "-", ">", "OGRErr" ]
def ExportToProj4(self, *args): r"""ExportToProj4(SpatialReference self) -> OGRErr""" return _osr.SpatialReference_ExportToProj4(self, *args)
[ "def", "ExportToProj4", "(", "self", ",", "*", "args", ")", ":", "return", "_osr", ".", "SpatialReference_ExportToProj4", "(", "self", ",", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/osr.py#L814-L816
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/phactori.py
python
CalculateColorMapRGBPointsWithSubranges
(inBaseRgbPoints, inMinimum, inMaximum, inSubrangeMin, inSubrangeMax, inSubrangeColor)
return myRgbPoints
creates the rgb values for color map with highlighed subranges
creates the rgb values for color map with highlighed subranges
[ "creates", "the", "rgb", "values", "for", "color", "map", "with", "highlighed", "subranges" ]
def CalculateColorMapRGBPointsWithSubranges(inBaseRgbPoints, inMinimum, inMaximum, inSubrangeMin, inSubrangeMax, inSubrangeColor): """creates the rgb values for color map with highlighed subranges""" if PhactoriDbg(100): myDebugPrint3("CalculateColorMapRGBPointsWithSubranges entered \n" " ...
[ "def", "CalculateColorMapRGBPointsWithSubranges", "(", "inBaseRgbPoints", ",", "inMinimum", ",", "inMaximum", ",", "inSubrangeMin", ",", "inSubrangeMax", ",", "inSubrangeColor", ")", ":", "if", "PhactoriDbg", "(", "100", ")", ":", "myDebugPrint3", "(", "\"CalculateCol...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/phactori.py#L12196-L12310
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/tarfile.py
python
TarInfo._create_payload
(payload)
return payload
Return the string payload filled with zero bytes up to the next 512 byte border.
Return the string payload filled with zero bytes up to the next 512 byte border.
[ "Return", "the", "string", "payload", "filled", "with", "zero", "bytes", "up", "to", "the", "next", "512", "byte", "border", "." ]
def _create_payload(payload): """Return the string payload filled with zero bytes up to the next 512 byte border. """ blocks, remainder = divmod(len(payload), BLOCKSIZE) if remainder > 0: payload += (BLOCKSIZE - remainder) * NUL return payload
[ "def", "_create_payload", "(", "payload", ")", ":", "blocks", ",", "remainder", "=", "divmod", "(", "len", "(", "payload", ")", ",", "BLOCKSIZE", ")", "if", "remainder", ">", "0", ":", "payload", "+=", "(", "BLOCKSIZE", "-", "remainder", ")", "*", "NUL...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/tarfile.py#L967-L974
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/genpy/src/genpy/generator.py
python
deserialize_fn_generator
(msg_context, spec, is_numpy=False)
generator for body of deserialize() function :param is_numpy: if True, generate serializer code for numpy datatypes instead of Python lists, ``bool``
generator for body of deserialize() function :param is_numpy: if True, generate serializer code for numpy datatypes instead of Python lists, ``bool``
[ "generator", "for", "body", "of", "deserialize", "()", "function", ":", "param", "is_numpy", ":", "if", "True", "generate", "serializer", "code", "for", "numpy", "datatypes", "instead", "of", "Python", "lists", "bool" ]
def deserialize_fn_generator(msg_context, spec, is_numpy=False): """ generator for body of deserialize() function :param is_numpy: if True, generate serializer code for numpy datatypes instead of Python lists, ``bool`` """ yield "try:" package = spec.package #Instantiate embedded type ...
[ "def", "deserialize_fn_generator", "(", "msg_context", ",", "spec", ",", "is_numpy", "=", "False", ")", ":", "yield", "\"try:\"", "package", "=", "spec", ".", "package", "#Instantiate embedded type classes", "for", "type_", ",", "name", "in", "spec", ".", "field...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/genpy/src/genpy/generator.py#L686-L719
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMS_KEYEDHASH_PARMS.__init__
(self, scheme = None)
This structure describes the parameters that would appear in the public area of a KEYEDHASH object. Attributes: scheme (TPMU_SCHEME_KEYEDHASH): Indicates the signing method used for a keyedHash signing object. This field also determines the size of the data f...
This structure describes the parameters that would appear in the public area of a KEYEDHASH object.
[ "This", "structure", "describes", "the", "parameters", "that", "would", "appear", "in", "the", "public", "area", "of", "a", "KEYEDHASH", "object", "." ]
def __init__(self, scheme = None): """ This structure describes the parameters that would appear in the public area of a KEYEDHASH object. Attributes: scheme (TPMU_SCHEME_KEYEDHASH): Indicates the signing method used for a keyedHash signing object. This field also de...
[ "def", "__init__", "(", "self", ",", "scheme", "=", "None", ")", ":", "self", ".", "scheme", "=", "scheme" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L7846-L7857
keyboardio/Kaleidoscope
d59604e98b2439d108647f15be52984a6837d360
bin/cpplint.py
python
IsBlankLine
(line)
return not line or line.isspace()
Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank.
Returns true if the given line is blank.
[ "Returns", "true", "if", "the", "given", "line", "is", "blank", "." ]
def IsBlankLine(line): """Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank. """ return not line or line.isspace()
[ "def", "IsBlankLine", "(", "line", ")", ":", "return", "not", "line", "or", "line", ".", "isspace", "(", ")" ]
https://github.com/keyboardio/Kaleidoscope/blob/d59604e98b2439d108647f15be52984a6837d360/bin/cpplint.py#L3244-L3256
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/model_selection/_split.py
python
BaseShuffleSplit.split
(self, X, y=None, groups=None)
Generate indices to split data into training and test set. Parameters ---------- X : array-like, shape (n_samples, n_features) Training data, where n_samples is the number of samples and n_features is the number of features. y : array-like, shape (n_samples,) ...
Generate indices to split data into training and test set.
[ "Generate", "indices", "to", "split", "data", "into", "training", "and", "test", "set", "." ]
def split(self, X, y=None, groups=None): """Generate indices to split data into training and test set. Parameters ---------- X : array-like, shape (n_samples, n_features) Training data, where n_samples is the number of samples and n_features is the number of feat...
[ "def", "split", "(", "self", ",", "X", ",", "y", "=", "None", ",", "groups", "=", "None", ")", ":", "X", ",", "y", ",", "groups", "=", "indexable", "(", "X", ",", "y", ",", "groups", ")", "for", "train", ",", "test", "in", "self", ".", "_iter...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/model_selection/_split.py#L1298-L1330
cmu-db/noisepage
79276e68fe83322f1249e8a8be96bd63c583ae56
script/self_driving/model_server.py
python
ModelServer._execute_cmd
(self, cmd: Command, data: Dict)
Execute a command from the ModelServerManager :param cmd: :param data: :return: Tuple { message string to sent back, if continue the server }
Execute a command from the ModelServerManager :param cmd: :param data: :return: Tuple { message string to sent back, if continue the server }
[ "Execute", "a", "command", "from", "the", "ModelServerManager", ":", "param", "cmd", ":", ":", "param", "data", ":", ":", "return", ":", "Tuple", "{", "message", "string", "to", "sent", "back", "if", "continue", "the", "server", "}" ]
def _execute_cmd(self, cmd: Command, data: Dict) -> Tuple[Dict, bool]: """ Execute a command from the ModelServerManager :param cmd: :param data: :return: Tuple { message string to sent back, if continue the server } """ if cmd == C...
[ "def", "_execute_cmd", "(", "self", ",", "cmd", ":", "Command", ",", "data", ":", "Dict", ")", "->", "Tuple", "[", "Dict", ",", "bool", "]", ":", "if", "cmd", "==", "Command", ".", "PRINT", ":", "msg", "=", "data", "[", "\"message\"", "]", "logging...
https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/script/self_driving/model_server.py#L741-L784
nnrg/opennero
43e12a1bcba6e228639db3886fec1dc47ddc24cb
mods/TowerofHanoi/agent.py
python
TowerAgentStrips2Disk.end
(self, time, reward)
return True
receive the reward for the last observation
receive the reward for the last observation
[ "receive", "the", "reward", "for", "the", "last", "observation" ]
def end(self, time, reward): """ receive the reward for the last observation """ return True
[ "def", "end", "(", "self", ",", "time", ",", "reward", ")", ":", "return", "True" ]
https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/TowerofHanoi/agent.py#L297-L301
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
base/PRESUBMIT.py
python
_CommonChecks
(input_api, output_api)
return results
Checks common to both upload and commit.
Checks common to both upload and commit.
[ "Checks", "common", "to", "both", "upload", "and", "commit", "." ]
def _CommonChecks(input_api, output_api): """Checks common to both upload and commit.""" results = [] results.extend(_CheckNoInterfacesInBase(input_api, output_api)) return results
[ "def", "_CommonChecks", "(", "input_api", ",", "output_api", ")", ":", "results", "=", "[", "]", "results", ".", "extend", "(", "_CheckNoInterfacesInBase", "(", "input_api", ",", "output_api", ")", ")", "return", "results" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/base/PRESUBMIT.py#L34-L38
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib2to3/pgen2/tokenize.py
python
untokenize
(iterable)
return ut.untokenize(iterable)
Transform tokens back into Python source code. Each element returned by the iterable must be a token sequence with at least two elements, a token number and token value. If only two tokens are passed, the resulting output is poor. Round-trip invariant for full input: Untokenized source will m...
Transform tokens back into Python source code.
[ "Transform", "tokens", "back", "into", "Python", "source", "code", "." ]
def untokenize(iterable): """Transform tokens back into Python source code. Each element returned by the iterable must be a token sequence with at least two elements, a token number and token value. If only two tokens are passed, the resulting output is poor. Round-trip invariant for full input: ...
[ "def", "untokenize", "(", "iterable", ")", ":", "ut", "=", "Untokenizer", "(", ")", "return", "ut", ".", "untokenize", "(", "iterable", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib2to3/pgen2/tokenize.py#L324-L343
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/relaxed_bernoulli.py
python
RelaxedBernoulli.logits
(self)
return self._logits
Log-odds of `1`.
Log-odds of `1`.
[ "Log", "-", "odds", "of", "1", "." ]
def logits(self): """Log-odds of `1`.""" return self._logits
[ "def", "logits", "(", "self", ")", ":", "return", "self", ".", "_logits" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/relaxed_bernoulli.py#L206-L208
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/layers/blocks.py
python
GRU
(shape, cell_shape=None, activation=default_override_or(tanh), init=default_override_or(glorot_uniform()), init_bias=default_override_or(0), enable_self_stabilization=default_override_or(False), name='')
return _RecurrentBlock('GRU', shape, cell_shape, activation=activation, use_peepholes=False, init=init, init_bias=init_bias, enable_self_stabilization=enable_self_stabilization, name=name)
GRU(shape, cell_shape=None, activation=tanh, init=glorot_uniform(), init_bias=0, enable_self_stabilization=False, name='') Layer factory function to create a GRU block for use inside a recurrence. The GRU block implements one step of the recurrence and is stateless. It accepts the previous state as its first a...
GRU(shape, cell_shape=None, activation=tanh, init=glorot_uniform(), init_bias=0, enable_self_stabilization=False, name='')
[ "GRU", "(", "shape", "cell_shape", "=", "None", "activation", "=", "tanh", "init", "=", "glorot_uniform", "()", "init_bias", "=", "0", "enable_self_stabilization", "=", "False", "name", "=", ")" ]
def GRU(shape, cell_shape=None, activation=default_override_or(tanh), init=default_override_or(glorot_uniform()), init_bias=default_override_or(0), enable_self_stabilization=default_override_or(False), name=''): ''' GRU(shape, cell_shape=None, activation=tanh, init=glorot_uniform(), init...
[ "def", "GRU", "(", "shape", ",", "cell_shape", "=", "None", ",", "activation", "=", "default_override_or", "(", "tanh", ")", ",", "init", "=", "default_override_or", "(", "glorot_uniform", "(", ")", ")", ",", "init_bias", "=", "default_override_or", "(", "0"...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/layers/blocks.py#L468-L507
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/grassprovider/ext/r_li.py
python
checkMovingWindow
(alg, parameters, context, outputTxt=False)
return True, None
Verify if we have the right parameters
Verify if we have the right parameters
[ "Verify", "if", "we", "have", "the", "right", "parameters" ]
def checkMovingWindow(alg, parameters, context, outputTxt=False): """ Verify if we have the right parameters """ configTxt = alg.parameterAsString(parameters, 'config_txt', context) config = alg.parameterAsString(parameters, 'config', context) if configTxt and config: return False, alg.tr("You n...
[ "def", "checkMovingWindow", "(", "alg", ",", "parameters", ",", "context", ",", "outputTxt", "=", "False", ")", ":", "configTxt", "=", "alg", ".", "parameterAsString", "(", "parameters", ",", "'config_txt'", ",", "context", ")", "config", "=", "alg", ".", ...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/grassprovider/ext/r_li.py#L54-L80
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/tempfile.py
python
mktemp
(suffix="", prefix=template, dir=None)
User-callable function to return a unique temporary file name. The file is not created. Arguments are as for mkstemp, except that the 'text' argument is not accepted. This function is unsafe and should not be used. The file name refers to a file that did not exist at some point, but by the time ...
User-callable function to return a unique temporary file name. The file is not created.
[ "User", "-", "callable", "function", "to", "return", "a", "unique", "temporary", "file", "name", ".", "The", "file", "is", "not", "created", "." ]
def mktemp(suffix="", prefix=template, dir=None): """User-callable function to return a unique temporary file name. The file is not created. Arguments are as for mkstemp, except that the 'text' argument is not accepted. This function is unsafe and should not be used. The file name refers to ...
[ "def", "mktemp", "(", "suffix", "=", "\"\"", ",", "prefix", "=", "template", ",", "dir", "=", "None", ")", ":", "## from warnings import warn as _warn", "## _warn(\"mktemp is a potential security risk to your program\",", "## RuntimeWarning, stacklevel=2)", "if",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/tempfile.py#L338-L365
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/resample.py
python
PeriodIndexResampler._downsample
(self, how, **kwargs)
Downsample the cython defined function. Parameters ---------- how : string / cython mapped function **kwargs : kw args passed to how function
Downsample the cython defined function.
[ "Downsample", "the", "cython", "defined", "function", "." ]
def _downsample(self, how, **kwargs): """ Downsample the cython defined function. Parameters ---------- how : string / cython mapped function **kwargs : kw args passed to how function """ # we may need to actually resample as if we are timestamps ...
[ "def", "_downsample", "(", "self", ",", "how", ",", "*", "*", "kwargs", ")", ":", "# we may need to actually resample as if we are timestamps", "if", "self", ".", "kind", "==", "'timestamp'", ":", "return", "super", "(", "PeriodIndexResampler", ",", "self", ")", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/resample.py#L1131-L1166
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Activation.py
python
Linear.multiplier
(self)
return self._internal.get_multiplier()
Gets the multiplier.
Gets the multiplier.
[ "Gets", "the", "multiplier", "." ]
def multiplier(self): """Gets the multiplier. """ return self._internal.get_multiplier()
[ "def", "multiplier", "(", "self", ")", ":", "return", "self", ".", "_internal", ".", "get_multiplier", "(", ")" ]
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Activation.py#L60-L63
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/metrics.py
python
DetectionMAP.get_map_var
(self)
return self.cur_map, self.accum_map
Returns: mAP variable of current mini-batch and accumulative mAP variable cross mini-batches.
Returns: mAP variable of current mini-batch and accumulative mAP variable cross mini-batches.
[ "Returns", ":", "mAP", "variable", "of", "current", "mini", "-", "batch", "and", "accumulative", "mAP", "variable", "cross", "mini", "-", "batches", "." ]
def get_map_var(self): """ Returns: mAP variable of current mini-batch and accumulative mAP variable cross mini-batches. """ return self.cur_map, self.accum_map
[ "def", "get_map_var", "(", "self", ")", ":", "return", "self", ".", "cur_map", ",", "self", ".", "accum_map" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/metrics.py#L970-L975
jiazhihao/TASO
f11782c4db180ad7d1e7ff7f4bb82e574ac3b6b8
verify/validate_axioms.py
python
check_axiom
(s)
Based on z3.prove, adapted for multiprocessing by forking at the right place
Based on z3.prove, adapted for multiprocessing by forking at the right place
[ "Based", "on", "z3", ".", "prove", "adapted", "for", "multiprocessing", "by", "forking", "at", "the", "right", "place" ]
def check_axiom(s): """Based on z3.prove, adapted for multiprocessing by forking at the right place""" global func msg = str(list(s)) try: vs = tuple( s[i] if v.sort() == P else Tensor.tensor(s[i], 't{}'.format(i)) for i, v in enumerate(variables) ) ...
[ "def", "check_axiom", "(", "s", ")", ":", "global", "func", "msg", "=", "str", "(", "list", "(", "s", ")", ")", "try", ":", "vs", "=", "tuple", "(", "s", "[", "i", "]", "if", "v", ".", "sort", "(", ")", "==", "P", "else", "Tensor", ".", "te...
https://github.com/jiazhihao/TASO/blob/f11782c4db180ad7d1e7ff7f4bb82e574ac3b6b8/verify/validate_axioms.py#L519-L544
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/random.py
python
Random.betavariate
(self, alpha, beta)
Beta distribution. Conditions on the parameters are alpha > 0 and beta > 0. Returned values range between 0 and 1.
Beta distribution.
[ "Beta", "distribution", "." ]
def betavariate(self, alpha, beta): """Beta distribution. Conditions on the parameters are alpha > 0 and beta > 0. Returned values range between 0 and 1. """ # This version due to Janne Sinkkonen, and matches all the std # texts (e.g., Knuth Vol 2 Ed 3 pg 134 "the beta...
[ "def", "betavariate", "(", "self", ",", "alpha", ",", "beta", ")", ":", "# This version due to Janne Sinkkonen, and matches all the std", "# texts (e.g., Knuth Vol 2 Ed 3 pg 134 \"the beta distribution\").", "y", "=", "self", ".", "gammavariate", "(", "alpha", ",", "1.0", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/random.py#L629-L643
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/debug/cli/curses_ui.py
python
CursesUI._display_candidates
(self, candidates)
Show candidates (e.g., tab-completion candidates) on multiple lines. Args: candidates: (list of str) candidates.
Show candidates (e.g., tab-completion candidates) on multiple lines.
[ "Show", "candidates", "(", "e", ".", "g", ".", "tab", "-", "completion", "candidates", ")", "on", "multiple", "lines", "." ]
def _display_candidates(self, candidates): """Show candidates (e.g., tab-completion candidates) on multiple lines. Args: candidates: (list of str) candidates. """ if self._curr_unwrapped_output: # Force refresh screen output. self._scroll_output(self._SCROLL_REFRESH) if not cand...
[ "def", "_display_candidates", "(", "self", ",", "candidates", ")", ":", "if", "self", ".", "_curr_unwrapped_output", ":", "# Force refresh screen output.", "self", ".", "_scroll_output", "(", "self", ".", "_SCROLL_REFRESH", ")", "if", "not", "candidates", ":", "re...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/debug/cli/curses_ui.py#L867-L903
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/combo.py
python
ComboCtrl.OnButtonClick
(*args, **kwargs)
return _combo.ComboCtrl_OnButtonClick(*args, **kwargs)
OnButtonClick(self) Implement in a derived class to define what happens on dropdown button click. Default action is to show the popup.
OnButtonClick(self)
[ "OnButtonClick", "(", "self", ")" ]
def OnButtonClick(*args, **kwargs): """ OnButtonClick(self) Implement in a derived class to define what happens on dropdown button click. Default action is to show the popup. """ return _combo.ComboCtrl_OnButtonClick(*args, **kwargs)
[ "def", "OnButtonClick", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_combo", ".", "ComboCtrl_OnButtonClick", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/combo.py#L148-L155
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pyio.py
python
TextIOBase.encoding
(self)
return None
Subclasses should override.
Subclasses should override.
[ "Subclasses", "should", "override", "." ]
def encoding(self): """Subclasses should override.""" return None
[ "def", "encoding", "(", "self", ")", ":", "return", "None" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pyio.py#L1813-L1815
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
Panel_GetClassDefaultAttributes
(*args, **kwargs)
return _windows_.Panel_GetClassDefaultAttributes(*args, **kwargs)
Panel_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colours or f...
Panel_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
[ "Panel_GetClassDefaultAttributes", "(", "int", "variant", "=", "WINDOW_VARIANT_NORMAL", ")", "-", ">", "VisualAttributes" ]
def Panel_GetClassDefaultAttributes(*args, **kwargs): """ Panel_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which ...
[ "def", "Panel_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Panel_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L116-L131
vslavik/poedit
f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a
deps/boost/libs/mpl/preprocessed/fix_boost_mpl_preprocess.py
python
check_header_comment
(filename)
return True
Checks if the header-comment of the given file needs fixing.
Checks if the header-comment of the given file needs fixing.
[ "Checks", "if", "the", "header", "-", "comment", "of", "the", "given", "file", "needs", "fixing", "." ]
def check_header_comment(filename): """Checks if the header-comment of the given file needs fixing.""" # Check input file. name = os.path.basename( filename ) # Read content of input file. sourcefile = open( filename, "rU" ) content = sourcefile.read() sourcefile.close() # Search content...
[ "def", "check_header_comment", "(", "filename", ")", ":", "# Check input file.", "name", "=", "os", ".", "path", ".", "basename", "(", "filename", ")", "# Read content of input file.", "sourcefile", "=", "open", "(", "filename", ",", "\"rU\"", ")", "content", "=...
https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/libs/mpl/preprocessed/fix_boost_mpl_preprocess.py#L19-L36
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/__init__.py
python
Environment.__add__
(self, other)
return new
Add an environment or distribution to an environment
Add an environment or distribution to an environment
[ "Add", "an", "environment", "or", "distribution", "to", "an", "environment" ]
def __add__(self, other): """Add an environment or distribution to an environment""" new = self.__class__([], platform=None, python=None) for env in self, other: new += env return new
[ "def", "__add__", "(", "self", ",", "other", ")", ":", "new", "=", "self", ".", "__class__", "(", "[", "]", ",", "platform", "=", "None", ",", "python", "=", "None", ")", "for", "env", "in", "self", ",", "other", ":", "new", "+=", "env", "return"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L1098-L1103
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_extends/parse/parser.py
python
get_ast_type
(node)
return ast_type
Get the ast type.
Get the ast type.
[ "Get", "the", "ast", "type", "." ]
def get_ast_type(node): """Get the ast type.""" ast_type = AST_SUB_TYPE_UNKNOWN if isinstance(node, ast.And): ast_type = AST_SUB_TYPE_AND elif isinstance(node, ast.Or): ast_type = AST_SUB_TYPE_OR elif isinstance(node, ast.Name): ast_type = AST_SUB_TYPE_NAME elif isinstanc...
[ "def", "get_ast_type", "(", "node", ")", ":", "ast_type", "=", "AST_SUB_TYPE_UNKNOWN", "if", "isinstance", "(", "node", ",", "ast", ".", "And", ")", ":", "ast_type", "=", "AST_SUB_TYPE_AND", "elif", "isinstance", "(", "node", ",", "ast", ".", "Or", ")", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parse/parser.py#L481-L500
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py
python
Standard_Suite_Events.data_size
(self, _object, _attributes={}, **_arguments)
data size: (optional) Return the size in bytes of an object Required argument: the object whose data size is to be returned Keyword argument as: the data type for which the size is calculated Keyword argument _attributes: AppleEvent attribute dictionary Returns: the size of the object in...
data size: (optional) Return the size in bytes of an object Required argument: the object whose data size is to be returned Keyword argument as: the data type for which the size is calculated Keyword argument _attributes: AppleEvent attribute dictionary Returns: the size of the object in...
[ "data", "size", ":", "(", "optional", ")", "Return", "the", "size", "in", "bytes", "of", "an", "object", "Required", "argument", ":", "the", "object", "whose", "data", "size", "is", "to", "be", "returned", "Keyword", "argument", "as", ":", "the", "data",...
def data_size(self, _object, _attributes={}, **_arguments): """data size: (optional) Return the size in bytes of an object Required argument: the object whose data size is to be returned Keyword argument as: the data type for which the size is calculated Keyword argument _attributes: App...
[ "def", "data_size", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'core'", "_subcode", "=", "'dsiz'", "aetools", ".", "keysubst", "(", "_arguments", ",", "self", ".", "_argmap_data_s...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py#L100-L120
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Taskmaster.py
python
Task.fail_continue
(self)
Explicit continue-the-build failure. This sets failure status on the target nodes and all of their dependent parent nodes. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure().
Explicit continue-the-build failure.
[ "Explicit", "continue", "-", "the", "-", "build", "failure", "." ]
def fail_continue(self): """ Explicit continue-the-build failure. This sets failure status on the target nodes and all of their dependent parent nodes. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-da...
[ "def", "fail_continue", "(", "self", ")", ":", "T", "=", "self", ".", "tm", ".", "trace", "if", "T", ":", "T", ".", "write", "(", "self", ".", "trace_message", "(", "'Task.failed_continue()'", ",", "self", ".", "node", ")", ")", "self", ".", "tm", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Taskmaster.py#L360-L374
anestisb/oatdump_plus
ba858c1596598f0d9ae79c14d08c708cecc50af3
tools/checker/match/line.py
python
splitAtSeparators
(expressions)
return splitExpressions
Splits a list of TestExpressions at separators.
Splits a list of TestExpressions at separators.
[ "Splits", "a", "list", "of", "TestExpressions", "at", "separators", "." ]
def splitAtSeparators(expressions): """ Splits a list of TestExpressions at separators. """ splitExpressions = [] wordStart = 0 for index, expression in enumerate(expressions): if expression.variant == TestExpression.Variant.Separator: splitExpressions.append(expressions[wordStart:index]) wordSt...
[ "def", "splitAtSeparators", "(", "expressions", ")", ":", "splitExpressions", "=", "[", "]", "wordStart", "=", "0", "for", "index", ",", "expression", "in", "enumerate", "(", "expressions", ")", ":", "if", "expression", ".", "variant", "==", "TestExpression", ...
https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/checker/match/line.py#L23-L32
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/ndarray/ndarray.py
python
NDArray._get_nd_advanced_indexing
(self, key)
return op.gather_nd(self, self._get_index_nd(key))
Get item when key is a tuple of any objects of the following types: NDArray, np.ndarray, list, tuple, slice, and integer.
Get item when key is a tuple of any objects of the following types: NDArray, np.ndarray, list, tuple, slice, and integer.
[ "Get", "item", "when", "key", "is", "a", "tuple", "of", "any", "objects", "of", "the", "following", "types", ":", "NDArray", "np", ".", "ndarray", "list", "tuple", "slice", "and", "integer", "." ]
def _get_nd_advanced_indexing(self, key): """Get item when key is a tuple of any objects of the following types: NDArray, np.ndarray, list, tuple, slice, and integer.""" return op.gather_nd(self, self._get_index_nd(key))
[ "def", "_get_nd_advanced_indexing", "(", "self", ",", "key", ")", ":", "return", "op", ".", "gather_nd", "(", "self", ",", "self", ".", "_get_index_nd", "(", "key", ")", ")" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L823-L826
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/preprocessing/categorical.py
python
CategoricalProcessor.__init__
(self, min_frequency=0, share=False, vocabularies=None)
Initializes a CategoricalProcessor instance. Args: min_frequency: Minimum frequency of categories in the vocabulary. share: Share vocabulary between variables. vocabularies: list of CategoricalVocabulary objects for each variable in the input dataset. Attributes: vocabularies_:...
Initializes a CategoricalProcessor instance.
[ "Initializes", "a", "CategoricalProcessor", "instance", "." ]
def __init__(self, min_frequency=0, share=False, vocabularies=None): """Initializes a CategoricalProcessor instance. Args: min_frequency: Minimum frequency of categories in the vocabulary. share: Share vocabulary between variables. vocabularies: list of CategoricalVocabulary objects for each ...
[ "def", "__init__", "(", "self", ",", "min_frequency", "=", "0", ",", "share", "=", "False", ",", "vocabularies", "=", "None", ")", ":", "self", ".", "min_frequency", "=", "min_frequency", "self", ".", "share", "=", "share", "self", ".", "vocabularies_", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/preprocessing/categorical.py#L38-L52
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/code.py
python
interact
(banner=None, readfunc=None, local=None, exitmsg=None)
Closely emulate the interactive Python interpreter. This is a backwards compatible interface to the InteractiveConsole class. When readfunc is not specified, it attempts to import the readline module to enable GNU readline if it is available. Arguments (all optional, all default to None): banner...
Closely emulate the interactive Python interpreter.
[ "Closely", "emulate", "the", "interactive", "Python", "interpreter", "." ]
def interact(banner=None, readfunc=None, local=None, exitmsg=None): """Closely emulate the interactive Python interpreter. This is a backwards compatible interface to the InteractiveConsole class. When readfunc is not specified, it attempts to import the readline module to enable GNU readline if it is...
[ "def", "interact", "(", "banner", "=", "None", ",", "readfunc", "=", "None", ",", "local", "=", "None", ",", "exitmsg", "=", "None", ")", ":", "console", "=", "InteractiveConsole", "(", "local", ")", "if", "readfunc", "is", "not", "None", ":", "console...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/code.py#L278-L301
gromacs/gromacs
7dec3a3f99993cf5687a122de3e12de31c21c399
admin/containers/scripted_gmx_docker_builds.py
python
hpccm_distro_name
(args)
return hpccm_name
Generate *_distro* for hpccm.baseimage(). Convert the linux distribution variables into something that hpccm understands. The same format is used by the lower level hpccm.config.set_linux_distro().
Generate *_distro* for hpccm.baseimage().
[ "Generate", "*", "_distro", "*", "for", "hpccm", ".", "baseimage", "()", "." ]
def hpccm_distro_name(args) -> str: """Generate *_distro* for hpccm.baseimage(). Convert the linux distribution variables into something that hpccm understands. The same format is used by the lower level hpccm.config.set_linux_distro(). """ if args.centos is not None: name_mapping = {'...
[ "def", "hpccm_distro_name", "(", "args", ")", "->", "str", ":", "if", "args", ".", "centos", "is", "not", "None", ":", "name_mapping", "=", "{", "'7'", ":", "'centos7'", ",", "'8'", ":", "'centos8'", "}", "if", "args", ".", "centos", "in", "name_mappin...
https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/admin/containers/scripted_gmx_docker_builds.py#L228-L253
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py
python
BeamSearchDecoder.step
(self, time, inputs, state, name=None)
return (beam_search_output, beam_search_state, next_inputs, finished)
Perform a decoding step. Args: time: scalar `int32` tensor. inputs: A (structure of) input tensors. state: A (structure of) state tensors and TensorArrays. name: Name scope for any created operations. Returns: `(outputs, next_state, next_inputs, finished)`.
Perform a decoding step.
[ "Perform", "a", "decoding", "step", "." ]
def step(self, time, inputs, state, name=None): """Perform a decoding step. Args: time: scalar `int32` tensor. inputs: A (structure of) input tensors. state: A (structure of) state tensors and TensorArrays. name: Name scope for any created operations. Returns: `(outputs, next...
[ "def", "step", "(", "self", ",", "time", ",", "inputs", ",", "state", ",", "name", "=", "None", ")", ":", "batch_size", "=", "self", ".", "_batch_size", "beam_width", "=", "self", ".", "_beam_width", "end_token", "=", "self", ".", "_end_token", "length_p...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py#L401-L451
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/normal.py
python
Normal.log_prob
(self, x, name="log_prob")
Log prob of observations in `x` under these Normal distribution(s). Args: x: tensor of dtype `dtype`, must be broadcastable with `mu` and `sigma`. name: The name to give this op. Returns: log_prob: tensor of dtype `dtype`, the log-PDFs of `x`.
Log prob of observations in `x` under these Normal distribution(s).
[ "Log", "prob", "of", "observations", "in", "x", "under", "these", "Normal", "distribution", "(", "s", ")", "." ]
def log_prob(self, x, name="log_prob"): """Log prob of observations in `x` under these Normal distribution(s). Args: x: tensor of dtype `dtype`, must be broadcastable with `mu` and `sigma`. name: The name to give this op. Returns: log_prob: tensor of dtype `dtype`, the log-PDFs of `x`. ...
[ "def", "log_prob", "(", "self", ",", "x", ",", "name", "=", "\"log_prob\"", ")", ":", "with", "ops", ".", "name_scope", "(", "self", ".", "name", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "self", ".", "_mu", ",", "self", ".", "_sigma", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/normal.py#L223-L241
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
WorldModel.terrain
(self, *args)
return _robotsim.WorldModel_terrain(self, *args)
r""" Returns a TerrainModel in the world by index or name. terrain (index): :class:`~klampt.TerrainModel` terrain (name): :class:`~klampt.TerrainModel` Args: index (int, optional): name (str, optional): Returns: :class:`~klampt.Terrain...
r""" Returns a TerrainModel in the world by index or name.
[ "r", "Returns", "a", "TerrainModel", "in", "the", "world", "by", "index", "or", "name", "." ]
def terrain(self, *args) -> "TerrainModel": r""" Returns a TerrainModel in the world by index or name. terrain (index): :class:`~klampt.TerrainModel` terrain (name): :class:`~klampt.TerrainModel` Args: index (int, optional): name (str, optional): ...
[ "def", "terrain", "(", "self", ",", "*", "args", ")", "->", "\"TerrainModel\"", ":", "return", "_robotsim", ".", "WorldModel_terrain", "(", "self", ",", "*", "args", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L5789-L5805
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/value_object/read/media/peresource.py
python
StringLiteral.readall
(cls, fileobj)
return result
In addition to the static data, reads the string.
In addition to the static data, reads the string.
[ "In", "addition", "to", "the", "static", "data", "reads", "the", "string", "." ]
def readall(cls, fileobj): """ In addition to the static data, reads the string. """ result = cls.read(fileobj) result.value = fileobj.read(result.length * 2).decode('utf-16-le') return result
[ "def", "readall", "(", "cls", ",", "fileobj", ")", ":", "result", "=", "cls", ".", "read", "(", "fileobj", ")", "result", ".", "value", "=", "fileobj", ".", "read", "(", "result", ".", "length", "*", "2", ")", ".", "decode", "(", "'utf-16-le'", ")"...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/value_object/read/media/peresource.py#L133-L139
GoSSIP-SJTU/TripleDoggy
03648d6b19c812504b14e8b98c8c7b3f443f4e54
tools/clang/bindings/python/clang/cindex.py
python
Type.get_result
(self)
return conf.lib.clang_getResultType(self)
Retrieve the result type associated with a function type.
Retrieve the result type associated with a function type.
[ "Retrieve", "the", "result", "type", "associated", "with", "a", "function", "type", "." ]
def get_result(self): """ Retrieve the result type associated with a function type. """ return conf.lib.clang_getResultType(self)
[ "def", "get_result", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getResultType", "(", "self", ")" ]
https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/tools/clang/bindings/python/clang/cindex.py#L2315-L2319
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/masked/maskededit.py
python
MaskedEditMixin.IsEmpty
(self, value=None)
Returns True if control is equal to an empty value. (Empty means all editable positions in the template == fillChar.)
Returns True if control is equal to an empty value. (Empty means all editable positions in the template == fillChar.)
[ "Returns", "True", "if", "control", "is", "equal", "to", "an", "empty", "value", ".", "(", "Empty", "means", "all", "editable", "positions", "in", "the", "template", "==", "fillChar", ".", ")" ]
def IsEmpty(self, value=None): """ Returns True if control is equal to an empty value. (Empty means all editable positions in the template == fillChar.) """ if value is None: value = self._GetValue() if value == self._template and not self._defaultValue: #### d...
[ "def", "IsEmpty", "(", "self", ",", "value", "=", "None", ")", ":", "if", "value", "is", "None", ":", "value", "=", "self", ".", "_GetValue", "(", ")", "if", "value", "==", "self", ".", "_template", "and", "not", "self", ".", "_defaultValue", ":", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/masked/maskededit.py#L5008-L5028
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/api/map_job/input_reader.py
python
InputReader.params_to_json
(cls, params)
return params
Translates JobConfig.input_reader_params to json serializable format. For most reader, this may be an identity transformation. Args: params: JobConfig.input_reader_params. Returns: The json serializable format of params.
Translates JobConfig.input_reader_params to json serializable format.
[ "Translates", "JobConfig", ".", "input_reader_params", "to", "json", "serializable", "format", "." ]
def params_to_json(cls, params): """Translates JobConfig.input_reader_params to json serializable format. For most reader, this may be an identity transformation. Args: params: JobConfig.input_reader_params. Returns: The json serializable format of params. """ return params
[ "def", "params_to_json", "(", "cls", ",", "params", ")", ":", "return", "params" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/api/map_job/input_reader.py#L124-L135
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/tools/docs/doc_generator_visitor.py
python
DocGeneratorVisitor.__init__
(self, root_name='')
Make a visitor. As this visitor is starting its traversal at a module or class, it will not be told the name of that object during traversal. `root_name` is the name it should use for that object, effectively prefixing all names with "root_name.". Args: root_name: The name of the root module...
Make a visitor.
[ "Make", "a", "visitor", "." ]
def __init__(self, root_name=''): """Make a visitor. As this visitor is starting its traversal at a module or class, it will not be told the name of that object during traversal. `root_name` is the name it should use for that object, effectively prefixing all names with "root_name.". Args: ...
[ "def", "__init__", "(", "self", ",", "root_name", "=", "''", ")", ":", "self", ".", "set_root_name", "(", "root_name", ")", "self", ".", "_index", "=", "{", "}", "self", ".", "_tree", "=", "{", "}", "self", ".", "_reverse_index", "=", "None", "self",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/tools/docs/doc_generator_visitor.py#L29-L45
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/ceph_manager.py
python
OSDThrasher.force_cancel_recovery
(self)
Force or cancel forcing recovery
Force or cancel forcing recovery
[ "Force", "or", "cancel", "forcing", "recovery" ]
def force_cancel_recovery(self): """ Force or cancel forcing recovery """ if random.random() >= 0.4: self.force_recovery() else: self.cancel_force_recovery()
[ "def", "force_cancel_recovery", "(", "self", ")", ":", "if", "random", ".", "random", "(", ")", ">=", "0.4", ":", "self", ".", "force_recovery", "(", ")", "else", ":", "self", ".", "cancel_force_recovery", "(", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph_manager.py#L786-L793
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
ThirdParty/cinema/paraview/tpl/cinema_python/database/store.py
python
Store.get_camera_model
(self)
return 'static'
return the camera model that the raster images in the store correspond to
return the camera model that the raster images in the store correspond to
[ "return", "the", "camera", "model", "that", "the", "raster", "images", "in", "the", "store", "correspond", "to" ]
def get_camera_model(self): """ return the camera model that the raster images in the store correspond to """ if self.metadata is None or 'camera_model' not in self.metadata: # figure out something appropriate for pre-spec C stores if 'phi' in self.paramet...
[ "def", "get_camera_model", "(", "self", ")", ":", "if", "self", ".", "metadata", "is", "None", "or", "'camera_model'", "not", "in", "self", ".", "metadata", ":", "# figure out something appropriate for pre-spec C stores", "if", "'phi'", "in", "self", ".", "paramet...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/database/store.py#L318-L346
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBEvent.GetDataFlavor
(self)
return _lldb.SBEvent_GetDataFlavor(self)
GetDataFlavor(self) -> str
GetDataFlavor(self) -> str
[ "GetDataFlavor", "(", "self", ")", "-", ">", "str" ]
def GetDataFlavor(self): """GetDataFlavor(self) -> str""" return _lldb.SBEvent_GetDataFlavor(self)
[ "def", "GetDataFlavor", "(", "self", ")", ":", "return", "_lldb", ".", "SBEvent_GetDataFlavor", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L3955-L3957
ZhouWeikuan/DouDiZhu
0d84ff6c0bc54dba6ae37955de9ae9307513dc99
code/frameworks/cocos2d-x/download-deps.py
python
CocosZipInstaller.unpack_zipfile
(self, extract_dir)
Unpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``).
Unpack zip `filename` to `extract_dir`
[ "Unpack", "zip", "filename", "to", "extract_dir" ]
def unpack_zipfile(self, extract_dir): """Unpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). """ if not zipfile.is_zipfile(self._filename): raise UnrecognizedFormat("%s is ...
[ "def", "unpack_zipfile", "(", "self", ",", "extract_dir", ")", ":", "if", "not", "zipfile", ".", "is_zipfile", "(", "self", ".", "_filename", ")", ":", "raise", "UnrecognizedFormat", "(", "\"%s is not a zip file\"", "%", "(", "self", ".", "_filename", ")", "...
https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/download-deps.py#L175-L215
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/datetime.py
python
date.month
(self)
return self._month
month (1-12)
month (1-12)
[ "month", "(", "1", "-", "12", ")" ]
def month(self): """month (1-12)""" return self._month
[ "def", "month", "(", "self", ")", ":", "return", "self", ".", "_month" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/datetime.py#L989-L991
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/buttonpanel.py
python
Control.GetBestSize
(self)
return self._size
This functions returns the best acceptable minimal size for the window. For example, for a static control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (typically :class:`Panel`), the size returned by this function will be the same a...
This functions returns the best acceptable minimal size for the window. For example, for a static control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (typically :class:`Panel`), the size returned by this function will be the same a...
[ "This", "functions", "returns", "the", "best", "acceptable", "minimal", "size", "for", "the", "window", ".", "For", "example", "for", "a", "static", "control", "it", "will", "be", "the", "minimal", "size", "such", "that", "the", "control", "label", "is", "...
def GetBestSize(self): """ This functions returns the best acceptable minimal size for the window. For example, for a static control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (typically :class:`Panel`), the size r...
[ "def", "GetBestSize", "(", "self", ")", ":", "return", "self", ".", "_size" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/buttonpanel.py#L904-L915
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/xrc.py
python
XmlResource.GetFlags
(*args, **kwargs)
return _xrc.XmlResource_GetFlags(*args, **kwargs)
GetFlags(self) -> int
GetFlags(self) -> int
[ "GetFlags", "(", "self", ")", "-", ">", "int" ]
def GetFlags(*args, **kwargs): """GetFlags(self) -> int""" return _xrc.XmlResource_GetFlags(*args, **kwargs)
[ "def", "GetFlags", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_xrc", ".", "XmlResource_GetFlags", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/xrc.py#L210-L212
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/quantize/python/quant_ops.py
python
LastValueQuantize
(inputs, per_channel=False, init_min=-6.0, init_max=6.0, updates_collection=ops.GraphKeys.UPDATE_OPS, vars_collection=ops.GraphKeys.MOVING_AVERAGE_VARIABLES, scope=None, ...
Adds a layer that collects quantization ranges as last input ranges. LastValueQuantize creates variables called 'min' and 'max', representing the interval used for quantization and clamping. Args: inputs: a tensor containing values to be quantized. per_channel: (Optional) a boolean specifying whether to...
Adds a layer that collects quantization ranges as last input ranges.
[ "Adds", "a", "layer", "that", "collects", "quantization", "ranges", "as", "last", "input", "ranges", "." ]
def LastValueQuantize(inputs, per_channel=False, init_min=-6.0, init_max=6.0, updates_collection=ops.GraphKeys.UPDATE_OPS, vars_collection=ops.GraphKeys.MOVING_AVERAGE_VARIABLES, scope=Non...
[ "def", "LastValueQuantize", "(", "inputs", ",", "per_channel", "=", "False", ",", "init_min", "=", "-", "6.0", ",", "init_max", "=", "6.0", ",", "updates_collection", "=", "ops", ".", "GraphKeys", ".", "UPDATE_OPS", ",", "vars_collection", "=", "ops", ".", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/quantize/python/quant_ops.py#L53-L164
mingchen/protobuf-ios
0958df34558cd54cb7b6e6ca5c8855bf3d475046
compiler/python/mox.py
python
UnknownMethodCallError.__init__
(self, unknown_method_name)
Init exception. Args: # unknown_method_name: Method call that is not part of the mocked class's # public interface. unknown_method_name: str
Init exception.
[ "Init", "exception", "." ]
def __init__(self, unknown_method_name): """Init exception. Args: # unknown_method_name: Method call that is not part of the mocked class's # public interface. unknown_method_name: str """ Error.__init__(self) self._unknown_method_name = unknown_method_name
[ "def", "__init__", "(", "self", ",", "unknown_method_name", ")", ":", "Error", ".", "__init__", "(", "self", ")", "self", ".", "_unknown_method_name", "=", "unknown_method_name" ]
https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/mox.py#L133-L143
google/ml-metadata
b60196492d2ea2bcd8e4ddff0f3757e5fd710e4d
ml_metadata/metadata_store/types.py
python
_SimpleArtifactStructType.__init__
(self, artifact_type: metadata_store_pb2.ArtifactType)
Initializes the type and registers the underlying proto as used.
Initializes the type and registers the underlying proto as used.
[ "Initializes", "the", "type", "and", "registers", "the", "underlying", "proto", "as", "used", "." ]
def __init__(self, artifact_type: metadata_store_pb2.ArtifactType): """Initializes the type and registers the underlying proto as used.""" self._type = artifact_type _registered_types.register_artifact_type_as_used(artifact_type)
[ "def", "__init__", "(", "self", ",", "artifact_type", ":", "metadata_store_pb2", ".", "ArtifactType", ")", ":", "self", ".", "_type", "=", "artifact_type", "_registered_types", ".", "register_artifact_type_as_used", "(", "artifact_type", ")" ]
https://github.com/google/ml-metadata/blob/b60196492d2ea2bcd8e4ddff0f3757e5fd710e4d/ml_metadata/metadata_store/types.py#L759-L762
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/framework/python/ops/variables.py
python
get_model_variables
(scope=None, suffix=None)
return get_variables(scope, suffix, ops.GraphKeys.MODEL_VARIABLES)
Gets the list of model variables, filtered by scope and/or suffix. Args: scope: an optional scope for filtering the variables to return. suffix: an optional suffix for filtering the variables to return. Returns: a list of variables in collection with scope and suffix.
Gets the list of model variables, filtered by scope and/or suffix.
[ "Gets", "the", "list", "of", "model", "variables", "filtered", "by", "scope", "and", "/", "or", "suffix", "." ]
def get_model_variables(scope=None, suffix=None): """Gets the list of model variables, filtered by scope and/or suffix. Args: scope: an optional scope for filtering the variables to return. suffix: an optional suffix for filtering the variables to return. Returns: a list of variables in collection w...
[ "def", "get_model_variables", "(", "scope", "=", "None", ",", "suffix", "=", "None", ")", ":", "return", "get_variables", "(", "scope", ",", "suffix", ",", "ops", ".", "GraphKeys", ".", "MODEL_VARIABLES", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/framework/python/ops/variables.py#L389-L399
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py
python
_PrunedDenseMatrixMultiplication
(a, b, indices, transpose_a=False, adjoint_a=False, transpose_b=False, adjoint_b=False)
return sparse_csr_matrix_ops.sparse_tensor_to_csr_sparse_matrix( indices=indices, values=values, dense_shape=dense_shape)
Multiplies two dense matrices at selected indices. The two inputs `a` and `b` must have matching rank (2 or 3). If using rank 3, the first rank is used for the batch number. The last two dimensions should also be compatible for matrix multiplication. TODO(tabakg): Consider C++ implementation. There is also a ...
Multiplies two dense matrices at selected indices.
[ "Multiplies", "two", "dense", "matrices", "at", "selected", "indices", "." ]
def _PrunedDenseMatrixMultiplication(a, b, indices, transpose_a=False, adjoint_a=False, transpose_b=False, ...
[ "def", "_PrunedDenseMatrixMultiplication", "(", "a", ",", "b", ",", "indices", ",", "transpose_a", "=", "False", ",", "adjoint_a", "=", "False", ",", "transpose_b", "=", "False", ",", "adjoint_b", "=", "False", ")", ":", "transpose_a", "=", "transpose_a", "o...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py#L132-L189
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/zipfile.py
python
ZipFile.__init__
(self, file, mode="r", compression=ZIP_STORED, allowZip64=False)
Open the ZIP file with mode read "r", write "w" or append "a".
Open the ZIP file with mode read "r", write "w" or append "a".
[ "Open", "the", "ZIP", "file", "with", "mode", "read", "r", "write", "w", "or", "append", "a", "." ]
def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=False): """Open the ZIP file with mode read "r", write "w" or append "a".""" if mode not in ("r", "w", "a"): raise RuntimeError('ZipFile() requires mode "r", "w", or "a"') if compression == ZIP_STORED: ...
[ "def", "__init__", "(", "self", ",", "file", ",", "mode", "=", "\"r\"", ",", "compression", "=", "ZIP_STORED", ",", "allowZip64", "=", "False", ")", ":", "if", "mode", "not", "in", "(", "\"r\"", ",", "\"w\"", ",", "\"a\"", ")", ":", "raise", "Runtime...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/zipfile.py#L722-L791
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/generator/analyzer.py
python
_GetUnqualifiedToTargetMapping
(all_targets, to_find)
return result, [x for x in to_find]
Returns a tuple of the following: . mapping (dictionary) from unqualified name to Target for all the Targets in |to_find|. . any target names not found. If this is empty all targets were found.
Returns a tuple of the following: . mapping (dictionary) from unqualified name to Target for all the Targets in |to_find|. . any target names not found. If this is empty all targets were found.
[ "Returns", "a", "tuple", "of", "the", "following", ":", ".", "mapping", "(", "dictionary", ")", "from", "unqualified", "name", "to", "Target", "for", "all", "the", "Targets", "in", "|to_find|", ".", ".", "any", "target", "names", "not", "found", ".", "If...
def _GetUnqualifiedToTargetMapping(all_targets, to_find): """Returns a tuple of the following: . mapping (dictionary) from unqualified name to Target for all the Targets in |to_find|. . any target names not found. If this is empty all targets were found.""" result = {} if not to_find: return {}, [] ...
[ "def", "_GetUnqualifiedToTargetMapping", "(", "all_targets", ",", "to_find", ")", ":", "result", "=", "{", "}", "if", "not", "to_find", ":", "return", "{", "}", ",", "[", "]", "to_find", "=", "set", "(", "to_find", ")", "for", "target_name", "in", "all_t...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/generator/analyzer.py#L404-L420
chatopera/clause
dee31153d5ffdef33deedb6bff03e7806c296968
thirdparty/crfsuite/crfsuite-0.12/example/crfutils.py
python
readiter
(fi, names, sep=' ')
Return an iterator for item sequences read from a file object. This function reads a sequence from a file object L{fi}, and yields the sequence as a list of mapping objects. Each line (item) from the file object is split by the separator character L{sep}. Separated values of the item are named by L{name...
Return an iterator for item sequences read from a file object. This function reads a sequence from a file object L{fi}, and yields the sequence as a list of mapping objects. Each line (item) from the file object is split by the separator character L{sep}. Separated values of the item are named by L{name...
[ "Return", "an", "iterator", "for", "item", "sequences", "read", "from", "a", "file", "object", ".", "This", "function", "reads", "a", "sequence", "from", "a", "file", "object", "L", "{", "fi", "}", "and", "yields", "the", "sequence", "as", "a", "list", ...
def readiter(fi, names, sep=' '): """ Return an iterator for item sequences read from a file object. This function reads a sequence from a file object L{fi}, and yields the sequence as a list of mapping objects. Each line (item) from the file object is split by the separator character L{sep}. Se...
[ "def", "readiter", "(", "fi", ",", "names", ",", "sep", "=", "' '", ")", ":", "X", "=", "[", "]", "for", "line", "in", "fi", ":", "line", "=", "line", ".", "strip", "(", "'\\n'", ")", "if", "not", "line", ":", "yield", "X", "X", "=", "[", "...
https://github.com/chatopera/clause/blob/dee31153d5ffdef33deedb6bff03e7806c296968/thirdparty/crfsuite/crfsuite-0.12/example/crfutils.py#L35-L68