repo
stringlengths
7
55
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
19
28.4k
docstring
stringlengths
1
46.9k
docstring_tokens
listlengths
1
1.97k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
3 values
summary
stringlengths
4
350
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget.setAlternatingRowColors
def setAlternatingRowColors( self, state ): """ Sets the alternating row colors state for this widget. :param state | <bool> """ self._alternatingRowColors = state self.treeWidget().setAlternatingRowColors(state)
python
def setAlternatingRowColors( self, state ): """ Sets the alternating row colors state for this widget. :param state | <bool> """ self._alternatingRowColors = state self.treeWidget().setAlternatingRowColors(state)
[ "def", "setAlternatingRowColors", "(", "self", ",", "state", ")", ":", "self", ".", "_alternatingRowColors", "=", "state", "self", ".", "treeWidget", "(", ")", ".", "setAlternatingRowColors", "(", "state", ")" ]
Sets the alternating row colors state for this widget. :param state | <bool>
[ "Sets", "the", "alternating", "row", "colors", "state", "for", "this", "widget", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L429-L437
train
Sets the state of the alternating row colors for this tree item.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget.setColumns
def setColumns( self, columns ): """ Sets the columns for this gantt widget's tree to the inputed list of columns. :param columns | {<str>, ..] """ self.treeWidget().setColumns(columns) item = self.treeWidget().headerItem() for i in ...
python
def setColumns( self, columns ): """ Sets the columns for this gantt widget's tree to the inputed list of columns. :param columns | {<str>, ..] """ self.treeWidget().setColumns(columns) item = self.treeWidget().headerItem() for i in ...
[ "def", "setColumns", "(", "self", ",", "columns", ")", ":", "self", ".", "treeWidget", "(", ")", ".", "setColumns", "(", "columns", ")", "item", "=", "self", ".", "treeWidget", "(", ")", ".", "headerItem", "(", ")", "for", "i", "in", "range", "(", ...
Sets the columns for this gantt widget's tree to the inputed list of columns. :param columns | {<str>, ..]
[ "Sets", "the", "columns", "for", "this", "gantt", "widget", "s", "tree", "to", "the", "inputed", "list", "of", "columns", ".", ":", "param", "columns", "|", "{", "<str", ">", "..", "]" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L464-L474
train
Sets the columns for this gantt widget s tree to the inputed list of columns.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget.setDateTimeEnd
def setDateTimeEnd(self, dtime): """ Sets the endiing date time for this gantt chart. :param dtime | <QDateTime> """ self._dateEnd = dtime.date() if self.timescale() in (self.Timescale.Minute, self.Timescale.Hour): self._timeEnd...
python
def setDateTimeEnd(self, dtime): """ Sets the endiing date time for this gantt chart. :param dtime | <QDateTime> """ self._dateEnd = dtime.date() if self.timescale() in (self.Timescale.Minute, self.Timescale.Hour): self._timeEnd...
[ "def", "setDateTimeEnd", "(", "self", ",", "dtime", ")", ":", "self", ".", "_dateEnd", "=", "dtime", ".", "date", "(", ")", "if", "self", ".", "timescale", "(", ")", "in", "(", "self", ".", "Timescale", ".", "Minute", ",", "self", ".", "Timescale", ...
Sets the endiing date time for this gantt chart. :param dtime | <QDateTime>
[ "Sets", "the", "endiing", "date", "time", "for", "this", "gantt", "chart", ".", ":", "param", "dtime", "|", "<QDateTime", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L502-L513
train
Sets the endiing date time for this gantt chart.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget.setDateTimeStart
def setDateTimeStart(self, dtime): """ Sets the starting date time for this gantt chart. :param dtime | <QDateTime> """ self._dateStart = dtime.date() if self.timescale() in (self.Timescale.Minute, self.Timescale.Hour): self._timeStart = ...
python
def setDateTimeStart(self, dtime): """ Sets the starting date time for this gantt chart. :param dtime | <QDateTime> """ self._dateStart = dtime.date() if self.timescale() in (self.Timescale.Minute, self.Timescale.Hour): self._timeStart = ...
[ "def", "setDateTimeStart", "(", "self", ",", "dtime", ")", ":", "self", ".", "_dateStart", "=", "dtime", ".", "date", "(", ")", "if", "self", ".", "timescale", "(", ")", "in", "(", "self", ".", "Timescale", ".", "Minute", ",", "self", ".", "Timescale...
Sets the starting date time for this gantt chart. :param dtime | <QDateTime>
[ "Sets", "the", "starting", "date", "time", "for", "this", "gantt", "chart", ".", ":", "param", "dtime", "|", "<QDateTime", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L515-L525
train
Sets the starting date time for this gantt chart.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget.setCurrentDateTime
def setCurrentDateTime(self, dtime): """ Sets the current date time for this widget. :param dtime | <datetime.datetime> """ view = self.uiGanttVIEW scene = view.scene() point = view.mapToScene(0, 0) x = scene.datetimeXPos(dtime) ...
python
def setCurrentDateTime(self, dtime): """ Sets the current date time for this widget. :param dtime | <datetime.datetime> """ view = self.uiGanttVIEW scene = view.scene() point = view.mapToScene(0, 0) x = scene.datetimeXPos(dtime) ...
[ "def", "setCurrentDateTime", "(", "self", ",", "dtime", ")", ":", "view", "=", "self", ".", "uiGanttVIEW", "scene", "=", "view", ".", "scene", "(", ")", "point", "=", "view", ".", "mapToScene", "(", "0", ",", "0", ")", "x", "=", "scene", ".", "date...
Sets the current date time for this widget. :param dtime | <datetime.datetime>
[ "Sets", "the", "current", "date", "time", "for", "this", "widget", ".", ":", "param", "dtime", "|", "<datetime", ".", "datetime", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L527-L538
train
Sets the current date time for this widget.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget.setTimescale
def setTimescale( self, timescale ): """ Sets the timescale value for this widget to the inputed value. :param timescale | <XGanttWidget.Timescale> """ self._timescale = timescale # show hour/minute scale if timescale == XGanttWidge...
python
def setTimescale( self, timescale ): """ Sets the timescale value for this widget to the inputed value. :param timescale | <XGanttWidget.Timescale> """ self._timescale = timescale # show hour/minute scale if timescale == XGanttWidge...
[ "def", "setTimescale", "(", "self", ",", "timescale", ")", ":", "self", ".", "_timescale", "=", "timescale", "# show hour/minute scale\r", "if", "timescale", "==", "XGanttWidget", ".", "Timescale", ".", "Minute", ":", "self", ".", "_cellWidth", "=", "60", "# (...
Sets the timescale value for this widget to the inputed value. :param timescale | <XGanttWidget.Timescale>
[ "Sets", "the", "timescale", "value", "for", "this", "widget", "to", "the", "inputed", "value", ".", ":", "param", "timescale", "|", "<XGanttWidget", ".", "Timescale", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L548-L582
train
Sets the timescale of the current instance.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget.setUpdatesEnabled
def setUpdatesEnabled(self, state): """ Sets whether or not updates will be enabled. :param state | <bool> """ super(XGanttWidget, self).setUpdatesEnabled(state) self.treeWidget().setUpdatesEnabled(state) self.viewWidget().setUpdatesEnabled(s...
python
def setUpdatesEnabled(self, state): """ Sets whether or not updates will be enabled. :param state | <bool> """ super(XGanttWidget, self).setUpdatesEnabled(state) self.treeWidget().setUpdatesEnabled(state) self.viewWidget().setUpdatesEnabled(s...
[ "def", "setUpdatesEnabled", "(", "self", ",", "state", ")", ":", "super", "(", "XGanttWidget", ",", "self", ")", ".", "setUpdatesEnabled", "(", "state", ")", "self", ".", "treeWidget", "(", ")", ".", "setUpdatesEnabled", "(", "state", ")", "self", ".", "...
Sets whether or not updates will be enabled. :param state | <bool>
[ "Sets", "whether", "or", "not", "updates", "will", "be", "enabled", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L600-L617
train
Sets whether or not updates will be enabled.
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
Syncs all the items to the view.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget.takeTopLevelItem
def takeTopLevelItem( self, index ): """ Removes the top level item at the inputed index from the widget. :param index | <int> :return <XGanttWidgetItem> || None """ item = self.topLevelItem(index) if item: self.vie...
python
def takeTopLevelItem( self, index ): """ Removes the top level item at the inputed index from the widget. :param index | <int> :return <XGanttWidgetItem> || None """ item = self.topLevelItem(index) if item: self.vie...
[ "def", "takeTopLevelItem", "(", "self", ",", "index", ")", ":", "item", "=", "self", ".", "topLevelItem", "(", "index", ")", "if", "item", ":", "self", ".", "viewWidget", "(", ")", ".", "scene", "(", ")", ".", "removeItem", "(", "item", ".", "viewIte...
Removes the top level item at the inputed index from the widget. :param index | <int> :return <XGanttWidgetItem> || None
[ "Removes", "the", "top", "level", "item", "at", "the", "inputed", "index", "from", "the", "widget", ".", ":", "param", "index", "|", "<int", ">", ":", "return", "<XGanttWidgetItem", ">", "||", "None" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L640-L654
train
Removes the top level item at the inputed index from the tree widget. Returns the item that was removed or None if no such item exists.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttwidget.py
XGanttWidget.updateItemData
def updateItemData(self, item, index): """ Updates the item information from the tree. :param item | <XGanttWidgetItem> index | <int> """ from projexui.widgets.xganttwidget.xganttwidgetitem import XGanttWidgetItem if not isin...
python
def updateItemData(self, item, index): """ Updates the item information from the tree. :param item | <XGanttWidgetItem> index | <int> """ from projexui.widgets.xganttwidget.xganttwidgetitem import XGanttWidgetItem if not isin...
[ "def", "updateItemData", "(", "self", ",", "item", ",", "index", ")", ":", "from", "projexui", ".", "widgets", ".", "xganttwidget", ".", "xganttwidgetitem", "import", "XGanttWidgetItem", "if", "not", "isinstance", "(", "item", ",", "XGanttWidgetItem", ")", ":"...
Updates the item information from the tree. :param item | <XGanttWidgetItem> index | <int>
[ "Updates", "the", "item", "information", "from", "the", "tree", ".", ":", "param", "item", "|", "<XGanttWidgetItem", ">", "index", "|", "<int", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L714-L736
train
Updates the item data with the information from the tree.
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", ")", ":", "# type: (str, str) -> str", "loader", "=", "pkgutil", ".", "get_loader", "(", "package", ")", "if", "loader", "is", "None", "or", "not", "hasattr", "(", "loader", ",", "'get_data'", ")", ":"...
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
Return the full file path of a resource of a package.
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggerwidget.py
XLoggerWidget.color
def color(self, key): """ Returns the color value for the given key for this console. :param key | <unicode> :return <QtGui.QColor> """ if type(key) == int: key = self.LoggingMap.get(key, ('NotSet', ''))[0] name = n...
python
def color(self, key): """ Returns the color value for the given key for this console. :param key | <unicode> :return <QtGui.QColor> """ if type(key) == int: key = self.LoggingMap.get(key, ('NotSet', ''))[0] name = n...
[ "def", "color", "(", "self", ",", "key", ")", ":", "if", "type", "(", "key", ")", "==", "int", ":", "key", "=", "self", ".", "LoggingMap", ".", "get", "(", "key", ",", "(", "'NotSet'", ",", "''", ")", ")", "[", "0", "]", "name", "=", "natives...
Returns the color value for the given key for this console. :param key | <unicode> :return <QtGui.QColor>
[ "Returns", "the", "color", "value", "for", "the", "given", "key", "for", "this", "console", ".", ":", "param", "key", "|", "<unicode", ">", ":", "return", "<QtGui", ".", "QColor", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggerwidget.py#L185-L196
train
Returns the color value for the given key for this console.
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggerwidget.py
XLoggerWidget.log
def log(self, level, msg): """ Logs the inputed message with the given level. :param level | <int> | logging level value msg | <unicode> :return <bool> success """ if self.isDestroyed(): return ...
python
def log(self, level, msg): """ Logs the inputed message with the given level. :param level | <int> | logging level value msg | <unicode> :return <bool> success """ if self.isDestroyed(): return ...
[ "def", "log", "(", "self", ",", "level", ",", "msg", ")", ":", "if", "self", ".", "isDestroyed", "(", ")", ":", "return", "locker", "=", "QtCore", ".", "QMutexLocker", "(", "self", ".", "_mutex", ")", "try", ":", "msg", "=", "projex", ".", "text", ...
Logs the inputed message with the given level. :param level | <int> | logging level value msg | <unicode> :return <bool> success
[ "Logs", "the", "inputed", "message", "with", "the", "given", "level", ".", ":", "param", "level", "|", "<int", ">", "|", "logging", "level", "value", "msg", "|", "<unicode", ">", ":", "return", "<bool", ">", "success" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggerwidget.py#L304-L331
train
Logs the inputed message with the given level.
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggerwidget.py
XLoggerWidget.loggerLevel
def loggerLevel(self, logger='root'): """ Returns the logging level for the inputed logger. :param logger | <str> || <logging.Logger> """ if isinstance(logger, logging.Logger): logger = logger.name return self.handler().loggerLe...
python
def loggerLevel(self, logger='root'): """ Returns the logging level for the inputed logger. :param logger | <str> || <logging.Logger> """ if isinstance(logger, logging.Logger): logger = logger.name return self.handler().loggerLe...
[ "def", "loggerLevel", "(", "self", ",", "logger", "=", "'root'", ")", ":", "if", "isinstance", "(", "logger", ",", "logging", ".", "Logger", ")", ":", "logger", "=", "logger", ".", "name", "return", "self", ".", "handler", "(", ")", ".", "loggerLevel",...
Returns the logging level for the inputed logger. :param logger | <str> || <logging.Logger>
[ "Returns", "the", "logging", "level", "for", "the", "inputed", "logger", ".", ":", "param", "logger", "|", "<str", ">", "||", "<logging", ".", "Logger", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggerwidget.py#L342-L351
train
Returns the logging level for the given logger.
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggerwidget.py
XLoggerWidget.restoreSettings
def restoreSettings(self, settings): """ Restores the settings for this logger from the inputed settings. :param <QtCore.QSettings> """ val = unwrapVariant(settings.value('format')) if val: self.setFormatText(val) level...
python
def restoreSettings(self, settings): """ Restores the settings for this logger from the inputed settings. :param <QtCore.QSettings> """ val = unwrapVariant(settings.value('format')) if val: self.setFormatText(val) level...
[ "def", "restoreSettings", "(", "self", ",", "settings", ")", ":", "val", "=", "unwrapVariant", "(", "settings", ".", "value", "(", "'format'", ")", ")", "if", "val", ":", "self", ".", "setFormatText", "(", "val", ")", "levels", "=", "unwrapVariant", "(",...
Restores the settings for this logger from the inputed settings. :param <QtCore.QSettings>
[ "Restores", "the", "settings", "for", "this", "logger", "from", "the", "inputed", "settings", ".", ":", "param", "<QtCore", ".", "QSettings", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggerwidget.py#L388-L407
train
Restores the settings for this logger from the inputed settings.
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggerwidget.py
XLoggerWidget.saveSettings
def saveSettings(self, settings): """ Saves the logging settings for this widget to the inputed settings. :param <QtCore.QSettings> """ lvls = [] for logger, level in self.loggerLevels().items(): lvls.append('{0}:{1}'.format(logger, level...
python
def saveSettings(self, settings): """ Saves the logging settings for this widget to the inputed settings. :param <QtCore.QSettings> """ lvls = [] for logger, level in self.loggerLevels().items(): lvls.append('{0}:{1}'.format(logger, level...
[ "def", "saveSettings", "(", "self", ",", "settings", ")", ":", "lvls", "=", "[", "]", "for", "logger", ",", "level", "in", "self", ".", "loggerLevels", "(", ")", ".", "items", "(", ")", ":", "lvls", ".", "append", "(", "'{0}:{1}'", ".", "format", "...
Saves the logging settings for this widget to the inputed settings. :param <QtCore.QSettings>
[ "Saves", "the", "logging", "settings", "for", "this", "widget", "to", "the", "inputed", "settings", ".", ":", "param", "<QtCore", ".", "QSettings", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggerwidget.py#L409-L421
train
Saves the logging settings for this widget to the inputed settings.
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
Scrolls to the end for this console edit.
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggerwidget.py
XLoggerWidget.setColor
def setColor(self, key, value): """ Sets the color value for the inputed color. :param key | <unicode> value | <QtGui.QColor> """ key = nativestring(key).capitalize() self._colorSet.setColor(key, value) # ...
python
def setColor(self, key, value): """ Sets the color value for the inputed color. :param key | <unicode> value | <QtGui.QColor> """ key = nativestring(key).capitalize() self._colorSet.setColor(key, value) # ...
[ "def", "setColor", "(", "self", ",", "key", ",", "value", ")", ":", "key", "=", "nativestring", "(", "key", ")", ".", "capitalize", "(", ")", "self", ".", "_colorSet", ".", "setColor", "(", "key", ",", "value", ")", "# update the palette information\r", ...
Sets the color value for the inputed color. :param key | <unicode> value | <QtGui.QColor>
[ "Sets", "the", "color", "value", "for", "the", "inputed", "color", ".", ":", "param", "key", "|", "<unicode", ">", "value", "|", "<QtGui", ".", "QColor", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggerwidget.py#L449-L463
train
Sets the color for the inputed color.
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggerwidget.py
XLoggerWidget.setColorSet
def setColorSet(self, colorSet): """ Sets the colors for this console to the inputed collection. :param colors | <XLoggerColorSet> """ self._colorSet = colorSet # update the palette information palette = self.palette() pale...
python
def setColorSet(self, colorSet): """ Sets the colors for this console to the inputed collection. :param colors | <XLoggerColorSet> """ self._colorSet = colorSet # update the palette information palette = self.palette() pale...
[ "def", "setColorSet", "(", "self", ",", "colorSet", ")", ":", "self", ".", "_colorSet", "=", "colorSet", "# update the palette information\r", "palette", "=", "self", ".", "palette", "(", ")", "palette", ".", "setColor", "(", "palette", ".", "Text", ",", "co...
Sets the colors for this console to the inputed collection. :param colors | <XLoggerColorSet>
[ "Sets", "the", "colors", "for", "this", "console", "to", "the", "inputed", "collection", ".", ":", "param", "colors", "|", "<XLoggerColorSet", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggerwidget.py#L465-L477
train
Sets the colors for this console to the inputed collection.
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggerwidget.py
XLoggerWidget.setConfigurable
def setConfigurable(self, state): """ Sets whether or not this logger widget is configurable. :param state | <bool> """ self._configurable = state self._configButton.setVisible(state)
python
def setConfigurable(self, state): """ Sets whether or not this logger widget is configurable. :param state | <bool> """ self._configurable = state self._configButton.setVisible(state)
[ "def", "setConfigurable", "(", "self", ",", "state", ")", ":", "self", ".", "_configurable", "=", "state", "self", ".", "_configButton", ".", "setVisible", "(", "state", ")" ]
Sets whether or not this logger widget is configurable. :param state | <bool>
[ "Sets", "whether", "or", "not", "this", "logger", "widget", "is", "configurable", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggerwidget.py#L479-L486
train
Sets whether or not this logger widget is configurable.
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggerwidget.py
XLoggerWidget.setCurrentMode
def setCurrentMode(self, mode): """ Sets the current color mode for this console to the inputed value. :param mode | <unicode> """ if type(mode) == int: mode = self.LoggingMap.get(mode, ('standard', ''))[0] if mode == self._...
python
def setCurrentMode(self, mode): """ Sets the current color mode for this console to the inputed value. :param mode | <unicode> """ if type(mode) == int: mode = self.LoggingMap.get(mode, ('standard', ''))[0] if mode == self._...
[ "def", "setCurrentMode", "(", "self", ",", "mode", ")", ":", "if", "type", "(", "mode", ")", "==", "int", ":", "mode", "=", "self", ".", "LoggingMap", ".", "get", "(", "mode", ",", "(", "'standard'", ",", "''", ")", ")", "[", "0", "]", "if", "m...
Sets the current color mode for this console to the inputed value. :param mode | <unicode>
[ "Sets", "the", "current", "color", "mode", "for", "this", "console", "to", "the", "inputed", "value", ".", ":", "param", "mode", "|", "<unicode", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggerwidget.py#L488-L507
train
Sets the current color mode for this console.
bitesofcode/projexui
projexui/dialogs/xwizardbrowserdialog/xwizardplugin.py
XWizardPlugin.iconFile
def iconFile( self ): """ Returns the icon file that is linked that to this plugin. :return <str> """ if not os.path.isfile(self._iconFile): return projexui.resources.find(self._iconFile) return self._iconFile
python
def iconFile( self ): """ Returns the icon file that is linked that to this plugin. :return <str> """ if not os.path.isfile(self._iconFile): return projexui.resources.find(self._iconFile) return self._iconFile
[ "def", "iconFile", "(", "self", ")", ":", "if", "not", "os", ".", "path", ".", "isfile", "(", "self", ".", "_iconFile", ")", ":", "return", "projexui", ".", "resources", ".", "find", "(", "self", ".", "_iconFile", ")", "return", "self", ".", "_iconFi...
Returns the icon file that is linked that to this plugin. :return <str>
[ "Returns", "the", "icon", "file", "that", "is", "linked", "that", "to", "this", "plugin", ".", ":", "return", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xwizardbrowserdialog/xwizardplugin.py#L55-L63
train
Returns the path to the icon file that is linked to this plugin.
bitesofcode/projexui
projexui/dialogs/xwizardbrowserdialog/xwizardplugin.py
XWizardPlugin.groupIcon
def groupIcon( cls, groupName, default = None ): """ Returns the icon for the inputed group name. :param groupName | <str> default | <str> || None :return <str> """ if ( cls._groupIcons is None ): cls....
python
def groupIcon( cls, groupName, default = None ): """ Returns the icon for the inputed group name. :param groupName | <str> default | <str> || None :return <str> """ if ( cls._groupIcons is None ): cls....
[ "def", "groupIcon", "(", "cls", ",", "groupName", ",", "default", "=", "None", ")", ":", "if", "(", "cls", ".", "_groupIcons", "is", "None", ")", ":", "cls", ".", "_groupIcons", "=", "{", "}", "if", "(", "not", "default", ")", ":", "default", "=", ...
Returns the icon for the inputed group name. :param groupName | <str> default | <str> || None :return <str>
[ "Returns", "the", "icon", "for", "the", "inputed", "group", "name", ".", ":", "param", "groupName", "|", "<str", ">", "default", "|", "<str", ">", "||", "None", ":", "return", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xwizardbrowserdialog/xwizardplugin.py#L152-L167
train
Returns the icon for the inputed group name.
bitesofcode/projexui
projexui/dialogs/xwizardbrowserdialog/xwizardplugin.py
XWizardPlugin.find
def find( cls, name ): """ Finds a particular wizard plugin based on its name. :param name | <str> || None """ if ( cls._plugins is None ): cls._plugins = {} return cls._plugins.get(nativestring(name))
python
def find( cls, name ): """ Finds a particular wizard plugin based on its name. :param name | <str> || None """ if ( cls._plugins is None ): cls._plugins = {} return cls._plugins.get(nativestring(name))
[ "def", "find", "(", "cls", ",", "name", ")", ":", "if", "(", "cls", ".", "_plugins", "is", "None", ")", ":", "cls", ".", "_plugins", "=", "{", "}", "return", "cls", ".", "_plugins", ".", "get", "(", "nativestring", "(", "name", ")", ")" ]
Finds a particular wizard plugin based on its name. :param name | <str> || None
[ "Finds", "a", "particular", "wizard", "plugin", "based", "on", "its", "name", ".", ":", "param", "name", "|", "<str", ">", "||", "None" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xwizardbrowserdialog/xwizardplugin.py#L170-L179
train
Returns the wizard plugin based on its name.
bitesofcode/projexui
projexui/dialogs/xwizardbrowserdialog/xwizardplugin.py
XWizardPlugin.setGroupIcon
def setGroupIcon( cls, groupName, icon ): """ Sets the group icon for the wizard plugin to the inputed icon. :param groupName | <str> icon | <str> """ if ( cls._groupIcons is None ): cls._groupIcons = {} ...
python
def setGroupIcon( cls, groupName, icon ): """ Sets the group icon for the wizard plugin to the inputed icon. :param groupName | <str> icon | <str> """ if ( cls._groupIcons is None ): cls._groupIcons = {} ...
[ "def", "setGroupIcon", "(", "cls", ",", "groupName", ",", "icon", ")", ":", "if", "(", "cls", ".", "_groupIcons", "is", "None", ")", ":", "cls", ".", "_groupIcons", "=", "{", "}", "cls", ".", "_groupIcons", "[", "nativestring", "(", "groupName", ")", ...
Sets the group icon for the wizard plugin to the inputed icon. :param groupName | <str> icon | <str>
[ "Sets", "the", "group", "icon", "for", "the", "wizard", "plugin", "to", "the", "inputed", "icon", ".", ":", "param", "groupName", "|", "<str", ">", "icon", "|", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xwizardbrowserdialog/xwizardplugin.py#L194-L204
train
Sets the group icon for the wizard plugin to the inputed icon.
bitesofcode/projexui
projexui/dialogs/xwizardbrowserdialog/xwizardplugin.py
XWizardPlugin.register
def register( cls, plugin ): """ Registers a particular plugin to the global system at the given name. :param plugin | <XWizardPlugin> """ if ( not plugin ): return if ( cls._plugins is None ): cls._plugins = {} ...
python
def register( cls, plugin ): """ Registers a particular plugin to the global system at the given name. :param plugin | <XWizardPlugin> """ if ( not plugin ): return if ( cls._plugins is None ): cls._plugins = {} ...
[ "def", "register", "(", "cls", ",", "plugin", ")", ":", "if", "(", "not", "plugin", ")", ":", "return", "if", "(", "cls", ".", "_plugins", "is", "None", ")", ":", "cls", ".", "_plugins", "=", "{", "}", "cls", ".", "_plugins", "[", "plugin", ".", ...
Registers a particular plugin to the global system at the given name. :param plugin | <XWizardPlugin>
[ "Registers", "a", "particular", "plugin", "to", "the", "global", "system", "at", "the", "given", "name", ".", ":", "param", "plugin", "|", "<XWizardPlugin", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xwizardbrowserdialog/xwizardplugin.py#L207-L219
train
Registers a particular plugin to the global system at the given name.
bitesofcode/projexui
projexui/dialogs/xwizardbrowserdialog/xwizardplugin.py
XScaffoldWizardPlugin.runWizard
def runWizard(self, parent): """ Runs the wizard instance for this plugin. :param parent | <QWidget> :return <bool> | success """ wizard = XScaffoldWizard(self._scaffold, parent) return wizard.exec_()
python
def runWizard(self, parent): """ Runs the wizard instance for this plugin. :param parent | <QWidget> :return <bool> | success """ wizard = XScaffoldWizard(self._scaffold, parent) return wizard.exec_()
[ "def", "runWizard", "(", "self", ",", "parent", ")", ":", "wizard", "=", "XScaffoldWizard", "(", "self", ".", "_scaffold", ",", "parent", ")", "return", "wizard", ".", "exec_", "(", ")" ]
Runs the wizard instance for this plugin. :param parent | <QWidget> :return <bool> | success
[ "Runs", "the", "wizard", "instance", "for", "this", "plugin", ".", ":", "param", "parent", "|", "<QWidget", ">", ":", "return", "<bool", ">", "|", "success" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xwizardbrowserdialog/xwizardplugin.py#L233-L242
train
Runs the wizard instance for this plugin.
bitesofcode/projexui
projexui/widgets/xorbgridedit/xorbgridedit.py
XOrbGridEdit.addWidget
def addWidget(self, widget, align=Qt.AlignLeft, before=None): """ Adds a widget to the grid edit's toolbar with the given alignment. :param widget | <QtGui.QWidget> align | <QtCore.Qt.Alignment> """ # self.uiToolbarLAYOUT points ...
python
def addWidget(self, widget, align=Qt.AlignLeft, before=None): """ Adds a widget to the grid edit's toolbar with the given alignment. :param widget | <QtGui.QWidget> align | <QtCore.Qt.Alignment> """ # self.uiToolbarLAYOUT points ...
[ "def", "addWidget", "(", "self", ",", "widget", ",", "align", "=", "Qt", ".", "AlignLeft", ",", "before", "=", "None", ")", ":", "# self.uiToolbarLAYOUT points to a deleted C/C++ object in PySide...\r", "layout", "=", "self", ".", "findChild", "(", "QHBoxLayout", ...
Adds a widget to the grid edit's toolbar with the given alignment. :param widget | <QtGui.QWidget> align | <QtCore.Qt.Alignment>
[ "Adds", "a", "widget", "to", "the", "grid", "edit", "s", "toolbar", "with", "the", "given", "alignment", ".", ":", "param", "widget", "|", "<QtGui", ".", "QWidget", ">", "align", "|", "<QtCore", ".", "Qt", ".", "Alignment", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbgridedit/xorbgridedit.py#L77-L103
train
Adds a widget to the grid edit s toolbar with the given alignment.
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
Assigns the query from the query widget to the edit.
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
Refreshes the table with the current information from the database.
bitesofcode/projexui
projexui/widgets/xorbgridedit/xorbgridedit.py
XOrbGridEdit.restoreXml
def restoreXml(self, xml): """ Restores the settings for this edit from xml. :param xml | <xml.etree.ElementTree> """ self.uiRecordTREE.restoreXml(xml.find('tree')) # restore the query xquery = xml.find('query') if xquery i...
python
def restoreXml(self, xml): """ Restores the settings for this edit from xml. :param xml | <xml.etree.ElementTree> """ self.uiRecordTREE.restoreXml(xml.find('tree')) # restore the query xquery = xml.find('query') if xquery i...
[ "def", "restoreXml", "(", "self", ",", "xml", ")", ":", "self", ".", "uiRecordTREE", ".", "restoreXml", "(", "xml", ".", "find", "(", "'tree'", ")", ")", "# restore the query\r", "xquery", "=", "xml", ".", "find", "(", "'query'", ")", "if", "xquery", "...
Restores the settings for this edit from xml. :param xml | <xml.etree.ElementTree>
[ "Restores", "the", "settings", "for", "this", "edit", "from", "xml", ".", ":", "param", "xml", "|", "<xml", ".", "etree", ".", "ElementTree", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbgridedit/xorbgridedit.py#L196-L207
train
Restores the settings for this edit from xml.
bitesofcode/projexui
projexui/widgets/xorbgridedit/xorbgridedit.py
XOrbGridEdit.saveXml
def saveXml(self, xml): """ Saves the settings for this edit to the xml parent. :param xparent | <xml.etree.ElementTree> """ # save grouping xtree = ElementTree.SubElement(xml, 'tree') self.uiRecordTREE.saveXml(xtree) # sav...
python
def saveXml(self, xml): """ Saves the settings for this edit to the xml parent. :param xparent | <xml.etree.ElementTree> """ # save grouping xtree = ElementTree.SubElement(xml, 'tree') self.uiRecordTREE.saveXml(xtree) # sav...
[ "def", "saveXml", "(", "self", ",", "xml", ")", ":", "# save grouping\r", "xtree", "=", "ElementTree", ".", "SubElement", "(", "xml", ",", "'tree'", ")", "self", ".", "uiRecordTREE", ".", "saveXml", "(", "xtree", ")", "# save the query\r", "query", "=", "s...
Saves the settings for this edit to the xml parent. :param xparent | <xml.etree.ElementTree>
[ "Saves", "the", "settings", "for", "this", "edit", "to", "the", "xml", "parent", ".", ":", "param", "xparent", "|", "<xml", ".", "etree", ".", "ElementTree", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbgridedit/xorbgridedit.py#L209-L222
train
Saves the settings for this edit to the xml parent.
bitesofcode/projexui
projexui/widgets/xorbgridedit/xorbgridedit.py
XOrbGridEdit.setEditable
def setEditable(self, state): """ Sets the editable state for this grid widget. :param state | <bool> """ self.uiRecordTREE.setEditable(state) self.uiSaveBTN.setVisible(state)
python
def setEditable(self, state): """ Sets the editable state for this grid widget. :param state | <bool> """ self.uiRecordTREE.setEditable(state) self.uiSaveBTN.setVisible(state)
[ "def", "setEditable", "(", "self", ",", "state", ")", ":", "self", ".", "uiRecordTREE", ".", "setEditable", "(", "state", ")", "self", ".", "uiSaveBTN", ".", "setVisible", "(", "state", ")" ]
Sets the editable state for this grid widget. :param state | <bool>
[ "Sets", "the", "editable", "state", "for", "this", "grid", "widget", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbgridedit/xorbgridedit.py#L251-L258
train
Sets the editable state for this grid widget.
bitesofcode/projexui
projexui/widgets/xorbgridedit/xorbgridedit.py
XOrbGridEdit.setQuery
def setQuery(self, query, autoRefresh=True): """ Sets the query for this edit to the inputed query. :param query | <orb.Query> """ self.uiRecordTREE.setQuery(query, autoRefresh=autoRefresh)
python
def setQuery(self, query, autoRefresh=True): """ Sets the query for this edit to the inputed query. :param query | <orb.Query> """ self.uiRecordTREE.setQuery(query, autoRefresh=autoRefresh)
[ "def", "setQuery", "(", "self", ",", "query", ",", "autoRefresh", "=", "True", ")", ":", "self", ".", "uiRecordTREE", ".", "setQuery", "(", "query", ",", "autoRefresh", "=", "autoRefresh", ")" ]
Sets the query for this edit to the inputed query. :param query | <orb.Query>
[ "Sets", "the", "query", "for", "this", "edit", "to", "the", "inputed", "query", ".", ":", "param", "query", "|", "<orb", ".", "Query", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbgridedit/xorbgridedit.py#L260-L266
train
Sets the query for this edit to the inputed query.
bitesofcode/projexui
projexui/widgets/xorbgridedit/xorbgridedit.py
XOrbGridEdit.setTableType
def setTableType(self, tableType, autoRefresh=True): """ Sets the table type associated with this edit. :param tableType | <subclass of orb.Table> """ self.uiRecordTREE.setTableType(tableType) self._queryWidget.setTableType(tableType) ...
python
def setTableType(self, tableType, autoRefresh=True): """ Sets the table type associated with this edit. :param tableType | <subclass of orb.Table> """ self.uiRecordTREE.setTableType(tableType) self._queryWidget.setTableType(tableType) ...
[ "def", "setTableType", "(", "self", ",", "tableType", ",", "autoRefresh", "=", "True", ")", ":", "self", ".", "uiRecordTREE", ".", "setTableType", "(", "tableType", ")", "self", ".", "_queryWidget", ".", "setTableType", "(", "tableType", ")", "if", "autoRefr...
Sets the table type associated with this edit. :param tableType | <subclass of orb.Table>
[ "Sets", "the", "table", "type", "associated", "with", "this", "edit", ".", ":", "param", "tableType", "|", "<subclass", "of", "orb", ".", "Table", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbgridedit/xorbgridedit.py#L296-L306
train
Sets the table type associated with this edit.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodelayout.py
XNodeLayout.connectionMap
def connectionMap(self, scene, nodes): """ Generates a mapping for the nodes to each other based on their connections. :param nodes | [<XNode>, ..] :return {<XNode>: ([<XNode> input, ..], [<XNode> output, ..]), ..} """ output = ...
python
def connectionMap(self, scene, nodes): """ Generates a mapping for the nodes to each other based on their connections. :param nodes | [<XNode>, ..] :return {<XNode>: ([<XNode> input, ..], [<XNode> output, ..]), ..} """ output = ...
[ "def", "connectionMap", "(", "self", ",", "scene", ",", "nodes", ")", ":", "output", "=", "{", "}", "connections", "=", "scene", ".", "connections", "(", ")", "for", "node", "in", "nodes", ":", "inputs", "=", "[", "]", "outputs", "=", "[", "]", "fo...
Generates a mapping for the nodes to each other based on their connections. :param nodes | [<XNode>, ..] :return {<XNode>: ([<XNode> input, ..], [<XNode> output, ..]), ..}
[ "Generates", "a", "mapping", "for", "the", "nodes", "to", "each", "other", "based", "on", "their", "connections", ".", ":", "param", "nodes", "|", "[", "<XNode", ">", "..", "]", ":", "return", "{", "<XNode", ">", ":", "(", "[", "<XNode", ">", "input"...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayout.py#L32-L59
train
Returns a mapping from the nodes to the other nodes.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodelayout.py
XLayeredNodeLayout.generateLayers
def generateLayers(self, scene, nodes, connections): """ Breaks the nodes into layers by grouping the nodes together based on their connection scheme. :param nodes | [<XNode>, ..] """ depth = {} for node in nodes: depth[node] = (...
python
def generateLayers(self, scene, nodes, connections): """ Breaks the nodes into layers by grouping the nodes together based on their connection scheme. :param nodes | [<XNode>, ..] """ depth = {} for node in nodes: depth[node] = (...
[ "def", "generateLayers", "(", "self", ",", "scene", ",", "nodes", ",", "connections", ")", ":", "depth", "=", "{", "}", "for", "node", "in", "nodes", ":", "depth", "[", "node", "]", "=", "(", "self", ".", "calculateDepth", "(", "node", ",", "connecti...
Breaks the nodes into layers by grouping the nodes together based on their connection scheme. :param nodes | [<XNode>, ..]
[ "Breaks", "the", "nodes", "into", "layers", "by", "grouping", "the", "nodes", "together", "based", "on", "their", "connection", "scheme", ".", ":", "param", "nodes", "|", "[", "<XNode", ">", "..", "]" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayout.py#L166-L186
train
Generates the layers for the given nodes.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodelayout.py
XLayeredNodeLayout.layout
def layout(self, scene, nodes, center=None, padX=None, padY=None, direction=None, animationGroup=None): """ Lays out the nodes for this scene based on a block layering algorithm. ...
python
def layout(self, scene, nodes, center=None, padX=None, padY=None, direction=None, animationGroup=None): """ Lays out the nodes for this scene based on a block layering algorithm. ...
[ "def", "layout", "(", "self", ",", "scene", ",", "nodes", ",", "center", "=", "None", ",", "padX", "=", "None", ",", "padY", "=", "None", ",", "direction", "=", "None", ",", "animationGroup", "=", "None", ")", ":", "nodes", "=", "filter", "(", "lam...
Lays out the nodes for this scene based on a block layering algorithm. :param scene | <XNodeScene> nodes | [<XNode>, ..] center | <QPointF> || None padX | <int> || None padY ...
[ "Lays", "out", "the", "nodes", "for", "this", "scene", "based", "on", "a", "block", "layering", "algorithm", ".", ":", "param", "scene", "|", "<XNodeScene", ">", "nodes", "|", "[", "<XNode", ">", "..", "]", "center", "|", "<QPointF", ">", "||", "None",...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayout.py#L188-L434
train
This method creates a new layout for the given scene and nodes.
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
Parse a URL into a configuration dict
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
Get the auto_config URL for the current node.
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
Dispatches the request to the plugins process method
johnnoone/aioconsul
aioconsul/client/members_endpoint.py
MembersEndpoint.items
async def items(self, *, wan=None): """Returns the members as seen by the local serf agent Parameters: wan (bool): List of WAN members instead of the LAN members Returns: Collection: List of cluster's members This endpoint returns an object like:: [...
python
async def items(self, *, wan=None): """Returns the members as seen by the local serf agent Parameters: wan (bool): List of WAN members instead of the LAN members Returns: Collection: List of cluster's members This endpoint returns an object like:: [...
[ "async", "def", "items", "(", "self", ",", "*", ",", "wan", "=", "None", ")", ":", "response", "=", "await", "self", ".", "_api", ".", "get", "(", "\"/v1/agent/members\"", ",", "params", "=", "{", "\"wan\"", ":", "wan", "}", ")", "return", "response"...
Returns the members as seen by the local serf agent Parameters: wan (bool): List of WAN members instead of the LAN members Returns: Collection: List of cluster's members This endpoint returns an object like:: [ { "Name": ...
[ "Returns", "the", "members", "as", "seen", "by", "the", "local", "serf", "agent" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/members_endpoint.py#L9-L42
train
Returns the members as seen by the local serf agent
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
Attempts to join a node with a given WAN pool.
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
Forces removal of a node s old notonical cache entries.
bitesofcode/projexui
projexui/widgets/xviewwidget/xviewpanelmenu.py
XViewBaseMenu.assignGroup
def assignGroup(self, action): """ Assigns the group for the given action to the current view. :param action | <QAction> """ grp = unwrapVariant(action.data()) view = self._currentPanel.currentView() view.setViewingGroup(grp)
python
def assignGroup(self, action): """ Assigns the group for the given action to the current view. :param action | <QAction> """ grp = unwrapVariant(action.data()) view = self._currentPanel.currentView() view.setViewingGroup(grp)
[ "def", "assignGroup", "(", "self", ",", "action", ")", ":", "grp", "=", "unwrapVariant", "(", "action", ".", "data", "(", ")", ")", "view", "=", "self", ".", "_currentPanel", ".", "currentView", "(", ")", "view", ".", "setViewingGroup", "(", "grp", ")"...
Assigns the group for the given action to the current view. :param action | <QAction>
[ "Assigns", "the", "group", "for", "the", "given", "action", "to", "the", "current", "view", ".", ":", "param", "action", "|", "<QAction", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanelmenu.py#L68-L76
train
Assigns the group for the given action to the current view.
bitesofcode/projexui
projexui/widgets/xviewwidget/xviewpanelmenu.py
XViewBaseMenu.detachPanel
def detachPanel(self): """ Detaches the current panel as a floating window. """ from projexui.widgets.xviewwidget import XViewDialog dlg = XViewDialog(self._viewWidget, self._viewWidget.viewTypes()) size = self._currentPanel.size() dlg.viewWidget().curren...
python
def detachPanel(self): """ Detaches the current panel as a floating window. """ from projexui.widgets.xviewwidget import XViewDialog dlg = XViewDialog(self._viewWidget, self._viewWidget.viewTypes()) size = self._currentPanel.size() dlg.viewWidget().curren...
[ "def", "detachPanel", "(", "self", ")", ":", "from", "projexui", ".", "widgets", ".", "xviewwidget", "import", "XViewDialog", "dlg", "=", "XViewDialog", "(", "self", ".", "_viewWidget", ",", "self", ".", "_viewWidget", ".", "viewTypes", "(", ")", ")", "siz...
Detaches the current panel as a floating window.
[ "Detaches", "the", "current", "panel", "as", "a", "floating", "window", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanelmenu.py#L104-L114
train
Detaches the current panel as a floating window.
bitesofcode/projexui
projexui/widgets/xviewwidget/xviewpanelmenu.py
XViewBaseMenu.detachPanelCopy
def detachPanelCopy(self): """ Detaches the current panel as a floating window. """ from projexui.widgets.xviewwidget import XViewDialog dlg = XViewDialog(self._viewWidget, self._viewWidget.viewTypes()) size = self._currentPanel.size() view = self._curren...
python
def detachPanelCopy(self): """ Detaches the current panel as a floating window. """ from projexui.widgets.xviewwidget import XViewDialog dlg = XViewDialog(self._viewWidget, self._viewWidget.viewTypes()) size = self._currentPanel.size() view = self._curren...
[ "def", "detachPanelCopy", "(", "self", ")", ":", "from", "projexui", ".", "widgets", ".", "xviewwidget", "import", "XViewDialog", "dlg", "=", "XViewDialog", "(", "self", ".", "_viewWidget", ",", "self", ".", "_viewWidget", ".", "viewTypes", "(", ")", ")", ...
Detaches the current panel as a floating window.
[ "Detaches", "the", "current", "panel", "as", "a", "floating", "window", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanelmenu.py#L116-L134
train
Detaches the current panel as a floating window.
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
Goes to the next panel tab.
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
Goes to the previous panel tab.
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", "(", ")", "# duplicate the current view", "if", "view", ":", "new_view", "=", "view", ".", "duplicate", "(", "self", ".", "_currentPanel", ")", "self"...
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
Creates a new panel with a copy of the current widget.
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
Prompts the user for a custom name for the current panel tab.
bitesofcode/projexui
projexui/widgets/xviewwidget/xviewpanelmenu.py
XViewBaseMenu.swapTabType
def swapTabType(self, action): """ Swaps the current tab view for the inputed action's type. :param action | <QAction> """ # for a new tab, use the add tab slot if not self._currentPanel.count(): self.addView(action) return ...
python
def swapTabType(self, action): """ Swaps the current tab view for the inputed action's type. :param action | <QAction> """ # for a new tab, use the add tab slot if not self._currentPanel.count(): self.addView(action) return ...
[ "def", "swapTabType", "(", "self", ",", "action", ")", ":", "# for a new tab, use the add tab slot", "if", "not", "self", ".", "_currentPanel", ".", "count", "(", ")", ":", "self", ".", "addView", "(", "action", ")", "return", "# make sure we're not trying to swit...
Swaps the current tab view for the inputed action's type. :param action | <QAction>
[ "Swaps", "the", "current", "tab", "view", "for", "the", "inputed", "action", "s", "type", ".", ":", "param", "action", "|", "<QAction", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanelmenu.py#L276-L311
train
Swaps the current tab view for the inputed action s type.
intelsdi-x/snap-plugin-lib-py
snap_plugin/v1/metric.py
Metric.data
def data(self): """Metric data Args: value (:obj:`bool` or :obj:`int` or :obj:`long` or :obj:`float` or :obj:`basestring` or :obj:`bytes`) Returns: value Raises: :obj:`TypeError` """ if self._data_type == int: ...
python
def data(self): """Metric data Args: value (:obj:`bool` or :obj:`int` or :obj:`long` or :obj:`float` or :obj:`basestring` or :obj:`bytes`) Returns: value Raises: :obj:`TypeError` """ if self._data_type == int: ...
[ "def", "data", "(", "self", ")", ":", "if", "self", ".", "_data_type", "==", "int", ":", "if", "self", ".", "_pb", ".", "HasField", "(", "\"int64_data\"", ")", ":", "return", "self", ".", "_pb", ".", "int64_data", "if", "self", ".", "_pb", ".", "Ha...
Metric data Args: value (:obj:`bool` or :obj:`int` or :obj:`long` or :obj:`float` or :obj:`basestring` or :obj:`bytes`) Returns: value Raises: :obj:`TypeError`
[ "Metric", "data" ]
8da5d00ac5f9d2b48a7239563ac7788209891ca4
https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/metric.py#L243-L277
train
Returns the data field of the object as a tuple.
pnegahdar/inenv
inenv/inenv.py
toggle_autojump
def toggle_autojump(): """Toggles Autojump""" if not autojump_enabled(): with open(AUTOJUMP_FILE, 'w+') as ajfile: ajfile.write("enabled") else: os.remove(AUTOJUMP_FILE)
python
def toggle_autojump(): """Toggles Autojump""" if not autojump_enabled(): with open(AUTOJUMP_FILE, 'w+') as ajfile: ajfile.write("enabled") else: os.remove(AUTOJUMP_FILE)
[ "def", "toggle_autojump", "(", ")", ":", "if", "not", "autojump_enabled", "(", ")", ":", "with", "open", "(", "AUTOJUMP_FILE", ",", "'w+'", ")", "as", "ajfile", ":", "ajfile", ".", "write", "(", "\"enabled\"", ")", "else", ":", "os", ".", "remove", "("...
Toggles Autojump
[ "Toggles", "Autojump" ]
8f484e520892bf9eb59f91b4b5c92df9fbd9a4e6
https://github.com/pnegahdar/inenv/blob/8f484e520892bf9eb59f91b4b5c92df9fbd9a4e6/inenv/inenv.py#L228-L234
train
Toggles autojump
pnegahdar/inenv
inenv/inenv.py
InenvManager.install_deps
def install_deps(self, virtualenv, skip_cached=True, always_exit=False, exit_if_failed=True, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr): """ :type virtualenv: VirtualEnv """ config = self.registered_venvs[virtualenv.venv_name] configed_deps = conf...
python
def install_deps(self, virtualenv, skip_cached=True, always_exit=False, exit_if_failed=True, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr): """ :type virtualenv: VirtualEnv """ config = self.registered_venvs[virtualenv.venv_name] configed_deps = conf...
[ "def", "install_deps", "(", "self", ",", "virtualenv", ",", "skip_cached", "=", "True", ",", "always_exit", "=", "False", ",", "exit_if_failed", "=", "True", ",", "stdin", "=", "sys", ".", "stdin", ",", "stdout", "=", "sys", ".", "stdout", ",", "stderr",...
:type virtualenv: VirtualEnv
[ ":", "type", "virtualenv", ":", "VirtualEnv" ]
8f484e520892bf9eb59f91b4b5c92df9fbd9a4e6
https://github.com/pnegahdar/inenv/blob/8f484e520892bf9eb59f91b4b5c92df9fbd9a4e6/inenv/inenv.py#L164-L181
train
Installs all the dependencies of the current virtualenv.
bitesofcode/projexui
projexui/widgets/xenumbox.py
XEnumBox.currentValue
def currentValue(self): """ Returns the current value for the widget. If this widget is checkable then the bitor value for all checked items is returned, otherwise, the selected value is returned. :return <int> """ enum = self.enum() ...
python
def currentValue(self): """ Returns the current value for the widget. If this widget is checkable then the bitor value for all checked items is returned, otherwise, the selected value is returned. :return <int> """ enum = self.enum() ...
[ "def", "currentValue", "(", "self", ")", ":", "enum", "=", "self", ".", "enum", "(", ")", "if", "(", "self", ".", "isCheckable", "(", ")", ")", ":", "value", "=", "0", "for", "i", "in", "self", ".", "checkedIndexes", "(", ")", ":", "value", "|=",...
Returns the current value for the widget. If this widget is checkable then the bitor value for all checked items is returned, otherwise, the selected value is returned. :return <int>
[ "Returns", "the", "current", "value", "for", "the", "widget", ".", "If", "this", "widget", "is", "checkable", "then", "the", "bitor", "value", "for", "all", "checked", "items", "is", "returned", "otherwise", "the", "selected", "value", "is", "returned", ".",...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xenumbox.py#L80-L98
train
Returns the current value for the current item in the list.
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
Reloads the contents of the object.
bitesofcode/projexui
projexui/widgets/xenumbox.py
XEnumBox.setCurrentValue
def setCurrentValue(self, value): """ Sets the value for the combobox to the inputed value. If the combobox is in a checkable state, then the values will be checked, otherwise, the value will be selected. :param value | <int> """ enum = sel...
python
def setCurrentValue(self, value): """ Sets the value for the combobox to the inputed value. If the combobox is in a checkable state, then the values will be checked, otherwise, the value will be selected. :param value | <int> """ enum = sel...
[ "def", "setCurrentValue", "(", "self", ",", "value", ")", ":", "enum", "=", "self", ".", "enum", "(", ")", "if", "not", "enum", ":", "return", "if", "self", ".", "isCheckable", "(", ")", ":", "indexes", "=", "[", "]", "for", "i", "in", "range", "...
Sets the value for the combobox to the inputed value. If the combobox is in a checkable state, then the values will be checked, otherwise, the value will be selected. :param value | <int>
[ "Sets", "the", "value", "for", "the", "combobox", "to", "the", "inputed", "value", ".", "If", "the", "combobox", "is", "in", "a", "checkable", "state", "then", "the", "values", "will", "be", "checked", "otherwise", "the", "value", "will", "be", "selected",...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xenumbox.py#L162-L191
train
Sets the value for the combobox to the inputed value.
bitesofcode/projexui
projexui/widgets/ximageslider/ximageslider.py
XImageSlider.addPixmap
def addPixmap(self, pixmap): """ Adds the pixmap to the list for this slider. :param pixmap | <QPixmap> || <str> """ scene = self.scene() scene.addItem(XImageItem(pixmap)) self.recalculate()
python
def addPixmap(self, pixmap): """ Adds the pixmap to the list for this slider. :param pixmap | <QPixmap> || <str> """ scene = self.scene() scene.addItem(XImageItem(pixmap)) self.recalculate()
[ "def", "addPixmap", "(", "self", ",", "pixmap", ")", ":", "scene", "=", "self", ".", "scene", "(", ")", "scene", ".", "addItem", "(", "XImageItem", "(", "pixmap", ")", ")", "self", ".", "recalculate", "(", ")" ]
Adds the pixmap to the list for this slider. :param pixmap | <QPixmap> || <str>
[ "Adds", "the", "pixmap", "to", "the", "list", "for", "this", "slider", ".", ":", "param", "pixmap", "|", "<QPixmap", ">", "||", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/ximageslider/ximageslider.py#L42-L50
train
Adds the pixmap to the list for this slider.
bitesofcode/projexui
projexui/widgets/ximageslider/ximageslider.py
XImageSlider.calculateSceneWidth
def calculateSceneWidth(self): """ Returns the total width for all the pixmaps for this widget. :return <int> """ widths = [] w = self.width() / 2.0 h = self.height() / 2.0 for item in self.scene().items(): ...
python
def calculateSceneWidth(self): """ Returns the total width for all the pixmaps for this widget. :return <int> """ widths = [] w = self.width() / 2.0 h = self.height() / 2.0 for item in self.scene().items(): ...
[ "def", "calculateSceneWidth", "(", "self", ")", ":", "widths", "=", "[", "]", "w", "=", "self", ".", "width", "(", ")", "/", "2.0", "h", "=", "self", ".", "height", "(", ")", "/", "2.0", "for", "item", "in", "self", ".", "scene", "(", ")", ".",...
Returns the total width for all the pixmaps for this widget. :return <int>
[ "Returns", "the", "total", "width", "for", "all", "the", "pixmaps", "for", "this", "widget", ".", ":", "return", "<int", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/ximageslider/ximageslider.py#L52-L69
train
Calculates the total width for all the pixmaps for this widget and returns the total width for all the pixmaps for all the items in the scene.
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", ")", ":", "# recalculate the scene geometry\r", "scene", "=", "self", ".", "scene", "(", ")", "w", "=", "self", ".", "calculateSceneWidth", "(", ")", "scene", ".", "setSceneRect", "(", "0", ",", "0", ",", "w", ",", "sel...
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
Recalculates the slider scene for this widget and the items for this widget.
bitesofcode/projexui
projexui/widgets/ximageslider/ximageslider.py
XImageSlider.removePixmap
def removePixmap(self, pixmap): """ Removes the pixmap from this widgets list of pixmaps. :param pixmap | <QPixmap> """ scene = self.scene() for item in self.items(): if item.basePixmap() == pixmap: scene.removeItem(item)...
python
def removePixmap(self, pixmap): """ Removes the pixmap from this widgets list of pixmaps. :param pixmap | <QPixmap> """ scene = self.scene() for item in self.items(): if item.basePixmap() == pixmap: scene.removeItem(item)...
[ "def", "removePixmap", "(", "self", ",", "pixmap", ")", ":", "scene", "=", "self", ".", "scene", "(", ")", "for", "item", "in", "self", ".", "items", "(", ")", ":", "if", "item", ".", "basePixmap", "(", ")", "==", "pixmap", ":", "scene", ".", "re...
Removes the pixmap from this widgets list of pixmaps. :param pixmap | <QPixmap>
[ "Removes", "the", "pixmap", "from", "this", "widgets", "list", "of", "pixmaps", ".", ":", "param", "pixmap", "|", "<QPixmap", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/ximageslider/ximageslider.py#L124-L134
train
Removes the pixmap from this widgets list of pixmaps.
bitesofcode/projexui
projexui/widgets/ximageslider/ximageslider.py
XImageSlider.resizeEvent
def resizeEvent(self, event): """ Hooks into the resize event for the slider widget to update the scene with the latest witdth. :param event | <QResizeEvent> """ super(XImageSlider, self).resizeEvent(event) self.recalculate()
python
def resizeEvent(self, event): """ Hooks into the resize event for the slider widget to update the scene with the latest witdth. :param event | <QResizeEvent> """ super(XImageSlider, self).resizeEvent(event) self.recalculate()
[ "def", "resizeEvent", "(", "self", ",", "event", ")", ":", "super", "(", "XImageSlider", ",", "self", ")", ".", "resizeEvent", "(", "event", ")", "self", ".", "recalculate", "(", ")" ]
Hooks into the resize event for the slider widget to update the scene with the latest witdth. :param event | <QResizeEvent>
[ "Hooks", "into", "the", "resize", "event", "for", "the", "slider", "widget", "to", "update", "the", "scene", "with", "the", "latest", "witdth", ".", ":", "param", "event", "|", "<QResizeEvent", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/ximageslider/ximageslider.py#L136-L145
train
Hook into the resize event for the slider widget.
bitesofcode/projexui
projexui/widgets/ximageslider/ximageslider.py
XImageSlider.setPixmaps
def setPixmaps(self, pixmaps): """ Sets the pixmaps for this widget to the inputed list of images. :param pixmaps | [<QPixmap>, ..] """ self.clear() scene = self.scene() for pmap in pixmaps: scene.addItem(XImageItem(pma...
python
def setPixmaps(self, pixmaps): """ Sets the pixmaps for this widget to the inputed list of images. :param pixmaps | [<QPixmap>, ..] """ self.clear() scene = self.scene() for pmap in pixmaps: scene.addItem(XImageItem(pma...
[ "def", "setPixmaps", "(", "self", ",", "pixmaps", ")", ":", "self", ".", "clear", "(", ")", "scene", "=", "self", ".", "scene", "(", ")", "for", "pmap", "in", "pixmaps", ":", "scene", ".", "addItem", "(", "XImageItem", "(", "pmap", ")", ")", "self"...
Sets the pixmaps for this widget to the inputed list of images. :param pixmaps | [<QPixmap>, ..]
[ "Sets", "the", "pixmaps", "for", "this", "widget", "to", "the", "inputed", "list", "of", "images", ".", ":", "param", "pixmaps", "|", "[", "<QPixmap", ">", "..", "]" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/ximageslider/ximageslider.py#L147-L159
train
Sets the pixmaps for this widget to the inputed list of images.
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
Check if token is expired and set auth header.
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
get refreshed location information.
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
Creates a new token with a given specification.
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
Destroys a given token.
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
Queries the policy of a given token.
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
Creates a new token by cloning an existing token
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
Lists all the active tokens
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
Checks the status of an ACL replication process in a datacenter.
mikhaildubov/AST-text-analysis
east/asts/utils.py
match_strings
def match_strings(str1, str2): """ Returns the largest index i such that str1[:i] == str2[:i] """ i = 0 min_len = len(str1) if len(str1) < len(str2) else len(str2) while i < min_len and str1[i] == str2[i]: i += 1 return i
python
def match_strings(str1, str2): """ Returns the largest index i such that str1[:i] == str2[:i] """ i = 0 min_len = len(str1) if len(str1) < len(str2) else len(str2) while i < min_len and str1[i] == str2[i]: i += 1 return i
[ "def", "match_strings", "(", "str1", ",", "str2", ")", ":", "i", "=", "0", "min_len", "=", "len", "(", "str1", ")", "if", "len", "(", "str1", ")", "<", "len", "(", "str2", ")", "else", "len", "(", "str2", ")", "while", "i", "<", "min_len", "and...
Returns the largest index i such that str1[:i] == str2[:i]
[ "Returns", "the", "largest", "index", "i", "such", "that", "str1", "[", ":", "i", "]", "==", "str2", "[", ":", "i", "]" ]
055ad8d2492c100bbbaa25309ec1074bdf1dfaa5
https://github.com/mikhaildubov/AST-text-analysis/blob/055ad8d2492c100bbbaa25309ec1074bdf1dfaa5/east/asts/utils.py#L14-L22
train
Returns the index of the first occurrence of str1 in str2.
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", ")", ")", ":", "# NOTE(msdubov): a trick to handle 'narrow' python installation issues.", "hex_code", "=", "hex",...
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
Make each string in the collection end with a unique character.
bitesofcode/projexui
projexui/widgets/xchart/axes/xdatetimeaxis.py
XDatetimeAxis.calculateValues
def calculateValues(self): """ Overloads the calculate values method to calculate the values for this axis based on the minimum and maximum values, and the number of steps desired. :return [<variant>, ..] """ if self.maximum() <= self.minimum(...
python
def calculateValues(self): """ Overloads the calculate values method to calculate the values for this axis based on the minimum and maximum values, and the number of steps desired. :return [<variant>, ..] """ if self.maximum() <= self.minimum(...
[ "def", "calculateValues", "(", "self", ")", ":", "if", "self", ".", "maximum", "(", ")", "<=", "self", ".", "minimum", "(", ")", ":", "return", "[", "]", "max_labels", "=", "self", ".", "maximumLabelCount", "(", ")", "seconds", "=", "(", "self", ".",...
Overloads the calculate values method to calculate the values for this axis based on the minimum and maximum values, and the number of steps desired. :return [<variant>, ..]
[ "Overloads", "the", "calculate", "values", "method", "to", "calculate", "the", "values", "for", "this", "axis", "based", "on", "the", "minimum", "and", "maximum", "values", "and", "the", "number", "of", "steps", "desired", ".", ":", "return", "[", "<variant"...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/axes/xdatetimeaxis.py#L36-L57
train
Returns a list of values for the maximum and minimum values for the current axis.
bitesofcode/projexui
projexui/widgets/xchart/axes/xdatetimeaxis.py
XDatetimeAxis.percentAt
def percentAt(self, value): """ Returns the percentage the value represents between the minimum and maximum for this axis. :param value | <int> || <float> :return <float> """ min_val = self.minimum() max_val = self.maxi...
python
def percentAt(self, value): """ Returns the percentage the value represents between the minimum and maximum for this axis. :param value | <int> || <float> :return <float> """ min_val = self.minimum() max_val = self.maxi...
[ "def", "percentAt", "(", "self", ",", "value", ")", ":", "min_val", "=", "self", ".", "minimum", "(", ")", "max_val", "=", "self", ".", "maximum", "(", ")", "# round the max value to sync with the values in the grid\r", "total_seconds", "=", "(", "max_val", "-",...
Returns the percentage the value represents between the minimum and maximum for this axis. :param value | <int> || <float> :return <float>
[ "Returns", "the", "percentage", "the", "value", "represents", "between", "the", "minimum", "and", "maximum", "for", "this", "axis", ".", ":", "param", "value", "|", "<int", ">", "||", "<float", ">", ":", "return", "<float", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/axes/xdatetimeaxis.py#L59-L85
train
Returns the percentage of value represents between the minimum and maximum for this axis.
bitesofcode/projexui
projexui/widgets/xchart/axes/xdatetimeaxis.py
XDatetimeAxis.sum
def sum(self, values): """ Calculates the total values for the inputed values. :return <int> """ values = sorted(values) try: return (values[-1] - values[0]).total_seconds() except IndexError, TypeError: return 0
python
def sum(self, values): """ Calculates the total values for the inputed values. :return <int> """ values = sorted(values) try: return (values[-1] - values[0]).total_seconds() except IndexError, TypeError: return 0
[ "def", "sum", "(", "self", ",", "values", ")", ":", "values", "=", "sorted", "(", "values", ")", "try", ":", "return", "(", "values", "[", "-", "1", "]", "-", "values", "[", "0", "]", ")", ".", "total_seconds", "(", ")", "except", "IndexError", "...
Calculates the total values for the inputed values. :return <int>
[ "Calculates", "the", "total", "values", "for", "the", "inputed", "values", ".", ":", "return", "<int", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/axes/xdatetimeaxis.py#L87-L97
train
Calculates the total amount of time for the given list of time items.
bitesofcode/projexui
projexui/widgets/xchart/axes/xdatetimeaxis.py
XDatetimeAxis.valueAt
def valueAt(self, percent): """ Returns the value the percent represents between the minimum and maximum for this axis. :param value | <int> || <float> :return <float> """ min_val = self.minimum() max_val = self.maximum...
python
def valueAt(self, percent): """ Returns the value the percent represents between the minimum and maximum for this axis. :param value | <int> || <float> :return <float> """ min_val = self.minimum() max_val = self.maximum...
[ "def", "valueAt", "(", "self", ",", "percent", ")", ":", "min_val", "=", "self", ".", "minimum", "(", ")", "max_val", "=", "self", ".", "maximum", "(", ")", "if", "percent", "<", "0", ":", "return", "min_val", "elif", "1", "<", "percent", ":", "ret...
Returns the value the percent represents between the minimum and maximum for this axis. :param value | <int> || <float> :return <float>
[ "Returns", "the", "value", "the", "percent", "represents", "between", "the", "minimum", "and", "maximum", "for", "this", "axis", ".", ":", "param", "value", "|", "<int", ">", "||", "<float", ">", ":", "return", "<float", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/axes/xdatetimeaxis.py#L99-L120
train
Returns the value at the given percent representing the minimum and maximum for this axis.
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
Queries for WAN network coordinates of Consul servers organized by DCs.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListWidgetItem._updateFrame
def _updateFrame(self): """ Updates the frame for the given sender. """ mov = self.movie() if mov: self.setIcon(QtGui.QIcon(mov.currentPixmap()))
python
def _updateFrame(self): """ Updates the frame for the given sender. """ mov = self.movie() if mov: self.setIcon(QtGui.QIcon(mov.currentPixmap()))
[ "def", "_updateFrame", "(", "self", ")", ":", "mov", "=", "self", ".", "movie", "(", ")", "if", "mov", ":", "self", ".", "setIcon", "(", "QtGui", ".", "QIcon", "(", "mov", ".", "currentPixmap", "(", ")", ")", ")" ]
Updates the frame for the given sender.
[ "Updates", "the", "frame", "for", "the", "given", "sender", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L43-L49
train
Updates the frame for the given sender.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListWidgetItem.filterData
def filterData(self, key): """ Returns the filter data for the given key. :param key | <str> :return <str> """ if key == 'text': default = nativestring(self.text()) else: default = '' return self._filt...
python
def filterData(self, key): """ Returns the filter data for the given key. :param key | <str> :return <str> """ if key == 'text': default = nativestring(self.text()) else: default = '' return self._filt...
[ "def", "filterData", "(", "self", ",", "key", ")", ":", "if", "key", "==", "'text'", ":", "default", "=", "nativestring", "(", "self", ".", "text", "(", ")", ")", "else", ":", "default", "=", "''", "return", "self", ".", "_filterData", ".", "get", ...
Returns the filter data for the given key. :param key | <str> :return <str>
[ "Returns", "the", "filter", "data", "for", "the", "given", "key", ".", ":", "param", "key", "|", "<str", ">", ":", "return", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L56-L68
train
Returns the filter data for the given key.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListWidgetItem.setFilterData
def setFilterData(self, key, value): """ Sets the filtering information for the given key to the inputed value. :param key | <str> value | <str> """ self._filterData[nativestring(key)] = nativestring(value)
python
def setFilterData(self, key, value): """ Sets the filtering information for the given key to the inputed value. :param key | <str> value | <str> """ self._filterData[nativestring(key)] = nativestring(value)
[ "def", "setFilterData", "(", "self", ",", "key", ",", "value", ")", ":", "self", ".", "_filterData", "[", "nativestring", "(", "key", ")", "]", "=", "nativestring", "(", "value", ")" ]
Sets the filtering information for the given key to the inputed value. :param key | <str> value | <str>
[ "Sets", "the", "filtering", "information", "for", "the", "given", "key", "to", "the", "inputed", "value", ".", ":", "param", "key", "|", "<str", ">", "value", "|", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L78-L85
train
Sets the filtering information for the given key to the inputed value.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListWidgetItem.setMovie
def setMovie(self, movie): """ Sets the movie that will play for the given column. :param movie | <QtGui.QMovie> || None """ mov = self.movie() if mov is not None: mov.frameChanged.disconnect(self._updateFrame) if movi...
python
def setMovie(self, movie): """ Sets the movie that will play for the given column. :param movie | <QtGui.QMovie> || None """ mov = self.movie() if mov is not None: mov.frameChanged.disconnect(self._updateFrame) if movi...
[ "def", "setMovie", "(", "self", ",", "movie", ")", ":", "mov", "=", "self", ".", "movie", "(", ")", "if", "mov", "is", "not", "None", ":", "mov", ".", "frameChanged", ".", "disconnect", "(", "self", ".", "_updateFrame", ")", "if", "movie", "is", "n...
Sets the movie that will play for the given column. :param movie | <QtGui.QMovie> || None
[ "Sets", "the", "movie", "that", "will", "play", "for", "the", "given", "column", ".", ":", "param", "movie", "|", "<QtGui", ".", "QMovie", ">", "||", "None" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L87-L106
train
Sets the movie that will play for the given column.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListGroupItem.children
def children(self): """ Returns the children in this group. :return [<QtGui.QListWidgetItem>, ..] """ new_refs = set() output = [] for ref in self._children: item = ref() if item is not None: output.a...
python
def children(self): """ Returns the children in this group. :return [<QtGui.QListWidgetItem>, ..] """ new_refs = set() output = [] for ref in self._children: item = ref() if item is not None: output.a...
[ "def", "children", "(", "self", ")", ":", "new_refs", "=", "set", "(", ")", "output", "=", "[", "]", "for", "ref", "in", "self", ".", "_children", ":", "item", "=", "ref", "(", ")", "if", "item", "is", "not", "None", ":", "output", ".", "append",...
Returns the children in this group. :return [<QtGui.QListWidgetItem>, ..]
[ "Returns", "the", "children", "in", "this", "group", ".", ":", "return", "[", "<QtGui", ".", "QListWidgetItem", ">", "..", "]" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L148-L163
train
Returns the children of this group.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListGroupItem.foreground
def foreground(self): """ Returns the foreground color for this group item. :return <QtGui.QColor> """ widget = self.widget() if widget: palette = widget.palette() return palette.color(palette.WindowText) else: ...
python
def foreground(self): """ Returns the foreground color for this group item. :return <QtGui.QColor> """ widget = self.widget() if widget: palette = widget.palette() return palette.color(palette.WindowText) else: ...
[ "def", "foreground", "(", "self", ")", ":", "widget", "=", "self", ".", "widget", "(", ")", "if", "widget", ":", "palette", "=", "widget", ".", "palette", "(", ")", "return", "palette", ".", "color", "(", "palette", ".", "WindowText", ")", "else", ":...
Returns the foreground color for this group item. :return <QtGui.QColor>
[ "Returns", "the", "foreground", "color", "for", "this", "group", "item", ".", ":", "return", "<QtGui", ".", "QColor", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L174-L185
train
Returns the foreground color for this group item.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListGroupItem.setExpanded
def setExpanded(self, state): """ Expands this group item to the inputed state. :param state | <bool> """ if state == self._expanded: return self._expanded = state # update the button btn = self.widge...
python
def setExpanded(self, state): """ Expands this group item to the inputed state. :param state | <bool> """ if state == self._expanded: return self._expanded = state # update the button btn = self.widge...
[ "def", "setExpanded", "(", "self", ",", "state", ")", ":", "if", "state", "==", "self", ".", "_expanded", ":", "return", "self", ".", "_expanded", "=", "state", "# update the button\r", "btn", "=", "self", ".", "widget", "(", ")", "if", "btn", ":", "if...
Expands this group item to the inputed state. :param state | <bool>
[ "Expands", "this", "group", "item", "to", "the", "inputed", "state", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L187-L209
train
Updates the expanded state of the group item.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListGroupItem.setHidden
def setHidden(self, state): """ Marks this item as hidden based on the state. This will affect all its children as well. :param state | <bool> """ super(XListGroupItem, self).setHidden(state) for child in self.children(): ...
python
def setHidden(self, state): """ Marks this item as hidden based on the state. This will affect all its children as well. :param state | <bool> """ super(XListGroupItem, self).setHidden(state) for child in self.children(): ...
[ "def", "setHidden", "(", "self", ",", "state", ")", ":", "super", "(", "XListGroupItem", ",", "self", ")", ".", "setHidden", "(", "state", ")", "for", "child", "in", "self", ".", "children", "(", ")", ":", "child", ".", "setHidden", "(", "state", "or...
Marks this item as hidden based on the state. This will affect all its children as well. :param state | <bool>
[ "Marks", "this", "item", "as", "hidden", "based", "on", "the", "state", ".", "This", "will", "affect", "all", "its", "children", "as", "well", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L211-L221
train
Sets the hidden state of this item.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListGroupItem.setForeground
def setForeground(self, color): """ Sets the foreground color for this group item to the inputed color. :param color | <QtGui.QColor> """ btn = self.widget() if btn: palette = btn.palette() palette.setColor(palette.WindowText...
python
def setForeground(self, color): """ Sets the foreground color for this group item to the inputed color. :param color | <QtGui.QColor> """ btn = self.widget() if btn: palette = btn.palette() palette.setColor(palette.WindowText...
[ "def", "setForeground", "(", "self", ",", "color", ")", ":", "btn", "=", "self", ".", "widget", "(", ")", "if", "btn", ":", "palette", "=", "btn", ".", "palette", "(", ")", "palette", ".", "setColor", "(", "palette", ".", "WindowText", ",", "color", ...
Sets the foreground color for this group item to the inputed color. :param color | <QtGui.QColor>
[ "Sets", "the", "foreground", "color", "for", "this", "group", "item", "to", "the", "inputed", "color", ".", ":", "param", "color", "|", "<QtGui", ".", "QColor", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L223-L233
train
Sets the foreground color for this group item.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListGroupItem.setText
def setText(self, text): """ Sets the text for this item. :param text | <str> """ self._text = text # update the label btn = self.widget() if btn: btn.setText(text)
python
def setText(self, text): """ Sets the text for this item. :param text | <str> """ self._text = text # update the label btn = self.widget() if btn: btn.setText(text)
[ "def", "setText", "(", "self", ",", "text", ")", ":", "self", ".", "_text", "=", "text", "# update the label\r", "btn", "=", "self", ".", "widget", "(", ")", "if", "btn", ":", "btn", ".", "setText", "(", "text", ")" ]
Sets the text for this item. :param text | <str>
[ "Sets", "the", "text", "for", "this", "item", ".", ":", "param", "text", "|", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L235-L246
train
Sets the text for this item.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListWidget.__filterItems
def __filterItems(self, terms, caseSensitive=False): """ Filters the items in this tree based on the inputed keywords. :param terms | {<str> dataType: [<str> term, ..], ..} caseSensitive | <bool> ...
python
def __filterItems(self, terms, caseSensitive=False): """ Filters the items in this tree based on the inputed keywords. :param terms | {<str> dataType: [<str> term, ..], ..} caseSensitive | <bool> ...
[ "def", "__filterItems", "(", "self", ",", "terms", ",", "caseSensitive", "=", "False", ")", ":", "found", "=", "False", "items", "=", "[", "]", "# collect the items to process", "for", "i", "in", "range", "(", "self", ".", "count", "(", ")", ")", ":", ...
Filters the items in this tree based on the inputed keywords. :param terms | {<str> dataType: [<str> term, ..], ..} caseSensitive | <bool> :return <bool> | found
[ "Filters", "the", "items", "in", "this", "tree", "based", "on", "the", "inputed", "keywords", ".", ":", "param", "terms", "|", "{", "<str", ">", "dataType", ":", "[", "<str", ">", "term", "..", "]", "..", "}", "caseSensitive", "|", "<bool", ">", ":",...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L293-L387
train
Filters the items in this tree based on the inputed keywords.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListWidget.filterItems
def filterItems(self, terms, caseSensitive=False): """ Filters the items in this tree based on the inputed text. :param terms | <str> || {<str> datatype: [<str> opt, ..]} caseSensitive | <bool> """ ...
python
def filterItems(self, terms, caseSensitive=False): """ Filters the items in this tree based on the inputed text. :param terms | <str> || {<str> datatype: [<str> opt, ..]} caseSensitive | <bool> """ ...
[ "def", "filterItems", "(", "self", ",", "terms", ",", "caseSensitive", "=", "False", ")", ":", "# create a dictionary of options", "if", "type", "(", "terms", ")", "!=", "dict", ":", "terms", "=", "{", "'*'", ":", "nativestring", "(", "terms", ")", "}", ...
Filters the items in this tree based on the inputed text. :param terms | <str> || {<str> datatype: [<str> opt, ..]} caseSensitive | <bool>
[ "Filters", "the", "items", "in", "this", "tree", "based", "on", "the", "inputed", "text", ".", ":", "param", "terms", "|", "<str", ">", "||", "{", "<str", ">", "datatype", ":", "[", "<str", ">", "opt", "..", "]", "}", "caseSensitive", "|", "<bool", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L414-L462
train
Filter the items in this tree based on the inputed text.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListWidget.paintEvent
def paintEvent(self, event): """ Overloads the paint event to support rendering of hints if there are no items in the tree. :param event | <QPaintEvent> """ super(XListWidget, self).paintEvent(event) if not self.visibleCount() and s...
python
def paintEvent(self, event): """ Overloads the paint event to support rendering of hints if there are no items in the tree. :param event | <QPaintEvent> """ super(XListWidget, self).paintEvent(event) if not self.visibleCount() and s...
[ "def", "paintEvent", "(", "self", ",", "event", ")", ":", "super", "(", "XListWidget", ",", "self", ")", ".", "paintEvent", "(", "event", ")", "if", "not", "self", ".", "visibleCount", "(", ")", "and", "self", ".", "hint", "(", ")", ":", "text", "=...
Overloads the paint event to support rendering of hints if there are no items in the tree. :param event | <QPaintEvent>
[ "Overloads", "the", "paint", "event", "to", "support", "rendering", "of", "hints", "if", "there", "are", "no", "items", "in", "the", "tree", ".", ":", "param", "event", "|", "<QPaintEvent", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L488-L518
train
Overloads the paint event to support rendering of hints if there are no items in the tree.
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
Resizes the list widget to fit its contents vertically.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListWidget.setAutoResizeToContents
def setAutoResizeToContents(self, state): """ Sets whether or not this widget should automatically resize its height based on its contents. :param state | <bool> """ self._autoResizeToContents = state if state: self.res...
python
def setAutoResizeToContents(self, state): """ Sets whether or not this widget should automatically resize its height based on its contents. :param state | <bool> """ self._autoResizeToContents = state if state: self.res...
[ "def", "setAutoResizeToContents", "(", "self", ",", "state", ")", ":", "self", ".", "_autoResizeToContents", "=", "state", "if", "state", ":", "self", ".", "resizeToContents", "(", ")", "self", ".", "setVerticalScrollBarPolicy", "(", "QtCore", ".", "Qt", ".", ...
Sets whether or not this widget should automatically resize its height based on its contents. :param state | <bool>
[ "Sets", "whether", "or", "not", "this", "widget", "should", "automatically", "resize", "its", "height", "based", "on", "its", "contents", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L548-L563
train
Sets whether or not this widget should automatically resize its height based on its contents.
bitesofcode/projexui
projexui/widgets/xlistwidget.py
XListWidget.visibleCount
def visibleCount(self): """ Returns the number of visible items in this list. :return <int> """ return sum(int(not self.item(i).isHidden()) for i in range(self.count()))
python
def visibleCount(self): """ Returns the number of visible items in this list. :return <int> """ return sum(int(not self.item(i).isHidden()) for i in range(self.count()))
[ "def", "visibleCount", "(", "self", ")", ":", "return", "sum", "(", "int", "(", "not", "self", ".", "item", "(", "i", ")", ".", "isHidden", "(", ")", ")", "for", "i", "in", "range", "(", "self", ".", "count", "(", ")", ")", ")" ]
Returns the number of visible items in this list. :return <int>
[ "Returns", "the", "number", "of", "visible", "items", "in", "this", "list", ".", ":", "return", "<int", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlistwidget.py#L598-L604
train
Returns the number of items in this list that are not hidden.
bitesofcode/projexui
projexui/dialogs/xinputdialog.py
XInputDialog.getPlainText
def getPlainText( parent, title, caption, text = '' ): """ Prompts the user for more advanced text input. :param parent | <QWidget> || None title | <str> caption | <str> text | <str> :return (<st...
python
def getPlainText( parent, title, caption, text = '' ): """ Prompts the user for more advanced text input. :param parent | <QWidget> || None title | <str> caption | <str> text | <str> :return (<st...
[ "def", "getPlainText", "(", "parent", ",", "title", ",", "caption", ",", "text", "=", "''", ")", ":", "dlg", "=", "QDialog", "(", "parent", ")", "dlg", ".", "setWindowTitle", "(", "title", ")", "label", "=", "QLabel", "(", "dlg", ")", "label", ".", ...
Prompts the user for more advanced text input. :param parent | <QWidget> || None title | <str> caption | <str> text | <str> :return (<str>, <bool> accepted)
[ "Prompts", "the", "user", "for", "more", "advanced", "text", "input", ".", ":", "param", "parent", "|", "<QWidget", ">", "||", "None", "title", "|", "<str", ">", "caption", "|", "<str", ">", "text", "|", "<str", ">", ":", "return", "(", "<str", ">", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xinputdialog.py#L31-L68
train
Prompts the user for more advanced text input.
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
parse openvpn status log
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
update status db
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
update radius accounting
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
Main function for the daemon.