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
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
src/python/grpcio/grpc/beta/implementations.py
python
secure_channel
(host, port, channel_credentials)
return Channel(channel)
Creates a secure Channel to a remote host. Args: host: The name of the remote host to which to connect. port: The port of the remote host to which to connect. If None only the 'host' part will be used. channel_credentials: A ChannelCredentials. Returns: A secure Channel to the remote host th...
Creates a secure Channel to a remote host.
[ "Creates", "a", "secure", "Channel", "to", "a", "remote", "host", "." ]
def secure_channel(host, port, channel_credentials): """Creates a secure Channel to a remote host. Args: host: The name of the remote host to which to connect. port: The port of the remote host to which to connect. If None only the 'host' part will be used. channel_credentials: A ChannelCredent...
[ "def", "secure_channel", "(", "host", ",", "port", ",", "channel_credentials", ")", ":", "channel", "=", "grpc", ".", "secure_channel", "(", "host", "if", "port", "is", "None", "else", "'%s:%d'", "%", "(", "host", ",", "port", ")", ",", "channel_credential...
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/beta/implementations.py#L119-L133
vslavik/poedit
f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a
deps/boost/tools/build/src/build/property_set.py
python
PropertySet.add_raw
(self, properties)
return self.add (create (properties))
Creates a new property set containing the properties in this one, plus the ones passed as argument.
Creates a new property set containing the properties in this one, plus the ones passed as argument.
[ "Creates", "a", "new", "property", "set", "containing", "the", "properties", "in", "this", "one", "plus", "the", "ones", "passed", "as", "argument", "." ]
def add_raw (self, properties): """ Creates a new property set containing the properties in this one, plus the ones passed as argument. """ return self.add (create (properties))
[ "def", "add_raw", "(", "self", ",", "properties", ")", ":", "return", "self", ".", "add", "(", "create", "(", "properties", ")", ")" ]
https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/property_set.py#L450-L454
ufal/udpipe
e51f02d2744cdfd4a29efc1320644ea04d535f0b
doc/t2t_docsys/txt2tags.py
python
ConfigMaster._check_target
(self)
Checks if the target is already defined. If not, do it
Checks if the target is already defined. If not, do it
[ "Checks", "if", "the", "target", "is", "already", "defined", ".", "If", "not", "do", "it" ]
def _check_target(self): "Checks if the target is already defined. If not, do it" if not self.target: self.target = self.find_value('target')
[ "def", "_check_target", "(", "self", ")", ":", "if", "not", "self", ".", "target", ":", "self", ".", "target", "=", "self", ".", "find_value", "(", "'target'", ")" ]
https://github.com/ufal/udpipe/blob/e51f02d2744cdfd4a29efc1320644ea04d535f0b/doc/t2t_docsys/txt2tags.py#L2739-L2742
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
v8_5_1/tools/stats-viewer.py
python
SharedDataAccess.IntAt
(self, index)
return result
Return the little-endian 32-byte int at the specified byte index.
Return the little-endian 32-byte int at the specified byte index.
[ "Return", "the", "little", "-", "endian", "32", "-", "byte", "int", "at", "the", "specified", "byte", "index", "." ]
def IntAt(self, index): """Return the little-endian 32-byte int at the specified byte index.""" word_str = self.data[index:index+4] result, = struct.unpack("I", word_str) return result
[ "def", "IntAt", "(", "self", ",", "index", ")", ":", "word_str", "=", "self", ".", "data", "[", "index", ":", "index", "+", "4", "]", "result", ",", "=", "struct", ".", "unpack", "(", "\"I\"", ",", "word_str", ")", "return", "result" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_5_1/tools/stats-viewer.py#L316-L320
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/processing/tools/general.py
python
runAndLoadResults
(algOrName, parameters, feedback=None, context=None)
return Processing.runAlgorithm(alg, parameters=parameters, onFinish=handleAlgorithmResults, feedback=feedback, context=context)
Executes given algorithm and load its results into the current QGIS project when possible. :param algOrName: Either an instance of an algorithm, or an algorithm's ID :param parameters: Algorithm parameters dictionary :param feedback: Processing feedback object :param context: Processing context obj...
Executes given algorithm and load its results into the current QGIS project when possible.
[ "Executes", "given", "algorithm", "and", "load", "its", "results", "into", "the", "current", "QGIS", "project", "when", "possible", "." ]
def runAndLoadResults(algOrName, parameters, feedback=None, context=None): """ Executes given algorithm and load its results into the current QGIS project when possible. :param algOrName: Either an instance of an algorithm, or an algorithm's ID :param parameters: Algorithm parameters dictionary ...
[ "def", "runAndLoadResults", "(", "algOrName", ",", "parameters", ",", "feedback", "=", "None", ",", "context", "=", "None", ")", ":", "if", "isinstance", "(", "algOrName", ",", "QgsProcessingAlgorithm", ")", ":", "alg", "=", "algOrName", "else", ":", "alg", ...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/processing/tools/general.py#L119-L152
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/configHelpSourceEdit.py
python
GetHelpSourceDialog.MenuOk
(self)
return menuOk
Simple validity check for a sensible menu item name
Simple validity check for a sensible menu item name
[ "Simple", "validity", "check", "for", "a", "sensible", "menu", "item", "name" ]
def MenuOk(self): "Simple validity check for a sensible menu item name" menuOk = True menu = self.menu.get() menu.strip() if not menu: tkMessageBox.showerror(title='Menu Item Error', message='No menu item specified', ...
[ "def", "MenuOk", "(", "self", ")", ":", "menuOk", "=", "True", "menu", "=", "self", ".", "menu", ".", "get", "(", ")", "menu", ".", "strip", "(", ")", "if", "not", "menu", ":", "tkMessageBox", ".", "showerror", "(", "title", "=", "'Menu Item Error'",...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/configHelpSourceEdit.py#L99-L117
rodeofx/OpenWalter
6116fbe3f04f1146c854afbfbdbe944feaee647e
walter/maya/scripts/walterPanel/walterMayaTraverser.py
python
WalterMayaImplementation.saveMaterials
(self, origin, fileName=None)
return pm.walterSaveShaders(node=origin, file=fileName)
Save the materials to the external file.
Save the materials to the external file.
[ "Save", "the", "materials", "to", "the", "external", "file", "." ]
def saveMaterials(self, origin, fileName=None): """Save the materials to the external file.""" fileName = self.getFileDialog(fileName) if not fileName: return if not pm.pluginInfo('walterMtoaConnection', query=True, loaded=True): pm.loadPlugin('walterMtoaConnect...
[ "def", "saveMaterials", "(", "self", ",", "origin", ",", "fileName", "=", "None", ")", ":", "fileName", "=", "self", ".", "getFileDialog", "(", "fileName", ")", "if", "not", "fileName", ":", "return", "if", "not", "pm", ".", "pluginInfo", "(", "'walterMt...
https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/maya/scripts/walterPanel/walterMayaTraverser.py#L588-L598
apache/singa
93fd9da72694e68bfe3fb29d0183a65263d238a1
python/singa/tensor.py
python
uniform
(low, high, t)
return t
Generate values following a Uniform distribution. Args: low (float): the lower bound high (float): the higher bound t (Tensor): the results are put into t Returns: t
Generate values following a Uniform distribution.
[ "Generate", "values", "following", "a", "Uniform", "distribution", "." ]
def uniform(low, high, t): '''Generate values following a Uniform distribution. Args: low (float): the lower bound high (float): the higher bound t (Tensor): the results are put into t Returns: t ''' singa.Uniform(float(low), float(high), t.data) return t
[ "def", "uniform", "(", "low", ",", "high", ",", "t", ")", ":", "singa", ".", "Uniform", "(", "float", "(", "low", ")", ",", "float", "(", "high", ")", ",", "t", ".", "data", ")", "return", "t" ]
https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/tensor.py#L1672-L1684
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Tools/msvc.py
python
gather_intel_composer_versions
(conf, versions)
Checks ICL compilers that are part of Intel Composer Suites :param versions: list to modify :type versions: list
Checks ICL compilers that are part of Intel Composer Suites
[ "Checks", "ICL", "compilers", "that", "are", "part", "of", "Intel", "Composer", "Suites" ]
def gather_intel_composer_versions(conf, versions): """ Checks ICL compilers that are part of Intel Composer Suites :param versions: list to modify :type versions: list """ version_pattern = re.compile('^...?.?\...?.?.?') try: all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow...
[ "def", "gather_intel_composer_versions", "(", "conf", ",", "versions", ")", ":", "version_pattern", "=", "re", ".", "compile", "(", "'^...?.?\\...?.?.?'", ")", "try", ":", "all_versions", "=", "Utils", ".", "winreg", ".", "OpenKey", "(", "Utils", ".", "winreg"...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/msvc.py#L446-L512
DaFuCoding/MTCNN_Caffe
09c30c3ff391bd9cb6b249c1910afaf147767ab3
scripts/cpp_lint.py
python
_CppLintState.SetCountingStyle
(self, counting_style)
Sets the module's counting options.
Sets the module's counting options.
[ "Sets", "the", "module", "s", "counting", "options", "." ]
def SetCountingStyle(self, counting_style): """Sets the module's counting options.""" self.counting = counting_style
[ "def", "SetCountingStyle", "(", "self", ",", "counting_style", ")", ":", "self", ".", "counting", "=", "counting_style" ]
https://github.com/DaFuCoding/MTCNN_Caffe/blob/09c30c3ff391bd9cb6b249c1910afaf147767ab3/scripts/cpp_lint.py#L713-L715
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/interactiveshell.py
python
InteractiveShell.system_raw
(self, cmd)
Call the given cmd in a subprocess using os.system on Windows or subprocess.call using the system shell on other platforms. Parameters ---------- cmd : str Command to execute.
Call the given cmd in a subprocess using os.system on Windows or subprocess.call using the system shell on other platforms.
[ "Call", "the", "given", "cmd", "in", "a", "subprocess", "using", "os", ".", "system", "on", "Windows", "or", "subprocess", ".", "call", "using", "the", "system", "shell", "on", "other", "platforms", "." ]
def system_raw(self, cmd): """Call the given cmd in a subprocess using os.system on Windows or subprocess.call using the system shell on other platforms. Parameters ---------- cmd : str Command to execute. """ cmd = self.var_expand(cmd, depth=1) ...
[ "def", "system_raw", "(", "self", ",", "cmd", ")", ":", "cmd", "=", "self", ".", "var_expand", "(", "cmd", ",", "depth", "=", "1", ")", "# protect os.system from UNC paths on Windows, which it can't handle:", "if", "sys", ".", "platform", "==", "'win32'", ":", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/interactiveshell.py#L2213-L2262
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl_compatibility_errors.py
python
IDLCompatibilityContext.add_command_removed_error
(self, command_name: str, file: str)
Add an error about a command that was removed.
Add an error about a command that was removed.
[ "Add", "an", "error", "about", "a", "command", "that", "was", "removed", "." ]
def add_command_removed_error(self, command_name: str, file: str) -> None: """Add an error about a command that was removed.""" self._add_error(ERROR_ID_REMOVED_COMMAND, command_name, "Old command '%s' was removed from new commands." % (command_name), file)
[ "def", "add_command_removed_error", "(", "self", ",", "command_name", ":", "str", ",", "file", ":", "str", ")", "->", "None", ":", "self", ".", "_add_error", "(", "ERROR_ID_REMOVED_COMMAND", ",", "command_name", ",", "\"Old command '%s' was removed from new commands.\...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl_compatibility_errors.py#L271-L274
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/aui_utilities.py
python
MakeGray
(rgbTuple, factor, maskColour)
Make a pixel grayed-out. If the pixel matches the `maskColour`, it won't be changed. :param tuple `rgbTuple`: a tuple representing a pixel colour; :param integer `factor`: a graying-out factor; :param Colour `maskColour`: a colour mask.
Make a pixel grayed-out.
[ "Make", "a", "pixel", "grayed", "-", "out", "." ]
def MakeGray(rgbTuple, factor, maskColour): """ Make a pixel grayed-out. If the pixel matches the `maskColour`, it won't be changed. :param tuple `rgbTuple`: a tuple representing a pixel colour; :param integer `factor`: a graying-out factor; :param Colour `maskColour`: a colour mask. """ ...
[ "def", "MakeGray", "(", "rgbTuple", ",", "factor", ",", "maskColour", ")", ":", "if", "rgbTuple", "!=", "maskColour", ":", "r", ",", "g", ",", "b", "=", "rgbTuple", "return", "map", "(", "lambda", "x", ":", "int", "(", "(", "230", "-", "x", ")", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/aui_utilities.py#L222-L237
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/usb_gadget/composite_gadget.py
python
CompositeFeature.VendorControlRead
(self, recipient, request, value, index, length)
return None
Handle vendor-specific control transfers. Args: recipient: Request recipient (interface or endpoint) request: bRequest field of the setup packet. value: wValue field of the setup packet. index: wIndex field of the setup packet. length: Maximum amount of data the host expects the devic...
Handle vendor-specific control transfers.
[ "Handle", "vendor", "-", "specific", "control", "transfers", "." ]
def VendorControlRead(self, recipient, request, value, index, length): """Handle vendor-specific control transfers. Args: recipient: Request recipient (interface or endpoint) request: bRequest field of the setup packet. value: wValue field of the setup packet. index: wIndex field of the...
[ "def", "VendorControlRead", "(", "self", ",", "recipient", ",", "request", ",", "value", ",", "index", ",", "length", ")", ":", "_", "=", "recipient", ",", "request", ",", "value", ",", "index", ",", "length", "return", "None" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/usb_gadget/composite_gadget.py#L214-L229
esa/pykep
b410363653623730b577de257c04b0e0289f2014
pykep/trajopt/_indirect.py
python
indirect_or2or.__init__
(self, elem0=[149598261129.93335, 0.016711230601231957, 2.640492490927786e-07, 3.141592653589793, 4.938194050401601, 0], elemf=[227943822376.03537, 0.09339409892101332, 0.032283207367640024, 0.8649771996521327, 5.000312830124232, 0], ...
Initialises ``pykep.trajopt.indirect_or2or`` problem. Args: - elem0 (``list``, ``tuple``, ``numpy.ndarray``): Departure Keplerian elements (mutable eccentric anomaly). - elemf (``list``, ``tuple``, ``numpy.ndarray``): Arrival Keplerian elements (mutable eccentric anomaly). -...
Initialises ``pykep.trajopt.indirect_or2or`` problem.
[ "Initialises", "pykep", ".", "trajopt", ".", "indirect_or2or", "problem", "." ]
def __init__(self, elem0=[149598261129.93335, 0.016711230601231957, 2.640492490927786e-07, 3.141592653589793, 4.938194050401601, 0], elemf=[227943822376.03537, 0.09339409892101332, 0.032283207367640024, 0.8649771996521327, 5.0003128301242...
[ "def", "__init__", "(", "self", ",", "elem0", "=", "[", "149598261129.93335", ",", "0.016711230601231957", ",", "2.640492490927786e-07", ",", "3.141592653589793", ",", "4.938194050401601", ",", "0", "]", ",", "elemf", "=", "[", "227943822376.03537", ",", "0.093394...
https://github.com/esa/pykep/blob/b410363653623730b577de257c04b0e0289f2014/pykep/trajopt/_indirect.py#L297-L341
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
PyImageHandler._SetSelf
(*args, **kwargs)
return _core_.PyImageHandler__SetSelf(*args, **kwargs)
_SetSelf(self, PyObject self)
_SetSelf(self, PyObject self)
[ "_SetSelf", "(", "self", "PyObject", "self", ")" ]
def _SetSelf(*args, **kwargs): """_SetSelf(self, PyObject self)""" return _core_.PyImageHandler__SetSelf(*args, **kwargs)
[ "def", "_SetSelf", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "PyImageHandler__SetSelf", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L2734-L2736
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
xmlNode.prop
(self, name)
return ret
Search and get the value of an attribute associated to a node This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values unless DTD use has been turned off. NOTE: this function acts independently of namespaces ...
Search and get the value of an attribute associated to a node This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values unless DTD use has been turned off. NOTE: this function acts independently of namespaces ...
[ "Search", "and", "get", "the", "value", "of", "an", "attribute", "associated", "to", "a", "node", "This", "does", "the", "entity", "substitution", ".", "This", "function", "looks", "in", "DTD", "attribute", "declaration", "for", "#FIXED", "or", "default", "d...
def prop(self, name): """Search and get the value of an attribute associated to a node This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values unless DTD use has been turned off. NOTE: this function acts...
[ "def", "prop", "(", "self", ",", "name", ")", ":", "ret", "=", "libxml2mod", ".", "xmlGetProp", "(", "self", ".", "_o", ",", "name", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L3418-L3427
verilog-to-routing/vtr-verilog-to-routing
d9719cf7374821156c3cee31d66991cb85578562
libs/EXTERNAL/libcatch2/tools/scripts/extractFeaturesFromReleaseNotes.py
python
create_introduced_in_text
(version, bug_number = None)
Generate text to paste in to documentation file
Generate text to paste in to documentation file
[ "Generate", "text", "to", "paste", "in", "to", "documentation", "file" ]
def create_introduced_in_text(version, bug_number = None): """Generate text to paste in to documentation file""" if bug_number: return '> [Introduced](https://github.com/catchorg/Catch2/issues/%s) in Catch %s.' % (bug_number, version) else: # Use this text for changes that don't have issue n...
[ "def", "create_introduced_in_text", "(", "version", ",", "bug_number", "=", "None", ")", ":", "if", "bug_number", ":", "return", "'> [Introduced](https://github.com/catchorg/Catch2/issues/%s) in Catch %s.'", "%", "(", "bug_number", ",", "version", ")", "else", ":", "# U...
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/libs/EXTERNAL/libcatch2/tools/scripts/extractFeaturesFromReleaseNotes.py#L29-L35
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
ext/ply/example/ansic/cparse.py
python
p_enumerator_1
(t)
enumerator : ID
enumerator : ID
[ "enumerator", ":", "ID" ]
def p_enumerator_1(t): 'enumerator : ID' pass
[ "def", "p_enumerator_1", "(", "t", ")", ":", "pass" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/ansic/cparse.py#L253-L255
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
buildscripts/resmokelib/core/network.py
python
_check_port
(func)
return wrapper
A decorator that verifies the port returned by the wrapped function is in the valid range. Returns the port if it is valid, and raises a PortAllocationError otherwise.
A decorator that verifies the port returned by the wrapped function is in the valid range.
[ "A", "decorator", "that", "verifies", "the", "port", "returned", "by", "the", "wrapped", "function", "is", "in", "the", "valid", "range", "." ]
def _check_port(func): """ A decorator that verifies the port returned by the wrapped function is in the valid range. Returns the port if it is valid, and raises a PortAllocationError otherwise. """ @functools.wraps(func) def wrapper(*args, **kwargs): port = func(*args, **kwarg...
[ "def", "_check_port", "(", "func", ")", ":", "@", "functools", ".", "wraps", "(", "func", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "port", "=", "func", "(", "*", "args", ",", "*", "*", "kwargs", ")", "if", "po...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/resmokelib/core/network.py#L16-L38
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/urllib.py
python
FancyURLopener.http_error_302
(self, url, fp, errcode, errmsg, headers, data=None)
Error 302 -- relocated (temporarily).
Error 302 -- relocated (temporarily).
[ "Error", "302", "--", "relocated", "(", "temporarily", ")", "." ]
def http_error_302(self, url, fp, errcode, errmsg, headers, data=None): """Error 302 -- relocated (temporarily).""" self.tries += 1 try: if self.maxtries and self.tries >= self.maxtries: if hasattr(self, "http_error_500"): meth = self.http_error_50...
[ "def", "http_error_302", "(", "self", ",", "url", ",", "fp", ",", "errcode", ",", "errmsg", ",", "headers", ",", "data", "=", "None", ")", ":", "self", ".", "tries", "+=", "1", "try", ":", "if", "self", ".", "maxtries", "and", "self", ".", "tries",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/urllib.py#L629-L645
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/fractions.py
python
Fraction.__abs__
(a)
return Fraction(abs(a._numerator), a._denominator)
abs(a)
abs(a)
[ "abs", "(", "a", ")" ]
def __abs__(a): """abs(a)""" return Fraction(abs(a._numerator), a._denominator)
[ "def", "__abs__", "(", "a", ")", ":", "return", "Fraction", "(", "abs", "(", "a", ".", "_numerator", ")", ",", "a", ".", "_denominator", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/fractions.py#L497-L499
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/random.py
python
WichmannHill.random
(self)
return (x/30269.0 + y/30307.0 + z/30323.0) % 1.0
Get the next random number in the range [0.0, 1.0).
Get the next random number in the range [0.0, 1.0).
[ "Get", "the", "next", "random", "number", "in", "the", "range", "[", "0", ".", "0", "1", ".", "0", ")", "." ]
def random(self): """Get the next random number in the range [0.0, 1.0).""" # Wichman-Hill random number generator. # # Wichmann, B. A. & Hill, I. D. (1982) # Algorithm AS 183: # An efficient and portable pseudo-random number generator # Applied Statistics 31 (19...
[ "def", "random", "(", "self", ")", ":", "# Wichman-Hill random number generator.", "#", "# Wichmann, B. A. & Hill, I. D. (1982)", "# Algorithm AS 183:", "# An efficient and portable pseudo-random number generator", "# Applied Statistics 31 (1982) 188-190", "#", "# see also:", "# C...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/random.py#L684-L713
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/tf_asymmetry_fitting/tf_asymmetry_fitting_view.py
python
TFAsymmetryFittingView.is_normalisation_fixed
(self, is_fixed: bool)
Sets whether the fix normalisation checkbox is ticked or not.
Sets whether the fix normalisation checkbox is ticked or not.
[ "Sets", "whether", "the", "fix", "normalisation", "checkbox", "is", "ticked", "or", "not", "." ]
def is_normalisation_fixed(self, is_fixed: bool) -> None: """Sets whether the fix normalisation checkbox is ticked or not.""" self.tf_asymmetry_fitting_options.is_normalisation_fixed = is_fixed
[ "def", "is_normalisation_fixed", "(", "self", ",", "is_fixed", ":", "bool", ")", "->", "None", ":", "self", ".", "tf_asymmetry_fitting_options", ".", "is_normalisation_fixed", "=", "is_fixed" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/tf_asymmetry_fitting/tf_asymmetry_fitting_view.py#L72-L74
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/input/win32.py
python
ConsoleInputReader._is_paste
(keys: List[KeyPress])
return newline_count >= 1 and text_count >= 1
Return `True` when we should consider this list of keys as a paste event. Pasted text on windows will be turned into a `Keys.BracketedPaste` event. (It's not 100% correct, but it is probably the best possible way to detect pasting of text and handle that correctly.)
Return `True` when we should consider this list of keys as a paste event. Pasted text on windows will be turned into a `Keys.BracketedPaste` event. (It's not 100% correct, but it is probably the best possible way to detect pasting of text and handle that correctly.)
[ "Return", "True", "when", "we", "should", "consider", "this", "list", "of", "keys", "as", "a", "paste", "event", ".", "Pasted", "text", "on", "windows", "will", "be", "turned", "into", "a", "Keys", ".", "BracketedPaste", "event", ".", "(", "It", "s", "...
def _is_paste(keys: List[KeyPress]) -> bool: """ Return `True` when we should consider this list of keys as a paste event. Pasted text on windows will be turned into a `Keys.BracketedPaste` event. (It's not 100% correct, but it is probably the best possible way to detect pasting ...
[ "def", "_is_paste", "(", "keys", ":", "List", "[", "KeyPress", "]", ")", "->", "bool", ":", "# Consider paste when it contains at least one newline and at least one", "# other character.", "text_count", "=", "0", "newline_count", "=", "0", "for", "k", "in", "keys", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/input/win32.py#L366-L385
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/confusion_matrix.py
python
remove_squeezable_dimensions
( labels, predictions, expected_rank_diff=0, name=None)
Squeeze last dim if ranks differ from expected by exactly 1. In the common case where we expect shapes to match, `expected_rank_diff` defaults to 0, and we squeeze the last dimension of the larger rank if they differ by 1. But, for example, if `labels` contains class IDs and `predictions` contains 1 probabi...
Squeeze last dim if ranks differ from expected by exactly 1.
[ "Squeeze", "last", "dim", "if", "ranks", "differ", "from", "expected", "by", "exactly", "1", "." ]
def remove_squeezable_dimensions( labels, predictions, expected_rank_diff=0, name=None): """Squeeze last dim if ranks differ from expected by exactly 1. In the common case where we expect shapes to match, `expected_rank_diff` defaults to 0, and we squeeze the last dimension of the larger rank if they diffe...
[ "def", "remove_squeezable_dimensions", "(", "labels", ",", "predictions", ",", "expected_rank_diff", "=", "0", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "'remove_squeezable_dimensions'", ",", "[", "labels", ",", "p...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/confusion_matrix.py#L36-L93
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/retdec-3.2/scripts/type_extractor/extract_types.py
python
parse_header
(header_file, path, output_handler, output_dir, output_format, indent)
Get types information from header file and writes output in chosen format to file to output directory. Path to header set to functions is relative path from script's input path.
Get types information from header file and writes output in chosen format to file to output directory.
[ "Get", "types", "information", "from", "header", "file", "and", "writes", "output", "in", "chosen", "format", "to", "file", "to", "output", "directory", "." ]
def parse_header(header_file, path, output_handler, output_dir, output_format, indent): """Get types information from header file and writes output in chosen format to file to output directory. Path to header set to functions is relative path from script's input path. """ logging.info('Reading file...
[ "def", "parse_header", "(", "header_file", ",", "path", ",", "output_handler", ",", "output_dir", ",", "output_format", ",", "indent", ")", ":", "logging", ".", "info", "(", "'Reading file: {}'", ".", "format", "(", "header_file", ")", ")", "content", "=", "...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/type_extractor/extract_types.py#L45-L65
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/inspect.py
python
isframe
(object)
return isinstance(object, types.FrameType)
Return true if the object is a frame object. Frame objects provide these attributes: f_back next outer frame object (this frame's caller) f_builtins built-in namespace seen by this frame f_code code object being executed in this frame f_globals global na...
Return true if the object is a frame object.
[ "Return", "true", "if", "the", "object", "is", "a", "frame", "object", "." ]
def isframe(object): """Return true if the object is a frame object. Frame objects provide these attributes: f_back next outer frame object (this frame's caller) f_builtins built-in namespace seen by this frame f_code code object being executed in this frame ...
[ "def", "isframe", "(", "object", ")", ":", "return", "isinstance", "(", "object", ",", "types", ".", "FrameType", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/inspect.py#L238-L250
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
UpdateUIEvent.GetSetShown
(*args, **kwargs)
return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
GetSetShown(self) -> bool Returns ``True`` if the application has called `Show`. For wxWidgets internal use only.
GetSetShown(self) -> bool
[ "GetSetShown", "(", "self", ")", "-", ">", "bool" ]
def GetSetShown(*args, **kwargs): """ GetSetShown(self) -> bool Returns ``True`` if the application has called `Show`. For wxWidgets internal use only. """ return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
[ "def", "GetSetShown", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "UpdateUIEvent_GetSetShown", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L6808-L6815
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/package/analyze/trace_dependencies.py
python
trace_dependencies
( callable: Callable[[Any], Any], inputs: Iterable[Tuple[Any, ...]] )
return list(modules_used)
Trace the execution of a callable in order to determine which modules it uses. Args: callable: The callable to execute and trace. inputs: The input to use during tracing. The modules used by 'callable' when invoked by each set of inputs are union-ed to determine all modules used by the ...
Trace the execution of a callable in order to determine which modules it uses.
[ "Trace", "the", "execution", "of", "a", "callable", "in", "order", "to", "determine", "which", "modules", "it", "uses", "." ]
def trace_dependencies( callable: Callable[[Any], Any], inputs: Iterable[Tuple[Any, ...]] ) -> List[str]: """Trace the execution of a callable in order to determine which modules it uses. Args: callable: The callable to execute and trace. inputs: The input to use during tracing. The modules...
[ "def", "trace_dependencies", "(", "callable", ":", "Callable", "[", "[", "Any", "]", ",", "Any", "]", ",", "inputs", ":", "Iterable", "[", "Tuple", "[", "Any", ",", "...", "]", "]", ")", "->", "List", "[", "str", "]", ":", "modules_used", "=", "set...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/package/analyze/trace_dependencies.py#L5-L60
stellar-deprecated/stellard
67eabb2217bdfa9a6ea317f62338fb6bca458c90
src/protobuf/python/google/protobuf/text_format.py
python
_MergeScalarField
(tokenizer, message, field)
Merges a single protocol message scalar field into a message. Args: tokenizer: A tokenizer to parse the field value. message: A protocol message to record the data. field: The descriptor of the field to be merged. Raises: ParseError: In case of ASCII parsing problems. RuntimeError: On runtime ...
Merges a single protocol message scalar field into a message.
[ "Merges", "a", "single", "protocol", "message", "scalar", "field", "into", "a", "message", "." ]
def _MergeScalarField(tokenizer, message, field): """Merges a single protocol message scalar field into a message. Args: tokenizer: A tokenizer to parse the field value. message: A protocol message to record the data. field: The descriptor of the field to be merged. Raises: ParseError: In case o...
[ "def", "_MergeScalarField", "(", "tokenizer", ",", "message", ",", "field", ")", ":", "tokenizer", ".", "Consume", "(", "':'", ")", "value", "=", "None", "if", "field", ".", "type", "in", "(", "descriptor", ".", "FieldDescriptor", ".", "TYPE_INT32", ",", ...
https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/text_format.py#L241-L293
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/lookup/lookup_ops.py
python
index_to_string
(tensor, mapping, default_value="UNK", name=None)
Maps `tensor` of indices into string values based on `mapping`. This operation converts `int64` indices into string values. The mapping is initialized from a string `mapping` tensor where each element is a value and the corresponding index within the tensor is the key. Any input which does not have a correspo...
Maps `tensor` of indices into string values based on `mapping`.
[ "Maps", "tensor", "of", "indices", "into", "string", "values", "based", "on", "mapping", "." ]
def index_to_string(tensor, mapping, default_value="UNK", name=None): """Maps `tensor` of indices into string values based on `mapping`. This operation converts `int64` indices into string values. The mapping is initialized from a string `mapping` tensor where each element is a value and the corresponding inde...
[ "def", "index_to_string", "(", "tensor", ",", "mapping", ",", "default_value", "=", "\"UNK\"", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "tensor", "]", ",", "name", ",", "\"index_to_string\"", ")", "as", "scope", ":", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/lookup/lookup_ops.py#L636-L687
jeog/TOSDataBridge
6a5a08ca5cf3883db1f12e9bc89ef374d098df5a
python/tosdb/_common.py
python
_TOSDB_DataBlock.info
()
Returns a more readable dict of info about the underlying block
Returns a more readable dict of info about the underlying block
[ "Returns", "a", "more", "readable", "dict", "of", "info", "about", "the", "underlying", "block" ]
def info(): """ Returns a more readable dict of info about the underlying block """ pass
[ "def", "info", "(", ")", ":", "pass" ]
https://github.com/jeog/TOSDataBridge/blob/6a5a08ca5cf3883db1f12e9bc89ef374d098df5a/python/tosdb/_common.py#L75-L77
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/closure_linter/closure_linter/statetracker.py
python
_GetNextIdentifierToken
(start_token)
return None
Searches for and returns the first identifier at the beginning of a token. Searches each token after the start to see if it starts with an identifier. If found, will split the token into at most 3 piecies: leading whitespace, identifier, rest of token, returning the identifier token. If no identifier is found ...
Searches for and returns the first identifier at the beginning of a token.
[ "Searches", "for", "and", "returns", "the", "first", "identifier", "at", "the", "beginning", "of", "a", "token", "." ]
def _GetNextIdentifierToken(start_token): """Searches for and returns the first identifier at the beginning of a token. Searches each token after the start to see if it starts with an identifier. If found, will split the token into at most 3 piecies: leading whitespace, identifier, rest of token, returning the...
[ "def", "_GetNextIdentifierToken", "(", "start_token", ")", ":", "token", "=", "start_token", ".", "next", "while", "token", "and", "not", "token", ".", "type", "in", "Type", ".", "FLAG_ENDING_TYPES", ":", "match", "=", "javascripttokenizer", ".", "JavaScriptToke...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/statetracker.py#L438-L464
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py3/jinja2/compiler.py
python
CodeGenerator._output_const_repr
(self, group: t.Iterable[t.Any])
return repr(concat(group))
Given a group of constant values converted from ``Output`` child nodes, produce a string to write to the template module source.
Given a group of constant values converted from ``Output`` child nodes, produce a string to write to the template module source.
[ "Given", "a", "group", "of", "constant", "values", "converted", "from", "Output", "child", "nodes", "produce", "a", "string", "to", "write", "to", "the", "template", "module", "source", "." ]
def _output_const_repr(self, group: t.Iterable[t.Any]) -> str: """Given a group of constant values converted from ``Output`` child nodes, produce a string to write to the template module source. """ return repr(concat(group))
[ "def", "_output_const_repr", "(", "self", ",", "group", ":", "t", ".", "Iterable", "[", "t", ".", "Any", "]", ")", "->", "str", ":", "return", "repr", "(", "concat", "(", "group", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/compiler.py#L1424-L1429
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/rospkg/manifest.py
python
_check_optional
(name, allowXHTML=False, merge_multiple=False)
return check
Validator for optional elements. :raise: :exc:`InvalidManifest` If validation fails
Validator for optional elements.
[ "Validator", "for", "optional", "elements", "." ]
def _check_optional(name, allowXHTML=False, merge_multiple=False): """ Validator for optional elements. :raise: :exc:`InvalidManifest` If validation fails """ def check(n, filename): n = _get_nodes_by_name(n, name) if len(n) > 1 and not merge_multiple: raise InvalidManif...
[ "def", "_check_optional", "(", "name", ",", "allowXHTML", "=", "False", ",", "merge_multiple", "=", "False", ")", ":", "def", "check", "(", "n", ",", "filename", ")", ":", "n", "=", "_get_nodes_by_name", "(", "n", ",", "name", ")", "if", "len", "(", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/rospkg/manifest.py#L59-L77
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/ctypes/macholib/dyld.py
python
dyld_find
(name, executable_path=None, env=None)
Find a library or framework using dyld semantics
Find a library or framework using dyld semantics
[ "Find", "a", "library", "or", "framework", "using", "dyld", "semantics" ]
def dyld_find(name, executable_path=None, env=None): """ Find a library or framework using dyld semantics """ for path in dyld_image_suffix_search(chain( dyld_override_search(name, env), dyld_executable_path_search(name, executable_path), dyld_default_sear...
[ "def", "dyld_find", "(", "name", ",", "executable_path", "=", "None", ",", "env", "=", "None", ")", ":", "for", "path", "in", "dyld_image_suffix_search", "(", "chain", "(", "dyld_override_search", "(", "name", ",", "env", ")", ",", "dyld_executable_path_search...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ctypes/macholib/dyld.py#L121-L139
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/element.py
python
Element.getBySymbol
(symbol)
return Element._elements_by_symbol[s]
Get the Element with a particular chemical symbol.
Get the Element with a particular chemical symbol.
[ "Get", "the", "Element", "with", "a", "particular", "chemical", "symbol", "." ]
def getBySymbol(symbol): """Get the Element with a particular chemical symbol.""" s = symbol.strip().upper() return Element._elements_by_symbol[s]
[ "def", "getBySymbol", "(", "symbol", ")", ":", "s", "=", "symbol", ".", "strip", "(", ")", ".", "upper", "(", ")", "return", "Element", ".", "_elements_by_symbol", "[", "s", "]" ]
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/element.py#L100-L103
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_style.py
python
MergeStyles
(styles1, styles2)
return styles1
Merges the styles from styles2 into styles1 overwriting any duplicate values already set in styles1 with the new data from styles2. @param styles1: dictionary of StyleItems to receive merge @param styles2: dictionary of StyleItems to merge from @return: style1 with all values from styles2 merged int...
Merges the styles from styles2 into styles1 overwriting any duplicate values already set in styles1 with the new data from styles2. @param styles1: dictionary of StyleItems to receive merge @param styles2: dictionary of StyleItems to merge from @return: style1 with all values from styles2 merged int...
[ "Merges", "the", "styles", "from", "styles2", "into", "styles1", "overwriting", "any", "duplicate", "values", "already", "set", "in", "styles1", "with", "the", "new", "data", "from", "styles2", ".", "@param", "styles1", ":", "dictionary", "of", "StyleItems", "...
def MergeStyles(styles1, styles2): """Merges the styles from styles2 into styles1 overwriting any duplicate values already set in styles1 with the new data from styles2. @param styles1: dictionary of StyleItems to receive merge @param styles2: dictionary of StyleItems to merge from @return: styl...
[ "def", "MergeStyles", "(", "styles1", ",", "styles2", ")", ":", "for", "style", "in", "styles2", ":", "styles1", "[", "style", "]", "=", "styles2", "[", "style", "]", "return", "styles1" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_style.py#L1076-L1087
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/client/device_lib.py
python
list_local_devices
()
return [_convert(s) for s in pywrap_tensorflow.list_devices()]
List the available devices available in the local process. Returns: A list of `DeviceAttribute` protocol buffers.
List the available devices available in the local process.
[ "List", "the", "available", "devices", "available", "in", "the", "local", "process", "." ]
def list_local_devices(): """List the available devices available in the local process. Returns: A list of `DeviceAttribute` protocol buffers. """ def _convert(pb_str): m = device_attributes_pb2.DeviceAttributes() m.ParseFromString(pb_str) return m return [_convert(s) for s in pywrap_tensorf...
[ "def", "list_local_devices", "(", ")", ":", "def", "_convert", "(", "pb_str", ")", ":", "m", "=", "device_attributes_pb2", ".", "DeviceAttributes", "(", ")", "m", ".", "ParseFromString", "(", "pb_str", ")", "return", "m", "return", "[", "_convert", "(", "s...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/client/device_lib.py#L25-L36
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/inspect.py
python
getsourcelines
(object)
Return a list of source lines and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of the lines corresponding to the object and the line number indicates where in the original source file ...
Return a list of source lines and starting line number for an object.
[ "Return", "a", "list", "of", "source", "lines", "and", "starting", "line", "number", "for", "an", "object", "." ]
def getsourcelines(object): """Return a list of source lines and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of the lines corresponding to the object and the line number indicates whe...
[ "def", "getsourcelines", "(", "object", ")", ":", "lines", ",", "lnum", "=", "findsource", "(", "object", ")", "if", "ismodule", "(", "object", ")", ":", "return", "lines", ",", "0", "else", ":", "return", "getblock", "(", "lines", "[", "lnum", ":", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/inspect.py#L682-L693
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/configure.py
python
get_python_path
(environ_cp, python_bin_path)
return paths
Get the python site package paths.
Get the python site package paths.
[ "Get", "the", "python", "site", "package", "paths", "." ]
def get_python_path(environ_cp, python_bin_path): """Get the python site package paths.""" python_paths = [] if environ_cp.get('PYTHONPATH'): python_paths = environ_cp.get('PYTHONPATH').split(':') try: library_paths = run_shell([ python_bin_path, '-c', 'import site; print("\\n".join(site...
[ "def", "get_python_path", "(", "environ_cp", ",", "python_bin_path", ")", ":", "python_paths", "=", "[", "]", "if", "environ_cp", ".", "get", "(", "'PYTHONPATH'", ")", ":", "python_paths", "=", "environ_cp", ".", "get", "(", "'PYTHONPATH'", ")", ".", "split"...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/configure.py#L165-L190
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/wizard.py
python
Wizard.ShowPage
(*args, **kwargs)
return _wizard.Wizard_ShowPage(*args, **kwargs)
ShowPage(self, WizardPage page, bool goingForward=True) -> bool
ShowPage(self, WizardPage page, bool goingForward=True) -> bool
[ "ShowPage", "(", "self", "WizardPage", "page", "bool", "goingForward", "=", "True", ")", "-", ">", "bool" ]
def ShowPage(*args, **kwargs): """ShowPage(self, WizardPage page, bool goingForward=True) -> bool""" return _wizard.Wizard_ShowPage(*args, **kwargs)
[ "def", "ShowPage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_wizard", ".", "Wizard_ShowPage", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/wizard.py#L443-L445
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/fuchsia/target.py
python
Target.PutFiles
(self, sources, dest, recursive=False, for_package=None, for_realms=())
Copies files from the local filesystem to the target filesystem. sources: List of local file paths to copy from, or a single path. dest: The path on the remote filesystem which will be copied to. recursive: If true, performs a recursive copy. for_package: If specified, /data in the |dest| is mapped to ...
Copies files from the local filesystem to the target filesystem.
[ "Copies", "files", "from", "the", "local", "filesystem", "to", "the", "target", "filesystem", "." ]
def PutFiles(self, sources, dest, recursive=False, for_package=None, for_realms=()): """Copies files from the local filesystem to the target filesystem. sources: List of local file paths to copy from, or a single path. dest: The pat...
[ "def", "PutFiles", "(", "self", ",", "sources", ",", "dest", ",", "recursive", "=", "False", ",", "for_package", "=", "None", ",", "for_realms", "=", "(", ")", ")", ":", "assert", "type", "(", "sources", ")", "is", "tuple", "or", "type", "(", "source...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/fuchsia/target.py#L197-L219
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/xcode_emulation.py
python
MacPrefixHeader.GetInclude
(self, lang)
Gets the cflags to include the prefix header for language |lang|.
Gets the cflags to include the prefix header for language |lang|.
[ "Gets", "the", "cflags", "to", "include", "the", "prefix", "header", "for", "language", "|lang|", "." ]
def GetInclude(self, lang): """Gets the cflags to include the prefix header for language |lang|.""" if self.compile_headers and lang in self.compiled_headers: return '-include %s' % self.compiled_headers[lang] elif self.header: return '-include %s' % self.header else: return ''
[ "def", "GetInclude", "(", "self", ",", "lang", ")", ":", "if", "self", ".", "compile_headers", "and", "lang", "in", "self", ".", "compiled_headers", ":", "return", "'-include %s'", "%", "self", ".", "compiled_headers", "[", "lang", "]", "elif", "self", "."...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/xcode_emulation.py#L745-L752
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/lib/pretty.py
python
PrettyPrinter.breakable
(self, sep=' ')
Add a breakable separator to the output. This does not mean that it will automatically break here. If no breaking on this position takes place the `sep` is inserted which default to one space.
Add a breakable separator to the output. This does not mean that it will automatically break here. If no breaking on this position takes place the `sep` is inserted which default to one space.
[ "Add", "a", "breakable", "separator", "to", "the", "output", ".", "This", "does", "not", "mean", "that", "it", "will", "automatically", "break", "here", ".", "If", "no", "breaking", "on", "this", "position", "takes", "place", "the", "sep", "is", "inserted"...
def breakable(self, sep=' '): """ Add a breakable separator to the output. This does not mean that it will automatically break here. If no breaking on this position takes place the `sep` is inserted which default to one space. """ width = len(sep) group = self.g...
[ "def", "breakable", "(", "self", ",", "sep", "=", "' '", ")", ":", "width", "=", "len", "(", "sep", ")", "group", "=", "self", ".", "group_stack", "[", "-", "1", "]", "if", "group", ".", "want_break", ":", "self", ".", "flush", "(", ")", "self", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/lib/pretty.py#L232-L249
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/cryptography/x509/base.py
python
CertificateBuilder.add_extension
(self, extension, critical)
return CertificateBuilder( self._issuer_name, self._subject_name, self._public_key, self._serial_number, self._not_valid_before, self._not_valid_after, self._extensions + [extension] )
Adds an X.509 extension to the certificate.
Adds an X.509 extension to the certificate.
[ "Adds", "an", "X", ".", "509", "extension", "to", "the", "certificate", "." ]
def add_extension(self, extension, critical): """ Adds an X.509 extension to the certificate. """ if not isinstance(extension, ExtensionType): raise TypeError("extension must be an ExtensionType") extension = Extension(extension.oid, critical, extension) _rej...
[ "def", "add_extension", "(", "self", ",", "extension", ",", "critical", ")", ":", "if", "not", "isinstance", "(", "extension", ",", "ExtensionType", ")", ":", "raise", "TypeError", "(", "\"extension must be an ExtensionType\"", ")", "extension", "=", "Extension", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/cryptography/x509/base.py#L562-L576
ablab/quast
5f6709528129a6ad266a6b24ef3f40b88f0fe04b
quast_libs/site_packages/joblib2/memory.py
python
MemorizedFunc._persist_input
(self, output_dir, *args, **kwargs)
return input_repr
Save a small summary of the call using json format in the output directory.
Save a small summary of the call using json format in the output directory.
[ "Save", "a", "small", "summary", "of", "the", "call", "using", "json", "format", "in", "the", "output", "directory", "." ]
def _persist_input(self, output_dir, *args, **kwargs): """ Save a small summary of the call using json format in the output directory. """ argument_dict = filter_args(self.func, self.ignore, args, kwargs) input_repr = dict((k, repr(v)) for...
[ "def", "_persist_input", "(", "self", ",", "output_dir", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "argument_dict", "=", "filter_args", "(", "self", ".", "func", ",", "self", ".", "ignore", ",", "args", ",", "kwargs", ")", "input_repr", "=",...
https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/site_packages/joblib2/memory.py#L385-L404
gemrb/gemrb
730206eed8d1dd358ca5e69a62f9e099aa22ffc6
gemrb/GUIScripts/bg2/CharGenCommon.py
python
ImportPress
()
return
Opens the character import window.
Opens the character import window.
[ "Opens", "the", "character", "import", "window", "." ]
def ImportPress(): """Opens the character import window.""" step = GemRB.GetVar ("Step") # TODO: check why this is handled differently if step == 1: GemRB.SetNextScript("GUICG24") else: GemRB.SetToken ("NextScript", "CharGen9") GemRB.SetNextScript ("ImportFile") #import return
[ "def", "ImportPress", "(", ")", ":", "step", "=", "GemRB", ".", "GetVar", "(", "\"Step\"", ")", "# TODO: check why this is handled differently", "if", "step", "==", "1", ":", "GemRB", ".", "SetNextScript", "(", "\"GUICG24\"", ")", "else", ":", "GemRB", ".", ...
https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/bg2/CharGenCommon.py#L317-L327
kungfu-origin/kungfu
90c84b2b590855654cb9a6395ed050e0f7763512
core/deps/SQLiteCpp-2.3.0/cpplint.py
python
_FunctionState.Check
(self, error, filename, linenum)
Report if too many lines in function body. Args: error: The function to call with any errors found. filename: The name of the current file. linenum: The number of the line to check.
Report if too many lines in function body.
[ "Report", "if", "too", "many", "lines", "in", "function", "body", "." ]
def Check(self, error, filename, linenum): """Report if too many lines in function body. Args: error: The function to call with any errors found. filename: The name of the current file. linenum: The number of the line to check. """ if Match(r'T(EST|est)', self.current_function): ...
[ "def", "Check", "(", "self", ",", "error", ",", "filename", ",", "linenum", ")", ":", "if", "Match", "(", "r'T(EST|est)'", ",", "self", ".", "current_function", ")", ":", "base_trigger", "=", "self", ".", "_TEST_TRIGGER", "else", ":", "base_trigger", "=", ...
https://github.com/kungfu-origin/kungfu/blob/90c84b2b590855654cb9a6395ed050e0f7763512/core/deps/SQLiteCpp-2.3.0/cpplint.py#L827-L850
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/MSVSVersion.py
python
_RegistryQuery
(key, value=None)
return text
r"""Use reg.exe to read a particular key through _RegistryQueryBase. First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If that fails, it falls back to System32. Sysnative is available on Vista and up and available on Windows Server 2003 and XP through KB patch 942589. Note that Sysnati...
r"""Use reg.exe to read a particular key through _RegistryQueryBase.
[ "r", "Use", "reg", ".", "exe", "to", "read", "a", "particular", "key", "through", "_RegistryQueryBase", "." ]
def _RegistryQuery(key, value=None): r"""Use reg.exe to read a particular key through _RegistryQueryBase. First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If that fails, it falls back to System32. Sysnative is available on Vista and up and available on Windows Server 2003 and XP throu...
[ "def", "_RegistryQuery", "(", "key", ",", "value", "=", "None", ")", ":", "text", "=", "None", "try", ":", "text", "=", "_RegistryQueryBase", "(", "'Sysnative'", ",", "key", ",", "value", ")", "except", "OSError", ",", "e", ":", "if", "e", ".", "errn...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/MSVSVersion.py#L141-L166
synfig/synfig
a5ec91db5b751dc12e4400ccfb5c063fd6d2d928
synfig-studio/plugins/lottie-exporter/common/DashItemList.py
python
DashItemList.__init__
(self, dash_item, parent)
This parent should be parameter
This parent should be parameter
[ "This", "parent", "should", "be", "parameter" ]
def __init__(self, dash_item, parent): """ This parent should be parameter """ self.parent = parent self.dash_item = dash_item self.type = dash_item.attrib["type"] self.entry_list = [] self.extract_entries(self.entry_list)
[ "def", "__init__", "(", "self", ",", "dash_item", ",", "parent", ")", ":", "self", ".", "parent", "=", "parent", "self", ".", "dash_item", "=", "dash_item", "self", ".", "type", "=", "dash_item", ".", "attrib", "[", "\"type\"", "]", "self", ".", "entry...
https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/common/DashItemList.py#L18-L26
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
ppapi/generators/idl_parser.py
python
IDLParser.p_value_lshift
(self, p)
value : integer LSHIFT INT
value : integer LSHIFT INT
[ "value", ":", "integer", "LSHIFT", "INT" ]
def p_value_lshift(self, p): """value : integer LSHIFT INT""" p[0] = "%s << %s" % (p[1], p[3]) if self.parse_debug: DumpReduction('value', p)
[ "def", "p_value_lshift", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "\"%s << %s\"", "%", "(", "p", "[", "1", "]", ",", "p", "[", "3", "]", ")", "if", "self", ".", "parse_debug", ":", "DumpReduction", "(", "'value'", ",", "p", ")"...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_parser.py#L491-L494
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
resources/osm_importer/webots_objects/road.py
python
Crossroad.add_road
(self, road)
Add a road.
Add a road.
[ "Add", "a", "road", "." ]
def add_road(self, road): """Add a road.""" self.roads.add(road)
[ "def", "add_road", "(", "self", ",", "road", ")", ":", "self", ".", "roads", ".", "add", "(", "road", ")" ]
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/resources/osm_importer/webots_objects/road.py#L654-L656
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_base.py
python
StreamBase.receive_bytes
(self, length)
return ''.join(read_bytes)
Receives multiple bytes. Retries read when we couldn't receive the specified amount. Raises: ConnectionTerminatedException: when read returns empty string.
Receives multiple bytes. Retries read when we couldn't receive the specified amount.
[ "Receives", "multiple", "bytes", ".", "Retries", "read", "when", "we", "couldn", "t", "receive", "the", "specified", "amount", "." ]
def receive_bytes(self, length): """Receives multiple bytes. Retries read when we couldn't receive the specified amount. Raises: ConnectionTerminatedException: when read returns empty string. """ read_bytes = [] while length > 0: new_read_bytes =...
[ "def", "receive_bytes", "(", "self", ",", "length", ")", ":", "read_bytes", "=", "[", "]", "while", "length", ">", "0", ":", "new_read_bytes", "=", "self", ".", "_read", "(", "length", ")", "read_bytes", ".", "append", "(", "new_read_bytes", ")", "length...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_base.py#L149-L162
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/distributions/python/ops/wishart.py
python
_WishartLinearOperator.mean_log_det
(self, name="mean_log_det")
Computes E[log(det(X))] under this Wishart distribution.
Computes E[log(det(X))] under this Wishart distribution.
[ "Computes", "E", "[", "log", "(", "det", "(", "X", "))", "]", "under", "this", "Wishart", "distribution", "." ]
def mean_log_det(self, name="mean_log_det"): """Computes E[log(det(X))] under this Wishart distribution.""" with self._name_scope(name): return (self._multi_digamma(0.5 * self.df, self.dimension) + self.dimension * math.log(2.) + 2 * self.scale_operator.log_abs_determinant())
[ "def", "mean_log_det", "(", "self", ",", "name", "=", "\"mean_log_det\"", ")", ":", "with", "self", ".", "_name_scope", "(", "name", ")", ":", "return", "(", "self", ".", "_multi_digamma", "(", "0.5", "*", "self", ".", "df", ",", "self", ".", "dimensio...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/distributions/python/ops/wishart.py#L399-L404
Samsung/veles
95ed733c2e49bc011ad98ccf2416ecec23fbf352
libVeles/cpplint.py
python
CheckAltTokens
(filename, clean_lines, linenum, error)
Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Check alternative keywords being used in boolean expressions.
[ "Check", "alternative", "keywords", "being", "used", "in", "boolean", "expressions", "." ]
def CheckAltTokens(filename, clean_lines, linenum, error): """Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call ...
[ "def", "CheckAltTokens", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Avoid preprocessor lines", "if", "Match", "(", "r'^\\s*#'", ",", "line", ")", ":", "retur...
https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/libVeles/cpplint.py#L2740-L2769
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/array_ops.py
python
tile_one_dimension
(data, axis, multiple)
return tile(data, multiples)
Tiles a single dimension of a tensor.
Tiles a single dimension of a tensor.
[ "Tiles", "a", "single", "dimension", "of", "a", "tensor", "." ]
def tile_one_dimension(data, axis, multiple): """Tiles a single dimension of a tensor.""" # Assumes axis is a nonnegative int. if data.shape.ndims is not None: multiples = [1] * data.shape.ndims multiples[axis] = multiple else: ones_value = ones(rank(data), dtypes.int32) multiples = concat([ones...
[ "def", "tile_one_dimension", "(", "data", ",", "axis", ",", "multiple", ")", ":", "# Assumes axis is a nonnegative int.", "if", "data", ".", "shape", ".", "ndims", "is", "not", "None", ":", "multiples", "=", "[", "1", "]", "*", "data", ".", "shape", ".", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/array_ops.py#L6867-L6877
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py
python
count
(a, axis = None)
return a.count(axis)
Count of the non-masked elements in a, or along a certain axis.
Count of the non-masked elements in a, or along a certain axis.
[ "Count", "of", "the", "non", "-", "masked", "elements", "in", "a", "or", "along", "a", "certain", "axis", "." ]
def count (a, axis = None): "Count of the non-masked elements in a, or along a certain axis." a = masked_array(a) return a.count(axis)
[ "def", "count", "(", "a", ",", "axis", "=", "None", ")", ":", "a", "=", "masked_array", "(", "a", ")", "return", "a", ".", "count", "(", "axis", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L1586-L1589
stepcode/stepcode
2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39
src/exp2python/python/SCL/Part21.py
python
Lexer.t_PART21_END
(self, t)
return t
r'END-ISO-10303-21;
r'END-ISO-10303-21;
[ "r", "END", "-", "ISO", "-", "10303", "-", "21", ";" ]
def t_PART21_END(self, t): r'END-ISO-10303-21;' t.lexer.begin('slurp') return t
[ "def", "t_PART21_END", "(", "self", ",", "t", ")", ":", "t", ".", "lexer", ".", "begin", "(", "'slurp'", ")", "return", "t" ]
https://github.com/stepcode/stepcode/blob/2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39/src/exp2python/python/SCL/Part21.py#L146-L149
cksystemsgroup/scalloc
049857919b5fa1d539c9e4206e353daca2e87394
tools/cpplint.py
python
CheckSpacing
(filename, clean_lines, linenum, nesting_state, error)
Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't start a block with a blank line, don't end a function with a blank line, don't ...
Checks for the correctness of various spacing issues in the code.
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "issues", "in", "the", "code", "." ]
def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't star...
[ "def", "CheckSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Don't use \"elided\" lines here, otherwise we can't check commented lines.", "# Don't want to use \"raw\" either, because we don't want to check inside C++11", ...
https://github.com/cksystemsgroup/scalloc/blob/049857919b5fa1d539c9e4206e353daca2e87394/tools/cpplint.py#L2531-L2876
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
chrome/common/extensions/docs/server2/patcher.py
python
Patcher.GetPatchedFiles
(self, version=None)
Returns patched files as(added_files, deleted_files, modified_files) from the patchset specified by |version|.
Returns patched files as(added_files, deleted_files, modified_files) from the patchset specified by |version|.
[ "Returns", "patched", "files", "as", "(", "added_files", "deleted_files", "modified_files", ")", "from", "the", "patchset", "specified", "by", "|version|", "." ]
def GetPatchedFiles(self, version=None): '''Returns patched files as(added_files, deleted_files, modified_files) from the patchset specified by |version|. ''' raise NotImplementedError(self.__class__)
[ "def", "GetPatchedFiles", "(", "self", ",", "version", "=", "None", ")", ":", "raise", "NotImplementedError", "(", "self", ".", "__class__", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/patcher.py#L6-L10
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/framework/ops.py
python
Operation.values
(self)
return tuple(self.outputs)
DEPRECATED: Use outputs.
DEPRECATED: Use outputs.
[ "DEPRECATED", ":", "Use", "outputs", "." ]
def values(self): """DEPRECATED: Use outputs.""" return tuple(self.outputs)
[ "def", "values", "(", "self", ")", ":", "return", "tuple", "(", "self", ".", "outputs", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/ops.py#L1328-L1330
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/handlers.py
python
conditionally_calculate_md5
(params, context, request_signer, **kwargs)
Only add a Content-MD5 if the system supports it.
Only add a Content-MD5 if the system supports it.
[ "Only", "add", "a", "Content", "-", "MD5", "if", "the", "system", "supports", "it", "." ]
def conditionally_calculate_md5(params, context, request_signer, **kwargs): """Only add a Content-MD5 if the system supports it.""" if MD5_AVAILABLE: calculate_md5(params, **kwargs)
[ "def", "conditionally_calculate_md5", "(", "params", ",", "context", ",", "request_signer", ",", "*", "*", "kwargs", ")", ":", "if", "MD5_AVAILABLE", ":", "calculate_md5", "(", "params", ",", "*", "*", "kwargs", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/handlers.py#L213-L216
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/profiler/parser/framework_parser.py
python
FrameworkParser._special_process_tensor_data
(item_binary_data, data_type, tensor_num)
return unpack_data
The tensor data depends tensor num, so need to special process.
The tensor data depends tensor num, so need to special process.
[ "The", "tensor", "data", "depends", "tensor", "num", "so", "need", "to", "special", "process", "." ]
def _special_process_tensor_data(item_binary_data, data_type, tensor_num): """The tensor data depends tensor num, so need to special process.""" start = 0 op_attr_struct = data_type[0] op_attr_size = StructType.sizeof(op_attr_struct) unpack_data = [] for _ in range(tenso...
[ "def", "_special_process_tensor_data", "(", "item_binary_data", ",", "data_type", ",", "tensor_num", ")", ":", "start", "=", "0", "op_attr_struct", "=", "data_type", "[", "0", "]", "op_attr_size", "=", "StructType", ".", "sizeof", "(", "op_attr_struct", ")", "un...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/profiler/parser/framework_parser.py#L268-L287
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchSite.py
python
makeSolarDiagram
(longitude,latitude,scale=1,complete=False,tz=None)
return mastersep
makeSolarDiagram(longitude,latitude,[scale,complete,tz]): returns a solar diagram as a pivy node. If complete is True, the 12 months are drawn. Tz is the timezone related to UTC (ex: -3 = UTC-3)
makeSolarDiagram(longitude,latitude,[scale,complete,tz]): returns a solar diagram as a pivy node. If complete is True, the 12 months are drawn. Tz is the timezone related to UTC (ex: -3 = UTC-3)
[ "makeSolarDiagram", "(", "longitude", "latitude", "[", "scale", "complete", "tz", "]", ")", ":", "returns", "a", "solar", "diagram", "as", "a", "pivy", "node", ".", "If", "complete", "is", "True", "the", "12", "months", "are", "drawn", ".", "Tz", "is", ...
def makeSolarDiagram(longitude,latitude,scale=1,complete=False,tz=None): """makeSolarDiagram(longitude,latitude,[scale,complete,tz]): returns a solar diagram as a pivy node. If complete is True, the 12 months are drawn. Tz is the timezone related to UTC (ex: -3 = UTC-3)""" oldversion = False l...
[ "def", "makeSolarDiagram", "(", "longitude", ",", "latitude", ",", "scale", "=", "1", ",", "complete", "=", "False", ",", "tz", "=", "None", ")", ":", "oldversion", "=", "False", "ladybug", "=", "False", "try", ":", "import", "ladybug", "from", "ladybug"...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchSite.py#L105-L287
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/math/spline.py
python
hermite_deriv
(x1,v1,x2,v2,u,order=1)
Returns the derivative of a hermite curve with control points x1, v1, x2, v2 at the parameter u in [0,1]. If order > 1, higher order derivatives are returned.
Returns the derivative of a hermite curve with control points x1, v1, x2, v2 at the parameter u in [0,1]. If order > 1, higher order derivatives are returned.
[ "Returns", "the", "derivative", "of", "a", "hermite", "curve", "with", "control", "points", "x1", "v1", "x2", "v2", "at", "the", "parameter", "u", "in", "[", "0", "1", "]", ".", "If", "order", ">", "1", "higher", "order", "derivatives", "are", "returne...
def hermite_deriv(x1,v1,x2,v2,u,order=1): """Returns the derivative of a hermite curve with control points x1, v1, x2, v2 at the parameter u in [0,1]. If order > 1, higher order derivatives are returned.""" assert len(x1)==len(v1) assert len(x1)==len(x2) assert len(x1)==len(v2) if order == ...
[ "def", "hermite_deriv", "(", "x1", ",", "v1", ",", "x2", ",", "v2", ",", "u", ",", "order", "=", "1", ")", ":", "assert", "len", "(", "x1", ")", "==", "len", "(", "v1", ")", "assert", "len", "(", "x1", ")", "==", "len", "(", "x2", ")", "ass...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/spline.py#L22-L60
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/plugins/codebrowser/codebrowser/gentag/cpptags.py
python
GenerateTags
(buff)
return formatter.rtags
GenTag interface method @return: taglib.DocStruct
GenTag interface method @return: taglib.DocStruct
[ "GenTag", "interface", "method", "@return", ":", "taglib", ".", "DocStruct" ]
def GenerateTags(buff): """GenTag interface method @return: taglib.DocStruct """ code = buff.read() # print "CODE", code lexer = get_lexer_by_name( "cpp", stripall = False ) formatter = CppFormatter() highlight( code, lexer, formatter) return formatter.rtags
[ "def", "GenerateTags", "(", "buff", ")", ":", "code", "=", "buff", ".", "read", "(", ")", "# print \"CODE\", code", "lexer", "=", "get_lexer_by_name", "(", "\"cpp\"", ",", "stripall", "=", "False", ")", "formatter", "=", "CppFormatter", "(", ")", "highlight"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/codebrowser/codebrowser/gentag/cpptags.py#L85-L96
rampageX/firmware-mod-kit
c94cd6aeee50d92ec5280a6dba6d74828fd3606b
src/binwalk-2.1.1/src/binwalk/core/plugin.py
python
Plugin.post_scan
(self)
Child class should override this if needed.
Child class should override this if needed.
[ "Child", "class", "should", "override", "this", "if", "needed", "." ]
def post_scan(self): ''' Child class should override this if needed. ''' pass
[ "def", "post_scan", "(", "self", ")", ":", "pass" ]
https://github.com/rampageX/firmware-mod-kit/blob/c94cd6aeee50d92ec5280a6dba6d74828fd3606b/src/binwalk-2.1.1/src/binwalk/core/plugin.py#L60-L64
facebook/fbthrift
fb9c8562aba04c4fd9b17716eb5d970cc88a75bb
build/fbcode_builder/getdeps/platform.py
python
get_available_ram
()
Returns a platform-appropriate available RAM metric in MiB.
Returns a platform-appropriate available RAM metric in MiB.
[ "Returns", "a", "platform", "-", "appropriate", "available", "RAM", "metric", "in", "MiB", "." ]
def get_available_ram() -> int: """ Returns a platform-appropriate available RAM metric in MiB. """ if sys.platform == "linux": return _get_available_ram_linux() elif sys.platform == "darwin": return _get_available_ram_macos() elif sys.platform == "win32": return _get_ava...
[ "def", "get_available_ram", "(", ")", "->", "int", ":", "if", "sys", ".", "platform", "==", "\"linux\"", ":", "return", "_get_available_ram_linux", "(", ")", "elif", "sys", ".", "platform", "==", "\"darwin\"", ":", "return", "_get_available_ram_macos", "(", ")...
https://github.com/facebook/fbthrift/blob/fb9c8562aba04c4fd9b17716eb5d970cc88a75bb/build/fbcode_builder/getdeps/platform.py#L133-L146
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
ObjectPoser.__init__
(self, object: "RigidObjectModel")
r""" __init__(ObjectPoser self, RigidObjectModel object) -> ObjectPoser
r""" __init__(ObjectPoser self, RigidObjectModel object) -> ObjectPoser
[ "r", "__init__", "(", "ObjectPoser", "self", "RigidObjectModel", "object", ")", "-", ">", "ObjectPoser" ]
def __init__(self, object: "RigidObjectModel"): r""" __init__(ObjectPoser self, RigidObjectModel object) -> ObjectPoser """ _robotsim.ObjectPoser_swiginit(self, _robotsim.new_ObjectPoser(object))
[ "def", "__init__", "(", "self", ",", "object", ":", "\"RigidObjectModel\"", ")", ":", "_robotsim", ".", "ObjectPoser_swiginit", "(", "self", ",", "_robotsim", ".", "new_ObjectPoser", "(", "object", ")", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L3613-L3619
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
buildscripts/resmokelib/selector.py
python
filter_jstests
(roots, include_files=None, include_with_all_tags=None, include_with_any_tags=None, exclude_files=None, exclude_with_all_tags=None, exclude_with_any_tags=None)
Filters out what jstests to run.
Filters out what jstests to run.
[ "Filters", "out", "what", "jstests", "to", "run", "." ]
def filter_jstests(roots, include_files=None, include_with_all_tags=None, include_with_any_tags=None, exclude_files=None, exclude_with_all_tags=None, exclude_with_any_tags=None): """ Filters out wha...
[ "def", "filter_jstests", "(", "roots", ",", "include_files", "=", "None", ",", "include_with_all_tags", "=", "None", ",", "include_with_any_tags", "=", "None", ",", "exclude_files", "=", "None", ",", "exclude_with_all_tags", "=", "None", ",", "exclude_with_any_tags"...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/resmokelib/selector.py#L105-L192
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/tlslite/X509CertChain.py
python
X509CertChain.validate
(self, x509TrustList)
Check the validity of the certificate chain. This checks that every certificate in the chain validates with the subsequent one, until some certificate validates with (or is identical to) one of the passed-in root certificates. The cryptlib_py module must be installed in order to use th...
Check the validity of the certificate chain.
[ "Check", "the", "validity", "of", "the", "certificate", "chain", "." ]
def validate(self, x509TrustList): """Check the validity of the certificate chain. This checks that every certificate in the chain validates with the subsequent one, until some certificate validates with (or is identical to) one of the passed-in root certificates. The cryptlib_...
[ "def", "validate", "(", "self", ",", "x509TrustList", ")", ":", "import", "cryptlib_py", "c1", "=", "None", "c2", "=", "None", "lastC", "=", "None", "rootC", "=", "None", "try", ":", "rootFingerprints", "=", "[", "c", ".", "getFingerprint", "(", ")", "...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/tlslite/X509CertChain.py#L67-L140
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
native_client_sdk/src/build_tools/nacl_sdk_scons/site_tools/nacl_tools.py
python
AppendOptCCFlags
(env, is_debug=False)
Append a set of CCFLAGS that will build a debug or optimized variant depending on the value of |is_debug|. Uses optional build-specific flags for debug and optimized builds. To set these in your build.scons files you can do something like this: nacl_env.Append(DEBUG_CCFLAGS=['-gfull'], O...
Append a set of CCFLAGS that will build a debug or optimized variant depending on the value of |is_debug|.
[ "Append", "a", "set", "of", "CCFLAGS", "that", "will", "build", "a", "debug", "or", "optimized", "variant", "depending", "on", "the", "value", "of", "|is_debug|", "." ]
def AppendOptCCFlags(env, is_debug=False): '''Append a set of CCFLAGS that will build a debug or optimized variant depending on the value of |is_debug|. Uses optional build-specific flags for debug and optimized builds. To set these in your build.scons files you can do something like this: nacl_env.Append...
[ "def", "AppendOptCCFlags", "(", "env", ",", "is_debug", "=", "False", ")", ":", "if", "is_debug", ":", "env", ".", "Append", "(", "CCFLAGS", "=", "[", "'${DEBUG_CCFLAGS}'", ",", "'-O0'", ",", "'-g'", ",", "]", ")", "else", ":", "env", ".", "Append", ...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/build_tools/nacl_sdk_scons/site_tools/nacl_tools.py#L41-L68
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pdb.py
python
Pdb.do_p
(self, arg)
p expression Print the value of the expression.
p expression Print the value of the expression.
[ "p", "expression", "Print", "the", "value", "of", "the", "expression", "." ]
def do_p(self, arg): """p expression Print the value of the expression. """ try: self.message(repr(self._getval(arg))) except: pass
[ "def", "do_p", "(", "self", ",", "arg", ")", ":", "try", ":", "self", ".", "message", "(", "repr", "(", "self", ".", "_getval", "(", "arg", ")", ")", ")", "except", ":", "pass" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pdb.py#L1174-L1181
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Misc.winfo_rgb
(self, color)
return self._getints( self.tk.call('winfo', 'rgb', self._w, color))
Return tuple of decimal values for red, green, blue for COLOR in this widget.
Return tuple of decimal values for red, green, blue for COLOR in this widget.
[ "Return", "tuple", "of", "decimal", "values", "for", "red", "green", "blue", "for", "COLOR", "in", "this", "widget", "." ]
def winfo_rgb(self, color): """Return tuple of decimal values for red, green, blue for COLOR in this widget.""" return self._getints( self.tk.call('winfo', 'rgb', self._w, color))
[ "def", "winfo_rgb", "(", "self", ",", "color", ")", ":", "return", "self", ".", "_getints", "(", "self", ".", "tk", ".", "call", "(", "'winfo'", ",", "'rgb'", ",", "self", ".", "_w", ",", "color", ")", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L833-L837
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py
python
Handler.__init__
(self, level=NOTSET)
Initializes the instance - basically setting the formatter to None and the filter list to empty.
Initializes the instance - basically setting the formatter to None and the filter list to empty.
[ "Initializes", "the", "instance", "-", "basically", "setting", "the", "formatter", "to", "None", "and", "the", "filter", "list", "to", "empty", "." ]
def __init__(self, level=NOTSET): """ Initializes the instance - basically setting the formatter to None and the filter list to empty. """ Filterer.__init__(self) self._name = None self.level = _checkLevel(level) self.formatter = None # Add the han...
[ "def", "__init__", "(", "self", ",", "level", "=", "NOTSET", ")", ":", "Filterer", ".", "__init__", "(", "self", ")", "self", ".", "_name", "=", "None", "self", ".", "level", "=", "_checkLevel", "(", "level", ")", "self", ".", "formatter", "=", "None...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py#L802-L813
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
orttraining/orttraining/python/training/optim/fused_adam.py
python
FusedAdam.step
(self, closure=None)
return loss
Performs a single optimization step. Arguments: closure (callable, optional): A closure that reevaluates the model and returns the loss. The remaining arguments are deprecated, and are only retained (for the moment) for error-checking purposes.
Performs a single optimization step.
[ "Performs", "a", "single", "optimization", "step", "." ]
def step(self, closure=None): """Performs a single optimization step. Arguments: closure (callable, optional): A closure that reevaluates the model and returns the loss. The remaining arguments are deprecated, and are only retained (for the moment) for error-checkin...
[ "def", "step", "(", "self", ",", "closure", "=", "None", ")", ":", "loss", "=", "None", "if", "closure", "is", "not", "None", ":", "loss", "=", "closure", "(", ")", "for", "group", "in", "self", ".", "param_groups", ":", "bias_correction", "=", "1", ...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/orttraining/orttraining/python/training/optim/fused_adam.py#L102-L190
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sarray.py
python
SArray.__materialize__
(self)
For a SArray that is lazily evaluated, force persist this sarray to disk, committing all lazy evaluated operations.
For a SArray that is lazily evaluated, force persist this sarray to disk, committing all lazy evaluated operations.
[ "For", "a", "SArray", "that", "is", "lazily", "evaluated", "force", "persist", "this", "sarray", "to", "disk", "committing", "all", "lazy", "evaluated", "operations", "." ]
def __materialize__(self): """ For a SArray that is lazily evaluated, force persist this sarray to disk, committing all lazy evaluated operations. """ with cython_context(): self.__proxy__.materialize()
[ "def", "__materialize__", "(", "self", ")", ":", "with", "cython_context", "(", ")", ":", "self", ".", "__proxy__", ".", "materialize", "(", ")" ]
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sarray.py#L1275-L1281
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
Grid.InsertRows
(*args, **kwargs)
return _grid.Grid_InsertRows(*args, **kwargs)
InsertRows(self, int pos=0, int numRows=1, bool updateLabels=True) -> bool
InsertRows(self, int pos=0, int numRows=1, bool updateLabels=True) -> bool
[ "InsertRows", "(", "self", "int", "pos", "=", "0", "int", "numRows", "=", "1", "bool", "updateLabels", "=", "True", ")", "-", ">", "bool" ]
def InsertRows(*args, **kwargs): """InsertRows(self, int pos=0, int numRows=1, bool updateLabels=True) -> bool""" return _grid.Grid_InsertRows(*args, **kwargs)
[ "def", "InsertRows", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_InsertRows", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L1267-L1269
su2code/SU2
72b2fa977b64b9683a388920f05298a40d39e5c5
SU2_PY/SU2_Nastran/pysu2_nastran.py
python
Solver.updateSolution
(self)
This method updates the solution.
This method updates the solution.
[ "This", "method", "updates", "the", "solution", "." ]
def updateSolution(self): """ This method updates the solution. """ self.q_n = np.copy(self.q) self.qdot_n = np.copy(self.qdot) self.qddot_n = np.copy(self.qddot) self.a_n = np.copy(self.a) self.__reset(self.q) self.__reset(self.qdot) self.__reset(self.qddot) self.__reset(se...
[ "def", "updateSolution", "(", "self", ")", ":", "self", ".", "q_n", "=", "np", ".", "copy", "(", "self", ".", "q", ")", "self", ".", "qdot_n", "=", "np", ".", "copy", "(", "self", ".", "qdot", ")", "self", ".", "qddot_n", "=", "np", ".", "copy"...
https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/SU2_Nastran/pysu2_nastran.py#L966-L981
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Tools/ruby.py
python
check_ruby_version
(self, minver=())
Checks if ruby is installed. If installed the variable RUBY will be set in environment. The ruby binary can be overridden by ``--with-ruby-binary`` command-line option.
Checks if ruby is installed. If installed the variable RUBY will be set in environment. The ruby binary can be overridden by ``--with-ruby-binary`` command-line option.
[ "Checks", "if", "ruby", "is", "installed", ".", "If", "installed", "the", "variable", "RUBY", "will", "be", "set", "in", "environment", ".", "The", "ruby", "binary", "can", "be", "overridden", "by", "--", "with", "-", "ruby", "-", "binary", "command", "-...
def check_ruby_version(self, minver=()): """ Checks if ruby is installed. If installed the variable RUBY will be set in environment. The ruby binary can be overridden by ``--with-ruby-binary`` command-line option. """ if Options.options.rubybinary: self.env.RUBY = Options.options.rubybinary else: self.find_...
[ "def", "check_ruby_version", "(", "self", ",", "minver", "=", "(", ")", ")", ":", "if", "Options", ".", "options", ".", "rubybinary", ":", "self", ".", "env", ".", "RUBY", "=", "Options", ".", "options", ".", "rubybinary", "else", ":", "self", ".", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/ruby.py#L52-L85
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-digital/python/digital/generic_mod_demod.py
python
generic_demod.add_options
(parser)
Adds generic demodulation options to the standard parser
Adds generic demodulation options to the standard parser
[ "Adds", "generic", "demodulation", "options", "to", "the", "standard", "parser" ]
def add_options(parser): """ Adds generic demodulation options to the standard parser """ # Add options shared with modulator. add_common_options(parser) # Add options specific to demodulator. parser.add_option("", "--freq-bw", type="float", default=_def_freq_bw, ...
[ "def", "add_options", "(", "parser", ")", ":", "# Add options shared with modulator.", "add_common_options", "(", "parser", ")", "# Add options specific to demodulator.", "parser", ".", "add_option", "(", "\"\"", ",", "\"--freq-bw\"", ",", "type", "=", "\"float\"", ",",...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/generic_mod_demod.py#L374-L386
balloonwj/TeamTalk
dc79c40687e4c9d7bec07ff5c9782be586fd9b41
win-client/3rdParty/src/json/amalgamate.py
python
amalgamate_source
( source_top_dir=None, target_source_path=None, header_include_path=None )
Produces amalgated source. Parameters: source_top_dir: top-directory target_source_path: output .cpp path header_include_path: generated header path relative to target_source_path.
Produces amalgated source. Parameters: source_top_dir: top-directory target_source_path: output .cpp path header_include_path: generated header path relative to target_source_path.
[ "Produces", "amalgated", "source", ".", "Parameters", ":", "source_top_dir", ":", "top", "-", "directory", "target_source_path", ":", "output", ".", "cpp", "path", "header_include_path", ":", "generated", "header", "path", "relative", "to", "target_source_path", "."...
def amalgamate_source( source_top_dir=None, target_source_path=None, header_include_path=None ): """Produces amalgated source. Parameters: source_top_dir: top-directory target_source_path: output .cpp path header_include_path: gen...
[ "def", "amalgamate_source", "(", "source_top_dir", "=", "None", ",", "target_source_path", "=", "None", ",", "header_include_path", "=", "None", ")", ":", "print", "'Amalgating header...'", "header", "=", "AmalgamationFile", "(", "source_top_dir", ")", "header", "."...
https://github.com/balloonwj/TeamTalk/blob/dc79c40687e4c9d7bec07ff5c9782be586fd9b41/win-client/3rdParty/src/json/amalgamate.py#L50-L122
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
samples/ide/activegrid/tool/process.py
python
IOBuffer._doReadline
(self, n)
return retval
Pop the front line (or n bytes of it, whichever is less) from the internal buffer and return it.
Pop the front line (or n bytes of it, whichever is less) from the internal buffer and return it.
[ "Pop", "the", "front", "line", "(", "or", "n", "bytes", "of", "it", "whichever", "is", "less", ")", "from", "the", "internal", "buffer", "and", "return", "it", "." ]
def _doReadline(self, n): """Pop the front line (or n bytes of it, whichever is less) from the internal buffer and return it. """ idx = self.__buf.find('\n') if idx == -1: idx = len(self.__buf) else: idx += 1 # include the '\n' if n is not ...
[ "def", "_doReadline", "(", "self", ",", "n", ")", ":", "idx", "=", "self", ".", "__buf", ".", "find", "(", "'\\n'", ")", "if", "idx", "==", "-", "1", ":", "idx", "=", "len", "(", "self", ".", "__buf", ")", "else", ":", "idx", "+=", "1", "# in...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/ide/activegrid/tool/process.py#L2020-L2032
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2_EncryptDecrypt2_REQUEST.initFromTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def initFromTpm(self, buf): """ TpmMarshaller method """ self.inData = buf.readSizedByteBuf() self.decrypt = buf.readByte() self.mode = buf.readShort() self.ivIn = buf.readSizedByteBuf()
[ "def", "initFromTpm", "(", "self", ",", "buf", ")", ":", "self", ".", "inData", "=", "buf", ".", "readSizedByteBuf", "(", ")", "self", ".", "decrypt", "=", "buf", ".", "readByte", "(", ")", "self", ".", "mode", "=", "buf", ".", "readShort", "(", ")...
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L11481-L11486
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/widgets/fitpropertybrowser/fitpropertybrowser.py
python
FitPropertyBrowser._get_allowed_spectra
(self)
return allowed_spectra
Get the workspaces and spectra that can be fitted from the tracked workspaces.
Get the workspaces and spectra that can be fitted from the tracked workspaces.
[ "Get", "the", "workspaces", "and", "spectra", "that", "can", "be", "fitted", "from", "the", "tracked", "workspaces", "." ]
def _get_allowed_spectra(self): """ Get the workspaces and spectra that can be fitted from the tracked workspaces. """ allowed_spectra = {} output_wsnames = [self.getWorkspaceList().item(ii).text() for ii in range(self.getWorkspaceList().count())] for ax in self.c...
[ "def", "_get_allowed_spectra", "(", "self", ")", ":", "allowed_spectra", "=", "{", "}", "output_wsnames", "=", "[", "self", ".", "getWorkspaceList", "(", ")", ".", "item", "(", "ii", ")", ".", "text", "(", ")", "for", "ii", "in", "range", "(", "self", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/fitpropertybrowser/fitpropertybrowser.py#L107-L130
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/dtypes/common.py
python
is_categorical
(arr)
return isinstance(arr, ABCCategorical) or is_categorical_dtype(arr)
Check whether an array-like is a Categorical instance. Parameters ---------- arr : array-like The array-like to check. Returns ------- boolean Whether or not the array-like is of a Categorical instance. Examples -------- >>> is_categorical([1, 2, 3]) False ...
Check whether an array-like is a Categorical instance.
[ "Check", "whether", "an", "array", "-", "like", "is", "a", "Categorical", "instance", "." ]
def is_categorical(arr) -> bool: """ Check whether an array-like is a Categorical instance. Parameters ---------- arr : array-like The array-like to check. Returns ------- boolean Whether or not the array-like is of a Categorical instance. Examples -------- ...
[ "def", "is_categorical", "(", "arr", ")", "->", "bool", ":", "return", "isinstance", "(", "arr", ",", "ABCCategorical", ")", "or", "is_categorical_dtype", "(", "arr", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/dtypes/common.py#L339-L369
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/pyct/cfg.py
python
GraphBuilder.exit_cond_section
(self, section_id)
Exits a conditional section.
Exits a conditional section.
[ "Exits", "a", "conditional", "section", "." ]
def exit_cond_section(self, section_id): """Exits a conditional section.""" for split in self.cond_leaves[section_id]: self.leaves |= split del self.cond_entry[section_id] del self.cond_leaves[section_id]
[ "def", "exit_cond_section", "(", "self", ",", "section_id", ")", ":", "for", "split", "in", "self", ".", "cond_leaves", "[", "section_id", "]", ":", "self", ".", "leaves", "|=", "split", "del", "self", ".", "cond_entry", "[", "section_id", "]", "del", "s...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/pyct/cfg.py#L538-L543
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/graph_actions.py
python
train
(graph, output_dir, train_op, loss_op, global_step_tensor=None, init_op=None, init_feed_dict=None, init_fn=None, log_every_steps=10, supervisor_is_chief=True, supervisor_master='', supervisor_save_model_secs=60...
Train a model. Given `graph`, a directory to write outputs to (`output_dir`), and some ops, run a training loop. The given `train_op` performs one step of training on the model. The `loss_op` represents the objective function of the training. It is expected to increment the `global_step_tensor`, a scalar integ...
Train a model.
[ "Train", "a", "model", "." ]
def train(graph, output_dir, train_op, loss_op, global_step_tensor=None, init_op=None, init_feed_dict=None, init_fn=None, log_every_steps=10, supervisor_is_chief=True, supervisor_master='', supervisor_save_mode...
[ "def", "train", "(", "graph", ",", "output_dir", ",", "train_op", ",", "loss_op", ",", "global_step_tensor", "=", "None", ",", "init_op", "=", "None", ",", "init_feed_dict", "=", "None", ",", "init_fn", "=", "None", ",", "log_every_steps", "=", "10", ",", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/graph_actions.py#L286-L392
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/utils_impl.py
python
get_variables_path
(export_dir)
return os.path.join( compat.as_text(get_variables_dir(export_dir)), compat.as_text(constants.VARIABLES_FILENAME))
Return the variables path, used as the prefix for checkpoint files.
Return the variables path, used as the prefix for checkpoint files.
[ "Return", "the", "variables", "path", "used", "as", "the", "prefix", "for", "checkpoint", "files", "." ]
def get_variables_path(export_dir): """Return the variables path, used as the prefix for checkpoint files.""" return os.path.join( compat.as_text(get_variables_dir(export_dir)), compat.as_text(constants.VARIABLES_FILENAME))
[ "def", "get_variables_path", "(", "export_dir", ")", ":", "return", "os", ".", "path", ".", "join", "(", "compat", ".", "as_text", "(", "get_variables_dir", "(", "export_dir", ")", ")", ",", "compat", ".", "as_text", "(", "constants", ".", "VARIABLES_FILENAM...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/utils_impl.py#L225-L229
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/mask_ops.py
python
kleene_or
( left: Union[bool, np.ndarray], right: Union[bool, np.ndarray], left_mask: Optional[np.ndarray], right_mask: Optional[np.ndarray], )
return result, mask
Boolean ``or`` using Kleene logic. Values are NA where we have ``NA | NA`` or ``NA | False``. ``NA | True`` is considered True. Parameters ---------- left, right : ndarray, NA, or bool The values of the array. left_mask, right_mask : ndarray, optional The masks. Only one of the...
Boolean ``or`` using Kleene logic.
[ "Boolean", "or", "using", "Kleene", "logic", "." ]
def kleene_or( left: Union[bool, np.ndarray], right: Union[bool, np.ndarray], left_mask: Optional[np.ndarray], right_mask: Optional[np.ndarray], ): """ Boolean ``or`` using Kleene logic. Values are NA where we have ``NA | NA`` or ``NA | False``. ``NA | True`` is considered True. Pa...
[ "def", "kleene_or", "(", "left", ":", "Union", "[", "bool", ",", "np", ".", "ndarray", "]", ",", "right", ":", "Union", "[", "bool", ",", "np", ".", "ndarray", "]", ",", "left_mask", ":", "Optional", "[", "np", ".", "ndarray", "]", ",", "right_mask...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/mask_ops.py#L11-L69
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/driver_cbs.py
python
_expand_scheme_orders
(scheme, basisname, basiszeta, wfnname, options, natom)
return NEED
Check that the length of *basiszeta* array matches the implied degree of extrapolation in *scheme* name. Return a dictionary of same length as basiszeta, with *basisname* and *basiszeta* distributed therein.
Check that the length of *basiszeta* array matches the implied degree of extrapolation in *scheme* name. Return a dictionary of same length as basiszeta, with *basisname* and *basiszeta* distributed therein.
[ "Check", "that", "the", "length", "of", "*", "basiszeta", "*", "array", "matches", "the", "implied", "degree", "of", "extrapolation", "in", "*", "scheme", "*", "name", ".", "Return", "a", "dictionary", "of", "same", "length", "as", "basiszeta", "with", "*"...
def _expand_scheme_orders(scheme, basisname, basiszeta, wfnname, options, natom): """Check that the length of *basiszeta* array matches the implied degree of extrapolation in *scheme* name. Return a dictionary of same length as basiszeta, with *basisname* and *basiszeta* distributed therein. """ Nx...
[ "def", "_expand_scheme_orders", "(", "scheme", ",", "basisname", ",", "basiszeta", ",", "wfnname", ",", "options", ",", "natom", ")", ":", "Nxtpl", "=", "len", "(", "basiszeta", ")", "if", "int", "(", "scheme", ".", "__name__", ".", "split", "(", "'_'", ...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/driver_cbs.py#L1792-L1812
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
SettableHeaderColumn.SetSortable
(*args, **kwargs)
return _core_.SettableHeaderColumn_SetSortable(*args, **kwargs)
SetSortable(self, bool sortable)
SetSortable(self, bool sortable)
[ "SetSortable", "(", "self", "bool", "sortable", ")" ]
def SetSortable(*args, **kwargs): """SetSortable(self, bool sortable)""" return _core_.SettableHeaderColumn_SetSortable(*args, **kwargs)
[ "def", "SetSortable", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SettableHeaderColumn_SetSortable", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L16504-L16506
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PyLongStringDialogAdapter.__init__
(self, *args, **kwargs)
__init__(self) -> PyLongStringDialogAdapter
__init__(self) -> PyLongStringDialogAdapter
[ "__init__", "(", "self", ")", "-", ">", "PyLongStringDialogAdapter" ]
def __init__(self, *args, **kwargs): """__init__(self) -> PyLongStringDialogAdapter""" _propgrid.PyLongStringDialogAdapter_swiginit(self,_propgrid.new_PyLongStringDialogAdapter(*args, **kwargs)) self._SetSelf(self); self._RegisterMethods()
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_propgrid", ".", "PyLongStringDialogAdapter_swiginit", "(", "self", ",", "_propgrid", ".", "new_PyLongStringDialogAdapter", "(", "*", "args", ",", "*", "*", "kwargs", ")", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L4059-L4062
KhronosGroup/SPIRV-LLVM
1eb85593f3fe2c39379b9a9b088d51eda4f42b8b
examples/Kaleidoscope/MCJIT/cached/genk-timing.py
python
generateKScript
(filename, numFuncs, elementsPerFunc, funcsBetweenExec, callWeighting, timingScript)
Generate a random Kaleidoscope script based on the given parameters
Generate a random Kaleidoscope script based on the given parameters
[ "Generate", "a", "random", "Kaleidoscope", "script", "based", "on", "the", "given", "parameters" ]
def generateKScript(filename, numFuncs, elementsPerFunc, funcsBetweenExec, callWeighting, timingScript): """ Generate a random Kaleidoscope script based on the given parameters """ print "Generating " + filename print(" %d functions, %d elements per function, %d functions between execution" % (nu...
[ "def", "generateKScript", "(", "filename", ",", "numFuncs", ",", "elementsPerFunc", ",", "funcsBetweenExec", ",", "callWeighting", ",", "timingScript", ")", ":", "print", "\"Generating \"", "+", "filename", "print", "(", "\" %d functions, %d elements per function, %d fun...
https://github.com/KhronosGroup/SPIRV-LLVM/blob/1eb85593f3fe2c39379b9a9b088d51eda4f42b8b/examples/Kaleidoscope/MCJIT/cached/genk-timing.py#L174-L204
wyrover/book-code
7f4883d9030d553bc6bcfa3da685e34789839900
3rdparty/protobuf/python/setup.py
python
generate_proto
(source, require = True)
Invokes the Protocol Compiler to generate a _pb2.py from the given .proto file. Does nothing if the output already exists and is newer than the input.
Invokes the Protocol Compiler to generate a _pb2.py from the given .proto file. Does nothing if the output already exists and is newer than the input.
[ "Invokes", "the", "Protocol", "Compiler", "to", "generate", "a", "_pb2", ".", "py", "from", "the", "given", ".", "proto", "file", ".", "Does", "nothing", "if", "the", "output", "already", "exists", "and", "is", "newer", "than", "the", "input", "." ]
def generate_proto(source, require = True): """Invokes the Protocol Compiler to generate a _pb2.py from the given .proto file. Does nothing if the output already exists and is newer than the input.""" if not require and not os.path.exists(source): return output = source.replace(".proto", "_pb2.py").rep...
[ "def", "generate_proto", "(", "source", ",", "require", "=", "True", ")", ":", "if", "not", "require", "and", "not", "os", ".", "path", ".", "exists", "(", "source", ")", ":", "return", "output", "=", "source", ".", "replace", "(", "\".proto\"", ",", ...
https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/setup.py#L49-L76
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/_feature_engineering/_word_trimmer.py
python
RareWordTrimmer.__repr__
(self)
return out + "\n" + out2
Return a string description of the model, including a description of the training data, training statistics, and model hyper-parameters. Returns ------- out : string A description of the model.
Return a string description of the model, including a description of the training data, training statistics, and model hyper-parameters.
[ "Return", "a", "string", "description", "of", "the", "model", "including", "a", "description", "of", "the", "training", "data", "training", "statistics", "and", "model", "hyper", "-", "parameters", "." ]
def __repr__(self): """ Return a string description of the model, including a description of the training data, training statistics, and model hyper-parameters. Returns ------- out : string A description of the model. """ accessible_fields = {...
[ "def", "__repr__", "(", "self", ")", ":", "accessible_fields", "=", "{", "\"vocabulary\"", ":", "\"The vocabulary of the trimmed input.\"", "}", "(", "sections", ",", "section_titles", ")", "=", "self", ".", "_get_summary_struct", "(", ")", "out", "=", "_toolkit_r...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/_feature_engineering/_word_trimmer.py#L392-L406
facebook/openr
ed38bdfd6bf290084bfab4821b59f83e7b59315d
openr/py/openr/cli/utils/commands.py
python
OpenrCtrlCmd._run
(self, client: Any, *args, **kwargs)
To be implemented by sub-command. @param: client - Client to connect to the Open/R server. Set it to `Any` type here for the overridden method to choose the type in its parameter. Currently, we have two types of the clients: 1. Op...
To be implemented by sub-command.
[ "To", "be", "implemented", "by", "sub", "-", "command", "." ]
def _run(self, client: Any, *args, **kwargs) -> Any: """ To be implemented by sub-command. @param: client - Client to connect to the Open/R server. Set it to `Any` type here for the overridden method to choose the type in its parameter. Currently...
[ "def", "_run", "(", "self", ",", "client", ":", "Any", ",", "*", "args", ",", "*", "*", "kwargs", ")", "->", "Any", ":", "raise", "NotImplementedError" ]
https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/openr/py/openr/cli/utils/commands.py#L48-L58
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usdImaging/usdAppUtils/rendererArgs.py
python
GetPluginIdFromArgument
(argumentString)
return None
Returns plugin id, if found, for the passed in argument string. Valid argument strings are returned by GetAllPluginArguments().
Returns plugin id, if found, for the passed in argument string.
[ "Returns", "plugin", "id", "if", "found", "for", "the", "passed", "in", "argument", "string", "." ]
def GetPluginIdFromArgument(argumentString): """ Returns plugin id, if found, for the passed in argument string. Valid argument strings are returned by GetAllPluginArguments(). """ from pxr import UsdImagingGL for p in UsdImagingGL.Engine.GetRendererPlugins(): if argumentString == UsdI...
[ "def", "GetPluginIdFromArgument", "(", "argumentString", ")", ":", "from", "pxr", "import", "UsdImagingGL", "for", "p", "in", "UsdImagingGL", ".", "Engine", ".", "GetRendererPlugins", "(", ")", ":", "if", "argumentString", "==", "UsdImagingGL", ".", "Engine", "....
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdAppUtils/rendererArgs.py#L37-L48