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/dialogs/xmessagebox.py | XMessageBox.timerEvent | def timerEvent( self, event ):
"""
Updates the min and max sizes to allow this message box to be resizable.
:param event | <QTimerEvent>
"""
self.killTimer(event.timerId())
self.setMaximumWidth(10000)
self.setMaximumHeight(10000) | python | def timerEvent( self, event ):
"""
Updates the min and max sizes to allow this message box to be resizable.
:param event | <QTimerEvent>
"""
self.killTimer(event.timerId())
self.setMaximumWidth(10000)
self.setMaximumHeight(10000) | [
"def",
"timerEvent",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"killTimer",
"(",
"event",
".",
"timerId",
"(",
")",
")",
"self",
".",
"setMaximumWidth",
"(",
"10000",
")",
"self",
".",
"setMaximumHeight",
"(",
"10000",
")"
] | Updates the min and max sizes to allow this message box to be resizable.
:param event | <QTimerEvent> | [
"Updates",
"the",
"min",
"and",
"max",
"sizes",
"to",
"allow",
"this",
"message",
"box",
"to",
"be",
"resizable",
".",
":",
"param",
"event",
"|",
"<QTimerEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xmessagebox.py#L69-L78 | train | Updates the min and max sizes for this message box. |
bitesofcode/projexui | projexui/dialogs/xmessagebox.py | XMessageBox.detailedInformation | def detailedInformation( cls, parent, title, info, details, buttons = None ):
"""
Creates a new information dialog with detailed information and \
presents it to the user.
:param parent | <QWidget>
title | <str>
info | <str>
... | python | def detailedInformation( cls, parent, title, info, details, buttons = None ):
"""
Creates a new information dialog with detailed information and \
presents it to the user.
:param parent | <QWidget>
title | <str>
info | <str>
... | [
"def",
"detailedInformation",
"(",
"cls",
",",
"parent",
",",
"title",
",",
"info",
",",
"details",
",",
"buttons",
"=",
"None",
")",
":",
"if",
"(",
"buttons",
"==",
"None",
")",
":",
"buttons",
"=",
"XMessageBox",
".",
"Ok",
"dlg",
"=",
"cls",
"(",... | Creates a new information dialog with detailed information and \
presents it to the user.
:param parent | <QWidget>
title | <str>
info | <str>
details | <str>
buttons | <QMessageBox.StandardButton>
... | [
"Creates",
"a",
"new",
"information",
"dialog",
"with",
"detailed",
"information",
"and",
"\\",
"presents",
"it",
"to",
"the",
"user",
".",
":",
"param",
"parent",
"|",
"<QWidget",
">",
"title",
"|",
"<str",
">",
"info",
"|",
"<str",
">",
"details",
"|",... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xmessagebox.py#L81-L104 | train | Create a detailed information dialog with the given title info and details and buttons. |
xflr6/fileconfig | fileconfig/bases.py | Config.names | def names(self):
"""Names, by which the instance can be retrieved."""
if getattr(self, 'key', None) is None:
result = []
else:
result = [self.key]
if hasattr(self, 'aliases'):
result.extend(self.aliases)
return result | python | def names(self):
"""Names, by which the instance can be retrieved."""
if getattr(self, 'key', None) is None:
result = []
else:
result = [self.key]
if hasattr(self, 'aliases'):
result.extend(self.aliases)
return result | [
"def",
"names",
"(",
"self",
")",
":",
"if",
"getattr",
"(",
"self",
",",
"'key'",
",",
"None",
")",
"is",
"None",
":",
"result",
"=",
"[",
"]",
"else",
":",
"result",
"=",
"[",
"self",
".",
"key",
"]",
"if",
"hasattr",
"(",
"self",
",",
"'alia... | Names, by which the instance can be retrieved. | [
"Names",
"by",
"which",
"the",
"instance",
"can",
"be",
"retrieved",
"."
] | 473d65f6442eb1ac49ada0b6e56cab45f8018c15 | https://github.com/xflr6/fileconfig/blob/473d65f6442eb1ac49ada0b6e56cab45f8018c15/fileconfig/bases.py#L27-L35 | train | Names of the instance. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughscene.py | XWalkthroughScene.addGraphic | def addGraphic(self, typ='basic'):
"""
Adds a new graphic to the scene.
:param typ | <str>
:return <XWalkthroughGraphic> || None
"""
cls = XWalkthroughGraphic.find(typ)
if not cls:
return None
graphic = c... | python | def addGraphic(self, typ='basic'):
"""
Adds a new graphic to the scene.
:param typ | <str>
:return <XWalkthroughGraphic> || None
"""
cls = XWalkthroughGraphic.find(typ)
if not cls:
return None
graphic = c... | [
"def",
"addGraphic",
"(",
"self",
",",
"typ",
"=",
"'basic'",
")",
":",
"cls",
"=",
"XWalkthroughGraphic",
".",
"find",
"(",
"typ",
")",
"if",
"not",
"cls",
":",
"return",
"None",
"graphic",
"=",
"cls",
"(",
")",
"self",
".",
"addItem",
"(",
"graphic... | Adds a new graphic to the scene.
:param typ | <str>
:return <XWalkthroughGraphic> || None | [
"Adds",
"a",
"new",
"graphic",
"to",
"the",
"scene",
".",
":",
"param",
"typ",
"|",
"<str",
">",
":",
"return",
"<XWalkthroughGraphic",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughscene.py#L29-L44 | train | Adds a new graphic to the scene. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughscene.py | XWalkthroughScene.autoLayout | def autoLayout(self, size=None):
"""
Updates the layout for the graphics within this scene.
"""
if size is None:
size = self._view.size()
self.setSceneRect(0, 0, size.width(), size.height())
for item in self.items():
if isinstance... | python | def autoLayout(self, size=None):
"""
Updates the layout for the graphics within this scene.
"""
if size is None:
size = self._view.size()
self.setSceneRect(0, 0, size.width(), size.height())
for item in self.items():
if isinstance... | [
"def",
"autoLayout",
"(",
"self",
",",
"size",
"=",
"None",
")",
":",
"if",
"size",
"is",
"None",
":",
"size",
"=",
"self",
".",
"_view",
".",
"size",
"(",
")",
"self",
".",
"setSceneRect",
"(",
"0",
",",
"0",
",",
"size",
".",
"width",
"(",
")... | Updates the layout for the graphics within this scene. | [
"Updates",
"the",
"layout",
"for",
"the",
"graphics",
"within",
"this",
"scene",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughscene.py#L46-L56 | train | Updates the layout for the graphics within this scene. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughscene.py | XWalkthroughScene.findReference | def findReference(self, name, cls=QtGui.QWidget):
"""
Looks up a reference from the widget based on its object name.
:param name | <str>
cls | <subclass of QtGui.QObject>
:return <QtGui.QObject> || None
"""
ref_widg... | python | def findReference(self, name, cls=QtGui.QWidget):
"""
Looks up a reference from the widget based on its object name.
:param name | <str>
cls | <subclass of QtGui.QObject>
:return <QtGui.QObject> || None
"""
ref_widg... | [
"def",
"findReference",
"(",
"self",
",",
"name",
",",
"cls",
"=",
"QtGui",
".",
"QWidget",
")",
":",
"ref_widget",
"=",
"self",
".",
"_referenceWidget",
"if",
"not",
"ref_widget",
":",
"return",
"None",
"if",
"ref_widget",
".",
"objectName",
"(",
")",
"... | Looks up a reference from the widget based on its object name.
:param name | <str>
cls | <subclass of QtGui.QObject>
:return <QtGui.QObject> || None | [
"Looks",
"up",
"a",
"reference",
"from",
"the",
"widget",
"based",
"on",
"its",
"object",
"name",
".",
":",
"param",
"name",
"|",
"<str",
">",
"cls",
"|",
"<subclass",
"of",
"QtGui",
".",
"QObject",
">",
":",
"return",
"<QtGui",
".",
"QObject",
">",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughscene.py#L66-L81 | train | Returns the first child of the given class with the given name. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughscene.py | XWalkthroughScene.prepare | def prepare(self):
"""
Prepares the items for display.
"""
for item in self.items():
if isinstance(item, XWalkthroughGraphic):
item.prepare() | python | def prepare(self):
"""
Prepares the items for display.
"""
for item in self.items():
if isinstance(item, XWalkthroughGraphic):
item.prepare() | [
"def",
"prepare",
"(",
"self",
")",
":",
"for",
"item",
"in",
"self",
".",
"items",
"(",
")",
":",
"if",
"isinstance",
"(",
"item",
",",
"XWalkthroughGraphic",
")",
":",
"item",
".",
"prepare",
"(",
")"
] | Prepares the items for display. | [
"Prepares",
"the",
"items",
"for",
"display",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughscene.py#L83-L89 | train | Prepares the items for display. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughscene.py | XWalkthroughScene.load | def load(self, slide):
"""
Loads the inputed slide to the scene.
:param slide | <XWalkthroughSlide>
"""
self._direction = getattr(QtGui.QBoxLayout,
slide.attributes().get('direction', 'TopToBottom'),
... | python | def load(self, slide):
"""
Loads the inputed slide to the scene.
:param slide | <XWalkthroughSlide>
"""
self._direction = getattr(QtGui.QBoxLayout,
slide.attributes().get('direction', 'TopToBottom'),
... | [
"def",
"load",
"(",
"self",
",",
"slide",
")",
":",
"self",
".",
"_direction",
"=",
"getattr",
"(",
"QtGui",
".",
"QBoxLayout",
",",
"slide",
".",
"attributes",
"(",
")",
".",
"get",
"(",
"'direction'",
",",
"'TopToBottom'",
")",
",",
"QtGui",
".",
"... | Loads the inputed slide to the scene.
:param slide | <XWalkthroughSlide> | [
"Loads",
"the",
"inputed",
"slide",
"to",
"the",
"scene",
".",
":",
"param",
"slide",
"|",
"<XWalkthroughSlide",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughscene.py#L91-L104 | train | Loads the inputed slide into the scene. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py | XWalkthroughGraphic.addToGroup | def addToGroup(self, item):
"""
Adds the inputed item to this group.
:param item | <QtGui.QGraphicsItem>
"""
effect = QtGui.QGraphicsDropShadowEffect(self.scene())
effect.setColor(QtGui.QColor('black'))
effect.setOffset(0, 0)
effect.... | python | def addToGroup(self, item):
"""
Adds the inputed item to this group.
:param item | <QtGui.QGraphicsItem>
"""
effect = QtGui.QGraphicsDropShadowEffect(self.scene())
effect.setColor(QtGui.QColor('black'))
effect.setOffset(0, 0)
effect.... | [
"def",
"addToGroup",
"(",
"self",
",",
"item",
")",
":",
"effect",
"=",
"QtGui",
".",
"QGraphicsDropShadowEffect",
"(",
"self",
".",
"scene",
"(",
")",
")",
"effect",
".",
"setColor",
"(",
"QtGui",
".",
"QColor",
"(",
"'black'",
")",
")",
"effect",
"."... | Adds the inputed item to this group.
:param item | <QtGui.QGraphicsItem> | [
"Adds",
"the",
"inputed",
"item",
"to",
"this",
"group",
".",
":",
"param",
"item",
"|",
"<QtGui",
".",
"QGraphicsItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py#L54-L67 | train | Adds the inputed item to this group. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py | XWalkthroughGraphic.addPixmap | def addPixmap(self, pixmap):
"""
Adds a pixmap to this graphics item.
:param pixmap | <QtGui.QPixmap>
"""
# add the item to the group
item = QtGui.QGraphicsPixmapItem(pixmap)
self.addToGroup(item)
return item | python | def addPixmap(self, pixmap):
"""
Adds a pixmap to this graphics item.
:param pixmap | <QtGui.QPixmap>
"""
# add the item to the group
item = QtGui.QGraphicsPixmapItem(pixmap)
self.addToGroup(item)
return item | [
"def",
"addPixmap",
"(",
"self",
",",
"pixmap",
")",
":",
"# add the item to the group\r",
"item",
"=",
"QtGui",
".",
"QGraphicsPixmapItem",
"(",
"pixmap",
")",
"self",
".",
"addToGroup",
"(",
"item",
")",
"return",
"item"
] | Adds a pixmap to this graphics item.
:param pixmap | <QtGui.QPixmap> | [
"Adds",
"a",
"pixmap",
"to",
"this",
"graphics",
"item",
".",
":",
"param",
"pixmap",
"|",
"<QtGui",
".",
"QPixmap",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py#L69-L78 | train | Adds a pixmap to this graphics item and returns the newly added item. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py | XWalkthroughGraphic.addText | def addText(self, text, width=None):
"""
Adds a simple text item to this group.
:param text | <str>
maximumWidth | <float> || None
maximumHeight | <float> || None
"""
item = QtGui.QGraphicsTextItem()
... | python | def addText(self, text, width=None):
"""
Adds a simple text item to this group.
:param text | <str>
maximumWidth | <float> || None
maximumHeight | <float> || None
"""
item = QtGui.QGraphicsTextItem()
... | [
"def",
"addText",
"(",
"self",
",",
"text",
",",
"width",
"=",
"None",
")",
":",
"item",
"=",
"QtGui",
".",
"QGraphicsTextItem",
"(",
")",
"font",
"=",
"item",
".",
"font",
"(",
")",
"font",
".",
"setFamily",
"(",
"'Arial'",
")",
"font",
".",
"setP... | Adds a simple text item to this group.
:param text | <str>
maximumWidth | <float> || None
maximumHeight | <float> || None | [
"Adds",
"a",
"simple",
"text",
"item",
"to",
"this",
"group",
".",
":",
"param",
"text",
"|",
"<str",
">",
"maximumWidth",
"|",
"<float",
">",
"||",
"None",
"maximumHeight",
"|",
"<float",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py#L80-L103 | train | Adds a simple text item to this group. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py | XWalkthroughGraphic.autoLayout | def autoLayout(self, size):
"""
Lays out this widget within the graphics scene.
"""
# update the children alignment
direction = self.property('direction', QtGui.QBoxLayout.TopToBottom)
x = 0
y = 0
base_off_x = 0
base_off_y = 0
... | python | def autoLayout(self, size):
"""
Lays out this widget within the graphics scene.
"""
# update the children alignment
direction = self.property('direction', QtGui.QBoxLayout.TopToBottom)
x = 0
y = 0
base_off_x = 0
base_off_y = 0
... | [
"def",
"autoLayout",
"(",
"self",
",",
"size",
")",
":",
"# update the children alignment\r",
"direction",
"=",
"self",
".",
"property",
"(",
"'direction'",
",",
"QtGui",
".",
"QBoxLayout",
".",
"TopToBottom",
")",
"x",
"=",
"0",
"y",
"=",
"0",
"base_off_x",... | Lays out this widget within the graphics scene. | [
"Lays",
"out",
"this",
"widget",
"within",
"the",
"graphics",
"scene",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py#L105-L177 | train | Returns the new size of the current widget. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py | XWalkthroughGraphic.load | def load(self, graphic):
"""
Loads information for this item from the xml data.
:param graphic | <XWalkthroughItem>
"""
for prop in graphic.properties():
key = prop.name()
value = prop.value()
if key == 'cap... | python | def load(self, graphic):
"""
Loads information for this item from the xml data.
:param graphic | <XWalkthroughItem>
"""
for prop in graphic.properties():
key = prop.name()
value = prop.value()
if key == 'cap... | [
"def",
"load",
"(",
"self",
",",
"graphic",
")",
":",
"for",
"prop",
"in",
"graphic",
".",
"properties",
"(",
")",
":",
"key",
"=",
"prop",
".",
"name",
"(",
")",
"value",
"=",
"prop",
".",
"value",
"(",
")",
"if",
"key",
"==",
"'caption'",
":",
... | Loads information for this item from the xml data.
:param graphic | <XWalkthroughItem> | [
"Loads",
"information",
"for",
"this",
"item",
"from",
"the",
"xml",
"data",
".",
":",
"param",
"graphic",
"|",
"<XWalkthroughItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py#L179-L196 | train | Load information for this item from the xml data. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py | XWalkthroughGraphic.findReference | def findReference(self, name, cls=QtGui.QWidget):
"""
Looks up a reference from the widget based on its object name.
:param name | <str>
cls | <subclass of QtGui.QObject>
:return <QtGui.QObject> || None
"""
return s... | python | def findReference(self, name, cls=QtGui.QWidget):
"""
Looks up a reference from the widget based on its object name.
:param name | <str>
cls | <subclass of QtGui.QObject>
:return <QtGui.QObject> || None
"""
return s... | [
"def",
"findReference",
"(",
"self",
",",
"name",
",",
"cls",
"=",
"QtGui",
".",
"QWidget",
")",
":",
"return",
"self",
".",
"scene",
"(",
")",
".",
"findReference",
"(",
"name",
",",
"cls",
")"
] | Looks up a reference from the widget based on its object name.
:param name | <str>
cls | <subclass of QtGui.QObject>
:return <QtGui.QObject> || None | [
"Looks",
"up",
"a",
"reference",
"from",
"the",
"widget",
"based",
"on",
"its",
"object",
"name",
".",
":",
"param",
"name",
"|",
"<str",
">",
"cls",
"|",
"<subclass",
"of",
"QtGui",
".",
"QObject",
">",
":",
"return",
"<QtGui",
".",
"QObject",
">",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py#L198-L207 | train | Returns the first reference that matches the given name and class. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py | XWalkthroughGraphic.prepare | def prepare(self):
"""
Prepares this graphic item to be displayed.
"""
text = self.property('caption')
if text:
capw = int(self.property('caption_width', 0))
item = self.addText(text, capw) | python | def prepare(self):
"""
Prepares this graphic item to be displayed.
"""
text = self.property('caption')
if text:
capw = int(self.property('caption_width', 0))
item = self.addText(text, capw) | [
"def",
"prepare",
"(",
"self",
")",
":",
"text",
"=",
"self",
".",
"property",
"(",
"'caption'",
")",
"if",
"text",
":",
"capw",
"=",
"int",
"(",
"self",
".",
"property",
"(",
"'caption_width'",
",",
"0",
")",
")",
"item",
"=",
"self",
".",
"addTex... | Prepares this graphic item to be displayed. | [
"Prepares",
"this",
"graphic",
"item",
"to",
"be",
"displayed",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py#L209-L216 | train | Prepares this graphic item to be displayed. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py | XWalkthroughGraphic.setProperty | def setProperty(self, name, value):
"""
Sets the property for this item to the inputed value for the given name.
:param name | <str>
value | <variant>
"""
if type(value) in (unicode, str):
try:
value = self._p... | python | def setProperty(self, name, value):
"""
Sets the property for this item to the inputed value for the given name.
:param name | <str>
value | <variant>
"""
if type(value) in (unicode, str):
try:
value = self._p... | [
"def",
"setProperty",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"if",
"type",
"(",
"value",
")",
"in",
"(",
"unicode",
",",
"str",
")",
":",
"try",
":",
"value",
"=",
"self",
".",
"_parsers",
"[",
"name",
"]",
"(",
"value",
")",
"except",... | Sets the property for this item to the inputed value for the given name.
:param name | <str>
value | <variant> | [
"Sets",
"the",
"property",
"for",
"this",
"item",
"to",
"the",
"inputed",
"value",
"for",
"the",
"given",
"name",
".",
":",
"param",
"name",
"|",
"<str",
">",
"value",
"|",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py#L236-L249 | train | Sets the property for this item to the inputed value for the given name. |
bitesofcode/projexui | projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py | XWalkthroughSnapshot.prepare | def prepare(self):
"""
Prepares the information for this graphic.
"""
# determine if we already have a snapshot setup
pixmap = self.property('pixmap')
if pixmap is not None:
return super(XWalkthroughSnapshot, self).prepare()
# otherwi... | python | def prepare(self):
"""
Prepares the information for this graphic.
"""
# determine if we already have a snapshot setup
pixmap = self.property('pixmap')
if pixmap is not None:
return super(XWalkthroughSnapshot, self).prepare()
# otherwi... | [
"def",
"prepare",
"(",
"self",
")",
":",
"# determine if we already have a snapshot setup\r",
"pixmap",
"=",
"self",
".",
"property",
"(",
"'pixmap'",
")",
"if",
"pixmap",
"is",
"not",
"None",
":",
"return",
"super",
"(",
"XWalkthroughSnapshot",
",",
"self",
")"... | Prepares the information for this graphic. | [
"Prepares",
"the",
"information",
"for",
"this",
"graphic",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xwalkthroughwidget/xwalkthroughgraphics.py#L280-L342 | train | Sets the properties of this graphic to the position of the first image that is used to create the snapshot. |
bitesofcode/projexui | projexui/widgets/xtimeedit.py | XTimeEdit.setEditable | def setEditable(self, state):
"""
Sets whether or not this combo box is editable.
:param state | <bool>
"""
self._editable = state
self._hourCombo.setEditable(state)
self._minuteCombo.setEditable(state)
self._secondCombo.setEditable(state)
... | python | def setEditable(self, state):
"""
Sets whether or not this combo box is editable.
:param state | <bool>
"""
self._editable = state
self._hourCombo.setEditable(state)
self._minuteCombo.setEditable(state)
self._secondCombo.setEditable(state)
... | [
"def",
"setEditable",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_editable",
"=",
"state",
"self",
".",
"_hourCombo",
".",
"setEditable",
"(",
"state",
")",
"self",
".",
"_minuteCombo",
".",
"setEditable",
"(",
"state",
")",
"self",
".",
"_second... | Sets whether or not this combo box is editable.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"this",
"combo",
"box",
"is",
"editable",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtimeedit.py#L83-L93 | train | Sets whether or not this combo box is editable. |
bitesofcode/projexui | projexui/widgets/xtimeedit.py | XTimeEdit.setFont | def setFont(self, font):
"""
Assigns the font to this widget and all of its children.
:param font | <QtGui.QFont>
"""
super(XTimeEdit, self).setFont(font)
# update the fonts for the time combos
self._hourCombo.setFont(font)
self._minuteCom... | python | def setFont(self, font):
"""
Assigns the font to this widget and all of its children.
:param font | <QtGui.QFont>
"""
super(XTimeEdit, self).setFont(font)
# update the fonts for the time combos
self._hourCombo.setFont(font)
self._minuteCom... | [
"def",
"setFont",
"(",
"self",
",",
"font",
")",
":",
"super",
"(",
"XTimeEdit",
",",
"self",
")",
".",
"setFont",
"(",
"font",
")",
"# update the fonts for the time combos\r",
"self",
".",
"_hourCombo",
".",
"setFont",
"(",
"font",
")",
"self",
".",
"_min... | Assigns the font to this widget and all of its children.
:param font | <QtGui.QFont> | [
"Assigns",
"the",
"font",
"to",
"this",
"widget",
"and",
"all",
"of",
"its",
"children",
".",
":",
"param",
"font",
"|",
"<QtGui",
".",
"QFont",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtimeedit.py#L95-L107 | train | Sets the font for this widget and all of its children. |
bitesofcode/projexui | projexui/widgets/xtimeedit.py | XTimeEdit.setMilitaryTime | def setMilitaryTime(self, state=True):
"""
Sets whether or not this widget will be displayed in military time. When in military time, the hour options
will go from 01-24, when in normal mode, the hours will go 1-12.
:param state | <bool>
"""
time = self.ti... | python | def setMilitaryTime(self, state=True):
"""
Sets whether or not this widget will be displayed in military time. When in military time, the hour options
will go from 01-24, when in normal mode, the hours will go 1-12.
:param state | <bool>
"""
time = self.ti... | [
"def",
"setMilitaryTime",
"(",
"self",
",",
"state",
"=",
"True",
")",
":",
"time",
"=",
"self",
".",
"time",
"(",
")",
"self",
".",
"_militaryTime",
"=",
"state",
"self",
".",
"_hourCombo",
".",
"clear",
"(",
")",
"if",
"state",
":",
"self",
".",
... | Sets whether or not this widget will be displayed in military time. When in military time, the hour options
will go from 01-24, when in normal mode, the hours will go 1-12.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"this",
"widget",
"will",
"be",
"displayed",
"in",
"military",
"time",
".",
"When",
"in",
"military",
"time",
"the",
"hour",
"options",
"will",
"go",
"from",
"01",
"-",
"24",
"when",
"in",
"normal",
"mode",
"the",
"hours",... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtimeedit.py#L109-L128 | train | Sets whether or not this widget will be displayed in military time. |
bitesofcode/projexui | projexui/widgets/xtimeedit.py | XTimeEdit.setShowHours | def setShowHours(self, state=True):
"""
Sets whether or not to display the hours combo box for this widget.
:param state | <bool>
"""
self._showHours = state
if state:
self._hourSeparator.show()
self._hourCombo.show()
else:
... | python | def setShowHours(self, state=True):
"""
Sets whether or not to display the hours combo box for this widget.
:param state | <bool>
"""
self._showHours = state
if state:
self._hourSeparator.show()
self._hourCombo.show()
else:
... | [
"def",
"setShowHours",
"(",
"self",
",",
"state",
"=",
"True",
")",
":",
"self",
".",
"_showHours",
"=",
"state",
"if",
"state",
":",
"self",
".",
"_hourSeparator",
".",
"show",
"(",
")",
"self",
".",
"_hourCombo",
".",
"show",
"(",
")",
"else",
":",... | Sets whether or not to display the hours combo box for this widget.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"to",
"display",
"the",
"hours",
"combo",
"box",
"for",
"this",
"widget",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtimeedit.py#L130-L142 | train | Sets whether or not to display the hours combo box for this widget. |
bitesofcode/projexui | projexui/widgets/xtimeedit.py | XTimeEdit.setShowMinutes | def setShowMinutes(self, state=True):
"""
Sets whether or not to display the minutes combo box for this widget.
:param state | <bool>
"""
self._showMinutes = state
if state:
self._minuteCombo.show()
else:
self._minuteCombo.h... | python | def setShowMinutes(self, state=True):
"""
Sets whether or not to display the minutes combo box for this widget.
:param state | <bool>
"""
self._showMinutes = state
if state:
self._minuteCombo.show()
else:
self._minuteCombo.h... | [
"def",
"setShowMinutes",
"(",
"self",
",",
"state",
"=",
"True",
")",
":",
"self",
".",
"_showMinutes",
"=",
"state",
"if",
"state",
":",
"self",
".",
"_minuteCombo",
".",
"show",
"(",
")",
"else",
":",
"self",
".",
"_minuteCombo",
".",
"hide",
"(",
... | Sets whether or not to display the minutes combo box for this widget.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"to",
"display",
"the",
"minutes",
"combo",
"box",
"for",
"this",
"widget",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtimeedit.py#L144-L154 | train | Sets whether or not to display the minutes combo box for this widget. |
bitesofcode/projexui | projexui/widgets/xtimeedit.py | XTimeEdit.setShowSeconds | def setShowSeconds(self, state=True):
"""
Sets whether or not to display the seconds combo box for this widget.
:param state | <bool>
"""
self._showSeconds = state
if state:
self._minuteSeparator.show()
self._secondCombo.show()
... | python | def setShowSeconds(self, state=True):
"""
Sets whether or not to display the seconds combo box for this widget.
:param state | <bool>
"""
self._showSeconds = state
if state:
self._minuteSeparator.show()
self._secondCombo.show()
... | [
"def",
"setShowSeconds",
"(",
"self",
",",
"state",
"=",
"True",
")",
":",
"self",
".",
"_showSeconds",
"=",
"state",
"if",
"state",
":",
"self",
".",
"_minuteSeparator",
".",
"show",
"(",
")",
"self",
".",
"_secondCombo",
".",
"show",
"(",
")",
"else"... | Sets whether or not to display the seconds combo box for this widget.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"to",
"display",
"the",
"seconds",
"combo",
"box",
"for",
"this",
"widget",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtimeedit.py#L156-L168 | train | Sets whether or not to display the seconds combo box for this widget. |
bitesofcode/projexui | projexui/widgets/xtimeedit.py | XTimeEdit.setTime | def setTime(self, time):
"""
Sets the current time for this edit.
:param time | <QtCore.QTime>
"""
hour = time.hour()
minute = time.minute()
second = time.second()
if not self.isMilitaryTime():
if hour > 12:
ho... | python | def setTime(self, time):
"""
Sets the current time for this edit.
:param time | <QtCore.QTime>
"""
hour = time.hour()
minute = time.minute()
second = time.second()
if not self.isMilitaryTime():
if hour > 12:
ho... | [
"def",
"setTime",
"(",
"self",
",",
"time",
")",
":",
"hour",
"=",
"time",
".",
"hour",
"(",
")",
"minute",
"=",
"time",
".",
"minute",
"(",
")",
"second",
"=",
"time",
".",
"second",
"(",
")",
"if",
"not",
"self",
".",
"isMilitaryTime",
"(",
")"... | Sets the current time for this edit.
:param time | <QtCore.QTime> | [
"Sets",
"the",
"current",
"time",
"for",
"this",
"edit",
".",
":",
"param",
"time",
"|",
"<QtCore",
".",
"QTime",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtimeedit.py#L170-L194 | train | Sets the current time for this edit. |
bitesofcode/projexui | projexui/widgets/xtimeedit.py | XTimeEdit.time | def time(self):
"""
Returns the current time for this edit.
:return <QtCore.QTime>
"""
if self.isMilitaryTime():
format = 'hh:mm:ss'
time_of_day = ''
else:
format = 'hh:mm:ssap'
time_of_day = self._timeOfDayC... | python | def time(self):
"""
Returns the current time for this edit.
:return <QtCore.QTime>
"""
if self.isMilitaryTime():
format = 'hh:mm:ss'
time_of_day = ''
else:
format = 'hh:mm:ssap'
time_of_day = self._timeOfDayC... | [
"def",
"time",
"(",
"self",
")",
":",
"if",
"self",
".",
"isMilitaryTime",
"(",
")",
":",
"format",
"=",
"'hh:mm:ss'",
"time_of_day",
"=",
"''",
"else",
":",
"format",
"=",
"'hh:mm:ssap'",
"time_of_day",
"=",
"self",
".",
"_timeOfDayCombo",
".",
"currentTe... | Returns the current time for this edit.
:return <QtCore.QTime> | [
"Returns",
"the",
"current",
"time",
"for",
"this",
"edit",
".",
":",
"return",
"<QtCore",
".",
"QTime",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtimeedit.py#L220-L249 | train | Returns the current time for this edit. |
nprapps/mapturner | mapturner/__init__.py | MapTurner.get_real_layer_path | def get_real_layer_path(self, path):
"""
Get the path the actual layer file.
"""
filename = path.split('/')[-1]
local_path = path
filetype = os.path.splitext(filename)[1]
# Url
if re.match(r'^[a-zA-Z]+://', path):
local_path = os.path.join(DAT... | python | def get_real_layer_path(self, path):
"""
Get the path the actual layer file.
"""
filename = path.split('/')[-1]
local_path = path
filetype = os.path.splitext(filename)[1]
# Url
if re.match(r'^[a-zA-Z]+://', path):
local_path = os.path.join(DAT... | [
"def",
"get_real_layer_path",
"(",
"self",
",",
"path",
")",
":",
"filename",
"=",
"path",
".",
"split",
"(",
"'/'",
")",
"[",
"-",
"1",
"]",
"local_path",
"=",
"path",
"filetype",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"filename",
")",
"[",
... | Get the path the actual layer file. | [
"Get",
"the",
"path",
"the",
"actual",
"layer",
"file",
"."
] | fc9747c9d1584af2053bff3df229a460ef2a5f62 | https://github.com/nprapps/mapturner/blob/fc9747c9d1584af2053bff3df229a460ef2a5f62/mapturner/__init__.py#L122-L157 | train | Get the path the actual layer file. |
nprapps/mapturner | mapturner/__init__.py | MapTurner.download_file | def download_file(self, url, local_path):
"""
Download a file from a remote host.
"""
response = requests.get(url, stream=True)
with open(local_path, 'wb') as f:
for chunk in tqdm(response.iter_content(chunk_size=1024), unit='KB'):
if chunk: # filter ... | python | def download_file(self, url, local_path):
"""
Download a file from a remote host.
"""
response = requests.get(url, stream=True)
with open(local_path, 'wb') as f:
for chunk in tqdm(response.iter_content(chunk_size=1024), unit='KB'):
if chunk: # filter ... | [
"def",
"download_file",
"(",
"self",
",",
"url",
",",
"local_path",
")",
":",
"response",
"=",
"requests",
".",
"get",
"(",
"url",
",",
"stream",
"=",
"True",
")",
"with",
"open",
"(",
"local_path",
",",
"'wb'",
")",
"as",
"f",
":",
"for",
"chunk",
... | Download a file from a remote host. | [
"Download",
"a",
"file",
"from",
"a",
"remote",
"host",
"."
] | fc9747c9d1584af2053bff3df229a460ef2a5f62 | https://github.com/nprapps/mapturner/blob/fc9747c9d1584af2053bff3df229a460ef2a5f62/mapturner/__init__.py#L159-L169 | train | Download a file from a remote host. |
nprapps/mapturner | mapturner/__init__.py | MapTurner.unzip_file | def unzip_file(self, zip_path, output_path):
"""
Unzip a local file into a specified directory.
"""
with zipfile.ZipFile(zip_path, 'r') as z:
z.extractall(output_path) | python | def unzip_file(self, zip_path, output_path):
"""
Unzip a local file into a specified directory.
"""
with zipfile.ZipFile(zip_path, 'r') as z:
z.extractall(output_path) | [
"def",
"unzip_file",
"(",
"self",
",",
"zip_path",
",",
"output_path",
")",
":",
"with",
"zipfile",
".",
"ZipFile",
"(",
"zip_path",
",",
"'r'",
")",
"as",
"z",
":",
"z",
".",
"extractall",
"(",
"output_path",
")"
] | Unzip a local file into a specified directory. | [
"Unzip",
"a",
"local",
"file",
"into",
"a",
"specified",
"directory",
"."
] | fc9747c9d1584af2053bff3df229a460ef2a5f62 | https://github.com/nprapps/mapturner/blob/fc9747c9d1584af2053bff3df229a460ef2a5f62/mapturner/__init__.py#L171-L176 | train | Unzip a local file into a specified directory. |
nprapps/mapturner | mapturner/__init__.py | MapTurner.process_ogr2ogr | def process_ogr2ogr(self, name, layer, input_path):
"""
Process a layer using ogr2ogr.
"""
output_path = os.path.join(TEMP_DIRECTORY, '%s.json' % name)
if os.path.exists(output_path):
os.remove(output_path)
ogr2ogr_cmd = [
'ogr2ogr',
... | python | def process_ogr2ogr(self, name, layer, input_path):
"""
Process a layer using ogr2ogr.
"""
output_path = os.path.join(TEMP_DIRECTORY, '%s.json' % name)
if os.path.exists(output_path):
os.remove(output_path)
ogr2ogr_cmd = [
'ogr2ogr',
... | [
"def",
"process_ogr2ogr",
"(",
"self",
",",
"name",
",",
"layer",
",",
"input_path",
")",
":",
"output_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"TEMP_DIRECTORY",
",",
"'%s.json'",
"%",
"name",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
... | Process a layer using ogr2ogr. | [
"Process",
"a",
"layer",
"using",
"ogr2ogr",
"."
] | fc9747c9d1584af2053bff3df229a460ef2a5f62 | https://github.com/nprapps/mapturner/blob/fc9747c9d1584af2053bff3df229a460ef2a5f62/mapturner/__init__.py#L193-L228 | train | Process a layer using ogr2ogr. |
nprapps/mapturner | mapturner/__init__.py | MapTurner.process_topojson | def process_topojson(self, name, layer, input_path):
"""
Process layer using topojson.
"""
output_path = os.path.join(TEMP_DIRECTORY, '%s.topojson' % name)
# Use local topojson binary
topojson_binary = 'node_modules/bin/topojson'
if not os.path.exists(topojson_b... | python | def process_topojson(self, name, layer, input_path):
"""
Process layer using topojson.
"""
output_path = os.path.join(TEMP_DIRECTORY, '%s.topojson' % name)
# Use local topojson binary
topojson_binary = 'node_modules/bin/topojson'
if not os.path.exists(topojson_b... | [
"def",
"process_topojson",
"(",
"self",
",",
"name",
",",
"layer",
",",
"input_path",
")",
":",
"output_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"TEMP_DIRECTORY",
",",
"'%s.topojson'",
"%",
"name",
")",
"# Use local topojson binary",
"topojson_binary",
... | Process layer using topojson. | [
"Process",
"layer",
"using",
"topojson",
"."
] | fc9747c9d1584af2053bff3df229a460ef2a5f62 | https://github.com/nprapps/mapturner/blob/fc9747c9d1584af2053bff3df229a460ef2a5f62/mapturner/__init__.py#L230-L275 | train | Process a topojson layer using topojson. |
nprapps/mapturner | mapturner/__init__.py | MapTurner.merge | def merge(self, paths):
"""
Merge data layers into a single topojson file.
"""
# Use local topojson binary
topojson_binary = 'node_modules/bin/topojson'
if not os.path.exists(topojson_binary):
# try with global topojson binary
topojson_binary = '... | python | def merge(self, paths):
"""
Merge data layers into a single topojson file.
"""
# Use local topojson binary
topojson_binary = 'node_modules/bin/topojson'
if not os.path.exists(topojson_binary):
# try with global topojson binary
topojson_binary = '... | [
"def",
"merge",
"(",
"self",
",",
"paths",
")",
":",
"# Use local topojson binary",
"topojson_binary",
"=",
"'node_modules/bin/topojson'",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"topojson_binary",
")",
":",
"# try with global topojson binary",
"topojson_b... | Merge data layers into a single topojson file. | [
"Merge",
"data",
"layers",
"into",
"a",
"single",
"topojson",
"file",
"."
] | fc9747c9d1584af2053bff3df229a460ef2a5f62 | https://github.com/nprapps/mapturner/blob/fc9747c9d1584af2053bff3df229a460ef2a5f62/mapturner/__init__.py#L277-L303 | train | Merge data layers into a single topojson file. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.addMenuItem | def addMenuItem( self, newItem, atItem ):
"""
Adds a new menu item at the given item.
:param newItem | <QTreeWidgetItem>
atItem | <QTreeWidgetItem>
"""
tree = self.uiMenuTREE
if ( not atItem ):
tree.addTopLevelItem(n... | python | def addMenuItem( self, newItem, atItem ):
"""
Adds a new menu item at the given item.
:param newItem | <QTreeWidgetItem>
atItem | <QTreeWidgetItem>
"""
tree = self.uiMenuTREE
if ( not atItem ):
tree.addTopLevelItem(n... | [
"def",
"addMenuItem",
"(",
"self",
",",
"newItem",
",",
"atItem",
")",
":",
"tree",
"=",
"self",
".",
"uiMenuTREE",
"if",
"(",
"not",
"atItem",
")",
":",
"tree",
".",
"addTopLevelItem",
"(",
"newItem",
")",
"elif",
"(",
"atItem",
".",
"data",
"(",
"0... | Adds a new menu item at the given item.
:param newItem | <QTreeWidgetItem>
atItem | <QTreeWidgetItem> | [
"Adds",
"a",
"new",
"menu",
"item",
"at",
"the",
"given",
"item",
".",
":",
"param",
"newItem",
"|",
"<QTreeWidgetItem",
">",
"atItem",
"|",
"<QTreeWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L70-L91 | train | Adds a new item at the given item. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.createActionItem | def createActionItem( self, key ):
"""
Creates a new action item for the inputed key.
:param key | <str>
:return <QTreeWidgetItem>
"""
action = self._actions.get(key)
if ( not action ):
text = 'Missing Action: %s' % key
... | python | def createActionItem( self, key ):
"""
Creates a new action item for the inputed key.
:param key | <str>
:return <QTreeWidgetItem>
"""
action = self._actions.get(key)
if ( not action ):
text = 'Missing Action: %s' % key
... | [
"def",
"createActionItem",
"(",
"self",
",",
"key",
")",
":",
"action",
"=",
"self",
".",
"_actions",
".",
"get",
"(",
"key",
")",
"if",
"(",
"not",
"action",
")",
":",
"text",
"=",
"'Missing Action: %s'",
"%",
"key",
"item",
"=",
"QTreeWidgetItem",
"(... | Creates a new action item for the inputed key.
:param key | <str>
:return <QTreeWidgetItem> | [
"Creates",
"a",
"new",
"action",
"item",
"for",
"the",
"inputed",
"key",
".",
":",
"param",
"key",
"|",
"<str",
">",
":",
"return",
"<QTreeWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L93-L118 | train | Creates a new action item for the inputed key. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.createMenu | def createMenu( self ):
"""
Creates a new menu with the given name.
"""
name, accepted = QInputDialog.getText( self,
'Create Menu',
'Name: ')
if ( accepted ):
self.a... | python | def createMenu( self ):
"""
Creates a new menu with the given name.
"""
name, accepted = QInputDialog.getText( self,
'Create Menu',
'Name: ')
if ( accepted ):
self.a... | [
"def",
"createMenu",
"(",
"self",
")",
":",
"name",
",",
"accepted",
"=",
"QInputDialog",
".",
"getText",
"(",
"self",
",",
"'Create Menu'",
",",
"'Name: '",
")",
"if",
"(",
"accepted",
")",
":",
"self",
".",
"addMenuItem",
"(",
"self",
".",
"createMenuI... | Creates a new menu with the given name. | [
"Creates",
"a",
"new",
"menu",
"with",
"the",
"given",
"name",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L120-L130 | train | Creates a new menu with the given name. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.createMenuItem | def createMenuItem( self, title ):
"""
Creates a new menu item with the given title.
:param title | <str>
:return <QTreeWidgetItem>
"""
item = QTreeWidgetItem([title])
ico = projexui.resources.find('img/folder.png')
item... | python | def createMenuItem( self, title ):
"""
Creates a new menu item with the given title.
:param title | <str>
:return <QTreeWidgetItem>
"""
item = QTreeWidgetItem([title])
ico = projexui.resources.find('img/folder.png')
item... | [
"def",
"createMenuItem",
"(",
"self",
",",
"title",
")",
":",
"item",
"=",
"QTreeWidgetItem",
"(",
"[",
"title",
"]",
")",
"ico",
"=",
"projexui",
".",
"resources",
".",
"find",
"(",
"'img/folder.png'",
")",
"item",
".",
"setIcon",
"(",
"0",
",",
"QIco... | Creates a new menu item with the given title.
:param title | <str>
:return <QTreeWidgetItem> | [
"Creates",
"a",
"new",
"menu",
"item",
"with",
"the",
"given",
"title",
".",
":",
"param",
"title",
"|",
"<str",
">",
":",
"return",
"<QTreeWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L132-L147 | train | Creates a new menu item with the given title. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.createSeparatorItem | def createSeparatorItem( self ):
"""
Creates a new separator item.
:return <QTreeWidgetItem>
"""
item = QTreeWidgetItem([' '])
font = item.font(0)
font.setStrikeOut(True)
item.setFont(0, font)
item.se... | python | def createSeparatorItem( self ):
"""
Creates a new separator item.
:return <QTreeWidgetItem>
"""
item = QTreeWidgetItem([' '])
font = item.font(0)
font.setStrikeOut(True)
item.setFont(0, font)
item.se... | [
"def",
"createSeparatorItem",
"(",
"self",
")",
":",
"item",
"=",
"QTreeWidgetItem",
"(",
"[",
"' '",
"]",
")",
"font",
"=",
"item",
".",
"font",
"(",
"0",
")",
"font",
".",
"setStrikeOut",
"(",
"True",
")",
"item",
".",
... | Creates a new separator item.
:return <QTreeWidgetItem> | [
"Creates",
"a",
"new",
"separator",
"item",
".",
":",
"return",
"<QTreeWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L156-L171 | train | Creates a new separator item. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.eventFilter | def eventFilter( self, object, event ):
"""
Processes events for the menu tree.
:param event | <QEvent>
"""
if ( not event.type() in (QEvent.DragEnter,
QEvent.DragMove,
QEvent.Drop) ):
r... | python | def eventFilter( self, object, event ):
"""
Processes events for the menu tree.
:param event | <QEvent>
"""
if ( not event.type() in (QEvent.DragEnter,
QEvent.DragMove,
QEvent.Drop) ):
r... | [
"def",
"eventFilter",
"(",
"self",
",",
"object",
",",
"event",
")",
":",
"if",
"(",
"not",
"event",
".",
"type",
"(",
")",
"in",
"(",
"QEvent",
".",
"DragEnter",
",",
"QEvent",
".",
"DragMove",
",",
"QEvent",
".",
"Drop",
")",
")",
":",
"return",
... | Processes events for the menu tree.
:param event | <QEvent> | [
"Processes",
"events",
"for",
"the",
"menu",
"tree",
".",
":",
"param",
"event",
"|",
"<QEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L173-L212 | train | Filter the menu tree items based on the event. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.loadXml | def loadXml( self, xaction ):
"""
Loads the xml action to the menu template tree.
:param xaction | <xml.etree.ElementTree>
"""
if ( xaction.tag == 'menu' ):
title = xaction.get('title', '')
item = self.createMenuItem(title)
for xc... | python | def loadXml( self, xaction ):
"""
Loads the xml action to the menu template tree.
:param xaction | <xml.etree.ElementTree>
"""
if ( xaction.tag == 'menu' ):
title = xaction.get('title', '')
item = self.createMenuItem(title)
for xc... | [
"def",
"loadXml",
"(",
"self",
",",
"xaction",
")",
":",
"if",
"(",
"xaction",
".",
"tag",
"==",
"'menu'",
")",
":",
"title",
"=",
"xaction",
".",
"get",
"(",
"'title'",
",",
"''",
")",
"item",
"=",
"self",
".",
"createMenuItem",
"(",
"title",
")",... | Loads the xml action to the menu template tree.
:param xaction | <xml.etree.ElementTree> | [
"Loads",
"the",
"xml",
"action",
"to",
"the",
"menu",
"template",
"tree",
".",
":",
"param",
"xaction",
"|",
"<xml",
".",
"etree",
".",
"ElementTree",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L214-L233 | train | Loads the xml action into the menu template tree. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.menuTemplate | def menuTemplate( self ):
"""
Returns the new menu template based on the user preferences.
:return <str>
"""
xml = ElementTree.Element('menu')
for i in range(self.uiMenuTREE.topLevelItemCount()):
self.saveXml(xml, self.uiMenuTREE.topLevelItem(i))
... | python | def menuTemplate( self ):
"""
Returns the new menu template based on the user preferences.
:return <str>
"""
xml = ElementTree.Element('menu')
for i in range(self.uiMenuTREE.topLevelItemCount()):
self.saveXml(xml, self.uiMenuTREE.topLevelItem(i))
... | [
"def",
"menuTemplate",
"(",
"self",
")",
":",
"xml",
"=",
"ElementTree",
".",
"Element",
"(",
"'menu'",
")",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"uiMenuTREE",
".",
"topLevelItemCount",
"(",
")",
")",
":",
"self",
".",
"saveXml",
"(",
"xml",
... | Returns the new menu template based on the user preferences.
:return <str> | [
"Returns",
"the",
"new",
"menu",
"template",
"based",
"on",
"the",
"user",
"preferences",
".",
":",
"return",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L235-L246 | train | Returns the menu template based on the user preferences. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.removeItem | def removeItem( self ):
"""
Removes the item from the menu.
"""
item = self.uiMenuTREE.currentItem()
if ( not item ):
return
opts = QMessageBox.Yes | QMessageBox.No
answer = QMessageBox.question( self,
'R... | python | def removeItem( self ):
"""
Removes the item from the menu.
"""
item = self.uiMenuTREE.currentItem()
if ( not item ):
return
opts = QMessageBox.Yes | QMessageBox.No
answer = QMessageBox.question( self,
'R... | [
"def",
"removeItem",
"(",
"self",
")",
":",
"item",
"=",
"self",
".",
"uiMenuTREE",
".",
"currentItem",
"(",
")",
"if",
"(",
"not",
"item",
")",
":",
"return",
"opts",
"=",
"QMessageBox",
".",
"Yes",
"|",
"QMessageBox",
".",
"No",
"answer",
"=",
"QMe... | Removes the item from the menu. | [
"Removes",
"the",
"item",
"from",
"the",
"menu",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L248-L269 | train | Removes the item from the menu. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.renameMenu | def renameMenu( self ):
"""
Prompts the user to supply a new name for the menu.
"""
item = self.uiMenuTREE.currentItem()
name, accepted = QInputDialog.getText( self,
'Rename Menu',
... | python | def renameMenu( self ):
"""
Prompts the user to supply a new name for the menu.
"""
item = self.uiMenuTREE.currentItem()
name, accepted = QInputDialog.getText( self,
'Rename Menu',
... | [
"def",
"renameMenu",
"(",
"self",
")",
":",
"item",
"=",
"self",
".",
"uiMenuTREE",
".",
"currentItem",
"(",
")",
"name",
",",
"accepted",
"=",
"QInputDialog",
".",
"getText",
"(",
"self",
",",
"'Rename Menu'",
",",
"'Name:'",
",",
"QLineEdit",
".",
"Nor... | Prompts the user to supply a new name for the menu. | [
"Prompts",
"the",
"user",
"to",
"supply",
"a",
"new",
"name",
"for",
"the",
"menu",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L271-L283 | train | Prompts the user to supply a new name for the menu. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.saveXml | def saveXml( self, xparent, item ):
"""
Saves the information from the tree item to xml.
:param xparent | <xml.etree.ElementTree.Element>
item | <QTreeWidgetItem>
"""
key = nativestring(unwrapVariant(item.data(0, Qt.UserRole)))
... | python | def saveXml( self, xparent, item ):
"""
Saves the information from the tree item to xml.
:param xparent | <xml.etree.ElementTree.Element>
item | <QTreeWidgetItem>
"""
key = nativestring(unwrapVariant(item.data(0, Qt.UserRole)))
... | [
"def",
"saveXml",
"(",
"self",
",",
"xparent",
",",
"item",
")",
":",
"key",
"=",
"nativestring",
"(",
"unwrapVariant",
"(",
"item",
".",
"data",
"(",
"0",
",",
"Qt",
".",
"UserRole",
")",
")",
")",
"if",
"(",
"key",
"==",
"'separator'",
")",
":",
... | Saves the information from the tree item to xml.
:param xparent | <xml.etree.ElementTree.Element>
item | <QTreeWidgetItem> | [
"Saves",
"the",
"information",
"from",
"the",
"tree",
"item",
"to",
"xml",
".",
":",
"param",
"xparent",
"|",
"<xml",
".",
"etree",
".",
"ElementTree",
".",
"Element",
">",
"item",
"|",
"<QTreeWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L285-L304 | train | Saves the information from the tree item to xml. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.setActions | def setActions( self, actions ):
"""
Sets the action options for this widget to the inputed list of actions.
:param actions | {<str> key: <QAction>, ..}
"""
self._actions = actions
self.uiActionTREE.blockSignals(True)
self.uiActionTREE.setUp... | python | def setActions( self, actions ):
"""
Sets the action options for this widget to the inputed list of actions.
:param actions | {<str> key: <QAction>, ..}
"""
self._actions = actions
self.uiActionTREE.blockSignals(True)
self.uiActionTREE.setUp... | [
"def",
"setActions",
"(",
"self",
",",
"actions",
")",
":",
"self",
".",
"_actions",
"=",
"actions",
"self",
".",
"uiActionTREE",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"uiActionTREE",
".",
"setUpdatesEnabled",
"(",
"False",
")",
"self",
".",
... | Sets the action options for this widget to the inputed list of actions.
:param actions | {<str> key: <QAction>, ..} | [
"Sets",
"the",
"action",
"options",
"for",
"this",
"widget",
"to",
"the",
"inputed",
"list",
"of",
"actions",
".",
":",
"param",
"actions",
"|",
"{",
"<str",
">",
"key",
":",
"<QAction",
">",
"..",
"}"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L306-L326 | train | Sets the actions for this widget to the inputed list of actions. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.setMenuTemplate | def setMenuTemplate( self, template ):
"""
Sets the menu template for this widget to the inputed string template.
:param template | <str>
"""
try:
xtree = ElementTree.fromstring(nativestring(template))
except ExpatError, e:
logger.exc... | python | def setMenuTemplate( self, template ):
"""
Sets the menu template for this widget to the inputed string template.
:param template | <str>
"""
try:
xtree = ElementTree.fromstring(nativestring(template))
except ExpatError, e:
logger.exc... | [
"def",
"setMenuTemplate",
"(",
"self",
",",
"template",
")",
":",
"try",
":",
"xtree",
"=",
"ElementTree",
".",
"fromstring",
"(",
"nativestring",
"(",
"template",
")",
")",
"except",
"ExpatError",
",",
"e",
":",
"logger",
".",
"exception",
"(",
"e",
")"... | Sets the menu template for this widget to the inputed string template.
:param template | <str> | [
"Sets",
"the",
"menu",
"template",
"for",
"this",
"widget",
"to",
"the",
"inputed",
"string",
"template",
".",
":",
"param",
"template",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L328-L348 | train | Sets the menu template for this widget to the inputed string template. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.showMenu | def showMenu( self ):
"""
Creates a menu to display for the editing of template information.
"""
item = self.uiMenuTREE.currentItem()
menu = QMenu(self)
act = menu.addAction('Add Menu...')
act.setIcon(QIcon(projexui.resources.find('img/folder.png')))
... | python | def showMenu( self ):
"""
Creates a menu to display for the editing of template information.
"""
item = self.uiMenuTREE.currentItem()
menu = QMenu(self)
act = menu.addAction('Add Menu...')
act.setIcon(QIcon(projexui.resources.find('img/folder.png')))
... | [
"def",
"showMenu",
"(",
"self",
")",
":",
"item",
"=",
"self",
".",
"uiMenuTREE",
".",
"currentItem",
"(",
")",
"menu",
"=",
"QMenu",
"(",
"self",
")",
"act",
"=",
"menu",
".",
"addAction",
"(",
"'Add Menu...'",
")",
"act",
".",
"setIcon",
"(",
"QIco... | Creates a menu to display for the editing of template information. | [
"Creates",
"a",
"menu",
"to",
"display",
"for",
"the",
"editing",
"of",
"template",
"information",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L350-L378 | train | Shows the menu for the current template information. |
bitesofcode/projexui | projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py | XMenuTemplateWidget.edit | def edit( parent, template, actions = None ):
"""
Prompts the user to edit the menu template with the given actions. \
If no actions are supplied, then the actions from the parent will \
be used.
:param parent | <QWidget>
template | <str>
... | python | def edit( parent, template, actions = None ):
"""
Prompts the user to edit the menu template with the given actions. \
If no actions are supplied, then the actions from the parent will \
be used.
:param parent | <QWidget>
template | <str>
... | [
"def",
"edit",
"(",
"parent",
",",
"template",
",",
"actions",
"=",
"None",
")",
":",
"# collect the potential actions from the widget",
"if",
"(",
"actions",
"is",
"None",
")",
":",
"actions",
"=",
"{",
"}",
"for",
"action",
"in",
"parent",
".",
"actions",
... | Prompts the user to edit the menu template with the given actions. \
If no actions are supplied, then the actions from the parent will \
be used.
:param parent | <QWidget>
template | <str>
actions | {<str> name: <QAction>, .. } || None
... | [
"Prompts",
"the",
"user",
"to",
"edit",
"the",
"menu",
"template",
"with",
"the",
"given",
"actions",
".",
"\\",
"If",
"no",
"actions",
"are",
"supplied",
"then",
"the",
"actions",
"from",
"the",
"parent",
"will",
"\\",
"be",
"used",
".",
":",
"param",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmenutemplatewidget/xmenutemplatewidget.py#L393-L443 | train | Prompts the user to edit the menu template with the given actions. |
solarnz/Flask-Stats | flask_stats/__init__.py | Stats.init_app | def init_app(self, app):
"""Inititialise the extension with the app object.
:param app: Your application object
"""
host = app.config.get('STATS_HOSTNAME', 'localhost')
port = app.config.get('STATS_PORT', 8125)
base_key = app.config.get('STATS_BASE_KEY', app.name)
... | python | def init_app(self, app):
"""Inititialise the extension with the app object.
:param app: Your application object
"""
host = app.config.get('STATS_HOSTNAME', 'localhost')
port = app.config.get('STATS_PORT', 8125)
base_key = app.config.get('STATS_BASE_KEY', app.name)
... | [
"def",
"init_app",
"(",
"self",
",",
"app",
")",
":",
"host",
"=",
"app",
".",
"config",
".",
"get",
"(",
"'STATS_HOSTNAME'",
",",
"'localhost'",
")",
"port",
"=",
"app",
".",
"config",
".",
"get",
"(",
"'STATS_PORT'",
",",
"8125",
")",
"base_key",
"... | Inititialise the extension with the app object.
:param app: Your application object | [
"Inititialise",
"the",
"extension",
"with",
"the",
"app",
"object",
"."
] | de9e476a30a98c9aa0eec4b9a18b150c905c382e | https://github.com/solarnz/Flask-Stats/blob/de9e476a30a98c9aa0eec4b9a18b150c905c382e/flask_stats/__init__.py#L50-L73 | train | Inititialise the extension with the app object. |
Zitrax/nose-dep | nosedep.py | depends | def depends(func=None, after=None, before=None, priority=None):
"""Decorator to specify test dependencies
:param after: The test needs to run after this/these tests. String or list of strings.
:param before: The test needs to run before this/these tests. String or list of strings.
"""
if not (func ... | python | def depends(func=None, after=None, before=None, priority=None):
"""Decorator to specify test dependencies
:param after: The test needs to run after this/these tests. String or list of strings.
:param before: The test needs to run before this/these tests. String or list of strings.
"""
if not (func ... | [
"def",
"depends",
"(",
"func",
"=",
"None",
",",
"after",
"=",
"None",
",",
"before",
"=",
"None",
",",
"priority",
"=",
"None",
")",
":",
"if",
"not",
"(",
"func",
"is",
"None",
"or",
"inspect",
".",
"ismethod",
"(",
"func",
")",
"or",
"inspect",
... | Decorator to specify test dependencies
:param after: The test needs to run after this/these tests. String or list of strings.
:param before: The test needs to run before this/these tests. String or list of strings. | [
"Decorator",
"to",
"specify",
"test",
"dependencies"
] | fd29c95e0e5eb2dbd821f6566b72dfcf42631226 | https://github.com/Zitrax/nose-dep/blob/fd29c95e0e5eb2dbd821f6566b72dfcf42631226/nosedep.py#L84-L127 | train | Decorator to specify test dependencies. |
Zitrax/nose-dep | nosedep.py | split_on_condition | def split_on_condition(seq, condition):
"""Split a sequence into two iterables without looping twice"""
l1, l2 = tee((condition(item), item) for item in seq)
return (i for p, i in l1 if p), (i for p, i in l2 if not p) | python | def split_on_condition(seq, condition):
"""Split a sequence into two iterables without looping twice"""
l1, l2 = tee((condition(item), item) for item in seq)
return (i for p, i in l1 if p), (i for p, i in l2 if not p) | [
"def",
"split_on_condition",
"(",
"seq",
",",
"condition",
")",
":",
"l1",
",",
"l2",
"=",
"tee",
"(",
"(",
"condition",
"(",
"item",
")",
",",
"item",
")",
"for",
"item",
"in",
"seq",
")",
"return",
"(",
"i",
"for",
"p",
",",
"i",
"in",
"l1",
... | Split a sequence into two iterables without looping twice | [
"Split",
"a",
"sequence",
"into",
"two",
"iterables",
"without",
"looping",
"twice"
] | fd29c95e0e5eb2dbd821f6566b72dfcf42631226 | https://github.com/Zitrax/nose-dep/blob/fd29c95e0e5eb2dbd821f6566b72dfcf42631226/nosedep.py#L195-L198 | train | Split a sequence into two iterables without looping twice |
Zitrax/nose-dep | nosedep.py | NoseDep.calculate_dependencies | def calculate_dependencies():
"""Calculate test dependencies
First do a topological sorting based on the dependencies.
Then sort the different dependency groups based on priorities.
"""
order = []
for g in toposort(merge_dicts(dependencies, soft_dependencies)):
... | python | def calculate_dependencies():
"""Calculate test dependencies
First do a topological sorting based on the dependencies.
Then sort the different dependency groups based on priorities.
"""
order = []
for g in toposort(merge_dicts(dependencies, soft_dependencies)):
... | [
"def",
"calculate_dependencies",
"(",
")",
":",
"order",
"=",
"[",
"]",
"for",
"g",
"in",
"toposort",
"(",
"merge_dicts",
"(",
"dependencies",
",",
"soft_dependencies",
")",
")",
":",
"for",
"t",
"in",
"sorted",
"(",
"g",
",",
"key",
"=",
"lambda",
"x"... | Calculate test dependencies
First do a topological sorting based on the dependencies.
Then sort the different dependency groups based on priorities. | [
"Calculate",
"test",
"dependencies",
"First",
"do",
"a",
"topological",
"sorting",
"based",
"on",
"the",
"dependencies",
".",
"Then",
"sort",
"the",
"different",
"dependency",
"groups",
"based",
"on",
"priorities",
"."
] | fd29c95e0e5eb2dbd821f6566b72dfcf42631226 | https://github.com/Zitrax/nose-dep/blob/fd29c95e0e5eb2dbd821f6566b72dfcf42631226/nosedep.py#L231-L240 | train | Calculate test dependencies
|
Zitrax/nose-dep | nosedep.py | NoseDep.prepare_suite | def prepare_suite(self, suite):
"""Prepare suite and determine test ordering"""
all_tests = {}
for s in suite:
m = re.match(r'(\w+)\s+\(.+\)', str(s))
if m:
name = m.group(1)
else:
name = str(s).split('.')[-1]
all_te... | python | def prepare_suite(self, suite):
"""Prepare suite and determine test ordering"""
all_tests = {}
for s in suite:
m = re.match(r'(\w+)\s+\(.+\)', str(s))
if m:
name = m.group(1)
else:
name = str(s).split('.')[-1]
all_te... | [
"def",
"prepare_suite",
"(",
"self",
",",
"suite",
")",
":",
"all_tests",
"=",
"{",
"}",
"for",
"s",
"in",
"suite",
":",
"m",
"=",
"re",
".",
"match",
"(",
"r'(\\w+)\\s+\\(.+\\)'",
",",
"str",
"(",
"s",
")",
")",
"if",
"m",
":",
"name",
"=",
"m",... | Prepare suite and determine test ordering | [
"Prepare",
"suite",
"and",
"determine",
"test",
"ordering"
] | fd29c95e0e5eb2dbd821f6566b72dfcf42631226 | https://github.com/Zitrax/nose-dep/blob/fd29c95e0e5eb2dbd821f6566b72dfcf42631226/nosedep.py#L268-L279 | train | Prepare suite and determine test ordering |
Zitrax/nose-dep | nosedep.py | NoseDep.dependency_failed | def dependency_failed(self, test):
"""Returns an error string if any of the dependencies failed"""
for d in (self.test_name(i) for i in dependencies[test]):
if d in (self.test_name(str(t[0])) for t in self.results.failures):
return "Required test '{}' FAILED".format(d)
... | python | def dependency_failed(self, test):
"""Returns an error string if any of the dependencies failed"""
for d in (self.test_name(i) for i in dependencies[test]):
if d in (self.test_name(str(t[0])) for t in self.results.failures):
return "Required test '{}' FAILED".format(d)
... | [
"def",
"dependency_failed",
"(",
"self",
",",
"test",
")",
":",
"for",
"d",
"in",
"(",
"self",
".",
"test_name",
"(",
"i",
")",
"for",
"i",
"in",
"dependencies",
"[",
"test",
"]",
")",
":",
"if",
"d",
"in",
"(",
"self",
".",
"test_name",
"(",
"st... | Returns an error string if any of the dependencies failed | [
"Returns",
"an",
"error",
"string",
"if",
"any",
"of",
"the",
"dependencies",
"failed"
] | fd29c95e0e5eb2dbd821f6566b72dfcf42631226 | https://github.com/Zitrax/nose-dep/blob/fd29c95e0e5eb2dbd821f6566b72dfcf42631226/nosedep.py#L321-L330 | train | Returns an error string if any of the dependencies failed |
Zitrax/nose-dep | nosedep.py | NoseDep.dependency_ran | def dependency_ran(self, test):
"""Returns an error string if any of the dependencies did not run"""
for d in (self.test_name(i) for i in dependencies[test]):
if d not in self.ok_results:
return "Required test '{}' did not run (does it exist?)".format(d)
return None | python | def dependency_ran(self, test):
"""Returns an error string if any of the dependencies did not run"""
for d in (self.test_name(i) for i in dependencies[test]):
if d not in self.ok_results:
return "Required test '{}' did not run (does it exist?)".format(d)
return None | [
"def",
"dependency_ran",
"(",
"self",
",",
"test",
")",
":",
"for",
"d",
"in",
"(",
"self",
".",
"test_name",
"(",
"i",
")",
"for",
"i",
"in",
"dependencies",
"[",
"test",
"]",
")",
":",
"if",
"d",
"not",
"in",
"self",
".",
"ok_results",
":",
"re... | Returns an error string if any of the dependencies did not run | [
"Returns",
"an",
"error",
"string",
"if",
"any",
"of",
"the",
"dependencies",
"did",
"not",
"run"
] | fd29c95e0e5eb2dbd821f6566b72dfcf42631226 | https://github.com/Zitrax/nose-dep/blob/fd29c95e0e5eb2dbd821f6566b72dfcf42631226/nosedep.py#L332-L337 | train | Returns an error string if any of the dependencies did not run |
xflr6/fileconfig | fileconfig/tools.py | class_path | def class_path(cls):
"""Return the path to the source file of the given class."""
if cls.__module__ == '__main__':
path = None
else:
path = os.path.dirname(inspect.getfile(cls))
if not path:
path = os.getcwd()
return os.path.realpath(path) | python | def class_path(cls):
"""Return the path to the source file of the given class."""
if cls.__module__ == '__main__':
path = None
else:
path = os.path.dirname(inspect.getfile(cls))
if not path:
path = os.getcwd()
return os.path.realpath(path) | [
"def",
"class_path",
"(",
"cls",
")",
":",
"if",
"cls",
".",
"__module__",
"==",
"'__main__'",
":",
"path",
"=",
"None",
"else",
":",
"path",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"inspect",
".",
"getfile",
"(",
"cls",
")",
")",
"if",
"not",... | Return the path to the source file of the given class. | [
"Return",
"the",
"path",
"to",
"the",
"source",
"file",
"of",
"the",
"given",
"class",
"."
] | 473d65f6442eb1ac49ada0b6e56cab45f8018c15 | https://github.com/xflr6/fileconfig/blob/473d65f6442eb1ac49ada0b6e56cab45f8018c15/fileconfig/tools.py#L10-L20 | train | Return the path to the source file of the given class. |
xflr6/fileconfig | fileconfig/tools.py | caller_path | def caller_path(steps=1):
"""Return the path to the source file of the current frames' caller."""
frame = sys._getframe(steps + 1)
try:
path = os.path.dirname(frame.f_code.co_filename)
finally:
del frame
if not path:
path = os.getcwd()
return os.path.realpath(path) | python | def caller_path(steps=1):
"""Return the path to the source file of the current frames' caller."""
frame = sys._getframe(steps + 1)
try:
path = os.path.dirname(frame.f_code.co_filename)
finally:
del frame
if not path:
path = os.getcwd()
return os.path.realpath(path) | [
"def",
"caller_path",
"(",
"steps",
"=",
"1",
")",
":",
"frame",
"=",
"sys",
".",
"_getframe",
"(",
"steps",
"+",
"1",
")",
"try",
":",
"path",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"frame",
".",
"f_code",
".",
"co_filename",
")",
"finally",... | Return the path to the source file of the current frames' caller. | [
"Return",
"the",
"path",
"to",
"the",
"source",
"file",
"of",
"the",
"current",
"frames",
"caller",
"."
] | 473d65f6442eb1ac49ada0b6e56cab45f8018c15 | https://github.com/xflr6/fileconfig/blob/473d65f6442eb1ac49ada0b6e56cab45f8018c15/fileconfig/tools.py#L23-L35 | train | Return the path to the source file of the current frames caller. |
pmuller/versions | versions/version.py | Version.parse | def parse(cls, version_string):
"""Parses a ``version_string`` and returns a :py:class:`~Version`
object.
"""
match = RE.match(version_string)
if match:
major_str, minor_str, patch_str, postrelease_alpha, \
postrelease_digit, prerelease_str, build_meta... | python | def parse(cls, version_string):
"""Parses a ``version_string`` and returns a :py:class:`~Version`
object.
"""
match = RE.match(version_string)
if match:
major_str, minor_str, patch_str, postrelease_alpha, \
postrelease_digit, prerelease_str, build_meta... | [
"def",
"parse",
"(",
"cls",
",",
"version_string",
")",
":",
"match",
"=",
"RE",
".",
"match",
"(",
"version_string",
")",
"if",
"match",
":",
"major_str",
",",
"minor_str",
",",
"patch_str",
",",
"postrelease_alpha",
",",
"postrelease_digit",
",",
"prerelea... | Parses a ``version_string`` and returns a :py:class:`~Version`
object. | [
"Parses",
"a",
"version_string",
"and",
"returns",
"a",
":",
"py",
":",
"class",
":",
"~Version",
"object",
"."
] | 951bc3fd99b6a675190f11ee0752af1d7ff5b440 | https://github.com/pmuller/versions/blob/951bc3fd99b6a675190f11ee0752af1d7ff5b440/versions/version.py#L122-L166 | train | Parses a version_string and returns a : py : class ~Version object. |
bitesofcode/projexui | projexui/widgets/xfindwidget.py | XFindWidget.find | def find( self, flags = 0 ):
"""
Looks throught the text document based on the current criteria. The \
inputed flags will be merged with the generated search flags.
:param flags | <QTextDocument.FindFlag>
:return <bool> | success
"""
... | python | def find( self, flags = 0 ):
"""
Looks throught the text document based on the current criteria. The \
inputed flags will be merged with the generated search flags.
:param flags | <QTextDocument.FindFlag>
:return <bool> | success
"""
... | [
"def",
"find",
"(",
"self",
",",
"flags",
"=",
"0",
")",
":",
"# check against the web and text views\r",
"if",
"(",
"not",
"(",
"self",
".",
"_textEdit",
"or",
"self",
".",
"_webView",
")",
")",
":",
"fg",
"=",
"QColor",
"(",
"'darkRed'",
")",
"bg",
"... | Looks throught the text document based on the current criteria. The \
inputed flags will be merged with the generated search flags.
:param flags | <QTextDocument.FindFlag>
:return <bool> | success | [
"Looks",
"throught",
"the",
"text",
"document",
"based",
"on",
"the",
"current",
"criteria",
".",
"The",
"\\",
"inputed",
"flags",
"will",
"be",
"merged",
"with",
"the",
"generated",
"search",
"flags",
".",
":",
"param",
"flags",
"|",
"<QTextDocument",
".",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfindwidget.py#L113-L180 | train | Returns True if the text document contains at least one entry in the text document. |
bitesofcode/projexui | projexui/widgets/xfindwidget.py | XFindWidget.setTextEdit | def setTextEdit( self, textEdit ):
"""
Sets the text edit that this find widget will use to search.
:param textEdit | <QTextEdit>
"""
if ( self._textEdit ):
self._textEdit.removeAction(self._findAction)
self._textEdit = text... | python | def setTextEdit( self, textEdit ):
"""
Sets the text edit that this find widget will use to search.
:param textEdit | <QTextEdit>
"""
if ( self._textEdit ):
self._textEdit.removeAction(self._findAction)
self._textEdit = text... | [
"def",
"setTextEdit",
"(",
"self",
",",
"textEdit",
")",
":",
"if",
"(",
"self",
".",
"_textEdit",
")",
":",
"self",
".",
"_textEdit",
".",
"removeAction",
"(",
"self",
".",
"_findAction",
")",
"self",
".",
"_textEdit",
"=",
"textEdit",
"if",
"(",
"tex... | Sets the text edit that this find widget will use to search.
:param textEdit | <QTextEdit> | [
"Sets",
"the",
"text",
"edit",
"that",
"this",
"find",
"widget",
"will",
"use",
"to",
"search",
".",
":",
"param",
"textEdit",
"|",
"<QTextEdit",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfindwidget.py#L198-L209 | train | Sets the text edit that this find widget will use to search for. |
bitesofcode/projexui | projexui/widgets/xfindwidget.py | XFindWidget.setWebView | def setWebView( self, webView ):
"""
Sets the web view edit that this find widget will use to search.
:param webView | <QWebView>
"""
if ( self._webView ):
self._webView.removeAction(self._findAction)
self._webView = webView
... | python | def setWebView( self, webView ):
"""
Sets the web view edit that this find widget will use to search.
:param webView | <QWebView>
"""
if ( self._webView ):
self._webView.removeAction(self._findAction)
self._webView = webView
... | [
"def",
"setWebView",
"(",
"self",
",",
"webView",
")",
":",
"if",
"(",
"self",
".",
"_webView",
")",
":",
"self",
".",
"_webView",
".",
"removeAction",
"(",
"self",
".",
"_findAction",
")",
"self",
".",
"_webView",
"=",
"webView",
"if",
"(",
"webView",... | Sets the web view edit that this find widget will use to search.
:param webView | <QWebView> | [
"Sets",
"the",
"web",
"view",
"edit",
"that",
"this",
"find",
"widget",
"will",
"use",
"to",
"search",
".",
":",
"param",
"webView",
"|",
"<QWebView",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfindwidget.py#L211-L222 | train | Sets the web view that this find widget will use to search. |
viatoriche/microservices | microservices/http/client.py | Resource.resource | def resource(self, *resources):
"""Resource builder with resources url
:param resources: 'one', 'two', 'three'
:return: instance of Resource
"""
resources = tuple(self.resources) + resources
return Resource(self.client, resources) | python | def resource(self, *resources):
"""Resource builder with resources url
:param resources: 'one', 'two', 'three'
:return: instance of Resource
"""
resources = tuple(self.resources) + resources
return Resource(self.client, resources) | [
"def",
"resource",
"(",
"self",
",",
"*",
"resources",
")",
":",
"resources",
"=",
"tuple",
"(",
"self",
".",
"resources",
")",
"+",
"resources",
"return",
"Resource",
"(",
"self",
".",
"client",
",",
"resources",
")"
] | Resource builder with resources url
:param resources: 'one', 'two', 'three'
:return: instance of Resource | [
"Resource",
"builder",
"with",
"resources",
"url"
] | 3510563edd15dc6131b8a948d6062856cd904ac7 | https://github.com/viatoriche/microservices/blob/3510563edd15dc6131b8a948d6062856cd904ac7/microservices/http/client.py#L57-L64 | train | Resource builder with resources url |
pmuller/versions | versions/constraint.py | Constraint.match | def match(self, version):
"""Match ``version`` with the constraint.
:param version: Version to match against the constraint.
:type version: :ref:`version expression <version-expressions>` or \
:class:`.Version`
:rtype: ``True`` if ``version`` satisfies the constraint, \
... | python | def match(self, version):
"""Match ``version`` with the constraint.
:param version: Version to match against the constraint.
:type version: :ref:`version expression <version-expressions>` or \
:class:`.Version`
:rtype: ``True`` if ``version`` satisfies the constraint, \
... | [
"def",
"match",
"(",
"self",
",",
"version",
")",
":",
"if",
"isinstance",
"(",
"version",
",",
"basestring",
")",
":",
"version",
"=",
"Version",
".",
"parse",
"(",
"version",
")",
"return",
"self",
".",
"operator",
"(",
"version",
",",
"self",
".",
... | Match ``version`` with the constraint.
:param version: Version to match against the constraint.
:type version: :ref:`version expression <version-expressions>` or \
:class:`.Version`
:rtype: ``True`` if ``version`` satisfies the constraint, \
``False`` if it doesn't. | [
"Match",
"version",
"with",
"the",
"constraint",
"."
] | 951bc3fd99b6a675190f11ee0752af1d7ff5b440 | https://github.com/pmuller/versions/blob/951bc3fd99b6a675190f11ee0752af1d7ff5b440/versions/constraint.py#L61-L72 | train | Match the version with the constraint. |
pmuller/versions | versions/constraint.py | Constraint.parse | def parse(cls, constraint_expression):
"""Parses a :ref:`constraint_expression <constraint-expressions>` \
and returns a :class:`Constraint` object.
:param constraint_expression: A \
:ref:`constraint expression <constraint-expressions>`
:type constraint_expression: str
:... | python | def parse(cls, constraint_expression):
"""Parses a :ref:`constraint_expression <constraint-expressions>` \
and returns a :class:`Constraint` object.
:param constraint_expression: A \
:ref:`constraint expression <constraint-expressions>`
:type constraint_expression: str
:... | [
"def",
"parse",
"(",
"cls",
",",
"constraint_expression",
")",
":",
"match",
"=",
"RE",
".",
"match",
"(",
"constraint_expression",
")",
"if",
"match",
":",
"operator_str",
",",
"version_str",
"=",
"match",
".",
"groups",
"(",
")",
"operator",
"=",
"Operat... | Parses a :ref:`constraint_expression <constraint-expressions>` \
and returns a :class:`Constraint` object.
:param constraint_expression: A \
:ref:`constraint expression <constraint-expressions>`
:type constraint_expression: str
:raises: :exc:`InvalidConstraintExpression` when pa... | [
"Parses",
"a",
":",
"ref",
":",
"constraint_expression",
"<constraint",
"-",
"expressions",
">",
"\\",
"and",
"returns",
"a",
":",
"class",
":",
"Constraint",
"object",
"."
] | 951bc3fd99b6a675190f11ee0752af1d7ff5b440 | https://github.com/pmuller/versions/blob/951bc3fd99b6a675190f11ee0752af1d7ff5b440/versions/constraint.py#L76-L95 | train | Parses a constraint_expression string and returns a : class:`Constraint` object. |
ponty/pyavrutils | pyavrutils/cli/arduino/build.py | warnings | def warnings(filename,
board='pro',
hwpack='arduino',
mcu='',
f_cpu='',
extra_lib='',
ver='',
# home='auto',
backend='arscons',
):
'''
build Arduino sketch and dis... | python | def warnings(filename,
board='pro',
hwpack='arduino',
mcu='',
f_cpu='',
extra_lib='',
ver='',
# home='auto',
backend='arscons',
):
'''
build Arduino sketch and dis... | [
"def",
"warnings",
"(",
"filename",
",",
"board",
"=",
"'pro'",
",",
"hwpack",
"=",
"'arduino'",
",",
"mcu",
"=",
"''",
",",
"f_cpu",
"=",
"''",
",",
"extra_lib",
"=",
"''",
",",
"ver",
"=",
"''",
",",
"# home='auto',",
"backend",
"=",
... | build Arduino sketch and display results | [
"build",
"Arduino",
"sketch",
"and",
"display",
"results"
] | 7a396a25b3ac076ede07b5cd5cbd416ebb578a28 | https://github.com/ponty/pyavrutils/blob/7a396a25b3ac076ede07b5cd5cbd416ebb578a28/pyavrutils/cli/arduino/build.py#L7-L64 | train | prints out the warnings of the current language |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttscene.py | XGanttScene.dateAt | def dateAt(self, x):
"""
Returns the date at the inputed x position.
:return <QDate>
"""
gantt = self.ganttWidget()
dstart = gantt.dateStart()
days = int(x / float(gantt.cellWidth()))
return dstart.addDays(... | python | def dateAt(self, x):
"""
Returns the date at the inputed x position.
:return <QDate>
"""
gantt = self.ganttWidget()
dstart = gantt.dateStart()
days = int(x / float(gantt.cellWidth()))
return dstart.addDays(... | [
"def",
"dateAt",
"(",
"self",
",",
"x",
")",
":",
"gantt",
"=",
"self",
".",
"ganttWidget",
"(",
")",
"dstart",
"=",
"gantt",
".",
"dateStart",
"(",
")",
"days",
"=",
"int",
"(",
"x",
"/",
"float",
"(",
"gantt",
".",
"cellWidth",
"(",
")",
")",
... | Returns the date at the inputed x position.
:return <QDate> | [
"Returns",
"the",
"date",
"at",
"the",
"inputed",
"x",
"position",
".",
":",
"return",
"<QDate",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttscene.py#L58-L68 | train | Returns the date at the inputed x position. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttscene.py | XGanttScene.datetimeAt | def datetimeAt(self, x):
"""
Returns the datetime at the inputed x position.
:return <QDateTime>
"""
gantt = self.ganttWidget()
dstart = gantt.dateTimeStart()
distance = int(x / float(gantt.cellWidth()))
# calculate the time... | python | def datetimeAt(self, x):
"""
Returns the datetime at the inputed x position.
:return <QDateTime>
"""
gantt = self.ganttWidget()
dstart = gantt.dateTimeStart()
distance = int(x / float(gantt.cellWidth()))
# calculate the time... | [
"def",
"datetimeAt",
"(",
"self",
",",
"x",
")",
":",
"gantt",
"=",
"self",
".",
"ganttWidget",
"(",
")",
"dstart",
"=",
"gantt",
".",
"dateTimeStart",
"(",
")",
"distance",
"=",
"int",
"(",
"x",
"/",
"float",
"(",
"gantt",
".",
"cellWidth",
"(",
"... | Returns the datetime at the inputed x position.
:return <QDateTime> | [
"Returns",
"the",
"datetime",
"at",
"the",
"inputed",
"x",
"position",
".",
":",
"return",
"<QDateTime",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttscene.py#L70-L96 | train | Returns the datetime at the inputed x position. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttscene.py | XGanttScene.dateXPos | def dateXPos(self, date):
"""
Returns the x-position for the inputed date.
:return <int>
"""
gantt = self.ganttWidget()
distance = gantt.dateStart().daysTo(date)
return gantt.cellWidth() * distance | python | def dateXPos(self, date):
"""
Returns the x-position for the inputed date.
:return <int>
"""
gantt = self.ganttWidget()
distance = gantt.dateStart().daysTo(date)
return gantt.cellWidth() * distance | [
"def",
"dateXPos",
"(",
"self",
",",
"date",
")",
":",
"gantt",
"=",
"self",
".",
"ganttWidget",
"(",
")",
"distance",
"=",
"gantt",
".",
"dateStart",
"(",
")",
".",
"daysTo",
"(",
"date",
")",
"return",
"gantt",
".",
"cellWidth",
"(",
")",
"*",
"d... | Returns the x-position for the inputed date.
:return <int> | [
"Returns",
"the",
"x",
"-",
"position",
"for",
"the",
"inputed",
"date",
".",
":",
"return",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttscene.py#L98-L106 | train | Returns the x - position of the inputed date. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttscene.py | XGanttScene.datetimeXPos | def datetimeXPos(self, dtime):
"""
Returns the x-position for the inputed date time.
:return <float>
"""
gantt = self.ganttWidget()
scale = gantt.timescale()
# calculate the distance for a minute
if scale == gantt.Timescale.... | python | def datetimeXPos(self, dtime):
"""
Returns the x-position for the inputed date time.
:return <float>
"""
gantt = self.ganttWidget()
scale = gantt.timescale()
# calculate the distance for a minute
if scale == gantt.Timescale.... | [
"def",
"datetimeXPos",
"(",
"self",
",",
"dtime",
")",
":",
"gantt",
"=",
"self",
".",
"ganttWidget",
"(",
")",
"scale",
"=",
"gantt",
".",
"timescale",
"(",
")",
"# calculate the distance for a minute\r",
"if",
"scale",
"==",
"gantt",
".",
"Timescale",
".",... | Returns the x-position for the inputed date time.
:return <float> | [
"Returns",
"the",
"x",
"-",
"position",
"for",
"the",
"inputed",
"date",
"time",
".",
":",
"return",
"<float",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttscene.py#L108-L137 | train | Returns the x - position of the inputed date time. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttscene.py | XGanttScene.drawForeground | def drawForeground(self, painter, rect):
"""
Draws the foreground for this scene.
:param painter | <QPainter>
rect | <QRect>
"""
gantt = self.ganttWidget()
header = gantt.treeWidget().header()
width = self.sceneRect(... | python | def drawForeground(self, painter, rect):
"""
Draws the foreground for this scene.
:param painter | <QPainter>
rect | <QRect>
"""
gantt = self.ganttWidget()
header = gantt.treeWidget().header()
width = self.sceneRect(... | [
"def",
"drawForeground",
"(",
"self",
",",
"painter",
",",
"rect",
")",
":",
"gantt",
"=",
"self",
".",
"ganttWidget",
"(",
")",
"header",
"=",
"gantt",
".",
"treeWidget",
"(",
")",
".",
"header",
"(",
")",
"width",
"=",
"self",
".",
"sceneRect",
"("... | Draws the foreground for this scene.
:param painter | <QPainter>
rect | <QRect> | [
"Draws",
"the",
"foreground",
"for",
"this",
"scene",
".",
":",
"param",
"painter",
"|",
"<QPainter",
">",
"rect",
"|",
"<QRect",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttscene.py#L139-L157 | train | Draws the foreground for this scene. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttscene.py | XGanttScene.drawBackground | def drawBackground(self, painter, rect):
"""
Draws the background for this scene.
:param painter | <QPainter>
rect | <QRect>
"""
if self._dirty:
self.rebuild()
# draw the alternating rects
gantt ... | python | def drawBackground(self, painter, rect):
"""
Draws the background for this scene.
:param painter | <QPainter>
rect | <QRect>
"""
if self._dirty:
self.rebuild()
# draw the alternating rects
gantt ... | [
"def",
"drawBackground",
"(",
"self",
",",
"painter",
",",
"rect",
")",
":",
"if",
"self",
".",
"_dirty",
":",
"self",
".",
"rebuild",
"(",
")",
"# draw the alternating rects\r",
"gantt",
"=",
"self",
".",
"ganttWidget",
"(",
")",
"# draw the alternating rects... | Draws the background for this scene.
:param painter | <QPainter>
rect | <QRect> | [
"Draws",
"the",
"background",
"for",
"this",
"scene",
".",
":",
"param",
"painter",
"|",
"<QPainter",
">",
"rect",
"|",
"<QRect",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttscene.py#L224-L250 | train | Draws the background for the current date. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttscene.py | XGanttScene.rebuild | def rebuild(self):
"""
Rebuilds the scene based on the current settings.
:param start | <QDate>
end | <QDate>
"""
gantt = self.ganttWidget()
scale = gantt.timescale()
rect = self.sceneRect()
header = gantt.tree... | python | def rebuild(self):
"""
Rebuilds the scene based on the current settings.
:param start | <QDate>
end | <QDate>
"""
gantt = self.ganttWidget()
scale = gantt.timescale()
rect = self.sceneRect()
header = gantt.tree... | [
"def",
"rebuild",
"(",
"self",
")",
":",
"gantt",
"=",
"self",
".",
"ganttWidget",
"(",
")",
"scale",
"=",
"gantt",
".",
"timescale",
"(",
")",
"rect",
"=",
"self",
".",
"sceneRect",
"(",
")",
"header",
"=",
"gantt",
".",
"treeWidget",
"(",
")",
".... | Rebuilds the scene based on the current settings.
:param start | <QDate>
end | <QDate> | [
"Rebuilds",
"the",
"scene",
"based",
"on",
"the",
"current",
"settings",
".",
":",
"param",
"start",
"|",
"<QDate",
">",
"end",
"|",
"<QDate",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttscene.py#L268-L310 | train | Rebuilds the scene based on the current settings. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttscene.py | XGanttScene.rebuildDay | def rebuildDay(self, opt):
"""
Rebuilds the scale for the day mode.
:param opt | <XGanttRenderOptions>
"""
self._labels = []
self._hlines = []
self._vlines = []
self._weekendRects = []
s... | python | def rebuildDay(self, opt):
"""
Rebuilds the scale for the day mode.
:param opt | <XGanttRenderOptions>
"""
self._labels = []
self._hlines = []
self._vlines = []
self._weekendRects = []
s... | [
"def",
"rebuildDay",
"(",
"self",
",",
"opt",
")",
":",
"self",
".",
"_labels",
"=",
"[",
"]",
"self",
".",
"_hlines",
"=",
"[",
"]",
"self",
".",
"_vlines",
"=",
"[",
"]",
"self",
".",
"_weekendRects",
"=",
"[",
"]",
"self",
".",
"_alternateRects"... | Rebuilds the scale for the day mode.
:param opt | <XGanttRenderOptions> | [
"Rebuilds",
"the",
"scale",
"for",
"the",
"day",
"mode",
".",
":",
"param",
"opt",
"|",
"<XGanttRenderOptions",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttscene.py#L312-L391 | train | Rebuilds the scale for the day mode. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttscene.py | XGanttScene.setDayWidth | def setDayWidth(self, width):
"""
Sets the day width that will be used for drawing this gantt widget.
:param width | <int>
"""
self._dayWidth = width
start = self.ganttWidget().dateStart()
end = self.ganttWidget().dateEnd()
... | python | def setDayWidth(self, width):
"""
Sets the day width that will be used for drawing this gantt widget.
:param width | <int>
"""
self._dayWidth = width
start = self.ganttWidget().dateStart()
end = self.ganttWidget().dateEnd()
... | [
"def",
"setDayWidth",
"(",
"self",
",",
"width",
")",
":",
"self",
".",
"_dayWidth",
"=",
"width",
"start",
"=",
"self",
".",
"ganttWidget",
"(",
")",
".",
"dateStart",
"(",
")",
"end",
"=",
"self",
".",
"ganttWidget",
"(",
")",
".",
"dateEnd",
"(",
... | Sets the day width that will be used for drawing this gantt widget.
:param width | <int> | [
"Sets",
"the",
"day",
"width",
"that",
"will",
"be",
"used",
"for",
"drawing",
"this",
"gantt",
"widget",
".",
":",
"param",
"width",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttscene.py#L563-L574 | train | Sets the day width that will be used for drawing this gantt widget. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttscene.py | XGanttScene.setSceneRect | def setSceneRect(self, *args):
"""
Overloads the set rect method to signal that the scene needs to be
rebuilt.
:param args | <arg variant>
"""
curr = self.sceneRect()
super(XGanttScene, self).setSceneRect(*args)
... | python | def setSceneRect(self, *args):
"""
Overloads the set rect method to signal that the scene needs to be
rebuilt.
:param args | <arg variant>
"""
curr = self.sceneRect()
super(XGanttScene, self).setSceneRect(*args)
... | [
"def",
"setSceneRect",
"(",
"self",
",",
"*",
"args",
")",
":",
"curr",
"=",
"self",
".",
"sceneRect",
"(",
")",
"super",
"(",
"XGanttScene",
",",
"self",
")",
".",
"setSceneRect",
"(",
"*",
"args",
")",
"if",
"curr",
"!=",
"QRectF",
"(",
"*",
"arg... | Overloads the set rect method to signal that the scene needs to be
rebuilt.
:param args | <arg variant> | [
"Overloads",
"the",
"set",
"rect",
"method",
"to",
"signal",
"that",
"the",
"scene",
"needs",
"to",
"be",
"rebuilt",
".",
":",
"param",
"args",
"|",
"<arg",
"variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttscene.py#L585-L597 | train | Overloads the setSceneRect method to signal that the scene is rebuilt. |
bitesofcode/projexui | projexui/dialogs/xshortcutdialog/xshortcutdialog.py | XShortcutDialog.accept | def accept( self ):
"""
Saves the current settings for the actions in the list and exits the
dialog.
"""
if ( not self.save() ):
return
for i in range(self.uiActionTREE.topLevelItemCount()):
item = self.uiActionTREE.topLevelItem(i)
... | python | def accept( self ):
"""
Saves the current settings for the actions in the list and exits the
dialog.
"""
if ( not self.save() ):
return
for i in range(self.uiActionTREE.topLevelItemCount()):
item = self.uiActionTREE.topLevelItem(i)
... | [
"def",
"accept",
"(",
"self",
")",
":",
"if",
"(",
"not",
"self",
".",
"save",
"(",
")",
")",
":",
"return",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"uiActionTREE",
".",
"topLevelItemCount",
"(",
")",
")",
":",
"item",
"=",
"self",
".",
"uiA... | Saves the current settings for the actions in the list and exits the
dialog. | [
"Saves",
"the",
"current",
"settings",
"for",
"the",
"actions",
"in",
"the",
"list",
"and",
"exits",
"the",
"dialog",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xshortcutdialog/xshortcutdialog.py#L77-L90 | train | Saves the current settings for the actions in the list and exits the dialog. |
bitesofcode/projexui | projexui/dialogs/xshortcutdialog/xshortcutdialog.py | XShortcutDialog.actions | def actions( self ):
"""
Returns a list of actions that are associated with this shortcut edit.
:return [<QAction>, ..]
"""
output = []
for i in range(self.uiActionTREE.topLevelItemCount()):
output.append(self.uiActionTREE.topLevelItem(i).action()... | python | def actions( self ):
"""
Returns a list of actions that are associated with this shortcut edit.
:return [<QAction>, ..]
"""
output = []
for i in range(self.uiActionTREE.topLevelItemCount()):
output.append(self.uiActionTREE.topLevelItem(i).action()... | [
"def",
"actions",
"(",
"self",
")",
":",
"output",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"uiActionTREE",
".",
"topLevelItemCount",
"(",
")",
")",
":",
"output",
".",
"append",
"(",
"self",
".",
"uiActionTREE",
".",
"topLevelItem",... | Returns a list of actions that are associated with this shortcut edit.
:return [<QAction>, ..] | [
"Returns",
"a",
"list",
"of",
"actions",
"that",
"are",
"associated",
"with",
"this",
"shortcut",
"edit",
".",
":",
"return",
"[",
"<QAction",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xshortcutdialog/xshortcutdialog.py#L92-L101 | train | Returns a list of actions that are associated with this shortcut edit. |
bitesofcode/projexui | projexui/dialogs/xshortcutdialog/xshortcutdialog.py | XShortcutDialog.clear | def clear( self ):
"""
Clears the current settings for the current action.
"""
item = self.uiActionTREE.currentItem()
if ( not item ):
return
self.uiShortcutTXT.setText('')
item.setText(1, '') | python | def clear( self ):
"""
Clears the current settings for the current action.
"""
item = self.uiActionTREE.currentItem()
if ( not item ):
return
self.uiShortcutTXT.setText('')
item.setText(1, '') | [
"def",
"clear",
"(",
"self",
")",
":",
"item",
"=",
"self",
".",
"uiActionTREE",
".",
"currentItem",
"(",
")",
"if",
"(",
"not",
"item",
")",
":",
"return",
"self",
".",
"uiShortcutTXT",
".",
"setText",
"(",
"''",
")",
"item",
".",
"setText",
"(",
... | Clears the current settings for the current action. | [
"Clears",
"the",
"current",
"settings",
"for",
"the",
"current",
"action",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xshortcutdialog/xshortcutdialog.py#L103-L112 | train | Clears the current settings for the current action. |
bitesofcode/projexui | projexui/dialogs/xshortcutdialog/xshortcutdialog.py | XShortcutDialog.eventFilter | def eventFilter( self, object, event ):
"""
Filters out key press events for the shortcut section for this edit.
:param object | <QObject>
event | <QEvent>
"""
if ( object != self.uiShortcutTXT ):
return False
if... | python | def eventFilter( self, object, event ):
"""
Filters out key press events for the shortcut section for this edit.
:param object | <QObject>
event | <QEvent>
"""
if ( object != self.uiShortcutTXT ):
return False
if... | [
"def",
"eventFilter",
"(",
"self",
",",
"object",
",",
"event",
")",
":",
"if",
"(",
"object",
"!=",
"self",
".",
"uiShortcutTXT",
")",
":",
"return",
"False",
"if",
"(",
"event",
".",
"type",
"(",
")",
"==",
"event",
".",
"KeyPress",
")",
":",
"se... | Filters out key press events for the shortcut section for this edit.
:param object | <QObject>
event | <QEvent> | [
"Filters",
"out",
"key",
"press",
"events",
"for",
"the",
"shortcut",
"section",
"for",
"this",
"edit",
".",
":",
"param",
"object",
"|",
"<QObject",
">",
"event",
"|",
"<QEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xshortcutdialog/xshortcutdialog.py#L114-L132 | train | Filter out key press events for the shortcut section for this edit. |
bitesofcode/projexui | projexui/dialogs/xshortcutdialog/xshortcutdialog.py | XShortcutDialog.setActions | def setActions( self, actions ):
"""
Sets the list of actions that will be used for this shortcut dialog \
when editing.
:param actions | [<QAction>, ..]
"""
self.uiActionTREE.blockSignals(True)
self.uiActionTREE.setUpdatesEnabled(False)
... | python | def setActions( self, actions ):
"""
Sets the list of actions that will be used for this shortcut dialog \
when editing.
:param actions | [<QAction>, ..]
"""
self.uiActionTREE.blockSignals(True)
self.uiActionTREE.setUpdatesEnabled(False)
... | [
"def",
"setActions",
"(",
"self",
",",
"actions",
")",
":",
"self",
".",
"uiActionTREE",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"uiActionTREE",
".",
"setUpdatesEnabled",
"(",
"False",
")",
"self",
".",
"uiActionTREE",
".",
"clear",
"(",
")",
... | Sets the list of actions that will be used for this shortcut dialog \
when editing.
:param actions | [<QAction>, ..] | [
"Sets",
"the",
"list",
"of",
"actions",
"that",
"will",
"be",
"used",
"for",
"this",
"shortcut",
"dialog",
"\\",
"when",
"editing",
".",
":",
"param",
"actions",
"|",
"[",
"<QAction",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xshortcutdialog/xshortcutdialog.py#L163-L179 | train | Sets the list of actions that will be used for this shortcut dialog when editing. |
bitesofcode/projexui | projexui/dialogs/xshortcutdialog/xshortcutdialog.py | XShortcutDialog.updateAction | def updateAction( self ):
"""
Updates the action to edit based on the current item.
"""
item = self.uiActionTREE.currentItem()
if ( item ):
action = item.action()
else:
action = QAction()
self.uiShortcutTXT.setText(action.short... | python | def updateAction( self ):
"""
Updates the action to edit based on the current item.
"""
item = self.uiActionTREE.currentItem()
if ( item ):
action = item.action()
else:
action = QAction()
self.uiShortcutTXT.setText(action.short... | [
"def",
"updateAction",
"(",
"self",
")",
":",
"item",
"=",
"self",
".",
"uiActionTREE",
".",
"currentItem",
"(",
")",
"if",
"(",
"item",
")",
":",
"action",
"=",
"item",
".",
"action",
"(",
")",
"else",
":",
"action",
"=",
"QAction",
"(",
")",
"sel... | Updates the action to edit based on the current item. | [
"Updates",
"the",
"action",
"to",
"edit",
"based",
"on",
"the",
"current",
"item",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xshortcutdialog/xshortcutdialog.py#L181-L191 | train | Updates the action to edit based on the current item. |
bitesofcode/projexui | projexui/dialogs/xkeyvaluedialog.py | XKeyValueDialog.edit | def edit( key = '', value = '', parent = None ):
"""
Prompts the user to edit the inputed key/value pairing.
:param key | <str>
value | <str>
parent | <QWidget>
:return (<bool> accepted, <str> key, <str> value)
... | python | def edit( key = '', value = '', parent = None ):
"""
Prompts the user to edit the inputed key/value pairing.
:param key | <str>
value | <str>
parent | <QWidget>
:return (<bool> accepted, <str> key, <str> value)
... | [
"def",
"edit",
"(",
"key",
"=",
"''",
",",
"value",
"=",
"''",
",",
"parent",
"=",
"None",
")",
":",
"dlg",
"=",
"XKeyValueDialog",
"(",
"parent",
")",
"dlg",
".",
"setKey",
"(",
"key",
")",
"dlg",
".",
"setValue",
"(",
"value",
")",
"if",
"(",
... | Prompts the user to edit the inputed key/value pairing.
:param key | <str>
value | <str>
parent | <QWidget>
:return (<bool> accepted, <str> key, <str> value) | [
"Prompts",
"the",
"user",
"to",
"edit",
"the",
"inputed",
"key",
"/",
"value",
"pairing",
".",
":",
"param",
"key",
"|",
"<str",
">",
"value",
"|",
"<str",
">",
"parent",
"|",
"<QWidget",
">",
":",
"return",
"(",
"<bool",
">",
"accepted",
"<str",
">"... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xkeyvaluedialog.py#L95-L112 | train | Prompts the user to edit the inputed key value pairing. |
bitesofcode/projexui | projexui/widgets/xchart/renderers/xlinerenderer.py | XLineRenderer.calculateDatasets | def calculateDatasets(self, scene, axes, datasets):
"""
Builds the datasets for this renderer. Each renderer will need to
subclass and implemenent this method, otherwise, no data will be
shown in the chart.
:param scene | <XChartScene>
ax... | python | def calculateDatasets(self, scene, axes, datasets):
"""
Builds the datasets for this renderer. Each renderer will need to
subclass and implemenent this method, otherwise, no data will be
shown in the chart.
:param scene | <XChartScene>
ax... | [
"def",
"calculateDatasets",
"(",
"self",
",",
"scene",
",",
"axes",
",",
"datasets",
")",
":",
"items",
"=",
"self",
".",
"calculateDatasetItems",
"(",
"scene",
",",
"datasets",
")",
"if",
"not",
"items",
":",
"scene",
".",
"clear",
"(",
")",
"return",
... | Builds the datasets for this renderer. Each renderer will need to
subclass and implemenent this method, otherwise, no data will be
shown in the chart.
:param scene | <XChartScene>
axes | [<
datasets | [<XChartDataset>, ..] | [
"Builds",
"the",
"datasets",
"for",
"this",
"renderer",
".",
"Each",
"renderer",
"will",
"need",
"to",
"subclass",
"and",
"implemenent",
"this",
"method",
"otherwise",
"no",
"data",
"will",
"be",
"shown",
"in",
"the",
"chart",
".",
":",
"param",
"scene",
"... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/renderers/xlinerenderer.py#L34-L69 | train | Calculates the datasets for this renderer. |
bitesofcode/projexui | projexui/widgets/xchart/renderers/xlinerenderer.py | XLineRenderer.drawItem | def drawItem(self, item, painter, option):
"""
Draws the inputed item as a bar graph.
:param item | <XChartDatasetItem>
painter | <QPainter>
option | <QStyleOptionGraphicsItem>
"""
dataset = item.dataset()
... | python | def drawItem(self, item, painter, option):
"""
Draws the inputed item as a bar graph.
:param item | <XChartDatasetItem>
painter | <QPainter>
option | <QStyleOptionGraphicsItem>
"""
dataset = item.dataset()
... | [
"def",
"drawItem",
"(",
"self",
",",
"item",
",",
"painter",
",",
"option",
")",
":",
"dataset",
"=",
"item",
".",
"dataset",
"(",
")",
"painter",
".",
"save",
"(",
")",
"painter",
".",
"setRenderHint",
"(",
"painter",
".",
"Antialiasing",
")",
"pen",
... | Draws the inputed item as a bar graph.
:param item | <XChartDatasetItem>
painter | <QPainter>
option | <QStyleOptionGraphicsItem> | [
"Draws",
"the",
"inputed",
"item",
"as",
"a",
"bar",
"graph",
".",
":",
"param",
"item",
"|",
"<XChartDatasetItem",
">",
"painter",
"|",
"<QPainter",
">",
"option",
"|",
"<QStyleOptionGraphicsItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/renderers/xlinerenderer.py#L71-L103 | train | Draws the item as a bar graph. |
damnit/pymite | pymite/utils.py | declassify | def declassify(to_remove, *args, **kwargs):
""" flatten the return values of the mite api.
"""
def argdecorate(fn):
""" enable the to_remove argument to the decorator. """
# wrap the function to get the original docstring
@wraps(fn)
def declassed(*args, **kwargs):
... | python | def declassify(to_remove, *args, **kwargs):
""" flatten the return values of the mite api.
"""
def argdecorate(fn):
""" enable the to_remove argument to the decorator. """
# wrap the function to get the original docstring
@wraps(fn)
def declassed(*args, **kwargs):
... | [
"def",
"declassify",
"(",
"to_remove",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"def",
"argdecorate",
"(",
"fn",
")",
":",
"\"\"\" enable the to_remove argument to the decorator. \"\"\"",
"# wrap the function to get the original docstring",
"@",
"wraps",
"("... | flatten the return values of the mite api. | [
"flatten",
"the",
"return",
"values",
"of",
"the",
"mite",
"api",
"."
] | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/utils.py#L13-L32 | train | Decorator to declassify a function to return a list of the neccesary items in the neccesary order. |
damnit/pymite | pymite/utils.py | clean_dict | def clean_dict(d):
""" remove the keys with None values. """
ktd = list()
for k, v in d.items():
if not v:
ktd.append(k)
elif type(v) is dict:
d[k] = clean_dict(v)
for k in ktd:
d.pop(k)
return d | python | def clean_dict(d):
""" remove the keys with None values. """
ktd = list()
for k, v in d.items():
if not v:
ktd.append(k)
elif type(v) is dict:
d[k] = clean_dict(v)
for k in ktd:
d.pop(k)
return d | [
"def",
"clean_dict",
"(",
"d",
")",
":",
"ktd",
"=",
"list",
"(",
")",
"for",
"k",
",",
"v",
"in",
"d",
".",
"items",
"(",
")",
":",
"if",
"not",
"v",
":",
"ktd",
".",
"append",
"(",
"k",
")",
"elif",
"type",
"(",
"v",
")",
"is",
"dict",
... | remove the keys with None values. | [
"remove",
"the",
"keys",
"with",
"None",
"values",
"."
] | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/utils.py#L35-L45 | train | Remove the keys with None values. |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xqueryrule.py | XQueryRule.defineOperator | def defineOperator( self, operator, widget = -1 ):
"""
Adds a new operator for this rule. If widget is supplied as -1, then \
a QLineEdit will be used by default.
:param operator | <str>
widget | <subclass of QWidget> || None || -1
"""
... | python | def defineOperator( self, operator, widget = -1 ):
"""
Adds a new operator for this rule. If widget is supplied as -1, then \
a QLineEdit will be used by default.
:param operator | <str>
widget | <subclass of QWidget> || None || -1
"""
... | [
"def",
"defineOperator",
"(",
"self",
",",
"operator",
",",
"widget",
"=",
"-",
"1",
")",
":",
"if",
"(",
"widget",
"==",
"-",
"1",
")",
":",
"widget",
"=",
"QLineEdit",
"self",
".",
"_operators",
"[",
"nativestring",
"(",
"operator",
")",
"]",
"=",
... | Adds a new operator for this rule. If widget is supplied as -1, then \
a QLineEdit will be used by default.
:param operator | <str>
widget | <subclass of QWidget> || None || -1 | [
"Adds",
"a",
"new",
"operator",
"for",
"this",
"rule",
".",
"If",
"widget",
"is",
"supplied",
"as",
"-",
"1",
"then",
"\\",
"a",
"QLineEdit",
"will",
"be",
"used",
"by",
"default",
".",
":",
"param",
"operator",
"|",
"<str",
">",
"widget",
"|",
"<sub... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xqueryrule.py#L46-L57 | train | Adds a new operator for this rule. |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xqueryrule.py | XQueryRule.operatorLabel | def operatorLabel( self, operator ):
"""
Returns the label for the inputed operator.
:return <str>
"""
for key, value in self._operatorMap.items():
if ( value == operator ):
return key
return operator | python | def operatorLabel( self, operator ):
"""
Returns the label for the inputed operator.
:return <str>
"""
for key, value in self._operatorMap.items():
if ( value == operator ):
return key
return operator | [
"def",
"operatorLabel",
"(",
"self",
",",
"operator",
")",
":",
"for",
"key",
",",
"value",
"in",
"self",
".",
"_operatorMap",
".",
"items",
"(",
")",
":",
"if",
"(",
"value",
"==",
"operator",
")",
":",
"return",
"key",
"return",
"operator"
] | Returns the label for the inputed operator.
:return <str> | [
"Returns",
"the",
"label",
"for",
"the",
"inputed",
"operator",
".",
":",
"return",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xqueryrule.py#L108-L117 | train | Returns the label for the inputed operator. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnItem.load | def load(self):
"""
Loads the children for this item.
"""
if self._loaded:
return
self.setChildIndicatorPolicy(self.DontShowIndicatorWhenChildless)
self._loaded = True
column = self.schemaColumn()
if not column.isRe... | python | def load(self):
"""
Loads the children for this item.
"""
if self._loaded:
return
self.setChildIndicatorPolicy(self.DontShowIndicatorWhenChildless)
self._loaded = True
column = self.schemaColumn()
if not column.isRe... | [
"def",
"load",
"(",
"self",
")",
":",
"if",
"self",
".",
"_loaded",
":",
"return",
"self",
".",
"setChildIndicatorPolicy",
"(",
"self",
".",
"DontShowIndicatorWhenChildless",
")",
"self",
".",
"_loaded",
"=",
"True",
"column",
"=",
"self",
".",
"schemaColumn... | Loads the children for this item. | [
"Loads",
"the",
"children",
"for",
"this",
"item",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L49-L70 | train | Loads the children for this item. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnItem.setCurrentSchemaColumn | def setCurrentSchemaColumn(self, column):
"""
Sets the current item based on the inputed column.
:param column | <orb.Column> || None
"""
if column == self._column:
self.treeWidget().setCurrentItem(self)
return True
... | python | def setCurrentSchemaColumn(self, column):
"""
Sets the current item based on the inputed column.
:param column | <orb.Column> || None
"""
if column == self._column:
self.treeWidget().setCurrentItem(self)
return True
... | [
"def",
"setCurrentSchemaColumn",
"(",
"self",
",",
"column",
")",
":",
"if",
"column",
"==",
"self",
".",
"_column",
":",
"self",
".",
"treeWidget",
"(",
")",
".",
"setCurrentItem",
"(",
"self",
")",
"return",
"True",
"for",
"c",
"in",
"range",
"(",
"s... | Sets the current item based on the inputed column.
:param column | <orb.Column> || None | [
"Sets",
"the",
"current",
"item",
"based",
"on",
"the",
"inputed",
"column",
".",
":",
"param",
"column",
"|",
"<orb",
".",
"Column",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L80-L94 | train | Sets the current item based on the inputed column. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnItem.setCurrentSchemaPath | def setCurrentSchemaPath(self, path):
"""
Sets the current item based on the inputed column.
:param path | <str>
"""
if not path:
return False
parts = path.split('.')
name = parts[0]
next = parts[1:]
... | python | def setCurrentSchemaPath(self, path):
"""
Sets the current item based on the inputed column.
:param path | <str>
"""
if not path:
return False
parts = path.split('.')
name = parts[0]
next = parts[1:]
... | [
"def",
"setCurrentSchemaPath",
"(",
"self",
",",
"path",
")",
":",
"if",
"not",
"path",
":",
"return",
"False",
"parts",
"=",
"path",
".",
"split",
"(",
"'.'",
")",
"name",
"=",
"parts",
"[",
"0",
"]",
"next",
"=",
"parts",
"[",
"1",
":",
"]",
"i... | Sets the current item based on the inputed column.
:param path | <str> | [
"Sets",
"the",
"current",
"item",
"based",
"on",
"the",
"inputed",
"column",
".",
":",
"param",
"path",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L96-L121 | train | Sets the current item based on the inputed column. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnNavigator.currentSchemaPath | def currentSchemaPath(self):
"""
Returns the column path for the current item. This will be a '.'
joined path based on the root schema to the given column.
:return <str>
"""
item = self.currentItem()
path = []
while item:
... | python | def currentSchemaPath(self):
"""
Returns the column path for the current item. This will be a '.'
joined path based on the root schema to the given column.
:return <str>
"""
item = self.currentItem()
path = []
while item:
... | [
"def",
"currentSchemaPath",
"(",
"self",
")",
":",
"item",
"=",
"self",
".",
"currentItem",
"(",
")",
"path",
"=",
"[",
"]",
"while",
"item",
":",
"path",
".",
"append",
"(",
"nativestring",
"(",
"item",
".",
"text",
"(",
"0",
")",
")",
")",
"item"... | Returns the column path for the current item. This will be a '.'
joined path based on the root schema to the given column.
:return <str> | [
"Returns",
"the",
"column",
"path",
"for",
"the",
"current",
"item",
".",
"This",
"will",
"be",
"a",
".",
"joined",
"path",
"based",
"on",
"the",
"root",
"schema",
"to",
"the",
"given",
"column",
".",
":",
"return",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L155-L168 | train | Returns the path to the current schema. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnNavigator.refresh | def refresh(self):
"""
Resets the data for this navigator.
"""
self.setUpdatesEnabled(False)
self.blockSignals(True)
self.clear()
tableType = self.tableType()
if not tableType:
self.setUpdatesEnabled(True)
self.blockSignal... | python | def refresh(self):
"""
Resets the data for this navigator.
"""
self.setUpdatesEnabled(False)
self.blockSignals(True)
self.clear()
tableType = self.tableType()
if not tableType:
self.setUpdatesEnabled(True)
self.blockSignal... | [
"def",
"refresh",
"(",
"self",
")",
":",
"self",
".",
"setUpdatesEnabled",
"(",
"False",
")",
"self",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"clear",
"(",
")",
"tableType",
"=",
"self",
".",
"tableType",
"(",
")",
"if",
"not",
"tableType",... | Resets the data for this navigator. | [
"Resets",
"the",
"data",
"for",
"this",
"navigator",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L185-L205 | train | Refreshes the data for this navigator. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnNavigator.setCurrentSchemaColumn | def setCurrentSchemaColumn(self, column):
"""
Sets the current column associated with this navigator.
:param column | <orb.Column>
"""
if not column:
self.setCurrentItem(None)
return
for item in self.topLevelItems():... | python | def setCurrentSchemaColumn(self, column):
"""
Sets the current column associated with this navigator.
:param column | <orb.Column>
"""
if not column:
self.setCurrentItem(None)
return
for item in self.topLevelItems():... | [
"def",
"setCurrentSchemaColumn",
"(",
"self",
",",
"column",
")",
":",
"if",
"not",
"column",
":",
"self",
".",
"setCurrentItem",
"(",
"None",
")",
"return",
"for",
"item",
"in",
"self",
".",
"topLevelItems",
"(",
")",
":",
"if",
"item",
".",
"setCurrent... | Sets the current column associated with this navigator.
:param column | <orb.Column> | [
"Sets",
"the",
"current",
"column",
"associated",
"with",
"this",
"navigator",
".",
":",
"param",
"column",
"|",
"<orb",
".",
"Column",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L207-L221 | train | Sets the current column associated with this navigator. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnNavigator.setCurrentSchemaPath | def setCurrentSchemaPath(self, path):
"""
Sets the column path for the current item. This will be a '.'
joined path based on the root schema to the given column.
:param path | <str>
"""
if not path:
self.setCurrentItem(None)
... | python | def setCurrentSchemaPath(self, path):
"""
Sets the column path for the current item. This will be a '.'
joined path based on the root schema to the given column.
:param path | <str>
"""
if not path:
self.setCurrentItem(None)
... | [
"def",
"setCurrentSchemaPath",
"(",
"self",
",",
"path",
")",
":",
"if",
"not",
"path",
":",
"self",
".",
"setCurrentItem",
"(",
"None",
")",
"return",
"False",
"for",
"item",
"in",
"self",
".",
"topLevelItems",
"(",
")",
":",
"if",
"item",
".",
"setCu... | Sets the column path for the current item. This will be a '.'
joined path based on the root schema to the given column.
:param path | <str> | [
"Sets",
"the",
"column",
"path",
"for",
"the",
"current",
"item",
".",
"This",
"will",
"be",
"a",
".",
"joined",
"path",
"based",
"on",
"the",
"root",
"schema",
"to",
"the",
"given",
"column",
".",
":",
"param",
"path",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L223-L239 | train | Sets the column path for the current item. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnNavigatorBox.acceptColumn | def acceptColumn(self):
"""
Accepts the current item as the current column.
"""
self.navigator().hide()
self.lineEdit().setText(self.navigator().currentSchemaPath())
self.emitSchemaColumnChanged(self.navigator().currentColumn()) | python | def acceptColumn(self):
"""
Accepts the current item as the current column.
"""
self.navigator().hide()
self.lineEdit().setText(self.navigator().currentSchemaPath())
self.emitSchemaColumnChanged(self.navigator().currentColumn()) | [
"def",
"acceptColumn",
"(",
"self",
")",
":",
"self",
".",
"navigator",
"(",
")",
".",
"hide",
"(",
")",
"self",
".",
"lineEdit",
"(",
")",
".",
"setText",
"(",
"self",
".",
"navigator",
"(",
")",
".",
"currentSchemaPath",
"(",
")",
")",
"self",
".... | Accepts the current item as the current column. | [
"Accepts",
"the",
"current",
"item",
"as",
"the",
"current",
"column",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L270-L276 | train | Updates the lineEdit to reflect the current column. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnNavigatorBox.emitSchemaColumnChanged | def emitSchemaColumnChanged(self, column):
"""
Emits the current column changed signal.
:param column | <orb.Column> || None
"""
edit = self.lineEdit()
if edit:
edit.setText(self.navigator().currentSchemaPath())
if ... | python | def emitSchemaColumnChanged(self, column):
"""
Emits the current column changed signal.
:param column | <orb.Column> || None
"""
edit = self.lineEdit()
if edit:
edit.setText(self.navigator().currentSchemaPath())
if ... | [
"def",
"emitSchemaColumnChanged",
"(",
"self",
",",
"column",
")",
":",
"edit",
"=",
"self",
".",
"lineEdit",
"(",
")",
"if",
"edit",
":",
"edit",
".",
"setText",
"(",
"self",
".",
"navigator",
"(",
")",
".",
"currentSchemaPath",
"(",
")",
")",
"if",
... | Emits the current column changed signal.
:param column | <orb.Column> || None | [
"Emits",
"the",
"current",
"column",
"changed",
"signal",
".",
":",
"param",
"column",
"|",
"<orb",
".",
"Column",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L298-L309 | train | Emits the current schema path changed signal. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnNavigatorBox.eventFilter | def eventFilter(self, object, event):
"""
Filters events for the popup tree widget.
:param object | <QObject>
event | <QEvent>
:retuen <bool> | consumed
"""
try:
is_lineedit = object == self.lineEdit()
... | python | def eventFilter(self, object, event):
"""
Filters events for the popup tree widget.
:param object | <QObject>
event | <QEvent>
:retuen <bool> | consumed
"""
try:
is_lineedit = object == self.lineEdit()
... | [
"def",
"eventFilter",
"(",
"self",
",",
"object",
",",
"event",
")",
":",
"try",
":",
"is_lineedit",
"=",
"object",
"==",
"self",
".",
"lineEdit",
"(",
")",
"except",
"RuntimeError",
":",
"is_lineedit",
"=",
"False",
"try",
":",
"is_nav",
"=",
"object",
... | Filters events for the popup tree widget.
:param object | <QObject>
event | <QEvent>
:retuen <bool> | consumed | [
"Filters",
"events",
"for",
"the",
"popup",
"tree",
"widget",
".",
":",
"param",
"object",
"|",
"<QObject",
">",
"event",
"|",
"<QEvent",
">",
":",
"retuen",
"<bool",
">",
"|",
"consumed"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L311-L373 | train | Filter events for the popup tree widget. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnNavigatorBox.navigator | def navigator(self):
"""
Returns the navigator associated with this box.
:return <XOrbColumnNavigator>
"""
if self._navigator is None:
self._navigator = nav = XOrbColumnNavigator()
self.lineEdit().setCompleter(None)
... | python | def navigator(self):
"""
Returns the navigator associated with this box.
:return <XOrbColumnNavigator>
"""
if self._navigator is None:
self._navigator = nav = XOrbColumnNavigator()
self.lineEdit().setCompleter(None)
... | [
"def",
"navigator",
"(",
"self",
")",
":",
"if",
"self",
".",
"_navigator",
"is",
"None",
":",
"self",
".",
"_navigator",
"=",
"nav",
"=",
"XOrbColumnNavigator",
"(",
")",
"self",
".",
"lineEdit",
"(",
")",
".",
"setCompleter",
"(",
"None",
")",
"# ini... | Returns the navigator associated with this box.
:return <XOrbColumnNavigator> | [
"Returns",
"the",
"navigator",
"associated",
"with",
"this",
"box",
".",
":",
"return",
"<XOrbColumnNavigator",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L382-L405 | train | Returns the navigator associated with this box. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnNavigatorBox.setTableType | def setTableType(self, tableType):
"""
Sets the table type associated with this navigator.
:param tableType | <subclass of orb.Table>
"""
self.navigator().setTableType(tableType)
completer = XJoinCompleter(self.navigator().model(), self)
comp... | python | def setTableType(self, tableType):
"""
Sets the table type associated with this navigator.
:param tableType | <subclass of orb.Table>
"""
self.navigator().setTableType(tableType)
completer = XJoinCompleter(self.navigator().model(), self)
comp... | [
"def",
"setTableType",
"(",
"self",
",",
"tableType",
")",
":",
"self",
".",
"navigator",
"(",
")",
".",
"setTableType",
"(",
"tableType",
")",
"completer",
"=",
"XJoinCompleter",
"(",
"self",
".",
"navigator",
"(",
")",
".",
"model",
"(",
")",
",",
"s... | Sets the table type associated with this navigator.
:param tableType | <subclass of orb.Table> | [
"Sets",
"the",
"table",
"type",
"associated",
"with",
"this",
"navigator",
".",
":",
"param",
"tableType",
"|",
"<subclass",
"of",
"orb",
".",
"Table",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L417-L426 | train | Sets the table type associated with this navigator. |
bitesofcode/projexui | projexui/widgets/xorbcolumnnavigator.py | XOrbColumnNavigatorBox.showPopup | def showPopup(self):
"""
Displays the popup associated with this navigator.
"""
nav = self.navigator()
nav.move(self.mapToGlobal(QPoint(0, self.height())))
nav.resize(400, 250)
nav.show() | python | def showPopup(self):
"""
Displays the popup associated with this navigator.
"""
nav = self.navigator()
nav.move(self.mapToGlobal(QPoint(0, self.height())))
nav.resize(400, 250)
nav.show() | [
"def",
"showPopup",
"(",
"self",
")",
":",
"nav",
"=",
"self",
".",
"navigator",
"(",
")",
"nav",
".",
"move",
"(",
"self",
".",
"mapToGlobal",
"(",
"QPoint",
"(",
"0",
",",
"self",
".",
"height",
"(",
")",
")",
")",
")",
"nav",
".",
"resize",
... | Displays the popup associated with this navigator. | [
"Displays",
"the",
"popup",
"associated",
"with",
"this",
"navigator",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnnavigator.py#L428-L436 | train | Displays the popup associated with this navigator. |
bitesofcode/projexui | projexui/widgets/xchart/axes/xnumberaxis.py | XNumberAxis.calculateRange | def calculateRange(self, values):
"""
Calculates the range of values for this axis based on the dataset
value amount.
:param values | [<variant>, ..]
"""
vals = filter(lambda x: x is not None, values)
try:
min_val = min... | python | def calculateRange(self, values):
"""
Calculates the range of values for this axis based on the dataset
value amount.
:param values | [<variant>, ..]
"""
vals = filter(lambda x: x is not None, values)
try:
min_val = min... | [
"def",
"calculateRange",
"(",
"self",
",",
"values",
")",
":",
"vals",
"=",
"filter",
"(",
"lambda",
"x",
":",
"x",
"is",
"not",
"None",
",",
"values",
")",
"try",
":",
"min_val",
"=",
"min",
"(",
"min",
"(",
"vals",
")",
",",
"0",
")",
"except",... | Calculates the range of values for this axis based on the dataset
value amount.
:param values | [<variant>, ..] | [
"Calculates",
"the",
"range",
"of",
"values",
"for",
"this",
"axis",
"based",
"on",
"the",
"dataset",
"value",
"amount",
".",
":",
"param",
"values",
"|",
"[",
"<variant",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/axes/xnumberaxis.py#L32-L57 | train | Calculates the range of values for this axis based on the dataset
value amount. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.