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
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/customtreectrl.py
python
GenericTreeItem.DeleteChildren
(self, tree)
Deletes the item children. :param `tree`: the main :class:`CustomTreeCtrl` instance.
Deletes the item children.
[ "Deletes", "the", "item", "children", "." ]
def DeleteChildren(self, tree): """ Deletes the item children. :param `tree`: the main :class:`CustomTreeCtrl` instance. """ for child in self._children: if tree: tree.SendDeleteEvent(child) child.DeleteChildren(tree) ...
[ "def", "DeleteChildren", "(", "self", ",", "tree", ")", ":", "for", "child", "in", "self", ".", "_children", ":", "if", "tree", ":", "tree", ".", "SendDeleteEvent", "(", "child", ")", "child", ".", "DeleteChildren", "(", "tree", ")", "if", "child", "==...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L2378-L2405
nyuwireless-unipd/ns3-mmwave
4ff9e87e8079764e04cbeccd8e85bff15ae16fb3
src/visualizer/visualizer/core.py
python
Node.set_label
(self, label)
! Set a label for the node. @param self: class object. @param label: label to set @return: an exception if invalid parameter.
! Set a label for the node.
[ "!", "Set", "a", "label", "for", "the", "node", "." ]
def set_label(self, label): """! Set a label for the node. @param self: class object. @param label: label to set @return: an exception if invalid parameter. """ assert isinstance(label, basestring) self._label = label self._update_appearance()
[ "def", "set_label", "(", "self", ",", "label", ")", ":", "assert", "isinstance", "(", "label", ",", "basestring", ")", "self", ".", "_label", "=", "label", "self", ".", "_update_appearance", "(", ")" ]
https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/src/visualizer/visualizer/core.py#L195-L206
greenheartgames/greenworks
3ea4ab490b56676de3f0a237c74bcfdb17323e60
deps/cpplint/cpplint.py
python
CheckForHeaderGuard
(filename, clean_lines, error)
Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. clean_lines: A CleansedLines instance containing the file. error: The function to call with a...
Checks that the file contains a header guard.
[ "Checks", "that", "the", "file", "contains", "a", "header", "guard", "." ]
def CheckForHeaderGuard(filename, clean_lines, error): """Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. clean_lines: A CleansedLines instance...
[ "def", "CheckForHeaderGuard", "(", "filename", ",", "clean_lines", ",", "error", ")", ":", "# Don't check for header guards if there are error suppression", "# comments somewhere in this file.", "#", "# Because this is silencing a warning for a nonexistent line, we", "# only support the ...
https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L1789-L1884
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
PyApp.SetMacAboutMenuItemId
(*args, **kwargs)
return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
SetMacAboutMenuItemId(long val)
SetMacAboutMenuItemId(long val)
[ "SetMacAboutMenuItemId", "(", "long", "val", ")" ]
def SetMacAboutMenuItemId(*args, **kwargs): """SetMacAboutMenuItemId(long val)""" return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
[ "def", "SetMacAboutMenuItemId", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "PyApp_SetMacAboutMenuItemId", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L8170-L8172
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/extras/msvs.py
python
msvs_generator.collect_projects
(self)
Fill the list self.all_projects with project objects Fill the list of build targets
Fill the list self.all_projects with project objects Fill the list of build targets
[ "Fill", "the", "list", "self", ".", "all_projects", "with", "project", "objects", "Fill", "the", "list", "of", "build", "targets" ]
def collect_projects(self): """ Fill the list self.all_projects with project objects Fill the list of build targets """ self.collect_targets() self.add_aliases() self.collect_dirs() default_project = getattr(self, 'default_project', None) def sortfun(x): if x.name == default_project: return '' ...
[ "def", "collect_projects", "(", "self", ")", ":", "self", ".", "collect_targets", "(", ")", "self", ".", "add_aliases", "(", ")", "self", ".", "collect_dirs", "(", ")", "default_project", "=", "getattr", "(", "self", ",", "'default_project'", ",", "None", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/extras/msvs.py#L743-L756
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Node/__init__.py
python
Node.add_ignore
(self, depend)
Adds dependencies to ignore.
Adds dependencies to ignore.
[ "Adds", "dependencies", "to", "ignore", "." ]
def add_ignore(self, depend): """Adds dependencies to ignore.""" try: self._add_child(self.ignore, self.ignore_set, depend) except TypeError as e: e = e.args[0] if SCons.Util.is_List(e): s = list(map(str, e)) else: s...
[ "def", "add_ignore", "(", "self", ",", "depend", ")", ":", "try", ":", "self", ".", "_add_child", "(", "self", ".", "ignore", ",", "self", ".", "ignore_set", ",", "depend", ")", "except", "TypeError", "as", "e", ":", "e", "=", "e", ".", "args", "["...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Node/__init__.py#L1290-L1300
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Misc.focus_lastfor
(self)
return self._nametowidget(name)
Return the widget which would have the focus if top level for this widget gets the focus from the window manager.
Return the widget which would have the focus if top level for this widget gets the focus from the window manager.
[ "Return", "the", "widget", "which", "would", "have", "the", "focus", "if", "top", "level", "for", "this", "widget", "gets", "the", "focus", "from", "the", "window", "manager", "." ]
def focus_lastfor(self): """Return the widget which would have the focus if top level for this widget gets the focus from the window manager.""" name = self.tk.call('focus', '-lastfor', self._w) if name == 'none' or not name: return None return self._nametowidget(name)
[ "def", "focus_lastfor", "(", "self", ")", ":", "name", "=", "self", ".", "tk", ".", "call", "(", "'focus'", ",", "'-lastfor'", ",", "self", ".", "_w", ")", "if", "name", "==", "'none'", "or", "not", "name", ":", "return", "None", "return", "self", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L491-L496
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/check_ops.py
python
assert_none_equal
( x, y, data=None, summarize=None, message=None, name=None)
Assert the condition `x != y` holds for all elements. Example of adding a dependency to an operation: ```python with tf.control_dependencies([tf.assert_none_equal(x, y)]): output = tf.reduce_sum(x) ``` This condition holds if for every pair of (possibly broadcast) elements `x[i]`, `y[i]`, we have `x[...
Assert the condition `x != y` holds for all elements.
[ "Assert", "the", "condition", "x", "!", "=", "y", "holds", "for", "all", "elements", "." ]
def assert_none_equal( x, y, data=None, summarize=None, message=None, name=None): """Assert the condition `x != y` holds for all elements. Example of adding a dependency to an operation: ```python with tf.control_dependencies([tf.assert_none_equal(x, y)]): output = tf.reduce_sum(x) ``` This condi...
[ "def", "assert_none_equal", "(", "x", ",", "y", ",", "data", "=", "None", ",", "summarize", "=", "None", ",", "message", "=", "None", ",", "name", "=", "None", ")", ":", "message", "=", "message", "or", "''", "with", "ops", ".", "name_scope", "(", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/check_ops.py#L321-L361
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/ceph.py
python
create_simple_monmap
(ctx, remote, conf, mons, path=None, mon_bind_addrvec=False)
return fsid
Writes a simple monmap based on current ceph.conf into path, or <testdir>/monmap by default. Assumes ceph_conf is up to date. Assumes mon sections are named "mon.*", with the dot. :return the FSID (as a string) of the newly created monmap
Writes a simple monmap based on current ceph.conf into path, or <testdir>/monmap by default.
[ "Writes", "a", "simple", "monmap", "based", "on", "current", "ceph", ".", "conf", "into", "path", "or", "<testdir", ">", "/", "monmap", "by", "default", "." ]
def create_simple_monmap(ctx, remote, conf, mons, path=None, mon_bind_addrvec=False): """ Writes a simple monmap based on current ceph.conf into path, or <testdir>/monmap by default. Assumes ceph_conf is up to date. Assumes mon sections are named "...
[ "def", "create_simple_monmap", "(", "ctx", ",", "remote", ",", "conf", ",", "mons", ",", "path", "=", "None", ",", "mon_bind_addrvec", "=", "False", ")", ":", "addresses", "=", "list", "(", "mons", ".", "items", "(", ")", ")", "assert", "addresses", ",...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph.py#L537-L594
OpenLightingProject/ola
d1433a1bed73276fbe55ce18c03b1c208237decc
python/examples/rdm_snapshot.py
python
ConfigReader._HandlePersonality
(self, data)
Called when we get a DMX_PERSONALITY response.
Called when we get a DMX_PERSONALITY response.
[ "Called", "when", "we", "get", "a", "DMX_PERSONALITY", "response", "." ]
def _HandlePersonality(self, data): """Called when we get a DMX_PERSONALITY response.""" this_device = self.data.setdefault(str(self.uid), {}) this_device['personality'] = data['current_personality'] self._NextState()
[ "def", "_HandlePersonality", "(", "self", ",", "data", ")", ":", "this_device", "=", "self", ".", "data", ".", "setdefault", "(", "str", "(", "self", ".", "uid", ")", ",", "{", "}", ")", "this_device", "[", "'personality'", "]", "=", "data", "[", "'c...
https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/python/examples/rdm_snapshot.py#L130-L134
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/io/ros.py
python
listen_tf
(listener,klampt_obj,frameprefix="klampt",root="world",onerror=None)
Reads Klampt frames from the ROS tf module. Args: listener (tf.TransformListener): the tf listener klampt_obj: the object to update. Can be WorldModel, RobotModel, anything with a setTransform or setCurrentTransform method, or None (in the latter case, a se3 object will be r...
Reads Klampt frames from the ROS tf module.
[ "Reads", "Klampt", "frames", "from", "the", "ROS", "tf", "module", "." ]
def listen_tf(listener,klampt_obj,frameprefix="klampt",root="world",onerror=None): """Reads Klampt frames from the ROS tf module. Args: listener (tf.TransformListener): the tf listener klampt_obj: the object to update. Can be WorldModel, RobotModel, anything with a setTransform or s...
[ "def", "listen_tf", "(", "listener", ",", "klampt_obj", ",", "frameprefix", "=", "\"klampt\"", ",", "root", "=", "\"world\"", ",", "onerror", "=", "None", ")", ":", "from", "klampt", "import", "WorldModel", ",", "RobotModel", "import", "tf", "def", "do_looku...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/io/ros.py#L1093-L1162
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
parserCtxt.htmlCtxtReadMemory
(self, buffer, size, URL, encoding, options)
return __tmp
parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context
parse an XML in-memory document and build a tree. This reuses the existing
[ "parse", "an", "XML", "in", "-", "memory", "document", "and", "build", "a", "tree", ".", "This", "reuses", "the", "existing" ]
def htmlCtxtReadMemory(self, buffer, size, URL, encoding, options): """parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context """ ret = libxml2mod.htmlCtxtReadMemory(self._o, buffer, size, URL, encoding, options) if ret is None:raise treeError(...
[ "def", "htmlCtxtReadMemory", "(", "self", ",", "buffer", ",", "size", ",", "URL", ",", "encoding", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "htmlCtxtReadMemory", "(", "self", ".", "_o", ",", "buffer", ",", "size", ",", "URL", ",", "enco...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L4193-L4199
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/wsgiref/simple_server.py
python
make_server
( host, port, app, server_class=WSGIServer, handler_class=WSGIRequestHandler )
return server
Create a new WSGI server listening on `host` and `port` for `app`
Create a new WSGI server listening on `host` and `port` for `app`
[ "Create", "a", "new", "WSGI", "server", "listening", "on", "host", "and", "port", "for", "app" ]
def make_server( host, port, app, server_class=WSGIServer, handler_class=WSGIRequestHandler ): """Create a new WSGI server listening on `host` and `port` for `app`""" server = server_class((host, port), handler_class) server.set_app(app) return server
[ "def", "make_server", "(", "host", ",", "port", ",", "app", ",", "server_class", "=", "WSGIServer", ",", "handler_class", "=", "WSGIRequestHandler", ")", ":", "server", "=", "server_class", "(", "(", "host", ",", "port", ")", ",", "handler_class", ")", "se...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/wsgiref/simple_server.py#L177-L183
xhzdeng/crpn
a5aef0f80dbe486103123f740c634fb01e6cc9a1
lib/nms/py_cpu_nms.py
python
py_cpu_nms
(dets, thresh)
return keep
Pure Python NMS baseline.
Pure Python NMS baseline.
[ "Pure", "Python", "NMS", "baseline", "." ]
def py_cpu_nms(dets, thresh): """Pure Python NMS baseline.""" x1 = dets[:, 0] y1 = dets[:, 1] x2 = dets[:, 2] y2 = dets[:, 3] scores = dets[:, 4] areas = (x2 - x1 + 1) * (y2 - y1 + 1) order = scores.argsort()[::-1] keep = [] while order.size > 0: i = order[0] ke...
[ "def", "py_cpu_nms", "(", "dets", ",", "thresh", ")", ":", "x1", "=", "dets", "[", ":", ",", "0", "]", "y1", "=", "dets", "[", ":", ",", "1", "]", "x2", "=", "dets", "[", ":", ",", "2", "]", "y2", "=", "dets", "[", ":", ",", "3", "]", "...
https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/lib/nms/py_cpu_nms.py#L10-L38
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/versioncontrol.py
python
VersionControl.get_requirement_revision
(cls, repo_dir)
return cls.get_revision(repo_dir)
Return the revision string that should be used in a requirement.
[]
def get_requirement_revision(cls, repo_dir): # type: (str) -> str """ Return the revision string that should be used in a requirement. """ return cls.get_revision(repo_dir)
[ "def", "get_requirement_revision", "(", "cls", ",", "repo_dir", ")", ":", "# type: (str) -> str", "return", "cls", ".", "get_revision", "(", "repo_dir", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/versioncontrol.py#L613-L623
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
DataViewCtrl.GetCurrentItem
(*args, **kwargs)
return _dataview.DataViewCtrl_GetCurrentItem(*args, **kwargs)
GetCurrentItem(self) -> DataViewItem
GetCurrentItem(self) -> DataViewItem
[ "GetCurrentItem", "(", "self", ")", "-", ">", "DataViewItem" ]
def GetCurrentItem(*args, **kwargs): """GetCurrentItem(self) -> DataViewItem""" return _dataview.DataViewCtrl_GetCurrentItem(*args, **kwargs)
[ "def", "GetCurrentItem", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewCtrl_GetCurrentItem", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L1743-L1745
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListCtrl.GetFooterHeight
(self)
return self._headerWin.GetWindowHeight()
Returns the :class:`UltimateListHeaderWindow` height, in pixels.
Returns the :class:`UltimateListHeaderWindow` height, in pixels.
[ "Returns", "the", ":", "class", ":", "UltimateListHeaderWindow", "height", "in", "pixels", "." ]
def GetFooterHeight(self): """ Returns the :class:`UltimateListHeaderWindow` height, in pixels. """ if not self._footerWin: return -1 return self._headerWin.GetWindowHeight()
[ "def", "GetFooterHeight", "(", "self", ")", ":", "if", "not", "self", ".", "_footerWin", ":", "return", "-", "1", "return", "self", ".", "_headerWin", ".", "GetWindowHeight", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L13699-L13705
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
Grid.SetColSize
(*args, **kwargs)
return _grid.Grid_SetColSize(*args, **kwargs)
SetColSize(self, int col, int width)
SetColSize(self, int col, int width)
[ "SetColSize", "(", "self", "int", "col", "int", "width", ")" ]
def SetColSize(*args, **kwargs): """SetColSize(self, int col, int width)""" return _grid.Grid_SetColSize(*args, **kwargs)
[ "def", "SetColSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_SetColSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L1834-L1836
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
build/android/buildbot/bb_device_status_check.py
python
CheckForMissingDevices
(options, adb_online_devs)
Uses file of previous online devices to detect broken phones. Args: options: out_dir parameter of options argument is used as the base directory to load and update the cache file. adb_online_devs: A list of serial numbers of the currently visible and online attached devices.
Uses file of previous online devices to detect broken phones.
[ "Uses", "file", "of", "previous", "online", "devices", "to", "detect", "broken", "phones", "." ]
def CheckForMissingDevices(options, adb_online_devs): """Uses file of previous online devices to detect broken phones. Args: options: out_dir parameter of options argument is used as the base directory to load and update the cache file. adb_online_devs: A list of serial numbers of the currentl...
[ "def", "CheckForMissingDevices", "(", "options", ",", "adb_online_devs", ")", ":", "# TODO(navabi): remove this once the bug that causes different number", "# of devices to be detected between calls is fixed.", "logger", "=", "logging", ".", "getLogger", "(", ")", "logger", ".", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/buildbot/bb_device_status_check.py#L139-L205
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/platform.py
python
win32_ver
(release='',version='',csd='',ptype='')
return release,version,csd,ptype
Get additional version information from the Windows Registry and return a tuple (version,csd,ptype) referring to version number, CSD level (service pack), and OS type (multi/single processor). As a hint: ptype returns 'Uniprocessor Free' on single processor NT machines and 'Mult...
Get additional version information from the Windows Registry and return a tuple (version,csd,ptype) referring to version number, CSD level (service pack), and OS type (multi/single processor).
[ "Get", "additional", "version", "information", "from", "the", "Windows", "Registry", "and", "return", "a", "tuple", "(", "version", "csd", "ptype", ")", "referring", "to", "version", "number", "CSD", "level", "(", "service", "pack", ")", "and", "OS", "type",...
def win32_ver(release='',version='',csd='',ptype=''): """ Get additional version information from the Windows Registry and return a tuple (version,csd,ptype) referring to version number, CSD level (service pack), and OS type (multi/single processor). As a hint: ptype returns 'Unipr...
[ "def", "win32_ver", "(", "release", "=", "''", ",", "version", "=", "''", ",", "csd", "=", "''", ",", "ptype", "=", "''", ")", ":", "# XXX Is there any way to find out the processor type on WinXX ?", "# XXX Is win32 available on Windows CE ?", "#", "# Adapted from code ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/platform.py#L553-L716
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/graph/graph.py
python
Graph.to_networkx
(self)
return self._igraph.to_networkx()
Returns a copy of this graph as an igraph.Graph instance. This method requires networkx to be installed.
Returns a copy of this graph as an igraph.Graph instance. This method requires networkx to be installed.
[ "Returns", "a", "copy", "of", "this", "graph", "as", "an", "igraph", ".", "Graph", "instance", ".", "This", "method", "requires", "networkx", "to", "be", "installed", "." ]
def to_networkx(self): """ Returns a copy of this graph as an igraph.Graph instance. This method requires networkx to be installed. """ return self._igraph.to_networkx()
[ "def", "to_networkx", "(", "self", ")", ":", "return", "self", ".", "_igraph", ".", "to_networkx", "(", ")" ]
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/graph/graph.py#L121-L126
epiqc/ScaffCC
66a79944ee4cd116b27bc1a69137276885461db8
clang/tools/scan-build-py/libscanbuild/clang.py
python
is_active
(checkers)
return predicate
Returns a method, which classifies the checker active or not, based on the received checker name list.
Returns a method, which classifies the checker active or not, based on the received checker name list.
[ "Returns", "a", "method", "which", "classifies", "the", "checker", "active", "or", "not", "based", "on", "the", "received", "checker", "name", "list", "." ]
def is_active(checkers): """ Returns a method, which classifies the checker active or not, based on the received checker name list. """ def predicate(checker): """ Returns True if the given checker is active. """ return any(pattern.match(checker) for pattern in predicate.patterns) pre...
[ "def", "is_active", "(", "checkers", ")", ":", "def", "predicate", "(", "checker", ")", ":", "\"\"\" Returns True if the given checker is active. \"\"\"", "return", "any", "(", "pattern", ".", "match", "(", "checker", ")", "for", "pattern", "in", "predicate", ".",...
https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/tools/scan-build-py/libscanbuild/clang.py#L87-L97
qboticslabs/mastering_ros
d83e78f30acc45b0f18522c1d5fae3a7f52974b9
chapter_3_codes/seven_dof_arm_gazebo/scripts/pick_and_place_pick_working.py
python
CokeCanPickAndPlace._create_place_goal
(self, group, target, places)
return goal
Create a MoveIt! PlaceGoal
Create a MoveIt! PlaceGoal
[ "Create", "a", "MoveIt!", "PlaceGoal" ]
def _create_place_goal(self, group, target, places): """ Create a MoveIt! PlaceGoal """ # Create goal: goal = PlaceGoal() goal.group_name = group goal.attached_object_name = target goal.place_locations.extend(places) # Configure goal ...
[ "def", "_create_place_goal", "(", "self", ",", "group", ",", "target", ",", "places", ")", ":", "# Create goal:", "goal", "=", "PlaceGoal", "(", ")", "goal", ".", "group_name", "=", "group", "goal", ".", "attached_object_name", "=", "target", "goal", ".", ...
https://github.com/qboticslabs/mastering_ros/blob/d83e78f30acc45b0f18522c1d5fae3a7f52974b9/chapter_3_codes/seven_dof_arm_gazebo/scripts/pick_and_place_pick_working.py#L273-L295
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/estimator.py
python
BaseEstimator.fit
(self, x=None, y=None, input_fn=None, steps=None, batch_size=None, monitors=None, max_steps=None)
return self
See `Trainable`. Raises: ValueError: If `x` or `y` are not `None` while `input_fn` is not `None`. ValueError: If both `steps` and `max_steps` are not `None`.
See `Trainable`.
[ "See", "Trainable", "." ]
def fit(self, x=None, y=None, input_fn=None, steps=None, batch_size=None, monitors=None, max_steps=None): # pylint: disable=g-doc-args,g-doc-return-or-yield """See `Trainable`. Raises: ValueError: If `x` or `y` are not `None` while `input_fn` is not `None`. ValueError: If both `steps`...
[ "def", "fit", "(", "self", ",", "x", "=", "None", ",", "y", "=", "None", ",", "input_fn", "=", "None", ",", "steps", "=", "None", ",", "batch_size", "=", "None", ",", "monitors", "=", "None", ",", "max_steps", "=", "None", ")", ":", "# pylint: disa...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/estimator.py#L200-L221
martinrotter/textosaurus
4e2ad75abaf5b7e6a823766a2aa8a30f0c965cb8
src/libtextosaurus/3rd-party/scintilla/scripts/FileGenerator.py
python
UpdateFile
(filename, updated)
If the file contents are different to updated then copy updated into the file else leave alone so Mercurial and make don't treat it as modified.
If the file contents are different to updated then copy updated into the file else leave alone so Mercurial and make don't treat it as modified.
[ "If", "the", "file", "contents", "are", "different", "to", "updated", "then", "copy", "updated", "into", "the", "file", "else", "leave", "alone", "so", "Mercurial", "and", "make", "don", "t", "treat", "it", "as", "modified", "." ]
def UpdateFile(filename, updated): """ If the file contents are different to updated then copy updated into the file else leave alone so Mercurial and make don't treat it as modified. """ newOrChanged = "Changed" try: with codecs.open(filename, "r", "utf-8") as infile: original = inf...
[ "def", "UpdateFile", "(", "filename", ",", "updated", ")", ":", "newOrChanged", "=", "\"Changed\"", "try", ":", "with", "codecs", ".", "open", "(", "filename", ",", "\"r\"", ",", "\"utf-8\"", ")", "as", "infile", ":", "original", "=", "infile", ".", "rea...
https://github.com/martinrotter/textosaurus/blob/4e2ad75abaf5b7e6a823766a2aa8a30f0c965cb8/src/libtextosaurus/3rd-party/scintilla/scripts/FileGenerator.py#L20-L35
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/generic_utils.py
python
custom_object_scope
(*args)
return CustomObjectScope(*args)
Provides a scope that changes to `_GLOBAL_CUSTOM_OBJECTS` cannot escape. Convenience wrapper for `CustomObjectScope`. Code within a `with` statement will be able to access custom objects by name. Changes to global custom objects persist within the enclosing `with` statement. At end of the `with` statement, g...
Provides a scope that changes to `_GLOBAL_CUSTOM_OBJECTS` cannot escape.
[ "Provides", "a", "scope", "that", "changes", "to", "_GLOBAL_CUSTOM_OBJECTS", "cannot", "escape", "." ]
def custom_object_scope(*args): """Provides a scope that changes to `_GLOBAL_CUSTOM_OBJECTS` cannot escape. Convenience wrapper for `CustomObjectScope`. Code within a `with` statement will be able to access custom objects by name. Changes to global custom objects persist within the enclosing `with` statement...
[ "def", "custom_object_scope", "(", "*", "args", ")", ":", "return", "CustomObjectScope", "(", "*", "args", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/generic_utils.py#L77-L104
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/aui.py
python
AuiNotebook.SetTabCtrlHeight
(*args, **kwargs)
return _aui.AuiNotebook_SetTabCtrlHeight(*args, **kwargs)
SetTabCtrlHeight(self, int height)
SetTabCtrlHeight(self, int height)
[ "SetTabCtrlHeight", "(", "self", "int", "height", ")" ]
def SetTabCtrlHeight(*args, **kwargs): """SetTabCtrlHeight(self, int height)""" return _aui.AuiNotebook_SetTabCtrlHeight(*args, **kwargs)
[ "def", "SetTabCtrlHeight", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiNotebook_SetTabCtrlHeight", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1317-L1319
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/fuchsia/binary_sizes.py
python
GetBinarySizesAndBlobs
(args, sizes_config)
return package_sizes, package_blobs
Get binary size data and contained blobs for packages specified in args. If "total_size_name" is set, then computes a synthetic package size which is the aggregated sizes across all packages.
Get binary size data and contained blobs for packages specified in args.
[ "Get", "binary", "size", "data", "and", "contained", "blobs", "for", "packages", "specified", "in", "args", "." ]
def GetBinarySizesAndBlobs(args, sizes_config): """Get binary size data and contained blobs for packages specified in args. If "total_size_name" is set, then computes a synthetic package size which is the aggregated sizes across all packages.""" # Calculate compressed and uncompressed package sizes. package...
[ "def", "GetBinarySizesAndBlobs", "(", "args", ",", "sizes_config", ")", ":", "# Calculate compressed and uncompressed package sizes.", "package_blobs", "=", "GetPackageBlobs", "(", "sizes_config", "[", "'far_files'", "]", ",", "args", ".", "build_out_dir", ")", "package_s...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/fuchsia/binary_sizes.py#L454-L475
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/feature_column/feature_column.py
python
bucketized_column
(source_column, boundaries)
return _BucketizedColumn(source_column, tuple(boundaries))
Represents discretized dense input. Buckets include the left boundary, and exclude the right boundary. Namely, `boundaries=[0., 1., 2.]` generates buckets `(-inf, 0.)`, `[0., 1.)`, `[1., 2.)`, and `[2., +inf)`. For example, if the inputs are ```python boundaries = [0, 10, 100] input tensor = [[-5, 1000...
Represents discretized dense input.
[ "Represents", "discretized", "dense", "input", "." ]
def bucketized_column(source_column, boundaries): """Represents discretized dense input. Buckets include the left boundary, and exclude the right boundary. Namely, `boundaries=[0., 1., 2.]` generates buckets `(-inf, 0.)`, `[0., 1.)`, `[1., 2.)`, and `[2., +inf)`. For example, if the inputs are ```python ...
[ "def", "bucketized_column", "(", "source_column", ",", "boundaries", ")", ":", "if", "not", "isinstance", "(", "source_column", ",", "_NumericColumn", ")", ":", "raise", "ValueError", "(", "'source_column must be a column generated with numeric_column(). '", "'Given: {}'", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/feature_column/feature_column.py#L634-L714
gsl-lite/gsl-lite
4b5e9ab7474841fc2d7efc2e0064ef81785535d1
script/create-vcpkg.py
python
createPortfile
( args )
Create vcpkg portfile
Create vcpkg portfile
[ "Create", "vcpkg", "portfile" ]
def createPortfile( args ): """Create vcpkg portfile""" output = tpl_vcpkg_portfile.format( usr=args.user, prj=args.project, ref=to_ref(args.version), sha=args.sha, lic=cfg_license ) if args.verbose: print( "Creating portfile '{f}':".format( f=portfile_path( args ) ) ) if args.verbose > ...
[ "def", "createPortfile", "(", "args", ")", ":", "output", "=", "tpl_vcpkg_portfile", ".", "format", "(", "usr", "=", "args", ".", "user", ",", "prj", "=", "args", ".", "project", ",", "ref", "=", "to_ref", "(", "args", ".", "version", ")", ",", "sha"...
https://github.com/gsl-lite/gsl-lite/blob/4b5e9ab7474841fc2d7efc2e0064ef81785535d1/script/create-vcpkg.py#L114-L124
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/dateutil/dateutil/tz/tz.py
python
resolve_imaginary
(dt)
return dt
Given a datetime that may be imaginary, return an existing datetime. This function assumes that an imaginary datetime represents what the wall time would be in a zone had the offset transition not occurred, so it will always fall forward by the transition's change in offset. .. doctest:: >>> ...
Given a datetime that may be imaginary, return an existing datetime.
[ "Given", "a", "datetime", "that", "may", "be", "imaginary", "return", "an", "existing", "datetime", "." ]
def resolve_imaginary(dt): """ Given a datetime that may be imaginary, return an existing datetime. This function assumes that an imaginary datetime represents what the wall time would be in a zone had the offset transition not occurred, so it will always fall forward by the transition's change in ...
[ "def", "resolve_imaginary", "(", "dt", ")", ":", "if", "dt", ".", "tzinfo", "is", "not", "None", "and", "not", "datetime_exists", "(", "dt", ")", ":", "curr_offset", "=", "(", "dt", "+", "datetime", ".", "timedelta", "(", "hours", "=", "24", ")", ")"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/dateutil/dateutil/tz/tz.py#L1763-L1806
s9xie/hed
94fb22f10cbfec8d84fbc0642b224022014b6bd6
scripts/cpp_lint.py
python
CheckIncludeLine
(filename, clean_lines, linenum, include_state, error)
Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage must be put here. Args: filename: The name of the current file. clean_l...
Check rules that are applicable to #include lines.
[ "Check", "rules", "that", "are", "applicable", "to", "#include", "lines", "." ]
def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): """Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage m...
[ "def", "CheckIncludeLine", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "include_state", ",", "error", ")", ":", "fileinfo", "=", "FileInfo", "(", "filename", ")", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "# \"include\" shoul...
https://github.com/s9xie/hed/blob/94fb22f10cbfec8d84fbc0642b224022014b6bd6/scripts/cpp_lint.py#L3680-L3749
scribusproject/scribus
41ec7c775a060912cf251682a8b1437f753f80f4
scribus/plugins/scriptplugin_py2x/scripts/CalendarWizard.py
python
ScEventCalendar.printMonth
(self, cal, month, week)
Print the month name(s)
Print the month name(s)
[ "Print", "the", "month", "name", "(", "s", ")" ]
def printMonth(self, cal, month, week): """ Print the month name(s) """ if week[6].day < 7: if (week == cal[len(cal)-1]): self.createHeader(localization[self.lang][0][month] + self.sepMonths + localization[self.lang][0][(month+1)%12]) elif ((month-1) not in self.months): self.createH...
[ "def", "printMonth", "(", "self", ",", "cal", ",", "month", ",", "week", ")", ":", "if", "week", "[", "6", "]", ".", "day", "<", "7", ":", "if", "(", "week", "==", "cal", "[", "len", "(", "cal", ")", "-", "1", "]", ")", ":", "self", ".", ...
https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/scribus/plugins/scriptplugin_py2x/scripts/CalendarWizard.py#L309-L317
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/rds2/__init__.py
python
connect_to_region
(region_name, **kw_params)
return None
Given a valid region name, return a :class:`boto.rds2.layer1.RDSConnection`. Any additional parameters after the region_name are passed on to the connect method of the region object. :type: str :param region_name: The name of the region to connect to. :rtype: :class:`boto.rds2.layer1.RDSConnec...
Given a valid region name, return a :class:`boto.rds2.layer1.RDSConnection`. Any additional parameters after the region_name are passed on to the connect method of the region object.
[ "Given", "a", "valid", "region", "name", "return", "a", ":", "class", ":", "boto", ".", "rds2", ".", "layer1", ".", "RDSConnection", ".", "Any", "additional", "parameters", "after", "the", "region_name", "are", "passed", "on", "to", "the", "connect", "meth...
def connect_to_region(region_name, **kw_params): """ Given a valid region name, return a :class:`boto.rds2.layer1.RDSConnection`. Any additional parameters after the region_name are passed on to the connect method of the region object. :type: str :param region_name: The name of the region t...
[ "def", "connect_to_region", "(", "region_name", ",", "*", "*", "kw_params", ")", ":", "for", "region", "in", "regions", "(", ")", ":", "if", "region", ".", "name", "==", "region_name", ":", "return", "region", ".", "connect", "(", "*", "*", "kw_params", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/rds2/__init__.py#L36-L53
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/google/protobuf/internal/python_message.py
python
_BytesForNonRepeatedElement
(value, field_number, field_type)
Returns the number of bytes needed to serialize a non-repeated element. The returned byte count includes space for tag information and any other additional space associated with serializing value. Args: value: Value we're serializing. field_number: Field number of this value. (Since the field number ...
Returns the number of bytes needed to serialize a non-repeated element. The returned byte count includes space for tag information and any other additional space associated with serializing value.
[ "Returns", "the", "number", "of", "bytes", "needed", "to", "serialize", "a", "non", "-", "repeated", "element", ".", "The", "returned", "byte", "count", "includes", "space", "for", "tag", "information", "and", "any", "other", "additional", "space", "associated...
def _BytesForNonRepeatedElement(value, field_number, field_type): """Returns the number of bytes needed to serialize a non-repeated element. The returned byte count includes space for tag information and any other additional space associated with serializing value. Args: value: Value we're serializing. ...
[ "def", "_BytesForNonRepeatedElement", "(", "value", ",", "field_number", ",", "field_type", ")", ":", "try", ":", "fn", "=", "type_checkers", ".", "TYPE_TO_BYTE_SIZE_FN", "[", "field_type", "]", "return", "fn", "(", "field_number", ",", "value", ")", "except", ...
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/internal/python_message.py#L1030-L1047
asLody/whale
6a661b27cc4cf83b7b5a3b02451597ee1ac7f264
whale/cpplint.py
python
PrintCategories
()
Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter.
Prints a list of all the error-categories used by error messages.
[ "Prints", "a", "list", "of", "all", "the", "error", "-", "categories", "used", "by", "error", "messages", "." ]
def PrintCategories(): """Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter. """ sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) sys.exit(0)
[ "def", "PrintCategories", "(", ")", ":", "sys", ".", "stderr", ".", "write", "(", "''", ".", "join", "(", "' %s\\n'", "%", "cat", "for", "cat", "in", "_ERROR_CATEGORIES", ")", ")", "sys", ".", "exit", "(", "0", ")" ]
https://github.com/asLody/whale/blob/6a661b27cc4cf83b7b5a3b02451597ee1ac7f264/whale/cpplint.py#L6137-L6143
devpack/android-python27
d42dd67565e104cf7b0b50eb473f615db3e69901
python-build-with-qt/PyQt-x11-gpl-4.8/pyuic/uic/driver.py
python
Driver._generate
(self)
Generate the Python code.
Generate the Python code.
[ "Generate", "the", "Python", "code", "." ]
def _generate(self): """ Generate the Python code. """ if self._opts.output == "-": pyfile = sys.stdout elif sys.hexversion >= 0x03000000: pyfile = open(self._opts.output, 'wt', encoding='utf8') else: pyfile = open(self._opts.output, 'wt') co...
[ "def", "_generate", "(", "self", ")", ":", "if", "self", ".", "_opts", ".", "output", "==", "\"-\"", ":", "pyfile", "=", "sys", ".", "stdout", "elif", "sys", ".", "hexversion", ">=", "0x03000000", ":", "pyfile", "=", "open", "(", "self", ".", "_opts"...
https://github.com/devpack/android-python27/blob/d42dd67565e104cf7b0b50eb473f615db3e69901/python-build-with-qt/PyQt-x11-gpl-4.8/pyuic/uic/driver.py#L57-L68
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/nntplib.py
python
NNTP.last
(self)
return self._statcmd('LAST')
Process a LAST command. No arguments. Return as for STAT.
Process a LAST command. No arguments. Return as for STAT.
[ "Process", "a", "LAST", "command", ".", "No", "arguments", ".", "Return", "as", "for", "STAT", "." ]
def last(self): """Process a LAST command. No arguments. Return as for STAT.""" return self._statcmd('LAST')
[ "def", "last", "(", "self", ")", ":", "return", "self", ".", "_statcmd", "(", "'LAST'", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/nntplib.py#L749-L751
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/datasets/kddcup99.py
python
fetch_kddcup99
(subset=None, shuffle=False, random_state=None, percent10=True, download_if_missing=True)
return Bunch(data=data, target=target)
Load and return the kddcup 99 dataset (classification). The KDD Cup '99 dataset was created by processing the tcpdump portions of the 1998 DARPA Intrusion Detection System (IDS) Evaluation dataset, created by MIT Lincoln Lab [1] . The artificial data was generated using a closed network and hand-inject...
Load and return the kddcup 99 dataset (classification).
[ "Load", "and", "return", "the", "kddcup", "99", "dataset", "(", "classification", ")", "." ]
def fetch_kddcup99(subset=None, shuffle=False, random_state=None, percent10=True, download_if_missing=True): """Load and return the kddcup 99 dataset (classification). The KDD Cup '99 dataset was created by processing the tcpdump portions of the 1998 DARPA Intrusion Detection System (IDS...
[ "def", "fetch_kddcup99", "(", "subset", "=", "None", ",", "shuffle", "=", "False", ",", "random_state", "=", "None", ",", "percent10", "=", "True", ",", "download_if_missing", "=", "True", ")", ":", "kddcup99", "=", "_fetch_brute_kddcup99", "(", "shuffle", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/datasets/kddcup99.py#L42-L212
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/telemetry/core/platform/profiler/__init__.py
python
Profiler.WillCloseBrowser
(cls, browser_backend, platform_backend)
Called before the browser is stopped.
Called before the browser is stopped.
[ "Called", "before", "the", "browser", "is", "stopped", "." ]
def WillCloseBrowser(cls, browser_backend, platform_backend): """Called before the browser is stopped.""" pass
[ "def", "WillCloseBrowser", "(", "cls", ",", "browser_backend", ",", "platform_backend", ")", ":", "pass" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/platform/profiler/__init__.py#L40-L42
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mimetypes.py
python
guess_type
(url, strict=True)
return _db.guess_type(url, strict)
Guess the type of a file based on its URL. Return value is a tuple (type, encoding) where type is None if the type can't be guessed (no or unknown suffix) or a string of the form type/subtype, usable for a MIME Content-type header; and encoding is None for no encoding or the name of the program used ...
Guess the type of a file based on its URL.
[ "Guess", "the", "type", "of", "a", "file", "based", "on", "its", "URL", "." ]
def guess_type(url, strict=True): """Guess the type of a file based on its URL. Return value is a tuple (type, encoding) where type is None if the type can't be guessed (no or unknown suffix) or a string of the form type/subtype, usable for a MIME Content-type header; and encoding is None for no en...
[ "def", "guess_type", "(", "url", ",", "strict", "=", "True", ")", ":", "if", "_db", "is", "None", ":", "init", "(", ")", "return", "_db", ".", "guess_type", "(", "url", ",", "strict", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mimetypes.py#L272-L292
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/http/client.py
python
HTTPResponse.getheader
(self, name, default=None)
Returns the value of the header matching *name*. If there are multiple matching headers, the values are combined into a single string separated by commas and spaces. If no matching header is found, returns *default* or None if the *default* is not specified. If the headers are...
Returns the value of the header matching *name*.
[ "Returns", "the", "value", "of", "the", "header", "matching", "*", "name", "*", "." ]
def getheader(self, name, default=None): '''Returns the value of the header matching *name*. If there are multiple matching headers, the values are combined into a single string separated by commas and spaces. If no matching header is found, returns *default* or None if the *de...
[ "def", "getheader", "(", "self", ",", "name", ",", "default", "=", "None", ")", ":", "if", "self", ".", "headers", "is", "None", ":", "raise", "ResponseNotReady", "(", ")", "headers", "=", "self", ".", "headers", ".", "get_all", "(", "name", ")", "or...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/http/client.py#L718-L736
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/cython/Cython/Utils.py
python
build_hex_version
(version_string)
return '0x%08X' % hexversion
Parse and translate '4.3a1' into the readable hex representation '0x040300A1' (like PY_VERSION_HEX).
Parse and translate '4.3a1' into the readable hex representation '0x040300A1' (like PY_VERSION_HEX).
[ "Parse", "and", "translate", "4", ".", "3a1", "into", "the", "readable", "hex", "representation", "0x040300A1", "(", "like", "PY_VERSION_HEX", ")", "." ]
def build_hex_version(version_string): """ Parse and translate '4.3a1' into the readable hex representation '0x040300A1' (like PY_VERSION_HEX). """ # First, parse '4.12a1' into [4, 12, 0, 0xA01]. digits = [] release_status = 0xF0 for digit in re.split('([.abrc]+)', version_string): i...
[ "def", "build_hex_version", "(", "version_string", ")", ":", "# First, parse '4.12a1' into [4, 12, 0, 0xA01].", "digits", "=", "[", "]", "release_status", "=", "0xF0", "for", "digit", "in", "re", ".", "split", "(", "'([.abrc]+)'", ",", "version_string", ")", ":", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Utils.py#L428-L449
tcpexmachina/remy
687b5db29b81df7ae8737889c78b47e7f9788297
scripts/plot.py
python
BaseRemyCCPerformancePlotGenerator.parse_senderrunner_output
(cls, result)
return norm_score, sender_data, link_ppt_prior
Parses the output of sender-runner to extract the normalized score, and sender throughputs and delays. Returns a 3-tuple. The first element is the normalized score from the sender-runner script. The second element is a list of lists, one list for each sender, each inner list having two elements,...
Parses the output of sender-runner to extract the normalized score, and sender throughputs and delays. Returns a 3-tuple. The first element is the normalized score from the sender-runner script. The second element is a list of lists, one list for each sender, each inner list having two elements,...
[ "Parses", "the", "output", "of", "sender", "-", "runner", "to", "extract", "the", "normalized", "score", "and", "sender", "throughputs", "and", "delays", ".", "Returns", "a", "3", "-", "tuple", ".", "The", "first", "element", "is", "the", "normalized", "sc...
def parse_senderrunner_output(cls, result): """Parses the output of sender-runner to extract the normalized score, and sender throughputs and delays. Returns a 3-tuple. The first element is the normalized score from the sender-runner script. The second element is a list of lists, one lis...
[ "def", "parse_senderrunner_output", "(", "cls", ",", "result", ")", ":", "norm_matches", "=", "cls", ".", "NORM_SCORE_REGEX", ".", "findall", "(", "result", ")", "if", "len", "(", "norm_matches", ")", "!=", "1", ":", "print", "(", "result", ")", "raise", ...
https://github.com/tcpexmachina/remy/blob/687b5db29b81df7ae8737889c78b47e7f9788297/scripts/plot.py#L116-L145
mapeditor/tiled
b7abf3c9606aa53442bab8fc6a44a1b2797226e0
src/plugins/python/scripts/pk2.py
python
PK2MAPLAYER.findBounds
(self)
return mx, my, mw, mh
find bounding box for coords that have tiles
find bounding box for coords that have tiles
[ "find", "bounding", "box", "for", "coords", "that", "have", "tiles" ]
def findBounds(self): "find bounding box for coords that have tiles" mx,my,mw,mh = None,None,10,10 for y in range(self.ly, self.ly+self.height()): for x in range(self.lx, self.lx+self.width()): if self.layer[x + y * self.MAXW] != 255: if not my: my = y if not mx or x < mx:...
[ "def", "findBounds", "(", "self", ")", ":", "mx", ",", "my", ",", "mw", ",", "mh", "=", "None", ",", "None", ",", "10", ",", "10", "for", "y", "in", "range", "(", "self", ".", "ly", ",", "self", ".", "ly", "+", "self", ".", "height", "(", "...
https://github.com/mapeditor/tiled/blob/b7abf3c9606aa53442bab8fc6a44a1b2797226e0/src/plugins/python/scripts/pk2.py#L209-L223
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/generate_stubs/generate_stubs.py
python
PosixStubWriter.UninitializeModuleName
(cls, module_name)
return 'Uninitialize%s' % PosixStubWriter.CStyleIdentifier(module_name)
Gets the name of the function that uninitializes this module. The name is in the format UninitializeModule. Where "Module" is replaced with the module name, munged to be a valid C identifier. Args: module_name: The name of the module to generate the function name for. Returns: A string w...
Gets the name of the function that uninitializes this module.
[ "Gets", "the", "name", "of", "the", "function", "that", "uninitializes", "this", "module", "." ]
def UninitializeModuleName(cls, module_name): """Gets the name of the function that uninitializes this module. The name is in the format UninitializeModule. Where "Module" is replaced with the module name, munged to be a valid C identifier. Args: module_name: The name of the module to generate ...
[ "def", "UninitializeModuleName", "(", "cls", ",", "module_name", ")", ":", "return", "'Uninitialize%s'", "%", "PosixStubWriter", ".", "CStyleIdentifier", "(", "module_name", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/generate_stubs/generate_stubs.py#L601-L613
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/MSVSUtil.py
python
ShardTargets
(target_list, target_dicts)
return (new_target_list, new_target_dicts)
Shard some targets apart to work around the linkers limits. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. Returns: Tuple of the new sharded versions of the inputs.
Shard some targets apart to work around the linkers limits.
[ "Shard", "some", "targets", "apart", "to", "work", "around", "the", "linkers", "limits", "." ]
def ShardTargets(target_list, target_dicts): """Shard some targets apart to work around the linkers limits. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. Returns: Tuple of the new sharded versions of the inputs. """...
[ "def", "ShardTargets", "(", "target_list", ",", "target_dicts", ")", ":", "# Gather the targets to shard, and how many pieces.", "targets_to_shard", "=", "{", "}", "for", "t", "in", "target_dicts", ":", "shards", "=", "int", "(", "target_dicts", "[", "t", "]", "."...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/MSVSUtil.py#L73-L125
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiPaneInfo.Direction
(*args, **kwargs)
return _aui.AuiPaneInfo_Direction(*args, **kwargs)
Direction(self, int direction) -> AuiPaneInfo
Direction(self, int direction) -> AuiPaneInfo
[ "Direction", "(", "self", "int", "direction", ")", "-", ">", "AuiPaneInfo" ]
def Direction(*args, **kwargs): """Direction(self, int direction) -> AuiPaneInfo""" return _aui.AuiPaneInfo_Direction(*args, **kwargs)
[ "def", "Direction", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiPaneInfo_Direction", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L373-L375
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/pathlib.py
python
PurePath.is_absolute
(self)
return not self._flavour.has_drv or bool(self._drv)
True if the path is absolute (has both a root and, if applicable, a drive).
True if the path is absolute (has both a root and, if applicable, a drive).
[ "True", "if", "the", "path", "is", "absolute", "(", "has", "both", "a", "root", "and", "if", "applicable", "a", "drive", ")", "." ]
def is_absolute(self): """True if the path is absolute (has both a root and, if applicable, a drive).""" if not self._root: return False return not self._flavour.has_drv or bool(self._drv)
[ "def", "is_absolute", "(", "self", ")", ":", "if", "not", "self", ".", "_root", ":", "return", "False", "return", "not", "self", ".", "_flavour", ".", "has_drv", "or", "bool", "(", "self", ".", "_drv", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pathlib.py#L1001-L1006
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/categorical.py
python
Categorical.allow_nan_stats
(self)
return self._allow_nan_stats
Boolean describing behavior when a stat is undefined for batch member.
Boolean describing behavior when a stat is undefined for batch member.
[ "Boolean", "describing", "behavior", "when", "a", "stat", "is", "undefined", "for", "batch", "member", "." ]
def allow_nan_stats(self): """Boolean describing behavior when a stat is undefined for batch member.""" return self._allow_nan_stats
[ "def", "allow_nan_stats", "(", "self", ")", ":", "return", "self", ".", "_allow_nan_stats" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/categorical.py#L74-L76
PrincetonUniversity/athena-public-version
9c266692b9423743d8e23509b3ab266a232a92d2
tst/style/cpplint.py
python
_VerboseLevel
()
return _cpplint_state.verbose_level
Returns the module's verbosity setting.
Returns the module's verbosity setting.
[ "Returns", "the", "module", "s", "verbosity", "setting", "." ]
def _VerboseLevel(): """Returns the module's verbosity setting.""" return _cpplint_state.verbose_level
[ "def", "_VerboseLevel", "(", ")", ":", "return", "_cpplint_state", ".", "verbose_level" ]
https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/tst/style/cpplint.py#L1190-L1192
Tencent/mars
54969ba56b402a622db123e780a4f760b38c5c36
mars/lint/cpplint.py
python
CheckAltTokens
(filename, clean_lines, linenum, error)
Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Check alternative keywords being used in boolean expressions.
[ "Check", "alternative", "keywords", "being", "used", "in", "boolean", "expressions", "." ]
def CheckAltTokens(filename, clean_lines, linenum, error): """Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call ...
[ "def", "CheckAltTokens", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Avoid preprocessor lines", "if", "Match", "(", "r'^\\s*#'", ",", "line", ")", ":", "retur...
https://github.com/Tencent/mars/blob/54969ba56b402a622db123e780a4f760b38c5c36/mars/lint/cpplint.py#L4324-L4353
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/fractions.py
python
Fraction.__neg__
(a)
return Fraction(-a._numerator, a._denominator)
-a
-a
[ "-", "a" ]
def __neg__(a): """-a""" return Fraction(-a._numerator, a._denominator)
[ "def", "__neg__", "(", "a", ")", ":", "return", "Fraction", "(", "-", "a", ".", "_numerator", ",", "a", ".", "_denominator", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/fractions.py#L493-L495
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py
python
obj_analysis.is_result_map_multi
(self)
return (self.result_type == 'multimap')
Returns true if this is a multi map type.
Returns true if this is a multi map type.
[ "Returns", "true", "if", "this", "is", "a", "multi", "map", "type", "." ]
def is_result_map_multi(self): """ Returns true if this is a multi map type. """ return (self.result_type == 'multimap')
[ "def", "is_result_map_multi", "(", "self", ")", ":", "return", "(", "self", ".", "result_type", "==", "'multimap'", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py#L1966-L1968
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/google/protobuf/internal/well_known_types.py
python
Duration.FromMilliseconds
(self, millis)
Converts milliseconds to Duration.
Converts milliseconds to Duration.
[ "Converts", "milliseconds", "to", "Duration", "." ]
def FromMilliseconds(self, millis): """Converts milliseconds to Duration.""" self._NormalizeDuration( millis // _MILLIS_PER_SECOND, (millis % _MILLIS_PER_SECOND) * _NANOS_PER_MILLISECOND)
[ "def", "FromMilliseconds", "(", "self", ",", "millis", ")", ":", "self", ".", "_NormalizeDuration", "(", "millis", "//", "_MILLIS_PER_SECOND", ",", "(", "millis", "%", "_MILLIS_PER_SECOND", ")", "*", "_NANOS_PER_MILLISECOND", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/internal/well_known_types.py#L330-L334
runtimejs/runtime
0a6e84c30823d35a4548d6634166784260ae7b74
deps/v8/tools/stats-viewer.py
python
ChromeCounter.Name
(self)
return result
Return the ascii name of this counter.
Return the ascii name of this counter.
[ "Return", "the", "ascii", "name", "of", "this", "counter", "." ]
def Name(self): """Return the ascii name of this counter.""" result = "" index = self.name_offset current = self.data.ByteAt(index) while current: result += chr(current) index += 1 current = self.data.ByteAt(index) return result
[ "def", "Name", "(", "self", ")", ":", "result", "=", "\"\"", "index", "=", "self", ".", "name_offset", "current", "=", "self", ".", "data", ".", "ByteAt", "(", "index", ")", "while", "current", ":", "result", "+=", "chr", "(", "current", ")", "index"...
https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/tools/stats-viewer.py#L402-L411
pristineio/webrtc-mirror
7a5bcdffaab90a05bc1146b2b1ea71c004e54d71
tools_webrtc/valgrind/common.py
python
NormalizeWindowsPath
(path)
If we're using Cygwin Python, turn the path into a Windows path. Don't turn forward slashes into backslashes for easier copy-pasting and escaping. TODO(rnk): If we ever want to cut out the subprocess invocation, we can use _winreg to get the root Cygwin directory from the registry key: HKEY_LOCAL_MACHINE\SO...
If we're using Cygwin Python, turn the path into a Windows path.
[ "If", "we", "re", "using", "Cygwin", "Python", "turn", "the", "path", "into", "a", "Windows", "path", "." ]
def NormalizeWindowsPath(path): """If we're using Cygwin Python, turn the path into a Windows path. Don't turn forward slashes into backslashes for easier copy-pasting and escaping. TODO(rnk): If we ever want to cut out the subprocess invocation, we can use _winreg to get the root Cygwin directory from the ...
[ "def", "NormalizeWindowsPath", "(", "path", ")", ":", "if", "sys", ".", "platform", ".", "startswith", "(", "\"cygwin\"", ")", ":", "p", "=", "subprocess", ".", "Popen", "(", "[", "\"cygpath\"", ",", "\"-m\"", ",", "path", "]", ",", "stdout", "=", "sub...
https://github.com/pristineio/webrtc-mirror/blob/7a5bcdffaab90a05bc1146b2b1ea71c004e54d71/tools_webrtc/valgrind/common.py#L214-L233
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
FileTypeInfo.SetIcon
(*args, **kwargs)
return _misc_.FileTypeInfo_SetIcon(*args, **kwargs)
SetIcon(self, String iconFile, int iconIndex=0)
SetIcon(self, String iconFile, int iconIndex=0)
[ "SetIcon", "(", "self", "String", "iconFile", "int", "iconIndex", "=", "0", ")" ]
def SetIcon(*args, **kwargs): """SetIcon(self, String iconFile, int iconIndex=0)""" return _misc_.FileTypeInfo_SetIcon(*args, **kwargs)
[ "def", "SetIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "FileTypeInfo_SetIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L2507-L2509
asLody/whale
6a661b27cc4cf83b7b5a3b02451597ee1ac7f264
whale/cpplint.py
python
NestingState.InNamespaceBody
(self)
return self.stack and isinstance(self.stack[-1], _NamespaceInfo)
Check if we are currently one level inside a namespace body. Returns: True if top of the stack is a namespace block, False otherwise.
Check if we are currently one level inside a namespace body.
[ "Check", "if", "we", "are", "currently", "one", "level", "inside", "a", "namespace", "body", "." ]
def InNamespaceBody(self): """Check if we are currently one level inside a namespace body. Returns: True if top of the stack is a namespace block, False otherwise. """ return self.stack and isinstance(self.stack[-1], _NamespaceInfo)
[ "def", "InNamespaceBody", "(", "self", ")", ":", "return", "self", ".", "stack", "and", "isinstance", "(", "self", ".", "stack", "[", "-", "1", "]", ",", "_NamespaceInfo", ")" ]
https://github.com/asLody/whale/blob/6a661b27cc4cf83b7b5a3b02451597ee1ac7f264/whale/cpplint.py#L2441-L2447
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/cr/cr/actions/debugger.py
python
Debugger.Attach
(self, context, targets, arguments)
Attach a debugger to a running program.
Attach a debugger to a running program.
[ "Attach", "a", "debugger", "to", "a", "running", "program", "." ]
def Attach(self, context, targets, arguments): """Attach a debugger to a running program.""" raise NotImplementedError('Must be overridden.')
[ "def", "Attach", "(", "self", ",", "context", ",", "targets", ",", "arguments", ")", ":", "raise", "NotImplementedError", "(", "'Must be overridden.'", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/cr/cr/actions/debugger.py#L49-L51
llvm-dcpu16/llvm-dcpu16
ae6b01fecd03219677e391d4421df5d966d80dcf
utils/lint/common_lint.py
python
VerifyLineLength
(filename, lines, max_length)
return lint
Checks to make sure the file has no lines with lines exceeding the length limit. Args: filename: the file under consideration as string lines: contents of the file as string array max_length: maximum acceptable line length as number Returns: A list of tuples with format [(filename, line number, ...
Checks to make sure the file has no lines with lines exceeding the length limit.
[ "Checks", "to", "make", "sure", "the", "file", "has", "no", "lines", "with", "lines", "exceeding", "the", "length", "limit", "." ]
def VerifyLineLength(filename, lines, max_length): """Checks to make sure the file has no lines with lines exceeding the length limit. Args: filename: the file under consideration as string lines: contents of the file as string array max_length: maximum acceptable line length as number Returns: ...
[ "def", "VerifyLineLength", "(", "filename", ",", "lines", ",", "max_length", ")", ":", "lint", "=", "[", "]", "line_num", "=", "1", "for", "line", "in", "lines", ":", "length", "=", "len", "(", "line", ".", "rstrip", "(", "'\\n'", ")", ")", "if", "...
https://github.com/llvm-dcpu16/llvm-dcpu16/blob/ae6b01fecd03219677e391d4421df5d966d80dcf/utils/lint/common_lint.py#L7-L28
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/data_structures/sarray.py
python
SArray.sort
(self, ascending=True)
return sf.sort("a", ascending)["a"]
Sort all values in this SArray. Sort only works for sarray of type str, int and float, otherwise TypeError will be raised. Creates a new, sorted SArray. Parameters ---------- ascending: boolean, optional If true, the sarray values are sorted in ascending order, other...
Sort all values in this SArray.
[ "Sort", "all", "values", "in", "this", "SArray", "." ]
def sort(self, ascending=True): """ Sort all values in this SArray. Sort only works for sarray of type str, int and float, otherwise TypeError will be raised. Creates a new, sorted SArray. Parameters ---------- ascending: boolean, optional If true, th...
[ "def", "sort", "(", "self", ",", "ascending", "=", "True", ")", ":", "from", ".", "sframe", "import", "SFrame", "as", "_SFrame", "if", "self", ".", "dtype", "not", "in", "(", "int", ",", "float", ",", "str", ",", "datetime", ".", "datetime", ")", "...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sarray.py#L3634-L3667
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.GetModify
(*args, **kwargs)
return _stc.StyledTextCtrl_GetModify(*args, **kwargs)
GetModify(self) -> bool Is the document different from when it was last saved?
GetModify(self) -> bool
[ "GetModify", "(", "self", ")", "-", ">", "bool" ]
def GetModify(*args, **kwargs): """ GetModify(self) -> bool Is the document different from when it was last saved? """ return _stc.StyledTextCtrl_GetModify(*args, **kwargs)
[ "def", "GetModify", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_GetModify", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L3569-L3575
CleverRaven/Cataclysm-DDA
03e7363df0835ec1b39da973ea29f26f27833b38
tools/gfx_tools/compose.py
python
write_to_json
( pathname: str, data: Union[dict, list], format_json: bool = False, )
Write data to a JSON file
Write data to a JSON file
[ "Write", "data", "to", "a", "JSON", "file" ]
def write_to_json( pathname: str, data: Union[dict, list], format_json: bool = False, ) -> None: ''' Write data to a JSON file ''' kwargs = { 'ensure_ascii': False, } if format_json: kwargs['indent'] = 2 with open(pathname, 'w', encoding="utf-8") as file: ...
[ "def", "write_to_json", "(", "pathname", ":", "str", ",", "data", ":", "Union", "[", "dict", ",", "list", "]", ",", "format_json", ":", "bool", "=", "False", ",", ")", "->", "None", ":", "kwargs", "=", "{", "'ensure_ascii'", ":", "False", ",", "}", ...
https://github.com/CleverRaven/Cataclysm-DDA/blob/03e7363df0835ec1b39da973ea29f26f27833b38/tools/gfx_tools/compose.py#L157-L184
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/fixes/fix_metaclass.py
python
fixup_simple_stmt
(parent, i, stmt_node)
if there is a semi-colon all the parts count as part of the same simple_stmt. We just want the __metaclass__ part so we move everything after the semi-colon into its own simple_stmt node
if there is a semi-colon all the parts count as part of the same simple_stmt. We just want the __metaclass__ part so we move everything after the semi-colon into its own simple_stmt node
[ "if", "there", "is", "a", "semi", "-", "colon", "all", "the", "parts", "count", "as", "part", "of", "the", "same", "simple_stmt", ".", "We", "just", "want", "the", "__metaclass__", "part", "so", "we", "move", "everything", "after", "the", "semi", "-", ...
def fixup_simple_stmt(parent, i, stmt_node): """ if there is a semi-colon all the parts count as part of the same simple_stmt. We just want the __metaclass__ part so we move everything after the semi-colon into its own simple_stmt node """ for semi_ind, node in enumerate(stmt_node.children)...
[ "def", "fixup_simple_stmt", "(", "parent", ",", "i", ",", "stmt_node", ")", ":", "for", "semi_ind", ",", "node", "in", "enumerate", "(", "stmt_node", ".", "children", ")", ":", "if", "node", ".", "type", "==", "token", ".", "SEMI", ":", "# *sigh*", "br...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/fixes/fix_metaclass.py#L71-L92
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/eager/graph_only_ops.py
python
graph_placeholder
(dtype, shape, name=None)
return result
Graph-only version of tf.placeholder(), for internal use only.
Graph-only version of tf.placeholder(), for internal use only.
[ "Graph", "-", "only", "version", "of", "tf", ".", "placeholder", "()", "for", "internal", "use", "only", "." ]
def graph_placeholder(dtype, shape, name=None): """Graph-only version of tf.placeholder(), for internal use only.""" dtype = dtype.base_dtype dtype_value = attr_value_pb2.AttrValue(type=dtype.as_datatype_enum) if isinstance(shape, (list, tuple)): shape = tensor_shape.TensorShape(shape) assert isinstance(s...
[ "def", "graph_placeholder", "(", "dtype", ",", "shape", ",", "name", "=", "None", ")", ":", "dtype", "=", "dtype", ".", "base_dtype", "dtype_value", "=", "attr_value_pb2", ".", "AttrValue", "(", "type", "=", "dtype", ".", "as_datatype_enum", ")", "if", "is...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/graph_only_ops.py#L41-L54
InsightSoftwareConsortium/ITK
87acfce9a93d928311c38bc371b666b515b9f19d
Modules/ThirdParty/pygccxml/src/pygccxml/declarations/declarations_matchers.py
python
operator_matcher_t.__init__
( self, name=None, symbol=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None)
:param symbol: operator symbol :type symbol: str
:param symbol: operator symbol :type symbol: str
[ ":", "param", "symbol", ":", "operator", "symbol", ":", "type", "symbol", ":", "str" ]
def __init__( self, name=None, symbol=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None): """ :param symbol: operator symbol :type symbol: str """ ...
[ "def", "__init__", "(", "self", ",", "name", "=", "None", ",", "symbol", "=", "None", ",", "return_type", "=", "None", ",", "arg_types", "=", "None", ",", "decl_type", "=", "None", ",", "header_dir", "=", "None", ",", "header_file", "=", "None", ")", ...
https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/declarations_matchers.py#L359-L382
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.__setitem__
(self, key, value)
Sets the item on the specified position.
Sets the item on the specified position.
[ "Sets", "the", "item", "on", "the", "specified", "position", "." ]
def __setitem__(self, key, value): """Sets the item on the specified position.""" if isinstance(key, slice): # PY3 if key.step is not None: raise ValueError('Extended slices not supported') self.__setslice__(key.start, key.stop, value) else: self._values[key] = self._type_checker....
[ "def", "__setitem__", "(", "self", ",", "key", ",", "value", ")", ":", "if", "isinstance", "(", "key", ",", "slice", ")", ":", "# PY3", "if", "key", ".", "step", "is", "not", "None", ":", "raise", "ValueError", "(", "'Extended slices not supported'", ")"...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/containers.py#L298-L306
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
library/python/hnsw/hnsw/hnsw.py
python
OnlineHnsw.get_nearest_and_add_item
(self, query)
return self._online_index._get_nearest_neighbors_and_add_item(query)
Get approximate nearest neighbors for query from index and add item to index Parameters ---------- query : list or numpy.ndarray Vector for which nearest neighbors should be found. Vector which should be added in index. Returns ------- neighbors ...
Get approximate nearest neighbors for query from index and add item to index
[ "Get", "approximate", "nearest", "neighbors", "for", "query", "from", "index", "and", "add", "item", "to", "index" ]
def get_nearest_and_add_item(self, query): """ Get approximate nearest neighbors for query from index and add item to index Parameters ---------- query : list or numpy.ndarray Vector for which nearest neighbors should be found. Vector which should be adde...
[ "def", "get_nearest_and_add_item", "(", "self", ",", "query", ")", ":", "return", "self", ".", "_online_index", ".", "_get_nearest_neighbors_and_add_item", "(", "query", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/library/python/hnsw/hnsw/hnsw.py#L587-L601
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
ToolBarToolBase.SetDropdownMenu
(*args, **kwargs)
return _controls_.ToolBarToolBase_SetDropdownMenu(*args, **kwargs)
SetDropdownMenu(self, Menu menu)
SetDropdownMenu(self, Menu menu)
[ "SetDropdownMenu", "(", "self", "Menu", "menu", ")" ]
def SetDropdownMenu(*args, **kwargs): """SetDropdownMenu(self, Menu menu)""" return _controls_.ToolBarToolBase_SetDropdownMenu(*args, **kwargs)
[ "def", "SetDropdownMenu", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ToolBarToolBase_SetDropdownMenu", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L3561-L3563
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/packager.py
python
Distro.name
(self)
return self.dname
Return name.
Return name.
[ "Return", "name", "." ]
def name(self): """Return name.""" return self.dname
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "dname" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/packager.py#L180-L182
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/build/android/pylib/android_commands.py
python
_GetFilesFromRecursiveLsOutput
(path, ls_output, re_file, utc_offset=None)
return files
Gets a list of files from `ls` command output. Python's os.walk isn't used because it doesn't work over adb shell. Args: path: The path to list. ls_output: A list of lines returned by an `ls -lR` command. re_file: A compiled regular expression which parses a line into named groups consisting o...
Gets a list of files from `ls` command output.
[ "Gets", "a", "list", "of", "files", "from", "ls", "command", "output", "." ]
def _GetFilesFromRecursiveLsOutput(path, ls_output, re_file, utc_offset=None): """Gets a list of files from `ls` command output. Python's os.walk isn't used because it doesn't work over adb shell. Args: path: The path to list. ls_output: A list of lines returned by an `ls -lR` command. re_file: A co...
[ "def", "_GetFilesFromRecursiveLsOutput", "(", "path", ",", "ls_output", ",", "re_file", ",", "utc_offset", "=", "None", ")", ":", "re_directory", "=", "re", ".", "compile", "(", "'^%s/(?P<dir>[^:]+):$'", "%", "re", ".", "escape", "(", "path", ")", ")", "path...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/build/android/pylib/android_commands.py#L110-L160
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/combo.py
python
BitmapComboBox.Append
(*args, **kwargs)
return _combo.BitmapComboBox_Append(*args, **kwargs)
Append(self, String item, Bitmap bitmap=wxNullBitmap, PyObject clientData=None) -> int Adds the item to the control, associating the given data with the item if not None. The return value is the index of the newly added item.
Append(self, String item, Bitmap bitmap=wxNullBitmap, PyObject clientData=None) -> int
[ "Append", "(", "self", "String", "item", "Bitmap", "bitmap", "=", "wxNullBitmap", "PyObject", "clientData", "=", "None", ")", "-", ">", "int" ]
def Append(*args, **kwargs): """ Append(self, String item, Bitmap bitmap=wxNullBitmap, PyObject clientData=None) -> int Adds the item to the control, associating the given data with the item if not None. The return value is the index of the newly added item. """ return ...
[ "def", "Append", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_combo", ".", "BitmapComboBox_Append", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/combo.py#L971-L978
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/training/summary_io.py
python
SummaryWriter.__init__
(self, logdir, graph=None, max_queue=10, flush_secs=120, graph_def=None)
Creates a `SummaryWriter` and an event file. This class is deprecated, and should be replaced with tf.summary.FileWriter. On construction the summary writer creates a new event file in `logdir`. This event file will contain `Event` protocol buffers constructed when you call one of the following functi...
Creates a `SummaryWriter` and an event file.
[ "Creates", "a", "SummaryWriter", "and", "an", "event", "file", "." ]
def __init__(self, logdir, graph=None, max_queue=10, flush_secs=120, graph_def=None): """Creates a `SummaryWriter` and an event file. This class is deprecated, and should be replaced with tf.summary.FileWriter. On construction the ...
[ "def", "__init__", "(", "self", ",", "logdir", ",", "graph", "=", "None", ",", "max_queue", "=", "10", ",", "flush_secs", "=", "120", ",", "graph_def", "=", "None", ")", ":", "super", "(", "SummaryWriter", ",", "self", ")", ".", "__init__", "(", "log...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/summary_io.py#L34-L81
GoldenCheetah/GoldenCheetah
919a418895040144be5579884446ed6cd701bf0d
util/gh-downloads.py
python
download_stats
(user=None, repo=None, tag=None, latest=False, token=None, quiet=False)
return stats
Get download statistics from GitHub API. :param user: GitHub repository owner username. If empty, user will be prompted for input. :param repo: GitHub repository name. If empty, user will be prompted for input. :param tag: Release tag name. If empty, get stats for all releases. :param latest: If True, i...
Get download statistics from GitHub API. :param user: GitHub repository owner username. If empty, user will be prompted for input. :param repo: GitHub repository name. If empty, user will be prompted for input. :param tag: Release tag name. If empty, get stats for all releases. :param latest: If True, i...
[ "Get", "download", "statistics", "from", "GitHub", "API", ".", ":", "param", "user", ":", "GitHub", "repository", "owner", "username", ".", "If", "empty", "user", "will", "be", "prompted", "for", "input", ".", ":", "param", "repo", ":", "GitHub", "reposito...
def download_stats(user=None, repo=None, tag=None, latest=False, token=None, quiet=False): """ Get download statistics from GitHub API. :param user: GitHub repository owner username. If empty, user will be prompted for input. :param repo: GitHub repository name. If empty, user will be prompted for input...
[ "def", "download_stats", "(", "user", "=", "None", ",", "repo", "=", "None", ",", "tag", "=", "None", ",", "latest", "=", "False", ",", "token", "=", "None", ",", "quiet", "=", "False", ")", ":", "if", "not", "user", ":", "user", "=", "input", "(...
https://github.com/GoldenCheetah/GoldenCheetah/blob/919a418895040144be5579884446ed6cd701bf0d/util/gh-downloads.py#L171-L214
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
Printer.PrintDialog
(*args, **kwargs)
return _windows_.Printer_PrintDialog(*args, **kwargs)
PrintDialog(self, Window parent) -> DC
PrintDialog(self, Window parent) -> DC
[ "PrintDialog", "(", "self", "Window", "parent", ")", "-", ">", "DC" ]
def PrintDialog(*args, **kwargs): """PrintDialog(self, Window parent) -> DC""" return _windows_.Printer_PrintDialog(*args, **kwargs)
[ "def", "PrintDialog", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Printer_PrintDialog", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L5231-L5233
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
PreDirFilterListCtrl
(*args, **kwargs)
return val
PreDirFilterListCtrl() -> DirFilterListCtrl
PreDirFilterListCtrl() -> DirFilterListCtrl
[ "PreDirFilterListCtrl", "()", "-", ">", "DirFilterListCtrl" ]
def PreDirFilterListCtrl(*args, **kwargs): """PreDirFilterListCtrl() -> DirFilterListCtrl""" val = _controls_.new_PreDirFilterListCtrl(*args, **kwargs) return val
[ "def", "PreDirFilterListCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_controls_", ".", "new_PreDirFilterListCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5813-L5816
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/coverage/coverage/results.py
python
Analysis.has_arcs
(self)
return self.data.has_arcs()
Were arcs measured in this result?
Were arcs measured in this result?
[ "Were", "arcs", "measured", "in", "this", "result?" ]
def has_arcs(self): """Were arcs measured in this result?""" return self.data.has_arcs()
[ "def", "has_arcs", "(", "self", ")", ":", "return", "self", ".", "data", ".", "has_arcs", "(", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/results.py#L61-L63
esphome/esphome
40e06c9819f17409615d4f4eec5cfe4dc9a3776d
esphome/yaml_util.py
python
_find_files
(directory, pattern)
Recursively load files in a directory.
Recursively load files in a directory.
[ "Recursively", "load", "files", "in", "a", "directory", "." ]
def _find_files(directory, pattern): """Recursively load files in a directory.""" for root, dirs, files in os.walk(directory, topdown=True): dirs[:] = [d for d in dirs if _is_file_valid(d)] for basename in files: if _is_file_valid(basename) and fnmatch.fnmatch(basename, pattern): ...
[ "def", "_find_files", "(", "directory", ",", "pattern", ")", ":", "for", "root", ",", "dirs", ",", "files", "in", "os", ".", "walk", "(", "directory", ",", "topdown", "=", "True", ")", ":", "dirs", "[", ":", "]", "=", "[", "d", "for", "d", "in", ...
https://github.com/esphome/esphome/blob/40e06c9819f17409615d4f4eec5cfe4dc9a3776d/esphome/yaml_util.py#L363-L370
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/ssd/tools/caffe_converter/convert_symbol.py
python
_parse_proto
(prototxt_fname)
return symbol_string, output_name, input_dim
Parse Caffe prototxt into symbol string
Parse Caffe prototxt into symbol string
[ "Parse", "Caffe", "prototxt", "into", "symbol", "string" ]
def _parse_proto(prototxt_fname): """Parse Caffe prototxt into symbol string """ proto = caffe_parser.read_prototxt(prototxt_fname) # process data layer input_name, input_dim, layers = _get_input(proto) # only support single input, so always use `data` as the input data mapping = {input_nam...
[ "def", "_parse_proto", "(", "prototxt_fname", ")", ":", "proto", "=", "caffe_parser", ".", "read_prototxt", "(", "prototxt_fname", ")", "# process data layer", "input_name", ",", "input_dim", ",", "layers", "=", "_get_input", "(", "proto", ")", "# only support singl...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/ssd/tools/caffe_converter/convert_symbol.py#L129-L359
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/frame.py
python
DataFrame.update
(self, other, join='left', overwrite=True, filter_func=None, errors='ignore')
Modify in place using non-NA values from another DataFrame. Aligns on indices. There is no return value. Parameters ---------- other : DataFrame, or object coercible into a DataFrame Should have at least one matching index/column label with the original DataFram...
Modify in place using non-NA values from another DataFrame.
[ "Modify", "in", "place", "using", "non", "-", "NA", "values", "from", "another", "DataFrame", "." ]
def update(self, other, join='left', overwrite=True, filter_func=None, errors='ignore'): """ Modify in place using non-NA values from another DataFrame. Aligns on indices. There is no return value. Parameters ---------- other : DataFrame, or object coerci...
[ "def", "update", "(", "self", ",", "other", ",", "join", "=", "'left'", ",", "overwrite", "=", "True", ",", "filter_func", "=", "None", ",", "errors", "=", "'ignore'", ")", ":", "import", "pandas", ".", "core", ".", "computation", ".", "expressions", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/frame.py#L5368-L5516
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/sessions.py
python
Session.delete
(self, url, **kwargs)
return self.request('DELETE', url, **kwargs)
r"""Sends a DELETE request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response
r"""Sends a DELETE request. Returns :class:`Response` object.
[ "r", "Sends", "a", "DELETE", "request", ".", "Returns", ":", "class", ":", "Response", "object", "." ]
def delete(self, url, **kwargs): r"""Sends a DELETE request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ return self.request('DELETE', ...
[ "def", "delete", "(", "self", ",", "url", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "request", "(", "'DELETE'", ",", "url", ",", "*", "*", "kwargs", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/sessions.py#L604-L612
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/misc_util.py
python
Configuration.__init__
(self, package_name=None, parent_name=None, top_path=None, package_path=None, caller_level=1, setup_name='setup.py', **attrs)
Construct configuration instance of a package. package_name -- name of the package Ex.: 'distutils' parent_name -- name of the parent package Ex.: 'numpy' top_path -- directory of the toplevel package Ex.: the director...
Construct configuration instance of a package.
[ "Construct", "configuration", "instance", "of", "a", "package", "." ]
def __init__(self, package_name=None, parent_name=None, top_path=None, package_path=None, caller_level=1, setup_name='setup.py', **attrs): """Construct configuration instance of a package. ...
[ "def", "__init__", "(", "self", ",", "package_name", "=", "None", ",", "parent_name", "=", "None", ",", "top_path", "=", "None", ",", "package_path", "=", "None", ",", "caller_level", "=", "1", ",", "setup_name", "=", "'setup.py'", ",", "*", "*", "attrs"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/misc_util.py#L741-L836
moflow/moflow
2dfb27c799c90c6caf1477508eca3eec616ef7d2
bap/libtracewrap/libtrace/protobuf/python/google/protobuf/message.py
python
Message.__getstate__
(self)
return dict(serialized=self.SerializePartialToString())
Support the pickle protocol.
Support the pickle protocol.
[ "Support", "the", "pickle", "protocol", "." ]
def __getstate__(self): """Support the pickle protocol.""" return dict(serialized=self.SerializePartialToString())
[ "def", "__getstate__", "(", "self", ")", ":", "return", "dict", "(", "serialized", "=", "self", ".", "SerializePartialToString", "(", ")", ")" ]
https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/message.py#L273-L275
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pathlib2/pathlib2/__init__.py
python
PurePath.anchor
(self)
return anchor
The concatenation of the drive and root, or ''.
The concatenation of the drive and root, or ''.
[ "The", "concatenation", "of", "the", "drive", "and", "root", "or", "." ]
def anchor(self): """The concatenation of the drive and root, or ''.""" anchor = self._drv + self._root return anchor
[ "def", "anchor", "(", "self", ")", ":", "anchor", "=", "self", ".", "_drv", "+", "self", ".", "_root", "return", "anchor" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pathlib2/pathlib2/__init__.py#L1034-L1037
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
Label.__init__
(self, master=None, cnf={}, **kw)
Construct a label widget with the parent MASTER. STANDARD OPTIONS activebackground, activeforeground, anchor, background, bitmap, borderwidth, cursor, disabledforeground, font, foreground, highlightbackground, highlightcolor, highlightthickness, imag...
Construct a label widget with the parent MASTER.
[ "Construct", "a", "label", "widget", "with", "the", "parent", "MASTER", "." ]
def __init__(self, master=None, cnf={}, **kw): """Construct a label widget with the parent MASTER. STANDARD OPTIONS activebackground, activeforeground, anchor, background, bitmap, borderwidth, cursor, disabledforeground, font, foreground, highlightbackgr...
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "cnf", "=", "{", "}", ",", "*", "*", "kw", ")", ":", "Widget", ".", "__init__", "(", "self", ",", "master", ",", "'label'", ",", "cnf", ",", "kw", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L2748-L2766
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
DateTime.__lt__
(*args, **kwargs)
return _misc_.DateTime___lt__(*args, **kwargs)
__lt__(self, DateTime other) -> bool
__lt__(self, DateTime other) -> bool
[ "__lt__", "(", "self", "DateTime", "other", ")", "-", ">", "bool" ]
def __lt__(*args, **kwargs): """__lt__(self, DateTime other) -> bool""" return _misc_.DateTime___lt__(*args, **kwargs)
[ "def", "__lt__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime___lt__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4106-L4108
Rid7/Table-OCR
26814d4d4d3a2cd9f6b0155d66dd475927a23d11
crnn/utils/util.py
python
strLabelConverter.encode
(self, text, depth=0)
return (torch.IntTensor(text), torch.IntTensor(length))
Support batch or single str.
Support batch or single str.
[ "Support", "batch", "or", "single", "str", "." ]
def encode(self, text, depth=0): """Support batch or single str.""" if isinstance(text, str): for char in text: if self.alphabet.find(char) == -1: print(char) text = [self.dict[char] for char in text] length = [len(text)] el...
[ "def", "encode", "(", "self", ",", "text", ",", "depth", "=", "0", ")", ":", "if", "isinstance", "(", "text", ",", "str", ")", ":", "for", "char", "in", "text", ":", "if", "self", ".", "alphabet", ".", "find", "(", "char", ")", "==", "-", "1", ...
https://github.com/Rid7/Table-OCR/blob/26814d4d4d3a2cd9f6b0155d66dd475927a23d11/crnn/utils/util.py#L15-L30
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchSite.py
python
_ViewProviderSite.setProperties
(self,vobj)
Give the site view provider its site view provider specific properties. These include solar diagram and compass data, dealing the orientation of the site, and its orientation to the sun. You can learn more about properties here: https://wiki.freecadweb.org/property
Give the site view provider its site view provider specific properties.
[ "Give", "the", "site", "view", "provider", "its", "site", "view", "provider", "specific", "properties", "." ]
def setProperties(self,vobj): """Give the site view provider its site view provider specific properties. These include solar diagram and compass data, dealing the orientation of the site, and its orientation to the sun. You can learn more about properties here: https://wiki.freecadweb....
[ "def", "setProperties", "(", "self", ",", "vobj", ")", ":", "pl", "=", "vobj", ".", "PropertiesList", "if", "not", "\"WindRose\"", "in", "pl", ":", "vobj", ".", "addProperty", "(", "\"App::PropertyBool\"", ",", "\"WindRose\"", ",", "\"Site\"", ",", "QT_TRANS...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchSite.py#L824-L858
epam/Indigo
30e40b4b1eb9bae0207435a26cfcb81ddcc42be1
api/python/indigo/__init__.py
python
IndigoObject.getMolecule
(self, index)
return self.dispatcher.IndigoObject( self.dispatcher, self.dispatcher._checkResult( Indigo._lib.indigoGetMolecule(self.id, index) ), )
Reaction method returns a molecule by index Args: index (int): molecule index Returns: IndigoObject: molecule object
Reaction method returns a molecule by index
[ "Reaction", "method", "returns", "a", "molecule", "by", "index" ]
def getMolecule(self, index): """Reaction method returns a molecule by index Args: index (int): molecule index Returns: IndigoObject: molecule object """ self.dispatcher._setSessionId() return self.dispatcher.IndigoObject( self.dispat...
[ "def", "getMolecule", "(", "self", ",", "index", ")", ":", "self", ".", "dispatcher", ".", "_setSessionId", "(", ")", "return", "self", ".", "dispatcher", ".", "IndigoObject", "(", "self", ".", "dispatcher", ",", "self", ".", "dispatcher", ".", "_checkResu...
https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L465-L480
GoSSIP-SJTU/TripleDoggy
03648d6b19c812504b14e8b98c8c7b3f443f4e54
utils/lit/lit/util.py
python
which
(command, paths=None)
return None
which(command, [paths]) - Look up the given command in the paths string (or the PATH environment variable, if unspecified).
which(command, [paths]) - Look up the given command in the paths string (or the PATH environment variable, if unspecified).
[ "which", "(", "command", "[", "paths", "]", ")", "-", "Look", "up", "the", "given", "command", "in", "the", "paths", "string", "(", "or", "the", "PATH", "environment", "variable", "if", "unspecified", ")", "." ]
def which(command, paths=None): """which(command, [paths]) - Look up the given command in the paths string (or the PATH environment variable, if unspecified).""" if paths is None: paths = os.environ.get('PATH', '') # Check for absolute match first. if os.path.isabs(command) and os.path.isf...
[ "def", "which", "(", "command", ",", "paths", "=", "None", ")", ":", "if", "paths", "is", "None", ":", "paths", "=", "os", ".", "environ", ".", "get", "(", "'PATH'", ",", "''", ")", "# Check for absolute match first.", "if", "os", ".", "path", ".", "...
https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/utils/lit/lit/util.py#L189-L218
strasdat/Sophus
36b08885e094fda63e92ad89d65be380c288265a
sympy/sophus/quaternion.py
python
Quaternion.Da_a_mul_b
(a, b)
return sympy.Matrix([[y, v2, -v1, v0], [-v2, y, v0, v1], [v1, -v0, y, v2], [-v0, -v1, -v2, y]])
derivatice of quaternion muliplication wrt left multiplier a
derivatice of quaternion muliplication wrt left multiplier a
[ "derivatice", "of", "quaternion", "muliplication", "wrt", "left", "multiplier", "a" ]
def Da_a_mul_b(a, b): """ derivatice of quaternion muliplication wrt left multiplier a """ v0 = b.vec[0] v1 = b.vec[1] v2 = b.vec[2] y = b.real return sympy.Matrix([[y, v2, -v1, v0], [-v2, y, v0, v1], [v1, -v0, y, ...
[ "def", "Da_a_mul_b", "(", "a", ",", "b", ")", ":", "v0", "=", "b", ".", "vec", "[", "0", "]", "v1", "=", "b", ".", "vec", "[", "1", "]", "v2", "=", "b", ".", "vec", "[", "2", "]", "y", "=", "b", ".", "real", "return", "sympy", ".", "Mat...
https://github.com/strasdat/Sophus/blob/36b08885e094fda63e92ad89d65be380c288265a/sympy/sophus/quaternion.py#L81-L90
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/generator/msvs.py
python
_ConvertSourcesToFilterHierarchy
(sources, prefix=None, excluded=None, list_excluded=True, msvs_version=None)
return result
Converts a list split source file paths into a vcproj folder hierarchy. Arguments: sources: A list of source file paths split. prefix: A list of source file path layers meant to apply to each of sources. excluded: A set of excluded files. msvs_version: A MSVSVersion object. Returns: A hierarch...
Converts a list split source file paths into a vcproj folder hierarchy.
[ "Converts", "a", "list", "split", "source", "file", "paths", "into", "a", "vcproj", "folder", "hierarchy", "." ]
def _ConvertSourcesToFilterHierarchy(sources, prefix=None, excluded=None, list_excluded=True, msvs_version=None): """Converts a list split source file paths into a vcproj folder hierarchy. Arguments: sources: A list of source file paths split. prefix: A list of source f...
[ "def", "_ConvertSourcesToFilterHierarchy", "(", "sources", ",", "prefix", "=", "None", ",", "excluded", "=", "None", ",", "list_excluded", "=", "True", ",", "msvs_version", "=", "None", ")", ":", "if", "not", "prefix", ":", "prefix", "=", "[", "]", "result...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/msvs.py#L180-L242
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/automate/automate-git.py
python
get_chromium_main_commit
(position)
return None
Returns the main commit for the specified Chromium commit position.
Returns the main commit for the specified Chromium commit position.
[ "Returns", "the", "main", "commit", "for", "the", "specified", "Chromium", "commit", "position", "." ]
def get_chromium_main_commit(position): """ Returns the main commit for the specified Chromium commit position. """ cmd = '%s log -1 --grep=refs/heads/master@{#%s} --grep=refs/heads/main@{#%s} origin/main' % ( git_exe, str(position), str(position)) result = exec_cmd(cmd, chromium_src_dir) if result['out']...
[ "def", "get_chromium_main_commit", "(", "position", ")", ":", "cmd", "=", "'%s log -1 --grep=refs/heads/master@{#%s} --grep=refs/heads/main@{#%s} origin/main'", "%", "(", "git_exe", ",", "str", "(", "position", ")", ",", "str", "(", "position", ")", ")", "result", "="...
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/automate/automate-git.py#L385-L394
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/number-of-students-unable-to-eat-lunch.py
python
Solution.countStudents
(self, students, sandwiches)
return len(sandwiches)-i
:type students: List[int] :type sandwiches: List[int] :rtype: int
:type students: List[int] :type sandwiches: List[int] :rtype: int
[ ":", "type", "students", ":", "List", "[", "int", "]", ":", "type", "sandwiches", ":", "List", "[", "int", "]", ":", "rtype", ":", "int" ]
def countStudents(self, students, sandwiches): """ :type students: List[int] :type sandwiches: List[int] :rtype: int """ count = collections.Counter(students) for i, s in enumerate(sandwiches): if not count[s]: break count[s...
[ "def", "countStudents", "(", "self", ",", "students", ",", "sandwiches", ")", ":", "count", "=", "collections", ".", "Counter", "(", "students", ")", "for", "i", ",", "s", "in", "enumerate", "(", "sandwiches", ")", ":", "if", "not", "count", "[", "s", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/number-of-students-unable-to-eat-lunch.py#L8-L21
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/dataset.py
python
InMemoryDataset.global_shuffle
(self, fleet=None, thread_num=12)
Global shuffle. Global shuffle can be used only in distributed mode. i.e. multiple processes on single machine or multiple machines training together. If you run in distributed mode, you should pass fleet instead of None. Examples: .. code-block:: python # req...
Global shuffle. Global shuffle can be used only in distributed mode. i.e. multiple processes on single machine or multiple machines training together. If you run in distributed mode, you should pass fleet instead of None.
[ "Global", "shuffle", ".", "Global", "shuffle", "can", "be", "used", "only", "in", "distributed", "mode", ".", "i", ".", "e", ".", "multiple", "processes", "on", "single", "machine", "or", "multiple", "machines", "training", "together", ".", "If", "you", "r...
def global_shuffle(self, fleet=None, thread_num=12): """ Global shuffle. Global shuffle can be used only in distributed mode. i.e. multiple processes on single machine or multiple machines training together. If you run in distributed mode, you should pass fleet instead of None. ...
[ "def", "global_shuffle", "(", "self", ",", "fleet", "=", "None", ",", "thread_num", "=", "12", ")", ":", "from", "paddle", ".", "fluid", ".", "incubate", ".", "fleet", ".", "parameter_server", ".", "pslib", "import", "PSLib", "if", "fleet", "is", "not", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dataset.py#L841-L898
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/idl/idl/struct_types.py
python
StructTypeInfoBase.get_op_msg_request_serializer_method
(self)
Get the OpMsg serializer method for a struct.
Get the OpMsg serializer method for a struct.
[ "Get", "the", "OpMsg", "serializer", "method", "for", "a", "struct", "." ]
def get_op_msg_request_serializer_method(self): # type: () -> Optional[MethodInfo] """Get the OpMsg serializer method for a struct.""" # pylint: disable=invalid-name pass
[ "def", "get_op_msg_request_serializer_method", "(", "self", ")", ":", "# type: () -> Optional[MethodInfo]", "# pylint: disable=invalid-name", "pass" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/struct_types.py#L164-L168
potassco/clingo
e0c91d8f95cc28de1c480a871f9c97c30de83d40
.github/manylinux.py
python
adjust_version
(url)
Adjust version in setup.py.
Adjust version in setup.py.
[ "Adjust", "version", "in", "setup", ".", "py", "." ]
def adjust_version(url): ''' Adjust version in setup.py. ''' with open('setup.py') as fr: setup = fr.read() package_name = search(r'''name[ ]*=[ ]*['"]([^'"]*)['"]''', setup).group(1) package_regex = package_name.replace('-', '[-_]') pip = check_output(['curl', '-sL', '{}/{}'.forma...
[ "def", "adjust_version", "(", "url", ")", ":", "with", "open", "(", "'setup.py'", ")", "as", "fr", ":", "setup", "=", "fr", ".", "read", "(", ")", "package_name", "=", "search", "(", "r'''name[ ]*=[ ]*['\"]([^'\"]*)['\"]'''", ",", "setup", ")", ".", "group...
https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/.github/manylinux.py#L14-L47
llvm-mirror/lldb
d01083a850f577b85501a0902b52fd0930de72c7
third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py
python
SpawnBase.fileno
(self)
return self.child_fd
Expose file descriptor for a file-like interface
Expose file descriptor for a file-like interface
[ "Expose", "file", "descriptor", "for", "a", "file", "-", "like", "interface" ]
def fileno(self): '''Expose file descriptor for a file-like interface ''' return self.child_fd
[ "def", "fileno", "(", "self", ")", ":", "return", "self", ".", "child_fd" ]
https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py#L501-L504
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/core/numeric.py
python
indices
(dimensions, dtype=int, sparse=False)
return res
Return an array representing the indices of a grid. Compute an array where the subarrays contain index values 0, 1, ... varying only along the corresponding axis. Parameters ---------- dimensions : sequence of ints The shape of the grid. dtype : dtype, optional Data type of the...
Return an array representing the indices of a grid.
[ "Return", "an", "array", "representing", "the", "indices", "of", "a", "grid", "." ]
def indices(dimensions, dtype=int, sparse=False): """ Return an array representing the indices of a grid. Compute an array where the subarrays contain index values 0, 1, ... varying only along the corresponding axis. Parameters ---------- dimensions : sequence of ints The shape of ...
[ "def", "indices", "(", "dimensions", ",", "dtype", "=", "int", ",", "sparse", "=", "False", ")", ":", "dimensions", "=", "tuple", "(", "dimensions", ")", "N", "=", "len", "(", "dimensions", ")", "shape", "=", "(", "1", ",", ")", "*", "N", "if", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/numeric.py#L1680-L1779