nwo
stringlengths
5
86
sha
stringlengths
40
40
path
stringlengths
4
189
language
stringclasses
1 value
identifier
stringlengths
1
94
parameters
stringlengths
2
4.03k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
11.5k
docstring
stringlengths
1
33.2k
docstring_summary
stringlengths
0
5.15k
docstring_tokens
list
function
stringlengths
34
151k
function_tokens
list
url
stringlengths
90
278
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/__init__.py
python
TransformSpec.get_transforms
(self)
return []
Transforms required by this class. Override in subclasses.
Transforms required by this class. Override in subclasses.
[ "Transforms", "required", "by", "this", "class", ".", "Override", "in", "subclasses", "." ]
def get_transforms(self): """Transforms required by this class. Override in subclasses.""" if self.default_transforms != (): import warnings warnings.warn('default_transforms attribute deprecated.\n' 'Use get_transforms() method instead.', ...
[ "def", "get_transforms", "(", "self", ")", ":", "if", "self", ".", "default_transforms", "!=", "(", ")", ":", "import", "warnings", "warnings", ".", "warn", "(", "'default_transforms attribute deprecated.\\n'", "'Use get_transforms() method instead.'", ",", "Deprecation...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/__init__.py#L206-L214
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/_abcoll.py
python
MutableSequence.pop
(self, index=-1)
return v
S.pop([index]) -> item -- remove and return item at index (default last). Raise IndexError if list is empty or index is out of range.
S.pop([index]) -> item -- remove and return item at index (default last). Raise IndexError if list is empty or index is out of range.
[ "S", ".", "pop", "(", "[", "index", "]", ")", "-", ">", "item", "--", "remove", "and", "return", "item", "at", "index", "(", "default", "last", ")", ".", "Raise", "IndexError", "if", "list", "is", "empty", "or", "index", "is", "out", "of", "range",...
def pop(self, index=-1): '''S.pop([index]) -> item -- remove and return item at index (default last). Raise IndexError if list is empty or index is out of range. ''' v = self[index] del self[index] return v
[ "def", "pop", "(", "self", ",", "index", "=", "-", "1", ")", ":", "v", "=", "self", "[", "index", "]", "del", "self", "[", "index", "]", "return", "v" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/_abcoll.py#L653-L659
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
FontFromNativeInfoString
(*args, **kwargs)
return val
FontFromNativeInfoString(String info) -> Font Construct a `wx.Font` from the string representation of a `wx.NativeFontInfo` object.
FontFromNativeInfoString(String info) -> Font
[ "FontFromNativeInfoString", "(", "String", "info", ")", "-", ">", "Font" ]
def FontFromNativeInfoString(*args, **kwargs): """ FontFromNativeInfoString(String info) -> Font Construct a `wx.Font` from the string representation of a `wx.NativeFontInfo` object. """ if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName'] val = _gdi_.ne...
[ "def", "FontFromNativeInfoString", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "kwargs", ".", "has_key", "(", "'faceName'", ")", ":", "kwargs", "[", "'face'", "]", "=", "kwargs", "[", "'faceName'", "]", "del", "kwargs", "[", "'faceName'", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L2545-L2554
cmu-db/bustub
fe1b9e984bd2967997b52df872c873d80f71cf7d
build_support/cpplint.py
python
_CppLintState.BackupFilters
(self)
Saves the current filter list to backup storage.
Saves the current filter list to backup storage.
[ "Saves", "the", "current", "filter", "list", "to", "backup", "storage", "." ]
def BackupFilters(self): """ Saves the current filter list to backup storage.""" self._filters_backup = self.filters[:]
[ "def", "BackupFilters", "(", "self", ")", ":", "self", ".", "_filters_backup", "=", "self", ".", "filters", "[", ":", "]" ]
https://github.com/cmu-db/bustub/blob/fe1b9e984bd2967997b52df872c873d80f71cf7d/build_support/cpplint.py#L1079-L1081
eProsima/Fast-DDS
6639a84b7855e8fda66a4afb541326ef22f8c727
tools/fastdds/shm/clean.py
python
Clean.__remove_file
(self, file)
Delete a file. Always return void, even if the function fails. param file str: The complete file_path
Delete a file.
[ "Delete", "a", "file", "." ]
def __remove_file(self, file): """ Delete a file. Always return void, even if the function fails. param file str: The complete file_path """ try: os.remove(file) except BaseException: pass
[ "def", "__remove_file", "(", "self", ",", "file", ")", ":", "try", ":", "os", ".", "remove", "(", "file", ")", "except", "BaseException", ":", "pass" ]
https://github.com/eProsima/Fast-DDS/blob/6639a84b7855e8fda66a4afb541326ef22f8c727/tools/fastdds/shm/clean.py#L169-L182
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/models/rnn/translate/data_utils.py
python
gunzip_file
(gz_path, new_path)
Unzips from gz_path into new_path.
Unzips from gz_path into new_path.
[ "Unzips", "from", "gz_path", "into", "new_path", "." ]
def gunzip_file(gz_path, new_path): """Unzips from gz_path into new_path.""" print("Unpacking %s to %s" % (gz_path, new_path)) with gzip.open(gz_path, "rb") as gz_file: with open(new_path, "wb") as new_file: for line in gz_file: new_file.write(line)
[ "def", "gunzip_file", "(", "gz_path", ",", "new_path", ")", ":", "print", "(", "\"Unpacking %s to %s\"", "%", "(", "gz_path", ",", "new_path", ")", ")", "with", "gzip", ".", "open", "(", "gz_path", ",", "\"rb\"", ")", "as", "gz_file", ":", "with", "open"...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/models/rnn/translate/data_utils.py#L65-L71
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
PRESUBMIT.py
python
_CheckIncludeOrderForScope
(scope, input_api, file_path, changed_linenums)
return warnings
Checks that the lines in scope occur in the right order. 1. C system files in alphabetical order 2. C++ system files in alphabetical order 3. Project's .h files
Checks that the lines in scope occur in the right order.
[ "Checks", "that", "the", "lines", "in", "scope", "occur", "in", "the", "right", "order", "." ]
def _CheckIncludeOrderForScope(scope, input_api, file_path, changed_linenums): """Checks that the lines in scope occur in the right order. 1. C system files in alphabetical order 2. C++ system files in alphabetical order 3. Project's .h files """ c_system_include_pattern = input_api.re.compile(r'\s*#inclu...
[ "def", "_CheckIncludeOrderForScope", "(", "scope", ",", "input_api", ",", "file_path", ",", "changed_linenums", ")", ":", "c_system_include_pattern", "=", "input_api", ".", "re", ".", "compile", "(", "r'\\s*#include <.*\\.h>'", ")", "cpp_system_include_pattern", "=", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/PRESUBMIT.py#L562-L608
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/quickcpplint.py
python
lint_all
(file_names: List[str])
Lint files command entry point based on working tree.
Lint files command entry point based on working tree.
[ "Lint", "files", "command", "entry", "point", "based", "on", "working", "tree", "." ]
def lint_all(file_names: List[str]) -> None: # pylint: disable=unused-argument """Lint files command entry point based on working tree.""" all_file_names = git.get_files_to_check_working_tree(is_interesting_file) _lint_files(all_file_names)
[ "def", "lint_all", "(", "file_names", ":", "List", "[", "str", "]", ")", "->", "None", ":", "# pylint: disable=unused-argument", "all_file_names", "=", "git", ".", "get_files_to_check_working_tree", "(", "is_interesting_file", ")", "_lint_files", "(", "all_file_names"...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/quickcpplint.py#L57-L62
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pdb.py
python
Pdb.do_commands
(self, arg)
Defines a list of commands associated to a breakpoint. Those commands will be executed whenever the breakpoint causes the program to stop execution.
Defines a list of commands associated to a breakpoint.
[ "Defines", "a", "list", "of", "commands", "associated", "to", "a", "breakpoint", "." ]
def do_commands(self, arg): """Defines a list of commands associated to a breakpoint. Those commands will be executed whenever the breakpoint causes the program to stop execution.""" if not arg: bnum = len(bdb.Breakpoint.bpbynumber)-1 else: try: ...
[ "def", "do_commands", "(", "self", ",", "arg", ")", ":", "if", "not", "arg", ":", "bnum", "=", "len", "(", "bdb", ".", "Breakpoint", ".", "bpbynumber", ")", "-", "1", "else", ":", "try", ":", "bnum", "=", "int", "(", "arg", ")", "except", ":", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pdb.py#L317-L342
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
armoryengine/CoinSelection.py
python
calcMinSuggestedFeesHackMS
(selectCoinsResult, targetOutVal, preSelectedFee, numRecipients)
return suggestedFee
This is a hack, because the calcMinSuggestedFees below assumes standard P2PKH inputs and outputs, not allowing us a way to modify it if we ne know that the inputs will be much larger, or the outputs. we just copy the original method with an update to the computation
This is a hack, because the calcMinSuggestedFees below assumes standard P2PKH inputs and outputs, not allowing us a way to modify it if we ne know that the inputs will be much larger, or the outputs.
[ "This", "is", "a", "hack", "because", "the", "calcMinSuggestedFees", "below", "assumes", "standard", "P2PKH", "inputs", "and", "outputs", "not", "allowing", "us", "a", "way", "to", "modify", "it", "if", "we", "ne", "know", "that", "the", "inputs", "will", ...
def calcMinSuggestedFeesHackMS(selectCoinsResult, targetOutVal, preSelectedFee, numRecipients): """ This is a hack, because the calcMinSuggestedFees below assumes standard P2PKH inputs and outputs, not allowing us a way to modify it if we ne know tha...
[ "def", "calcMinSuggestedFeesHackMS", "(", "selectCoinsResult", ",", "targetOutVal", ",", "preSelectedFee", ",", "numRecipients", ")", ":", "numBytes", "=", "0", "msInfo", "=", "[", "getMultisigScriptInfo", "(", "utxo", ".", "getScript", "(", ")", ")", "for", "ut...
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryengine/CoinSelection.py#L762-L792
OpenGenus/quark
225ad96efdfcc66cb6584a756c17eb3871e6eb62
code/code/data_structures/src/list/circular_linked_list/operations/has_loop.py
python
LinkedList.add
(self, data)
return new
add new node to head of list
add new node to head of list
[ "add", "new", "node", "to", "head", "of", "list" ]
def add(self, data): """add new node to head of list""" new = LinkedList.Node(data, self.head) self.head = new return new
[ "def", "add", "(", "self", ",", "data", ")", ":", "new", "=", "LinkedList", ".", "Node", "(", "data", ",", "self", ".", "head", ")", "self", ".", "head", "=", "new", "return", "new" ]
https://github.com/OpenGenus/quark/blob/225ad96efdfcc66cb6584a756c17eb3871e6eb62/code/code/data_structures/src/list/circular_linked_list/operations/has_loop.py#L35-L39
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/main.py
python
StdoutRefactoringTool.__init__
(self, fixers, options, explicit, nobackups, show_diffs, input_base_dir='', output_dir='', append_suffix='')
Args: fixers: A list of fixers to import. options: A dict with RefactoringTool configuration. explicit: A list of fixers to run even if they are explicit. nobackups: If true no backup '.bak' files will be created for those files that are being refactored. ...
Args: fixers: A list of fixers to import. options: A dict with RefactoringTool configuration. explicit: A list of fixers to run even if they are explicit. nobackups: If true no backup '.bak' files will be created for those files that are being refactored. ...
[ "Args", ":", "fixers", ":", "A", "list", "of", "fixers", "to", "import", ".", "options", ":", "A", "dict", "with", "RefactoringTool", "configuration", ".", "explicit", ":", "A", "list", "of", "fixers", "to", "run", "even", "if", "they", "are", "explicit"...
def __init__(self, fixers, options, explicit, nobackups, show_diffs, input_base_dir='', output_dir='', append_suffix=''): """ Args: fixers: A list of fixers to import. options: A dict with RefactoringTool configuration. explicit: A list of fixers to r...
[ "def", "__init__", "(", "self", ",", "fixers", ",", "options", ",", "explicit", ",", "nobackups", ",", "show_diffs", ",", "input_base_dir", "=", "''", ",", "output_dir", "=", "''", ",", "append_suffix", "=", "''", ")", ":", "self", ".", "nobackups", "=",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/main.py#L36-L63
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/codecs.py
python
IncrementalEncoder.getstate
(self)
return 0
Return the current state of the encoder.
Return the current state of the encoder.
[ "Return", "the", "current", "state", "of", "the", "encoder", "." ]
def getstate(self): """ Return the current state of the encoder. """ return 0
[ "def", "getstate", "(", "self", ")", ":", "return", "0" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/codecs.py#L184-L188
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/dataset/engine/datasets.py
python
TransferDataset.send
(self, num_epochs=-1)
Send to device
Send to device
[ "Send", "to", "device" ]
def send(self, num_epochs=-1): """ Send to device """ if Dataset._noop_mode(): return if self._to_device is not None: del self._to_device self._to_device = _ToDevice(self, num_epochs) self._to_device.send()
[ "def", "send", "(", "self", ",", "num_epochs", "=", "-", "1", ")", ":", "if", "Dataset", ".", "_noop_mode", "(", ")", ":", "return", "if", "self", ".", "_to_device", "is", "not", "None", ":", "del", "self", ".", "_to_device", "self", ".", "_to_device...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/datasets.py#L3352-L3361
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/stats/morestats.py
python
_parse_dist_kw
(dist, enforce_subclass=True)
return dist
Parse `dist` keyword. Parameters ---------- dist : str or stats.distributions instance. Several functions take `dist` as a keyword, hence this utility function. enforce_subclass : bool, optional If True (default), `dist` needs to be a `_distn_infrastructure.rv_generic` i...
Parse `dist` keyword.
[ "Parse", "dist", "keyword", "." ]
def _parse_dist_kw(dist, enforce_subclass=True): """Parse `dist` keyword. Parameters ---------- dist : str or stats.distributions instance. Several functions take `dist` as a keyword, hence this utility function. enforce_subclass : bool, optional If True (default), `dist` ne...
[ "def", "_parse_dist_kw", "(", "dist", ",", "enforce_subclass", "=", "True", ")", ":", "if", "isinstance", "(", "dist", ",", "rv_generic", ")", ":", "pass", "elif", "isinstance", "(", "dist", ",", "string_types", ")", ":", "try", ":", "dist", "=", "getatt...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/morestats.py#L424-L452
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/buttonpanel.py
python
Control.__init__
(self, parent, size=wx.Size(-1, -1), id=wx.ID_ANY)
Default class constructor. :param Window `parent`: the control parent object. Must not be ``None``; :param `size`: the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform; :type `size`: tuple or :c...
Default class constructor. :param Window `parent`: the control parent object. Must not be ``None``; :param `size`: the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform; :type `size`: tuple or :c...
[ "Default", "class", "constructor", ".", ":", "param", "Window", "parent", ":", "the", "control", "parent", "object", ".", "Must", "not", "be", "None", ";", ":", "param", "size", ":", "the", "control", "size", ".", "A", "value", "of", "(", "-", "1", "...
def __init__(self, parent, size=wx.Size(-1, -1), id=wx.ID_ANY): """ Default class constructor. :param Window `parent`: the control parent object. Must not be ``None``; :param `size`: the control size. A value of (-1, -1) indicates a default size, chosen by either the wi...
[ "def", "__init__", "(", "self", ",", "parent", ",", "size", "=", "wx", ".", "Size", "(", "-", "1", ",", "-", "1", ")", ",", "id", "=", "wx", ".", "ID_ANY", ")", ":", "wx", ".", "EvtHandler", ".", "__init__", "(", "self", ")", "self", ".", "_p...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/buttonpanel.py#L839-L861
francinexue/xuefu
b6ff79747a42e020588c0c0a921048e08fe4680c
cnx/tickfeed.py
python
BaseBarFeed.getNextBars
(self)
Override to return the next :class:`pyalgotrade.bar.Bars` in the feed or None if there are no bars. .. note:: This is for BaseBarFeed subclasses and it should not be called directly.
Override to return the next :class:`pyalgotrade.bar.Bars` in the feed or None if there are no bars.
[ "Override", "to", "return", "the", "next", ":", "class", ":", "pyalgotrade", ".", "bar", ".", "Bars", "in", "the", "feed", "or", "None", "if", "there", "are", "no", "bars", "." ]
def getNextBars(self): """Override to return the next :class:`pyalgotrade.bar.Bars` in the feed or None if there are no bars. .. note:: This is for BaseBarFeed subclasses and it should not be called directly. """ raise NotImplementedError()
[ "def", "getNextBars", "(", "self", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/cnx/tickfeed.py#L84-L90
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/lexers.py
python
PygmentsLexer.lex_document
(self, cli, document)
return get_line
Create a lexer function that takes a line number and returns the list of (Token, text) tuples as the Pygments lexer returns for that line.
Create a lexer function that takes a line number and returns the list of (Token, text) tuples as the Pygments lexer returns for that line.
[ "Create", "a", "lexer", "function", "that", "takes", "a", "line", "number", "and", "returns", "the", "list", "of", "(", "Token", "text", ")", "tuples", "as", "the", "Pygments", "lexer", "returns", "for", "that", "line", "." ]
def lex_document(self, cli, document): """ Create a lexer function that takes a line number and returns the list of (Token, text) tuples as the Pygments lexer returns for that line. """ # Cache of already lexed lines. cache = {} # Pygments generators that are cur...
[ "def", "lex_document", "(", "self", ",", "cli", ",", "document", ")", ":", "# Cache of already lexed lines.", "cache", "=", "{", "}", "# Pygments generators that are currently lexing.", "line_generators", "=", "{", "}", "# Map lexer generator to the line number.", "def", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/lexers.py#L216-L320
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/fusion/portableglobe/servers/local_server.py
python
LocalServer.JStoJson
(self, js_string)
return json.dumps(json.loads(out_string))
Converts a JS server definition string to valid JSON.
Converts a JS server definition string to valid JSON.
[ "Converts", "a", "JS", "server", "definition", "string", "to", "valid", "JSON", "." ]
def JStoJson(self, js_string): """Converts a JS server definition string to valid JSON.""" # Remove "var geeServerDefs = " or similar from start. # Then add quotes to JSON keys that don't have them. # Strip out the trailing ';' # Finally, push it through json.dumps to ensure consistently-formatted o...
[ "def", "JStoJson", "(", "self", ",", "js_string", ")", ":", "# Remove \"var geeServerDefs = \" or similar from start.", "# Then add quotes to JSON keys that don't have them.", "# Strip out the trailing ';'", "# Finally, push it through json.dumps to ensure consistently-formatted output.", "o...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/servers/local_server.py#L414-L423
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/showbase/Audio3DManager.py
python
Audio3DManager.getDistanceFactor
(self)
return self.audio_manager.audio3dGetDistanceFactor()
Control the scale that sets the distance units for 3D spacialized audio. Default is 1.0 which is adjust in panda to be meters.
Control the scale that sets the distance units for 3D spacialized audio. Default is 1.0 which is adjust in panda to be meters.
[ "Control", "the", "scale", "that", "sets", "the", "distance", "units", "for", "3D", "spacialized", "audio", ".", "Default", "is", "1", ".", "0", "which", "is", "adjust", "in", "panda", "to", "be", "meters", "." ]
def getDistanceFactor(self): """ Control the scale that sets the distance units for 3D spacialized audio. Default is 1.0 which is adjust in panda to be meters. """ return self.audio_manager.audio3dGetDistanceFactor()
[ "def", "getDistanceFactor", "(", "self", ")", ":", "return", "self", ".", "audio_manager", ".", "audio3dGetDistanceFactor", "(", ")" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/Audio3DManager.py#L44-L49
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/credentials.py
python
AssumeRoleProvider._get_role_config
(self, profile_name)
return role_config
Retrieves and validates the role configuration for the profile.
Retrieves and validates the role configuration for the profile.
[ "Retrieves", "and", "validates", "the", "role", "configuration", "for", "the", "profile", "." ]
def _get_role_config(self, profile_name): """Retrieves and validates the role configuration for the profile.""" profiles = self._loaded_config.get('profiles', {}) profile = profiles[profile_name] source_profile = profile.get('source_profile') role_arn = profile['role_arn'] ...
[ "def", "_get_role_config", "(", "self", ",", "profile_name", ")", ":", "profiles", "=", "self", ".", "_loaded_config", ".", "get", "(", "'profiles'", ",", "{", "}", ")", "profile", "=", "profiles", "[", "profile_name", "]", "source_profile", "=", "profile", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/credentials.py#L1437-L1485
anestisb/oatdump_plus
ba858c1596598f0d9ae79c14d08c708cecc50af3
tools/cpplint.py
python
CleansedLines.NumLines
(self)
return self.num_lines
Returns the number of lines represented.
Returns the number of lines represented.
[ "Returns", "the", "number", "of", "lines", "represented", "." ]
def NumLines(self): """Returns the number of lines represented.""" return self.num_lines
[ "def", "NumLines", "(", "self", ")", ":", "return", "self", ".", "num_lines" ]
https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/cpplint.py#L1038-L1040
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/mws/connection.py
python
MWSConnection.create_inbound_shipment_plan
(self, request, response, **kw)
return self._post_request(request, kw, response)
Returns the information required to create an inbound shipment.
Returns the information required to create an inbound shipment.
[ "Returns", "the", "information", "required", "to", "create", "an", "inbound", "shipment", "." ]
def create_inbound_shipment_plan(self, request, response, **kw): """Returns the information required to create an inbound shipment. """ return self._post_request(request, kw, response)
[ "def", "create_inbound_shipment_plan", "(", "self", ",", "request", ",", "response", ",", "*", "*", "kw", ")", ":", "return", "self", ".", "_post_request", "(", "request", ",", "kw", ",", "response", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/mws/connection.py#L551-L554
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/elastic/rendezvous/api.py
python
RendezvousHandler.get_run_id
(self)
Returns the run id of the rendezvous. The run id is a user-defined id that uniquely identifies an instance of a distributed application. It typically maps to a job id and is used to allow nodes to join the correct distributed application.
Returns the run id of the rendezvous.
[ "Returns", "the", "run", "id", "of", "the", "rendezvous", "." ]
def get_run_id(self) -> str: """Returns the run id of the rendezvous. The run id is a user-defined id that uniquely identifies an instance of a distributed application. It typically maps to a job id and is used to allow nodes to join the correct distributed application. """
[ "def", "get_run_id", "(", "self", ")", "->", "str", ":" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/elastic/rendezvous/api.py#L100-L106
DaehwanKimLab/hisat2
c4419f9884c43295b141fe7ec5aeecc032427d42
scripts/sa.py
python
loadFasta
(fns)
return ''.join(falist)
Load the concatenation of all the A/C/G/T characters
Load the concatenation of all the A/C/G/T characters
[ "Load", "the", "concatenation", "of", "all", "the", "A", "/", "C", "/", "G", "/", "T", "characters" ]
def loadFasta(fns): """ Load the concatenation of all the A/C/G/T characters """ falist = [] dna = set(['A', 'C', 'G', 'T', 'a', 'c', 'g', 't']) for fn in fns: with open(fn, 'r') as fh: for line in fh: if line[0] == '>': continue for c in line: if c in dna: falist.append(c) return ''.j...
[ "def", "loadFasta", "(", "fns", ")", ":", "falist", "=", "[", "]", "dna", "=", "set", "(", "[", "'A'", ",", "'C'", ",", "'G'", ",", "'T'", ",", "'a'", ",", "'c'", ",", "'g'", ",", "'t'", "]", ")", "for", "fn", "in", "fns", ":", "with", "ope...
https://github.com/DaehwanKimLab/hisat2/blob/c4419f9884c43295b141fe7ec5aeecc032427d42/scripts/sa.py#L25-L37
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
tools/update-packaging/make_incremental_updates.py
python
copy_file
(src_file_abs_path, dst_file_abs_path)
Copies src to dst creating any parent dirs required in dst first
Copies src to dst creating any parent dirs required in dst first
[ "Copies", "src", "to", "dst", "creating", "any", "parent", "dirs", "required", "in", "dst", "first" ]
def copy_file(src_file_abs_path, dst_file_abs_path): """ Copies src to dst creating any parent dirs required in dst first """ dst_file_dir=os.path.dirname(dst_file_abs_path) if not os.path.exists(dst_file_dir): os.makedirs(dst_file_dir) # Copy the file over shutil.copy2(src_file_abs_path, d...
[ "def", "copy_file", "(", "src_file_abs_path", ",", "dst_file_abs_path", ")", ":", "dst_file_dir", "=", "os", ".", "path", ".", "dirname", "(", "dst_file_abs_path", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "dst_file_dir", ")", ":", "os", "."...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/tools/update-packaging/make_incremental_updates.py#L194-L200
NVIDIA/thrust
627dccb359a635afdd69e95a6cc59698f23f70e2
internal/benchmark/combine_benchmark_results.py
python
find_significant_digit
(x)
return -int(floor(log10(abs(x))))
Return the significant digit of the number x. The result is the number of digits after the decimal place to round to (negative numbers indicate rounding before the decimal place).
Return the significant digit of the number x. The result is the number of digits after the decimal place to round to (negative numbers indicate rounding before the decimal place).
[ "Return", "the", "significant", "digit", "of", "the", "number", "x", ".", "The", "result", "is", "the", "number", "of", "digits", "after", "the", "decimal", "place", "to", "round", "to", "(", "negative", "numbers", "indicate", "rounding", "before", "the", ...
def find_significant_digit(x): """Return the significant digit of the number x. The result is the number of digits after the decimal place to round to (negative numbers indicate rounding before the decimal place).""" if x == 0: return 0 return -int(floor(log10(abs(x))))
[ "def", "find_significant_digit", "(", "x", ")", ":", "if", "x", "==", "0", ":", "return", "0", "return", "-", "int", "(", "floor", "(", "log10", "(", "abs", "(", "x", ")", ")", ")", ")" ]
https://github.com/NVIDIA/thrust/blob/627dccb359a635afdd69e95a6cc59698f23f70e2/internal/benchmark/combine_benchmark_results.py#L92-L97
GXYM/DRRG
9e074fa9052de8d131f55ca1f6ae6673c1bfeca4
dataset/icdar15/Evaluation_Protocol/rrc_evaluation_funcs.py
python
load_zip_file_keys
(file,fileNameRegExp='')
return pairs
Returns an array with the entries of the ZIP file that match with the regular expression. The key's are the names or the file or the capturing group definied in the fileNameRegExp
Returns an array with the entries of the ZIP file that match with the regular expression. The key's are the names or the file or the capturing group definied in the fileNameRegExp
[ "Returns", "an", "array", "with", "the", "entries", "of", "the", "ZIP", "file", "that", "match", "with", "the", "regular", "expression", ".", "The", "key", "s", "are", "the", "names", "or", "the", "file", "or", "the", "capturing", "group", "definied", "i...
def load_zip_file_keys(file,fileNameRegExp=''): """ Returns an array with the entries of the ZIP file that match with the regular expression. The key's are the names or the file or the capturing group definied in the fileNameRegExp """ try: archive=zipfile.ZipFile(file, mode='r', allowZip64=...
[ "def", "load_zip_file_keys", "(", "file", ",", "fileNameRegExp", "=", "''", ")", ":", "try", ":", "archive", "=", "zipfile", ".", "ZipFile", "(", "file", ",", "mode", "=", "'r'", ",", "allowZip64", "=", "True", ")", "except", ":", "raise", "Exception", ...
https://github.com/GXYM/DRRG/blob/9e074fa9052de8d131f55ca1f6ae6673c1bfeca4/dataset/icdar15/Evaluation_Protocol/rrc_evaluation_funcs.py#L17-L43
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py
python
StateTracker.DocFlagPass
(self, start_token, error_handler)
Parses doc flags. This pass needs to be executed before the aliaspass and we don't want to do a full-blown statetracker dry run for these. Args: start_token: The token at which to start iterating error_handler: An error handler for error reporting.
Parses doc flags.
[ "Parses", "doc", "flags", "." ]
def DocFlagPass(self, start_token, error_handler): """Parses doc flags. This pass needs to be executed before the aliaspass and we don't want to do a full-blown statetracker dry run for these. Args: start_token: The token at which to start iterating error_handler: An error handler for erro...
[ "def", "DocFlagPass", "(", "self", ",", "start_token", ",", "error_handler", ")", ":", "if", "not", "start_token", ":", "return", "doc_flag_types", "=", "(", "Type", ".", "DOC_FLAG", ",", "Type", ".", "DOC_INLINE_FLAG", ")", "for", "token", "in", "start_toke...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py#L782-L797
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
python
quantized_matmul
( A=TensorDef(T1, S.M, S.K), B=TensorDef(T2, S.K, S.N), AZp=ScalarDef(I32), BZp=ScalarDef(I32), C=TensorDef(U, S.M, S.N, output=True))
Performs a matrix multiplication of two 2D inputs. Numeric casting is performed on the operands to the inner multiply, promoting them to the same data type as the accumulator/output. The quantized variant includes zero-point adjustments for the left and right operands of the matmul.
Performs a matrix multiplication of two 2D inputs.
[ "Performs", "a", "matrix", "multiplication", "of", "two", "2D", "inputs", "." ]
def quantized_matmul( A=TensorDef(T1, S.M, S.K), B=TensorDef(T2, S.K, S.N), AZp=ScalarDef(I32), BZp=ScalarDef(I32), C=TensorDef(U, S.M, S.N, output=True)): """Performs a matrix multiplication of two 2D inputs. Numeric casting is performed on the operands to the inner multiply, promoting them ...
[ "def", "quantized_matmul", "(", "A", "=", "TensorDef", "(", "T1", ",", "S", ".", "M", ",", "S", ".", "K", ")", ",", "B", "=", "TensorDef", "(", "T2", ",", "S", ".", "K", ",", "S", ".", "N", ")", ",", "AZp", "=", "ScalarDef", "(", "I32", ")"...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py#L41-L56
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
chrome/common/extensions/docs/server2/link_error_detector.py
python
LinkErrorDetector._RenderAllPages
(self)
Traverses the public templates directory rendering each URL and processing the resultant html to pull out all links and anchors.
Traverses the public templates directory rendering each URL and processing the resultant html to pull out all links and anchors.
[ "Traverses", "the", "public", "templates", "directory", "rendering", "each", "URL", "and", "processing", "the", "resultant", "html", "to", "pull", "out", "all", "links", "and", "anchors", "." ]
def _RenderAllPages(self): '''Traverses the public templates directory rendering each URL and processing the resultant html to pull out all links and anchors. ''' top_level_directories = ( ('docs/templates/public/', ''), ('docs/static/', 'static/'), ('docs/examples/', 'extensions/examp...
[ "def", "_RenderAllPages", "(", "self", ")", ":", "top_level_directories", "=", "(", "(", "'docs/templates/public/'", ",", "''", ")", ",", "(", "'docs/static/'", ",", "'static/'", ")", ",", "(", "'docs/examples/'", ",", "'extensions/examples/'", ")", ",", ")", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/link_error_detector.py#L141-L158
scribusproject/scribus
41ec7c775a060912cf251682a8b1437f753f80f4
scribus/plugins/scripter/python/scripter_runtime.py
python
cleanup
()
delete every child which is not marked as keep
delete every child which is not marked as keep
[ "delete", "every", "child", "which", "is", "not", "marked", "as", "keep" ]
def cleanup(): """ delete every child which is not marked as keep """ for child in Scripter.collector.children(): if hasattr(child, "qt"): child = child.qt v = child.property("keep") if v and v.toBool() == True: #print "Keeping", child continue pr...
[ "def", "cleanup", "(", ")", ":", "for", "child", "in", "Scripter", ".", "collector", ".", "children", "(", ")", ":", "if", "hasattr", "(", "child", ",", "\"qt\"", ")", ":", "child", "=", "child", ".", "qt", "v", "=", "child", ".", "property", "(", ...
https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/scribus/plugins/scripter/python/scripter_runtime.py#L237-L248
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/utils/misc/grep-svn-log.py
python
Log.finish
(self)
Call this when you're finished with populating content.
Call this when you're finished with populating content.
[ "Call", "this", "when", "you", "re", "finished", "with", "populating", "content", "." ]
def finish(self): """Call this when you're finished with populating content.""" if self.prev_line is not None: print >> self, self.prev_line self.prev_line = None
[ "def", "finish", "(", "self", ")", ":", "if", "self", ".", "prev_line", "is", "not", "None", ":", "print", ">>", "self", ",", "self", ".", "prev_line", "self", ".", "prev_line", "=", "None" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/utils/misc/grep-svn-log.py#L48-L52
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py3/google/protobuf/descriptor_pool.py
python
DescriptorPool._GetDeps
(self, dependencies)
Recursively finds dependencies for file protos. Args: dependencies: The names of the files being depended on. Yields: Each direct and indirect dependency.
Recursively finds dependencies for file protos.
[ "Recursively", "finds", "dependencies", "for", "file", "protos", "." ]
def _GetDeps(self, dependencies): """Recursively finds dependencies for file protos. Args: dependencies: The names of the files being depended on. Yields: Each direct and indirect dependency. """ for dependency in dependencies: dep_desc = self.FindFileByName(dependency) yi...
[ "def", "_GetDeps", "(", "self", ",", "dependencies", ")", ":", "for", "dependency", "in", "dependencies", ":", "dep_desc", "=", "self", ".", "FindFileByName", "(", "dependency", ")", "yield", "dep_desc", "for", "parent_dep", "in", "dep_desc", ".", "dependencie...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/descriptor_pool.py#L1218-L1232
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/probability/distribution/logistic.py
python
Logistic._sd
(self, loc=None, scale=None)
return scale * self.consttensor(self.sd_const, self.dtypeop(scale))
The standard deviation of the distribution.
The standard deviation of the distribution.
[ "The", "standard", "deviation", "of", "the", "distribution", "." ]
def _sd(self, loc=None, scale=None): """ The standard deviation of the distribution. """ _, scale = self._check_param_type(loc, scale) return scale * self.consttensor(self.sd_const, self.dtypeop(scale))
[ "def", "_sd", "(", "self", ",", "loc", "=", "None", ",", "scale", "=", "None", ")", ":", "_", ",", "scale", "=", "self", ".", "_check_param_type", "(", "loc", ",", "scale", ")", "return", "scale", "*", "self", ".", "consttensor", "(", "self", ".", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/logistic.py#L255-L260
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/motionplanning.py
python
CSpaceInterface.setVisibilityPrior
(self, name, costPrior=0.0, visibilityProbability=0.0, evidenceStrength=1.0)
return _motionplanning.CSpaceInterface_setVisibilityPrior(self, name, costPrior, visibilityProbability, evidenceStrength)
setVisibilityPrior(CSpaceInterface self, char const * name, double costPrior=0.0, double visibilityProbability=0.0, double evidenceStrength=1.0) setVisibilityPrior(CSpaceInterface self, char const * name, double costPrior=0.0, double visibilityProbability=0.0) setVisibilityPrior(CSpaceInterface self, ch...
setVisibilityPrior(CSpaceInterface self, char const * name, double costPrior=0.0, double visibilityProbability=0.0, double evidenceStrength=1.0) setVisibilityPrior(CSpaceInterface self, char const * name, double costPrior=0.0, double visibilityProbability=0.0) setVisibilityPrior(CSpaceInterface self, ch...
[ "setVisibilityPrior", "(", "CSpaceInterface", "self", "char", "const", "*", "name", "double", "costPrior", "=", "0", ".", "0", "double", "visibilityProbability", "=", "0", ".", "0", "double", "evidenceStrength", "=", "1", ".", "0", ")", "setVisibilityPrior", "...
def setVisibilityPrior(self, name, costPrior=0.0, visibilityProbability=0.0, evidenceStrength=1.0): """ setVisibilityPrior(CSpaceInterface self, char const * name, double costPrior=0.0, double visibilityProbability=0.0, double evidenceStrength=1.0) setVisibilityPrior(CSpaceInterface self, char c...
[ "def", "setVisibilityPrior", "(", "self", ",", "name", ",", "costPrior", "=", "0.0", ",", "visibilityProbability", "=", "0.0", ",", "evidenceStrength", "=", "1.0", ")", ":", "return", "_motionplanning", ".", "CSpaceInterface_setVisibilityPrior", "(", "self", ",", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/motionplanning.py#L634-L647
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py
python
WhileContext._MaybeAddControlDependency
(self, op)
Add a control input to the op if it only depends on loop invariants.
Add a control input to the op if it only depends on loop invariants.
[ "Add", "a", "control", "input", "to", "the", "op", "if", "it", "only", "depends", "on", "loop", "invariants", "." ]
def _MaybeAddControlDependency(self, op): """Add a control input to the op if it only depends on loop invariants.""" def _IsOpFree(op): if op.control_inputs: return False for x in op.inputs: if not _IsLoopConstantEnter(x.op): return False return True if _IsOpFree(...
[ "def", "_MaybeAddControlDependency", "(", "self", ",", "op", ")", ":", "def", "_IsOpFree", "(", "op", ")", ":", "if", "op", ".", "control_inputs", ":", "return", "False", "for", "x", "in", "op", ".", "inputs", ":", "if", "not", "_IsLoopConstantEnter", "(...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L1544-L1555
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
chrome/common/extensions/docs/server2/api_data_source.py
python
_JSCModel._GetIntroTableList
(self)
return intro_rows
Create a generic data structure that can be traversed by the templates to create an API intro table.
Create a generic data structure that can be traversed by the templates to create an API intro table.
[ "Create", "a", "generic", "data", "structure", "that", "can", "be", "traversed", "by", "the", "templates", "to", "create", "an", "API", "intro", "table", "." ]
def _GetIntroTableList(self): '''Create a generic data structure that can be traversed by the templates to create an API intro table. ''' intro_rows = [ self._GetIntroDescriptionRow(), self._GetIntroAvailabilityRow() ] + self._GetIntroDependencyRows() # Add rows using data from intr...
[ "def", "_GetIntroTableList", "(", "self", ")", ":", "intro_rows", "=", "[", "self", ".", "_GetIntroDescriptionRow", "(", ")", ",", "self", ".", "_GetIntroAvailabilityRow", "(", ")", "]", "+", "self", ".", "_GetIntroDependencyRows", "(", ")", "# Add rows using da...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/api_data_source.py#L334-L352
wujixiu/helmet-detection
8eff5c59ddfba5a29e0b76aeb48babcb49246178
hardhat-wearing-detection/SSD-RPA/scripts/cpp_lint.py
python
CheckComment
(comment, filename, linenum, error)
Checks for common mistakes in TODO comments. Args: comment: The text of the comment from the line in question. filename: The name of the current file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for common mistakes in TODO comments.
[ "Checks", "for", "common", "mistakes", "in", "TODO", "comments", "." ]
def CheckComment(comment, filename, linenum, error): """Checks for common mistakes in TODO comments. Args: comment: The text of the comment from the line in question. filename: The name of the current file. linenum: The number of the line to check. error: The function to call with any errors found....
[ "def", "CheckComment", "(", "comment", ",", "filename", ",", "linenum", ",", "error", ")", ":", "match", "=", "_RE_PATTERN_TODO", ".", "match", "(", "comment", ")", "if", "match", ":", "# One whitespace is correct; zero whitespace is handled elsewhere.", "leading_whit...
https://github.com/wujixiu/helmet-detection/blob/8eff5c59ddfba5a29e0b76aeb48babcb49246178/hardhat-wearing-detection/SSD-RPA/scripts/cpp_lint.py#L2461-L2488
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/math_ops.py
python
cumsum
(x, axis=0, exclusive=False, reverse=False, name=None)
Compute the cumulative sum of the tensor `x` along `axis`. By default, this op performs an inclusive cumsum, which means that the first element of the input is identical to the first element of the output: ```prettyprint tf.cumsum([a, b, c]) ==> [a, a + b, a + b + c] ``` By setting the `exclusive` kwarg t...
Compute the cumulative sum of the tensor `x` along `axis`.
[ "Compute", "the", "cumulative", "sum", "of", "the", "tensor", "x", "along", "axis", "." ]
def cumsum(x, axis=0, exclusive=False, reverse=False, name=None): """Compute the cumulative sum of the tensor `x` along `axis`. By default, this op performs an inclusive cumsum, which means that the first element of the input is identical to the first element of the output: ```prettyprint tf.cumsum([a, b, c]...
[ "def", "cumsum", "(", "x", ",", "axis", "=", "0", ",", "exclusive", "=", "False", ",", "reverse", "=", "False", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "x", "]", ",", "name", ",", "\"Cumsum\"", ")", "as", "...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L1605-L1646
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/difflib.py
python
Differ._fancy_replace
(self, a, alo, ahi, b, blo, bhi)
r""" When replacing one block of lines with another, search the blocks for *similar* lines; the best-matching pair (if any) is used as a synch point, and intraline difference marking is done on the similar pair. Lots of work, but often worth it. Example: >>> d = Differ(...
r""" When replacing one block of lines with another, search the blocks for *similar* lines; the best-matching pair (if any) is used as a synch point, and intraline difference marking is done on the similar pair. Lots of work, but often worth it.
[ "r", "When", "replacing", "one", "block", "of", "lines", "with", "another", "search", "the", "blocks", "for", "*", "similar", "*", "lines", ";", "the", "best", "-", "matching", "pair", "(", "if", "any", ")", "is", "used", "as", "a", "synch", "point", ...
def _fancy_replace(self, a, alo, ahi, b, blo, bhi): r""" When replacing one block of lines with another, search the blocks for *similar* lines; the best-matching pair (if any) is used as a synch point, and intraline difference marking is done on the similar pair. Lots of work, bu...
[ "def", "_fancy_replace", "(", "self", ",", "a", ",", "alo", ",", "ahi", ",", "b", ",", "blo", ",", "bhi", ")", ":", "# don't synch up unless the lines have a similarity score of at", "# least cutoff; best_ratio tracks the best score seen so far", "best_ratio", ",", "cutof...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/difflib.py#L928-L1020
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/stats/_continuous_distns.py
python
crystalball_gen._munp
(self, n, beta, m)
return N * _lazywhere(n + 1 < m, (n, beta, m), np.vectorize(n_th_moment, otypes=[np.float]), np.inf)
Returns the n-th non-central moment of the crystalball function.
Returns the n-th non-central moment of the crystalball function.
[ "Returns", "the", "n", "-", "th", "non", "-", "central", "moment", "of", "the", "crystalball", "function", "." ]
def _munp(self, n, beta, m): """ Returns the n-th non-central moment of the crystalball function. """ N = 1.0 / (m/beta / (m-1) * np.exp(-beta**2 / 2.0) + _norm_pdf_C * _norm_cdf(beta)) def n_th_moment(n, beta, m): """ Returns n-th mome...
[ "def", "_munp", "(", "self", ",", "n", ",", "beta", ",", "m", ")", ":", "N", "=", "1.0", "/", "(", "m", "/", "beta", "/", "(", "m", "-", "1", ")", "*", "np", ".", "exp", "(", "-", "beta", "**", "2", "/", "2.0", ")", "+", "_norm_pdf_C", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/_continuous_distns.py#L7025-L7049
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py
python
_GetPdbPath
(target_dict, config_name, vars)
return pdb_path
Returns the path to the PDB file that will be generated by a given configuration. The lookup proceeds as follows: - Look for an explicit path in the VCLinkerTool configuration block. - Look for an 'msvs_large_pdb_path' variable. - Use '<(PRODUCT_DIR)/<(product_name).(exe|dll).pdb' if 'product_name' is ...
Returns the path to the PDB file that will be generated by a given configuration.
[ "Returns", "the", "path", "to", "the", "PDB", "file", "that", "will", "be", "generated", "by", "a", "given", "configuration", "." ]
def _GetPdbPath(target_dict, config_name, vars): """Returns the path to the PDB file that will be generated by a given configuration. The lookup proceeds as follows: - Look for an explicit path in the VCLinkerTool configuration block. - Look for an 'msvs_large_pdb_path' variable. - Use '<(PRODUCT_DIR...
[ "def", "_GetPdbPath", "(", "target_dict", ",", "config_name", ",", "vars", ")", ":", "config", "=", "target_dict", "[", "'configurations'", "]", "[", "config_name", "]", "msvs", "=", "config", ".", "setdefault", "(", "'msvs_settings'", ",", "{", "}", ")", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py#L128-L165
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_distutils/ccompiler.py
python
gen_lib_options
(compiler, library_dirs, runtime_library_dirs, libraries)
return lib_opts
Generate linker options for searching library directories and linking with specific libraries. 'libraries' and 'library_dirs' are, respectively, lists of library names (not filenames!) and search directories. Returns a list of command-line options suitable for use with some compiler (depending on the ...
Generate linker options for searching library directories and linking with specific libraries. 'libraries' and 'library_dirs' are, respectively, lists of library names (not filenames!) and search directories. Returns a list of command-line options suitable for use with some compiler (depending on the ...
[ "Generate", "linker", "options", "for", "searching", "library", "directories", "and", "linking", "with", "specific", "libraries", ".", "libraries", "and", "library_dirs", "are", "respectively", "lists", "of", "library", "names", "(", "not", "filenames!", ")", "and...
def gen_lib_options (compiler, library_dirs, runtime_library_dirs, libraries): """Generate linker options for searching library directories and linking with specific libraries. 'libraries' and 'library_dirs' are, respectively, lists of library names (not filenames!) and search directories. Returns a l...
[ "def", "gen_lib_options", "(", "compiler", ",", "library_dirs", ",", "runtime_library_dirs", ",", "libraries", ")", ":", "lib_opts", "=", "[", "]", "for", "dir", "in", "library_dirs", ":", "lib_opts", ".", "append", "(", "compiler", ".", "library_dir_option", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/ccompiler.py#L1087-L1123
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2_SelfTest_REQUEST.initFromTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def initFromTpm(self, buf): """ TpmMarshaller method """ self.fullTest = buf.readByte()
[ "def", "initFromTpm", "(", "self", ",", "buf", ")", ":", "self", ".", "fullTest", "=", "buf", ".", "readByte", "(", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L9140-L9142
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/ttk.py
python
Progressbar.__init__
(self, master=None, **kw)
Construct a Ttk Progressbar with parent master. STANDARD OPTIONS class, cursor, style, takefocus WIDGET-SPECIFIC OPTIONS orient, length, mode, maximum, value, variable, phase
Construct a Ttk Progressbar with parent master.
[ "Construct", "a", "Ttk", "Progressbar", "with", "parent", "master", "." ]
def __init__(self, master=None, **kw): """Construct a Ttk Progressbar with parent master. STANDARD OPTIONS class, cursor, style, takefocus WIDGET-SPECIFIC OPTIONS orient, length, mode, maximum, value, variable, phase """ Widget.__init__(self, master, "...
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "*", "*", "kw", ")", ":", "Widget", ".", "__init__", "(", "self", ",", "master", ",", "\"ttk::progressbar\"", ",", "kw", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/ttk.py#L999-L1010
shader-slang/slang
b8982fcf43b86c1e39dcc3dd19bff2821633eda6
external/vulkan/registry/reg.py
python
Registry.checkForCorrectionAliases
(self, alias, require, tag)
return False
Check for an alias in the same require block. - alias - String name of the alias - require - `<require>` block from the registry - tag - tag to look for in the require block
Check for an alias in the same require block.
[ "Check", "for", "an", "alias", "in", "the", "same", "require", "block", "." ]
def checkForCorrectionAliases(self, alias, require, tag): """Check for an alias in the same require block. - alias - String name of the alias - require - `<require>` block from the registry - tag - tag to look for in the require block""" if alias and require.findall(tag + "[@n...
[ "def", "checkForCorrectionAliases", "(", "self", ",", "alias", ",", "require", ",", "tag", ")", ":", "if", "alias", "and", "require", ".", "findall", "(", "tag", "+", "\"[@name='\"", "+", "alias", "+", "\"']\"", ")", ":", "return", "True", "return", "Fal...
https://github.com/shader-slang/slang/blob/b8982fcf43b86c1e39dcc3dd19bff2821633eda6/external/vulkan/registry/reg.py#L810-L820
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
examples/pycaffe/layers/pascal_multilabel_datalayers.py
python
BatchLoader.load_next_image
(self)
return self.transformer.preprocess(im), multilabel
Load the next image in a batch.
Load the next image in a batch.
[ "Load", "the", "next", "image", "in", "a", "batch", "." ]
def load_next_image(self): """ Load the next image in a batch. """ # Did we finish an epoch? if self._cur == len(self.indexlist): self._cur = 0 shuffle(self.indexlist) # Load an image index = self.indexlist[self._cur] # Get the image inde...
[ "def", "load_next_image", "(", "self", ")", ":", "# Did we finish an epoch?", "if", "self", ".", "_cur", "==", "len", "(", "self", ".", "indexlist", ")", ":", "self", ".", "_cur", "=", "0", "shuffle", "(", "self", ".", "indexlist", ")", "# Load an image", ...
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/pycaffe/layers/pascal_multilabel_datalayers.py#L142-L173
JarveeLee/SynthText_Chinese_version
4b2cbc7d14741f21d0bb17966a339ab3574b09a8
synthgen.py
python
RendererV3.render_text
(self,rgb,depth,seg,area,label,ninstance=1,viz=False)
return res
rgb : HxWx3 image rgb values (uint8) depth : HxW depth values (float) seg : HxW segmentation region masks area : number of pixels in each region label : region labels == unique(seg) / {0} i.e., indices of pixels in SEG which constitute a region mask ...
rgb : HxWx3 image rgb values (uint8) depth : HxW depth values (float) seg : HxW segmentation region masks area : number of pixels in each region label : region labels == unique(seg) / {0} i.e., indices of pixels in SEG which constitute a region mask ...
[ "rgb", ":", "HxWx3", "image", "rgb", "values", "(", "uint8", ")", "depth", ":", "HxW", "depth", "values", "(", "float", ")", "seg", ":", "HxW", "segmentation", "region", "masks", "area", ":", "number", "of", "pixels", "in", "each", "region", "label", "...
def render_text(self,rgb,depth,seg,area,label,ninstance=1,viz=False): """ rgb : HxWx3 image rgb values (uint8) depth : HxW depth values (float) seg : HxW segmentation region masks area : number of pixels in each region label : region labels == unique(seg) / {0} ...
[ "def", "render_text", "(", "self", ",", "rgb", ",", "depth", ",", "seg", ",", "area", ",", "label", ",", "ninstance", "=", "1", ",", "viz", "=", "False", ")", ":", "try", ":", "# depth -> xyz", "xyz", "=", "su", ".", "DepthCamera", ".", "depth2xyz", ...
https://github.com/JarveeLee/SynthText_Chinese_version/blob/4b2cbc7d14741f21d0bb17966a339ab3574b09a8/synthgen.py#L585-L698
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/ensemble/_gb.py
python
VerboseReporter.update
(self, j, est)
Update reporter with new iteration. Parameters ---------- j : int The new iteration est : Estimator The estimator
Update reporter with new iteration.
[ "Update", "reporter", "with", "new", "iteration", "." ]
def update(self, j, est): """Update reporter with new iteration. Parameters ---------- j : int The new iteration est : Estimator The estimator """ do_oob = est.subsample < 1 # we need to take into account if we fit additional estim...
[ "def", "update", "(", "self", ",", "j", ",", "est", ")", ":", "do_oob", "=", "est", ".", "subsample", "<", "1", "# we need to take into account if we fit additional estimators.", "i", "=", "j", "-", "self", ".", "begin_at_stage", "# iteration relative to the start i...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/ensemble/_gb.py#L1136-L1163
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rcode.py
python
from_text
(text)
return v
Convert text into an rcode. @param text: the texual rcode @type text: string @raises UnknownRcode: the rcode is unknown @rtype: int
Convert text into an rcode.
[ "Convert", "text", "into", "an", "rcode", "." ]
def from_text(text): """Convert text into an rcode. @param text: the texual rcode @type text: string @raises UnknownRcode: the rcode is unknown @rtype: int """ if text.isdigit(): v = int(text) if v >= 0 and v <= 4095: return v v = _by_text.get(text.upper()) ...
[ "def", "from_text", "(", "text", ")", ":", "if", "text", ".", "isdigit", "(", ")", ":", "v", "=", "int", "(", "text", ")", "if", "v", ">=", "0", "and", "v", "<=", "4095", ":", "return", "v", "v", "=", "_by_text", ".", "get", "(", "text", ".",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rcode.py#L59-L75
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
python
pooling_nchw_max
( I=TensorDef(T1, S.N, S.C, S.OH * S.SH + S.KH * S.DH, S.OW * S.SW + S.KW * S.DW), K=TensorDef(T2, S.KH, S.KW, index_dims=[D.kh, D.kw]), O=TensorDef(U, S.N, S.C, S.OH, S.OW, output=True), strides=IndexAttrDef(S.SH, S.SW), dilations=IndexAttrDef(S.DH, S.DW))
Performs max pooling. Numeric casting is performed on the input operand, promoting it to the same data type as the accumulator/output.
Performs max pooling.
[ "Performs", "max", "pooling", "." ]
def pooling_nchw_max( I=TensorDef(T1, S.N, S.C, S.OH * S.SH + S.KH * S.DH, S.OW * S.SW + S.KW * S.DW), K=TensorDef(T2, S.KH, S.KW, index_dims=[D.kh, D.kw]), O=TensorDef(U, S.N, S.C, S.OH, S.OW, output=True), strides=IndexAttrDef(S.SH, S.SW), dilations=IndexAttrDef(S.DH, S.DW)): """...
[ "def", "pooling_nchw_max", "(", "I", "=", "TensorDef", "(", "T1", ",", "S", ".", "N", ",", "S", ".", "C", ",", "S", ".", "OH", "*", "S", ".", "SH", "+", "S", ".", "KH", "*", "S", ".", "DH", ",", "S", ".", "OW", "*", "S", ".", "SW", "+",...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py#L508-L525
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/internal/flops_registry.py
python
_equal_flops
(graph, node)
return _binary_per_element_op_flops(graph, node)
Compute flops for Equal operation.
Compute flops for Equal operation.
[ "Compute", "flops", "for", "Equal", "operation", "." ]
def _equal_flops(graph, node): """Compute flops for Equal operation.""" return _binary_per_element_op_flops(graph, node)
[ "def", "_equal_flops", "(", "graph", ",", "node", ")", ":", "return", "_binary_per_element_op_flops", "(", "graph", ",", "node", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/internal/flops_registry.py#L220-L222
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListMainWindow.PaintWaterMark
(self, dc)
Draws a watermark at the bottom right of :class:`UltimateListCtrl`. :param `dc`: an instance of :class:`DC`. .. todo:: Better support for this is needed.
Draws a watermark at the bottom right of :class:`UltimateListCtrl`.
[ "Draws", "a", "watermark", "at", "the", "bottom", "right", "of", ":", "class", ":", "UltimateListCtrl", "." ]
def PaintWaterMark(self, dc): """ Draws a watermark at the bottom right of :class:`UltimateListCtrl`. :param `dc`: an instance of :class:`DC`. .. todo:: Better support for this is needed. """ if not self._waterMark: return width, height = self.Calc...
[ "def", "PaintWaterMark", "(", "self", ",", "dc", ")", ":", "if", "not", "self", ".", "_waterMark", ":", "return", "width", ",", "height", "=", "self", ".", "CalcUnscrolledPosition", "(", "*", "self", ".", "GetClientSize", "(", ")", ")", "bitmapW", "=", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L7236-L7256
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/feature_column/feature_column_v2.py
python
EmbeddingColumn._get_dense_tensor_internal
(self, sparse_tensors, state_manager)
return self._get_dense_tensor_internal_helper(sparse_tensors, embedding_weights)
Private method that follows the signature of get_dense_tensor.
Private method that follows the signature of get_dense_tensor.
[ "Private", "method", "that", "follows", "the", "signature", "of", "get_dense_tensor", "." ]
def _get_dense_tensor_internal(self, sparse_tensors, state_manager): """Private method that follows the signature of get_dense_tensor.""" embedding_weights = state_manager.get_variable( self, name='embedding_weights') return self._get_dense_tensor_internal_helper(sparse_tensors, ...
[ "def", "_get_dense_tensor_internal", "(", "self", ",", "sparse_tensors", ",", "state_manager", ")", ":", "embedding_weights", "=", "state_manager", ".", "get_variable", "(", "self", ",", "name", "=", "'embedding_weights'", ")", "return", "self", ".", "_get_dense_ten...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/feature_column/feature_column_v2.py#L3004-L3009
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/multiprocessing/__init__.py
python
Manager
()
return m
Returns a manager associated with a running server process The managers methods such as `Lock()`, `Condition()` and `Queue()` can be used to create shared objects.
Returns a manager associated with a running server process
[ "Returns", "a", "manager", "associated", "with", "a", "running", "server", "process" ]
def Manager(): ''' Returns a manager associated with a running server process The managers methods such as `Lock()`, `Condition()` and `Queue()` can be used to create shared objects. ''' from multiprocessing.managers import SyncManager m = SyncManager() m.start() return m
[ "def", "Manager", "(", ")", ":", "from", "multiprocessing", ".", "managers", "import", "SyncManager", "m", "=", "SyncManager", "(", ")", "m", ".", "start", "(", ")", "return", "m" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/multiprocessing/__init__.py#L89-L99
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
prj/app/prj.py
python
System.image
(self)
return os.path.join(self.output, 'system')
The image of this system once built. The system image is currently represented as the path to the linked executable. In the future, more complex, class-based representations of system images might be introduced.
The image of this system once built. The system image is currently represented as the path to the linked executable. In the future, more complex, class-based representations of system images might be introduced.
[ "The", "image", "of", "this", "system", "once", "built", ".", "The", "system", "image", "is", "currently", "represented", "as", "the", "path", "to", "the", "linked", "executable", ".", "In", "the", "future", "more", "complex", "class", "-", "based", "repre...
def image(self): """The image of this system once built. The system image is currently represented as the path to the linked executable. In the future, more complex, class-based representations of system images might be introduced. """ return os.path.join(self.output, 'system')
[ "def", "image", "(", "self", ")", ":", "return", "os", ".", "path", ".", "join", "(", "self", ".", "output", ",", "'system'", ")" ]
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/prj/app/prj.py#L670-L677
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
GraphicsContext.SetPen
(*args)
return _gdi_.GraphicsContext_SetPen(*args)
SetPen(self, GraphicsPen pen) SetPen(self, Pen pen) Sets the stroke pen
SetPen(self, GraphicsPen pen) SetPen(self, Pen pen)
[ "SetPen", "(", "self", "GraphicsPen", "pen", ")", "SetPen", "(", "self", "Pen", "pen", ")" ]
def SetPen(*args): """ SetPen(self, GraphicsPen pen) SetPen(self, Pen pen) Sets the stroke pen """ return _gdi_.GraphicsContext_SetPen(*args)
[ "def", "SetPen", "(", "*", "args", ")", ":", "return", "_gdi_", ".", "GraphicsContext_SetPen", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L6310-L6317
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftobjects/pointarray.py
python
PointArray.onDocumentRestored
(self, obj)
return super(PointArray, self).onDocumentRestored(obj)
Execute code when the document is restored. Add properties that don't exist and migrate old properties.
Execute code when the document is restored.
[ "Execute", "code", "when", "the", "document", "is", "restored", "." ]
def onDocumentRestored(self, obj): """Execute code when the document is restored. Add properties that don't exist and migrate old properties. """ # If the ExtraPlacement property has never been added before # it will add it first, and set it to the base object's position ...
[ "def", "onDocumentRestored", "(", "self", ",", "obj", ")", ":", "# If the ExtraPlacement property has never been added before", "# it will add it first, and set it to the base object's position", "# in order to produce the same displacement as before.", "# Then all the other properties will be...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftobjects/pointarray.py#L127-L149
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/ragged/ragged_math_ops.py
python
reduce_min
(input_tensor: ragged_tensor.Ragged, axis=None, keepdims=None, name=None)
return ragged_reduce_aggregate( reduce_op=math_ops.reduce_min, unsorted_segment_op=math_ops.unsorted_segment_min, rt_input=input_tensor, axis=axis, keepdims=keepdims, name=(name or 'RaggedReduceMin'))
For docs, see: _RAGGED_REDUCE_DOCSTRING.
For docs, see: _RAGGED_REDUCE_DOCSTRING.
[ "For", "docs", "see", ":", "_RAGGED_REDUCE_DOCSTRING", "." ]
def reduce_min(input_tensor: ragged_tensor.Ragged, axis=None, keepdims=None, name=None): """For docs, see: _RAGGED_REDUCE_DOCSTRING.""" return ragged_reduce_aggregate( reduce_op=math_ops.reduce_min, unsorted_segment_op=math_ops.unsorted_segment_min, rt_...
[ "def", "reduce_min", "(", "input_tensor", ":", "ragged_tensor", ".", "Ragged", ",", "axis", "=", "None", ",", "keepdims", "=", "None", ",", "name", "=", "None", ")", ":", "return", "ragged_reduce_aggregate", "(", "reduce_op", "=", "math_ops", ".", "reduce_mi...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ragged/ragged_math_ops.py#L639-L650
gklz1982/caffe-yolov2
ebb27029db4ddc0d40e520634633b0fa9cdcc10d
scripts/cpp_lint.py
python
_IncludeState.CheckNextIncludeOrder
(self, header_type)
return ''
Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The empty string if the header is in the right order, or a...
Returns a non-empty error message if the next header is out of order.
[ "Returns", "a", "non", "-", "empty", "error", "message", "if", "the", "next", "header", "is", "out", "of", "order", "." ]
def CheckNextIncludeOrder(self, header_type): """Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The e...
[ "def", "CheckNextIncludeOrder", "(", "self", ",", "header_type", ")", ":", "error_message", "=", "(", "'Found %s after %s'", "%", "(", "self", ".", "_TYPE_NAMES", "[", "header_type", "]", ",", "self", ".", "_SECTION_NAMES", "[", "self", ".", "_section", "]", ...
https://github.com/gklz1982/caffe-yolov2/blob/ebb27029db4ddc0d40e520634633b0fa9cdcc10d/scripts/cpp_lint.py#L633-L684
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
StandardPaths_Get
(*args)
return _misc_.StandardPaths_Get(*args)
StandardPaths_Get() -> StandardPaths Return the global standard paths singleton
StandardPaths_Get() -> StandardPaths
[ "StandardPaths_Get", "()", "-", ">", "StandardPaths" ]
def StandardPaths_Get(*args): """ StandardPaths_Get() -> StandardPaths Return the global standard paths singleton """ return _misc_.StandardPaths_Get(*args)
[ "def", "StandardPaths_Get", "(", "*", "args", ")", ":", "return", "_misc_", ".", "StandardPaths_Get", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L6472-L6478
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usdImaging/usdviewq/appController.py
python
AppController._getPrimsFromPaths
(self, paths)
return prims
Get all prims from a list of paths.
Get all prims from a list of paths.
[ "Get", "all", "prims", "from", "a", "list", "of", "paths", "." ]
def _getPrimsFromPaths(self, paths): """Get all prims from a list of paths.""" prims = [] for path in paths: # Ensure we have an Sdf.Path, not a string. sdfPath = Sdf.Path(str(path)) prim = self._dataModel.stage.GetPrimAtPath( sdfPath.GetAbs...
[ "def", "_getPrimsFromPaths", "(", "self", ",", "paths", ")", ":", "prims", "=", "[", "]", "for", "path", "in", "paths", ":", "# Ensure we have an Sdf.Path, not a string.", "sdfPath", "=", "Sdf", ".", "Path", "(", "str", "(", "path", ")", ")", "prim", "=", ...
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/appController.py#L3257-L3273
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/types.py
python
prepare_class
(name, bases=(), kwds=None)
return meta, ns, kwds
Call the __prepare__ method of the appropriate metaclass. Returns (metaclass, namespace, kwds) as a 3-tuple *metaclass* is the appropriate metaclass *namespace* is the prepared class namespace *kwds* is an updated copy of the passed in kwds argument with any 'metaclass' entry removed. If no kwds a...
Call the __prepare__ method of the appropriate metaclass.
[ "Call", "the", "__prepare__", "method", "of", "the", "appropriate", "metaclass", "." ]
def prepare_class(name, bases=(), kwds=None): """Call the __prepare__ method of the appropriate metaclass. Returns (metaclass, namespace, kwds) as a 3-tuple *metaclass* is the appropriate metaclass *namespace* is the prepared class namespace *kwds* is an updated copy of the passed in kwds argument...
[ "def", "prepare_class", "(", "name", ",", "bases", "=", "(", ")", ",", "kwds", "=", "None", ")", ":", "if", "kwds", "is", "None", ":", "kwds", "=", "{", "}", "else", ":", "kwds", "=", "dict", "(", "kwds", ")", "# Don't alter the provided mapping", "i...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/types.py#L93-L123
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
Grid_GetClassDefaultAttributes
(*args, **kwargs)
return _grid.Grid_GetClassDefaultAttributes(*args, **kwargs)
Grid_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 fo...
Grid_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
[ "Grid_GetClassDefaultAttributes", "(", "int", "variant", "=", "WINDOW_VARIANT_NORMAL", ")", "-", ">", "VisualAttributes" ]
def Grid_GetClassDefaultAttributes(*args, **kwargs): """ Grid_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...
[ "def", "Grid_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L2261-L2276
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/thrift/TMultiplexedProcessor.py
python
TMultiplexedProcessor.registerDefault
(self, processor)
If a non-multiplexed processor connects to the server and wants to communicate, use the given processor to handle it. This mechanism allows servers to upgrade from non-multiplexed to multiplexed in a backwards-compatible way and still handle old clients.
If a non-multiplexed processor connects to the server and wants to communicate, use the given processor to handle it. This mechanism allows servers to upgrade from non-multiplexed to multiplexed in a backwards-compatible way and still handle old clients.
[ "If", "a", "non", "-", "multiplexed", "processor", "connects", "to", "the", "server", "and", "wants", "to", "communicate", "use", "the", "given", "processor", "to", "handle", "it", ".", "This", "mechanism", "allows", "servers", "to", "upgrade", "from", "non"...
def registerDefault(self, processor): """ If a non-multiplexed processor connects to the server and wants to communicate, use the given processor to handle it. This mechanism allows servers to upgrade from non-multiplexed to multiplexed in a backwards-compatible way and still ha...
[ "def", "registerDefault", "(", "self", ",", "processor", ")", ":", "self", ".", "defaultProcessor", "=", "processor" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/thrift/TMultiplexedProcessor.py#L30-L37
fengbingchun/NN_Test
d6305825d5273e4569ccd1eda9ffa2a9c72e18d2
src/tiny-dnn/third_party/gemmlowp/meta/generators/qnt_Nx8_neon.py
python
GenerateMultiQuantize
(emitter, aligned, rows)
Emit main quantization code that switches between optimized versions.
Emit main quantization code that switches between optimized versions.
[ "Emit", "main", "quantization", "code", "that", "switches", "between", "optimized", "versions", "." ]
def GenerateMultiQuantize(emitter, aligned, rows): """Emit main quantization code that switches between optimized versions.""" name = BuildMultiQuantizeName(aligned, rows) emitter.EmitFunctionBeginA(name, [['const std::int32_t*', 'source'], ['std::int32_t', 'count'], ...
[ "def", "GenerateMultiQuantize", "(", "emitter", ",", "aligned", ",", "rows", ")", ":", "name", "=", "BuildMultiQuantizeName", "(", "aligned", ",", "rows", ")", "emitter", ".", "EmitFunctionBeginA", "(", "name", ",", "[", "[", "'const std::int32_t*'", ",", "'so...
https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/gemmlowp/meta/generators/qnt_Nx8_neon.py#L221-L247
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py
python
Decimal.__mul__
(self, other, context=None)
return ans
Return self * other. (+-) INF * 0 (or its reverse) raise InvalidOperation.
Return self * other.
[ "Return", "self", "*", "other", "." ]
def __mul__(self, other, context=None): """Return self * other. (+-) INF * 0 (or its reverse) raise InvalidOperation. """ other = _convert_other(other) if other is NotImplemented: return other if context is None: context = getcontext() r...
[ "def", "__mul__", "(", "self", ",", "other", ",", "context", "=", "None", ")", ":", "other", "=", "_convert_other", "(", "other", ")", "if", "other", "is", "NotImplemented", ":", "return", "other", "if", "context", "is", "None", ":", "context", "=", "g...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py#L1236-L1290
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/polynomial/polyutils.py
python
mapparms
(old, new)
return off, scl
Linear map parameters between domains. Return the parameters of the linear map ``offset + scale*x`` that maps `old` to `new` such that ``old[i] -> new[i]``, ``i = 0, 1``. Parameters ---------- old, new : array_like Domains. Each domain must (successfully) convert to a 1-d array con...
Linear map parameters between domains.
[ "Linear", "map", "parameters", "between", "domains", "." ]
def mapparms(old, new) : """ Linear map parameters between domains. Return the parameters of the linear map ``offset + scale*x`` that maps `old` to `new` such that ``old[i] -> new[i]``, ``i = 0, 1``. Parameters ---------- old, new : array_like Domains. Each domain must (successfull...
[ "def", "mapparms", "(", "old", ",", "new", ")", ":", "oldlen", "=", "old", "[", "1", "]", "-", "old", "[", "0", "]", "newlen", "=", "new", "[", "1", "]", "-", "new", "[", "0", "]", "off", "=", "(", "old", "[", "1", "]", "*", "new", "[", ...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/polynomial/polyutils.py#L282-L327
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/framework/convert_to_constants.py
python
_ConverterData.graph_def
(self)
return self._graph_def
The graph to be converted.
The graph to be converted.
[ "The", "graph", "to", "be", "converted", "." ]
def graph_def(self): """The graph to be converted.""" return self._graph_def
[ "def", "graph_def", "(", "self", ")", ":", "return", "self", ".", "_graph_def" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/convert_to_constants.py#L730-L732
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/sslproto.py
python
SSLProtocol.connection_lost
(self, exc)
Called when the low-level connection is lost or closed. The argument is an exception object or None (the latter meaning a regular EOF is received or the connection was aborted or closed).
Called when the low-level connection is lost or closed.
[ "Called", "when", "the", "low", "-", "level", "connection", "is", "lost", "or", "closed", "." ]
def connection_lost(self, exc): """Called when the low-level connection is lost or closed. The argument is an exception object or None (the latter meaning a regular EOF is received or the connection was aborted or closed). """ if self._session_established: se...
[ "def", "connection_lost", "(", "self", ",", "exc", ")", ":", "if", "self", ".", "_session_established", ":", "self", ".", "_session_established", "=", "False", "self", ".", "_loop", ".", "call_soon", "(", "self", ".", "_app_protocol", ".", "connection_lost", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/sslproto.py#L484-L506
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/DraftVecUtils.py
python
isColinear
(vlist)
return True
Check if the vectors in the list are colinear. Colinear vectors are those whose angle between them is zero. This function tests for colinearity between the difference of the first two vectors, and the difference of the nth vector with the first vector. :: vlist = [a, b, c, d, ..., n] ...
Check if the vectors in the list are colinear.
[ "Check", "if", "the", "vectors", "in", "the", "list", "are", "colinear", "." ]
def isColinear(vlist): """Check if the vectors in the list are colinear. Colinear vectors are those whose angle between them is zero. This function tests for colinearity between the difference of the first two vectors, and the difference of the nth vector with the first vector. :: vlis...
[ "def", "isColinear", "(", "vlist", ")", ":", "typecheck", "(", "[", "(", "vlist", ",", "list", ")", "]", ",", "\"isColinear\"", ")", "# Return True if the list only has two vectors, why?", "# This doesn't test for colinearity between the first two vectors.", "if", "len", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/DraftVecUtils.py#L651-L716
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
GridTableBase.GetNumberRows
(*args, **kwargs)
return _grid.GridTableBase_GetNumberRows(*args, **kwargs)
GetNumberRows(self) -> int
GetNumberRows(self) -> int
[ "GetNumberRows", "(", "self", ")", "-", ">", "int" ]
def GetNumberRows(*args, **kwargs): """GetNumberRows(self) -> int""" return _grid.GridTableBase_GetNumberRows(*args, **kwargs)
[ "def", "GetNumberRows", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridTableBase_GetNumberRows", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L802-L804
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/lockfile/__init__.py
python
MkdirFileLock
(*args, **kwds)
return _fl_helper(mkdirlockfile.MkdirLockFile, "lockfile.mkdirlockfile", *args, **kwds)
Factory function provided for backwards compatibility. Do not use in new code. Instead, import MkdirLockFile from the lockfile.mkdirlockfile module.
Factory function provided for backwards compatibility.
[ "Factory", "function", "provided", "for", "backwards", "compatibility", "." ]
def MkdirFileLock(*args, **kwds): """Factory function provided for backwards compatibility. Do not use in new code. Instead, import MkdirLockFile from the lockfile.mkdirlockfile module. """ from . import mkdirlockfile return _fl_helper(mkdirlockfile.MkdirLockFile, "lockfile.mkdirlockfile", ...
[ "def", "MkdirFileLock", "(", "*", "args", ",", "*", "*", "kwds", ")", ":", "from", ".", "import", "mkdirlockfile", "return", "_fl_helper", "(", "mkdirlockfile", ".", "MkdirLockFile", ",", "\"lockfile.mkdirlockfile\"", ",", "*", "args", ",", "*", "*", "kwds",...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/lockfile/__init__.py#L293-L301
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/cross_device_utils.py
python
sum_grad_and_var_all_reduce
(grad_and_vars, num_workers, alg, gpu_indices, aux_devices=None, num_shards=1)
return result
Apply all-reduce algorithm over specified gradient tensors.
Apply all-reduce algorithm over specified gradient tensors.
[ "Apply", "all", "-", "reduce", "algorithm", "over", "specified", "gradient", "tensors", "." ]
def sum_grad_and_var_all_reduce(grad_and_vars, num_workers, alg, gpu_indices, aux_devices=None, num_shards=1): """Apply all-reduce algorithm over specified gr...
[ "def", "sum_grad_and_var_all_reduce", "(", "grad_and_vars", ",", "num_workers", ",", "alg", ",", "gpu_indices", ",", "aux_devices", "=", "None", ",", "num_shards", "=", "1", ")", ":", "with", "ops", ".", "name_scope", "(", "'allreduce'", ")", ":", "# Note that...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/cross_device_utils.py#L411-L449
GoSSIP-SJTU/Armariris
ad5d868482956b2194a77b39c8d543c7c2318200
utils/llvm-build/llvmbuild/main.py
python
add_magic_target_components
(parser, project, opts)
add_magic_target_components(project, opts) -> None Add the "magic" target based components to the project, which can only be determined based on the target configuration options. This currently is responsible for populating the required_libraries list of the "all-targets", "Native", "NativeCodeGen", a...
add_magic_target_components(project, opts) -> None
[ "add_magic_target_components", "(", "project", "opts", ")", "-", ">", "None" ]
def add_magic_target_components(parser, project, opts): """add_magic_target_components(project, opts) -> None Add the "magic" target based components to the project, which can only be determined based on the target configuration options. This currently is responsible for populating the required_librar...
[ "def", "add_magic_target_components", "(", "parser", ",", "project", ",", "opts", ")", ":", "# Determine the available targets.", "available_targets", "=", "dict", "(", "(", "ci", ".", "name", ",", "ci", ")", "for", "ci", "in", "project", ".", "component_infos",...
https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/utils/llvm-build/llvmbuild/main.py#L735-L841
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/framework/graph_util.py
python
set_cpu0
(device_string)
return parsed_device.to_string()
Creates a new device string based on `device_string' but using /CPU:0. If the device is already on /CPU:0, this is a no-op. Args: device_string: A device string. Returns: A device string.
Creates a new device string based on `device_string' but using /CPU:0.
[ "Creates", "a", "new", "device", "string", "based", "on", "device_string", "but", "using", "/", "CPU", ":", "0", "." ]
def set_cpu0(device_string): """Creates a new device string based on `device_string' but using /CPU:0. If the device is already on /CPU:0, this is a no-op. Args: device_string: A device string. Returns: A device string. """ parsed_device = pydev.DeviceSpec.from_string(device_string) parsed...
[ "def", "set_cpu0", "(", "device_string", ")", ":", "parsed_device", "=", "pydev", ".", "DeviceSpec", ".", "from_string", "(", "device_string", ")", "parsed_device", ".", "device_type", "=", "\"CPU\"", "parsed_device", ".", "device_index", "=", "0", "return", "pa...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/graph_util.py#L50-L64
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/SimpleHTTPServer.py
python
SimpleHTTPRequestHandler.do_HEAD
(self)
Serve a HEAD request.
Serve a HEAD request.
[ "Serve", "a", "HEAD", "request", "." ]
def do_HEAD(self): """Serve a HEAD request.""" f = self.send_head() if f: f.close()
[ "def", "do_HEAD", "(", "self", ")", ":", "f", "=", "self", ".", "send_head", "(", ")", "if", "f", ":", "f", ".", "close", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/SimpleHTTPServer.py#L49-L53
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/ogl/_composit.py
python
DivisionShape.ResizeAdjoining
(self, side, newPos, test)
return True
Resize adjoining divisions at the given side. If test is TRUE, just see whether it's possible for each adjoining region, returning FALSE if it's not. side can be one of: * DIVISION_SIDE_NONE * DIVISION_SIDE_LEFT * DIVISION_SIDE_TOP * DIVISION_SIDE_RIGHT ...
Resize adjoining divisions at the given side.
[ "Resize", "adjoining", "divisions", "at", "the", "given", "side", "." ]
def ResizeAdjoining(self, side, newPos, test): """Resize adjoining divisions at the given side. If test is TRUE, just see whether it's possible for each adjoining region, returning FALSE if it's not. side can be one of: * DIVISION_SIDE_NONE * DIVISION_SIDE_LEFT ...
[ "def", "ResizeAdjoining", "(", "self", ",", "side", ",", "newPos", ",", "test", ")", ":", "divisionParent", "=", "self", ".", "GetParent", "(", ")", "for", "division", "in", "divisionParent", ".", "GetDivisions", "(", ")", ":", "if", "side", "==", "DIVIS...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_composit.py#L1378-L1414
tensorflow/ngraph-bridge
ea6422491ec75504e78a63db029e7f74ec3479a5
examples/mnist/mnist_deep_simplified.py
python
conv2d
(x, W)
return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
conv2d returns a 2d convolution layer with full stride.
conv2d returns a 2d convolution layer with full stride.
[ "conv2d", "returns", "a", "2d", "convolution", "layer", "with", "full", "stride", "." ]
def conv2d(x, W): """conv2d returns a 2d convolution layer with full stride.""" return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
[ "def", "conv2d", "(", "x", ",", "W", ")", ":", "return", "tf", ".", "nn", ".", "conv2d", "(", "x", ",", "W", ",", "strides", "=", "[", "1", ",", "1", ",", "1", ",", "1", "]", ",", "padding", "=", "'SAME'", ")" ]
https://github.com/tensorflow/ngraph-bridge/blob/ea6422491ec75504e78a63db029e7f74ec3479a5/examples/mnist/mnist_deep_simplified.py#L106-L108
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
modules/freetype2/src/tools/docmaker/content.py
python
DocBlock.get_markup
( self, tag_name )
return None
return the DocMarkup corresponding to a given tag in a block
return the DocMarkup corresponding to a given tag in a block
[ "return", "the", "DocMarkup", "corresponding", "to", "a", "given", "tag", "in", "a", "block" ]
def get_markup( self, tag_name ): """return the DocMarkup corresponding to a given tag in a block""" for m in self.markups: if m.tag == string.lower( tag_name ): return m return None
[ "def", "get_markup", "(", "self", ",", "tag_name", ")", ":", "for", "m", "in", "self", ".", "markups", ":", "if", "m", ".", "tag", "==", "string", ".", "lower", "(", "tag_name", ")", ":", "return", "m", "return", "None" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/modules/freetype2/src/tools/docmaker/content.py#L542-L547
CanalTP/navitia
cb84ce9859070187e708818b058e6a7e0b7f891b
source/tyr/tyr/external_service.py
python
ExternalService.delete
(self, id=None, version=0)
Delete an external service in db, i.e. set parameter DISCARDED to TRUE
Delete an external service in db, i.e. set parameter DISCARDED to TRUE
[ "Delete", "an", "external", "service", "in", "db", "i", ".", "e", ".", "set", "parameter", "DISCARDED", "to", "TRUE" ]
def delete(self, id=None, version=0): """ Delete an external service in db, i.e. set parameter DISCARDED to TRUE """ if not id: abort(400, status="error", message='id is required') try: provider = models.ExternalService.find_by_id(id) provider....
[ "def", "delete", "(", "self", ",", "id", "=", "None", ",", "version", "=", "0", ")", ":", "if", "not", "id", ":", "abort", "(", "400", ",", "status", "=", "\"error\"", ",", "message", "=", "'id is required'", ")", "try", ":", "provider", "=", "mode...
https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/tyr/tyr/external_service.py#L77-L89
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/linalg/basic.py
python
pinvh
(a, cond=None, rcond=None, lower=True, return_rank=False, check_finite=True)
Compute the (Moore-Penrose) pseudo-inverse of a Hermitian matrix. Calculate a generalized inverse of a Hermitian or real symmetric matrix using its eigenvalue decomposition and including all eigenvalues with 'large' absolute value. Parameters ---------- a : (N, N) array_like Real symme...
Compute the (Moore-Penrose) pseudo-inverse of a Hermitian matrix.
[ "Compute", "the", "(", "Moore", "-", "Penrose", ")", "pseudo", "-", "inverse", "of", "a", "Hermitian", "matrix", "." ]
def pinvh(a, cond=None, rcond=None, lower=True, return_rank=False, check_finite=True): """ Compute the (Moore-Penrose) pseudo-inverse of a Hermitian matrix. Calculate a generalized inverse of a Hermitian or real symmetric matrix using its eigenvalue decomposition and including all eigenvalues...
[ "def", "pinvh", "(", "a", ",", "cond", "=", "None", ",", "rcond", "=", "None", ",", "lower", "=", "True", ",", "return_rank", "=", "False", ",", "check_finite", "=", "True", ")", ":", "a", "=", "_asarray_validated", "(", "a", ",", "check_finite", "="...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/basic.py#L1397-L1470
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
clang/bindings/python/clang/cindex.py
python
Type.spelling
(self)
return conf.lib.clang_getTypeSpelling(self)
Retrieve the spelling of this Type.
Retrieve the spelling of this Type.
[ "Retrieve", "the", "spelling", "of", "this", "Type", "." ]
def spelling(self): """Retrieve the spelling of this Type.""" return conf.lib.clang_getTypeSpelling(self)
[ "def", "spelling", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getTypeSpelling", "(", "self", ")" ]
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/bindings/python/clang/cindex.py#L2427-L2429
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py
python
Globable.popending
(self, expected = None)
return ending
Pop the ending found at the current position
Pop the ending found at the current position
[ "Pop", "the", "ending", "found", "at", "the", "current", "position" ]
def popending(self, expected = None): "Pop the ending found at the current position" if self.isout() and self.leavepending: return expected ending = self.endinglist.pop(self) if expected and expected != ending: Trace.error('Expected ending ' + expected + ', got ' + ending) self.skip(endi...
[ "def", "popending", "(", "self", ",", "expected", "=", "None", ")", ":", "if", "self", ".", "isout", "(", ")", "and", "self", ".", "leavepending", ":", "return", "expected", "ending", "=", "self", ".", "endinglist", ".", "pop", "(", "self", ")", "if"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L1920-L1928
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
lldb/examples/python/gdbremote.py
python
TerminalColors.reset
(self)
return ''
Reset all terminal colors and formatting.
Reset all terminal colors and formatting.
[ "Reset", "all", "terminal", "colors", "and", "formatting", "." ]
def reset(self): '''Reset all terminal colors and formatting.''' if self.enabled: return "\x1b[0m" return ''
[ "def", "reset", "(", "self", ")", ":", "if", "self", ".", "enabled", ":", "return", "\"\\x1b[0m\"", "return", "''" ]
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/examples/python/gdbremote.py#L50-L54
casadi/casadi
8d0f80a4d0fe2054384bfb9748f7a0f6bae540ff
misc/cpplint.py
python
CheckSpacingForFunctionCall
(filename, line, linenum, error)
Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. line: The text of the line to check. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for the correctness of various spacing around function calls.
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "around", "function", "calls", "." ]
def CheckSpacingForFunctionCall(filename, line, linenum, error): """Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. line: The text of the line to check. linenum: The number of the line to check. error: The function to call with any ...
[ "def", "CheckSpacingForFunctionCall", "(", "filename", ",", "line", ",", "linenum", ",", "error", ")", ":", "# Since function calls often occur inside if/for/while/switch", "# expressions - which have their own, more liberal conventions - we", "# first see if we should be looking inside ...
https://github.com/casadi/casadi/blob/8d0f80a4d0fe2054384bfb9748f7a0f6bae540ff/misc/cpplint.py#L2194-L2259
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/clang/bindings/python/clang/cindex.py
python
Type.get_declaration
(self)
return conf.lib.clang_getTypeDeclaration(self)
Return the cursor for the declaration of the given type.
Return the cursor for the declaration of the given type.
[ "Return", "the", "cursor", "for", "the", "declaration", "of", "the", "given", "type", "." ]
def get_declaration(self): """ Return the cursor for the declaration of the given type. """ return conf.lib.clang_getTypeDeclaration(self)
[ "def", "get_declaration", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getTypeDeclaration", "(", "self", ")" ]
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/bindings/python/clang/cindex.py#L2342-L2346
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tarfile.py
python
_Stream.__read
(self, size)
return t[:size]
Return size bytes from stream. If internal buffer is empty, read another block from the stream.
Return size bytes from stream. If internal buffer is empty, read another block from the stream.
[ "Return", "size", "bytes", "from", "stream", ".", "If", "internal", "buffer", "is", "empty", "read", "another", "block", "from", "the", "stream", "." ]
def __read(self, size): """Return size bytes from stream. If internal buffer is empty, read another block from the stream. """ c = len(self.buf) t = [self.buf] while c < size: buf = self.fileobj.read(self.bufsize) if not buf: bre...
[ "def", "__read", "(", "self", ",", "size", ")", ":", "c", "=", "len", "(", "self", ".", "buf", ")", "t", "=", "[", "self", ".", "buf", "]", "while", "c", "<", "size", ":", "buf", "=", "self", ".", "fileobj", ".", "read", "(", "self", ".", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tarfile.py#L563-L577
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/mindrecord/tools/tfrecord_to_mr.py
python
TFRecordToMR.tfrecord_iterator
(self)
Yield a dictionary whose keys are fields in schema. Yields: dict, data dictionary whose keys are the same as columns.
Yield a dictionary whose keys are fields in schema.
[ "Yield", "a", "dictionary", "whose", "keys", "are", "fields", "in", "schema", "." ]
def tfrecord_iterator(self): """ Yield a dictionary whose keys are fields in schema. Yields: dict, data dictionary whose keys are the same as columns. """ dataset = self.tf.data.TFRecordDataset(self.source) dataset = dataset.map(self._parse_record) it...
[ "def", "tfrecord_iterator", "(", "self", ")", ":", "dataset", "=", "self", ".", "tf", ".", "data", ".", "TFRecordDataset", "(", "self", ".", "source", ")", "dataset", "=", "dataset", ".", "map", "(", "self", ".", "_parse_record", ")", "iterator", "=", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/mindrecord/tools/tfrecord_to_mr.py#L262-L278
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/google/protobuf/internal/python_message.py
python
_AddEnumValues
(descriptor, cls)
Sets class-level attributes for all enum fields defined in this message. Args: descriptor: Descriptor object for this message type. cls: Class we're constructing for this message type.
Sets class-level attributes for all enum fields defined in this message.
[ "Sets", "class", "-", "level", "attributes", "for", "all", "enum", "fields", "defined", "in", "this", "message", "." ]
def _AddEnumValues(descriptor, cls): """Sets class-level attributes for all enum fields defined in this message. Args: descriptor: Descriptor object for this message type. cls: Class we're constructing for this message type. """ for enum_type in descriptor.enum_types: for enum_value in enum_type.va...
[ "def", "_AddEnumValues", "(", "descriptor", ",", "cls", ")", ":", "for", "enum_type", "in", "descriptor", ".", "enum_types", ":", "for", "enum_value", "in", "enum_type", ".", "values", ":", "setattr", "(", "cls", ",", "enum_value", ".", "name", ",", "enum_...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/python_message.py#L223-L232
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
DateTime.MakeFromUTC
(*args, **kwargs)
return _misc_.DateTime_MakeFromUTC(*args, **kwargs)
MakeFromUTC(self, bool noDST=False) -> DateTime
MakeFromUTC(self, bool noDST=False) -> DateTime
[ "MakeFromUTC", "(", "self", "bool", "noDST", "=", "False", ")", "-", ">", "DateTime" ]
def MakeFromUTC(*args, **kwargs): """MakeFromUTC(self, bool noDST=False) -> DateTime""" return _misc_.DateTime_MakeFromUTC(*args, **kwargs)
[ "def", "MakeFromUTC", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_MakeFromUTC", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L3958-L3960
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/auibook.py
python
AuiNotebook.RemoveControlFromPage
(self, page_idx)
return True
Removes a control from a tab (not from the tab area). :param integer `page_idx`: the page index.
Removes a control from a tab (not from the tab area).
[ "Removes", "a", "control", "from", "a", "tab", "(", "not", "from", "the", "tab", "area", ")", "." ]
def RemoveControlFromPage(self, page_idx): """ Removes a control from a tab (not from the tab area). :param integer `page_idx`: the page index. """ if page_idx >= self._tabs.GetPageCount(): return False page_info = self._tabs.GetPage(page_idx) if pa...
[ "def", "RemoveControlFromPage", "(", "self", ",", "page_idx", ")", ":", "if", "page_idx", ">=", "self", ".", "_tabs", ".", "GetPageCount", "(", ")", ":", "return", "False", "page_info", "=", "self", ".", "_tabs", ".", "GetPage", "(", "page_idx", ")", "if...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L3859-L3889
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/nn/parallel/scatter_gather.py
python
scatter_kwargs
(inputs, kwargs, target_gpus, dim=0)
return inputs, kwargs
r"""Scatter with support for kwargs dictionary
r"""Scatter with support for kwargs dictionary
[ "r", "Scatter", "with", "support", "for", "kwargs", "dictionary" ]
def scatter_kwargs(inputs, kwargs, target_gpus, dim=0): r"""Scatter with support for kwargs dictionary""" inputs = scatter(inputs, target_gpus, dim) if inputs else [] kwargs = scatter(kwargs, target_gpus, dim) if kwargs else [] if len(inputs) < len(kwargs): inputs.extend(() for _ in range(len(kw...
[ "def", "scatter_kwargs", "(", "inputs", ",", "kwargs", ",", "target_gpus", ",", "dim", "=", "0", ")", ":", "inputs", "=", "scatter", "(", "inputs", ",", "target_gpus", ",", "dim", ")", "if", "inputs", "else", "[", "]", "kwargs", "=", "scatter", "(", ...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/parallel/scatter_gather.py#L42-L52
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
tools/coverage/coverage_diff.py
python
get_info_file_lines
(info_file, diff_file)
Args: info_file (str): File generated by lcov. diff_file (str): File to get modified lines. Returns: None
Args: info_file (str): File generated by lcov. diff_file (str): File to get modified lines.
[ "Args", ":", "info_file", "(", "str", ")", ":", "File", "generated", "by", "lcov", ".", "diff_file", "(", "str", ")", ":", "File", "to", "get", "modified", "lines", "." ]
def get_info_file_lines(info_file, diff_file): """ Args: info_file (str): File generated by lcov. diff_file (str): File to get modified lines. Returns: None """ diff_file_lines = get_diff_file_lines(diff_file) current_lines = [] current_lf = 0 current_lh = 0 ...
[ "def", "get_info_file_lines", "(", "info_file", ",", "diff_file", ")", ":", "diff_file_lines", "=", "get_diff_file_lines", "(", "diff_file", ")", "current_lines", "=", "[", "]", "current_lf", "=", "0", "current_lh", "=", "0", "with", "open", "(", "info_file", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/tools/coverage/coverage_diff.py#L66-L116
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/main.py
python
StdoutRefactoringTool.__init__
(self, fixers, options, explicit, nobackups, show_diffs, input_base_dir='', output_dir='', append_suffix='')
Args: fixers: A list of fixers to import. options: A dict with RefactoringTool configuration. explicit: A list of fixers to run even if they are explicit. nobackups: If true no backup '.bak' files will be created for those files that are being refactored. ...
Args: fixers: A list of fixers to import. options: A dict with RefactoringTool configuration. explicit: A list of fixers to run even if they are explicit. nobackups: If true no backup '.bak' files will be created for those files that are being refactored. ...
[ "Args", ":", "fixers", ":", "A", "list", "of", "fixers", "to", "import", ".", "options", ":", "A", "dict", "with", "RefactoringTool", "configuration", ".", "explicit", ":", "A", "list", "of", "fixers", "to", "run", "even", "if", "they", "are", "explicit"...
def __init__(self, fixers, options, explicit, nobackups, show_diffs, input_base_dir='', output_dir='', append_suffix=''): """ Args: fixers: A list of fixers to import. options: A dict with RefactoringTool configuration. explicit: A list of fixers to r...
[ "def", "__init__", "(", "self", ",", "fixers", ",", "options", ",", "explicit", ",", "nobackups", ",", "show_diffs", ",", "input_base_dir", "=", "''", ",", "output_dir", "=", "''", ",", "append_suffix", "=", "''", ")", ":", "self", ".", "nobackups", "=",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/main.py#L36-L63
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
ThirdParty/cinema/paraview/tpl/cinema_python/database/vti_store.py
python
VTIFileStore.create
(self)
creates a new file store
creates a new file store
[ "creates", "a", "new", "file", "store" ]
def create(self): """creates a new file store""" super(VTIFileStore, self).create() self.save()
[ "def", "create", "(", "self", ")", ":", "super", "(", "VTIFileStore", ",", "self", ")", ".", "create", "(", ")", "self", ".", "save", "(", ")" ]
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/database/vti_store.py#L40-L43
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Inelastic/IndirectCommon.py
python
convertToElasticQ
(input_ws, output_ws=None)
Helper function to convert the spectrum axis of a sample to ElasticQ. @param input_ws - the name of the workspace to convert from @param output_ws - the name to call the converted workspace
Helper function to convert the spectrum axis of a sample to ElasticQ.
[ "Helper", "function", "to", "convert", "the", "spectrum", "axis", "of", "a", "sample", "to", "ElasticQ", "." ]
def convertToElasticQ(input_ws, output_ws=None): """ Helper function to convert the spectrum axis of a sample to ElasticQ. @param input_ws - the name of the workspace to convert from @param output_ws - the name to call the converted workspace """ if output_ws is None: output_ws = input...
[ "def", "convertToElasticQ", "(", "input_ws", ",", "output_ws", "=", "None", ")", ":", "if", "output_ws", "is", "None", ":", "output_ws", "=", "input_ws", "axis", "=", "s_api", ".", "mtd", "[", "input_ws", "]", ".", "getAxis", "(", "1", ")", "if", "axis...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/IndirectCommon.py#L456-L481
pichenettes/eurorack
11cc3a80f2c6d67ee024091c711dfce59a58cb59
elements/resources/audio_io.py
python
AudioIoException.__init__
(self, message)
Initializes an AudioIoException object.
Initializes an AudioIoException object.
[ "Initializes", "an", "AudioIoException", "object", "." ]
def __init__(self, message): """Initializes an AudioIoException object.""" Exception.__init__(self, 'Audio IO error: %s' % message)
[ "def", "__init__", "(", "self", ",", "message", ")", ":", "Exception", ".", "__init__", "(", "self", ",", "'Audio IO error: %s'", "%", "message", ")" ]
https://github.com/pichenettes/eurorack/blob/11cc3a80f2c6d67ee024091c711dfce59a58cb59/elements/resources/audio_io.py#L30-L32
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py3/jinja2/lexer.py
python
TokenStream.close
(self)
Close the stream.
Close the stream.
[ "Close", "the", "stream", "." ]
def close(self) -> None: """Close the stream.""" self.current = Token(self.current.lineno, TOKEN_EOF, "") self._iter = iter(()) self.closed = True
[ "def", "close", "(", "self", ")", "->", "None", ":", "self", ".", "current", "=", "Token", "(", "self", ".", "current", ".", "lineno", ",", "TOKEN_EOF", ",", "\"\"", ")", "self", ".", "_iter", "=", "iter", "(", "(", ")", ")", "self", ".", "closed...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/lexer.py#L395-L399