repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
partition
stringclasses
1 value
pmuller/versions
versions/packages.py
Package.build_options
def build_options(self): """The package build options. :returns: :func:`set` of build options strings. """ if self.version.build_metadata: return set(self.version.build_metadata.split('.')) else: return set()
python
def build_options(self): """The package build options. :returns: :func:`set` of build options strings. """ if self.version.build_metadata: return set(self.version.build_metadata.split('.')) else: return set()
[ "def", "build_options", "(", "self", ")", ":", "if", "self", ".", "version", ".", "build_metadata", ":", "return", "set", "(", "self", ".", "version", ".", "build_metadata", ".", "split", "(", "'.'", ")", ")", "else", ":", "return", "set", "(", ")" ]
The package build options. :returns: :func:`set` of build options strings.
[ "The", "package", "build", "options", "." ]
951bc3fd99b6a675190f11ee0752af1d7ff5b440
https://github.com/pmuller/versions/blob/951bc3fd99b6a675190f11ee0752af1d7ff5b440/versions/packages.py#L84-L93
train
bitesofcode/projexui
projexui/widgets/xserialedit.py
XSerialEdit.clearSelection
def clearSelection(self): """ Clears the selected text for this edit. """ first = None editors = self.editors() for editor in editors: if not editor.selectedText(): continue first = first or editor ...
python
def clearSelection(self): """ Clears the selected text for this edit. """ first = None editors = self.editors() for editor in editors: if not editor.selectedText(): continue first = first or editor ...
[ "def", "clearSelection", "(", "self", ")", ":", "first", "=", "None", "editors", "=", "self", ".", "editors", "(", ")", "for", "editor", "in", "editors", ":", "if", "not", "editor", ".", "selectedText", "(", ")", ":", "continue", "first", "=", "first",...
Clears the selected text for this edit.
[ "Clears", "the", "selected", "text", "for", "this", "edit", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L48-L65
train
bitesofcode/projexui
projexui/widgets/xserialedit.py
XSerialEdit.cut
def cut(self): """ Cuts the text from the serial to the clipboard. """ text = self.selectedText() for editor in self.editors(): editor.cut() QtGui.QApplication.clipboard().setText(text)
python
def cut(self): """ Cuts the text from the serial to the clipboard. """ text = self.selectedText() for editor in self.editors(): editor.cut() QtGui.QApplication.clipboard().setText(text)
[ "def", "cut", "(", "self", ")", ":", "text", "=", "self", ".", "selectedText", "(", ")", "for", "editor", "in", "self", ".", "editors", "(", ")", ":", "editor", ".", "cut", "(", ")", "QtGui", ".", "QApplication", ".", "clipboard", "(", ")", ".", ...
Cuts the text from the serial to the clipboard.
[ "Cuts", "the", "text", "from", "the", "serial", "to", "the", "clipboard", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L82-L90
train
bitesofcode/projexui
projexui/widgets/xserialedit.py
XSerialEdit.goBack
def goBack(self): """ Moves the cursor to the end of the previous editor """ index = self.indexOf(self.currentEditor()) if index == -1: return previous = self.editorAt(index - 1) if previous: previous.setFocus() ...
python
def goBack(self): """ Moves the cursor to the end of the previous editor """ index = self.indexOf(self.currentEditor()) if index == -1: return previous = self.editorAt(index - 1) if previous: previous.setFocus() ...
[ "def", "goBack", "(", "self", ")", ":", "index", "=", "self", ".", "indexOf", "(", "self", ".", "currentEditor", "(", ")", ")", "if", "index", "==", "-", "1", ":", "return", "previous", "=", "self", ".", "editorAt", "(", "index", "-", "1", ")", "...
Moves the cursor to the end of the previous editor
[ "Moves", "the", "cursor", "to", "the", "end", "of", "the", "previous", "editor" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L206-L217
train
bitesofcode/projexui
projexui/widgets/xserialedit.py
XSerialEdit.goForward
def goForward(self): """ Moves the cursor to the beginning of the next editor. """ index = self.indexOf(self.currentEditor()) if index == -1: return next = self.editorAt(index + 1) if next: next.setFocus() ne...
python
def goForward(self): """ Moves the cursor to the beginning of the next editor. """ index = self.indexOf(self.currentEditor()) if index == -1: return next = self.editorAt(index + 1) if next: next.setFocus() ne...
[ "def", "goForward", "(", "self", ")", ":", "index", "=", "self", ".", "indexOf", "(", "self", ".", "currentEditor", "(", ")", ")", "if", "index", "==", "-", "1", ":", "return", "next", "=", "self", ".", "editorAt", "(", "index", "+", "1", ")", "i...
Moves the cursor to the beginning of the next editor.
[ "Moves", "the", "cursor", "to", "the", "beginning", "of", "the", "next", "editor", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L219-L230
train
bitesofcode/projexui
projexui/widgets/xserialedit.py
XSerialEdit.selectAll
def selectAll(self): """ Selects the text within all the editors. """ self.blockEditorHandling(True) for editor in self.editors(): editor.selectAll() self.blockEditorHandling(False)
python
def selectAll(self): """ Selects the text within all the editors. """ self.blockEditorHandling(True) for editor in self.editors(): editor.selectAll() self.blockEditorHandling(False)
[ "def", "selectAll", "(", "self", ")", ":", "self", ".", "blockEditorHandling", "(", "True", ")", "for", "editor", "in", "self", ".", "editors", "(", ")", ":", "editor", ".", "selectAll", "(", ")", "self", ".", "blockEditorHandling", "(", "False", ")" ]
Selects the text within all the editors.
[ "Selects", "the", "text", "within", "all", "the", "editors", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L315-L322
train
johnnoone/aioconsul
aioconsul/client/agent_endpoint.py
AgentEndpoint.disable
async def disable(self, reason=None): """Enters maintenance mode Parameters: reason (str): Reason of disabling Returns: bool: ``True`` on success """ params = {"enable": True, "reason": reason} response = await self._api.put("/v1/agent/maintenance...
python
async def disable(self, reason=None): """Enters maintenance mode Parameters: reason (str): Reason of disabling Returns: bool: ``True`` on success """ params = {"enable": True, "reason": reason} response = await self._api.put("/v1/agent/maintenance...
[ "async", "def", "disable", "(", "self", ",", "reason", "=", "None", ")", ":", "params", "=", "{", "\"enable\"", ":", "True", ",", "\"reason\"", ":", "reason", "}", "response", "=", "await", "self", ".", "_api", ".", "put", "(", "\"/v1/agent/maintenance\"...
Enters maintenance mode Parameters: reason (str): Reason of disabling Returns: bool: ``True`` on success
[ "Enters", "maintenance", "mode" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/agent_endpoint.py#L86-L96
train
johnnoone/aioconsul
aioconsul/client/agent_endpoint.py
AgentEndpoint.enable
async def enable(self, reason=None): """Resumes normal operation Parameters: reason (str): Reason of enabling Returns: bool: ``True`` on success """ params = {"enable": False, "reason": reason} response = await self._api.put("/v1/agent/maintenance...
python
async def enable(self, reason=None): """Resumes normal operation Parameters: reason (str): Reason of enabling Returns: bool: ``True`` on success """ params = {"enable": False, "reason": reason} response = await self._api.put("/v1/agent/maintenance...
[ "async", "def", "enable", "(", "self", ",", "reason", "=", "None", ")", ":", "params", "=", "{", "\"enable\"", ":", "False", ",", "\"reason\"", ":", "reason", "}", "response", "=", "await", "self", ".", "_api", ".", "put", "(", "\"/v1/agent/maintenance\"...
Resumes normal operation Parameters: reason (str): Reason of enabling Returns: bool: ``True`` on success
[ "Resumes", "normal", "operation" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/agent_endpoint.py#L98-L108
train
fitnr/buoyant
buoyant/timezone.py
parse_datetime
def parse_datetime(dt): '''Parse an ISO datetime, which Python does buggily.''' d = datetime.strptime(dt[:-1], ISOFORMAT) if dt[-1:] == 'Z': return timezone('utc').localize(d) else: return d
python
def parse_datetime(dt): '''Parse an ISO datetime, which Python does buggily.''' d = datetime.strptime(dt[:-1], ISOFORMAT) if dt[-1:] == 'Z': return timezone('utc').localize(d) else: return d
[ "def", "parse_datetime", "(", "dt", ")", ":", "d", "=", "datetime", ".", "strptime", "(", "dt", "[", ":", "-", "1", "]", ",", "ISOFORMAT", ")", "if", "dt", "[", "-", "1", ":", "]", "==", "'Z'", ":", "return", "timezone", "(", "'utc'", ")", ".",...
Parse an ISO datetime, which Python does buggily.
[ "Parse", "an", "ISO", "datetime", "which", "Python", "does", "buggily", "." ]
ef7a74f9ebd4774629508ccf2c9abb43aa0235c9
https://github.com/fitnr/buoyant/blob/ef7a74f9ebd4774629508ccf2c9abb43aa0235c9/buoyant/timezone.py#L21-L28
train
bitesofcode/projexui
projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py
XOrbBrowserWidget.refreshRecords
def refreshRecords( self ): """ Refreshes the records being loaded by this browser. """ table_type = self.tableType() if ( not table_type ): self._records = RecordSet() return False search = nativestring(self.uiSearchTXT.text()) ...
python
def refreshRecords( self ): """ Refreshes the records being loaded by this browser. """ table_type = self.tableType() if ( not table_type ): self._records = RecordSet() return False search = nativestring(self.uiSearchTXT.text()) ...
[ "def", "refreshRecords", "(", "self", ")", ":", "table_type", "=", "self", ".", "tableType", "(", ")", "if", "(", "not", "table_type", ")", ":", "self", ".", "_records", "=", "RecordSet", "(", ")", "return", "False", "search", "=", "nativestring", "(", ...
Refreshes the records being loaded by this browser.
[ "Refreshes", "the", "records", "being", "loaded", "by", "this", "browser", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L476-L494
train
bitesofcode/projexui
projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py
XOrbBrowserWidget.refreshResults
def refreshResults( self ): """ Joins together the queries from the fixed system, the search, and the query builder to generate a query for the browser to display. """ if ( self.currentMode() == XOrbBrowserWidget.Mode.Detail ): self.refreshDetails() eli...
python
def refreshResults( self ): """ Joins together the queries from the fixed system, the search, and the query builder to generate a query for the browser to display. """ if ( self.currentMode() == XOrbBrowserWidget.Mode.Detail ): self.refreshDetails() eli...
[ "def", "refreshResults", "(", "self", ")", ":", "if", "(", "self", ".", "currentMode", "(", ")", "==", "XOrbBrowserWidget", ".", "Mode", ".", "Detail", ")", ":", "self", ".", "refreshDetails", "(", ")", "elif", "(", "self", ".", "currentMode", "(", ")"...
Joins together the queries from the fixed system, the search, and the query builder to generate a query for the browser to display.
[ "Joins", "together", "the", "queries", "from", "the", "fixed", "system", "the", "search", "and", "the", "query", "builder", "to", "generate", "a", "query", "for", "the", "browser", "to", "display", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L496-L506
train
bitesofcode/projexui
projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py
XOrbBrowserWidget.refreshCards
def refreshCards( self ): """ Refreshes the results for the cards view of the browser. """ cards = self.cardWidget() factory = self.factory() self.setUpdatesEnabled(False) self.blockSignals(True) cards.setUpdatesEnabled(False) ...
python
def refreshCards( self ): """ Refreshes the results for the cards view of the browser. """ cards = self.cardWidget() factory = self.factory() self.setUpdatesEnabled(False) self.blockSignals(True) cards.setUpdatesEnabled(False) ...
[ "def", "refreshCards", "(", "self", ")", ":", "cards", "=", "self", ".", "cardWidget", "(", ")", "factory", "=", "self", ".", "factory", "(", ")", "self", ".", "setUpdatesEnabled", "(", "False", ")", "self", ".", "blockSignals", "(", "True", ")", "card...
Refreshes the results for the cards view of the browser.
[ "Refreshes", "the", "results", "for", "the", "cards", "view", "of", "the", "browser", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L508-L546
train
bitesofcode/projexui
projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py
XOrbBrowserWidget.refreshDetails
def refreshDetails( self ): """ Refreshes the results for the details view of the browser. """ # start off by filtering based on the group selection tree = self.uiRecordsTREE tree.blockSignals(True) tree.setRecordSet(self.records()) tree.blockSigna...
python
def refreshDetails( self ): """ Refreshes the results for the details view of the browser. """ # start off by filtering based on the group selection tree = self.uiRecordsTREE tree.blockSignals(True) tree.setRecordSet(self.records()) tree.blockSigna...
[ "def", "refreshDetails", "(", "self", ")", ":", "tree", "=", "self", ".", "uiRecordsTREE", "tree", ".", "blockSignals", "(", "True", ")", "tree", ".", "setRecordSet", "(", "self", ".", "records", "(", ")", ")", "tree", ".", "blockSignals", "(", "False", ...
Refreshes the results for the details view of the browser.
[ "Refreshes", "the", "results", "for", "the", "details", "view", "of", "the", "browser", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L548-L556
train
bitesofcode/projexui
projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py
XOrbBrowserWidget.refreshThumbnails
def refreshThumbnails( self ): """ Refreshes the thumbnails view of the browser. """ # clear existing items widget = self.thumbnailWidget() widget.setUpdatesEnabled(False) widget.blockSignals(True) widget.clear() widget.setIconSi...
python
def refreshThumbnails( self ): """ Refreshes the thumbnails view of the browser. """ # clear existing items widget = self.thumbnailWidget() widget.setUpdatesEnabled(False) widget.blockSignals(True) widget.clear() widget.setIconSi...
[ "def", "refreshThumbnails", "(", "self", ")", ":", "widget", "=", "self", ".", "thumbnailWidget", "(", ")", "widget", ".", "setUpdatesEnabled", "(", "False", ")", "widget", ".", "blockSignals", "(", "True", ")", "widget", ".", "clear", "(", ")", "widget", ...
Refreshes the thumbnails view of the browser.
[ "Refreshes", "the", "thumbnails", "view", "of", "the", "browser", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L558-L587
train
bitesofcode/projexui
projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py
XOrbBrowserWidget.showGroupMenu
def showGroupMenu( self ): """ Displays the group menu to the user for modification. """ group_active = self.isGroupingActive() group_by = self.groupBy() menu = XMenu(self) menu.setTitle('Grouping Options') menu.setShowTitle(True) ...
python
def showGroupMenu( self ): """ Displays the group menu to the user for modification. """ group_active = self.isGroupingActive() group_by = self.groupBy() menu = XMenu(self) menu.setTitle('Grouping Options') menu.setShowTitle(True) ...
[ "def", "showGroupMenu", "(", "self", ")", ":", "group_active", "=", "self", ".", "isGroupingActive", "(", ")", "group_by", "=", "self", ".", "groupBy", "(", ")", "menu", "=", "XMenu", "(", "self", ")", "menu", ".", "setTitle", "(", "'Grouping Options'", ...
Displays the group menu to the user for modification.
[ "Displays", "the", "group", "menu", "to", "the", "user", "for", "modification", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L743-L811
train
musashiXXX/django-clamav-upload
clamav_upload/__init__.py
get_settings
def get_settings(): """ This function returns a dict containing default settings """ s = getattr(settings, 'CLAMAV_UPLOAD', {}) s = { 'CONTENT_TYPE_CHECK_ENABLED': s.get('CONTENT_TYPE_CHECK_ENABLED', False), # LAST_HANDLER is not a user configurable option; we return ...
python
def get_settings(): """ This function returns a dict containing default settings """ s = getattr(settings, 'CLAMAV_UPLOAD', {}) s = { 'CONTENT_TYPE_CHECK_ENABLED': s.get('CONTENT_TYPE_CHECK_ENABLED', False), # LAST_HANDLER is not a user configurable option; we return ...
[ "def", "get_settings", "(", ")", ":", "s", "=", "getattr", "(", "settings", ",", "'CLAMAV_UPLOAD'", ",", "{", "}", ")", "s", "=", "{", "'CONTENT_TYPE_CHECK_ENABLED'", ":", "s", ".", "get", "(", "'CONTENT_TYPE_CHECK_ENABLED'", ",", "False", ")", ",", "'LAST...
This function returns a dict containing default settings
[ "This", "function", "returns", "a", "dict", "containing", "default", "settings" ]
00ea8baaa127d98ffb0919aaa2c3aeec9bb58fd5
https://github.com/musashiXXX/django-clamav-upload/blob/00ea8baaa127d98ffb0919aaa2c3aeec9bb58fd5/clamav_upload/__init__.py#L21-L32
train
bitesofcode/projexui
projexui/xsettings.py
XmlFormat.clear
def clear(self): """ Clears the settings for this XML format. """ self._xroot = ElementTree.Element('settings') self._xroot.set('version', '1.0') self._xstack = [self._xroot]
python
def clear(self): """ Clears the settings for this XML format. """ self._xroot = ElementTree.Element('settings') self._xroot.set('version', '1.0') self._xstack = [self._xroot]
[ "def", "clear", "(", "self", ")", ":", "self", ".", "_xroot", "=", "ElementTree", ".", "Element", "(", "'settings'", ")", "self", ".", "_xroot", ".", "set", "(", "'version'", ",", "'1.0'", ")", "self", ".", "_xstack", "=", "[", "self", ".", "_xroot",...
Clears the settings for this XML format.
[ "Clears", "the", "settings", "for", "this", "XML", "format", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L119-L125
train
bitesofcode/projexui
projexui/xsettings.py
XSettings.clear
def clear(self): """ Clears out all the settings for this instance. """ if self._customFormat: self._customFormat.clear() else: super(XSettings, self).clear()
python
def clear(self): """ Clears out all the settings for this instance. """ if self._customFormat: self._customFormat.clear() else: super(XSettings, self).clear()
[ "def", "clear", "(", "self", ")", ":", "if", "self", ".", "_customFormat", ":", "self", ".", "_customFormat", ".", "clear", "(", ")", "else", ":", "super", "(", "XSettings", ",", "self", ")", ".", "clear", "(", ")" ]
Clears out all the settings for this instance.
[ "Clears", "out", "all", "the", "settings", "for", "this", "instance", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L519-L526
train
bitesofcode/projexui
projexui/xsettings.py
XSettings.endGroup
def endGroup(self): """ Ends the current group of xml data. """ if self._customFormat: self._customFormat.endGroup() else: super(XSettings, self).endGroup()
python
def endGroup(self): """ Ends the current group of xml data. """ if self._customFormat: self._customFormat.endGroup() else: super(XSettings, self).endGroup()
[ "def", "endGroup", "(", "self", ")", ":", "if", "self", ".", "_customFormat", ":", "self", ".", "_customFormat", ".", "endGroup", "(", ")", "else", ":", "super", "(", "XSettings", ",", "self", ")", ".", "endGroup", "(", ")" ]
Ends the current group of xml data.
[ "Ends", "the", "current", "group", "of", "xml", "data", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L548-L555
train
bitesofcode/projexui
projexui/xsettings.py
XSettings.load
def load(self): """ Loads the settings from disk for this XSettings object, if it is a custom format. """ # load the custom format if self._customFormat and os.path.exists(self.fileName()): self._customFormat.load(self.fileName())
python
def load(self): """ Loads the settings from disk for this XSettings object, if it is a custom format. """ # load the custom format if self._customFormat and os.path.exists(self.fileName()): self._customFormat.load(self.fileName())
[ "def", "load", "(", "self", ")", ":", "if", "self", ".", "_customFormat", "and", "os", ".", "path", ".", "exists", "(", "self", ".", "fileName", "(", ")", ")", ":", "self", ".", "_customFormat", ".", "load", "(", "self", ".", "fileName", "(", ")", ...
Loads the settings from disk for this XSettings object, if it is a custom format.
[ "Loads", "the", "settings", "from", "disk", "for", "this", "XSettings", "object", "if", "it", "is", "a", "custom", "format", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L557-L563
train
bitesofcode/projexui
projexui/xsettings.py
XSettings.sync
def sync(self): """ Syncs the information for this settings out to the file system. """ if self._customFormat: self._customFormat.save(self.fileName()) else: super(XSettings, self).sync()
python
def sync(self): """ Syncs the information for this settings out to the file system. """ if self._customFormat: self._customFormat.save(self.fileName()) else: super(XSettings, self).sync()
[ "def", "sync", "(", "self", ")", ":", "if", "self", ".", "_customFormat", ":", "self", ".", "_customFormat", ".", "save", "(", "self", ".", "fileName", "(", ")", ")", "else", ":", "super", "(", "XSettings", ",", "self", ")", ".", "sync", "(", ")" ]
Syncs the information for this settings out to the file system.
[ "Syncs", "the", "information", "for", "this", "settings", "out", "to", "the", "file", "system", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L608-L615
train
bitesofcode/projexui
projexui/widgets/xorbquerywidget/xorbquerycontainer.py
XOrbQueryContainer.clear
def clear(self): """ Clears out the widgets for this query builder. """ layout = self._entryWidget.layout() for i in range(layout.count() - 1): widget = layout.itemAt(i).widget() widget.close()
python
def clear(self): """ Clears out the widgets for this query builder. """ layout = self._entryWidget.layout() for i in range(layout.count() - 1): widget = layout.itemAt(i).widget() widget.close()
[ "def", "clear", "(", "self", ")", ":", "layout", "=", "self", ".", "_entryWidget", ".", "layout", "(", ")", "for", "i", "in", "range", "(", "layout", ".", "count", "(", ")", "-", "1", ")", ":", "widget", "=", "layout", ".", "itemAt", "(", "i", ...
Clears out the widgets for this query builder.
[ "Clears", "out", "the", "widgets", "for", "this", "query", "builder", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbquerycontainer.py#L83-L90
train
bitesofcode/projexui
projexui/widgets/xorbquerywidget/xorbquerycontainer.py
XOrbQueryContainer.moveDown
def moveDown(self, entry): """ Moves the current query down one entry. """ if not entry: return entries = self.entries() next = entries[entries.index(entry) + 1] entry_q = entry.query() next_q = next.query() ...
python
def moveDown(self, entry): """ Moves the current query down one entry. """ if not entry: return entries = self.entries() next = entries[entries.index(entry) + 1] entry_q = entry.query() next_q = next.query() ...
[ "def", "moveDown", "(", "self", ",", "entry", ")", ":", "if", "not", "entry", ":", "return", "entries", "=", "self", ".", "entries", "(", ")", "next", "=", "entries", "[", "entries", ".", "index", "(", "entry", ")", "+", "1", "]", "entry_q", "=", ...
Moves the current query down one entry.
[ "Moves", "the", "current", "query", "down", "one", "entry", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbquerycontainer.py#L168-L182
train
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget._selectTree
def _selectTree( self ): """ Matches the tree selection to the views selection. """ self.uiGanttTREE.blockSignals(True) self.uiGanttTREE.clearSelection() for item in self.uiGanttVIEW.scene().selectedItems(): item.treeItem().setSelected(True) se...
python
def _selectTree( self ): """ Matches the tree selection to the views selection. """ self.uiGanttTREE.blockSignals(True) self.uiGanttTREE.clearSelection() for item in self.uiGanttVIEW.scene().selectedItems(): item.treeItem().setSelected(True) se...
[ "def", "_selectTree", "(", "self", ")", ":", "self", ".", "uiGanttTREE", ".", "blockSignals", "(", "True", ")", "self", ".", "uiGanttTREE", ".", "clearSelection", "(", ")", "for", "item", "in", "self", ".", "uiGanttVIEW", ".", "scene", "(", ")", ".", "...
Matches the tree selection to the views selection.
[ "Matches", "the", "tree", "selection", "to", "the", "views", "selection", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L158-L166
train
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget._selectView
def _selectView( self ): """ Matches the view selection to the trees selection. """ scene = self.uiGanttVIEW.scene() scene.blockSignals(True) scene.clearSelection() for item in self.uiGanttTREE.selectedItems(): item.viewItem().setSelected(True)...
python
def _selectView( self ): """ Matches the view selection to the trees selection. """ scene = self.uiGanttVIEW.scene() scene.blockSignals(True) scene.clearSelection() for item in self.uiGanttTREE.selectedItems(): item.viewItem().setSelected(True)...
[ "def", "_selectView", "(", "self", ")", ":", "scene", "=", "self", ".", "uiGanttVIEW", ".", "scene", "(", ")", "scene", ".", "blockSignals", "(", "True", ")", "scene", ".", "clearSelection", "(", ")", "for", "item", "in", "self", ".", "uiGanttTREE", "....
Matches the view selection to the trees selection.
[ "Matches", "the", "view", "selection", "to", "the", "trees", "selection", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L168-L183
train
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget._updateViewRect
def _updateViewRect( self ): """ Updates the view rect to match the current tree value. """ if not self.updatesEnabled(): return header_h = self._cellHeight * 2 rect = self.uiGanttVIEW.scene().sceneRect() sbar_max = self....
python
def _updateViewRect( self ): """ Updates the view rect to match the current tree value. """ if not self.updatesEnabled(): return header_h = self._cellHeight * 2 rect = self.uiGanttVIEW.scene().sceneRect() sbar_max = self....
[ "def", "_updateViewRect", "(", "self", ")", ":", "if", "not", "self", ".", "updatesEnabled", "(", ")", ":", "return", "header_h", "=", "self", ".", "_cellHeight", "*", "2", "rect", "=", "self", ".", "uiGanttVIEW", ".", "scene", "(", ")", ".", "sceneRec...
Updates the view rect to match the current tree value.
[ "Updates", "the", "view", "rect", "to", "match", "the", "current", "tree", "value", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L185-L200
train
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget.syncView
def syncView(self): """ Syncs all the items to the view. """ if not self.updatesEnabled(): return for item in self.topLevelItems(): try: item.syncView(recursive=True) except AttributeError: co...
python
def syncView(self): """ Syncs all the items to the view. """ if not self.updatesEnabled(): return for item in self.topLevelItems(): try: item.syncView(recursive=True) except AttributeError: co...
[ "def", "syncView", "(", "self", ")", ":", "if", "not", "self", ".", "updatesEnabled", "(", ")", ":", "return", "for", "item", "in", "self", ".", "topLevelItems", "(", ")", ":", "try", ":", "item", ".", "syncView", "(", "recursive", "=", "True", ")", ...
Syncs all the items to the view.
[ "Syncs", "all", "the", "items", "to", "the", "view", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L627-L638
train
tueda/python-form
form/datapath.py
get_data_path
def get_data_path(package, resource): # type: (str, str) -> str """Return the full file path of a resource of a package.""" loader = pkgutil.get_loader(package) if loader is None or not hasattr(loader, 'get_data'): raise PackageResourceError("Failed to load package: '{0}'".format( pa...
python
def get_data_path(package, resource): # type: (str, str) -> str """Return the full file path of a resource of a package.""" loader = pkgutil.get_loader(package) if loader is None or not hasattr(loader, 'get_data'): raise PackageResourceError("Failed to load package: '{0}'".format( pa...
[ "def", "get_data_path", "(", "package", ",", "resource", ")", ":", "loader", "=", "pkgutil", ".", "get_loader", "(", "package", ")", "if", "loader", "is", "None", "or", "not", "hasattr", "(", "loader", ",", "'get_data'", ")", ":", "raise", "PackageResource...
Return the full file path of a resource of a package.
[ "Return", "the", "full", "file", "path", "of", "a", "resource", "of", "a", "package", "." ]
1e5a8464f7a7a6cbbb32411fc2ea3615fd48334b
https://github.com/tueda/python-form/blob/1e5a8464f7a7a6cbbb32411fc2ea3615fd48334b/form/datapath.py#L11-L25
train
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggerwidget.py
XLoggerWidget.scrollToEnd
def scrollToEnd(self): """ Scrolls to the end for this console edit. """ vsbar = self.verticalScrollBar() vsbar.setValue(vsbar.maximum()) hbar = self.horizontalScrollBar() hbar.setValue(0)
python
def scrollToEnd(self): """ Scrolls to the end for this console edit. """ vsbar = self.verticalScrollBar() vsbar.setValue(vsbar.maximum()) hbar = self.horizontalScrollBar() hbar.setValue(0)
[ "def", "scrollToEnd", "(", "self", ")", ":", "vsbar", "=", "self", ".", "verticalScrollBar", "(", ")", "vsbar", ".", "setValue", "(", "vsbar", ".", "maximum", "(", ")", ")", "hbar", "=", "self", ".", "horizontalScrollBar", "(", ")", "hbar", ".", "setVa...
Scrolls to the end for this console edit.
[ "Scrolls", "to", "the", "end", "for", "this", "console", "edit", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggerwidget.py#L423-L431
train
bitesofcode/projexui
projexui/widgets/xorbgridedit/xorbgridedit.py
XOrbGridEdit.assignQuery
def assignQuery(self): """ Assigns the query from the query widget to the edit. """ self.uiRecordTREE.setQuery(self._queryWidget.query(), autoRefresh=True)
python
def assignQuery(self): """ Assigns the query from the query widget to the edit. """ self.uiRecordTREE.setQuery(self._queryWidget.query(), autoRefresh=True)
[ "def", "assignQuery", "(", "self", ")", ":", "self", ".", "uiRecordTREE", ".", "setQuery", "(", "self", ".", "_queryWidget", ".", "query", "(", ")", ",", "autoRefresh", "=", "True", ")" ]
Assigns the query from the query widget to the edit.
[ "Assigns", "the", "query", "from", "the", "query", "widget", "to", "the", "edit", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbgridedit/xorbgridedit.py#L115-L119
train
bitesofcode/projexui
projexui/widgets/xorbgridedit/xorbgridedit.py
XOrbGridEdit.refresh
def refresh(self): """ Commits changes stored in the interface to the database. """ table = self.tableType() if table: table.markTableCacheExpired() self.uiRecordTREE.searchRecords(self.uiSearchTXT.text())
python
def refresh(self): """ Commits changes stored in the interface to the database. """ table = self.tableType() if table: table.markTableCacheExpired() self.uiRecordTREE.searchRecords(self.uiSearchTXT.text())
[ "def", "refresh", "(", "self", ")", ":", "table", "=", "self", ".", "tableType", "(", ")", "if", "table", ":", "table", ".", "markTableCacheExpired", "(", ")", "self", ".", "uiRecordTREE", ".", "searchRecords", "(", "self", ".", "uiSearchTXT", ".", "text...
Commits changes stored in the interface to the database.
[ "Commits", "changes", "stored", "in", "the", "interface", "to", "the", "database", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbgridedit/xorbgridedit.py#L186-L194
train
evansd/django-envsettings
envsettings/base.py
URLSettingsBase.parse
def parse(self, url): """ Return a configuration dict from a URL """ parsed_url = urlparse.urlparse(url) try: default_config = self.CONFIG[parsed_url.scheme] except KeyError: raise ValueError( 'unrecognised URL scheme for {}: {}'.fo...
python
def parse(self, url): """ Return a configuration dict from a URL """ parsed_url = urlparse.urlparse(url) try: default_config = self.CONFIG[parsed_url.scheme] except KeyError: raise ValueError( 'unrecognised URL scheme for {}: {}'.fo...
[ "def", "parse", "(", "self", ",", "url", ")", ":", "parsed_url", "=", "urlparse", ".", "urlparse", "(", "url", ")", "try", ":", "default_config", "=", "self", ".", "CONFIG", "[", "parsed_url", ".", "scheme", "]", "except", "KeyError", ":", "raise", "Va...
Return a configuration dict from a URL
[ "Return", "a", "configuration", "dict", "from", "a", "URL" ]
541932af261d5369f211f836a238dc020ee316e8
https://github.com/evansd/django-envsettings/blob/541932af261d5369f211f836a238dc020ee316e8/envsettings/base.py#L91-L104
train
evansd/django-envsettings
envsettings/base.py
URLSettingsBase.get_auto_config
def get_auto_config(self): """ Walk over all available auto_config methods, passing them the current environment and seeing if they return a configuration URL """ methods = [m for m in dir(self) if m.startswith('auto_config_')] for method_name in sorted(methods): ...
python
def get_auto_config(self): """ Walk over all available auto_config methods, passing them the current environment and seeing if they return a configuration URL """ methods = [m for m in dir(self) if m.startswith('auto_config_')] for method_name in sorted(methods): ...
[ "def", "get_auto_config", "(", "self", ")", ":", "methods", "=", "[", "m", "for", "m", "in", "dir", "(", "self", ")", "if", "m", ".", "startswith", "(", "'auto_config_'", ")", "]", "for", "method_name", "in", "sorted", "(", "methods", ")", ":", "auto...
Walk over all available auto_config methods, passing them the current environment and seeing if they return a configuration URL
[ "Walk", "over", "all", "available", "auto_config", "methods", "passing", "them", "the", "current", "environment", "and", "seeing", "if", "they", "return", "a", "configuration", "URL" ]
541932af261d5369f211f836a238dc020ee316e8
https://github.com/evansd/django-envsettings/blob/541932af261d5369f211f836a238dc020ee316e8/envsettings/base.py#L114-L124
train
intelsdi-x/snap-plugin-lib-py
snap_plugin/v1/processor_proxy.py
_ProcessorProxy.Process
def Process(self, request, context): """Dispatches the request to the plugins process method""" LOG.debug("Process called") try: metrics = self.plugin.process( [Metric(pb=m) for m in request.Metrics], ConfigMap(pb=request.Config) ) ...
python
def Process(self, request, context): """Dispatches the request to the plugins process method""" LOG.debug("Process called") try: metrics = self.plugin.process( [Metric(pb=m) for m in request.Metrics], ConfigMap(pb=request.Config) ) ...
[ "def", "Process", "(", "self", ",", "request", ",", "context", ")", ":", "LOG", ".", "debug", "(", "\"Process called\"", ")", "try", ":", "metrics", "=", "self", ".", "plugin", ".", "process", "(", "[", "Metric", "(", "pb", "=", "m", ")", "for", "m...
Dispatches the request to the plugins process method
[ "Dispatches", "the", "request", "to", "the", "plugins", "process", "method" ]
8da5d00ac5f9d2b48a7239563ac7788209891ca4
https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/processor_proxy.py#L36-L48
train
johnnoone/aioconsul
aioconsul/client/members_endpoint.py
MembersEndpoint.join
async def join(self, address, *, wan=None): """Triggers the local agent to join a node Parameters: address (str): Address of node wan (bool): Attempt to join using the WAN pool Returns: bool: ``True`` on success This endpoint is used to instruct the ...
python
async def join(self, address, *, wan=None): """Triggers the local agent to join a node Parameters: address (str): Address of node wan (bool): Attempt to join using the WAN pool Returns: bool: ``True`` on success This endpoint is used to instruct the ...
[ "async", "def", "join", "(", "self", ",", "address", ",", "*", ",", "wan", "=", "None", ")", ":", "response", "=", "await", "self", ".", "_api", ".", "get", "(", "\"/v1/agent/join\"", ",", "address", ",", "params", "=", "{", "\"wan\"", ":", "wan", ...
Triggers the local agent to join a node Parameters: address (str): Address of node wan (bool): Attempt to join using the WAN pool Returns: bool: ``True`` on success This endpoint is used to instruct the agent to attempt to connect to a given address....
[ "Triggers", "the", "local", "agent", "to", "join", "a", "node" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/members_endpoint.py#L44-L59
train
johnnoone/aioconsul
aioconsul/client/members_endpoint.py
MembersEndpoint.force_leave
async def force_leave(self, node): """Forces removal of a node Parameters: node (ObjectID): Node name Returns: bool: ``True`` on success This endpoint is used to instruct the agent to force a node into the ``left`` state. If a node fails unexpectedly, th...
python
async def force_leave(self, node): """Forces removal of a node Parameters: node (ObjectID): Node name Returns: bool: ``True`` on success This endpoint is used to instruct the agent to force a node into the ``left`` state. If a node fails unexpectedly, th...
[ "async", "def", "force_leave", "(", "self", ",", "node", ")", ":", "node_id", "=", "extract_attr", "(", "node", ",", "keys", "=", "[", "\"Node\"", ",", "\"ID\"", "]", ")", "response", "=", "await", "self", ".", "_get", "(", "\"/v1/agent/force-leave\"", "...
Forces removal of a node Parameters: node (ObjectID): Node name Returns: bool: ``True`` on success This endpoint is used to instruct the agent to force a node into the ``left`` state. If a node fails unexpectedly, then it will be in a ``failed`` state. O...
[ "Forces", "removal", "of", "a", "node" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/members_endpoint.py#L61-L78
train
bitesofcode/projexui
projexui/widgets/xviewwidget/xviewpanelmenu.py
XViewBaseMenu.gotoNext
def gotoNext(self): """ Goes to the next panel tab. """ index = self._currentPanel.currentIndex() + 1 if ( self._currentPanel.count() == index ): index = 0 self._currentPanel.setCurrentIndex(index)
python
def gotoNext(self): """ Goes to the next panel tab. """ index = self._currentPanel.currentIndex() + 1 if ( self._currentPanel.count() == index ): index = 0 self._currentPanel.setCurrentIndex(index)
[ "def", "gotoNext", "(", "self", ")", ":", "index", "=", "self", ".", "_currentPanel", ".", "currentIndex", "(", ")", "+", "1", "if", "(", "self", ".", "_currentPanel", ".", "count", "(", ")", "==", "index", ")", ":", "index", "=", "0", "self", ".",...
Goes to the next panel tab.
[ "Goes", "to", "the", "next", "panel", "tab", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanelmenu.py#L136-L144
train
bitesofcode/projexui
projexui/widgets/xviewwidget/xviewpanelmenu.py
XViewBaseMenu.gotoPrevious
def gotoPrevious(self): """ Goes to the previous panel tab. """ index = self._currentPanel.currentIndex() - 1 if index < 0: index = self._currentPanel.count() - 1 self._currentPanel.setCurrentIndex(index)
python
def gotoPrevious(self): """ Goes to the previous panel tab. """ index = self._currentPanel.currentIndex() - 1 if index < 0: index = self._currentPanel.count() - 1 self._currentPanel.setCurrentIndex(index)
[ "def", "gotoPrevious", "(", "self", ")", ":", "index", "=", "self", ".", "_currentPanel", ".", "currentIndex", "(", ")", "-", "1", "if", "index", "<", "0", ":", "index", "=", "self", ".", "_currentPanel", ".", "count", "(", ")", "-", "1", "self", "...
Goes to the previous panel tab.
[ "Goes", "to", "the", "previous", "panel", "tab", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanelmenu.py#L146-L154
train
bitesofcode/projexui
projexui/widgets/xviewwidget/xviewpanelmenu.py
XViewBaseMenu.newPanelTab
def newPanelTab(self): """ Creates a new panel with a copy of the current widget. """ view = self._currentPanel.currentView() # duplicate the current view if view: new_view = view.duplicate(self._currentPanel) self._currentPanel.addTab(new...
python
def newPanelTab(self): """ Creates a new panel with a copy of the current widget. """ view = self._currentPanel.currentView() # duplicate the current view if view: new_view = view.duplicate(self._currentPanel) self._currentPanel.addTab(new...
[ "def", "newPanelTab", "(", "self", ")", ":", "view", "=", "self", ".", "_currentPanel", ".", "currentView", "(", ")", "if", "view", ":", "new_view", "=", "view", ".", "duplicate", "(", "self", ".", "_currentPanel", ")", "self", ".", "_currentPanel", ".",...
Creates a new panel with a copy of the current widget.
[ "Creates", "a", "new", "panel", "with", "a", "copy", "of", "the", "current", "widget", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanelmenu.py#L156-L165
train
bitesofcode/projexui
projexui/widgets/xviewwidget/xviewpanelmenu.py
XViewBaseMenu.renamePanel
def renamePanel(self): """ Prompts the user for a custom name for the current panel tab. """ index = self._currentPanel.currentIndex() title = self._currentPanel.tabText(index) new_title, accepted = QInputDialog.getText( self, ...
python
def renamePanel(self): """ Prompts the user for a custom name for the current panel tab. """ index = self._currentPanel.currentIndex() title = self._currentPanel.tabText(index) new_title, accepted = QInputDialog.getText( self, ...
[ "def", "renamePanel", "(", "self", ")", ":", "index", "=", "self", ".", "_currentPanel", ".", "currentIndex", "(", ")", "title", "=", "self", ".", "_currentPanel", ".", "tabText", "(", "index", ")", "new_title", ",", "accepted", "=", "QInputDialog", ".", ...
Prompts the user for a custom name for the current panel tab.
[ "Prompts", "the", "user", "for", "a", "custom", "name", "for", "the", "current", "panel", "tab", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanelmenu.py#L167-L183
train
bitesofcode/projexui
projexui/widgets/xenumbox.py
XEnumBox.reload
def reload(self): """ Reloads the contents for this box. """ enum = self._enum if not enum: return self.clear() if not self.isRequired(): self.addItem('') if self.sortByKey(): sel...
python
def reload(self): """ Reloads the contents for this box. """ enum = self._enum if not enum: return self.clear() if not self.isRequired(): self.addItem('') if self.sortByKey(): sel...
[ "def", "reload", "(", "self", ")", ":", "enum", "=", "self", ".", "_enum", "if", "not", "enum", ":", "return", "self", ".", "clear", "(", ")", "if", "not", "self", ".", "isRequired", "(", ")", ":", "self", ".", "addItem", "(", "''", ")", "if", ...
Reloads the contents for this box.
[ "Reloads", "the", "contents", "for", "this", "box", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xenumbox.py#L124-L143
train
bitesofcode/projexui
projexui/widgets/ximageslider/ximageslider.py
XImageSlider.recalculate
def recalculate(self): """ Recalcualtes the slider scene for this widget. """ # recalculate the scene geometry scene = self.scene() w = self.calculateSceneWidth() scene.setSceneRect(0, 0, w, self.height()) # recalculate the item layout ...
python
def recalculate(self): """ Recalcualtes the slider scene for this widget. """ # recalculate the scene geometry scene = self.scene() w = self.calculateSceneWidth() scene.setSceneRect(0, 0, w, self.height()) # recalculate the item layout ...
[ "def", "recalculate", "(", "self", ")", ":", "scene", "=", "self", ".", "scene", "(", ")", "w", "=", "self", ".", "calculateSceneWidth", "(", ")", "scene", ".", "setSceneRect", "(", "0", ",", "0", ",", "w", ",", "self", ".", "height", "(", ")", "...
Recalcualtes the slider scene for this widget.
[ "Recalcualtes", "the", "slider", "scene", "for", "this", "widget", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/ximageslider/ximageslider.py#L106-L122
train
ReneNulschDE/mercedesmejsonpy
mercedesmejsonpy/controller.py
Controller._check_token
def _check_token(self): """ Simple Mercedes me API. """ need_token = (self._token_info is None or self.auth_handler.is_token_expired(self._token_info)) if need_token: new_token = \ self.auth_handler.refresh_access_token( ...
python
def _check_token(self): """ Simple Mercedes me API. """ need_token = (self._token_info is None or self.auth_handler.is_token_expired(self._token_info)) if need_token: new_token = \ self.auth_handler.refresh_access_token( ...
[ "def", "_check_token", "(", "self", ")", ":", "need_token", "=", "(", "self", ".", "_token_info", "is", "None", "or", "self", ".", "auth_handler", ".", "is_token_expired", "(", "self", ".", "_token_info", ")", ")", "if", "need_token", ":", "new_token", "="...
Simple Mercedes me API.
[ "Simple", "Mercedes", "me", "API", "." ]
0618a0b49d6bb46599d11a8f66dc8d08d112ceec
https://github.com/ReneNulschDE/mercedesmejsonpy/blob/0618a0b49d6bb46599d11a8f66dc8d08d112ceec/mercedesmejsonpy/controller.py#L159-L176
train
ReneNulschDE/mercedesmejsonpy
mercedesmejsonpy/controller.py
Controller.get_location
def get_location(self, car_id): """ get refreshed location information. """ _LOGGER.debug("get_location for %s called", car_id) api_result = self._retrieve_api_result(car_id, API_LOCATION) _LOGGER.debug("get_location result: %s", api_result) location = Location() ...
python
def get_location(self, car_id): """ get refreshed location information. """ _LOGGER.debug("get_location for %s called", car_id) api_result = self._retrieve_api_result(car_id, API_LOCATION) _LOGGER.debug("get_location result: %s", api_result) location = Location() ...
[ "def", "get_location", "(", "self", ",", "car_id", ")", ":", "_LOGGER", ".", "debug", "(", "\"get_location for %s called\"", ",", "car_id", ")", "api_result", "=", "self", ".", "_retrieve_api_result", "(", "car_id", ",", "API_LOCATION", ")", "_LOGGER", ".", "d...
get refreshed location information.
[ "get", "refreshed", "location", "information", "." ]
0618a0b49d6bb46599d11a8f66dc8d08d112ceec
https://github.com/ReneNulschDE/mercedesmejsonpy/blob/0618a0b49d6bb46599d11a8f66dc8d08d112ceec/mercedesmejsonpy/controller.py#L233-L254
train
johnnoone/aioconsul
aioconsul/client/acl_endpoint.py
ACLEndpoint.create
async def create(self, token): """Creates a new token with a given policy Parameters: token (Object): Token specification Returns: Object: token ID The create endpoint is used to make a new token. A token has a name, a type, and a set of ACL rules. ...
python
async def create(self, token): """Creates a new token with a given policy Parameters: token (Object): Token specification Returns: Object: token ID The create endpoint is used to make a new token. A token has a name, a type, and a set of ACL rules. ...
[ "async", "def", "create", "(", "self", ",", "token", ")", ":", "token", "=", "encode_token", "(", "token", ")", "response", "=", "await", "self", ".", "_api", ".", "put", "(", "\"/v1/acl/create\"", ",", "data", "=", "token", ")", "return", "response", ...
Creates a new token with a given policy Parameters: token (Object): Token specification Returns: Object: token ID The create endpoint is used to make a new token. A token has a name, a type, and a set of ACL rules. The request body may take the form:: ...
[ "Creates", "a", "new", "token", "with", "a", "given", "policy" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/acl_endpoint.py#L15-L59
train
johnnoone/aioconsul
aioconsul/client/acl_endpoint.py
ACLEndpoint.destroy
async def destroy(self, token): """Destroys a given token. Parameters: token (ObjectID): Token ID Returns: bool: ``True`` on success """ token_id = extract_attr(token, keys=["ID"]) response = await self._api.put("/v1/acl/destroy", token_id) ...
python
async def destroy(self, token): """Destroys a given token. Parameters: token (ObjectID): Token ID Returns: bool: ``True`` on success """ token_id = extract_attr(token, keys=["ID"]) response = await self._api.put("/v1/acl/destroy", token_id) ...
[ "async", "def", "destroy", "(", "self", ",", "token", ")", ":", "token_id", "=", "extract_attr", "(", "token", ",", "keys", "=", "[", "\"ID\"", "]", ")", "response", "=", "await", "self", ".", "_api", ".", "put", "(", "\"/v1/acl/destroy\"", ",", "token...
Destroys a given token. Parameters: token (ObjectID): Token ID Returns: bool: ``True`` on success
[ "Destroys", "a", "given", "token", "." ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/acl_endpoint.py#L93-L103
train
johnnoone/aioconsul
aioconsul/client/acl_endpoint.py
ACLEndpoint.info
async def info(self, token): """Queries the policy of a given token. Parameters: token (ObjectID): Token ID Returns: ObjectMeta: where value is token Raises: NotFound: It returns a body like this:: { "CreateIndex"...
python
async def info(self, token): """Queries the policy of a given token. Parameters: token (ObjectID): Token ID Returns: ObjectMeta: where value is token Raises: NotFound: It returns a body like this:: { "CreateIndex"...
[ "async", "def", "info", "(", "self", ",", "token", ")", ":", "token_id", "=", "extract_attr", "(", "token", ",", "keys", "=", "[", "\"ID\"", "]", ")", "response", "=", "await", "self", ".", "_api", ".", "get", "(", "\"/v1/acl/info\"", ",", "token_id", ...
Queries the policy of a given token. Parameters: token (ObjectID): Token ID Returns: ObjectMeta: where value is token Raises: NotFound: It returns a body like this:: { "CreateIndex": 3, "ModifyIndex": 3, ...
[ "Queries", "the", "policy", "of", "a", "given", "token", "." ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/acl_endpoint.py#L107-L144
train
johnnoone/aioconsul
aioconsul/client/acl_endpoint.py
ACLEndpoint.clone
async def clone(self, token): """Creates a new token by cloning an existing token Parameters: token (ObjectID): Token ID Returns: ObjectMeta: where value is token ID This allows a token to serve as a template for others, making it simple to generate new ...
python
async def clone(self, token): """Creates a new token by cloning an existing token Parameters: token (ObjectID): Token ID Returns: ObjectMeta: where value is token ID This allows a token to serve as a template for others, making it simple to generate new ...
[ "async", "def", "clone", "(", "self", ",", "token", ")", ":", "token_id", "=", "extract_attr", "(", "token", ",", "keys", "=", "[", "\"ID\"", "]", ")", "response", "=", "await", "self", ".", "_api", ".", "put", "(", "\"/v1/acl/clone\"", ",", "token_id"...
Creates a new token by cloning an existing token Parameters: token (ObjectID): Token ID Returns: ObjectMeta: where value is token ID This allows a token to serve as a template for others, making it simple to generate new tokens without complex rule management. ...
[ "Creates", "a", "new", "token", "by", "cloning", "an", "existing", "token" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/acl_endpoint.py#L146-L166
train
johnnoone/aioconsul
aioconsul/client/acl_endpoint.py
ACLEndpoint.items
async def items(self): """Lists all the active tokens Returns: ObjectMeta: where value is a list of tokens It returns a body like this:: [ { "CreateIndex": 3, "ModifyIndex": 3, "ID": "8f246b77-f3e1-ff88-5b48...
python
async def items(self): """Lists all the active tokens Returns: ObjectMeta: where value is a list of tokens It returns a body like this:: [ { "CreateIndex": 3, "ModifyIndex": 3, "ID": "8f246b77-f3e1-ff88-5b48...
[ "async", "def", "items", "(", "self", ")", ":", "response", "=", "await", "self", ".", "_api", ".", "get", "(", "\"/v1/acl/list\"", ")", "results", "=", "[", "decode_token", "(", "r", ")", "for", "r", "in", "response", ".", "body", "]", "return", "co...
Lists all the active tokens Returns: ObjectMeta: where value is a list of tokens It returns a body like this:: [ { "CreateIndex": 3, "ModifyIndex": 3, "ID": "8f246b77-f3e1-ff88-5b48-8ec93abf3e05", "N...
[ "Lists", "all", "the", "active", "tokens" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/acl_endpoint.py#L168-L194
train
johnnoone/aioconsul
aioconsul/client/acl_endpoint.py
ACLEndpoint.replication
async def replication(self, *, dc=None): """Checks status of ACL replication Parameters: dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. Returns: Object: Replication information Returns the status o...
python
async def replication(self, *, dc=None): """Checks status of ACL replication Parameters: dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. Returns: Object: Replication information Returns the status o...
[ "async", "def", "replication", "(", "self", ",", "*", ",", "dc", "=", "None", ")", ":", "params", "=", "{", "\"dc\"", ":", "dc", "}", "response", "=", "await", "self", ".", "_api", ".", "get", "(", "\"/v1/acl/replication\"", ",", "params", "=", "para...
Checks status of ACL replication Parameters: dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. Returns: Object: Replication information Returns the status of the ACL replication process in the datacenter. ...
[ "Checks", "status", "of", "ACL", "replication" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/acl_endpoint.py#L196-L257
train
mikhaildubov/AST-text-analysis
east/asts/utils.py
make_unique_endings
def make_unique_endings(strings_collection): """ Make each string in the collection end with a unique character. Essential for correct builiding of a generalized annotated suffix tree. Returns the updated strings collection, encoded in Unicode. max strings_collection ~ 1.100.000 """ re...
python
def make_unique_endings(strings_collection): """ Make each string in the collection end with a unique character. Essential for correct builiding of a generalized annotated suffix tree. Returns the updated strings collection, encoded in Unicode. max strings_collection ~ 1.100.000 """ re...
[ "def", "make_unique_endings", "(", "strings_collection", ")", ":", "res", "=", "[", "]", "for", "i", "in", "range", "(", "len", "(", "strings_collection", ")", ")", ":", "hex_code", "=", "hex", "(", "consts", ".", "String", ".", "UNICODE_SPECIAL_SYMBOLS_STAR...
Make each string in the collection end with a unique character. Essential for correct builiding of a generalized annotated suffix tree. Returns the updated strings collection, encoded in Unicode. max strings_collection ~ 1.100.000
[ "Make", "each", "string", "in", "the", "collection", "end", "with", "a", "unique", "character", ".", "Essential", "for", "correct", "builiding", "of", "a", "generalized", "annotated", "suffix", "tree", ".", "Returns", "the", "updated", "strings", "collection", ...
055ad8d2492c100bbbaa25309ec1074bdf1dfaa5
https://github.com/mikhaildubov/AST-text-analysis/blob/055ad8d2492c100bbbaa25309ec1074bdf1dfaa5/east/asts/utils.py#L25-L40
train
johnnoone/aioconsul
aioconsul/client/coordinate_endpoint.py
CoordinateEndpoint.datacenters
async def datacenters(self): """Queries for WAN coordinates of Consul servers Returns: Mapping: WAN network coordinates for all Consul servers, organized by DCs. It returns a body like this:: { "dc1": { "Datacent...
python
async def datacenters(self): """Queries for WAN coordinates of Consul servers Returns: Mapping: WAN network coordinates for all Consul servers, organized by DCs. It returns a body like this:: { "dc1": { "Datacent...
[ "async", "def", "datacenters", "(", "self", ")", ":", "response", "=", "await", "self", ".", "_api", ".", "get", "(", "\"/v1/coordinate/datacenters\"", ")", "return", "{", "data", "[", "\"Datacenter\"", "]", ":", "data", "for", "data", "in", "response", "....
Queries for WAN coordinates of Consul servers Returns: Mapping: WAN network coordinates for all Consul servers, organized by DCs. It returns a body like this:: { "dc1": { "Datacenter": "dc1", "Coordin...
[ "Queries", "for", "WAN", "coordinates", "of", "Consul", "servers" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/coordinate_endpoint.py#L15-L48
train
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListWidget.resizeToContents
def resizeToContents(self): """ Resizes the list widget to fit its contents vertically. """ if self.count(): item = self.item(self.count() - 1) rect = self.visualItemRect(item) height = rect.bottom() + 8 height = max(28, height) ...
python
def resizeToContents(self): """ Resizes the list widget to fit its contents vertically. """ if self.count(): item = self.item(self.count() - 1) rect = self.visualItemRect(item) height = rect.bottom() + 8 height = max(28, height) ...
[ "def", "resizeToContents", "(", "self", ")", ":", "if", "self", ".", "count", "(", ")", ":", "item", "=", "self", ".", "item", "(", "self", ".", "count", "(", ")", "-", "1", ")", "rect", "=", "self", ".", "visualItemRect", "(", "item", ")", "heig...
Resizes the list widget to fit its contents vertically.
[ "Resizes", "the", "list", "widget", "to", "fit", "its", "contents", "vertically", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L535-L546
train
talkincode/txradius
txradius/openvpn/daemon.py
parse_status_file
def parse_status_file(status_file,nas_addr): ''' parse openvpn status log ''' session_users = {} flag1 = False flag2 = False with open(status_file) as stlines: for line in stlines: if line.startswith("Common Name"): flag1 = True continue ...
python
def parse_status_file(status_file,nas_addr): ''' parse openvpn status log ''' session_users = {} flag1 = False flag2 = False with open(status_file) as stlines: for line in stlines: if line.startswith("Common Name"): flag1 = True continue ...
[ "def", "parse_status_file", "(", "status_file", ",", "nas_addr", ")", ":", "session_users", "=", "{", "}", "flag1", "=", "False", "flag2", "=", "False", "with", "open", "(", "status_file", ")", "as", "stlines", ":", "for", "line", "in", "stlines", ":", "...
parse openvpn status log
[ "parse", "openvpn", "status", "log" ]
b86fdbc9be41183680b82b07d3a8e8ea10926e01
https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/openvpn/daemon.py#L21-L77
train
talkincode/txradius
txradius/openvpn/daemon.py
update_status
def update_status(dbfile,status_file,nas_addr): ''' update status db ''' try: total = 0 params = [] for sid, su in parse_status_file(status_file, nas_addr).items(): if 'session_id' in su and 'inbytes' in su and 'outbytes' in su: params.append((su['inbytes...
python
def update_status(dbfile,status_file,nas_addr): ''' update status db ''' try: total = 0 params = [] for sid, su in parse_status_file(status_file, nas_addr).items(): if 'session_id' in su and 'inbytes' in su and 'outbytes' in su: params.append((su['inbytes...
[ "def", "update_status", "(", "dbfile", ",", "status_file", ",", "nas_addr", ")", ":", "try", ":", "total", "=", "0", "params", "=", "[", "]", "for", "sid", ",", "su", "in", "parse_status_file", "(", "status_file", ",", "nas_addr", ")", ".", "items", "(...
update status db
[ "update", "status", "db" ]
b86fdbc9be41183680b82b07d3a8e8ea10926e01
https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/openvpn/daemon.py#L79-L93
train
talkincode/txradius
txradius/openvpn/daemon.py
accounting
def accounting(dbfile,config): ''' update radius accounting ''' try: nas_id = config.get('DEFAULT', 'nas_id') nas_addr = config.get('DEFAULT', 'nas_addr') secret = config.get('DEFAULT', 'radius_secret') radius_addr = config.get('DEFAULT', 'radius_addr') radius_acct_po...
python
def accounting(dbfile,config): ''' update radius accounting ''' try: nas_id = config.get('DEFAULT', 'nas_id') nas_addr = config.get('DEFAULT', 'nas_addr') secret = config.get('DEFAULT', 'radius_secret') radius_addr = config.get('DEFAULT', 'radius_addr') radius_acct_po...
[ "def", "accounting", "(", "dbfile", ",", "config", ")", ":", "try", ":", "nas_id", "=", "config", ".", "get", "(", "'DEFAULT'", ",", "'nas_id'", ")", "nas_addr", "=", "config", ".", "get", "(", "'DEFAULT'", ",", "'nas_addr'", ")", "secret", "=", "confi...
update radius accounting
[ "update", "radius", "accounting" ]
b86fdbc9be41183680b82b07d3a8e8ea10926e01
https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/openvpn/daemon.py#L95-L147
train
talkincode/txradius
txradius/openvpn/daemon.py
main
def main(conf): """ OpenVPN status daemon """ config = init_config(conf) nas_addr = config.get('DEFAULT', 'nas_addr') status_file = config.get('DEFAULT', 'statusfile') status_dbfile = config.get('DEFAULT', 'statusdb') nas_coa_port = config.get('DEFAULT', 'nas_coa_port') def do_update_s...
python
def main(conf): """ OpenVPN status daemon """ config = init_config(conf) nas_addr = config.get('DEFAULT', 'nas_addr') status_file = config.get('DEFAULT', 'statusfile') status_dbfile = config.get('DEFAULT', 'statusdb') nas_coa_port = config.get('DEFAULT', 'nas_coa_port') def do_update_s...
[ "def", "main", "(", "conf", ")", ":", "config", "=", "init_config", "(", "conf", ")", "nas_addr", "=", "config", ".", "get", "(", "'DEFAULT'", ",", "'nas_addr'", ")", "status_file", "=", "config", ".", "get", "(", "'DEFAULT'", ",", "'statusfile'", ")", ...
OpenVPN status daemon
[ "OpenVPN", "status", "daemon" ]
b86fdbc9be41183680b82b07d3a8e8ea10926e01
https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/openvpn/daemon.py#L202-L228
train
neithere/eav-django
eav/managers.py
BaseEntityManager._filter_by_simple_schema
def _filter_by_simple_schema(self, qs, lookup, sublookup, value, schema): """ Filters given entity queryset by an attribute which is linked to given schema and has given value in the field for schema's datatype. """ value_lookup = 'attrs__value_%s' % schema.datatype if su...
python
def _filter_by_simple_schema(self, qs, lookup, sublookup, value, schema): """ Filters given entity queryset by an attribute which is linked to given schema and has given value in the field for schema's datatype. """ value_lookup = 'attrs__value_%s' % schema.datatype if su...
[ "def", "_filter_by_simple_schema", "(", "self", ",", "qs", ",", "lookup", ",", "sublookup", ",", "value", ",", "schema", ")", ":", "value_lookup", "=", "'attrs__value_%s'", "%", "schema", ".", "datatype", "if", "sublookup", ":", "value_lookup", "=", "'%s__%s'"...
Filters given entity queryset by an attribute which is linked to given schema and has given value in the field for schema's datatype.
[ "Filters", "given", "entity", "queryset", "by", "an", "attribute", "which", "is", "linked", "to", "given", "schema", "and", "has", "given", "value", "in", "the", "field", "for", "schema", "s", "datatype", "." ]
7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7
https://github.com/neithere/eav-django/blob/7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7/eav/managers.py#L121-L132
train
neithere/eav-django
eav/managers.py
BaseEntityManager._filter_by_m2m_schema
def _filter_by_m2m_schema(self, qs, lookup, sublookup, value, schema, model=None): """ Filters given entity queryset by an attribute which is linked to given many-to-many schema. """ model = model or self.model schemata = dict((s.name, s) for s in model.get_schemata_for_m...
python
def _filter_by_m2m_schema(self, qs, lookup, sublookup, value, schema, model=None): """ Filters given entity queryset by an attribute which is linked to given many-to-many schema. """ model = model or self.model schemata = dict((s.name, s) for s in model.get_schemata_for_m...
[ "def", "_filter_by_m2m_schema", "(", "self", ",", "qs", ",", "lookup", ",", "sublookup", ",", "value", ",", "schema", ",", "model", "=", "None", ")", ":", "model", "=", "model", "or", "self", ".", "model", "schemata", "=", "dict", "(", "(", "s", ".",...
Filters given entity queryset by an attribute which is linked to given many-to-many schema.
[ "Filters", "given", "entity", "queryset", "by", "an", "attribute", "which", "is", "linked", "to", "given", "many", "-", "to", "-", "many", "schema", "." ]
7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7
https://github.com/neithere/eav-django/blob/7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7/eav/managers.py#L173-L189
train
neithere/eav-django
eav/managers.py
BaseEntityManager.create
def create(self, **kwargs): """ Creates entity instance and related Attr instances. Note that while entity instances may filter schemata by fields, that filtering does not take place here. Attribute of any schema will be saved successfully as long as such schema exists. ...
python
def create(self, **kwargs): """ Creates entity instance and related Attr instances. Note that while entity instances may filter schemata by fields, that filtering does not take place here. Attribute of any schema will be saved successfully as long as such schema exists. ...
[ "def", "create", "(", "self", ",", "**", "kwargs", ")", ":", "fields", "=", "self", ".", "model", ".", "_meta", ".", "get_all_field_names", "(", ")", "schemata", "=", "dict", "(", "(", "s", ".", "name", ",", "s", ")", "for", "s", "in", "self", "....
Creates entity instance and related Attr instances. Note that while entity instances may filter schemata by fields, that filtering does not take place here. Attribute of any schema will be saved successfully as long as such schema exists. Note that we cannot create attribute with no pr...
[ "Creates", "entity", "instance", "and", "related", "Attr", "instances", "." ]
7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7
https://github.com/neithere/eav-django/blob/7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7/eav/managers.py#L191-L225
train
bitesofcode/projexui
projexui/widgets/xviewwidget/xviewprofilemanagermenu.py
XViewProfileManagerMenu.removeProfile
def removeProfile( self ): """ Removes the current profile from the system. """ manager = self.parent() prof = manager.currentProfile() opts = QMessageBox.Yes | QMessageBox.No question = 'Are you sure you want to remove "%s"?' % prof.name() answer...
python
def removeProfile( self ): """ Removes the current profile from the system. """ manager = self.parent() prof = manager.currentProfile() opts = QMessageBox.Yes | QMessageBox.No question = 'Are you sure you want to remove "%s"?' % prof.name() answer...
[ "def", "removeProfile", "(", "self", ")", ":", "manager", "=", "self", ".", "parent", "(", ")", "prof", "=", "manager", ".", "currentProfile", "(", ")", "opts", "=", "QMessageBox", ".", "Yes", "|", "QMessageBox", ".", "No", "question", "=", "'Are you sur...
Removes the current profile from the system.
[ "Removes", "the", "current", "profile", "from", "the", "system", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanagermenu.py#L44-L55
train
bitesofcode/projexui
projexui/widgets/xviewwidget/xviewprofilemanagermenu.py
XViewProfileManagerMenu.saveProfile
def saveProfile( self ): """ Saves the current profile to the current settings from the view widget. """ manager = self.parent() prof = manager.currentProfile() # save the current profile save_prof = manager.viewWidget().saveProfile() prof.setX...
python
def saveProfile( self ): """ Saves the current profile to the current settings from the view widget. """ manager = self.parent() prof = manager.currentProfile() # save the current profile save_prof = manager.viewWidget().saveProfile() prof.setX...
[ "def", "saveProfile", "(", "self", ")", ":", "manager", "=", "self", ".", "parent", "(", ")", "prof", "=", "manager", ".", "currentProfile", "(", ")", "save_prof", "=", "manager", ".", "viewWidget", "(", ")", ".", "saveProfile", "(", ")", "prof", ".", ...
Saves the current profile to the current settings from the view widget.
[ "Saves", "the", "current", "profile", "to", "the", "current", "settings", "from", "the", "view", "widget", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanagermenu.py#L57-L66
train
bitesofcode/projexui
projexui/widgets/xviewwidget/xviewprofilemanagermenu.py
XViewProfileManagerMenu.saveProfileAs
def saveProfileAs( self ): """ Saves the current profile as a new profile to the manager. """ name, ok = QInputDialog.getText(self, 'Create Profile', 'Name:') if ( not name ): return manager = self.parent() prof = manager.viewWidget().saveP...
python
def saveProfileAs( self ): """ Saves the current profile as a new profile to the manager. """ name, ok = QInputDialog.getText(self, 'Create Profile', 'Name:') if ( not name ): return manager = self.parent() prof = manager.viewWidget().saveP...
[ "def", "saveProfileAs", "(", "self", ")", ":", "name", ",", "ok", "=", "QInputDialog", ".", "getText", "(", "self", ",", "'Create Profile'", ",", "'Name:'", ")", "if", "(", "not", "name", ")", ":", "return", "manager", "=", "self", ".", "parent", "(", ...
Saves the current profile as a new profile to the manager.
[ "Saves", "the", "current", "profile", "as", "a", "new", "profile", "to", "the", "manager", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanagermenu.py#L68-L79
train
Gbps/fastlog
fastlog/hexdump.py
hexdump
def hexdump(logger, s, width=16, skip=True, hexii=False, begin=0, highlight=None): r""" Return a hexdump-dump of a string. Arguments: logger(FastLogger): Logger object s(str): The data to hexdump. width(int): The number of characters per line skip(bool): Set to True, if repe...
python
def hexdump(logger, s, width=16, skip=True, hexii=False, begin=0, highlight=None): r""" Return a hexdump-dump of a string. Arguments: logger(FastLogger): Logger object s(str): The data to hexdump. width(int): The number of characters per line skip(bool): Set to True, if repe...
[ "def", "hexdump", "(", "logger", ",", "s", ",", "width", "=", "16", ",", "skip", "=", "True", ",", "hexii", "=", "False", ",", "begin", "=", "0", ",", "highlight", "=", "None", ")", ":", "r", "s", "=", "_flat", "(", "s", ")", "return", "'\\n'",...
r""" Return a hexdump-dump of a string. Arguments: logger(FastLogger): Logger object s(str): The data to hexdump. width(int): The number of characters per line skip(bool): Set to True, if repeated lines should be replaced by a "*" hexii(bool): Set to True, if a hexii-dum...
[ "r", "Return", "a", "hexdump", "-", "dump", "of", "a", "string", "." ]
8edb2327d72191510302c4654ffaa1691fe31277
https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/hexdump.py#L183-L314
train
bitesofcode/projexui
projexui/widgets/xlineedit.py
XLineEdit.adjustText
def adjustText(self): """ Updates the text based on the current format options. """ pos = self.cursorPosition() self.blockSignals(True) super(XLineEdit, self).setText(self.formatText(self.text())) self.setCursorPosition(pos) self.blockSignals(False)
python
def adjustText(self): """ Updates the text based on the current format options. """ pos = self.cursorPosition() self.blockSignals(True) super(XLineEdit, self).setText(self.formatText(self.text())) self.setCursorPosition(pos) self.blockSignals(False)
[ "def", "adjustText", "(", "self", ")", ":", "pos", "=", "self", ".", "cursorPosition", "(", ")", "self", ".", "blockSignals", "(", "True", ")", "super", "(", "XLineEdit", ",", "self", ")", ".", "setText", "(", "self", ".", "formatText", "(", "self", ...
Updates the text based on the current format options.
[ "Updates", "the", "text", "based", "on", "the", "current", "format", "options", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlineedit.py#L110-L118
train
bitesofcode/projexui
projexui/widgets/xlineedit.py
XLineEdit.adjustButtons
def adjustButtons( self ): """ Adjusts the placement of the buttons for this line edit. """ y = 1 for btn in self.buttons(): btn.setIconSize(self.iconSize()) btn.setFixedSize(QSize(self.height() - 2, self.height() - 2)) # adju...
python
def adjustButtons( self ): """ Adjusts the placement of the buttons for this line edit. """ y = 1 for btn in self.buttons(): btn.setIconSize(self.iconSize()) btn.setFixedSize(QSize(self.height() - 2, self.height() - 2)) # adju...
[ "def", "adjustButtons", "(", "self", ")", ":", "y", "=", "1", "for", "btn", "in", "self", ".", "buttons", "(", ")", ":", "btn", ".", "setIconSize", "(", "self", ".", "iconSize", "(", ")", ")", "btn", ".", "setFixedSize", "(", "QSize", "(", "self", ...
Adjusts the placement of the buttons for this line edit.
[ "Adjusts", "the", "placement", "of", "the", "buttons", "for", "this", "line", "edit", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlineedit.py#L152-L182
train
bitesofcode/projexui
projexui/widgets/xlineedit.py
XLineEdit.adjustTextMargins
def adjustTextMargins( self ): """ Adjusts the margins for the text based on the contents to be displayed. """ left_buttons = self._buttons.get(Qt.AlignLeft, []) if left_buttons: bwidth = left_buttons[-1].pos().x() + left_buttons[-1].width() - 4 else:...
python
def adjustTextMargins( self ): """ Adjusts the margins for the text based on the contents to be displayed. """ left_buttons = self._buttons.get(Qt.AlignLeft, []) if left_buttons: bwidth = left_buttons[-1].pos().x() + left_buttons[-1].width() - 4 else:...
[ "def", "adjustTextMargins", "(", "self", ")", ":", "left_buttons", "=", "self", ".", "_buttons", ".", "get", "(", "Qt", ".", "AlignLeft", ",", "[", "]", ")", "if", "left_buttons", ":", "bwidth", "=", "left_buttons", "[", "-", "1", "]", ".", "pos", "(...
Adjusts the margins for the text based on the contents to be displayed.
[ "Adjusts", "the", "margins", "for", "the", "text", "based", "on", "the", "contents", "to", "be", "displayed", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlineedit.py#L184-L199
train
bitesofcode/projexui
projexui/widgets/xlineedit.py
XLineEdit.clear
def clear(self): """ Clears the text from the edit. """ super(XLineEdit, self).clear() self.textEntered.emit('') self.textChanged.emit('') self.textEdited.emit('')
python
def clear(self): """ Clears the text from the edit. """ super(XLineEdit, self).clear() self.textEntered.emit('') self.textChanged.emit('') self.textEdited.emit('')
[ "def", "clear", "(", "self", ")", ":", "super", "(", "XLineEdit", ",", "self", ")", ".", "clear", "(", ")", "self", ".", "textEntered", ".", "emit", "(", "''", ")", "self", ".", "textChanged", ".", "emit", "(", "''", ")", "self", ".", "textEdited",...
Clears the text from the edit.
[ "Clears", "the", "text", "from", "the", "edit", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlineedit.py#L237-L245
train
Gbps/fastlog
fastlog/termcap.py
get
def get(cap, *args, **kwargs): """ Get a terminal capability exposes through the `curses` module. """ # Hack for readthedocs.org if 'READTHEDOCS' in os.environ: return '' if kwargs != {}: raise TypeError("get(): No such argument %r" % kwargs.popitem()[0]) if _cache == {}: ...
python
def get(cap, *args, **kwargs): """ Get a terminal capability exposes through the `curses` module. """ # Hack for readthedocs.org if 'READTHEDOCS' in os.environ: return '' if kwargs != {}: raise TypeError("get(): No such argument %r" % kwargs.popitem()[0]) if _cache == {}: ...
[ "def", "get", "(", "cap", ",", "*", "args", ",", "**", "kwargs", ")", ":", "if", "'READTHEDOCS'", "in", "os", ".", "environ", ":", "return", "''", "if", "kwargs", "!=", "{", "}", ":", "raise", "TypeError", "(", "\"get(): No such argument %r\"", "%", "k...
Get a terminal capability exposes through the `curses` module.
[ "Get", "a", "terminal", "capability", "exposes", "through", "the", "curses", "module", "." ]
8edb2327d72191510302c4654ffaa1691fe31277
https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/termcap.py#L9-L49
train
andylockran/heatmiserV3
heatmiserV3/connection.py
HeatmiserUH1.registerThermostat
def registerThermostat(self, thermostat): """Registers a thermostat with the UH1""" try: type(thermostat) == heatmiser.HeatmiserThermostat if thermostat.address in self.thermostats.keys(): raise ValueError("Key already present") else: s...
python
def registerThermostat(self, thermostat): """Registers a thermostat with the UH1""" try: type(thermostat) == heatmiser.HeatmiserThermostat if thermostat.address in self.thermostats.keys(): raise ValueError("Key already present") else: s...
[ "def", "registerThermostat", "(", "self", ",", "thermostat", ")", ":", "try", ":", "type", "(", "thermostat", ")", "==", "heatmiser", ".", "HeatmiserThermostat", "if", "thermostat", ".", "address", "in", "self", ".", "thermostats", ".", "keys", "(", ")", "...
Registers a thermostat with the UH1
[ "Registers", "a", "thermostat", "with", "the", "UH1" ]
bd8638f5fd1f85d16c908020252f58a0cc4f6ac0
https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/connection.py#L49-L62
train
bitesofcode/projexui
projexui/menus/xrecentfilesmenu.py
XRecentFilesMenu.refresh
def refresh( self ): """ Clears out the actions for this menu and then loads the files. """ self.clear() for i, filename in enumerate(self.filenames()): name = '%i. %s' % (i+1, os.path.basename(filename)) action = self.addAction(name) ...
python
def refresh( self ): """ Clears out the actions for this menu and then loads the files. """ self.clear() for i, filename in enumerate(self.filenames()): name = '%i. %s' % (i+1, os.path.basename(filename)) action = self.addAction(name) ...
[ "def", "refresh", "(", "self", ")", ":", "self", ".", "clear", "(", ")", "for", "i", ",", "filename", "in", "enumerate", "(", "self", ".", "filenames", "(", ")", ")", ":", "name", "=", "'%i. %s'", "%", "(", "i", "+", "1", ",", "os", ".", "path"...
Clears out the actions for this menu and then loads the files.
[ "Clears", "out", "the", "actions", "for", "this", "menu", "and", "then", "loads", "the", "files", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xrecentfilesmenu.py#L84-L93
train
whiteclover/dbpy
db/query/insert.py
InsertQuery.values
def values(self, values): """The values for insert , it can be a dict row or list tuple row. """ if isinstance(values, dict): l = [] for column in self._columns: l.append(values[column]) self._values.append(tuple(l)) else: ...
python
def values(self, values): """The values for insert , it can be a dict row or list tuple row. """ if isinstance(values, dict): l = [] for column in self._columns: l.append(values[column]) self._values.append(tuple(l)) else: ...
[ "def", "values", "(", "self", ",", "values", ")", ":", "if", "isinstance", "(", "values", ",", "dict", ")", ":", "l", "=", "[", "]", "for", "column", "in", "self", ".", "_columns", ":", "l", ".", "append", "(", "values", "[", "column", "]", ")", ...
The values for insert , it can be a dict row or list tuple row.
[ "The", "values", "for", "insert", "it", "can", "be", "a", "dict", "row", "or", "list", "tuple", "row", "." ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/db/query/insert.py#L36-L47
train
bitesofcode/projexui
projexui/widgets/xratingslider.py
XRatingSlider.adjustMinimumWidth
def adjustMinimumWidth( self ): """ Modifies the minimum width to factor in the size of the pixmaps and the number for the maximum. """ pw = self.pixmapSize().width() # allow 1 pixel space between the icons self.setMinimumWidth(pw * self.maximum()...
python
def adjustMinimumWidth( self ): """ Modifies the minimum width to factor in the size of the pixmaps and the number for the maximum. """ pw = self.pixmapSize().width() # allow 1 pixel space between the icons self.setMinimumWidth(pw * self.maximum()...
[ "def", "adjustMinimumWidth", "(", "self", ")", ":", "pw", "=", "self", ".", "pixmapSize", "(", ")", ".", "width", "(", ")", "self", ".", "setMinimumWidth", "(", "pw", "*", "self", ".", "maximum", "(", ")", "+", "3", "*", "self", ".", "maximum", "("...
Modifies the minimum width to factor in the size of the pixmaps and the number for the maximum.
[ "Modifies", "the", "minimum", "width", "to", "factor", "in", "the", "size", "of", "the", "pixmaps", "and", "the", "number", "for", "the", "maximum", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xratingslider.py#L44-L52
train
talkincode/txradius
txradius/openvpn/client_disconnect.py
cli
def cli(conf): """ OpenVPN client_disconnect method """ config = init_config(conf) nas_id = config.get('DEFAULT', 'nas_id') secret = config.get('DEFAULT', 'radius_secret') nas_addr = config.get('DEFAULT', 'nas_addr') radius_addr = config.get('DEFAULT', 'radius_addr') radius_acct_port = c...
python
def cli(conf): """ OpenVPN client_disconnect method """ config = init_config(conf) nas_id = config.get('DEFAULT', 'nas_id') secret = config.get('DEFAULT', 'radius_secret') nas_addr = config.get('DEFAULT', 'nas_addr') radius_addr = config.get('DEFAULT', 'radius_addr') radius_acct_port = c...
[ "def", "cli", "(", "conf", ")", ":", "config", "=", "init_config", "(", "conf", ")", "nas_id", "=", "config", ".", "get", "(", "'DEFAULT'", ",", "'nas_id'", ")", "secret", "=", "config", ".", "get", "(", "'DEFAULT'", ",", "'radius_secret'", ")", "nas_a...
OpenVPN client_disconnect method
[ "OpenVPN", "client_disconnect", "method" ]
b86fdbc9be41183680b82b07d3a8e8ea10926e01
https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/openvpn/client_disconnect.py#L19-L73
train
bitesofcode/projexui
projexui/widgets/xviewwidget/xviewwidget.py
XViewWidget.viewAt
def viewAt(self, point): """ Looks up the view at the inputed point. :param point | <QtCore.QPoint> :return <projexui.widgets.xviewwidget.XView> || None """ widget = self.childAt(point) if widget: return projexui.ancestor(widget, XView) ...
python
def viewAt(self, point): """ Looks up the view at the inputed point. :param point | <QtCore.QPoint> :return <projexui.widgets.xviewwidget.XView> || None """ widget = self.childAt(point) if widget: return projexui.ancestor(widget, XView) ...
[ "def", "viewAt", "(", "self", ",", "point", ")", ":", "widget", "=", "self", ".", "childAt", "(", "point", ")", "if", "widget", ":", "return", "projexui", ".", "ancestor", "(", "widget", ",", "XView", ")", "else", ":", "return", "None" ]
Looks up the view at the inputed point. :param point | <QtCore.QPoint> :return <projexui.widgets.xviewwidget.XView> || None
[ "Looks", "up", "the", "view", "at", "the", "inputed", "point", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewwidget.py#L578-L590
train
mojaie/chorus
chorus/draw/drawer2d.py
draw
def draw(canvas, mol): """Draw molecule structure image. Args: canvas: draw.drawable.Drawable mol: model.graphmol.Compound """ mol.require("ScaleAndCenter") mlb = mol.size2d[2] if not mol.atom_count(): return bond_type_fn = { 1: { 0: single_bond, ...
python
def draw(canvas, mol): """Draw molecule structure image. Args: canvas: draw.drawable.Drawable mol: model.graphmol.Compound """ mol.require("ScaleAndCenter") mlb = mol.size2d[2] if not mol.atom_count(): return bond_type_fn = { 1: { 0: single_bond, ...
[ "def", "draw", "(", "canvas", ",", "mol", ")", ":", "mol", ".", "require", "(", "\"ScaleAndCenter\"", ")", "mlb", "=", "mol", ".", "size2d", "[", "2", "]", "if", "not", "mol", ".", "atom_count", "(", ")", ":", "return", "bond_type_fn", "=", "{", "1...
Draw molecule structure image. Args: canvas: draw.drawable.Drawable mol: model.graphmol.Compound
[ "Draw", "molecule", "structure", "image", "." ]
fc7fe23a0272554c67671645ab07830b315eeb1b
https://github.com/mojaie/chorus/blob/fc7fe23a0272554c67671645ab07830b315eeb1b/chorus/draw/drawer2d.py#L17-L93
train
mojaie/chorus
chorus/smilessupplier.py
smiles_to_compound
def smiles_to_compound(smiles, assign_descriptors=True): """Convert SMILES text to compound object Raises: ValueError: SMILES with unsupported format """ it = iter(smiles) mol = molecule() try: for token in it: mol(token) result, _ = mol(None) except ...
python
def smiles_to_compound(smiles, assign_descriptors=True): """Convert SMILES text to compound object Raises: ValueError: SMILES with unsupported format """ it = iter(smiles) mol = molecule() try: for token in it: mol(token) result, _ = mol(None) except ...
[ "def", "smiles_to_compound", "(", "smiles", ",", "assign_descriptors", "=", "True", ")", ":", "it", "=", "iter", "(", "smiles", ")", "mol", "=", "molecule", "(", ")", "try", ":", "for", "token", "in", "it", ":", "mol", "(", "token", ")", "result", ",...
Convert SMILES text to compound object Raises: ValueError: SMILES with unsupported format
[ "Convert", "SMILES", "text", "to", "compound", "object" ]
fc7fe23a0272554c67671645ab07830b315eeb1b
https://github.com/mojaie/chorus/blob/fc7fe23a0272554c67671645ab07830b315eeb1b/chorus/smilessupplier.py#L316-L334
train
moble/spinsfast
python/__init__.py
salm2map
def salm2map(salm, s, lmax, Ntheta, Nphi): """Convert mode weights of spin-weighted function to values on a grid Parameters ---------- salm : array_like, complex, shape (..., (lmax+1)**2) Input array representing mode weights of the spin-weighted function. This array may be multi-dimen...
python
def salm2map(salm, s, lmax, Ntheta, Nphi): """Convert mode weights of spin-weighted function to values on a grid Parameters ---------- salm : array_like, complex, shape (..., (lmax+1)**2) Input array representing mode weights of the spin-weighted function. This array may be multi-dimen...
[ "def", "salm2map", "(", "salm", ",", "s", ",", "lmax", ",", "Ntheta", ",", "Nphi", ")", ":", "if", "Ntheta", "<", "2", "or", "Nphi", "<", "1", ":", "raise", "ValueError", "(", "\"Input values of Ntheta={0} and Nphi={1} \"", ".", "format", "(", "Ntheta", ...
Convert mode weights of spin-weighted function to values on a grid Parameters ---------- salm : array_like, complex, shape (..., (lmax+1)**2) Input array representing mode weights of the spin-weighted function. This array may be multi-dimensional, where initial dimensions may represent dif...
[ "Convert", "mode", "weights", "of", "spin", "-", "weighted", "function", "to", "values", "on", "a", "grid" ]
02480a3f712eb88eff5faa1d4afcbdfb0c25b865
https://github.com/moble/spinsfast/blob/02480a3f712eb88eff5faa1d4afcbdfb0c25b865/python/__init__.py#L40-L133
train
moble/spinsfast
python/__init__.py
map2salm
def map2salm(map, s, lmax): """Convert values of spin-weighted function on a grid to mode weights Parameters ---------- map : array_like, complex, shape (..., Ntheta, Nphi) Values of the spin-weighted function on grid points of the sphere. This array may have more than two dimensions, ...
python
def map2salm(map, s, lmax): """Convert values of spin-weighted function on a grid to mode weights Parameters ---------- map : array_like, complex, shape (..., Ntheta, Nphi) Values of the spin-weighted function on grid points of the sphere. This array may have more than two dimensions, ...
[ "def", "map2salm", "(", "map", ",", "s", ",", "lmax", ")", ":", "import", "numpy", "as", "np", "map", "=", "np", ".", "ascontiguousarray", "(", "map", ",", "dtype", "=", "np", ".", "complex128", ")", "salm", "=", "np", ".", "empty", "(", "map", "...
Convert values of spin-weighted function on a grid to mode weights Parameters ---------- map : array_like, complex, shape (..., Ntheta, Nphi) Values of the spin-weighted function on grid points of the sphere. This array may have more than two dimensions, where initial dimensions may repres...
[ "Convert", "values", "of", "spin", "-", "weighted", "function", "on", "a", "grid", "to", "mode", "weights" ]
02480a3f712eb88eff5faa1d4afcbdfb0c25b865
https://github.com/moble/spinsfast/blob/02480a3f712eb88eff5faa1d4afcbdfb0c25b865/python/__init__.py#L136-L216
train
moble/spinsfast
python/__init__.py
Imm
def Imm(extended_map, s, lmax): """Take the fft of the theta extended map, then zero pad and reorganize it This is mostly an internal function, included here for backwards compatibility. See map2salm and salm2map for more useful functions. """ import numpy as np extended_map = np.ascontiguous...
python
def Imm(extended_map, s, lmax): """Take the fft of the theta extended map, then zero pad and reorganize it This is mostly an internal function, included here for backwards compatibility. See map2salm and salm2map for more useful functions. """ import numpy as np extended_map = np.ascontiguous...
[ "def", "Imm", "(", "extended_map", ",", "s", ",", "lmax", ")", ":", "import", "numpy", "as", "np", "extended_map", "=", "np", ".", "ascontiguousarray", "(", "extended_map", ",", "dtype", "=", "np", ".", "complex128", ")", "NImm", "=", "(", "2", "*", ...
Take the fft of the theta extended map, then zero pad and reorganize it This is mostly an internal function, included here for backwards compatibility. See map2salm and salm2map for more useful functions.
[ "Take", "the", "fft", "of", "the", "theta", "extended", "map", "then", "zero", "pad", "and", "reorganize", "it" ]
02480a3f712eb88eff5faa1d4afcbdfb0c25b865
https://github.com/moble/spinsfast/blob/02480a3f712eb88eff5faa1d4afcbdfb0c25b865/python/__init__.py#L252-L264
train
ehansis/ozelot
ozelot/cache.py
RequestCache._query
def _query(self, url, xpath): """Base query for an url and xpath Args: url (str): URL to search xpath (str): xpath to search (may be ``None``) """ return self.session.query(CachedRequest).filter(CachedRequest.url == url).filter(CachedRequest.xpath == xpath)
python
def _query(self, url, xpath): """Base query for an url and xpath Args: url (str): URL to search xpath (str): xpath to search (may be ``None``) """ return self.session.query(CachedRequest).filter(CachedRequest.url == url).filter(CachedRequest.xpath == xpath)
[ "def", "_query", "(", "self", ",", "url", ",", "xpath", ")", ":", "return", "self", ".", "session", ".", "query", "(", "CachedRequest", ")", ".", "filter", "(", "CachedRequest", ".", "url", "==", "url", ")", ".", "filter", "(", "CachedRequest", ".", ...
Base query for an url and xpath Args: url (str): URL to search xpath (str): xpath to search (may be ``None``)
[ "Base", "query", "for", "an", "url", "and", "xpath" ]
948675e02eb6fca940450f5cb814f53e97159e5b
https://github.com/ehansis/ozelot/blob/948675e02eb6fca940450f5cb814f53e97159e5b/ozelot/cache.py#L106-L113
train
ehansis/ozelot
ozelot/cache.py
RequestCache.get
def get(self, url, store_on_error=False, xpath=None, rate_limit=None, log_hits=True, log_misses=True): """Get a URL via the cache. If the URL exists in the cache, return the cached value. Otherwise perform the request, store the resulting content in the cache and return it. Throws a :c...
python
def get(self, url, store_on_error=False, xpath=None, rate_limit=None, log_hits=True, log_misses=True): """Get a URL via the cache. If the URL exists in the cache, return the cached value. Otherwise perform the request, store the resulting content in the cache and return it. Throws a :c...
[ "def", "get", "(", "self", ",", "url", ",", "store_on_error", "=", "False", ",", "xpath", "=", "None", ",", "rate_limit", "=", "None", ",", "log_hits", "=", "True", ",", "log_misses", "=", "True", ")", ":", "try", ":", "cached", "=", "self", ".", "...
Get a URL via the cache. If the URL exists in the cache, return the cached value. Otherwise perform the request, store the resulting content in the cache and return it. Throws a :class:`RuntimeError` if the request results in an error. Args: url (str): URL to request ...
[ "Get", "a", "URL", "via", "the", "cache", "." ]
948675e02eb6fca940450f5cb814f53e97159e5b
https://github.com/ehansis/ozelot/blob/948675e02eb6fca940450f5cb814f53e97159e5b/ozelot/cache.py#L115-L202
train
ehansis/ozelot
ozelot/cache.py
RequestCache.get_timestamp
def get_timestamp(self, url, xpath=None): """Get time stamp of cached query result. If DB has not yet been initialized or url/xpath has not been queried yet, return None. Args: url (str): If given, clear specific item only. Otherwise remove the DB file. xpath (str): xpa...
python
def get_timestamp(self, url, xpath=None): """Get time stamp of cached query result. If DB has not yet been initialized or url/xpath has not been queried yet, return None. Args: url (str): If given, clear specific item only. Otherwise remove the DB file. xpath (str): xpa...
[ "def", "get_timestamp", "(", "self", ",", "url", ",", "xpath", "=", "None", ")", ":", "if", "not", "path", ".", "exists", "(", "self", ".", "db_path", ")", ":", "return", "None", "if", "self", ".", "_query", "(", "url", ",", "xpath", ")", ".", "c...
Get time stamp of cached query result. If DB has not yet been initialized or url/xpath has not been queried yet, return None. Args: url (str): If given, clear specific item only. Otherwise remove the DB file. xpath (str): xpath to search (may be ``None``) Returns: ...
[ "Get", "time", "stamp", "of", "cached", "query", "result", "." ]
948675e02eb6fca940450f5cb814f53e97159e5b
https://github.com/ehansis/ozelot/blob/948675e02eb6fca940450f5cb814f53e97159e5b/ozelot/cache.py#L241-L257
train
gmdzy2010/dingtalk_sdk_gmdzy2010
dingtalk_sdk_gmdzy2010/base_request.py
BaseRequest.set_logger
def set_logger(self): """Method to build the base logging system. By default, logging level is set to INFO.""" logger = logging.getLogger(__name__) logger.setLevel(level=logging.INFO) logger_file = os.path.join(self.logs_path, 'dingtalk_sdk.logs') logger_handler = l...
python
def set_logger(self): """Method to build the base logging system. By default, logging level is set to INFO.""" logger = logging.getLogger(__name__) logger.setLevel(level=logging.INFO) logger_file = os.path.join(self.logs_path, 'dingtalk_sdk.logs') logger_handler = l...
[ "def", "set_logger", "(", "self", ")", ":", "logger", "=", "logging", ".", "getLogger", "(", "__name__", ")", "logger", ".", "setLevel", "(", "level", "=", "logging", ".", "INFO", ")", "logger_file", "=", "os", ".", "path", ".", "join", "(", "self", ...
Method to build the base logging system. By default, logging level is set to INFO.
[ "Method", "to", "build", "the", "base", "logging", "system", ".", "By", "default", "logging", "level", "is", "set", "to", "INFO", "." ]
b06cb1f78f89be9554dcb6101af8bc72718a9ecd
https://github.com/gmdzy2010/dingtalk_sdk_gmdzy2010/blob/b06cb1f78f89be9554dcb6101af8bc72718a9ecd/dingtalk_sdk_gmdzy2010/base_request.py#L22-L35
train
gmdzy2010/dingtalk_sdk_gmdzy2010
dingtalk_sdk_gmdzy2010/base_request.py
BaseRequest.get_response
def get_response(self): """Get the original response of requests""" request = getattr(requests, self.request_method, None) if request is None and self._request_method is None: raise ValueError("A effective http request method must be set") if self.request_url is None: ...
python
def get_response(self): """Get the original response of requests""" request = getattr(requests, self.request_method, None) if request is None and self._request_method is None: raise ValueError("A effective http request method must be set") if self.request_url is None: ...
[ "def", "get_response", "(", "self", ")", ":", "request", "=", "getattr", "(", "requests", ",", "self", ".", "request_method", ",", "None", ")", "if", "request", "is", "None", "and", "self", ".", "_request_method", "is", "None", ":", "raise", "ValueError", ...
Get the original response of requests
[ "Get", "the", "original", "response", "of", "requests" ]
b06cb1f78f89be9554dcb6101af8bc72718a9ecd
https://github.com/gmdzy2010/dingtalk_sdk_gmdzy2010/blob/b06cb1f78f89be9554dcb6101af8bc72718a9ecd/dingtalk_sdk_gmdzy2010/base_request.py#L55-L67
train
micolous/python-slackrealtime
src/slackrealtime/protocol.py
RtmProtocol.sendCommand
def sendCommand(self, **msg): """ Sends a raw command to the Slack server, generating a message ID automatically. """ assert 'type' in msg, 'Message type is required.' msg['id'] = self.next_message_id self.next_message_id += 1 if self.next_message_id >= maxint: self.next_message_id = 1 self.sendMe...
python
def sendCommand(self, **msg): """ Sends a raw command to the Slack server, generating a message ID automatically. """ assert 'type' in msg, 'Message type is required.' msg['id'] = self.next_message_id self.next_message_id += 1 if self.next_message_id >= maxint: self.next_message_id = 1 self.sendMe...
[ "def", "sendCommand", "(", "self", ",", "**", "msg", ")", ":", "assert", "'type'", "in", "msg", ",", "'Message type is required.'", "msg", "[", "'id'", "]", "=", "self", ".", "next_message_id", "self", ".", "next_message_id", "+=", "1", "if", "self", ".", ...
Sends a raw command to the Slack server, generating a message ID automatically.
[ "Sends", "a", "raw", "command", "to", "the", "Slack", "server", "generating", "a", "message", "ID", "automatically", "." ]
e9c94416f979a6582110ebba09c147de2bfe20a1
https://github.com/micolous/python-slackrealtime/blob/e9c94416f979a6582110ebba09c147de2bfe20a1/src/slackrealtime/protocol.py#L70-L83
train
micolous/python-slackrealtime
src/slackrealtime/protocol.py
RtmProtocol.sendChatMessage
def sendChatMessage(self, text, id=None, user=None, group=None, channel=None, parse='none', link_names=True, unfurl_links=True, unfurl_media=False, send_with_api=False, icon_emoji=None, icon_url=None, username=None, attachments=None, thread_ts=None, reply_broadcast=False): """ Sends a chat message to a given id, us...
python
def sendChatMessage(self, text, id=None, user=None, group=None, channel=None, parse='none', link_names=True, unfurl_links=True, unfurl_media=False, send_with_api=False, icon_emoji=None, icon_url=None, username=None, attachments=None, thread_ts=None, reply_broadcast=False): """ Sends a chat message to a given id, us...
[ "def", "sendChatMessage", "(", "self", ",", "text", ",", "id", "=", "None", ",", "user", "=", "None", ",", "group", "=", "None", ",", "channel", "=", "None", ",", "parse", "=", "'none'", ",", "link_names", "=", "True", ",", "unfurl_links", "=", "True...
Sends a chat message to a given id, user, group or channel. If the API token is not a bot token (xoxb), ``send_with_api`` may be set to True. This will send messages using ``chat.postMessage`` in the Slack API, instead of using the WebSockets channel. This makes the message sending process a little bit slowe...
[ "Sends", "a", "chat", "message", "to", "a", "given", "id", "user", "group", "or", "channel", "." ]
e9c94416f979a6582110ebba09c147de2bfe20a1
https://github.com/micolous/python-slackrealtime/blob/e9c94416f979a6582110ebba09c147de2bfe20a1/src/slackrealtime/protocol.py#L86-L155
train
abantos/bolt
bolt/__init__.py
run
def run(): """ Entry point for the `bolt` executable. """ options = btoptions.Options() btlog.initialize_logging(options.log_level, options.log_file) app = btapp.get_application() app.run()
python
def run(): """ Entry point for the `bolt` executable. """ options = btoptions.Options() btlog.initialize_logging(options.log_level, options.log_file) app = btapp.get_application() app.run()
[ "def", "run", "(", ")", ":", "options", "=", "btoptions", ".", "Options", "(", ")", "btlog", ".", "initialize_logging", "(", "options", ".", "log_level", ",", "options", ".", "log_file", ")", "app", "=", "btapp", ".", "get_application", "(", ")", "app", ...
Entry point for the `bolt` executable.
[ "Entry", "point", "for", "the", "bolt", "executable", "." ]
8b6a911d4a7b1a6e870748a523c9b2b91997c773
https://github.com/abantos/bolt/blob/8b6a911d4a7b1a6e870748a523c9b2b91997c773/bolt/__init__.py#L31-L38
train
mojaie/chorus
chorus/v2000writer.py
mols_to_file
def mols_to_file(mols, path): """Save molecules to the SDFile format file Args: mols: list of molecule objects path: file path to save """ with open(path, 'w') as f: f.write(mols_to_text(mols))
python
def mols_to_file(mols, path): """Save molecules to the SDFile format file Args: mols: list of molecule objects path: file path to save """ with open(path, 'w') as f: f.write(mols_to_text(mols))
[ "def", "mols_to_file", "(", "mols", ",", "path", ")", ":", "with", "open", "(", "path", ",", "'w'", ")", "as", "f", ":", "f", ".", "write", "(", "mols_to_text", "(", "mols", ")", ")" ]
Save molecules to the SDFile format file Args: mols: list of molecule objects path: file path to save
[ "Save", "molecules", "to", "the", "SDFile", "format", "file" ]
fc7fe23a0272554c67671645ab07830b315eeb1b
https://github.com/mojaie/chorus/blob/fc7fe23a0272554c67671645ab07830b315eeb1b/chorus/v2000writer.py#L130-L138
train
ShadowBlip/Neteria
neteria/client.py
NeteriaClient.listen
def listen(self): """Starts the client listener to listen for server responses. Args: None Returns: None """ logger.info("Listening on port " + str(self.listener.listen_port)) self.listener.listen()
python
def listen(self): """Starts the client listener to listen for server responses. Args: None Returns: None """ logger.info("Listening on port " + str(self.listener.listen_port)) self.listener.listen()
[ "def", "listen", "(", "self", ")", ":", "logger", ".", "info", "(", "\"Listening on port \"", "+", "str", "(", "self", ".", "listener", ".", "listen_port", ")", ")", "self", ".", "listener", ".", "listen", "(", ")" ]
Starts the client listener to listen for server responses. Args: None Returns: None
[ "Starts", "the", "client", "listener", "to", "listen", "for", "server", "responses", "." ]
1a8c976eb2beeca0a5a272a34ac58b2c114495a4
https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/client.py#L158-L170
train
ShadowBlip/Neteria
neteria/client.py
NeteriaClient.retransmit
def retransmit(self, data): """Processes messages that have been delivered from the transport protocol. Args: data (dict): A dictionary containing the packet data to resend. Returns: None Examples: >>> data {'method': 'REGISTER', 'addres...
python
def retransmit(self, data): """Processes messages that have been delivered from the transport protocol. Args: data (dict): A dictionary containing the packet data to resend. Returns: None Examples: >>> data {'method': 'REGISTER', 'addres...
[ "def", "retransmit", "(", "self", ",", "data", ")", ":", "if", "data", "[", "\"method\"", "]", "==", "\"REGISTER\"", ":", "if", "not", "self", ".", "registered", "and", "self", ".", "register_retries", "<", "self", ".", "max_retries", ":", "logger", ".",...
Processes messages that have been delivered from the transport protocol. Args: data (dict): A dictionary containing the packet data to resend. Returns: None Examples: >>> data {'method': 'REGISTER', 'address': ('192.168.0.20', 40080)}
[ "Processes", "messages", "that", "have", "been", "delivered", "from", "the", "transport", "protocol", "." ]
1a8c976eb2beeca0a5a272a34ac58b2c114495a4
https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/client.py#L173-L230
train
ShadowBlip/Neteria
neteria/client.py
NeteriaClient.handle_message
def handle_message(self, msg, host): """Processes messages that have been delivered from the transport protocol Args: msg (string): The raw packet data delivered from the transport protocol. host (tuple): A tuple containing the (address, port) combination of ...
python
def handle_message(self, msg, host): """Processes messages that have been delivered from the transport protocol Args: msg (string): The raw packet data delivered from the transport protocol. host (tuple): A tuple containing the (address, port) combination of ...
[ "def", "handle_message", "(", "self", ",", "msg", ",", "host", ")", ":", "logger", ".", "debug", "(", "\"Executing handle_message method.\"", ")", "response", "=", "None", "if", "self", ".", "encryption", "and", "self", ".", "server_key", ":", "msg_data", "=...
Processes messages that have been delivered from the transport protocol Args: msg (string): The raw packet data delivered from the transport protocol. host (tuple): A tuple containing the (address, port) combination of the message's origin. Returns: ...
[ "Processes", "messages", "that", "have", "been", "delivered", "from", "the", "transport", "protocol" ]
1a8c976eb2beeca0a5a272a34ac58b2c114495a4
https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/client.py#L233-L321
train
ShadowBlip/Neteria
neteria/client.py
NeteriaClient.autodiscover
def autodiscover(self, autoregister=True): """This function will send out an autodiscover broadcast to find a Neteria server. Any servers that respond with an "OHAI CLIENT" packet are servers that we can connect to. Servers that respond are stored in the "discovered_servers" list. ...
python
def autodiscover(self, autoregister=True): """This function will send out an autodiscover broadcast to find a Neteria server. Any servers that respond with an "OHAI CLIENT" packet are servers that we can connect to. Servers that respond are stored in the "discovered_servers" list. ...
[ "def", "autodiscover", "(", "self", ",", "autoregister", "=", "True", ")", ":", "logger", ".", "debug", "(", "\"<%s> Sending autodiscover message to broadcast \"", "\"address\"", "%", "str", "(", "self", ".", "cuuid", ")", ")", "if", "not", "self", ".", "liste...
This function will send out an autodiscover broadcast to find a Neteria server. Any servers that respond with an "OHAI CLIENT" packet are servers that we can connect to. Servers that respond are stored in the "discovered_servers" list. Args: autoregister (boolean): Whether or ...
[ "This", "function", "will", "send", "out", "an", "autodiscover", "broadcast", "to", "find", "a", "Neteria", "server", ".", "Any", "servers", "that", "respond", "with", "an", "OHAI", "CLIENT", "packet", "are", "servers", "that", "we", "can", "connect", "to", ...
1a8c976eb2beeca0a5a272a34ac58b2c114495a4
https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/client.py#L324-L360
train
ShadowBlip/Neteria
neteria/client.py
NeteriaClient.register
def register(self, address, retry=True): """This function will send a register packet to the discovered Neteria server. Args: address (tuple): A tuple of the (address, port) to send the register request to. retry (boolean): Whether or not we want to reset the cur...
python
def register(self, address, retry=True): """This function will send a register packet to the discovered Neteria server. Args: address (tuple): A tuple of the (address, port) to send the register request to. retry (boolean): Whether or not we want to reset the cur...
[ "def", "register", "(", "self", ",", "address", ",", "retry", "=", "True", ")", ":", "logger", ".", "debug", "(", "\"<%s> Sending REGISTER request to: %s\"", "%", "(", "str", "(", "self", ".", "cuuid", ")", ",", "str", "(", "address", ")", ")", ")", "i...
This function will send a register packet to the discovered Neteria server. Args: address (tuple): A tuple of the (address, port) to send the register request to. retry (boolean): Whether or not we want to reset the current number of registration retries to 0...
[ "This", "function", "will", "send", "a", "register", "packet", "to", "the", "discovered", "Neteria", "server", "." ]
1a8c976eb2beeca0a5a272a34ac58b2c114495a4
https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/client.py#L363-L408
train
ShadowBlip/Neteria
neteria/client.py
NeteriaClient.event
def event(self, event_data, priority="normal", event_method="EVENT"): """This function will send event packets to the server. This is the main method you would use to send data from your application to the server. Whenever an event is sent to the server, a universally unique event id ...
python
def event(self, event_data, priority="normal", event_method="EVENT"): """This function will send event packets to the server. This is the main method you would use to send data from your application to the server. Whenever an event is sent to the server, a universally unique event id ...
[ "def", "event", "(", "self", ",", "event_data", ",", "priority", "=", "\"normal\"", ",", "event_method", "=", "\"EVENT\"", ")", ":", "logger", ".", "debug", "(", "\"event: \"", "+", "str", "(", "event_data", ")", ")", "euuid", "=", "uuid", ".", "uuid1", ...
This function will send event packets to the server. This is the main method you would use to send data from your application to the server. Whenever an event is sent to the server, a universally unique event id (euuid) is created for each event and stored in the "event_uuids" d...
[ "This", "function", "will", "send", "event", "packets", "to", "the", "server", ".", "This", "is", "the", "main", "method", "you", "would", "use", "to", "send", "data", "from", "your", "application", "to", "the", "server", "." ]
1a8c976eb2beeca0a5a272a34ac58b2c114495a4
https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/client.py#L411-L487
train
ShadowBlip/Neteria
neteria/client.py
NeteriaClient.legal_check
def legal_check(self, message): """This method handles event legality check messages from the server. Args: message (dict): The unserialized legality dictionary received from the server. Returns: None Examples: >>> message """ ...
python
def legal_check(self, message): """This method handles event legality check messages from the server. Args: message (dict): The unserialized legality dictionary received from the server. Returns: None Examples: >>> message """ ...
[ "def", "legal_check", "(", "self", ",", "message", ")", ":", "if", "message", "[", "\"method\"", "]", "==", "\"LEGAL\"", ":", "logger", ".", "debug", "(", "\"<%s> <euuid:%s> Event LEGAL\"", "%", "(", "str", "(", "self", ".", "cuuid", ")", ",", "message", ...
This method handles event legality check messages from the server. Args: message (dict): The unserialized legality dictionary received from the server. Returns: None Examples: >>> message
[ "This", "method", "handles", "event", "legality", "check", "messages", "from", "the", "server", "." ]
1a8c976eb2beeca0a5a272a34ac58b2c114495a4
https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/client.py#L490-L543
train
Locu-Unofficial/locu-python
locu/api.py
VenueApiClient.search
def search(self, category = None, cuisine = None, location = (None, None), radius = None, tl_coord = (None, None), \ br_coord = (None, None), name = None, country = None, locality = None, \ region = None, postal_code = None, street_address = None,\ website_url = ...
python
def search(self, category = None, cuisine = None, location = (None, None), radius = None, tl_coord = (None, None), \ br_coord = (None, None), name = None, country = None, locality = None, \ region = None, postal_code = None, street_address = None,\ website_url = ...
[ "def", "search", "(", "self", ",", "category", "=", "None", ",", "cuisine", "=", "None", ",", "location", "=", "(", "None", ",", "None", ")", ",", "radius", "=", "None", ",", "tl_coord", "=", "(", "None", ",", "None", ")", ",", "br_coord", "=", "...
Locu Venue Search API Call Wrapper Args: *Note that none of the arguments are required category : List of category types that need to be filtered by: ['restaurant', 'spa', 'beauty salon', 'gym', 'laundry', 'hair care', 'other'] type : [string] cuisine ...
[ "Locu", "Venue", "Search", "API", "Call", "Wrapper" ]
fcdf136b68333ab7055e623591801dd35df3bc45
https://github.com/Locu-Unofficial/locu-python/blob/fcdf136b68333ab7055e623591801dd35df3bc45/locu/api.py#L147-L199
train
Locu-Unofficial/locu-python
locu/api.py
VenueApiClient.search_next
def search_next(self, obj): """ Takes the dictionary that is returned by 'search' or 'search_next' function and gets the next batch of results Args: obj: dictionary returned by the 'search' or 'search_next' function Returns: A dictionary with a data returned by the...
python
def search_next(self, obj): """ Takes the dictionary that is returned by 'search' or 'search_next' function and gets the next batch of results Args: obj: dictionary returned by the 'search' or 'search_next' function Returns: A dictionary with a data returned by the...
[ "def", "search_next", "(", "self", ",", "obj", ")", ":", "if", "'meta'", "in", "obj", "and", "'next'", "in", "obj", "[", "'meta'", "]", "and", "obj", "[", "'meta'", "]", "[", "'next'", "]", "!=", "None", ":", "uri", "=", "self", ".", "api_url", "...
Takes the dictionary that is returned by 'search' or 'search_next' function and gets the next batch of results Args: obj: dictionary returned by the 'search' or 'search_next' function Returns: A dictionary with a data returned by the server Raises: HttpException...
[ "Takes", "the", "dictionary", "that", "is", "returned", "by", "search", "or", "search_next", "function", "and", "gets", "the", "next", "batch", "of", "results" ]
fcdf136b68333ab7055e623591801dd35df3bc45
https://github.com/Locu-Unofficial/locu-python/blob/fcdf136b68333ab7055e623591801dd35df3bc45/locu/api.py#L201-L222
train
Locu-Unofficial/locu-python
locu/api.py
VenueApiClient.get_details
def get_details(self, ids): """ Locu Venue Details API Call Wrapper Args: list of ids : ids of a particular venues to get insights about. Can process up to 5 ids """ if isinstance(ids, list): if len(ids) > 5: ids = ids[:5] ...
python
def get_details(self, ids): """ Locu Venue Details API Call Wrapper Args: list of ids : ids of a particular venues to get insights about. Can process up to 5 ids """ if isinstance(ids, list): if len(ids) > 5: ids = ids[:5] ...
[ "def", "get_details", "(", "self", ",", "ids", ")", ":", "if", "isinstance", "(", "ids", ",", "list", ")", ":", "if", "len", "(", "ids", ")", ">", "5", ":", "ids", "=", "ids", "[", ":", "5", "]", "id_param", "=", "';'", ".", "join", "(", "ids...
Locu Venue Details API Call Wrapper Args: list of ids : ids of a particular venues to get insights about. Can process up to 5 ids
[ "Locu", "Venue", "Details", "API", "Call", "Wrapper" ]
fcdf136b68333ab7055e623591801dd35df3bc45
https://github.com/Locu-Unofficial/locu-python/blob/fcdf136b68333ab7055e623591801dd35df3bc45/locu/api.py#L280-L302
train
Locu-Unofficial/locu-python
locu/api.py
VenueApiClient.get_menus
def get_menus(self, id): """ Given a venue id returns a list of menus associated with a venue """ resp = self.get_details([id]) menus = [] for obj in resp['objects']: if obj['has_menu']: menus += obj['menus'] return menus
python
def get_menus(self, id): """ Given a venue id returns a list of menus associated with a venue """ resp = self.get_details([id]) menus = [] for obj in resp['objects']: if obj['has_menu']: menus += obj['menus'] return menus
[ "def", "get_menus", "(", "self", ",", "id", ")", ":", "resp", "=", "self", ".", "get_details", "(", "[", "id", "]", ")", "menus", "=", "[", "]", "for", "obj", "in", "resp", "[", "'objects'", "]", ":", "if", "obj", "[", "'has_menu'", "]", ":", "...
Given a venue id returns a list of menus associated with a venue
[ "Given", "a", "venue", "id", "returns", "a", "list", "of", "menus", "associated", "with", "a", "venue" ]
fcdf136b68333ab7055e623591801dd35df3bc45
https://github.com/Locu-Unofficial/locu-python/blob/fcdf136b68333ab7055e623591801dd35df3bc45/locu/api.py#L304-L314
train