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
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/minimum-number-of-days-to-disconnect-island.py
python
Solution.minDays
(self, grid)
return 2
:type grid: List[List[int]] :rtype: int
:type grid: List[List[int]] :rtype: int
[ ":", "type", "grid", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "int" ]
def minDays(self, grid): """ :type grid: List[List[int]] :rtype: int """ directions = [(0, 1), (1, 0), (0, -1), (-1, 0)] def floodfill(grid, i, j, lookup): stk = [(i, j)] lookup[i][j] = 1 while stk: i, j = stk.pop()...
[ "def", "minDays", "(", "self", ",", "grid", ")", ":", "directions", "=", "[", "(", "0", ",", "1", ")", ",", "(", "1", ",", "0", ")", ",", "(", "0", ",", "-", "1", ")", ",", "(", "-", "1", ",", "0", ")", "]", "def", "floodfill", "(", "gr...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimum-number-of-days-to-disconnect-island.py#L5-L50
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
CommandLinkButton.SetMainLabelAndNote
(*args, **kwargs)
return _controls_.CommandLinkButton_SetMainLabelAndNote(*args, **kwargs)
SetMainLabelAndNote(self, String mainLabel, String note)
SetMainLabelAndNote(self, String mainLabel, String note)
[ "SetMainLabelAndNote", "(", "self", "String", "mainLabel", "String", "note", ")" ]
def SetMainLabelAndNote(*args, **kwargs): """SetMainLabelAndNote(self, String mainLabel, String note)""" return _controls_.CommandLinkButton_SetMainLabelAndNote(*args, **kwargs)
[ "def", "SetMainLabelAndNote", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "CommandLinkButton_SetMainLabelAndNote", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L7884-L7886
godlikepanos/anki-3d-engine
e2f65e5045624492571ea8527a4dbf3fad8d2c0a
Tools/Image/CreateAtlas.py
python
create_atlas
(ctx)
Create and populate the atlas
Create and populate the atlas
[ "Create", "and", "populate", "the", "atlas" ]
def create_atlas(ctx): """ Create and populate the atlas """ # Change the color to something PIL can understand bg_color = (ctx.bg_color >> 24) bg_color |= (ctx.bg_color >> 8) & 0xFF00 bg_color |= (ctx.bg_color << 8) & 0xFF0000 bg_color |= (ctx.bg_color << 24) & 0xFF000000 mode = "RGB" ...
[ "def", "create_atlas", "(", "ctx", ")", ":", "# Change the color to something PIL can understand", "bg_color", "=", "(", "ctx", ".", "bg_color", ">>", "24", ")", "bg_color", "|=", "(", "ctx", ".", "bg_color", ">>", "8", ")", "&", "0xFF00", "bg_color", "|=", ...
https://github.com/godlikepanos/anki-3d-engine/blob/e2f65e5045624492571ea8527a4dbf3fad8d2c0a/Tools/Image/CreateAtlas.py#L249-L277
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/ssl.py
python
SSLSocket.read
(self, len=1024, buffer=None)
Read up to LEN bytes and return them. Return zero-length string on EOF.
Read up to LEN bytes and return them. Return zero-length string on EOF.
[ "Read", "up", "to", "LEN", "bytes", "and", "return", "them", ".", "Return", "zero", "-", "length", "string", "on", "EOF", "." ]
def read(self, len=1024, buffer=None): """Read up to LEN bytes and return them. Return zero-length string on EOF.""" self._checkClosed() if not self._sslobj: raise ValueError("Read on closed or unwrapped SSL socket.") try: if buffer is not None: ...
[ "def", "read", "(", "self", ",", "len", "=", "1024", ",", "buffer", "=", "None", ")", ":", "self", ".", "_checkClosed", "(", ")", "if", "not", "self", ".", "_sslobj", ":", "raise", "ValueError", "(", "\"Read on closed or unwrapped SSL socket.\"", ")", "try...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/ssl.py#L647-L667
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillTableWidget.py
python
DrillTableWidget.getRowsFromSelectedCells
(self)
return [r for r in allRows if r in selectedRows]
Get the row indexes of the selected cells. Return: list(int): list of unique rows indexes
Get the row indexes of the selected cells.
[ "Get", "the", "row", "indexes", "of", "the", "selected", "cells", "." ]
def getRowsFromSelectedCells(self): """ Get the row indexes of the selected cells. Return: list(int): list of unique rows indexes """ selectedIndexes = self.selectionModel().selectedIndexes() selectedRows = [i.row() for i in selectedIndexes] allRows =...
[ "def", "getRowsFromSelectedCells", "(", "self", ")", ":", "selectedIndexes", "=", "self", ".", "selectionModel", "(", ")", ".", "selectedIndexes", "(", ")", "selectedRows", "=", "[", "i", ".", "row", "(", ")", "for", "i", "in", "selectedIndexes", "]", "all...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillTableWidget.py#L297-L307
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/client/timeline.py
python
_TensorTracker.name
(self)
return self._name
Name of this tensor.
Name of this tensor.
[ "Name", "of", "this", "tensor", "." ]
def name(self): """Name of this tensor.""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/client/timeline.py#L296-L298
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
projects/default/controllers/sumo_supervisor/SumoSupervisor.py
python
SumoSupervisor.update_traffic_light_state
(self, id, states)
Update the traffic lights state in Webots.
Update the traffic lights state in Webots.
[ "Update", "the", "traffic", "lights", "state", "in", "Webots", "." ]
def update_traffic_light_state(self, id, states): """Update the traffic lights state in Webots.""" # update light LED state if traffic light state has changed currentState = states[self.traci.constants.TL_RED_YELLOW_GREEN_STATE] if self.trafficLights[id].previousState != currentState: ...
[ "def", "update_traffic_light_state", "(", "self", ",", "id", ",", "states", ")", ":", "# update light LED state if traffic light state has changed", "currentState", "=", "states", "[", "self", ".", "traci", ".", "constants", ".", "TL_RED_YELLOW_GREEN_STATE", "]", "if", ...
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/projects/default/controllers/sumo_supervisor/SumoSupervisor.py#L389-L422
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/inspector_protocol/jinja2/filters.py
python
do_filesizeformat
(value, binary=False)
Format the value like a 'human-readable' file size (i.e. 13 kB, 4.1 MB, 102 Bytes, etc). Per default decimal prefixes are used (Mega, Giga, etc.), if the second parameter is set to `True` the binary prefixes are used (Mebi, Gibi).
Format the value like a 'human-readable' file size (i.e. 13 kB, 4.1 MB, 102 Bytes, etc). Per default decimal prefixes are used (Mega, Giga, etc.), if the second parameter is set to `True` the binary prefixes are used (Mebi, Gibi).
[ "Format", "the", "value", "like", "a", "human", "-", "readable", "file", "size", "(", "i", ".", "e", ".", "13", "kB", "4", ".", "1", "MB", "102", "Bytes", "etc", ")", ".", "Per", "default", "decimal", "prefixes", "are", "used", "(", "Mega", "Giga",...
def do_filesizeformat(value, binary=False): """Format the value like a 'human-readable' file size (i.e. 13 kB, 4.1 MB, 102 Bytes, etc). Per default decimal prefixes are used (Mega, Giga, etc.), if the second parameter is set to `True` the binary prefixes are used (Mebi, Gibi). """ bytes = float...
[ "def", "do_filesizeformat", "(", "value", ",", "binary", "=", "False", ")", ":", "bytes", "=", "float", "(", "value", ")", "base", "=", "binary", "and", "1024", "or", "1000", "prefixes", "=", "[", "(", "binary", "and", "'KiB'", "or", "'kB'", ")", ","...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/filters.py#L459-L486
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/pytree.py
python
Node.pre_order
(self)
Return a pre-order iterator for the tree.
Return a pre-order iterator for the tree.
[ "Return", "a", "pre", "-", "order", "iterator", "for", "the", "tree", "." ]
def pre_order(self): """Return a pre-order iterator for the tree.""" yield self for child in self.children: for node in child.pre_order(): yield node
[ "def", "pre_order", "(", "self", ")", ":", "yield", "self", "for", "child", "in", "self", ".", "children", ":", "for", "node", "in", "child", ".", "pre_order", "(", ")", ":", "yield", "node" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/pytree.py#L301-L306
rdiankov/openrave
d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7
python/examples/cubeassembly.py
python
main
(env,options)
Main example code.
Main example code.
[ "Main", "example", "code", "." ]
def main(env,options): "Main example code." env.Load(options.scene) robot = env.GetRobots()[0] if len(options.manipname) > 0: robot.SetActiveManipulator(options.manipname) time.sleep(0.1) # give time for environment to update self = CubeAssembly(robot) self.CreateBlocks() while T...
[ "def", "main", "(", "env", ",", "options", ")", ":", "env", ".", "Load", "(", "options", ".", "scene", ")", "robot", "=", "env", ".", "GetRobots", "(", ")", "[", "0", "]", "if", "len", "(", "options", ".", "manipname", ")", ">", "0", ":", "robo...
https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/examples/cubeassembly.py#L181-L195
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
wrap/gtwrap/matlab_wrapper/wrapper.py
python
MatlabWrapper.generate_collector_function
(self, func_id)
return collector_function
Generate the complete collector function.
Generate the complete collector function.
[ "Generate", "the", "complete", "collector", "function", "." ]
def generate_collector_function(self, func_id): """ Generate the complete collector function. """ collector_func = self.wrapper_map.get(func_id) if collector_func is None: return '' method_name = collector_func[3] collector_function = "void {}" \ ...
[ "def", "generate_collector_function", "(", "self", ",", "func_id", ")", ":", "collector_func", "=", "self", ".", "wrapper_map", ".", "get", "(", "func_id", ")", "if", "collector_func", "is", "None", ":", "return", "''", "method_name", "=", "collector_func", "[...
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/wrap/gtwrap/matlab_wrapper/wrapper.py#L1208-L1356
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBAddress.SetLoadAddress
(self, load_addr, target)
return _lldb.SBAddress_SetLoadAddress(self, load_addr, target)
SetLoadAddress(SBAddress self, lldb::addr_t load_addr, SBTarget target)
SetLoadAddress(SBAddress self, lldb::addr_t load_addr, SBTarget target)
[ "SetLoadAddress", "(", "SBAddress", "self", "lldb", "::", "addr_t", "load_addr", "SBTarget", "target", ")" ]
def SetLoadAddress(self, load_addr, target): """SetLoadAddress(SBAddress self, lldb::addr_t load_addr, SBTarget target)""" return _lldb.SBAddress_SetLoadAddress(self, load_addr, target)
[ "def", "SetLoadAddress", "(", "self", ",", "load_addr", ",", "target", ")", ":", "return", "_lldb", ".", "SBAddress_SetLoadAddress", "(", "self", ",", "load_addr", ",", "target", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L909-L911
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
RealPoint.__ne__
(*args, **kwargs)
return _core_.RealPoint___ne__(*args, **kwargs)
__ne__(self, PyObject other) -> bool Test for inequality of wx.RealPoint objects.
__ne__(self, PyObject other) -> bool
[ "__ne__", "(", "self", "PyObject", "other", ")", "-", ">", "bool" ]
def __ne__(*args, **kwargs): """ __ne__(self, PyObject other) -> bool Test for inequality of wx.RealPoint objects. """ return _core_.RealPoint___ne__(*args, **kwargs)
[ "def", "__ne__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "RealPoint___ne__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L1103-L1109
manutdzou/KITTI_SSD
5b620c2f291d36a0fe14489214f22a992f173f44
scripts/cpp_lint.py
python
GetHeaderGuardCPPVariable
(filename)
return re.sub(r'[-./\s]', '_', file_path_from_root).upper() + '_'
Returns the CPP variable that should be used as a header guard. Args: filename: The name of a C++ header file. Returns: The CPP variable that should be used as a header guard in the named file.
Returns the CPP variable that should be used as a header guard.
[ "Returns", "the", "CPP", "variable", "that", "should", "be", "used", "as", "a", "header", "guard", "." ]
def GetHeaderGuardCPPVariable(filename): """Returns the CPP variable that should be used as a header guard. Args: filename: The name of a C++ header file. Returns: The CPP variable that should be used as a header guard in the named file. """ # Restores original filename in case that cpplint is...
[ "def", "GetHeaderGuardCPPVariable", "(", "filename", ")", ":", "# Restores original filename in case that cpplint is invoked from Emacs's", "# flymake.", "filename", "=", "re", ".", "sub", "(", "r'_flymake\\.h$'", ",", "'.h'", ",", "filename", ")", "filename", "=", "re", ...
https://github.com/manutdzou/KITTI_SSD/blob/5b620c2f291d36a0fe14489214f22a992f173f44/scripts/cpp_lint.py#L1384-L1405
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/YouCompleteMe/third_party/bottle/bottle.py
python
ResourceManager.open
(self, name, mode='r', *args, **kwargs)
return self.opener(fname, mode=mode, *args, **kwargs)
Find a resource and return a file object, or raise IOError.
Find a resource and return a file object, or raise IOError.
[ "Find", "a", "resource", "and", "return", "a", "file", "object", "or", "raise", "IOError", "." ]
def open(self, name, mode='r', *args, **kwargs): ''' Find a resource and return a file object, or raise IOError. ''' fname = self.lookup(name) if not fname: raise IOError("Resource %r not found." % name) return self.opener(fname, mode=mode, *args, **kwargs)
[ "def", "open", "(", "self", ",", "name", ",", "mode", "=", "'r'", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "fname", "=", "self", ".", "lookup", "(", "name", ")", "if", "not", "fname", ":", "raise", "IOError", "(", "\"Resource %r not fou...
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/bottle/bottle.py#L2234-L2238
NeoGeographyToolkit/StereoPipeline
eedf54a919fb5cce1ab0e280bb0df4050763aa11
src/asp/IceBridge/icebridge_common.py
python
validFilesPrefix
()
return 'valid_files'
This one is used in multiple places.
This one is used in multiple places.
[ "This", "one", "is", "used", "in", "multiple", "places", "." ]
def validFilesPrefix(): '''This one is used in multiple places.''' return 'valid_files'
[ "def", "validFilesPrefix", "(", ")", ":", "return", "'valid_files'" ]
https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/icebridge_common.py#L290-L292
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/ma/core.py
python
_extrema_operation.outer
(self, a, b)
return result
Return the function applied to the outer product of a and b.
Return the function applied to the outer product of a and b.
[ "Return", "the", "function", "applied", "to", "the", "outer", "product", "of", "a", "and", "b", "." ]
def outer(self, a, b): "Return the function applied to the outer product of a and b." ma = getmask(a) mb = getmask(b) if ma is nomask and mb is nomask: m = nomask else: ma = getmaskarray(a) mb = getmaskarray(b) m = logical_or.outer(...
[ "def", "outer", "(", "self", ",", "a", ",", "b", ")", ":", "ma", "=", "getmask", "(", "a", ")", "mb", "=", "getmask", "(", "b", ")", "if", "ma", "is", "nomask", "and", "mb", "is", "nomask", ":", "m", "=", "nomask", "else", ":", "ma", "=", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L6498-L6512
irods/irods
ed6328646cee87182098d569919004049bf4ce21
scripts/irods/pyparsing.py
python
ParserElement.__radd__
(self, other )
return other + self
Implementation of + operator when left operand is not a C{L{ParserElement}}
Implementation of + operator when left operand is not a C{L{ParserElement}}
[ "Implementation", "of", "+", "operator", "when", "left", "operand", "is", "not", "a", "C", "{", "L", "{", "ParserElement", "}}" ]
def __radd__(self, other ): """Implementation of + operator when left operand is not a C{L{ParserElement}}""" if isinstance( other, basestring ): other = ParserElement.literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine ele...
[ "def", "__radd__", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "basestring", ")", ":", "other", "=", "ParserElement", ".", "literalStringClass", "(", "other", ")", "if", "not", "isinstance", "(", "other", ",", "ParserElement...
https://github.com/irods/irods/blob/ed6328646cee87182098d569919004049bf4ce21/scripts/irods/pyparsing.py#L1273-L1281
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/lib2to3/pytree.py
python
Node._eq
(self, other)
return (self.type, self.children) == (other.type, other.children)
Compare two nodes for equality.
Compare two nodes for equality.
[ "Compare", "two", "nodes", "for", "equality", "." ]
def _eq(self, other): """Compare two nodes for equality.""" return (self.type, self.children) == (other.type, other.children)
[ "def", "_eq", "(", "self", ",", "other", ")", ":", "return", "(", "self", ".", "type", ",", "self", ".", "children", ")", "==", "(", "other", ".", "type", ",", "other", ".", "children", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/lib2to3/pytree.py#L253-L255
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/device.py
python
DeviceSpec.merge_from
(self, dev)
Merge the properties of "dev" into this `DeviceSpec`. Args: dev: a `DeviceSpec`.
Merge the properties of "dev" into this `DeviceSpec`.
[ "Merge", "the", "properties", "of", "dev", "into", "this", "DeviceSpec", "." ]
def merge_from(self, dev): """Merge the properties of "dev" into this `DeviceSpec`. Args: dev: a `DeviceSpec`. """ if dev.job is not None: self.job = dev.job if dev.replica is not None: self.replica = dev.replica if dev.task is not None: self.task = dev.task if dev.d...
[ "def", "merge_from", "(", "self", ",", "dev", ")", ":", "if", "dev", ".", "job", "is", "not", "None", ":", "self", ".", "job", "=", "dev", ".", "job", "if", "dev", ".", "replica", "is", "not", "None", ":", "self", ".", "replica", "=", "dev", "....
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/device.py#L175-L190
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/pydoc.py
python
synopsis
(filename, cache={})
return result
Get the one-line summary out of a module file.
Get the one-line summary out of a module file.
[ "Get", "the", "one", "-", "line", "summary", "out", "of", "a", "module", "file", "." ]
def synopsis(filename, cache={}): """Get the one-line summary out of a module file.""" mtime = os.stat(filename).st_mtime lastupdate, result = cache.get(filename, (None, None)) if lastupdate is None or lastupdate < mtime: # Look for binary suffixes first, falling back to source. if filen...
[ "def", "synopsis", "(", "filename", ",", "cache", "=", "{", "}", ")", ":", "mtime", "=", "os", ".", "stat", "(", "filename", ")", ".", "st_mtime", "lastupdate", ",", "result", "=", "cache", ".", "get", "(", "filename", ",", "(", "None", ",", "None"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pydoc.py#L255-L292
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/supertooltip.py
python
SuperToolTip.SetFooterFont
(self, font)
Sets the font for the footer text. :param `font`: the font to use for the footer text, a valid :class:`Font` object.
Sets the font for the footer text.
[ "Sets", "the", "font", "for", "the", "footer", "text", "." ]
def SetFooterFont(self, font): """ Sets the font for the footer text. :param `font`: the font to use for the footer text, a valid :class:`Font` object. """ self._footerFont = font if self._superToolTip: self._superToolTip.Invalidate()
[ "def", "SetFooterFont", "(", "self", ",", "font", ")", ":", "self", ".", "_footerFont", "=", "font", "if", "self", ".", "_superToolTip", ":", "self", ".", "_superToolTip", ".", "Invalidate", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/supertooltip.py#L1298-L1308
facebook/redex
fac189a289bca2647061f9e364016afc1096500d
pyredex/logger.py
python
update_trace_file
(env: typing.Dict[str, str])
If TRACEFILE is specified, update it to point to the file descriptor instead of the filename. (redex-all will treat integer TRACEFILE values as file descriptors.) This allows the redex-all subprocess to append to the file instead of calling open() on it again, which would overwrite its contents. No...
If TRACEFILE is specified, update it to point to the file descriptor instead of the filename. (redex-all will treat integer TRACEFILE values as file descriptors.) This allows the redex-all subprocess to append to the file instead of calling open() on it again, which would overwrite its contents.
[ "If", "TRACEFILE", "is", "specified", "update", "it", "to", "point", "to", "the", "file", "descriptor", "instead", "of", "the", "filename", ".", "(", "redex", "-", "all", "will", "treat", "integer", "TRACEFILE", "values", "as", "file", "descriptors", ".", ...
def update_trace_file(env: typing.Dict[str, str]) -> None: """ If TRACEFILE is specified, update it to point to the file descriptor instead of the filename. (redex-all will treat integer TRACEFILE values as file descriptors.) This allows the redex-all subprocess to append to the file instead of call...
[ "def", "update_trace_file", "(", "env", ":", "typing", ".", "Dict", "[", "str", ",", "str", "]", ")", "->", "None", ":", "trace_fp", "=", "get_trace_file", "(", ")", "if", "trace_fp", "is", "not", "sys", ".", "stderr", ":", "env", "[", "\"TRACEFILE\"",...
https://github.com/facebook/redex/blob/fac189a289bca2647061f9e364016afc1096500d/pyredex/logger.py#L92-L106
ZhouWeikuan/DouDiZhu
0d84ff6c0bc54dba6ae37955de9ae9307513dc99
code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py
python
CursorKind.name
(self)
return self._name_map[self]
Get the enumeration name of this cursor kind.
Get the enumeration name of this cursor kind.
[ "Get", "the", "enumeration", "name", "of", "this", "cursor", "kind", "." ]
def name(self): """Get the enumeration name of this cursor kind.""" if self._name_map is None: self._name_map = {} for key,value in CursorKind.__dict__.items(): if isinstance(value,CursorKind): self._name_map[value] = key return self._n...
[ "def", "name", "(", "self", ")", ":", "if", "self", ".", "_name_map", "is", "None", ":", "self", ".", "_name_map", "=", "{", "}", "for", "key", ",", "value", "in", "CursorKind", ".", "__dict__", ".", "items", "(", ")", ":", "if", "isinstance", "(",...
https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L612-L619
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/webapp2/webapp2.py
python
SimpleRoute.match
(self, request)
Matches this route against the current request. .. seealso:: :meth:`BaseRoute.match`.
Matches this route against the current request.
[ "Matches", "this", "route", "against", "the", "current", "request", "." ]
def match(self, request): """Matches this route against the current request. .. seealso:: :meth:`BaseRoute.match`. """ match = self.regex.match(urllib.unquote(request.path)) if match: return self, match.groups(), {}
[ "def", "match", "(", "self", ",", "request", ")", ":", "match", "=", "self", ".", "regex", ".", "match", "(", "urllib", ".", "unquote", "(", "request", ".", "path", ")", ")", "if", "match", ":", "return", "self", ",", "match", ".", "groups", "(", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2.py#L845-L852
alexgkendall/caffe-segnet
344c113bf1832886f1cbe9f33ffe28a3beeaf412
scripts/cpp_lint.py
python
CheckForNonStandardConstructs
(filename, clean_lines, linenum, nesting_state, error)
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint is one way to ease the transition to new compilers. - put storage class first (e.g. "static const" instead of "const stat...
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
[ "r", "Logs", "an", "error", "if", "we", "see", "certain", "non", "-", "ANSI", "constructs", "ignored", "by", "gcc", "-", "2", "." ]
def CheckForNonStandardConstructs(filename, clean_lines, linenum, nesting_state, error): r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint ...
[ "def", "CheckForNonStandardConstructs", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Remove comments from the line, but leave in strings for now.", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "i...
https://github.com/alexgkendall/caffe-segnet/blob/344c113bf1832886f1cbe9f33ffe28a3beeaf412/scripts/cpp_lint.py#L2194-L2298
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/turtle.py
python
ScrolledCanvas.reset
(self, canvwidth=None, canvheight=None, bg = None)
Adjust canvas and scrollbars according to given canvas size.
Adjust canvas and scrollbars according to given canvas size.
[ "Adjust", "canvas", "and", "scrollbars", "according", "to", "given", "canvas", "size", "." ]
def reset(self, canvwidth=None, canvheight=None, bg = None): """Adjust canvas and scrollbars according to given canvas size.""" if canvwidth: self.canvwidth = canvwidth if canvheight: self.canvheight = canvheight if bg: self.bg = bg self._canva...
[ "def", "reset", "(", "self", ",", "canvwidth", "=", "None", ",", "canvheight", "=", "None", ",", "bg", "=", "None", ")", ":", "if", "canvwidth", ":", "self", ".", "canvwidth", "=", "canvwidth", "if", "canvheight", ":", "self", ".", "canvheight", "=", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/turtle.py#L384-L399
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/ensemble/gradient_boosting.py
python
LossFunction.__call__
(self, y, pred, sample_weight=None)
Compute the loss of prediction ``pred`` and ``y``.
Compute the loss of prediction ``pred`` and ``y``.
[ "Compute", "the", "loss", "of", "prediction", "pred", "and", "y", "." ]
def __call__(self, y, pred, sample_weight=None): """Compute the loss of prediction ``pred`` and ``y``. """
[ "def", "__call__", "(", "self", ",", "y", ",", "pred", ",", "sample_weight", "=", "None", ")", ":" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/ensemble/gradient_boosting.py#L196-L197
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Executor.py
python
Executor.get_all_targets
(self)
return result
Returns all targets for all batches of this Executor.
Returns all targets for all batches of this Executor.
[ "Returns", "all", "targets", "for", "all", "batches", "of", "this", "Executor", "." ]
def get_all_targets(self): """Returns all targets for all batches of this Executor.""" result = [] for batch in self.batches: result.extend(batch.targets) return result
[ "def", "get_all_targets", "(", "self", ")", ":", "result", "=", "[", "]", "for", "batch", "in", "self", ".", "batches", ":", "result", ".", "extend", "(", "batch", ".", "targets", ")", "return", "result" ]
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Executor.py#L295-L300
NeoGeographyToolkit/StereoPipeline
eedf54a919fb5cce1ab0e280bb0df4050763aa11
src/asp/IceBridge/process_icebridge_batch.py
python
createDem
(i, options, inputPairs, prefixes, demFiles, projString, heightLimitString, threadText, matchFilePair, suppressOutput, redo, logger=None)
Create a DEM from a pair of images
Create a DEM from a pair of images
[ "Create", "a", "DEM", "from", "a", "pair", "of", "images" ]
def createDem(i, options, inputPairs, prefixes, demFiles, projString, heightLimitString, threadText, matchFilePair, suppressOutput, redo, logger=None): '''Create a DEM from a pair of images''' # Since we use epipolar alignment our images should be aligned at least this well. VER...
[ "def", "createDem", "(", "i", ",", "options", ",", "inputPairs", ",", "prefixes", ",", "demFiles", ",", "projString", ",", "heightLimitString", ",", "threadText", ",", "matchFilePair", ",", "suppressOutput", ",", "redo", ",", "logger", "=", "None", ")", ":",...
https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/process_icebridge_batch.py#L853-L1021
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py
python
_SSLPipe.feed_ssldata
(self, data, only_handshake=False)
return (ssldata, appdata)
Feed SSL record level data into the pipe. The data must be a bytes instance. It is OK to send an empty bytes instance. This can be used to get ssldata for a handshake initiated by this endpoint. Return a (ssldata, appdata) tuple. The ssldata element is a list of buffers contain...
Feed SSL record level data into the pipe.
[ "Feed", "SSL", "record", "level", "data", "into", "the", "pipe", "." ]
def feed_ssldata(self, data, only_handshake=False): """Feed SSL record level data into the pipe. The data must be a bytes instance. It is OK to send an empty bytes instance. This can be used to get ssldata for a handshake initiated by this endpoint. Return a (ssldata, appdata) ...
[ "def", "feed_ssldata", "(", "self", ",", "data", ",", "only_handshake", "=", "False", ")", ":", "if", "self", ".", "_state", "==", "_UNWRAPPED", ":", "# If unwrapped, pass plaintext data straight through.", "if", "data", ":", "appdata", "=", "[", "data", "]", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py#L157-L230
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/check_ops.py
python
assert_rank_in_v2
(x, ranks, message=None, name=None)
return assert_rank_in(x=x, ranks=ranks, message=message, name=name)
Assert that `x` has a rank in `ranks`. This Op checks that the rank of `x` is in `ranks`. If `x` has a different rank, `message`, as well as the shape of `x` are printed, and `InvalidArgumentError` is raised. Args: x: `Tensor`. ranks: `Iterable` of scalar `Tensor` objects. message: A string to pr...
Assert that `x` has a rank in `ranks`.
[ "Assert", "that", "x", "has", "a", "rank", "in", "ranks", "." ]
def assert_rank_in_v2(x, ranks, message=None, name=None): """Assert that `x` has a rank in `ranks`. This Op checks that the rank of `x` is in `ranks`. If `x` has a different rank, `message`, as well as the shape of `x` are printed, and `InvalidArgumentError` is raised. Args: x: `Tensor`. ranks: `It...
[ "def", "assert_rank_in_v2", "(", "x", ",", "ranks", ",", "message", "=", "None", ",", "name", "=", "None", ")", ":", "return", "assert_rank_in", "(", "x", "=", "x", ",", "ranks", "=", "ranks", ",", "message", "=", "message", ",", "name", "=", "name",...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/check_ops.py#L1412-L1440
sigmaai/self-driving-golf-cart
8d891600af3d851add27a10ae45cf3c2108bb87c
ros/src/ros_carla_bridge/carla_manual_control/src/carla_manual_control/carla_manual_control.py
python
HUD.render
(self, display)
render the display
render the display
[ "render", "the", "display" ]
def render(self, display): """ render the display """ if self._show_info: info_surface = pygame.Surface((220, self.dim[1])) info_surface.set_alpha(100) display.blit(info_surface, (0, 0)) v_offset = 4 bar_h_offset = 100 ...
[ "def", "render", "(", "self", ",", "display", ")", ":", "if", "self", ".", "_show_info", ":", "info_surface", "=", "pygame", ".", "Surface", "(", "(", "220", ",", "self", ".", "dim", "[", "1", "]", ")", ")", "info_surface", ".", "set_alpha", "(", "...
https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_manual_control/src/carla_manual_control/carla_manual_control.py#L430-L471
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
lldb/utils/lui/lldbutil.py
python
print_stacktraces
(process, string_buffer=False)
Prints the stack traces of all the threads.
Prints the stack traces of all the threads.
[ "Prints", "the", "stack", "traces", "of", "all", "the", "threads", "." ]
def print_stacktraces(process, string_buffer=False): """Prints the stack traces of all the threads.""" output = io.StringIO() if string_buffer else sys.stdout print("Stack traces for " + str(process), file=output) for thread in process: print(print_stacktrace(thread, string_buffer=True), file...
[ "def", "print_stacktraces", "(", "process", ",", "string_buffer", "=", "False", ")", ":", "output", "=", "io", ".", "StringIO", "(", ")", "if", "string_buffer", "else", "sys", ".", "stdout", "print", "(", "\"Stack traces for \"", "+", "str", "(", "process", ...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/utils/lui/lldbutil.py#L819-L830
sailing-pmls/pmls-caffe
49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a
scripts/cpp_lint.py
python
PrintUsage
(message)
Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message.
Prints a brief usage string and exits, optionally with an error message.
[ "Prints", "a", "brief", "usage", "string", "and", "exits", "optionally", "with", "an", "error", "message", "." ]
def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message. """ sys.stderr.write(_USAGE) if message: sys.exit('\nFATAL ERROR: ' + message) else: sys.exit(1)
[ "def", "PrintUsage", "(", "message", ")", ":", "sys", ".", "stderr", ".", "write", "(", "_USAGE", ")", "if", "message", ":", "sys", ".", "exit", "(", "'\\nFATAL ERROR: '", "+", "message", ")", "else", ":", "sys", ".", "exit", "(", "1", ")" ]
https://github.com/sailing-pmls/pmls-caffe/blob/49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a/scripts/cpp_lint.py#L4757-L4767
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
NestingState.UpdatePreprocessor
(self, line)
Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the following assumptions (good enough for most...
Update preprocessor stack.
[ "Update", "preprocessor", "stack", "." ]
def UpdatePreprocessor(self, line): """Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the ...
[ "def", "UpdatePreprocessor", "(", "self", ",", "line", ")", ":", "if", "Match", "(", "r'^\\s*#\\s*(if|ifdef|ifndef)\\b'", ",", "line", ")", ":", "# Beginning of #if block, save the nesting stack here. The saved", "# stack will allow us to restore the parsing state in the #else cas...
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L2525-L2579
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/message.py
python
Message.MergeFrom
(self, other_msg)
Merges the contents of the specified message into current message. This method merges the contents of the specified message into the current message. Singular fields that are set in the specified message overwrite the corresponding fields in the current message. Repeated fields are appended. Singular s...
Merges the contents of the specified message into current message.
[ "Merges", "the", "contents", "of", "the", "specified", "message", "into", "current", "message", "." ]
def MergeFrom(self, other_msg): """Merges the contents of the specified message into current message. This method merges the contents of the specified message into the current message. Singular fields that are set in the specified message overwrite the corresponding fields in the current message. Repea...
[ "def", "MergeFrom", "(", "self", ",", "other_msg", ")", ":", "raise", "NotImplementedError" ]
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/message.py#L80-L91
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/polynomial/hermite.py
python
hermweight
(x)
return w
Weight function of the Hermite polynomials. The weight function is :math:`\\exp(-x^2)` and the interval of integration is :math:`[-\\inf, \\inf]`. the Hermite polynomials are orthogonal, but not normalized, with respect to this weight function. Parameters ---------- x : array_like Value...
Weight function of the Hermite polynomials.
[ "Weight", "function", "of", "the", "Hermite", "polynomials", "." ]
def hermweight(x): """ Weight function of the Hermite polynomials. The weight function is :math:`\\exp(-x^2)` and the interval of integration is :math:`[-\\inf, \\inf]`. the Hermite polynomials are orthogonal, but not normalized, with respect to this weight function. Parameters ---------- ...
[ "def", "hermweight", "(", "x", ")", ":", "w", "=", "np", ".", "exp", "(", "-", "x", "**", "2", ")", "return", "w" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/polynomial/hermite.py#L1787-L1812
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/hmac.py
python
HMAC.hexdigest
(self)
return h.hexdigest()
Like digest(), but returns a string of hexadecimal digits instead.
Like digest(), but returns a string of hexadecimal digits instead.
[ "Like", "digest", "()", "but", "returns", "a", "string", "of", "hexadecimal", "digits", "instead", "." ]
def hexdigest(self): """Like digest(), but returns a string of hexadecimal digits instead. """ h = self._current() return h.hexdigest()
[ "def", "hexdigest", "(", "self", ")", ":", "h", "=", "self", ".", "_current", "(", ")", "return", "h", ".", "hexdigest", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/hmac.py#L119-L123
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/framework/random_seed.py
python
get_seed
(op_seed)
Returns the local seeds an operation should use given an op-specific seed. Given operation-specific seed, `op_seed`, this helper function returns two seeds derived from graph-level and op-level seeds. Many random operations internally use the two seeds to allow user to change the seed globally for a graph, or ...
Returns the local seeds an operation should use given an op-specific seed.
[ "Returns", "the", "local", "seeds", "an", "operation", "should", "use", "given", "an", "op", "-", "specific", "seed", "." ]
def get_seed(op_seed): """Returns the local seeds an operation should use given an op-specific seed. Given operation-specific seed, `op_seed`, this helper function returns two seeds derived from graph-level and op-level seeds. Many random operations internally use the two seeds to allow user to change the seed...
[ "def", "get_seed", "(", "op_seed", ")", ":", "graph_seed", "=", "ops", ".", "get_default_graph", "(", ")", ".", "seed", "if", "graph_seed", "is", "not", "None", ":", "if", "op_seed", "is", "not", "None", ":", "return", "_truncate_seed", "(", "graph_seed", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/random_seed.py#L33-L61
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xmlTextReader.ReadAttributeValue
(self)
return ret
Parses an attribute value into one or more Text and EntityReference nodes.
Parses an attribute value into one or more Text and EntityReference nodes.
[ "Parses", "an", "attribute", "value", "into", "one", "or", "more", "Text", "and", "EntityReference", "nodes", "." ]
def ReadAttributeValue(self): """Parses an attribute value into one or more Text and EntityReference nodes. """ ret = libxml2mod.xmlTextReaderReadAttributeValue(self._o) return ret
[ "def", "ReadAttributeValue", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderReadAttributeValue", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L6042-L6046
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMS_SIGNATURE_ECDSA.fromTpm
(buf)
return buf.createObj(TPMS_SIGNATURE_ECDSA)
Returns new TPMS_SIGNATURE_ECDSA object constructed from its marshaled representation in the given TpmBuffer buffer
Returns new TPMS_SIGNATURE_ECDSA object constructed from its marshaled representation in the given TpmBuffer buffer
[ "Returns", "new", "TPMS_SIGNATURE_ECDSA", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "TpmBuffer", "buffer" ]
def fromTpm(buf): """ Returns new TPMS_SIGNATURE_ECDSA object constructed from its marshaled representation in the given TpmBuffer buffer """ return buf.createObj(TPMS_SIGNATURE_ECDSA)
[ "def", "fromTpm", "(", "buf", ")", ":", "return", "buf", ".", "createObj", "(", "TPMS_SIGNATURE_ECDSA", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L7628-L7632
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/PostprocessorViewer/plugins/LineGroupWidget.py
python
LineGroupWidget.getAxisLabels
(self)
return x_var, y_vars, y2_vars
Return the active x,y axis labels.
Return the active x,y axis labels.
[ "Return", "the", "active", "x", "y", "axis", "labels", "." ]
def getAxisLabels(self): """ Return the active x,y axis labels. """ # x x_var = self.AxisVariable.currentText() y_vars = [] y2_vars = [] for variable, toggle in self._toggles.items(): if toggle.isValid(): if toggle.axis() == '...
[ "def", "getAxisLabels", "(", "self", ")", ":", "# x", "x_var", "=", "self", ".", "AxisVariable", ".", "currentText", "(", ")", "y_vars", "=", "[", "]", "y2_vars", "=", "[", "]", "for", "variable", ",", "toggle", "in", "self", ".", "_toggles", ".", "i...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/PostprocessorViewer/plugins/LineGroupWidget.py#L172-L189
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/utils/history.py
python
History.__iter__
(self)
return iter(zip(self.iters, self.values))
You can iterate the values in history object. Returns the Iterator object.
You can iterate the values in history object.
[ "You", "can", "iterate", "the", "values", "in", "history", "object", "." ]
def __iter__(self): """ You can iterate the values in history object. Returns the Iterator object. """ return iter(zip(self.iters, self.values))
[ "def", "__iter__", "(", "self", ")", ":", "return", "iter", "(", "zip", "(", "self", ".", "iters", ",", "self", ".", "values", ")", ")" ]
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/utils/history.py#L234-L240
mit-nlp/MITIE
bf8c532c9bbd23f2aea7c3b88a3ebfe03c1e0878
mitielib/mitie.py
python
text_categorizer.__call__
(self, tokens, feature_extractor=None)
return to_default_str_type(_label), _score
Categorise a piece of text. The input tokens should have been produced by something like tokenize(). This function returns a predicted label and a confidence score.
Categorise a piece of text. The input tokens should have been produced by something like tokenize(). This function returns a predicted label and a confidence score.
[ "Categorise", "a", "piece", "of", "text", ".", "The", "input", "tokens", "should", "have", "been", "produced", "by", "something", "like", "tokenize", "()", ".", "This", "function", "returns", "a", "predicted", "label", "and", "a", "confidence", "score", "." ...
def __call__(self, tokens, feature_extractor=None): """Categorise a piece of text. The input tokens should have been produced by something like tokenize(). This function returns a predicted label and a confidence score.""" score = ctypes.c_double() label = ctypes.POINTER(ctypes.c_char_...
[ "def", "__call__", "(", "self", ",", "tokens", ",", "feature_extractor", "=", "None", ")", ":", "score", "=", "ctypes", ".", "c_double", "(", ")", "label", "=", "ctypes", ".", "POINTER", "(", "ctypes", ".", "c_char_p", ")", "(", ")", "ctokens", "=", ...
https://github.com/mit-nlp/MITIE/blob/bf8c532c9bbd23f2aea7c3b88a3ebfe03c1e0878/mitielib/mitie.py#L739-L757
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/index.py
python
PackageFinder._get_index_urls_locations
(self, project_name)
return []
Returns the locations found via self.index_urls Checks the url_name on the main (first in the list) index and use this url_name to produce all locations
Returns the locations found via self.index_urls
[ "Returns", "the", "locations", "found", "via", "self", ".", "index_urls" ]
def _get_index_urls_locations(self, project_name): """Returns the locations found via self.index_urls Checks the url_name on the main (first in the list) index and use this url_name to produce all locations """ def mkurl_pypi_url(url): loc = posixpath.join(url, proj...
[ "def", "_get_index_urls_locations", "(", "self", ",", "project_name", ")", ":", "def", "mkurl_pypi_url", "(", "url", ")", ":", "loc", "=", "posixpath", ".", "join", "(", "url", ",", "project_url_name", ")", "# For maximum compatibility with easy_install, ensure the pa...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/index.py#L349-L394
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
docs/doxygen/other/doxypy.py
python
main
()
Starts the parser on the file given by the filename as the first argument on the commandline.
Starts the parser on the file given by the filename as the first argument on the commandline.
[ "Starts", "the", "parser", "on", "the", "file", "given", "by", "the", "filename", "as", "the", "first", "argument", "on", "the", "commandline", "." ]
def main(): """Starts the parser on the file given by the filename as the first argument on the commandline. """ global args args = argParse() fsm = Doxypy() fsm.parseFile(args.filename)
[ "def", "main", "(", ")", ":", "global", "args", "args", "=", "argParse", "(", ")", "fsm", "=", "Doxypy", "(", ")", "fsm", ".", "parseFile", "(", "args", ".", "filename", ")" ]
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/docs/doxygen/other/doxypy.py#L435-L442
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/util.py
python
checkmsyscompat
()
return (shell, msys)
For msys compatibility on windows, honor the SHELL environment variable, and if $MSYSTEM == MINGW32, run commands through $SHELL -c instead of letting Python use the system shell.
For msys compatibility on windows, honor the SHELL environment variable, and if $MSYSTEM == MINGW32, run commands through $SHELL -c instead of letting Python use the system shell.
[ "For", "msys", "compatibility", "on", "windows", "honor", "the", "SHELL", "environment", "variable", "and", "if", "$MSYSTEM", "==", "MINGW32", "run", "commands", "through", "$SHELL", "-", "c", "instead", "of", "letting", "Python", "use", "the", "system", "shel...
def checkmsyscompat(): """For msys compatibility on windows, honor the SHELL environment variable, and if $MSYSTEM == MINGW32, run commands through $SHELL -c instead of letting Python use the system shell.""" if 'SHELL' in os.environ: shell = os.environ['SHELL'] elif 'MOZILLABUILD' in os.env...
[ "def", "checkmsyscompat", "(", ")", ":", "if", "'SHELL'", "in", "os", ".", "environ", ":", "shell", "=", "os", ".", "environ", "[", "'SHELL'", "]", "elif", "'MOZILLABUILD'", "in", "os", ".", "environ", ":", "shell", "=", "os", ".", "environ", "[", "'...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/util.py#L38-L56
CaoWGG/TensorRT-YOLOv4
4d7c2edce99e8794a4cb4ea3540d51ce91158a36
onnx-tensorrt/third_party/onnx/third_party/benchmark/tools/gbench/util.py
python
classify_input_file
(filename)
return ftype, err_msg
Return a tuple (type, msg) where 'type' specifies the classified type of 'filename'. If 'type' is 'IT_Invalid' then 'msg' is a human readable string represeting the error.
Return a tuple (type, msg) where 'type' specifies the classified type of 'filename'. If 'type' is 'IT_Invalid' then 'msg' is a human readable string represeting the error.
[ "Return", "a", "tuple", "(", "type", "msg", ")", "where", "type", "specifies", "the", "classified", "type", "of", "filename", ".", "If", "type", "is", "IT_Invalid", "then", "msg", "is", "a", "human", "readable", "string", "represeting", "the", "error", "."...
def classify_input_file(filename): """ Return a tuple (type, msg) where 'type' specifies the classified type of 'filename'. If 'type' is 'IT_Invalid' then 'msg' is a human readable string represeting the error. """ ftype = IT_Invalid err_msg = None if not os.path.exists(filename): ...
[ "def", "classify_input_file", "(", "filename", ")", ":", "ftype", "=", "IT_Invalid", "err_msg", "=", "None", "if", "not", "os", ".", "path", ".", "exists", "(", "filename", ")", ":", "err_msg", "=", "\"'%s' does not exist\"", "%", "filename", "elif", "not", ...
https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/benchmark/tools/gbench/util.py#L54-L72
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/flatnotebook.py
python
PageContainer.GetAGWWindowStyleFlag
(self)
return self.GetParent().GetAGWWindowStyleFlag()
Returns the :class:`FlatNotebook` window style. :see: The :meth:`FlatNotebook.__init__() <FlatNotebook.__init__>` method for the `agwStyle` parameter description.
Returns the :class:`FlatNotebook` window style.
[ "Returns", "the", ":", "class", ":", "FlatNotebook", "window", "style", "." ]
def GetAGWWindowStyleFlag(self): """ Returns the :class:`FlatNotebook` window style. :see: The :meth:`FlatNotebook.__init__() <FlatNotebook.__init__>` method for the `agwStyle` parameter description. """ return self.GetParent().GetAGWWindowStyleFlag()
[ "def", "GetAGWWindowStyleFlag", "(", "self", ")", ":", "return", "self", ".", "GetParent", "(", ")", ".", "GetAGWWindowStyleFlag", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatnotebook.py#L6325-L6332
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/closure_linter/closure_linter/javascripttokens.py
python
JavaScriptToken.IsOperator
(self, operator)
return self.type == JavaScriptTokenType.OPERATOR and self.string == operator
Tests if this token is the given operator. Args: operator: The operator to compare to. Returns: True if this token is a operator token with the given name.
Tests if this token is the given operator.
[ "Tests", "if", "this", "token", "is", "the", "given", "operator", "." ]
def IsOperator(self, operator): """Tests if this token is the given operator. Args: operator: The operator to compare to. Returns: True if this token is a operator token with the given name. """ return self.type == JavaScriptTokenType.OPERATOR and self.string == operator
[ "def", "IsOperator", "(", "self", ",", "operator", ")", ":", "return", "self", ".", "type", "==", "JavaScriptTokenType", ".", "OPERATOR", "and", "self", ".", "string", "==", "operator" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/javascripttokens.py#L116-L125
freesurfer/freesurfer
6dbe527d43ffa611acb2cd112e9469f9bfec8e36
python/freesurfer/utils/logging.py
python
Logger.flush
(self)
Flushes the file and, if tee'd, stdout.
Flushes the file and, if tee'd, stdout.
[ "Flushes", "the", "file", "and", "if", "tee", "d", "stdout", "." ]
def flush(self): '''Flushes the file and, if tee'd, stdout.''' if self.tee: self.stdout.flush() self.file.flush()
[ "def", "flush", "(", "self", ")", ":", "if", "self", ".", "tee", ":", "self", ".", "stdout", ".", "flush", "(", ")", "self", ".", "file", ".", "flush", "(", ")" ]
https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/python/freesurfer/utils/logging.py#L76-L80
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/api/stats_api.py
python
StatsApi.stats_get
(self, **kwargs)
Get exchange-wide and per-series turnover and volume statistics. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.stats_get(async_req=True) >>> result = thread.get() :param a...
Get exchange-wide and per-series turnover and volume statistics. # noqa: E501
[ "Get", "exchange", "-", "wide", "and", "per", "-", "series", "turnover", "and", "volume", "statistics", ".", "#", "noqa", ":", "E501" ]
def stats_get(self, **kwargs): # noqa: E501 """Get exchange-wide and per-series turnover and volume statistics. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.stats_get(async_req=T...
[ "def", "stats_get", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# noqa: E501", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'async_req'", ")", ":", "return", "self", ".", "stats_get_with_http_info", "(",...
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/api/stats_api.py#L36-L54
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/aui.py
python
AuiToolBar.ClearTools
(*args, **kwargs)
return _aui.AuiToolBar_ClearTools(*args, **kwargs)
ClearTools(self)
ClearTools(self)
[ "ClearTools", "(", "self", ")" ]
def ClearTools(*args, **kwargs): """ClearTools(self)""" return _aui.AuiToolBar_ClearTools(*args, **kwargs)
[ "def", "ClearTools", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiToolBar_ClearTools", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L2070-L2072
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
clang/bindings/python/clang/cindex.py
python
Type.get_canonical
(self)
return conf.lib.clang_getCanonicalType(self)
Return the canonical type for a Type. Clang's type system explicitly models typedefs and all the ways a specific type can be represented. The canonical type is the underlying type with all the "sugar" removed. For example, if 'T' is a typedef for 'int', the canonical type for ...
Return the canonical type for a Type.
[ "Return", "the", "canonical", "type", "for", "a", "Type", "." ]
def get_canonical(self): """ Return the canonical type for a Type. Clang's type system explicitly models typedefs and all the ways a specific type can be represented. The canonical type is the underlying type with all the "sugar" removed. For example, if 'T' is a typed...
[ "def", "get_canonical", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getCanonicalType", "(", "self", ")" ]
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/bindings/python/clang/cindex.py#L2284-L2294
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/site_compare/scrapers/firefox/firefox2.py
python
InvokeBrowser
(path)
return (wnd, proc, render_pane)
Invoke the Firefox browser. Args: path: full path to browser Returns: A tuple of (main window, process handle, render pane)
Invoke the Firefox browser.
[ "Invoke", "the", "Firefox", "browser", "." ]
def InvokeBrowser(path): """Invoke the Firefox browser. Args: path: full path to browser Returns: A tuple of (main window, process handle, render pane) """ # Reuse an existing instance of the browser if we can find one. This # may not work correctly, especially if the window is behind other window...
[ "def", "InvokeBrowser", "(", "path", ")", ":", "# Reuse an existing instance of the browser if we can find one. This", "# may not work correctly, especially if the window is behind other windows.", "wnds", "=", "windowing", ".", "FindChildWindows", "(", "0", ",", "\"MozillaUIWindowCl...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/site_compare/scrapers/firefox/firefox2.py#L49-L73
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
SplitterWindow.GetBorderSize
(*args, **kwargs)
return _windows_.SplitterWindow_GetBorderSize(*args, **kwargs)
GetBorderSize(self) -> int Gets the border size
GetBorderSize(self) -> int
[ "GetBorderSize", "(", "self", ")", "-", ">", "int" ]
def GetBorderSize(*args, **kwargs): """ GetBorderSize(self) -> int Gets the border size """ return _windows_.SplitterWindow_GetBorderSize(*args, **kwargs)
[ "def", "GetBorderSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "SplitterWindow_GetBorderSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L1549-L1555
PaddlePaddle/PaddleOCR
b756bf5f8c90142e0d89d3db0163965c686b6ffe
ppocr/modeling/heads/rec_nrtr_head.py
python
Transformer.generate_square_subsequent_mask
(self, sz)
return mask
Generate a square mask for the sequence. The masked positions are filled with float('-inf'). Unmasked positions are filled with float(0.0).
Generate a square mask for the sequence. The masked positions are filled with float('-inf'). Unmasked positions are filled with float(0.0).
[ "Generate", "a", "square", "mask", "for", "the", "sequence", ".", "The", "masked", "positions", "are", "filled", "with", "float", "(", "-", "inf", ")", ".", "Unmasked", "positions", "are", "filled", "with", "float", "(", "0", ".", "0", ")", "." ]
def generate_square_subsequent_mask(self, sz): """Generate a square mask for the sequence. The masked positions are filled with float('-inf'). Unmasked positions are filled with float(0.0). """ mask = paddle.zeros([sz, sz], dtype='float32') mask_inf = paddle.triu( ...
[ "def", "generate_square_subsequent_mask", "(", "self", ",", "sz", ")", ":", "mask", "=", "paddle", ".", "zeros", "(", "[", "sz", ",", "sz", "]", ",", "dtype", "=", "'float32'", ")", "mask_inf", "=", "paddle", ".", "triu", "(", "paddle", ".", "full", ...
https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppocr/modeling/heads/rec_nrtr_head.py#L347-L357
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
Log.LogText
(*args, **kwargs)
return _misc_.Log_LogText(*args, **kwargs)
LogText(self, String msg)
LogText(self, String msg)
[ "LogText", "(", "self", "String", "msg", ")" ]
def LogText(*args, **kwargs): """LogText(self, String msg)""" return _misc_.Log_LogText(*args, **kwargs)
[ "def", "LogText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Log_LogText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L1613-L1615
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py
python
MaskedArray.soften_mask
(self)
return self
Force the mask to soft. Whether the mask of a masked array is hard or soft is determined by its `hardmask` property. `soften_mask` sets `hardmask` to False. See Also -------- hardmask
Force the mask to soft.
[ "Force", "the", "mask", "to", "soft", "." ]
def soften_mask(self): """ Force the mask to soft. Whether the mask of a masked array is hard or soft is determined by its `hardmask` property. `soften_mask` sets `hardmask` to False. See Also -------- hardmask """ self._hardmask = False ...
[ "def", "soften_mask", "(", "self", ")", ":", "self", ".", "_hardmask", "=", "False", "return", "self" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L3234-L3247
gv22ga/dlib-face-recognition-android
42d6305cbd85833f2b85bb79b70ab9ab004153c9
tools/lint/cpplint.py
python
_ShouldPrintError
(category, confidence, linenum)
return True
If confidence >= verbose, category passes filter and is not suppressed.
If confidence >= verbose, category passes filter and is not suppressed.
[ "If", "confidence", ">", "=", "verbose", "category", "passes", "filter", "and", "is", "not", "suppressed", "." ]
def _ShouldPrintError(category, confidence, linenum): """If confidence >= verbose, category passes filter and is not suppressed.""" # There are three ways we might decide not to print an error message: # a "NOLINT(category)" comment appears in the source, # the verbosity level isn't high enough, or the filters...
[ "def", "_ShouldPrintError", "(", "category", ",", "confidence", ",", "linenum", ")", ":", "# There are three ways we might decide not to print an error message:", "# a \"NOLINT(category)\" comment appears in the source,", "# the verbosity level isn't high enough, or the filters filter it out...
https://github.com/gv22ga/dlib-face-recognition-android/blob/42d6305cbd85833f2b85bb79b70ab9ab004153c9/tools/lint/cpplint.py#L1093-L1118
serguei-k/maya-math-nodes
669ace5366356c6038ef63ba7d5574f18a583ae9
python/maya_math_nodes/expression_lexer.py
python
ExpressionLexer.read_string
(self)
return Token(StringToken, self.read_while(functools.partial(self.is_string, strict=False)))
Read string from stream Returns: Token: Returns read token
Read string from stream
[ "Read", "string", "from", "stream" ]
def read_string(self): """Read string from stream Returns: Token: Returns read token """ return Token(StringToken, self.read_while(functools.partial(self.is_string, strict=False)))
[ "def", "read_string", "(", "self", ")", ":", "return", "Token", "(", "StringToken", ",", "self", ".", "read_while", "(", "functools", ".", "partial", "(", "self", ".", "is_string", ",", "strict", "=", "False", ")", ")", ")" ]
https://github.com/serguei-k/maya-math-nodes/blob/669ace5366356c6038ef63ba7d5574f18a583ae9/python/maya_math_nodes/expression_lexer.py#L326-L332
shogun-toolbox/shogun
9b8d856971af5a295dd6ad70623ae45647a6334c
examples/undocumented/python/graphical/eigenfaces.py
python
EigenFaces.getEigenValues
(self)
return self.pca.get_eigenvalues()
Return the eigenvalues vector
Return the eigenvalues vector
[ "Return", "the", "eigenvalues", "vector" ]
def getEigenValues(self): """ Return the eigenvalues vector """ return self.pca.get_eigenvalues();
[ "def", "getEigenValues", "(", "self", ")", ":", "return", "self", ".", "pca", ".", "get_eigenvalues", "(", ")" ]
https://github.com/shogun-toolbox/shogun/blob/9b8d856971af5a295dd6ad70623ae45647a6334c/examples/undocumented/python/graphical/eigenfaces.py#L118-L122
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/data/array.py
python
coerce_mock_to_array
(val)
return val if not isinstance(val, HOOMDArray) else val._coerce_to_ndarray()
Helper function for ``__array_{ufunc,function}__``. Coerces ``HOOMDArray`` objects into ``numpy.ndarray`` objects.
Helper function for ``__array_{ufunc,function}__``.
[ "Helper", "function", "for", "__array_", "{", "ufunc", "function", "}", "__", "." ]
def coerce_mock_to_array(val): """Helper function for ``__array_{ufunc,function}__``. Coerces ``HOOMDArray`` objects into ``numpy.ndarray`` objects. """ if isinstance(val, Iterable) and not isinstance(val, (np.ndarray, HOOMDArray)): return [co...
[ "def", "coerce_mock_to_array", "(", "val", ")", ":", "if", "isinstance", "(", "val", ",", "Iterable", ")", "and", "not", "isinstance", "(", "val", ",", "(", "np", ".", "ndarray", ",", "HOOMDArray", ")", ")", ":", "return", "[", "coerce_mock_to_array", "(...
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/data/array.py#L325-L333
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/lib2to3/patcomp.py
python
pattern_convert
(grammar, raw_node_info)
Converts raw node information to a Node or Leaf instance.
Converts raw node information to a Node or Leaf instance.
[ "Converts", "raw", "node", "information", "to", "a", "Node", "or", "Leaf", "instance", "." ]
def pattern_convert(grammar, raw_node_info): """Converts raw node information to a Node or Leaf instance.""" type, value, context, children = raw_node_info if children or type in grammar.number2symbol: return pytree.Node(type, children, context=context) else: return pytree.Leaf(type, val...
[ "def", "pattern_convert", "(", "grammar", ",", "raw_node_info", ")", ":", "type", ",", "value", ",", "context", ",", "children", "=", "raw_node_info", "if", "children", "or", "type", "in", "grammar", ".", "number2symbol", ":", "return", "pytree", ".", "Node"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/lib2to3/patcomp.py#L194-L200
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/util/_cloudpickle/_cloudpickle_py27.py
python
CloudPickler.save_buffer
(self, obj)
Fallback to save_string
Fallback to save_string
[ "Fallback", "to", "save_string" ]
def save_buffer(self, obj): """Fallback to save_string""" Pickler.save_string(self, str(obj))
[ "def", "save_buffer", "(", "self", ",", "obj", ")", ":", "Pickler", ".", "save_string", "(", "self", ",", "str", "(", "obj", ")", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/util/_cloudpickle/_cloudpickle_py27.py#L273-L275
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/usb_gadget/usb_descriptors.py
python
Descriptor.AddField
(cls, name, struct_fmt, str_fmt='{}', default=None)
Adds a user-specified field to this descriptor. Adds a field to the binary structure representing this descriptor. The field can be set by passing a keyword argument name=... to the object constructor will be accessible as foo.name on any instance. If no default value is provided then the constructor ...
Adds a user-specified field to this descriptor.
[ "Adds", "a", "user", "-", "specified", "field", "to", "this", "descriptor", "." ]
def AddField(cls, name, struct_fmt, str_fmt='{}', default=None): """Adds a user-specified field to this descriptor. Adds a field to the binary structure representing this descriptor. The field can be set by passing a keyword argument name=... to the object constructor will be accessible as foo.name on ...
[ "def", "AddField", "(", "cls", ",", "name", ",", "struct_fmt", ",", "str_fmt", "=", "'{}'", ",", "default", "=", "None", ")", ":", "if", "cls", ".", "_fields", "is", "None", ":", "cls", ".", "_fields", "=", "[", "]", "cls", ".", "_fields", ".", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/usb_gadget/usb_descriptors.py#L49-L79
KhronosGroup/Vulkan-Headers
b32da5329b50e3cb96229aaecba9ded032fe29cc
registry/reg.py
python
matchAPIProfile
(api, profile, elem)
return True
Return whether an API and profile being generated matches an element's profile - api - string naming the API to match - profile - string naming the profile to match - elem - Element which (may) have 'api' and 'profile' attributes to match to. If a tag is not present in the Element, the corre...
Return whether an API and profile being generated matches an element's profile
[ "Return", "whether", "an", "API", "and", "profile", "being", "generated", "matches", "an", "element", "s", "profile" ]
def matchAPIProfile(api, profile, elem): """Return whether an API and profile being generated matches an element's profile - api - string naming the API to match - profile - string naming the profile to match - elem - Element which (may) have 'api' and 'profile' attributes to match to. I...
[ "def", "matchAPIProfile", "(", "api", ",", "profile", ",", "elem", ")", ":", "# Match 'api', if present", "elem_api", "=", "elem", ".", "get", "(", "'api'", ")", "if", "elem_api", ":", "if", "api", "is", "None", ":", "raise", "UserWarning", "(", "\"No API ...
https://github.com/KhronosGroup/Vulkan-Headers/blob/b32da5329b50e3cb96229aaecba9ded032fe29cc/registry/reg.py#L32-L87
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/shlex.py
python
shlex.sourcehook
(self, newfile)
return (newfile, open(newfile, "r"))
Hook called on a filename to be sourced.
Hook called on a filename to be sourced.
[ "Hook", "called", "on", "a", "filename", "to", "be", "sourced", "." ]
def sourcehook(self, newfile): "Hook called on a filename to be sourced." if newfile[0] == '"': newfile = newfile[1:-1] # This implements cpp-like semantics for relative-path inclusion. if isinstance(self.infile, str) and not os.path.isabs(newfile): newfile = os.p...
[ "def", "sourcehook", "(", "self", ",", "newfile", ")", ":", "if", "newfile", "[", "0", "]", "==", "'\"'", ":", "newfile", "=", "newfile", "[", "1", ":", "-", "1", "]", "# This implements cpp-like semantics for relative-path inclusion.", "if", "isinstance", "("...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/shlex.py#L278-L285
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/combo.py
python
ComboPopup.FindItem
(*args, **kwargs)
return _combo.ComboPopup_FindItem(*args, **kwargs)
FindItem(self, String item) -> bool
FindItem(self, String item) -> bool
[ "FindItem", "(", "self", "String", "item", ")", "-", ">", "bool" ]
def FindItem(*args, **kwargs): """FindItem(self, String item) -> bool""" return _combo.ComboPopup_FindItem(*args, **kwargs)
[ "def", "FindItem", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_combo", ".", "ComboPopup_FindItem", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/combo.py#L695-L697
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/RNN/rnn_quantizer/tensorflow/tf_nndct/utils/generic_utils.py
python
to_list
(x)
return [x]
Normalizes a list/tuple to a list. If a tensor is passed, we return a list of size 1 containing the tensor. Arguments: x: target object to be normalized. Returns: A list.
Normalizes a list/tuple to a list.
[ "Normalizes", "a", "list", "/", "tuple", "to", "a", "list", "." ]
def to_list(x): """Normalizes a list/tuple to a list. If a tensor is passed, we return a list of size 1 containing the tensor. Arguments: x: target object to be normalized. Returns: A list. """ if isinstance(x, (list, tuple)): return list(x) return [x]
[ "def", "to_list", "(", "x", ")", ":", "if", "isinstance", "(", "x", ",", "(", "list", ",", "tuple", ")", ")", ":", "return", "list", "(", "x", ")", "return", "[", "x", "]" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/tensorflow/tf_nndct/utils/generic_utils.py#L29-L43
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBValue.GetLoadAddress
(self)
return _lldb.SBValue_GetLoadAddress(self)
GetLoadAddress(SBValue self) -> lldb::addr_t
GetLoadAddress(SBValue self) -> lldb::addr_t
[ "GetLoadAddress", "(", "SBValue", "self", ")", "-", ">", "lldb", "::", "addr_t" ]
def GetLoadAddress(self): """GetLoadAddress(SBValue self) -> lldb::addr_t""" return _lldb.SBValue_GetLoadAddress(self)
[ "def", "GetLoadAddress", "(", "self", ")", ":", "return", "_lldb", ".", "SBValue_GetLoadAddress", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L14658-L14660
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/gyp/pylib/gyp/msvs_emulation.py
python
PrecompiledHeader._PchHeader
(self)
return self.settings.msvs_precompiled_header[self.config]
Get the header that will appear in an #include line for all source files.
Get the header that will appear in an #include line for all source files.
[ "Get", "the", "header", "that", "will", "appear", "in", "an", "#include", "line", "for", "all", "source", "files", "." ]
def _PchHeader(self): """Get the header that will appear in an #include line for all source files.""" return self.settings.msvs_precompiled_header[self.config]
[ "def", "_PchHeader", "(", "self", ")", ":", "return", "self", ".", "settings", ".", "msvs_precompiled_header", "[", "self", ".", "config", "]" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/msvs_emulation.py#L1042-L1045
merryhime/dynarmic
a8cbfd9af4f3f3cdad6efcd067e76edec76c1338
externals/fmt/support/docopt.py
python
Pattern.fix_repeating_arguments
(self)
return self
Fix elements that should accumulate/increment values.
Fix elements that should accumulate/increment values.
[ "Fix", "elements", "that", "should", "accumulate", "/", "increment", "values", "." ]
def fix_repeating_arguments(self): """Fix elements that should accumulate/increment values.""" either = [list(child.children) for child in transform(self).children] for case in either: for e in [child for child in case if case.count(child) > 1]: if type(e) is Argument...
[ "def", "fix_repeating_arguments", "(", "self", ")", ":", "either", "=", "[", "list", "(", "child", ".", "children", ")", "for", "child", "in", "transform", "(", "self", ")", ".", "children", "]", "for", "case", "in", "either", ":", "for", "e", "in", ...
https://github.com/merryhime/dynarmic/blob/a8cbfd9af4f3f3cdad6efcd067e76edec76c1338/externals/fmt/support/docopt.py#L57-L69
facebookresearch/minirts
859e747a5e2fab2355bea083daffa6a36820a7f2
scripts/behavior_clone/inst_dict.py
python
InstructionDict.total_num_insts
(self)
return self.num_insts + 2
num_insts + <unk>, <pad>
num_insts + <unk>, <pad>
[ "num_insts", "+", "<unk", ">", "<pad", ">" ]
def total_num_insts(self): """num_insts + <unk>, <pad>""" return self.num_insts + 2
[ "def", "total_num_insts", "(", "self", ")", ":", "return", "self", ".", "num_insts", "+", "2" ]
https://github.com/facebookresearch/minirts/blob/859e747a5e2fab2355bea083daffa6a36820a7f2/scripts/behavior_clone/inst_dict.py#L65-L67
ProgerXP/Notepad2e
71585758099ec07d61dd14ba806068c0d937efd3
scintilla/scripts/FileGenerator.py
python
UpdateFile
(filename, updated)
If the file contents are different to updated then copy updated into the file else leave alone so Mercurial and make don't treat it as modified.
If the file contents are different to updated then copy updated into the file else leave alone so Mercurial and make don't treat it as modified.
[ "If", "the", "file", "contents", "are", "different", "to", "updated", "then", "copy", "updated", "into", "the", "file", "else", "leave", "alone", "so", "Mercurial", "and", "make", "don", "t", "treat", "it", "as", "modified", "." ]
def UpdateFile(filename, updated): """ If the file contents are different to updated then copy updated into the file else leave alone so Mercurial and make don't treat it as modified. """ newOrChanged = "Changed" try: with codecs.open(filename, "r", "utf-8") as infile: original = inf...
[ "def", "UpdateFile", "(", "filename", ",", "updated", ")", ":", "newOrChanged", "=", "\"Changed\"", "try", ":", "with", "codecs", ".", "open", "(", "filename", ",", "\"r\"", ",", "\"utf-8\"", ")", "as", "infile", ":", "original", "=", "infile", ".", "rea...
https://github.com/ProgerXP/Notepad2e/blob/71585758099ec07d61dd14ba806068c0d937efd3/scintilla/scripts/FileGenerator.py#L20-L35
apple/swift-clang
d7403439fc6641751840b723e7165fb02f52db95
bindings/python/clang/cindex.py
python
SourceLocation.column
(self)
return self._get_instantiation()[2]
Get the column represented by this source location.
Get the column represented by this source location.
[ "Get", "the", "column", "represented", "by", "this", "source", "location", "." ]
def column(self): """Get the column represented by this source location.""" return self._get_instantiation()[2]
[ "def", "column", "(", "self", ")", ":", "return", "self", ".", "_get_instantiation", "(", ")", "[", "2", "]" ]
https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/bindings/python/clang/cindex.py#L280-L282
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/yaml/__init__.py
python
add_implicit_resolver
(tag, regexp, first=None, Loader=Loader, Dumper=Dumper)
Add an implicit scalar detector. If an implicit scalar value matches the given regexp, the corresponding tag is assigned to the scalar. first is a sequence of possible initial characters or None.
Add an implicit scalar detector. If an implicit scalar value matches the given regexp, the corresponding tag is assigned to the scalar. first is a sequence of possible initial characters or None.
[ "Add", "an", "implicit", "scalar", "detector", ".", "If", "an", "implicit", "scalar", "value", "matches", "the", "given", "regexp", "the", "corresponding", "tag", "is", "assigned", "to", "the", "scalar", ".", "first", "is", "a", "sequence", "of", "possible",...
def add_implicit_resolver(tag, regexp, first=None, Loader=Loader, Dumper=Dumper): """ Add an implicit scalar detector. If an implicit scalar value matches the given regexp, the corresponding tag is assigned to the scalar. first is a sequence of possible initial characters or None. """ ...
[ "def", "add_implicit_resolver", "(", "tag", ",", "regexp", ",", "first", "=", "None", ",", "Loader", "=", "Loader", ",", "Dumper", "=", "Dumper", ")", ":", "Loader", ".", "add_implicit_resolver", "(", "tag", ",", "regexp", ",", "first", ")", "Dumper", "....
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/yaml/__init__.py#L218-L227
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py
python
Dir.Entry
(self, name)
return self.fs.Entry(name, self)
Looks up or creates an entry node named 'name' relative to this directory.
Looks up or creates an entry node named 'name' relative to this directory.
[ "Looks", "up", "or", "creates", "an", "entry", "node", "named", "name", "relative", "to", "this", "directory", "." ]
def Entry(self, name): """ Looks up or creates an entry node named 'name' relative to this directory. """ return self.fs.Entry(name, self)
[ "def", "Entry", "(", "self", ",", "name", ")", ":", "return", "self", ".", "fs", ".", "Entry", "(", "name", ",", "self", ")" ]
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py#L1635-L1640
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
MemoryDCFromDC
(*args, **kwargs)
return val
MemoryDCFromDC(DC oldDC) -> MemoryDC Creates a DC that is compatible with the oldDC.
MemoryDCFromDC(DC oldDC) -> MemoryDC
[ "MemoryDCFromDC", "(", "DC", "oldDC", ")", "-", ">", "MemoryDC" ]
def MemoryDCFromDC(*args, **kwargs): """ MemoryDCFromDC(DC oldDC) -> MemoryDC Creates a DC that is compatible with the oldDC. """ val = _gdi_.new_MemoryDCFromDC(*args, **kwargs) return val
[ "def", "MemoryDCFromDC", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_gdi_", ".", "new_MemoryDCFromDC", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L5272-L5279
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/roslaunch/src/roslaunch/server.py
python
ROSLaunchChildHandler.__init__
(self, run_id, name, server_uri, pm)
@param server_uri: XML-RPC URI of server @type server_uri: str @param pm: process monitor to use @type pm: L{ProcessMonitor} @raise RLException: If parameters are invalid
[]
def __init__(self, run_id, name, server_uri, pm): """ @param server_uri: XML-RPC URI of server @type server_uri: str @param pm: process monitor to use @type pm: L{ProcessMonitor} @raise RLException: If parameters are invalid """ super(ROSLaun...
[ "def", "__init__", "(", "self", ",", "run_id", ",", "name", ",", "server_uri", ",", "pm", ")", ":", "super", "(", "ROSLaunchChildHandler", ",", "self", ")", ".", "__init__", "(", "pm", ")", "if", "server_uri", "is", "None", ":", "raise", "RLException", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/roslaunch/src/roslaunch/server.py#L245-L266
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/client/timeline.py
python
Timeline.generate_chrome_trace_format
(self, show_dataflow=True, show_memory=False)
return step_stats_analysis.chrome_trace.format_to_string(pretty=True)
Produces a trace in Chrome Trace Format. Args: show_dataflow: (Optional.) If True, add flow events to the trace connecting producers and consumers of tensors. show_memory: (Optional.) If True, add object snapshot events to the trace showing the sizes and lifetimes of tensors. Retur...
Produces a trace in Chrome Trace Format.
[ "Produces", "a", "trace", "in", "Chrome", "Trace", "Format", "." ]
def generate_chrome_trace_format(self, show_dataflow=True, show_memory=False): """Produces a trace in Chrome Trace Format. Args: show_dataflow: (Optional.) If True, add flow events to the trace connecting producers and consumers of tensors. show_memory: (Optional.) If True, add object snaps...
[ "def", "generate_chrome_trace_format", "(", "self", ",", "show_dataflow", "=", "True", ",", "show_memory", "=", "False", ")", ":", "step_stats_analysis", "=", "self", ".", "analyze_step_stats", "(", "show_dataflow", "=", "show_dataflow", ",", "show_memory", "=", "...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/client/timeline.py#L613-L628
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/fleet/utils/internal_storage.py
python
GradStorage.reset_checked_in
(self)
Reset the counter of the parameter grads which have been checked in
Reset the counter of the parameter grads which have been checked in
[ "Reset", "the", "counter", "of", "the", "parameter", "grads", "which", "have", "been", "checked", "in" ]
def reset_checked_in(self): """ Reset the counter of the parameter grads which have been checked in """ self.params_checked_in = 0 self.sent = False
[ "def", "reset_checked_in", "(", "self", ")", ":", "self", ".", "params_checked_in", "=", "0", "self", ".", "sent", "=", "False" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/utils/internal_storage.py#L216-L220
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/showbase/PythonUtil.py
python
adjust
(command = None, dim = 1, parent = None, **kw)
return vg
adjust(command = None, parent = None, **kw) Popup and entry scale to adjust a parameter Accepts any Slider keyword argument. Typical arguments include: command: The one argument command to execute min: The min value of the slider max: The max value of the slider resolution: The resolution of t...
adjust(command = None, parent = None, **kw) Popup and entry scale to adjust a parameter
[ "adjust", "(", "command", "=", "None", "parent", "=", "None", "**", "kw", ")", "Popup", "and", "entry", "scale", "to", "adjust", "a", "parameter" ]
def adjust(command = None, dim = 1, parent = None, **kw): """ adjust(command = None, parent = None, **kw) Popup and entry scale to adjust a parameter Accepts any Slider keyword argument. Typical arguments include: command: The one argument command to execute min: The min value of the slider ...
[ "def", "adjust", "(", "command", "=", "None", ",", "dim", "=", "1", ",", "parent", "=", "None", ",", "*", "*", "kw", ")", ":", "# Make sure we enable Tk", "# Don't use a regular import, to prevent ModuleFinder from picking", "# it up as a dependency when building a .p3d p...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/PythonUtil.py#L268-L304
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/urlparse.py
python
urljoin
(base, url, allow_fragments=True)
return urlunparse((scheme, netloc, '/'.join(segments), params, query, fragment))
Join a base URL and a possibly relative URL to form an absolute interpretation of the latter.
Join a base URL and a possibly relative URL to form an absolute interpretation of the latter.
[ "Join", "a", "base", "URL", "and", "a", "possibly", "relative", "URL", "to", "form", "an", "absolute", "interpretation", "of", "the", "latter", "." ]
def urljoin(base, url, allow_fragments=True): """Join a base URL and a possibly relative URL to form an absolute interpretation of the latter.""" if not base: return url if not url: return base bscheme, bnetloc, bpath, bparams, bquery, bfragment = \ urlparse(base, '', all...
[ "def", "urljoin", "(", "base", ",", "url", ",", "allow_fragments", "=", "True", ")", ":", "if", "not", "base", ":", "return", "url", "if", "not", "url", ":", "return", "base", "bscheme", ",", "bnetloc", ",", "bpath", ",", "bparams", ",", "bquery", ",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/urlparse.py#L250-L300
francinexue/xuefu
b6ff79747a42e020588c0c0a921048e08fe4680c
ctpx/ctp3/ctptd.py
python
CtpTd.onErrRtnQueryBankBalanceByFuture
(self, ReqQueryAccountField, RspInfoField)
期货发起查询银行余额错误回报
期货发起查询银行余额错误回报
[ "期货发起查询银行余额错误回报" ]
def onErrRtnQueryBankBalanceByFuture(self, ReqQueryAccountField, RspInfoField): """期货发起查询银行余额错误回报""" pass
[ "def", "onErrRtnQueryBankBalanceByFuture", "(", "self", ",", "ReqQueryAccountField", ",", "RspInfoField", ")", ":", "pass" ]
https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/ctpx/ctp3/ctptd.py#L511-L513
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/plugins/common/wxgui.py
python
WxGui.refresh_widgets
(self)
Check through mainframe what the state of the application is and reset widgets. For exampe enable/disable widgets dependent on the availability of data.
Check through mainframe what the state of the application is and reset widgets. For exampe enable/disable widgets dependent on the availability of data.
[ "Check", "through", "mainframe", "what", "the", "state", "of", "the", "application", "is", "and", "reset", "widgets", ".", "For", "exampe", "enable", "/", "disable", "widgets", "dependent", "on", "the", "availability", "of", "data", "." ]
def refresh_widgets(self): """ Check through mainframe what the state of the application is and reset widgets. For exampe enable/disable widgets dependent on the availability of data. """ pass
[ "def", "refresh_widgets", "(", "self", ")", ":", "pass" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/plugins/common/wxgui.py#L47-L53
kclyu/rpi-webrtc-streamer
e109e418aa9023009b3b59c95eec2de4721125be
tools/telegramBot.py
python
remove_mp4
( filename )
return True
remove video file which is created temporarily for uploading
remove video file which is created temporarily for uploading
[ "remove", "video", "file", "which", "is", "created", "temporarily", "for", "uploading" ]
def remove_mp4( filename ): """ remove video file which is created temporarily for uploading """ try: os.remove(filename) except OSError: logger.error("Failed to remove temp .mp4 file {}" .format(filename)) return False logger.debug("Removing tempoary mp4 file {}" .format(filena...
[ "def", "remove_mp4", "(", "filename", ")", ":", "try", ":", "os", ".", "remove", "(", "filename", ")", "except", "OSError", ":", "logger", ".", "error", "(", "\"Failed to remove temp .mp4 file {}\"", ".", "format", "(", "filename", ")", ")", "return", "False...
https://github.com/kclyu/rpi-webrtc-streamer/blob/e109e418aa9023009b3b59c95eec2de4721125be/tools/telegramBot.py#L459-L468
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/simulation/wxgui.py
python
WxGui.on_filter_edgeresults
(self, event=None)
Filter edgeresults by zone, etc.
Filter edgeresults by zone, etc.
[ "Filter", "edgeresults", "by", "zone", "etc", "." ]
def on_filter_edgeresults(self, event=None): """Filter edgeresults by zone, etc.""" if self._simulation.results is None: self._simulation.results = results.Simresults(ident='simresults', simulation=self._simulation) edgeresultfilter = results.EdgeresultFilter(self._simulation.result...
[ "def", "on_filter_edgeresults", "(", "self", ",", "event", "=", "None", ")", ":", "if", "self", ".", "_simulation", ".", "results", "is", "None", ":", "self", ".", "_simulation", ".", "results", "=", "results", ".", "Simresults", "(", "ident", "=", "'sim...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/simulation/wxgui.py#L465-L489
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/botocore/credentials.py
python
CanonicalNameCredentialSourcer.is_supported
(self, source_name)
return source_name in [p.CANONICAL_NAME for p in self._providers]
Validates a given source name. :type source_name: str :param source_name: The value of credential_source in the config file. This is the canonical name of the credential provider. :rtype: bool :returns: True if the credential provider is supported, False otherwi...
Validates a given source name.
[ "Validates", "a", "given", "source", "name", "." ]
def is_supported(self, source_name): """Validates a given source name. :type source_name: str :param source_name: The value of credential_source in the config file. This is the canonical name of the credential provider. :rtype: bool :returns: True if the credential ...
[ "def", "is_supported", "(", "self", ",", "source_name", ")", ":", "return", "source_name", "in", "[", "p", ".", "CANONICAL_NAME", "for", "p", "in", "self", ".", "_providers", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/credentials.py#L1402-L1413
nest/nest-simulator
f2623eb78518cdbd55e77e0ed486bf1111bcb62f
pynest/nest/voltage_trace.py
python
from_file
(fname, title=None, grayscale=False)
return plotid
Plot voltage trace from file. Parameters ---------- fname : str or list Filename or list of filenames to load from title : str, optional Plot title grayscale : bool, optional Plot in grayscale Raises ------ ValueError
Plot voltage trace from file.
[ "Plot", "voltage", "trace", "from", "file", "." ]
def from_file(fname, title=None, grayscale=False): """Plot voltage trace from file. Parameters ---------- fname : str or list Filename or list of filenames to load from title : str, optional Plot title grayscale : bool, optional Plot in grayscale Raises ------ ...
[ "def", "from_file", "(", "fname", ",", "title", "=", "None", ",", "grayscale", "=", "False", ")", ":", "import", "matplotlib", ".", "pyplot", "as", "plt", "if", "isinstance", "(", "fname", ",", "(", "list", ",", "tuple", ")", ")", ":", "data", "=", ...
https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/voltage_trace.py#L35-L125
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/portableserver/build.py
python
ensure_directory
(path)
Makes sure a given directory exists.
Makes sure a given directory exists.
[ "Makes", "sure", "a", "given", "directory", "exists", "." ]
def ensure_directory(path): """Makes sure a given directory exists.""" if not os.path.isdir(path): if os.name is 'nt' and path[1] is ':': path = u'\\\\?\\' + path os.makedirs(path)
[ "def", "ensure_directory", "(", "path", ")", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "path", ")", ":", "if", "os", ".", "name", "is", "'nt'", "and", "path", "[", "1", "]", "is", "':'", ":", "path", "=", "u'\\\\\\\\?\\\\'", "+", "p...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/portableserver/build.py#L36-L42
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/subprocess.py
python
check_call
(*popenargs, **kwargs)
return 0
Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the Popen constructor. Example: check_call...
Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute.
[ "Run", "command", "with", "arguments", ".", "Wait", "for", "command", "to", "complete", ".", "If", "the", "exit", "code", "was", "zero", "then", "return", "otherwise", "raise", "CalledProcessError", ".", "The", "CalledProcessError", "object", "will", "have", "...
def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the...
[ "def", "check_call", "(", "*", "popenargs", ",", "*", "*", "kwargs", ")", ":", "retcode", "=", "call", "(", "*", "popenargs", ",", "*", "*", "kwargs", ")", "if", "retcode", ":", "cmd", "=", "kwargs", ".", "get", "(", "\"args\"", ")", "if", "cmd", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/subprocess.py#L527-L543
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/throbber.py
python
Throbber.Increment
(self)
Display next image in sequence
Display next image in sequence
[ "Display", "next", "image", "in", "sequence" ]
def Increment(self): """Display next image in sequence""" self.current += 1 self.Wrap()
[ "def", "Increment", "(", "self", ")", ":", "self", ".", "current", "+=", "1", "self", ".", "Wrap", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/throbber.py#L260-L263
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
sp/src/thirdparty/protobuf-2.3.0/python/mox.py
python
MockAnything._CreateMockMethod
(self, method_name)
return MockMethod(method_name, self._expected_calls_queue, self._replay_mode)
Create a new mock method call and return it. Args: # method name: the name of the method being called. method_name: str Returns: A new MockMethod aware of MockAnything's state (record or replay).
Create a new mock method call and return it.
[ "Create", "a", "new", "mock", "method", "call", "and", "return", "it", "." ]
def _CreateMockMethod(self, method_name): """Create a new mock method call and return it. Args: # method name: the name of the method being called. method_name: str Returns: A new MockMethod aware of MockAnything's state (record or replay). """ return MockMethod(method_name, sel...
[ "def", "_CreateMockMethod", "(", "self", ",", "method_name", ")", ":", "return", "MockMethod", "(", "method_name", ",", "self", ".", "_expected_calls_queue", ",", "self", ".", "_replay_mode", ")" ]
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/mox.py#L295-L307
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/dtypes/cast.py
python
is_nested_object
(obj)
return bool( isinstance(obj, ABCSeries) and is_object_dtype(obj.dtype) and any(isinstance(v, ABCSeries) for v in obj._values) )
return a boolean if we have a nested object, e.g. a Series with 1 or more Series elements This may not be necessarily be performant.
return a boolean if we have a nested object, e.g. a Series with 1 or more Series elements
[ "return", "a", "boolean", "if", "we", "have", "a", "nested", "object", "e", ".", "g", ".", "a", "Series", "with", "1", "or", "more", "Series", "elements" ]
def is_nested_object(obj) -> bool: """ return a boolean if we have a nested object, e.g. a Series with 1 or more Series elements This may not be necessarily be performant. """ return bool( isinstance(obj, ABCSeries) and is_object_dtype(obj.dtype) and any(isinstance(v, A...
[ "def", "is_nested_object", "(", "obj", ")", "->", "bool", ":", "return", "bool", "(", "isinstance", "(", "obj", ",", "ABCSeries", ")", "and", "is_object_dtype", "(", "obj", ".", "dtype", ")", "and", "any", "(", "isinstance", "(", "v", ",", "ABCSeries", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/dtypes/cast.py#L131-L143
jiaxiang-wu/quantized-cnn
4d020e17026df90e40111d219e3eb74e0afb1588
cpplint.py
python
IsDeletedOrDefault
(clean_lines, linenum)
return Match(r'\s*=\s*(?:delete|default)\b', close_line[close_paren:])
Check if current constructor or operator is deleted or default. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if this is a deleted or default constructor.
Check if current constructor or operator is deleted or default.
[ "Check", "if", "current", "constructor", "or", "operator", "is", "deleted", "or", "default", "." ]
def IsDeletedOrDefault(clean_lines, linenum): """Check if current constructor or operator is deleted or default. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if this is a deleted or default constructor. """ open_paren = c...
[ "def", "IsDeletedOrDefault", "(", "clean_lines", ",", "linenum", ")", ":", "open_paren", "=", "clean_lines", ".", "elided", "[", "linenum", "]", ".", "find", "(", "'('", ")", "if", "open_paren", "<", "0", ":", "return", "False", "(", "close_line", ",", "...
https://github.com/jiaxiang-wu/quantized-cnn/blob/4d020e17026df90e40111d219e3eb74e0afb1588/cpplint.py#L3635-L3651
ideawu/ssdb-rocks
a3cbb322cafb2f493252829c608e2239df98c9ac
deps/cpy/antlr3/tree.py
python
BaseTreeAdaptor.errorNode
(self, input, start, stop, exc)
return CommonErrorNode(input, start, stop, exc)
create tree node that holds the start and stop tokens associated with an error. If you specify your own kind of tree nodes, you will likely have to override this method. CommonTree returns Token.INVALID_TOKEN_TYPE if no token payload but you might have to set token type for diff ...
create tree node that holds the start and stop tokens associated with an error.
[ "create", "tree", "node", "that", "holds", "the", "start", "and", "stop", "tokens", "associated", "with", "an", "error", "." ]
def errorNode(self, input, start, stop, exc): """ create tree node that holds the start and stop tokens associated with an error. If you specify your own kind of tree nodes, you will likely have to override this method. CommonTree returns Token.INVALID_TOKEN_TYPE if no t...
[ "def", "errorNode", "(", "self", ",", "input", ",", "start", ",", "stop", ",", "exc", ")", ":", "return", "CommonErrorNode", "(", "input", ",", "start", ",", "stop", ",", "exc", ")" ]
https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/tree.py#L918-L929
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/locked_file.py
python
LockedFile.open_and_lock
(self, timeout=0, delay=0.05)
Open the file, trying to lock it. Args: timeout: float, The number of seconds to try to acquire the lock. delay: float, The number of seconds to wait between retry attempts. Raises: AlreadyLockedException: if the lock is already acquired. IOError: if the open fails.
Open the file, trying to lock it.
[ "Open", "the", "file", "trying", "to", "lock", "it", "." ]
def open_and_lock(self, timeout=0, delay=0.05): """Open the file, trying to lock it. Args: timeout: float, The number of seconds to try to acquire the lock. delay: float, The number of seconds to wait between retry attempts. Raises: AlreadyLockedException: if the lock is already acquired...
[ "def", "open_and_lock", "(", "self", ",", "timeout", "=", "0", ",", "delay", "=", "0.05", ")", ":", "self", ".", "_opener", ".", "open_and_lock", "(", "timeout", ",", "delay", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/locked_file.py#L363-L374
dscharrer/innoextract
5519d364cc8898f906f6285d81a87ab8c5469cde
cmake/cpplint.py
python
_ShouldPrintError
(category, confidence, linenum)
return True
If confidence >= verbose, category passes filter and is not suppressed.
If confidence >= verbose, category passes filter and is not suppressed.
[ "If", "confidence", ">", "=", "verbose", "category", "passes", "filter", "and", "is", "not", "suppressed", "." ]
def _ShouldPrintError(category, confidence, linenum): """If confidence >= verbose, category passes filter and is not suppressed.""" # There are three ways we might decide not to print an error message: # a "NOLINT(category)" comment appears in the source, # the verbosity level isn't high enough, or the filters...
[ "def", "_ShouldPrintError", "(", "category", ",", "confidence", ",", "linenum", ")", ":", "# There are three ways we might decide not to print an error message:", "# a \"NOLINT(category)\" comment appears in the source,", "# the verbosity level isn't high enough, or the filters filter it out...
https://github.com/dscharrer/innoextract/blob/5519d364cc8898f906f6285d81a87ab8c5469cde/cmake/cpplint.py#L828-L852