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
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBAttachInfo.EffectiveGroupIDIsValid
(self)
return _lldb.SBAttachInfo_EffectiveGroupIDIsValid(self)
EffectiveGroupIDIsValid(SBAttachInfo self) -> bool
EffectiveGroupIDIsValid(SBAttachInfo self) -> bool
[ "EffectiveGroupIDIsValid", "(", "SBAttachInfo", "self", ")", "-", ">", "bool" ]
def EffectiveGroupIDIsValid(self): """EffectiveGroupIDIsValid(SBAttachInfo self) -> bool""" return _lldb.SBAttachInfo_EffectiveGroupIDIsValid(self)
[ "def", "EffectiveGroupIDIsValid", "(", "self", ")", ":", "return", "_lldb", ".", "SBAttachInfo_EffectiveGroupIDIsValid", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L1167-L1169
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typing/templates.py
python
make_overload_attribute_template
(typ, attr, overload_func, inline, base=_OverloadAttributeTemplate)
return type(base)(name, (base,), dct)
Make a template class for attribute *attr* of *typ* overloaded by *overload_func*.
Make a template class for attribute *attr* of *typ* overloaded by *overload_func*.
[ "Make", "a", "template", "class", "for", "attribute", "*", "attr", "*", "of", "*", "typ", "*", "overloaded", "by", "*", "overload_func", "*", "." ]
def make_overload_attribute_template(typ, attr, overload_func, inline, base=_OverloadAttributeTemplate): """ Make a template class for attribute *attr* of *typ* overloaded by *overload_func*. """ assert isinstance(typ, types.Type) or issubclass(typ, types.Type) ...
[ "def", "make_overload_attribute_template", "(", "typ", ",", "attr", ",", "overload_func", ",", "inline", ",", "base", "=", "_OverloadAttributeTemplate", ")", ":", "assert", "isinstance", "(", "typ", ",", "types", ".", "Type", ")", "or", "issubclass", "(", "typ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typing/templates.py#L816-L830
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/ma/core.py
python
MaskedArray.argmin
(self, axis=None, fill_value=None, out=None)
return d.argmin(axis, out=out)
Return array of indices to the minimum values along the given axis. Parameters ---------- axis : {None, integer} If None, the index is into the flattened array, otherwise along the specified axis fill_value : {var}, optional Value used to fill in the ...
Return array of indices to the minimum values along the given axis.
[ "Return", "array", "of", "indices", "to", "the", "minimum", "values", "along", "the", "given", "axis", "." ]
def argmin(self, axis=None, fill_value=None, out=None): """ Return array of indices to the minimum values along the given axis. Parameters ---------- axis : {None, integer} If None, the index is into the flattened array, otherwise along the specified axis...
[ "def", "argmin", "(", "self", ",", "axis", "=", "None", ",", "fill_value", "=", "None", ",", "out", "=", "None", ")", ":", "if", "fill_value", "is", "None", ":", "fill_value", "=", "minimum_fill_value", "(", "self", ")", "d", "=", "self", ".", "fille...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L5410-L5449
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/lib/npyio.py
python
_getconv
(dtype)
Find the correct dtype converter. Adapted from matplotlib
Find the correct dtype converter. Adapted from matplotlib
[ "Find", "the", "correct", "dtype", "converter", ".", "Adapted", "from", "matplotlib" ]
def _getconv(dtype): """ Find the correct dtype converter. Adapted from matplotlib """ def floatconv(x): x.lower() if '0x' in x: return float.fromhex(x) return float(x) typ = dtype.type if issubclass(typ, np.bool_): return lambda x: bool(int(x)) if issub...
[ "def", "_getconv", "(", "dtype", ")", ":", "def", "floatconv", "(", "x", ")", ":", "x", ".", "lower", "(", ")", "if", "'0x'", "in", "x", ":", "return", "float", ".", "fromhex", "(", "x", ")", "return", "float", "(", "x", ")", "typ", "=", "dtype...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/npyio.py#L768-L797
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/portable_globe.py
python
Globe.ReadMapImageryPacket
(self, qtpath, channel, layer_id)
return self.ReadMapDataPacket( qtpath, glc_unpacker.kImagePacket, channel, layer_id)
Returns imagery packet at given address. If imagery packet is not found, throws an exception. Args: qtpath: the quadtree node of the map imagery packet. channel: the channel of the map imagery packet. layer_id: id of layer in the composite globe. Returns: The map imagery packet its...
Returns imagery packet at given address.
[ "Returns", "imagery", "packet", "at", "given", "address", "." ]
def ReadMapImageryPacket(self, qtpath, channel, layer_id): """Returns imagery packet at given address. If imagery packet is not found, throws an exception. Args: qtpath: the quadtree node of the map imagery packet. channel: the channel of the map imagery packet. layer_id: id of layer in ...
[ "def", "ReadMapImageryPacket", "(", "self", ",", "qtpath", ",", "channel", ",", "layer_id", ")", ":", "return", "self", ".", "ReadMapDataPacket", "(", "qtpath", ",", "glc_unpacker", ".", "kImagePacket", ",", "channel", ",", "layer_id", ")" ]
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/portable_globe.py#L400-L413
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/tools/gyp/pylib/gyp/xcode_emulation.py
python
XcodeArchsDefault._VariableMapping
(self, sdkroot)
Returns the dictionary of variable mapping depending on the SDKROOT.
Returns the dictionary of variable mapping depending on the SDKROOT.
[ "Returns", "the", "dictionary", "of", "variable", "mapping", "depending", "on", "the", "SDKROOT", "." ]
def _VariableMapping(self, sdkroot): """Returns the dictionary of variable mapping depending on the SDKROOT.""" sdkroot = sdkroot.lower() if 'iphoneos' in sdkroot: return self._archs['ios'] elif 'iphonesimulator' in sdkroot: return self._archs['iossim'] else: return self._archs['ma...
[ "def", "_VariableMapping", "(", "self", ",", "sdkroot", ")", ":", "sdkroot", "=", "sdkroot", ".", "lower", "(", ")", "if", "'iphoneos'", "in", "sdkroot", ":", "return", "self", ".", "_archs", "[", "'ios'", "]", "elif", "'iphonesimulator'", "in", "sdkroot",...
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/xcode_emulation.py#L53-L61
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/email/feedparser.py
python
FeedParser.__init__
(self, _factory=message.Message)
_factory is called with no arguments to create a new message obj
_factory is called with no arguments to create a new message obj
[ "_factory", "is", "called", "with", "no", "arguments", "to", "create", "a", "new", "message", "obj" ]
def __init__(self, _factory=message.Message): """_factory is called with no arguments to create a new message obj""" self._factory = _factory self._input = BufferedSubFile() self._msgstack = [] self._parse = self._parsegen().next self._cur = None self._last = None...
[ "def", "__init__", "(", "self", ",", "_factory", "=", "message", ".", "Message", ")", ":", "self", ".", "_factory", "=", "_factory", "self", ".", "_input", "=", "BufferedSubFile", "(", ")", "self", ".", "_msgstack", "=", "[", "]", "self", ".", "_parse"...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/email/feedparser.py#L140-L148
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/wsgiref/handlers.py
python
BaseHandler.send_preamble
(self)
Transmit version/status/date/server, via self._write()
Transmit version/status/date/server, via self._write()
[ "Transmit", "version", "/", "status", "/", "date", "/", "server", "via", "self", ".", "_write", "()" ]
def send_preamble(self): """Transmit version/status/date/server, via self._write()""" if self.origin_server: if self.client_is_modern(): self._write(('HTTP/%s %s\r\n' % (self.http_version,self.status)).encode('iso-8859-1')) if 'Date' not in self.headers: ...
[ "def", "send_preamble", "(", "self", ")", ":", "if", "self", ".", "origin_server", ":", "if", "self", ".", "client_is_modern", "(", ")", ":", "self", ".", "_write", "(", "(", "'HTTP/%s %s\\r\\n'", "%", "(", "self", ".", "http_version", ",", "self", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/wsgiref/handlers.py#L261-L273
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/plotting/markers.py
python
HorizontalMarker.mouse_move_stop
(self)
Stop moving.
Stop moving.
[ "Stop", "moving", "." ]
def mouse_move_stop(self): """ Stop moving. """ self.is_moving = False
[ "def", "mouse_move_stop", "(", "self", ")", ":", "self", ".", "is_moving", "=", "False" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/plotting/markers.py#L157-L161
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/dygraph/layers.py
python
Layer.add_parameter
(self, name, parameter)
return parameter
Adds a Parameter instance. Added parameter can be accessed by self.name Parameters: name(str): name of this sublayer. parameter(Parameter): an instance of Parameter. Returns: Parameter: the parameter passed in. Examples: .. code-block:: p...
Adds a Parameter instance.
[ "Adds", "a", "Parameter", "instance", "." ]
def add_parameter(self, name, parameter): """Adds a Parameter instance. Added parameter can be accessed by self.name Parameters: name(str): name of this sublayer. parameter(Parameter): an instance of Parameter. Returns: Parameter: the parameter passe...
[ "def", "add_parameter", "(", "self", ",", "name", ",", "parameter", ")", ":", "if", "'_parameters'", "not", "in", "self", ".", "__dict__", ":", "raise", "RuntimeError", "(", "\"super(YourLayer, self).__init__() should be called firstly.\"", ")", "elif", "not", "isin...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dygraph/layers.py#L975-L1037
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/agilepy/lib_base/misc.py
python
string_to_float
(s)
return float(q)
Returns a float from a string while cleaning it
Returns a float from a string while cleaning it
[ "Returns", "a", "float", "from", "a", "string", "while", "cleaning", "it" ]
def string_to_float(s): """Returns a float from a string while cleaning it""" q = '' is_sample = False for c in s: if c.isdigit(): q += c elif c == '.': q += c else: break return float(q)
[ "def", "string_to_float", "(", "s", ")", ":", "q", "=", "''", "is_sample", "=", "False", "for", "c", "in", "s", ":", "if", "c", ".", "isdigit", "(", ")", ":", "q", "+=", "c", "elif", "c", "==", "'.'", ":", "q", "+=", "c", "else", ":", "break"...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_base/misc.py#L35-L46
fifengine/fifengine
4b62c42e85bec19893cef8e63e6855927cff2c47
engine/python/fife/extensions/pychan/widgets/widget.py
python
Widget.removeChildren
(self,*widgets)
Remove a list of direct child widgets. All widgets have to be direct child widgets. To 'clear' a container take a look at L{removeAllChildren}. See also L{removeChild}. Usage:: container.removeChildren( widget1, widget2, ... ) # or you can use this on a list container.removeChildren( [widget1,widget2,...
Remove a list of direct child widgets. All widgets have to be direct child widgets. To 'clear' a container take a look at L{removeAllChildren}. See also L{removeChild}.
[ "Remove", "a", "list", "of", "direct", "child", "widgets", ".", "All", "widgets", "have", "to", "be", "direct", "child", "widgets", ".", "To", "clear", "a", "container", "take", "a", "look", "at", "L", "{", "removeAllChildren", "}", ".", "See", "also", ...
def removeChildren(self,*widgets): """ Remove a list of direct child widgets. All widgets have to be direct child widgets. To 'clear' a container take a look at L{removeAllChildren}. See also L{removeChild}. Usage:: container.removeChildren( widget1, widget2, ... ) # or you can use this on a list ...
[ "def", "removeChildren", "(", "self", ",", "*", "widgets", ")", ":", "if", "len", "(", "widgets", ")", "==", "1", "and", "not", "isinstance", "(", "widgets", "[", "0", "]", ",", "Widget", ")", ":", "widgets", "=", "widgets", "[", "0", "]", "for", ...
https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pychan/widgets/widget.py#L676-L691
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/plugins/mapmatching/mapmatching.py
python
Mapmatching.get_distancesmap
(self, is_check_lanes = False, ids_mode = None)
return self._distancesmap
Returns a dictionary where key is id_mode and value is a distance-lookup table, mapping id_edge to edge distance
Returns a dictionary where key is id_mode and value is a distance-lookup table, mapping id_edge to edge distance
[ "Returns", "a", "dictionary", "where", "key", "is", "id_mode", "and", "value", "is", "a", "distance", "-", "lookup", "table", "mapping", "id_edge", "to", "edge", "distance" ]
def get_distancesmap(self, is_check_lanes = False, ids_mode = None): """ Returns a dictionary where key is id_mode and value is a distance-lookup table, mapping id_edge to edge distance """ print 'get_distancesmap',self._distancesmap is None ...
[ "def", "get_distancesmap", "(", "self", ",", "is_check_lanes", "=", "False", ",", "ids_mode", "=", "None", ")", ":", "print", "'get_distancesmap'", ",", "self", ".", "_distancesmap", "is", "None", "if", "self", ".", "_distancesmap", "is", "None", ":", "edges...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/plugins/mapmatching/mapmatching.py#L9909-L9935
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/devil/devil/android/apk_helper.py
python
GetPackageName
(apk_path)
return ApkHelper(apk_path).GetPackageName()
Returns the package name of the apk.
Returns the package name of the apk.
[ "Returns", "the", "package", "name", "of", "the", "apk", "." ]
def GetPackageName(apk_path): """Returns the package name of the apk.""" return ApkHelper(apk_path).GetPackageName()
[ "def", "GetPackageName", "(", "apk_path", ")", ":", "return", "ApkHelper", "(", "apk_path", ")", ".", "GetPackageName", "(", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/apk_helper.py#L18-L20
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/codedeploy/layer1.py
python
CodeDeployConnection.get_deployment_group
(self, application_name, deployment_group_name)
return self.make_request(action='GetDeploymentGroup', body=json.dumps(params))
Gets information about a deployment group. :type application_name: string :param application_name: The name of an existing AWS CodeDeploy application within the AWS user account. :type deployment_group_name: string :param deployment_group_name: The name of an existing deplo...
Gets information about a deployment group.
[ "Gets", "information", "about", "a", "deployment", "group", "." ]
def get_deployment_group(self, application_name, deployment_group_name): """ Gets information about a deployment group. :type application_name: string :param application_name: The name of an existing AWS CodeDeploy application within the AWS user account. :type depl...
[ "def", "get_deployment_group", "(", "self", ",", "application_name", ",", "deployment_group_name", ")", ":", "params", "=", "{", "'applicationName'", ":", "application_name", ",", "'deploymentGroupName'", ":", "deployment_group_name", ",", "}", "return", "self", ".", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/codedeploy/layer1.py#L493-L511
PX4/PX4-Autopilot
0b9f60a0370be53d683352c63fd92db3d6586e18
Tools/mavlink_shell.py
python
MavlinkSerialPort.write
(self, b)
write some bytes
write some bytes
[ "write", "some", "bytes" ]
def write(self, b): '''write some bytes''' self.debug("sending '%s' (0x%02x) of len %u\n" % (b, ord(b[0]), len(b)), 2) while len(b) > 0: n = len(b) if n > 70: n = 70 buf = [ord(x) for x in b[:n]] buf.extend([0]*(70-len(buf))) ...
[ "def", "write", "(", "self", ",", "b", ")", ":", "self", ".", "debug", "(", "\"sending '%s' (0x%02x) of len %u\\n\"", "%", "(", "b", ",", "ord", "(", "b", "[", "0", "]", ")", ",", "len", "(", "b", ")", ")", ",", "2", ")", "while", "len", "(", "...
https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/mavlink_shell.py#L58-L74
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
clang/bindings/python/clang/cindex.py
python
Diagnostic.category_name
(self)
return conf.lib.clang_getDiagnosticCategoryText(self)
The string name of the category for this diagnostic.
The string name of the category for this diagnostic.
[ "The", "string", "name", "of", "the", "category", "for", "this", "diagnostic", "." ]
def category_name(self): """The string name of the category for this diagnostic.""" return conf.lib.clang_getDiagnosticCategoryText(self)
[ "def", "category_name", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getDiagnosticCategoryText", "(", "self", ")" ]
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/bindings/python/clang/cindex.py#L465-L467
JoseExposito/touchegg
1f3fda214358d071c05da4bf17c070c33d67b5eb
cmake/cpplint.py
python
FileInfo.Split
(self)
return (project,) + os.path.splitext(rest)
Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension).
Splits the file into the directory, basename, and extension.
[ "Splits", "the", "file", "into", "the", "directory", "basename", "and", "extension", "." ]
def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os...
[ "def", "Split", "(", "self", ")", ":", "googlename", "=", "self", ".", "RepositoryName", "(", ")", "project", ",", "rest", "=", "os", ".", "path", ".", "split", "(", "googlename", ")", "return", "(", "project", ",", ")", "+", "os", ".", "path", "."...
https://github.com/JoseExposito/touchegg/blob/1f3fda214358d071c05da4bf17c070c33d67b5eb/cmake/cpplint.py#L1157-L1169
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/lite/tools/visualize.py
python
GenerateGraph
(subgraph_idx, g, opcode_mapper)
return html
Produces the HTML required to have a d3 visualization of the dag.
Produces the HTML required to have a d3 visualization of the dag.
[ "Produces", "the", "HTML", "required", "to", "have", "a", "d3", "visualization", "of", "the", "dag", "." ]
def GenerateGraph(subgraph_idx, g, opcode_mapper): """Produces the HTML required to have a d3 visualization of the dag.""" def TensorName(idx): return "t%d" % idx def OpName(idx): return "o%d" % idx edges = [] nodes = [] first = {} second = {} pixel_mult = 200 # TODO(aselle): multiplier for ...
[ "def", "GenerateGraph", "(", "subgraph_idx", ",", "g", ",", "opcode_mapper", ")", ":", "def", "TensorName", "(", "idx", ")", ":", "return", "\"t%d\"", "%", "idx", "def", "OpName", "(", "idx", ")", ":", "return", "\"o%d\"", "%", "idx", "edges", "=", "["...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/lite/tools/visualize.py#L265-L324
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/setuptools/depends.py
python
Require.get_version
(self, paths=None, default="unknown")
return v
Get version number of installed module, 'None', or 'default' Search 'paths' for module. If not found, return 'None'. If found, return the extracted version attribute, or 'default' if no version attribute was specified, or the value cannot be determined without importing the module. T...
Get version number of installed module, 'None', or 'default'
[ "Get", "version", "number", "of", "installed", "module", "None", "or", "default" ]
def get_version(self, paths=None, default="unknown"): """Get version number of installed module, 'None', or 'default' Search 'paths' for module. If not found, return 'None'. If found, return the extracted version attribute, or 'default' if no version attribute was specified, or the va...
[ "def", "get_version", "(", "self", ",", "paths", "=", "None", ",", "default", "=", "\"unknown\"", ")", ":", "if", "self", ".", "attribute", "is", "None", ":", "try", ":", "f", ",", "p", ",", "i", "=", "find_module", "(", "self", ".", "module", ",",...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/depends.py#L43-L68
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
tools/update-packaging/make_incremental_updates.py
python
PatchInfo.create_manifest_files
(self)
Create the v2 manifest file in the root of the work_dir
Create the v2 manifest file in the root of the work_dir
[ "Create", "the", "v2", "manifest", "file", "in", "the", "root", "of", "the", "work_dir" ]
def create_manifest_files(self): """ Create the v2 manifest file in the root of the work_dir """ manifest_file_path = os.path.join(self.work_dir,"updatev2.manifest") manifest_file = open(manifest_file_path, "wb") manifest_file.writelines("type \"partial\"\n") manifest_file.writel...
[ "def", "create_manifest_files", "(", "self", ")", ":", "manifest_file_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "work_dir", ",", "\"updatev2.manifest\"", ")", "manifest_file", "=", "open", "(", "manifest_file_path", ",", "\"wb\"", ")", "man...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/tools/update-packaging/make_incremental_updates.py#L106-L127
ROCmSoftwarePlatform/hipCaffe
4ec5d482515cce532348553b6db6d00d015675d5
python/caffe/io.py
python
Transformer.set_channel_swap
(self, in_, order)
Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. N.B. this assumes the channels are the first dimension AFTER transpose. Parameters ---------- in_ : which input to assign this channel order order : the order to take t...
Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. N.B. this assumes the channels are the first dimension AFTER transpose.
[ "Set", "the", "input", "channel", "order", "for", "e", ".", "g", ".", "RGB", "to", "BGR", "conversion", "as", "needed", "for", "the", "reference", "ImageNet", "model", ".", "N", ".", "B", ".", "this", "assumes", "the", "channels", "are", "the", "first"...
def set_channel_swap(self, in_, order): """ Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. N.B. this assumes the channels are the first dimension AFTER transpose. Parameters ---------- in_ : which input to a...
[ "def", "set_channel_swap", "(", "self", ",", "in_", ",", "order", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "if", "len", "(", "order", ")", "!=", "self", ".", "inputs", "[", "in_", "]", "[", "1", "]", ":", "raise", "Exception", "(", ...
https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/python/caffe/io.py#L203-L219
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextEvent.SetAnnotationLinesAdded
(*args, **kwargs)
return _stc.StyledTextEvent_SetAnnotationLinesAdded(*args, **kwargs)
SetAnnotationLinesAdded(self, int val)
SetAnnotationLinesAdded(self, int val)
[ "SetAnnotationLinesAdded", "(", "self", "int", "val", ")" ]
def SetAnnotationLinesAdded(*args, **kwargs): """SetAnnotationLinesAdded(self, int val)""" return _stc.StyledTextEvent_SetAnnotationLinesAdded(*args, **kwargs)
[ "def", "SetAnnotationLinesAdded", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextEvent_SetAnnotationLinesAdded", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L7098-L7100
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/_custom_op/img2col_impl.py
python
shape28_3
(tik_instance, input_x, res, input_shape, shape_info)
return tik_instance, res
input_shape is ((32, 8, 28, 28, 16), 'float16', (1, 1), (1, 1))
input_shape is ((32, 8, 28, 28, 16), 'float16', (1, 1), (1, 1))
[ "input_shape", "is", "((", "32", "8", "28", "28", "16", ")", "float16", "(", "1", "1", ")", "(", "1", "1", "))" ]
def shape28_3(tik_instance, input_x, res, input_shape, shape_info): """input_shape is ((32, 8, 28, 28, 16), 'float16', (1, 1), (1, 1))""" stride_w, stride_h, filter_w, filter_h, dilation_filter_w, dilation_filter_h = shape_info pad = [0, 0, 0, 0] l1_h, l1_w, jump_stride, repeat_mode = 28, 28, 1, 1 c...
[ "def", "shape28_3", "(", "tik_instance", ",", "input_x", ",", "res", ",", "input_shape", ",", "shape_info", ")", ":", "stride_w", ",", "stride_h", ",", "filter_w", ",", "filter_h", ",", "dilation_filter_w", ",", "dilation_filter_h", "=", "shape_info", "pad", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/_custom_op/img2col_impl.py#L288-L313
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/metrics/python/ops/metric_ops.py
python
streaming_pearson_correlation
(predictions, labels, weights=None, metrics_collections=None, updates_collections=None, name=None)
return pearson_r, update_op
Computes Pearson correlation coefficient between `predictions`, `labels`. The `streaming_pearson_correlation` function delegates to `streaming_covariance` the tracking of three [co]variances: - `streaming_covariance(predictions, labels)`, i.e. covariance - `streaming_covariance(predictions, predictions)`, i.e...
Computes Pearson correlation coefficient between `predictions`, `labels`.
[ "Computes", "Pearson", "correlation", "coefficient", "between", "predictions", "labels", "." ]
def streaming_pearson_correlation(predictions, labels, weights=None, metrics_collections=None, updates_collections=None, name=None): """Computes Pea...
[ "def", "streaming_pearson_correlation", "(", "predictions", ",", "labels", ",", "weights", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ")", ":", "with", "variable_scope", ".", "variable...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/metrics/python/ops/metric_ops.py#L2438-L2513
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Import/App/config_control_design.py
python
msf_curve_check
(cv,)
return FALSE
:param cv :type cv:curve
:param cv :type cv:curve
[ ":", "param", "cv", ":", "type", "cv", ":", "curve" ]
def msf_curve_check(cv,): ''' :param cv :type cv:curve ''' if (SIZEOF(['CONFIG_CONTROL_DESIGN.BOUNDED_CURVE','CONFIG_CONTROL_DESIGN.CONIC','CONFIG_CONTROL_DESIGN.CURVE_REPLICA','CONFIG_CONTROL_DESIGN.LINE','CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D'] * TYPEOF(cv)) > 1): return FALSE else: if ((('CONFIG_CONTRO...
[ "def", "msf_curve_check", "(", "cv", ",", ")", ":", "if", "(", "SIZEOF", "(", "[", "'CONFIG_CONTROL_DESIGN.BOUNDED_CURVE'", ",", "'CONFIG_CONTROL_DESIGN.CONIC'", ",", "'CONFIG_CONTROL_DESIGN.CURVE_REPLICA'", ",", "'CONFIG_CONTROL_DESIGN.LINE'", ",", "'CONFIG_CONTROL_DESIGN.OF...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Import/App/config_control_design.py#L12181-L12219
libfive/libfive
ab5e354cf6fd992f80aaa9432c52683219515c8a
libfive/bind/python/libfive/stdlib/transforms.py
python
shear_x_y
(t, base, height, offset, base_offset=0)
return Shape(stdlib.shear_x_y( args[0].ptr, tvec2(*[a.ptr for a in args[1]]), args[2].ptr, args[3].ptr, args[4].ptr))
Shears a shape on the x axis as a function of y offset = base-offset at base.y offset = offset = base.y + h
Shears a shape on the x axis as a function of y offset = base-offset at base.y offset = offset = base.y + h
[ "Shears", "a", "shape", "on", "the", "x", "axis", "as", "a", "function", "of", "y", "offset", "=", "base", "-", "offset", "at", "base", ".", "y", "offset", "=", "offset", "=", "base", ".", "y", "+", "h" ]
def shear_x_y(t, base, height, offset, base_offset=0): """ Shears a shape on the x axis as a function of y offset = base-offset at base.y offset = offset = base.y + h """ args = [Shape.wrap(t), list([Shape.wrap(i) for i in base]), Shape.wrap(height), Shape.wrap(offset), Shape.wrap(base_offse...
[ "def", "shear_x_y", "(", "t", ",", "base", ",", "height", ",", "offset", ",", "base_offset", "=", "0", ")", ":", "args", "=", "[", "Shape", ".", "wrap", "(", "t", ")", ",", "list", "(", "[", "Shape", ".", "wrap", "(", "i", ")", "for", "i", "i...
https://github.com/libfive/libfive/blob/ab5e354cf6fd992f80aaa9432c52683219515c8a/libfive/bind/python/libfive/stdlib/transforms.py#L226-L237
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/msg/_RouteNetwork.py
python
RouteNetwork.serialize
(self, buff)
serialize message into buffer :param buff: buffer, ``StringIO``
serialize message into buffer :param buff: buffer, ``StringIO``
[ "serialize", "message", "into", "buffer", ":", "param", "buff", ":", "buffer", "StringIO" ]
def serialize(self, buff): """ serialize message into buffer :param buff: buffer, ``StringIO`` """ try: _x = self buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) _x = self.header.frame_id length = len(_x) if python3 or type(_x) ==...
[ "def", "serialize", "(", "self", ",", "buff", ")", ":", "try", ":", "_x", "=", "self", "buff", ".", "write", "(", "_struct_3I", ".", "pack", "(", "_x", ".", "header", ".", "seq", ",", "_x", ".", "header", ".", "stamp", ".", "secs", ",", "_x", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/msg/_RouteNetwork.py#L172-L298
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/ExodusViewer/plugins/FilePlugin.py
python
FilePlugin.updateOptions
(self)
Update the widget based on current selections.
Update the widget based on current selections.
[ "Update", "the", "widget", "based", "on", "current", "selections", "." ]
def updateOptions(self): """ Update the widget based on current selections. """ # Update component widgets index = self.VariableList.currentIndex() data = self.VariableList.itemData(index) if data is None: self.ComponentList.setEnabled(False) e...
[ "def", "updateOptions", "(", "self", ")", ":", "# Update component widgets", "index", "=", "self", ".", "VariableList", ".", "currentIndex", "(", ")", "data", "=", "self", ".", "VariableList", ".", "itemData", "(", "index", ")", "if", "data", "is", "None", ...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/ExodusViewer/plugins/FilePlugin.py#L178-L197
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pty.py
python
_read
(fd)
return os.read(fd, 1024)
Default read function.
Default read function.
[ "Default", "read", "function", "." ]
def _read(fd): """Default read function.""" return os.read(fd, 1024)
[ "def", "_read", "(", "fd", ")", ":", "return", "os", ".", "read", "(", "fd", ",", "1024", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pty.py#L136-L138
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/lib/type_check.py
python
asfarray
(a, dtype=_nx.float_)
return asarray(a,dtype=dtype)
Return an array converted to a float type. Parameters ---------- a : array_like The input array. dtype : str or dtype object, optional Float type code to coerce input array `a`. If `dtype` is one of the 'int' dtypes, it is replaced with float64. Returns ------- out...
Return an array converted to a float type.
[ "Return", "an", "array", "converted", "to", "a", "float", "type", "." ]
def asfarray(a, dtype=_nx.float_): """ Return an array converted to a float type. Parameters ---------- a : array_like The input array. dtype : str or dtype object, optional Float type code to coerce input array `a`. If `dtype` is one of the 'int' dtypes, it is replaced...
[ "def", "asfarray", "(", "a", ",", "dtype", "=", "_nx", ".", "float_", ")", ":", "dtype", "=", "_nx", ".", "obj2sctype", "(", "dtype", ")", "if", "not", "issubclass", "(", "dtype", ",", "_nx", ".", "inexact", ")", ":", "dtype", "=", "_nx", ".", "f...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/type_check.py#L73-L103
apache/arrow
af33dd1157eb8d7d9bfac25ebf61445b793b7943
cpp/build-support/cpplint.py
python
_IncludeState.ResetSection
(self, directive)
Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else").
Reset section checking for preprocessor directive.
[ "Reset", "section", "checking", "for", "preprocessor", "directive", "." ]
def ResetSection(self, directive): """Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else"). """ # The name of the current section. self._section = self._INITIAL_SECTION # The path of last found header. self._last_header = '' ...
[ "def", "ResetSection", "(", "self", ",", "directive", ")", ":", "# The name of the current section.", "self", ".", "_section", "=", "self", ".", "_INITIAL_SECTION", "# The path of last found header.", "self", ".", "_last_header", "=", "''", "# Update list of includes. No...
https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/cpp/build-support/cpplint.py#L853-L869
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/urllib/parse.py
python
urlunparse
(components)
return _coerce_result(urlunsplit((scheme, netloc, url, query, fragment)))
Put a parsed URL back together again. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had redundant delimiters, e.g. a ? with an empty query (the draft states that these are equivalent).
Put a parsed URL back together again. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had redundant delimiters, e.g. a ? with an empty query (the draft states that these are equivalent).
[ "Put", "a", "parsed", "URL", "back", "together", "again", ".", "This", "may", "result", "in", "a", "slightly", "different", "but", "equivalent", "URL", "if", "the", "URL", "that", "was", "parsed", "originally", "had", "redundant", "delimiters", "e", ".", "...
def urlunparse(components): """Put a parsed URL back together again. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had redundant delimiters, e.g. a ? with an empty query (the draft states that these are equivalent).""" scheme, netloc, url, params...
[ "def", "urlunparse", "(", "components", ")", ":", "scheme", ",", "netloc", ",", "url", ",", "params", ",", "query", ",", "fragment", ",", "_coerce_result", "=", "(", "_coerce_args", "(", "*", "components", ")", ")", "if", "params", ":", "url", "=", "\"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/urllib/parse.py#L469-L478
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/xml/sax/xmlreader.py
python
XMLReader.getProperty
(self, name)
Looks up and returns the value of a SAX2 property.
Looks up and returns the value of a SAX2 property.
[ "Looks", "up", "and", "returns", "the", "value", "of", "a", "SAX2", "property", "." ]
def getProperty(self, name): "Looks up and returns the value of a SAX2 property." raise SAXNotRecognizedException("Property '%s' not recognized" % name)
[ "def", "getProperty", "(", "self", ",", "name", ")", ":", "raise", "SAXNotRecognizedException", "(", "\"Property '%s' not recognized\"", "%", "name", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/xml/sax/xmlreader.py#L83-L85
eric612/MobileNet-YOLO
69b4441cb3ec8d553fbdef788ad033e246f901bd
scripts/cpp_lint.py
python
CheckForBadCharacters
(filename, lines, error)
Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that it's possible for this to throw off line numbering if...
Logs an error for each line containing bad characters.
[ "Logs", "an", "error", "for", "each", "line", "containing", "bad", "characters", "." ]
def CheckForBadCharacters(filename, lines, error): """Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that...
[ "def", "CheckForBadCharacters", "(", "filename", ",", "lines", ",", "error", ")", ":", "for", "linenum", ",", "line", "in", "enumerate", "(", "lines", ")", ":", "if", "u'\\ufffd'", "in", "line", ":", "error", "(", "filename", ",", "linenum", ",", "'reada...
https://github.com/eric612/MobileNet-YOLO/blob/69b4441cb3ec8d553fbdef788ad033e246f901bd/scripts/cpp_lint.py#L1487-L1509
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
tools/harness-thci/OpenThread_WpanCtl.py
python
OpenThread_WpanCtl.__setRouterDowngradeThreshold
(self, iThreshold)
set router downgrade threshold Args: iThreshold: the number of active routers on the Thread network partition above which an active router may decide to become a child. Returns: True: successful to set the ROUTER_DOWNGRADE_THRESHO...
set router downgrade threshold
[ "set", "router", "downgrade", "threshold" ]
def __setRouterDowngradeThreshold(self, iThreshold): """set router downgrade threshold Args: iThreshold: the number of active routers on the Thread network partition above which an active router may decide to become a child. Returns: ...
[ "def", "__setRouterDowngradeThreshold", "(", "self", ",", "iThreshold", ")", ":", "print", "(", "'call __setRouterDowngradeThreshold'", ")", "try", ":", "cmd", "=", "self", ".", "wpan_cmd_prefix", "+", "'setprop Thread:RouterDowngradeThreshold %s'", "%", "str", "(", "...
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread_WpanCtl.py#L346-L363
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/printimpl.py
python
print_varargs_impl
(context, builder, sig, args)
return impl_ret_untracked(context, builder, sig.return_type, res)
A entire print() call.
A entire print() call.
[ "A", "entire", "print", "()", "call", "." ]
def print_varargs_impl(context, builder, sig, args): """ A entire print() call. """ pyapi = context.get_python_api(builder) gil = pyapi.gil_ensure() for i, (argtype, argval) in enumerate(zip(sig.args, args)): signature = typing.signature(types.none, argtype) imp = context.get_fu...
[ "def", "print_varargs_impl", "(", "context", ",", "builder", ",", "sig", ",", "args", ")", ":", "pyapi", "=", "context", ".", "get_python_api", "(", "builder", ")", "gil", "=", "pyapi", ".", "gil_ensure", "(", ")", "for", "i", ",", "(", "argtype", ",",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/printimpl.py#L67-L84
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/lib2to3/refactor.py
python
RefactoringTool.parse_block
(self, block, lineno, indent)
return tree
Parses a block into a tree. This is necessary to get correct line number / offset information in the parser diagnostics and embedded into the parse tree.
Parses a block into a tree.
[ "Parses", "a", "block", "into", "a", "tree", "." ]
def parse_block(self, block, lineno, indent): """Parses a block into a tree. This is necessary to get correct line number / offset information in the parser diagnostics and embedded into the parse tree. """ tree = self.driver.parse_tokens(self.wrap_toks(block, lineno, indent)) ...
[ "def", "parse_block", "(", "self", ",", "block", ",", "lineno", ",", "indent", ")", ":", "tree", "=", "self", ".", "driver", ".", "parse_tokens", "(", "self", ".", "wrap_toks", "(", "block", ",", "lineno", ",", "indent", ")", ")", "tree", ".", "futur...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/lib2to3/refactor.py#L628-L636
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py
python
Babyl.get_message
(self, key)
return msg
Return a Message representation or raise a KeyError.
Return a Message representation or raise a KeyError.
[ "Return", "a", "Message", "representation", "or", "raise", "a", "KeyError", "." ]
def get_message(self, key): """Return a Message representation or raise a KeyError.""" start, stop = self._lookup(key) self._file.seek(start) self._file.readline() # Skip '1,' line specifying labels. original_headers = StringIO.StringIO() while True: line = ...
[ "def", "get_message", "(", "self", ",", "key", ")", ":", "start", ",", "stop", "=", "self", ".", "_lookup", "(", "key", ")", "self", ".", "_file", ".", "seek", "(", "start", ")", "self", ".", "_file", ".", "readline", "(", ")", "# Skip '1,' line spec...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L1248-L1271
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
syzygy/scripts/benchmark/optimize.py
python
main
()
return 0
Parses arguments and runs the optimization.
Parses arguments and runs the optimization.
[ "Parses", "arguments", "and", "runs", "the", "optimization", "." ]
def main(): """Parses arguments and runs the optimization.""" opts = _ParseArguments() work_dir = tempfile.mkdtemp(prefix='chrome-instr') _LOGGER.info('Created working directory "%s".', work_dir) try: # We always instrument in calltrace mode to be able to generate a coarse # function layout for the ...
[ "def", "main", "(", ")", ":", "opts", "=", "_ParseArguments", "(", ")", "work_dir", "=", "tempfile", ".", "mkdtemp", "(", "prefix", "=", "'chrome-instr'", ")", "_LOGGER", ".", "info", "(", "'Created working directory \"%s\".'", ",", "work_dir", ")", "try", "...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/syzygy/scripts/benchmark/optimize.py#L295-L330
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/calendar.py
python
HTMLCalendar.formatday
(self, day, weekday)
Return a day as a table cell.
Return a day as a table cell.
[ "Return", "a", "day", "as", "a", "table", "cell", "." ]
def formatday(self, day, weekday): """ Return a day as a table cell. """ if day == 0: # day outside month return '<td class="%s">&nbsp;</td>' % self.cssclass_noday else: return '<td class="%s">%d</td>' % (self.cssclasses[weekday], day)
[ "def", "formatday", "(", "self", ",", "day", ",", "weekday", ")", ":", "if", "day", "==", "0", ":", "# day outside month", "return", "'<td class=\"%s\">&nbsp;</td>'", "%", "self", ".", "cssclass_noday", "else", ":", "return", "'<td class=\"%s\">%d</td>'", "%", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/calendar.py#L436-L444
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/telemetry/core/timeline/thread.py
python
Thread._AddSliceIfBounds
(self, root, child)
return False
Adds a child slice to a root slice its proper row. Return False if the child slice is not in the bounds of the root slice. Because we know that the start time of child is >= the start time of all other slices seen so far, we can just check the last slice of each row for bounding.
Adds a child slice to a root slice its proper row. Return False if the child slice is not in the bounds of the root slice.
[ "Adds", "a", "child", "slice", "to", "a", "root", "slice", "its", "proper", "row", ".", "Return", "False", "if", "the", "child", "slice", "is", "not", "in", "the", "bounds", "of", "the", "root", "slice", "." ]
def _AddSliceIfBounds(self, root, child): ''' Adds a child slice to a root slice its proper row. Return False if the child slice is not in the bounds of the root slice. Because we know that the start time of child is >= the start time of all other slices seen so far, we can just check the last slic...
[ "def", "_AddSliceIfBounds", "(", "self", ",", "root", ",", "child", ")", ":", "# The source trace data is in microseconds but we store it as milliseconds", "# in floating-point. Since we can't represent micros as millis perfectly,", "# two end=start+duration combos that should be the same wi...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/timeline/thread.py#L240-L262
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/swig.py
python
_get_swig_version
(env, swig)
Run the SWIG command line tool to get and return the version number
Run the SWIG command line tool to get and return the version number
[ "Run", "the", "SWIG", "command", "line", "tool", "to", "get", "and", "return", "the", "version", "number" ]
def _get_swig_version(env, swig): """Run the SWIG command line tool to get and return the version number""" swig = env.subst(swig) pipe = SCons.Action._subproc(env, SCons.Util.CLVar(swig) + ['-version'], stdin = 'devnull', stderr = 'devnull',...
[ "def", "_get_swig_version", "(", "env", ",", "swig", ")", ":", "swig", "=", "env", ".", "subst", "(", "swig", ")", "pipe", "=", "SCons", ".", "Action", ".", "_subproc", "(", "env", ",", "SCons", ".", "Util", ".", "CLVar", "(", "swig", ")", "+", "...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/swig.py#L134-L149
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/framework/convert_to_constants.py
python
_Convertible.converted_enclosing_graph
(self)
return self._enclosing_graph.converted_self()
The graph being converted.
The graph being converted.
[ "The", "graph", "being", "converted", "." ]
def converted_enclosing_graph(self): """The graph being converted.""" return self._enclosing_graph.converted_self()
[ "def", "converted_enclosing_graph", "(", "self", ")", ":", "return", "self", ".", "_enclosing_graph", ".", "converted_self", "(", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/convert_to_constants.py#L132-L134
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/ordered_set.py
python
OrderedSet.copy
(self)
return self.__class__(self)
Return a shallow copy of this object. Example: >>> this = OrderedSet([1, 2, 3]) >>> other = this.copy() >>> this == other True >>> this is other False
Return a shallow copy of this object.
[ "Return", "a", "shallow", "copy", "of", "this", "object", "." ]
def copy(self): """ Return a shallow copy of this object. Example: >>> this = OrderedSet([1, 2, 3]) >>> other = this.copy() >>> this == other True >>> this is other False """ return self.__class__(self)
[ "def", "copy", "(", "self", ")", ":", "return", "self", ".", "__class__", "(", "self", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/ordered_set.py#L101-L113
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
TextAttrBorder.GetStyle
(*args, **kwargs)
return _richtext.TextAttrBorder_GetStyle(*args, **kwargs)
GetStyle(self) -> int
GetStyle(self) -> int
[ "GetStyle", "(", "self", ")", "-", ">", "int" ]
def GetStyle(*args, **kwargs): """GetStyle(self) -> int""" return _richtext.TextAttrBorder_GetStyle(*args, **kwargs)
[ "def", "GetStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "TextAttrBorder_GetStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L353-L355
alibaba/graph-learn
54cafee9db3054dc310a28b856be7f97c7d5aee9
graphlearn/python/utils.py
python
strategy2op
(strategy, op_type)
return op
Convert strategy to op.
Convert strategy to op.
[ "Convert", "strategy", "to", "op", "." ]
def strategy2op(strategy, op_type): """ Convert strategy to op. """ op = '' if isinstance(strategy, str): for s in strategy.split('_'): op += s.capitalize() op += op_type return op
[ "def", "strategy2op", "(", "strategy", ",", "op_type", ")", ":", "op", "=", "''", "if", "isinstance", "(", "strategy", ",", "str", ")", ":", "for", "s", "in", "strategy", ".", "split", "(", "'_'", ")", ":", "op", "+=", "s", ".", "capitalize", "(", ...
https://github.com/alibaba/graph-learn/blob/54cafee9db3054dc310a28b856be7f97c7d5aee9/graphlearn/python/utils.py#L34-L42
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/pyserial/serial/serialposix.py
python
Serial.read
(self, size=1)
return bytes(read)
\ Read size bytes from the serial port. If a timeout is set it may return less characters as requested. With no timeout it will block until the requested number of bytes is read.
\ Read size bytes from the serial port. If a timeout is set it may return less characters as requested. With no timeout it will block until the requested number of bytes is read.
[ "\\", "Read", "size", "bytes", "from", "the", "serial", "port", ".", "If", "a", "timeout", "is", "set", "it", "may", "return", "less", "characters", "as", "requested", ".", "With", "no", "timeout", "it", "will", "block", "until", "the", "requested", "num...
def read(self, size=1): """\ Read size bytes from the serial port. If a timeout is set it may return less characters as requested. With no timeout it will block until the requested number of bytes is read. """ if not self.is_open: raise portNotOpenError ...
[ "def", "read", "(", "self", ",", "size", "=", "1", ")", ":", "if", "not", "self", ".", "is_open", ":", "raise", "portNotOpenError", "read", "=", "bytearray", "(", ")", "timeout", "=", "Timeout", "(", "self", ".", "_timeout", ")", "while", "len", "(",...
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/serialposix.py#L471-L518
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/actor/Actor.py
python
Actor.loadAnimsOnAllLODs
(self, anims,partName="modelRoot")
loadAnims(self, string:string{}, string='modelRoot', string='lodRoot') Actor anim loader. Takes an optional partName (defaults to 'modelRoot' for non-multipart actors) and lodName (defaults to 'lodRoot' for non-LOD actors) and dict of corresponding anims in the form animName:anim...
loadAnims(self, string:string{}, string='modelRoot', string='lodRoot') Actor anim loader. Takes an optional partName (defaults to 'modelRoot' for non-multipart actors) and lodName (defaults to 'lodRoot' for non-LOD actors) and dict of corresponding anims in the form animName:anim...
[ "loadAnims", "(", "self", "string", ":", "string", "{}", "string", "=", "modelRoot", "string", "=", "lodRoot", ")", "Actor", "anim", "loader", ".", "Takes", "an", "optional", "partName", "(", "defaults", "to", "modelRoot", "for", "non", "-", "multipart", "...
def loadAnimsOnAllLODs(self, anims,partName="modelRoot"): """loadAnims(self, string:string{}, string='modelRoot', string='lodRoot') Actor anim loader. Takes an optional partName (defaults to 'modelRoot' for non-multipart actors) and lodName (defaults to 'lodRoot' for non-LOD acto...
[ "def", "loadAnimsOnAllLODs", "(", "self", ",", "anims", ",", "partName", "=", "\"modelRoot\"", ")", ":", "if", "self", ".", "mergeLODBundles", ":", "lodNames", "=", "[", "'common'", "]", "else", ":", "lodNames", "=", "self", ".", "__partBundleDict", ".", "...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/actor/Actor.py#L2195-L2214
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
BookCtrlBase.GetInternalBorder
(*args, **kwargs)
return _core_.BookCtrlBase_GetInternalBorder(*args, **kwargs)
GetInternalBorder(self) -> unsigned int
GetInternalBorder(self) -> unsigned int
[ "GetInternalBorder", "(", "self", ")", "-", ">", "unsigned", "int" ]
def GetInternalBorder(*args, **kwargs): """GetInternalBorder(self) -> unsigned int""" return _core_.BookCtrlBase_GetInternalBorder(*args, **kwargs)
[ "def", "GetInternalBorder", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "BookCtrlBase_GetInternalBorder", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L13574-L13576
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/AddonManager/AddonManager.py
python
CommandAddonManager.update_all
(self)
Asynchronously apply all available updates: individual failures are noted, but do not stop other updates
Asynchronously apply all available updates: individual failures are noted, but do not stop other updates
[ "Asynchronously", "apply", "all", "available", "updates", ":", "individual", "failures", "are", "noted", "but", "do", "not", "stop", "other", "updates" ]
def update_all(self) -> None: """Asynchronously apply all available updates: individual failures are noted, but do not stop other updates""" if hasattr(self, "update_all_worker") and self.update_all_worker: if self.update_all_worker.isRunning(): return self.subupdat...
[ "def", "update_all", "(", "self", ")", "->", "None", ":", "if", "hasattr", "(", "self", ",", "\"update_all_worker\"", ")", "and", "self", ".", "update_all_worker", ":", "if", "self", ".", "update_all_worker", ".", "isRunning", "(", ")", ":", "return", "sel...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/AddonManager/AddonManager.py#L1189-L1212
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/_pydecimal.py
python
Context.to_integral_exact
(self, a)
return a.to_integral_exact(context=self)
Rounds to an integer. When the operand has a negative exponent, the result is the same as using the quantize() operation using the given operand as the left-hand-operand, 1E+0 as the right-hand-operand, and the precision of the operand as the precision setting; Inexact and Rounded flags...
Rounds to an integer.
[ "Rounds", "to", "an", "integer", "." ]
def to_integral_exact(self, a): """Rounds to an integer. When the operand has a negative exponent, the result is the same as using the quantize() operation using the given operand as the left-hand-operand, 1E+0 as the right-hand-operand, and the precision of the operand as the p...
[ "def", "to_integral_exact", "(", "self", ",", "a", ")", ":", "a", "=", "_convert_other", "(", "a", ",", "raiseit", "=", "True", ")", "return", "a", ".", "to_integral_exact", "(", "context", "=", "self", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/_pydecimal.py#L5552-L5580
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/Input/InputTreeWriter.py
python
addNode
(parent_hit_node, entry)
Adds a node and its children to the HIT tree. Input: parent_hit_node[hit.Node]: Parent to add children to entry[BlockInfo]: The block to add
Adds a node and its children to the HIT tree. Input: parent_hit_node[hit.Node]: Parent to add children to entry[BlockInfo]: The block to add
[ "Adds", "a", "node", "and", "its", "children", "to", "the", "HIT", "tree", ".", "Input", ":", "parent_hit_node", "[", "hit", ".", "Node", "]", ":", "Parent", "to", "add", "children", "to", "entry", "[", "BlockInfo", "]", ":", "The", "block", "to", "a...
def addNode(parent_hit_node, entry): """ Adds a node and its children to the HIT tree. Input: parent_hit_node[hit.Node]: Parent to add children to entry[BlockInfo]: The block to add """ name = entry.name hit_node = hit.NewSection(name) parent_hit_node.addChild(hit_node) i...
[ "def", "addNode", "(", "parent_hit_node", ",", "entry", ")", ":", "name", "=", "entry", ".", "name", "hit_node", "=", "hit", ".", "NewSection", "(", "name", ")", "parent_hit_node", ".", "addChild", "(", "hit_node", ")", "if", "entry", ".", "comments", ":...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/Input/InputTreeWriter.py#L47-L65
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
resources/web/server/session_server.py
python
send_email
(subject, content)
Send notification email.
Send notification email.
[ "Send", "notification", "email", "." ]
def send_email(subject, content): """Send notification email.""" sender = config['mailSender'] receivers = [config['administrator']] if 'mailServerPort' in config: port = config['mailServerPort'] else: port = 0 message = "From: Simulation Server <" + sender + ">\n" + \ ...
[ "def", "send_email", "(", "subject", ",", "content", ")", ":", "sender", "=", "config", "[", "'mailSender'", "]", "receivers", "=", "[", "config", "[", "'administrator'", "]", "]", "if", "'mailServerPort'", "in", "config", ":", "port", "=", "config", "[", ...
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/resources/web/server/session_server.py#L159-L182
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/google/protobuf/text_format.py
python
_Parser._ConsumeAnyTypeUrl
(self, tokenizer)
return '.'.join(prefix), '.'.join(name)
Consumes a google.protobuf.Any type URL and returns the type name.
Consumes a google.protobuf.Any type URL and returns the type name.
[ "Consumes", "a", "google", ".", "protobuf", ".", "Any", "type", "URL", "and", "returns", "the", "type", "name", "." ]
def _ConsumeAnyTypeUrl(self, tokenizer): """Consumes a google.protobuf.Any type URL and returns the type name.""" # Consume "type.googleapis.com/". prefix = [tokenizer.ConsumeIdentifier()] tokenizer.Consume('.') prefix.append(tokenizer.ConsumeIdentifier()) tokenizer.Consume('.') prefix.appen...
[ "def", "_ConsumeAnyTypeUrl", "(", "self", ",", "tokenizer", ")", ":", "# Consume \"type.googleapis.com/\".", "prefix", "=", "[", "tokenizer", ".", "ConsumeIdentifier", "(", ")", "]", "tokenizer", ".", "Consume", "(", "'.'", ")", "prefix", ".", "append", "(", "...
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/text_format.py#L979-L992
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
build/print_python_deps.py
python
_ComputePythonDependencies
()
return src_paths
Gets the paths of imported non-system python modules. A path is assumed to be a "system" import if it is outside of chromium's src/. The paths will be relative to the current directory.
Gets the paths of imported non-system python modules.
[ "Gets", "the", "paths", "of", "imported", "non", "-", "system", "python", "modules", "." ]
def _ComputePythonDependencies(): """Gets the paths of imported non-system python modules. A path is assumed to be a "system" import if it is outside of chromium's src/. The paths will be relative to the current directory. """ module_paths = (m.__file__ for m in sys.modules.values() if m an...
[ "def", "_ComputePythonDependencies", "(", ")", ":", "module_paths", "=", "(", "m", ".", "__file__", "for", "m", "in", "sys", ".", "modules", ".", "values", "(", ")", "if", "m", "and", "hasattr", "(", "m", ",", "'__file__'", ")", ")", "src_paths", "=", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/print_python_deps.py#L24-L45
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
v8_5_1/tools/grokdump.py
python
InspectionShell.do_km
(self, address)
Teach V8 heap layout information to the inspector. Set the first map-space page by passing any pointer into that page.
Teach V8 heap layout information to the inspector. Set the first map-space page by passing any pointer into that page.
[ "Teach", "V8", "heap", "layout", "information", "to", "the", "inspector", ".", "Set", "the", "first", "map", "-", "space", "page", "by", "passing", "any", "pointer", "into", "that", "page", "." ]
def do_km(self, address): """ Teach V8 heap layout information to the inspector. Set the first map-space page by passing any pointer into that page. """ address = int(address, 16) page_address = address & ~self.heap.PageAlignmentMask() self.padawan.known_first_map_page = page_address
[ "def", "do_km", "(", "self", ",", "address", ")", ":", "address", "=", "int", "(", "address", ",", "16", ")", "page_address", "=", "address", "&", "~", "self", ".", "heap", ".", "PageAlignmentMask", "(", ")", "self", ".", "padawan", ".", "known_first_m...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_5_1/tools/grokdump.py#L3010-L3017
PaddlePaddle/Anakin
5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730
tools/external_converter_v2/parser/onnx/med_graph.py
python
MedGraphUtil._deleteScale
(med_node, med_graph)
delete dropout node when is_test = 0 :param med_node: :param med_graph: :return:
delete dropout node when is_test = 0 :param med_node: :param med_graph: :return:
[ "delete", "dropout", "node", "when", "is_test", "=", "0", ":", "param", "med_node", ":", ":", "param", "med_graph", ":", ":", "return", ":" ]
def _deleteScale(med_node, med_graph): """ delete dropout node when is_test = 0 :param med_node: :param med_graph: :return: """ ak_attr = med_node['ak_attr'] if 'drop' in ak_attr.keys() and ak_attr['drop'] == 0: #not do scale, delete node ...
[ "def", "_deleteScale", "(", "med_node", ",", "med_graph", ")", ":", "ak_attr", "=", "med_node", "[", "'ak_attr'", "]", "if", "'drop'", "in", "ak_attr", ".", "keys", "(", ")", "and", "ak_attr", "[", "'drop'", "]", "==", "0", ":", "#not do scale, delete node...
https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/parser/onnx/med_graph.py#L288-L340
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py
python
_Macro.as_list
(self)
return self._macro
Return the macro as a list.
Return the macro as a list.
[ "Return", "the", "macro", "as", "a", "list", "." ]
def as_list(self): """Return the macro as a list. """ return self._macro
[ "def", "as_list", "(", "self", ")", ":", "return", "self", ".", "_macro" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py#L304-L307
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/mpi_collectives/__init__.py
python
DistributedOptimizer._apply_sparse
(self, *args, **kwargs)
return self._optimizer._apply_sparse(*args, **kwargs)
Calls this same method on the underlying optimizer.
Calls this same method on the underlying optimizer.
[ "Calls", "this", "same", "method", "on", "the", "underlying", "optimizer", "." ]
def _apply_sparse(self, *args, **kwargs): """Calls this same method on the underlying optimizer.""" return self._optimizer._apply_sparse(*args, **kwargs)
[ "def", "_apply_sparse", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_optimizer", ".", "_apply_sparse", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/mpi_collectives/__init__.py#L208-L210
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/logging_ops.py
python
Print
(input_, data, message=None, first_n=None, summarize=None, name=None)
return gen_logging_ops._print(input_, data, message, first_n, summarize, name)
Prints a list of tensors. This is an identity op (behaves like `tf.identity`) with the side effect of printing `data` when evaluating. Note: This op prints to the standard error. It is not currently compatible with jupyter notebook (printing to the notebook *server's* output, not into the notebook). ...
Prints a list of tensors.
[ "Prints", "a", "list", "of", "tensors", "." ]
def Print(input_, data, message=None, first_n=None, summarize=None, name=None): """Prints a list of tensors. This is an identity op (behaves like `tf.identity`) with the side effect of printing `data` when evaluating. Note: This op prints to the standard error. It is not currently compatible with jupyter ...
[ "def", "Print", "(", "input_", ",", "data", ",", "message", "=", "None", ",", "first_n", "=", "None", ",", "summarize", "=", "None", ",", "name", "=", "None", ")", ":", "return", "gen_logging_ops", ".", "_print", "(", "input_", ",", "data", ",", "mes...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/logging_ops.py#L74-L118
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2_PolicySigned_REQUEST.fromTpm
(buf)
return buf.createObj(TPM2_PolicySigned_REQUEST)
Returns new TPM2_PolicySigned_REQUEST object constructed from its marshaled representation in the given TpmBuffer buffer
Returns new TPM2_PolicySigned_REQUEST object constructed from its marshaled representation in the given TpmBuffer buffer
[ "Returns", "new", "TPM2_PolicySigned_REQUEST", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "TpmBuffer", "buffer" ]
def fromTpm(buf): """ Returns new TPM2_PolicySigned_REQUEST object constructed from its marshaled representation in the given TpmBuffer buffer """ return buf.createObj(TPM2_PolicySigned_REQUEST)
[ "def", "fromTpm", "(", "buf", ")", ":", "return", "buf", ".", "createObj", "(", "TPM2_PolicySigned_REQUEST", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L14180-L14184
ucla-vision/xivo
1b97bf5a3124e62bf4920429af5bb91c7a6de876
scripts/tum_rgbd_benchmark_tools/evaluate_rpe.py
python
scale
(a,scalar)
return numpy.array( [[a[0,0], a[0,1], a[0,2], a[0,3]*scalar], [a[1,0], a[1,1], a[1,2], a[1,3]*scalar], [a[2,0], a[2,1], a[2,2], a[2,3]*scalar], [a[3,0], a[3,1], a[3,2], a[3,3]]] )
Scale the translational components of a 4x4 homogeneous matrix by a scale factor.
Scale the translational components of a 4x4 homogeneous matrix by a scale factor.
[ "Scale", "the", "translational", "components", "of", "a", "4x4", "homogeneous", "matrix", "by", "a", "scale", "factor", "." ]
def scale(a,scalar): """ Scale the translational components of a 4x4 homogeneous matrix by a scale factor. """ return numpy.array( [[a[0,0], a[0,1], a[0,2], a[0,3]*scalar], [a[1,0], a[1,1], a[1,2], a[1,3]*scalar], [a[2,0], a[2,1], a[2,2], a[2,3]*scalar], [a[3,0], a[3,1...
[ "def", "scale", "(", "a", ",", "scalar", ")", ":", "return", "numpy", ".", "array", "(", "[", "[", "a", "[", "0", ",", "0", "]", ",", "a", "[", "0", ",", "1", "]", ",", "a", "[", "0", ",", "2", "]", ",", "a", "[", "0", ",", "3", "]", ...
https://github.com/ucla-vision/xivo/blob/1b97bf5a3124e62bf4920429af5bb91c7a6de876/scripts/tum_rgbd_benchmark_tools/evaluate_rpe.py#L155-L164
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/special-binary-string.py
python
Solution.makeLargestSpecial
(self, S)
return "".join(result)
:type S: str :rtype: str
:type S: str :rtype: str
[ ":", "type", "S", ":", "str", ":", "rtype", ":", "str" ]
def makeLargestSpecial(self, S): """ :type S: str :rtype: str """ result = [] anchor = count = 0 for i, v in enumerate(S): count += 1 if v == '1' else -1 if count == 0: result.append("1{}0".format(self.makeLargestSpecial(S[a...
[ "def", "makeLargestSpecial", "(", "self", ",", "S", ")", ":", "result", "=", "[", "]", "anchor", "=", "count", "=", "0", "for", "i", ",", "v", "in", "enumerate", "(", "S", ")", ":", "count", "+=", "1", "if", "v", "==", "'1'", "else", "-", "1", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/special-binary-string.py#L6-L19
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
GridTableBase.SetValue
(*args, **kwargs)
return _grid.GridTableBase_SetValue(*args, **kwargs)
SetValue(self, int row, int col, String value)
SetValue(self, int row, int col, String value)
[ "SetValue", "(", "self", "int", "row", "int", "col", "String", "value", ")" ]
def SetValue(*args, **kwargs): """SetValue(self, int row, int col, String value)""" return _grid.GridTableBase_SetValue(*args, **kwargs)
[ "def", "SetValue", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridTableBase_SetValue", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L818-L820
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/metrics_impl.py
python
_remove_squeezable_dimensions
(predictions, labels, weights)
return predictions, labels, weights
Squeeze or expand last dim if needed. Squeezes last dim of `predictions` or `labels` if their rank differs by 1 (using confusion_matrix.remove_squeezable_dimensions). Squeezes or expands last dim of `weights` if its rank differs by 1 from the new rank of `predictions`. If `weights` is scalar, it is kept sca...
Squeeze or expand last dim if needed.
[ "Squeeze", "or", "expand", "last", "dim", "if", "needed", "." ]
def _remove_squeezable_dimensions(predictions, labels, weights): """Squeeze or expand last dim if needed. Squeezes last dim of `predictions` or `labels` if their rank differs by 1 (using confusion_matrix.remove_squeezable_dimensions). Squeezes or expands last dim of `weights` if its rank differs by 1 from the ...
[ "def", "_remove_squeezable_dimensions", "(", "predictions", ",", "labels", ",", "weights", ")", ":", "predictions", "=", "ops", ".", "convert_to_tensor", "(", "predictions", ")", "if", "labels", "is", "not", "None", ":", "labels", ",", "predictions", "=", "con...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/metrics_impl.py#L84-L157
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
NewFileProperty
(*args, **kwargs)
return _propgrid.NewFileProperty(*args, **kwargs)
NewFileProperty(String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL), String value=wxEmptyString) -> PGProperty
NewFileProperty(String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL), String value=wxEmptyString) -> PGProperty
[ "NewFileProperty", "(", "String", "label", "=", "(", "*", "wxPGProperty", "::", "sm_wxPG_LABEL", ")", "String", "name", "=", "(", "*", "wxPGProperty", "::", "sm_wxPG_LABEL", ")", "String", "value", "=", "wxEmptyString", ")", "-", ">", "PGProperty" ]
def NewFileProperty(*args, **kwargs): """ NewFileProperty(String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL), String value=wxEmptyString) -> PGProperty """ return _propgrid.NewFileProperty(*args, **kwargs)
[ "def", "NewFileProperty", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "NewFileProperty", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L3727-L3732
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/PyChop2.py
python
PyChop2.calculate
(cls, *args, **kwargs)
return obj.getResolution(etrans), obj.getFlux()
! Calculates the resolution and flux directly (without setting up a PyChop2 object) ! ! PyChop2.calculate('mari', 's', 250., 55.) # Instname, Chopper Type, Freq, Ei in order ! PyChop2.calculate('let', 180, 2.2) # For LET, chopper type is not needed. ! PyChop2.calculate('...
! Calculates the resolution and flux directly (without setting up a PyChop2 object) ! ! PyChop2.calculate('mari', 's', 250., 55.) # Instname, Chopper Type, Freq, Ei in order ! PyChop2.calculate('let', 180, 2.2) # For LET, chopper type is not needed. ! PyChop2.calculate('...
[ "!", "Calculates", "the", "resolution", "and", "flux", "directly", "(", "without", "setting", "up", "a", "PyChop2", "object", ")", "!", "!", "PyChop2", ".", "calculate", "(", "mari", "s", "250", ".", "55", ".", ")", "#", "Instname", "Chopper", "Type", ...
def calculate(cls, *args, **kwargs): """ ! Calculates the resolution and flux directly (without setting up a PyChop2 object) ! ! PyChop2.calculate('mari', 's', 250., 55.) # Instname, Chopper Type, Freq, Ei in order ! PyChop2.calculate('let', 180, 2.2) # For LET, ...
[ "def", "calculate", "(", "cls", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "len", "(", "args", ")", ">", "0", ":", "if", "not", "isinstance", "(", "args", "[", "0", "]", ",", "str", ")", ":", "raise", "ValueError", "(", "'The fi...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/PyChop2.py#L186-L254
Ewenwan/MVision
97b394dfa48cb21c82cd003b1a952745e413a17f
deepLearning/06_rbm.py
python
RBM.propdown
(self, h)
return tf.nn.sigmoid(tf.matmul(h, tf.transpose(self.W)) + self.vbias)
Compute the sigmoid activation for visible units given hidden units
Compute the sigmoid activation for visible units given hidden units
[ "Compute", "the", "sigmoid", "activation", "for", "visible", "units", "given", "hidden", "units" ]
def propdown(self, h): """Compute the sigmoid activation for visible units given hidden units""" return tf.nn.sigmoid(tf.matmul(h, tf.transpose(self.W)) + self.vbias)
[ "def", "propdown", "(", "self", ",", "h", ")", ":", "return", "tf", ".", "nn", ".", "sigmoid", "(", "tf", ".", "matmul", "(", "h", ",", "tf", ".", "transpose", "(", "self", ".", "W", ")", ")", "+", "self", ".", "vbias", ")" ]
https://github.com/Ewenwan/MVision/blob/97b394dfa48cb21c82cd003b1a952745e413a17f/deepLearning/06_rbm.py#L50-L52
kmatheussen/radium
90f113f2df1d63b987a0106be3bb09ab2ab8c233
bin/import_mod.py
python
read_trackline
(file, pattern, tracknum, linenum, pos)
from http://www.aes.id.au/modformat.html : 7654-3210 7654-3210 7654-3210 7654-3210 wwww xxxxxxxxxxxxxx yyyy zzzzzzzzzzzzzz wwwwyyyy (8 bits) is the sample for this channel/division xxxxxxxxxxxx (12 bits) is the sample's period (or effect parameter) zzzzzzzzzzzz (12 bits) is the effect for this cha...
from http://www.aes.id.au/modformat.html :
[ "from", "http", ":", "//", "www", ".", "aes", ".", "id", ".", "au", "/", "modformat", ".", "html", ":" ]
def read_trackline(file, pattern, tracknum, linenum, pos): ''' from http://www.aes.id.au/modformat.html : 7654-3210 7654-3210 7654-3210 7654-3210 wwww xxxxxxxxxxxxxx yyyy zzzzzzzzzzzzzz wwwwyyyy (8 bits) is the sample for this channel/division xxxxxxxxxxxx (12 bits) is the sample's period (or ...
[ "def", "read_trackline", "(", "file", ",", "pattern", ",", "tracknum", ",", "linenum", ",", "pos", ")", ":", "byte1", "=", "read_uint8", "(", "file", ",", "pos", ")", "byte2", "=", "read_uint8", "(", "file", ",", "pos", "+", "1", ")", "byte3", "=", ...
https://github.com/kmatheussen/radium/blob/90f113f2df1d63b987a0106be3bb09ab2ab8c233/bin/import_mod.py#L1282-L1349
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/module/bucketing_module.py
python
BucketingModule.set_params
(self, arg_params, aux_params, allow_missing=False, force_init=True, allow_extra=False)
Assigns parameters and aux state values. Parameters ---------- arg_params : dict Dictionary of name to value (`NDArray`) mapping. aux_params : dict Dictionary of name to value (`NDArray`) mapping. allow_missing : bool If true, params could con...
Assigns parameters and aux state values.
[ "Assigns", "parameters", "and", "aux", "state", "values", "." ]
def set_params(self, arg_params, aux_params, allow_missing=False, force_init=True, allow_extra=False): """Assigns parameters and aux state values. Parameters ---------- arg_params : dict Dictionary of name to value (`NDArray`) mapping. aux_params :...
[ "def", "set_params", "(", "self", ",", "arg_params", ",", "aux_params", ",", "allow_missing", "=", "False", ",", "force_init", "=", "True", ",", "allow_extra", "=", "False", ")", ":", "if", "not", "allow_missing", ":", "self", ".", "init_params", "(", "ini...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/module/bucketing_module.py#L179-L220
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/idlelib/sidebar.py
python
BaseSideBar.redirect_yscroll_event
(self, *args, **kwargs)
return 'break'
Redirect vertical scrolling to the main editor text widget. The scroll bar is also updated.
Redirect vertical scrolling to the main editor text widget.
[ "Redirect", "vertical", "scrolling", "to", "the", "main", "editor", "text", "widget", "." ]
def redirect_yscroll_event(self, *args, **kwargs): """Redirect vertical scrolling to the main editor text widget. The scroll bar is also updated. """ self.editwin.vbar.set(*args) self.sidebar_text.yview_moveto(args[0]) return 'break'
[ "def", "redirect_yscroll_event", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "editwin", ".", "vbar", ".", "set", "(", "*", "args", ")", "self", ".", "sidebar_text", ".", "yview_moveto", "(", "args", "[", "0", "]", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/sidebar.py#L94-L101
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/story/shared_state.py
python
SharedState.DidRunStory
(self, results)
Override to do any action after running each of all stories that share this same state. This method is styled on unittest.TestCase.tearDown.
Override to do any action after running each of all stories that share this same state. This method is styled on unittest.TestCase.tearDown.
[ "Override", "to", "do", "any", "action", "after", "running", "each", "of", "all", "stories", "that", "share", "this", "same", "state", ".", "This", "method", "is", "styled", "on", "unittest", ".", "TestCase", ".", "tearDown", "." ]
def DidRunStory(self, results): """ Override to do any action after running each of all stories that share this same state. This method is styled on unittest.TestCase.tearDown. """ raise NotImplementedError()
[ "def", "DidRunStory", "(", "self", ",", "results", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/story/shared_state.py#L38-L43
apache/arrow
af33dd1157eb8d7d9bfac25ebf61445b793b7943
cpp/build-support/cpplint.py
python
ProcessFile
(filename, vlevel, extra_check_functions=None)
Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An array of additional check functions that will be ...
Does google-lint on a single file.
[ "Does", "google", "-", "lint", "on", "a", "single", "file", "." ]
def ProcessFile(filename, vlevel, extra_check_functions=None): """Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An ...
[ "def", "ProcessFile", "(", "filename", ",", "vlevel", ",", "extra_check_functions", "=", "None", ")", ":", "_SetVerboseLevel", "(", "vlevel", ")", "_BackupFilters", "(", ")", "if", "not", "ProcessConfigOverrides", "(", "filename", ")", ":", "_RestoreFilters", "(...
https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/cpp/build-support/cpplint.py#L6203-L6288
dmtcp/dmtcp
48a23686e1ce6784829b783ced9c62a14d620507
util/cpplint.py
python
CheckSpacingForFunctionCall
(filename, clean_lines, linenum, error)
Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for the correctness of various spacing around function calls.
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "around", "function", "calls", "." ]
def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error): """Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: T...
[ "def", "CheckSpacingForFunctionCall", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Since function calls often occur inside if/for/while/switch", "# expressions - which have th...
https://github.com/dmtcp/dmtcp/blob/48a23686e1ce6784829b783ced9c62a14d620507/util/cpplint.py#L2843-L2917
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
external_tools/ply_info/example/ansic/clex.py
python
t_comment
(t)
r'/\*(.|\n)*?\*/
r'/\*(.|\n)*?\*/
[ "r", "/", "\\", "*", "(", ".", "|", "\\", "n", ")", "*", "?", "\\", "*", "/" ]
def t_comment(t): r'/\*(.|\n)*?\*/' t.lexer.lineno += t.value.count('\n')
[ "def", "t_comment", "(", "t", ")", ":", "t", ".", "lexer", ".", "lineno", "+=", "t", ".", "value", ".", "count", "(", "'\\n'", ")" ]
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/clex.py#L144-L146
synfig/synfig
a5ec91db5b751dc12e4400ccfb5c063fd6d2d928
synfig-studio/plugins/lottie-exporter/common/WidthPointList.py
python
WidthPointList.get_list_at_frame_2
(self, fr)
return wplist
Returns list of WidthPoint's at a particular frame
Returns list of WidthPoint's at a particular frame
[ "Returns", "list", "of", "WidthPoint", "s", "at", "a", "particular", "frame" ]
def get_list_at_frame_2(self, fr): """ Returns list of WidthPoint's at a particular frame """ wplist = [] for entry in self.get_entry_list(): pos = entry["position"].get_value(fr) pos = to_Synfig_axis(pos, "real") width = entry["width"].get_val...
[ "def", "get_list_at_frame_2", "(", "self", ",", "fr", ")", ":", "wplist", "=", "[", "]", "for", "entry", "in", "self", ".", "get_entry_list", "(", ")", ":", "pos", "=", "entry", "[", "\"position\"", "]", ".", "get_value", "(", "fr", ")", "pos", "=", ...
https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/common/WidthPointList.py#L116-L141
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/handlers.py
python
KickOffJobHandler._check_mr_state
(cls, state, mr_id)
return True
Check MapreduceState. Args: state: an MapreduceState instance. mr_id: mapreduce id. Returns: True if state is valid. False if not and this task should be dropped.
Check MapreduceState.
[ "Check", "MapreduceState", "." ]
def _check_mr_state(cls, state, mr_id): """Check MapreduceState. Args: state: an MapreduceState instance. mr_id: mapreduce id. Returns: True if state is valid. False if not and this task should be dropped. """ if state is None: logging.warning( "Mapreduce State fo...
[ "def", "_check_mr_state", "(", "cls", ",", "state", ",", "mr_id", ")", ":", "if", "state", "is", "None", ":", "logging", ".", "warning", "(", "\"Mapreduce State for job %s is missing. Dropping Task.\"", ",", "mr_id", ")", "return", "False", "if", "not", "state",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/handlers.py#L1582-L1602
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/experimental/vqs/io.py
python
variables_from_file
(filename: str, variables: _PyTree)
Loads the variables of a variational state from a `.mpack` file. Args: filename: the file containing the variables. Assumes a .mpack extension and adds it if missing and no file exists. variables: An object variables with the same structure and shape of the object to be dese...
Loads the variables of a variational state from a `.mpack` file.
[ "Loads", "the", "variables", "of", "a", "variational", "state", "from", "a", ".", "mpack", "file", "." ]
def variables_from_file(filename: str, variables: _PyTree): """ Loads the variables of a variational state from a `.mpack` file. Args: filename: the file containing the variables. Assumes a .mpack extension and adds it if missing and no file exists. variables: An object variable...
[ "def", "variables_from_file", "(", "filename", ":", "str", ",", "variables", ":", "_PyTree", ")", ":", "if", "not", "_path", ".", "isfile", "(", "filename", ")", ":", "if", "filename", "[", "-", "6", ":", "]", "!=", "\".mpack\"", ":", "filename", "=", ...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/experimental/vqs/io.py#L22-L67
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/application.py
python
IApplicationStream.Write
(self, Text)
Writes data to stream. @param Text: Data to send. @type Text: unicode
Writes data to stream.
[ "Writes", "data", "to", "stream", "." ]
def Write(self, Text): '''Writes data to stream. @param Text: Data to send. @type Text: unicode ''' self._Application._Alter('WRITE', '%s %s' % (self._Handle, Text))
[ "def", "Write", "(", "self", ",", "Text", ")", ":", "self", ".", "_Application", ".", "_Alter", "(", "'WRITE'", ",", "'%s %s'", "%", "(", "self", ".", "_Handle", ",", "Text", ")", ")" ]
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/application.py#L177-L183
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/instance.py
python
Instance.start
(self, dry_run=False)
Start the instance.
Start the instance.
[ "Start", "the", "instance", "." ]
def start(self, dry_run=False): """ Start the instance. """ rs = self.connection.start_instances([self.id], dry_run=dry_run) if len(rs) > 0: self._update(rs[0])
[ "def", "start", "(", "self", ",", "dry_run", "=", "False", ")", ":", "rs", "=", "self", ".", "connection", ".", "start_instances", "(", "[", "self", ".", "id", "]", ",", "dry_run", "=", "dry_run", ")", "if", "len", "(", "rs", ")", ">", "0", ":", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/instance.py#L445-L451
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/dataview.py
python
DataViewCtrl.AppendToggleColumn
(*args, **kwargs)
return _dataview.DataViewCtrl_AppendToggleColumn(*args, **kwargs)
AppendToggleColumn(self, PyObject label_or_bitmap, unsigned int model_column, int mode=DATAVIEW_CELL_INERT, int width=DVC_TOGGLE_DEFAULT_WIDTH, int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
AppendToggleColumn(self, PyObject label_or_bitmap, unsigned int model_column, int mode=DATAVIEW_CELL_INERT, int width=DVC_TOGGLE_DEFAULT_WIDTH, int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
[ "AppendToggleColumn", "(", "self", "PyObject", "label_or_bitmap", "unsigned", "int", "model_column", "int", "mode", "=", "DATAVIEW_CELL_INERT", "int", "width", "=", "DVC_TOGGLE_DEFAULT_WIDTH", "int", "align", "=", "ALIGN_CENTER", "int", "flags", "=", "DATAVIEW_COL_RESIZ...
def AppendToggleColumn(*args, **kwargs): """ AppendToggleColumn(self, PyObject label_or_bitmap, unsigned int model_column, int mode=DATAVIEW_CELL_INERT, int width=DVC_TOGGLE_DEFAULT_WIDTH, int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn ...
[ "def", "AppendToggleColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewCtrl_AppendToggleColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L1655-L1662
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/asyncio/sslproto.py
python
_SSLProtocolTransport.get_extra_info
(self, name, default=None)
return self._ssl_protocol._get_extra_info(name, default)
Get optional transport information.
Get optional transport information.
[ "Get", "optional", "transport", "information", "." ]
def get_extra_info(self, name, default=None): """Get optional transport information.""" return self._ssl_protocol._get_extra_info(name, default)
[ "def", "get_extra_info", "(", "self", ",", "name", ",", "default", "=", "None", ")", ":", "return", "self", ".", "_ssl_protocol", ".", "_get_extra_info", "(", "name", ",", "default", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/sslproto.py#L295-L297
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/centre_finder.py
python
PositionProviderXY.get_coord1_for_output_with_correct_scaling_and_offset
(self, coord1)
return coord1
Get the coordinate with the correct scaling @param coord1: first coordinate in m @returns the first coordinate in m
Get the coordinate with the correct scaling
[ "Get", "the", "coordinate", "with", "the", "correct", "scaling" ]
def get_coord1_for_output_with_correct_scaling_and_offset(self, coord1): ''' Get the coordinate with the correct scaling @param coord1: first coordinate in m @returns the first coordinate in m ''' return coord1
[ "def", "get_coord1_for_output_with_correct_scaling_and_offset", "(", "self", ",", "coord1", ")", ":", "return", "coord1" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/centre_finder.py#L637-L643
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Script/SConscript.py
python
SConsEnvironment.EnsureSConsVersion
(self, major, minor, revision=0)
Exit abnormally if the SCons version is not late enough.
Exit abnormally if the SCons version is not late enough.
[ "Exit", "abnormally", "if", "the", "SCons", "version", "is", "not", "late", "enough", "." ]
def EnsureSConsVersion(self, major, minor, revision=0): """Exit abnormally if the SCons version is not late enough.""" # split string to avoid replacement during build process if SCons.__version__ == '__' + 'VERSION__': SCons.Warnings.warn(SCons.Warnings.DevelopmentVersionWarning, ...
[ "def", "EnsureSConsVersion", "(", "self", ",", "major", ",", "minor", ",", "revision", "=", "0", ")", ":", "# split string to avoid replacement during build process", "if", "SCons", ".", "__version__", "==", "'__'", "+", "'VERSION__'", ":", "SCons", ".", "Warnings...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Script/SConscript.py#L485-L500
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/reduction_gui/reduction/diffraction/diffraction_run_setup_script.py
python
RunSetupScript.buildParameterDict
(self)
return pardict
Create a dictionary for parameter and parameter values for SNSPowderReductionPlus()
Create a dictionary for parameter and parameter values for SNSPowderReductionPlus()
[ "Create", "a", "dictionary", "for", "parameter", "and", "parameter", "values", "for", "SNSPowderReductionPlus", "()" ]
def buildParameterDict(self): """ Create a dictionary for parameter and parameter values for SNSPowderReductionPlus() """ pardict = {} pardict['RunNumber'] = str(self.runnumbers) pardict['Sum'] = str(int(self.dosum)) pardict['CalibrationFile'] = self.calibfilename ...
[ "def", "buildParameterDict", "(", "self", ")", ":", "pardict", "=", "{", "}", "pardict", "[", "'RunNumber'", "]", "=", "str", "(", "self", ".", "runnumbers", ")", "pardict", "[", "'Sum'", "]", "=", "str", "(", "int", "(", "self", ".", "dosum", ")", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/diffraction/diffraction_run_setup_script.py#L87-L123
jackaudio/jack2
21b293dbc37d42446141a08922cdec0d2550c6a0
waflib/Task.py
python
Task.sig_explicit_deps
(self)
Used by :py:meth:`waflib.Task.Task.signature`; it hashes :py:attr:`waflib.Task.Task.inputs` and :py:attr:`waflib.Task.Task.dep_nodes` signatures.
Used by :py:meth:`waflib.Task.Task.signature`; it hashes :py:attr:`waflib.Task.Task.inputs` and :py:attr:`waflib.Task.Task.dep_nodes` signatures.
[ "Used", "by", ":", "py", ":", "meth", ":", "waflib", ".", "Task", ".", "Task", ".", "signature", ";", "it", "hashes", ":", "py", ":", "attr", ":", "waflib", ".", "Task", ".", "Task", ".", "inputs", "and", ":", "py", ":", "attr", ":", "waflib", ...
def sig_explicit_deps(self): """ Used by :py:meth:`waflib.Task.Task.signature`; it hashes :py:attr:`waflib.Task.Task.inputs` and :py:attr:`waflib.Task.Task.dep_nodes` signatures. """ bld = self.generator.bld upd = self.m.update # the inputs for x in self.inputs + self.dep_nodes: upd(x.get_bld_sig())...
[ "def", "sig_explicit_deps", "(", "self", ")", ":", "bld", "=", "self", ".", "generator", ".", "bld", "upd", "=", "self", ".", "m", ".", "update", "# the inputs", "for", "x", "in", "self", ".", "inputs", "+", "self", ".", "dep_nodes", ":", "upd", "(",...
https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Task.py#L723-L750
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/nocompile_driver.py
python
ValidateInput
(parallelism, sourcefile_path, cflags, resultfile_path)
Make sure the arguments being passed in are sane.
Make sure the arguments being passed in are sane.
[ "Make", "sure", "the", "arguments", "being", "passed", "in", "are", "sane", "." ]
def ValidateInput(parallelism, sourcefile_path, cflags, resultfile_path): """Make sure the arguments being passed in are sane.""" assert parallelism >= 1 assert type(sourcefile_path) is str assert type(cflags) is str assert type(resultfile_path) is str
[ "def", "ValidateInput", "(", "parallelism", ",", "sourcefile_path", ",", "cflags", ",", "resultfile_path", ")", ":", "assert", "parallelism", ">=", "1", "assert", "type", "(", "sourcefile_path", ")", "is", "str", "assert", "type", "(", "cflags", ")", "is", "...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/nocompile_driver.py#L87-L92
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.ComputeOutputFileName
(self, spec, type=None)
Compute the filename of the final output for the current target.
Compute the filename of the final output for the current target.
[ "Compute", "the", "filename", "of", "the", "final", "output", "for", "the", "current", "target", "." ]
def ComputeOutputFileName(self, spec, type=None): """Compute the filename of the final output for the current target.""" if not type: type = spec['type'] default_variables = copy.copy(generator_default_variables) CalculateVariables(default_variables, {'flavor': self.flavor}) # Compute filena...
[ "def", "ComputeOutputFileName", "(", "self", ",", "spec", ",", "type", "=", "None", ")", ":", "if", "not", "type", ":", "type", "=", "spec", "[", "'type'", "]", "default_variables", "=", "copy", ".", "copy", "(", "generator_default_variables", ")", "Calcul...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/generator/ninja.py#L1048-L1096
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/joblib/joblib/_store_backends.py
python
StoreBackendBase.clear_location
(self, location)
Clears a location on the store. Parameters ---------- location: string The location in the store. On a filesystem, this corresponds to a directory or a filename absolute path
Clears a location on the store.
[ "Clears", "a", "location", "on", "the", "store", "." ]
def clear_location(self, location): """Clears a location on the store. Parameters ---------- location: string The location in the store. On a filesystem, this corresponds to a directory or a filename absolute path """
[ "def", "clear_location", "(", "self", ",", "location", ")", ":" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/_store_backends.py#L101-L109
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
GetOsVersion
(*args)
return _misc_.GetOsVersion(*args)
GetOsVersion() -> (platform, major, minor)
GetOsVersion() -> (platform, major, minor)
[ "GetOsVersion", "()", "-", ">", "(", "platform", "major", "minor", ")" ]
def GetOsVersion(*args): """GetOsVersion() -> (platform, major, minor)""" return _misc_.GetOsVersion(*args)
[ "def", "GetOsVersion", "(", "*", "args", ")", ":", "return", "_misc_", ".", "GetOsVersion", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L336-L338
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/evtmgr.py
python
EventMacroInfo.getEventTypes
(self, eventMacro)
return eventMacro.evtType
Return the list of event types that the given macro corresponds to.
Return the list of event types that the given macro corresponds to.
[ "Return", "the", "list", "of", "event", "types", "that", "the", "given", "macro", "corresponds", "to", "." ]
def getEventTypes(self, eventMacro): """ Return the list of event types that the given macro corresponds to. """ return eventMacro.evtType
[ "def", "getEventTypes", "(", "self", ",", "eventMacro", ")", ":", "return", "eventMacro", ".", "evtType" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/evtmgr.py#L321-L326
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/distributions/python/ops/operator_pd.py
python
_flip_matrix_to_vector_dynamic
(mat, batch_shape)
return vector
Flip matrix to vector with dynamic shapes.
Flip matrix to vector with dynamic shapes.
[ "Flip", "matrix", "to", "vector", "with", "dynamic", "shapes", "." ]
def _flip_matrix_to_vector_dynamic(mat, batch_shape): """Flip matrix to vector with dynamic shapes.""" mat_rank = array_ops.rank(mat) k = array_ops.gather(array_ops.shape(mat), mat_rank - 2) final_shape = array_ops.concat((batch_shape, [k]), 0) # mat.shape = matrix_batch_shape + [k, M] # Permutation corres...
[ "def", "_flip_matrix_to_vector_dynamic", "(", "mat", ",", "batch_shape", ")", ":", "mat_rank", "=", "array_ops", ".", "rank", "(", "mat", ")", "k", "=", "array_ops", ".", "gather", "(", "array_ops", ".", "shape", "(", "mat", ")", ",", "mat_rank", "-", "2...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/distributions/python/ops/operator_pd.py#L702-L713
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PGArrayStringEditorDialog.__init__
(self, *args, **kwargs)
__init__(self) -> PGArrayStringEditorDialog
__init__(self) -> PGArrayStringEditorDialog
[ "__init__", "(", "self", ")", "-", ">", "PGArrayStringEditorDialog" ]
def __init__(self, *args, **kwargs): """__init__(self) -> PGArrayStringEditorDialog""" _propgrid.PGArrayStringEditorDialog_swiginit(self,_propgrid.new_PGArrayStringEditorDialog(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_propgrid", ".", "PGArrayStringEditorDialog_swiginit", "(", "self", ",", "_propgrid", ".", "new_PGArrayStringEditorDialog", "(", "*", "args", ",", "*", "*", "kwargs", ")", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L3239-L3241
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/feature_column/feature_column.py
python
_IdentityCategoricalColumn._num_buckets
(self)
return self.num_buckets
Returns number of buckets in this sparse feature.
Returns number of buckets in this sparse feature.
[ "Returns", "number", "of", "buckets", "in", "this", "sparse", "feature", "." ]
def _num_buckets(self): """Returns number of buckets in this sparse feature.""" return self.num_buckets
[ "def", "_num_buckets", "(", "self", ")", ":", "return", "self", ".", "num_buckets" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/feature_column/feature_column.py#L2218-L2220
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
BookCtrlBase.GetSelection
(*args, **kwargs)
return _core_.BookCtrlBase_GetSelection(*args, **kwargs)
GetSelection(self) -> int
GetSelection(self) -> int
[ "GetSelection", "(", "self", ")", "-", ">", "int" ]
def GetSelection(*args, **kwargs): """GetSelection(self) -> int""" return _core_.BookCtrlBase_GetSelection(*args, **kwargs)
[ "def", "GetSelection", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "BookCtrlBase_GetSelection", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L13550-L13552
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
third-party/benchmark/tools/gbench/report.py
python
calculate_change
(old_val, new_val)
return float(new_val - old_val) / abs(old_val)
Return a float representing the decimal change between old_val and new_val.
Return a float representing the decimal change between old_val and new_val.
[ "Return", "a", "float", "representing", "the", "decimal", "change", "between", "old_val", "and", "new_val", "." ]
def calculate_change(old_val, new_val): """ Return a float representing the decimal change between old_val and new_val. """ if old_val == 0 and new_val == 0: return 0.0 if old_val == 0: return float(new_val - old_val) / (float(old_val + new_val) / 2) return float(new_val - old_va...
[ "def", "calculate_change", "(", "old_val", ",", "new_val", ")", ":", "if", "old_val", "==", "0", "and", "new_val", "==", "0", ":", "return", "0.0", "if", "old_val", "==", "0", ":", "return", "float", "(", "new_val", "-", "old_val", ")", "/", "(", "fl...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/third-party/benchmark/tools/gbench/report.py#L75-L83
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/reduce_prod.py
python
_reduce_prod_tbe
()
return
ReduceProd TBE register
ReduceProd TBE register
[ "ReduceProd", "TBE", "register" ]
def _reduce_prod_tbe(): """ReduceProd TBE register""" return
[ "def", "_reduce_prod_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/reduce_prod.py#L40-L42
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2_Shutdown_REQUEST.initFromTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def initFromTpm(self, buf): """ TpmMarshaller method """ self.shutdownType = buf.readShort()
[ "def", "initFromTpm", "(", "self", ",", "buf", ")", ":", "self", ".", "shutdownType", "=", "buf", ".", "readShort", "(", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L9104-L9106
lilypond/lilypond
2a14759372979f5b796ee802b0ee3bc15d28b06b
scripts/musicxml2ly.py
python
get_all_lyric_parts_in_voice
(voice)
return all_lyric_parts
r''' Collect the indexes of all lyric parts in this voice. In case not all of the current lyric parts are active (a typical case would be a refrain/chorus), the current implementation inserts \skip-commands in the inactive parts to keep them in sync.
r''' Collect the indexes of all lyric parts in this voice. In case not all of the current lyric parts are active (a typical case would be a refrain/chorus), the current implementation inserts \skip-commands in the inactive parts to keep them in sync.
[ "r", "Collect", "the", "indexes", "of", "all", "lyric", "parts", "in", "this", "voice", ".", "In", "case", "not", "all", "of", "the", "current", "lyric", "parts", "are", "active", "(", "a", "typical", "case", "would", "be", "a", "refrain", "/", "chorus...
def get_all_lyric_parts_in_voice(voice): r''' Collect the indexes of all lyric parts in this voice. In case not all of the current lyric parts are active (a typical case would be a refrain/chorus), the current implementation inserts \skip-commands in the inactive parts to keep them in sync. ''' ...
[ "def", "get_all_lyric_parts_in_voice", "(", "voice", ")", ":", "all_lyric_parts", "=", "[", "]", "for", "elem", "in", "voice", ".", "_elements", ":", "lyrics", "=", "elem", ".", "get_typed_children", "(", "musicxml", ".", "Lyric", ")", "if", "lyrics", ":", ...
https://github.com/lilypond/lilypond/blob/2a14759372979f5b796ee802b0ee3bc15d28b06b/scripts/musicxml2ly.py#L2245-L2260