repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 3
values | summary stringlengths 4 350 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
bitesofcode/projexui | projexui/widgets/xchart/xchartaxis.py | XChartAxis.calculateRange | def calculateRange(self, values):
"""
Calculates the range of values for this axis based on the dataset
value amount.
:param values | [<variant>, ..]
"""
self.reset()
self._values = list(set(values))
self._values.sort(key=lambda x: v... | python | def calculateRange(self, values):
"""
Calculates the range of values for this axis based on the dataset
value amount.
:param values | [<variant>, ..]
"""
self.reset()
self._values = list(set(values))
self._values.sort(key=lambda x: v... | [
"def",
"calculateRange",
"(",
"self",
",",
"values",
")",
":",
"self",
".",
"reset",
"(",
")",
"self",
".",
"_values",
"=",
"list",
"(",
"set",
"(",
"values",
")",
")",
"self",
".",
"_values",
".",
"sort",
"(",
"key",
"=",
"lambda",
"x",
":",
"va... | 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/xchartaxis.py#L58-L67 | train | Calculates the range of values for this axis based on the dataset
value amount. |
bitesofcode/projexui | projexui/widgets/xchart/xchartaxis.py | XChartAxis.labels | def labels(self):
"""
Returns the list of labels that will be used to represent
this axis' information.
:return [<str>, ..]
"""
if self._labels is None:
self._labels = map(self.labelFormat().format, self.values())
return self._lab... | python | def labels(self):
"""
Returns the list of labels that will be used to represent
this axis' information.
:return [<str>, ..]
"""
if self._labels is None:
self._labels = map(self.labelFormat().format, self.values())
return self._lab... | [
"def",
"labels",
"(",
"self",
")",
":",
"if",
"self",
".",
"_labels",
"is",
"None",
":",
"self",
".",
"_labels",
"=",
"map",
"(",
"self",
".",
"labelFormat",
"(",
")",
".",
"format",
",",
"self",
".",
"values",
"(",
")",
")",
"return",
"self",
".... | Returns the list of labels that will be used to represent
this axis' information.
:return [<str>, ..] | [
"Returns",
"the",
"list",
"of",
"labels",
"that",
"will",
"be",
"used",
"to",
"represent",
"this",
"axis",
"information",
".",
":",
"return",
"[",
"<str",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartaxis.py#L107-L116 | train | Returns the list of labels that will be used to represent
this axis s information. |
bitesofcode/projexui | projexui/widgets/xchart/xchartaxis.py | XChartAxis.labelCount | def labelCount(self):
"""
Returns the label count for this axis. If the labels have been
defined then the length of the labels list will be provided, otherwise
the hardcoded label count will be returned.
:return <int>
"""
if self._labels is N... | python | def labelCount(self):
"""
Returns the label count for this axis. If the labels have been
defined then the length of the labels list will be provided, otherwise
the hardcoded label count will be returned.
:return <int>
"""
if self._labels is N... | [
"def",
"labelCount",
"(",
"self",
")",
":",
"if",
"self",
".",
"_labels",
"is",
"None",
":",
"count",
"=",
"self",
".",
"maximumLabelCount",
"(",
")",
"if",
"count",
"is",
"None",
":",
"return",
"1",
"else",
":",
"return",
"count",
"return",
"len",
"... | Returns the label count for this axis. If the labels have been
defined then the length of the labels list will be provided, otherwise
the hardcoded label count will be returned.
:return <int> | [
"Returns",
"the",
"label",
"count",
"for",
"this",
"axis",
".",
"If",
"the",
"labels",
"have",
"been",
"defined",
"then",
"the",
"length",
"of",
"the",
"labels",
"list",
"will",
"be",
"provided",
"otherwise",
"the",
"hardcoded",
"label",
"count",
"will",
"... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartaxis.py#L118-L133 | train | Returns the number of labels for this axis. |
bitesofcode/projexui | projexui/widgets/xchart/xchartaxis.py | XChartAxis.minimumLabelWidth | def minimumLabelWidth(self):
"""
Returns the minimum label width required on this renderers font size.
:param labels | [<str>, ..]
"""
min_w = 0
metrics = QFontMetrics(self.labelFont())
for label in self.labels():
min_w = max(min... | python | def minimumLabelWidth(self):
"""
Returns the minimum label width required on this renderers font size.
:param labels | [<str>, ..]
"""
min_w = 0
metrics = QFontMetrics(self.labelFont())
for label in self.labels():
min_w = max(min... | [
"def",
"minimumLabelWidth",
"(",
"self",
")",
":",
"min_w",
"=",
"0",
"metrics",
"=",
"QFontMetrics",
"(",
"self",
".",
"labelFont",
"(",
")",
")",
"for",
"label",
"in",
"self",
".",
"labels",
"(",
")",
":",
"min_w",
"=",
"max",
"(",
"min_w",
",",
... | Returns the minimum label width required on this renderers font size.
:param labels | [<str>, ..] | [
"Returns",
"the",
"minimum",
"label",
"width",
"required",
"on",
"this",
"renderers",
"font",
"size",
".",
":",
"param",
"labels",
"|",
"[",
"<str",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartaxis.py#L177-L189 | train | Returns the minimum width required on this renderers font size. |
bitesofcode/projexui | projexui/widgets/xchart/xchartaxis.py | XChartAxis.minimumLabelHeight | def minimumLabelHeight(self):
"""
Returns the minimum height that will be required based on this font size
and labels list.
"""
metrics = QFontMetrics(self.labelFont())
return max(self._minimumLabelHeight,
metrics.height() + self.verticalLabelPad... | python | def minimumLabelHeight(self):
"""
Returns the minimum height that will be required based on this font size
and labels list.
"""
metrics = QFontMetrics(self.labelFont())
return max(self._minimumLabelHeight,
metrics.height() + self.verticalLabelPad... | [
"def",
"minimumLabelHeight",
"(",
"self",
")",
":",
"metrics",
"=",
"QFontMetrics",
"(",
"self",
".",
"labelFont",
"(",
")",
")",
"return",
"max",
"(",
"self",
".",
"_minimumLabelHeight",
",",
"metrics",
".",
"height",
"(",
")",
"+",
"self",
".",
"vertic... | Returns the minimum height that will be required based on this font size
and labels list. | [
"Returns",
"the",
"minimum",
"height",
"that",
"will",
"be",
"required",
"based",
"on",
"this",
"font",
"size",
"and",
"labels",
"list",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartaxis.py#L191-L198 | train | Returns the minimum height that will be required based on this font size and the labels list. |
bitesofcode/projexui | projexui/widgets/xchart/xchartaxis.py | XChartAxis.percentAt | def percentAt(self, value):
"""
Returns the percentage where the given value lies between this rulers
minimum and maximum values. If the value equals the minimum, then the
percent is 0, if it equals the maximum, then the percent is 1 - any
value between will be a floating p... | python | def percentAt(self, value):
"""
Returns the percentage where the given value lies between this rulers
minimum and maximum values. If the value equals the minimum, then the
percent is 0, if it equals the maximum, then the percent is 1 - any
value between will be a floating p... | [
"def",
"percentAt",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
"is",
"None",
":",
"return",
"0.0",
"values",
"=",
"self",
".",
"values",
"(",
")",
"try",
":",
"return",
"float",
"(",
"values",
".",
"index",
"(",
"value",
")",
")",
"/",
"... | Returns the percentage where the given value lies between this rulers
minimum and maximum values. If the value equals the minimum, then the
percent is 0, if it equals the maximum, then the percent is 1 - any
value between will be a floating point. If the ruler is a custom type,
the... | [
"Returns",
"the",
"percentage",
"where",
"the",
"given",
"value",
"lies",
"between",
"this",
"rulers",
"minimum",
"and",
"maximum",
"values",
".",
"If",
"the",
"value",
"equals",
"the",
"minimum",
"then",
"the",
"percent",
"is",
"0",
"if",
"it",
"equals",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartaxis.py#L216-L238 | train | Returns the percentage of the given value lies between the given minimum and maximum values. |
bitesofcode/projexui | projexui/widgets/xchart/xchartaxis.py | XChartAxis.percentOfTotal | def percentOfTotal(self, value, values):
"""
Calculates the percent the inputed value is in relation to the
list of other values.
:param value | <variant>
values | [<variant>, ..]
:return <float> 0.0 - 1.0
"""
... | python | def percentOfTotal(self, value, values):
"""
Calculates the percent the inputed value is in relation to the
list of other values.
:param value | <variant>
values | [<variant>, ..]
:return <float> 0.0 - 1.0
"""
... | [
"def",
"percentOfTotal",
"(",
"self",
",",
"value",
",",
"values",
")",
":",
"try",
":",
"return",
"float",
"(",
"values",
".",
"index",
"(",
"value",
")",
"+",
"1",
")",
"/",
"len",
"(",
"values",
")",
"except",
"(",
"ZeroDivisionError",
",",
"Value... | Calculates the percent the inputed value is in relation to the
list of other values.
:param value | <variant>
values | [<variant>, ..]
:return <float> 0.0 - 1.0 | [
"Calculates",
"the",
"percent",
"the",
"inputed",
"value",
"is",
"in",
"relation",
"to",
"the",
"list",
"of",
"other",
"values",
".",
":",
"param",
"value",
"|",
"<variant",
">",
"values",
"|",
"[",
"<variant",
">",
"..",
"]",
":",
"return",
"<float",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartaxis.py#L240-L253 | train | Returns the percentage of total time the inputed value is in relation to the list of other values. |
bitesofcode/projexui | projexui/widgets/xchart/xchartaxis.py | XChartAxis.title | def title(self):
"""
Returns the title for this axis.
:return <str>
"""
if not self._title:
return projex.text.pretty(self.name())
return self._title | python | def title(self):
"""
Returns the title for this axis.
:return <str>
"""
if not self._title:
return projex.text.pretty(self.name())
return self._title | [
"def",
"title",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_title",
":",
"return",
"projex",
".",
"text",
".",
"pretty",
"(",
"self",
".",
"name",
"(",
")",
")",
"return",
"self",
".",
"_title"
] | Returns the title for this axis.
:return <str> | [
"Returns",
"the",
"title",
"for",
"this",
"axis",
".",
":",
"return",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartaxis.py#L440-L448 | train | Returns the title for this axis. |
bitesofcode/projexui | projexui/widgets/xchart/xchartaxis.py | XChartAxis.values | def values(self):
"""
Returns the values for this axis.
:return [<variant>, ..]
"""
if self._values is None:
self._values = self.calculateValues()
return self._values | python | def values(self):
"""
Returns the values for this axis.
:return [<variant>, ..]
"""
if self._values is None:
self._values = self.calculateValues()
return self._values | [
"def",
"values",
"(",
"self",
")",
":",
"if",
"self",
".",
"_values",
"is",
"None",
":",
"self",
".",
"_values",
"=",
"self",
".",
"calculateValues",
"(",
")",
"return",
"self",
".",
"_values"
] | Returns the values for this axis.
:return [<variant>, ..] | [
"Returns",
"the",
"values",
"for",
"this",
"axis",
".",
":",
"return",
"[",
"<variant",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartaxis.py#L475-L483 | train | Returns the values for this axis. |
bitesofcode/projexui | projexui/widgets/xchart/xchartaxis.py | XChartAxis.valueAt | def valueAt(self, percent):
"""
Returns the value at the inputed percent.
:param percent | <float>
:return <variant>
"""
values = self.values()
if percent < 0:
index = 0
elif percent > 1:
index ... | python | def valueAt(self, percent):
"""
Returns the value at the inputed percent.
:param percent | <float>
:return <variant>
"""
values = self.values()
if percent < 0:
index = 0
elif percent > 1:
index ... | [
"def",
"valueAt",
"(",
"self",
",",
"percent",
")",
":",
"values",
"=",
"self",
".",
"values",
"(",
")",
"if",
"percent",
"<",
"0",
":",
"index",
"=",
"0",
"elif",
"percent",
">",
"1",
":",
"index",
"=",
"-",
"1",
"else",
":",
"index",
"=",
"pe... | Returns the value at the inputed percent.
:param percent | <float>
:return <variant> | [
"Returns",
"the",
"value",
"at",
"the",
"inputed",
"percent",
".",
":",
"param",
"percent",
"|",
"<float",
">",
":",
"return",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartaxis.py#L485-L508 | train | Returns the value at the inputed percent. |
bitesofcode/projexui | projexui/widgets/xlabel.py | XLabel.acceptEdit | def acceptEdit(self):
"""
Accepts the current edit for this label.
"""
if not self._lineEdit:
return
self.setText(self._lineEdit.text())
self._lineEdit.hide()
if not self.signalsBlocked():
self.editingFinished.e... | python | def acceptEdit(self):
"""
Accepts the current edit for this label.
"""
if not self._lineEdit:
return
self.setText(self._lineEdit.text())
self._lineEdit.hide()
if not self.signalsBlocked():
self.editingFinished.e... | [
"def",
"acceptEdit",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_lineEdit",
":",
"return",
"self",
".",
"setText",
"(",
"self",
".",
"_lineEdit",
".",
"text",
"(",
")",
")",
"self",
".",
"_lineEdit",
".",
"hide",
"(",
")",
"if",
"not",
"self... | Accepts the current edit for this label. | [
"Accepts",
"the",
"current",
"edit",
"for",
"this",
"label",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlabel.py#L32-L43 | train | Updates the text of the current edit. |
bitesofcode/projexui | projexui/widgets/xlabel.py | XLabel.beginEdit | def beginEdit(self):
"""
Begins editing for the label.
"""
if not self._lineEdit:
return
self.aboutToEdit.emit()
self._lineEdit.setText(self.editText())
self._lineEdit.show()
self._lineEdit.selectAll()
self... | python | def beginEdit(self):
"""
Begins editing for the label.
"""
if not self._lineEdit:
return
self.aboutToEdit.emit()
self._lineEdit.setText(self.editText())
self._lineEdit.show()
self._lineEdit.selectAll()
self... | [
"def",
"beginEdit",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_lineEdit",
":",
"return",
"self",
".",
"aboutToEdit",
".",
"emit",
"(",
")",
"self",
".",
"_lineEdit",
".",
"setText",
"(",
"self",
".",
"editText",
"(",
")",
")",
"self",
".",
... | Begins editing for the label. | [
"Begins",
"editing",
"for",
"the",
"label",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlabel.py#L45-L57 | train | Starts editing for the label. |
bitesofcode/projexui | projexui/widgets/xlabel.py | XLabel.eventFilter | def eventFilter( self, object, event ):
"""
Filters the event for the inputed object looking for escape keys.
:param object | <QObject>
event | <QEvent>
:return <bool>
"""
if event.type() == event.KeyPress:
... | python | def eventFilter( self, object, event ):
"""
Filters the event for the inputed object looking for escape keys.
:param object | <QObject>
event | <QEvent>
:return <bool>
"""
if event.type() == event.KeyPress:
... | [
"def",
"eventFilter",
"(",
"self",
",",
"object",
",",
"event",
")",
":",
"if",
"event",
".",
"type",
"(",
")",
"==",
"event",
".",
"KeyPress",
":",
"if",
"event",
".",
"key",
"(",
")",
"==",
"Qt",
".",
"Key_Escape",
":",
"self",
".",
"rejectEdit",... | Filters the event for the inputed object looking for escape keys.
:param object | <QObject>
event | <QEvent>
:return <bool> | [
"Filters",
"the",
"event",
"for",
"the",
"inputed",
"object",
"looking",
"for",
"escape",
"keys",
".",
":",
"param",
"object",
"|",
"<QObject",
">",
"event",
"|",
"<QEvent",
">",
":",
"return",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlabel.py#L71-L92 | train | Returns True if the event should be handled for the object and False otherwise. |
bitesofcode/projexui | projexui/widgets/xlabel.py | XLabel.mouseDoubleClickEvent | def mouseDoubleClickEvent(self, event):
"""
Prompts the editing process if the label is editable.
:param event | <QMouseDoubleClickEvent>
"""
if self.isEditable():
self.beginEdit()
super(XLabel, self).mouseDoubleClickEvent(event... | python | def mouseDoubleClickEvent(self, event):
"""
Prompts the editing process if the label is editable.
:param event | <QMouseDoubleClickEvent>
"""
if self.isEditable():
self.beginEdit()
super(XLabel, self).mouseDoubleClickEvent(event... | [
"def",
"mouseDoubleClickEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"isEditable",
"(",
")",
":",
"self",
".",
"beginEdit",
"(",
")",
"super",
"(",
"XLabel",
",",
"self",
")",
".",
"mouseDoubleClickEvent",
"(",
"event",
")"
] | Prompts the editing process if the label is editable.
:param event | <QMouseDoubleClickEvent> | [
"Prompts",
"the",
"editing",
"process",
"if",
"the",
"label",
"is",
"editable",
".",
":",
"param",
"event",
"|",
"<QMouseDoubleClickEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlabel.py#L111-L120 | train | Prompts the editing process if the label is editable. |
bitesofcode/projexui | projexui/widgets/xlabel.py | XLabel.rejectEdit | def rejectEdit(self):
"""
Cancels the edit for this label.
"""
if self._lineEdit:
self._lineEdit.hide()
self.editingCancelled.emit() | python | def rejectEdit(self):
"""
Cancels the edit for this label.
"""
if self._lineEdit:
self._lineEdit.hide()
self.editingCancelled.emit() | [
"def",
"rejectEdit",
"(",
"self",
")",
":",
"if",
"self",
".",
"_lineEdit",
":",
"self",
".",
"_lineEdit",
".",
"hide",
"(",
")",
"self",
".",
"editingCancelled",
".",
"emit",
"(",
")"
] | Cancels the edit for this label. | [
"Cancels",
"the",
"edit",
"for",
"this",
"label",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlabel.py#L122-L128 | train | Cancels the edit for this label. |
bitesofcode/projexui | projexui/widgets/xlabel.py | XLabel.resizeEvent | def resizeEvent(self, event):
"""
Resize the label and the line edit for this label.
:param event | <QResizeEvent>
"""
super(XLabel, self).resizeEvent(event)
if self._lineEdit:
self._lineEdit.resize(self.size()) | python | def resizeEvent(self, event):
"""
Resize the label and the line edit for this label.
:param event | <QResizeEvent>
"""
super(XLabel, self).resizeEvent(event)
if self._lineEdit:
self._lineEdit.resize(self.size()) | [
"def",
"resizeEvent",
"(",
"self",
",",
"event",
")",
":",
"super",
"(",
"XLabel",
",",
"self",
")",
".",
"resizeEvent",
"(",
"event",
")",
"if",
"self",
".",
"_lineEdit",
":",
"self",
".",
"_lineEdit",
".",
"resize",
"(",
"self",
".",
"size",
"(",
... | Resize the label and the line edit for this label.
:param event | <QResizeEvent> | [
"Resize",
"the",
"label",
"and",
"the",
"line",
"edit",
"for",
"this",
"label",
".",
":",
"param",
"event",
"|",
"<QResizeEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlabel.py#L130-L139 | train | Resize the label and line edit for this label. |
bitesofcode/projexui | projexui/widgets/xlabel.py | XLabel.setEditable | def setEditable(self, state):
"""
Sets whether or not this label should be editable or not.
:param state | <bool>
"""
self._editable = state
if state and not self._lineEdit:
self.setLineEdit(XLineEdit(self))
e... | python | def setEditable(self, state):
"""
Sets whether or not this label should be editable or not.
:param state | <bool>
"""
self._editable = state
if state and not self._lineEdit:
self.setLineEdit(XLineEdit(self))
e... | [
"def",
"setEditable",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_editable",
"=",
"state",
"if",
"state",
"and",
"not",
"self",
".",
"_lineEdit",
":",
"self",
".",
"setLineEdit",
"(",
"XLineEdit",
"(",
"self",
")",
")",
"elif",
"not",
"state",
... | Sets whether or not this label should be editable or not.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"this",
"label",
"should",
"be",
"editable",
"or",
"not",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlabel.py#L141-L156 | train | Sets whether or not this label should be editable or not. |
bitesofcode/projexui | projexui/widgets/xlabel.py | XLabel.setLineEdit | def setLineEdit(self, lineEdit):
"""
Sets the line edit instance for this label.
:param lineEdit | <XLineEdit>
"""
self._lineEdit = lineEdit
if lineEdit:
lineEdit.setFont(self.font())
lineEdit.installEventFilter(self)
... | python | def setLineEdit(self, lineEdit):
"""
Sets the line edit instance for this label.
:param lineEdit | <XLineEdit>
"""
self._lineEdit = lineEdit
if lineEdit:
lineEdit.setFont(self.font())
lineEdit.installEventFilter(self)
... | [
"def",
"setLineEdit",
"(",
"self",
",",
"lineEdit",
")",
":",
"self",
".",
"_lineEdit",
"=",
"lineEdit",
"if",
"lineEdit",
":",
"lineEdit",
".",
"setFont",
"(",
"self",
".",
"font",
"(",
")",
")",
"lineEdit",
".",
"installEventFilter",
"(",
"self",
")",
... | Sets the line edit instance for this label.
:param lineEdit | <XLineEdit> | [
"Sets",
"the",
"line",
"edit",
"instance",
"for",
"this",
"label",
".",
":",
"param",
"lineEdit",
"|",
"<XLineEdit",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlabel.py#L166-L177 | train | Sets the line edit instance for this label. |
bitesofcode/projexui | projexui/widgets/xchart/xchartrenderer.py | XChartRenderer.buildData | def buildData(self, key, default=None):
"""
Returns the build information for the given key.
:param key | <str>
default | <variant>
:return <variant>
"""
return self._buildData.get(nativestring(key), default) | python | def buildData(self, key, default=None):
"""
Returns the build information for the given key.
:param key | <str>
default | <variant>
:return <variant>
"""
return self._buildData.get(nativestring(key), default) | [
"def",
"buildData",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"return",
"self",
".",
"_buildData",
".",
"get",
"(",
"nativestring",
"(",
"key",
")",
",",
"default",
")"
] | Returns the build information for the given key.
:param key | <str>
default | <variant>
:return <variant> | [
"Returns",
"the",
"build",
"information",
"for",
"the",
"given",
"key",
".",
":",
"param",
"key",
"|",
"<str",
">",
"default",
"|",
"<variant",
">",
":",
"return",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartrenderer.py#L106-L115 | train | Returns the build information for the given key. |
bitesofcode/projexui | projexui/widgets/xchart/xchartrenderer.py | XChartRenderer.calculate | def calculate(self, scene, xaxis, yaxis):
"""
Calculates the grid data before rendering.
:param scene | <XChartScene>
xaxis | <XChartAxis>
yaxis | <XChartAxis>
"""
# build the grid location
s... | python | def calculate(self, scene, xaxis, yaxis):
"""
Calculates the grid data before rendering.
:param scene | <XChartScene>
xaxis | <XChartAxis>
yaxis | <XChartAxis>
"""
# build the grid location
s... | [
"def",
"calculate",
"(",
"self",
",",
"scene",
",",
"xaxis",
",",
"yaxis",
")",
":",
"# build the grid location\r",
"sceneRect",
"=",
"scene",
".",
"sceneRect",
"(",
")",
"# process axis information\r",
"h_lines",
"=",
"[",
"]",
"h_alt",
"=",
"[",
"]",
"h_la... | Calculates the grid data before rendering.
:param scene | <XChartScene>
xaxis | <XChartAxis>
yaxis | <XChartAxis> | [
"Calculates",
"the",
"grid",
"data",
"before",
"rendering",
".",
":",
"param",
"scene",
"|",
"<XChartScene",
">",
"xaxis",
"|",
"<XChartAxis",
">",
"yaxis",
"|",
"<XChartAxis",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartrenderer.py#L117-L234 | train | Calculates the grid data before rendering. |
bitesofcode/projexui | projexui/widgets/xchart/xchartrenderer.py | XChartRenderer.calculateAxis | def calculateAxis(self, axis, size, minDelta):
"""
Calculates the rendering information for the given axis based on
the current size and the minimum required delta.
:param axis | <XChartAxis>
size | <int>
minDelta | <in... | python | def calculateAxis(self, axis, size, minDelta):
"""
Calculates the rendering information for the given axis based on
the current size and the minimum required delta.
:param axis | <XChartAxis>
size | <int>
minDelta | <in... | [
"def",
"calculateAxis",
"(",
"self",
",",
"axis",
",",
"size",
",",
"minDelta",
")",
":",
"labels",
"=",
"axis",
".",
"labels",
"(",
")",
"count",
"=",
"len",
"(",
"labels",
")",
"sections",
"=",
"max",
"(",
"(",
"count",
"-",
"1",
")",
",",
"1",... | Calculates the rendering information for the given axis based on
the current size and the minimum required delta.
:param axis | <XChartAxis>
size | <int>
minDelta | <int>
:return ([<str>, ..] labels, \
... | [
"Calculates",
"the",
"rendering",
"information",
"for",
"the",
"given",
"axis",
"based",
"on",
"the",
"current",
"size",
"and",
"the",
"minimum",
"required",
"delta",
".",
":",
"param",
"axis",
"|",
"<XChartAxis",
">",
"size",
"|",
"<int",
">",
"minDelta",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartrenderer.py#L236-L285 | train | Calculates the rendering information for the given axis based on the current size and the minimum required delta. |
bitesofcode/projexui | projexui/widgets/xchart/xchartrenderer.py | XChartRenderer.calculateDatasetItems | def calculateDatasetItems(self, scene, datasets):
"""
Syncs the scene together with the given datasets to make sure we
have the proper number of items, by removing non-existant datasets
and adding new ones.
:param scene | <XChartScene>
... | python | def calculateDatasetItems(self, scene, datasets):
"""
Syncs the scene together with the given datasets to make sure we
have the proper number of items, by removing non-existant datasets
and adding new ones.
:param scene | <XChartScene>
... | [
"def",
"calculateDatasetItems",
"(",
"self",
",",
"scene",
",",
"datasets",
")",
":",
"dataitems",
"=",
"scene",
".",
"datasetItems",
"(",
")",
"olditems",
"=",
"set",
"(",
"dataitems",
".",
"keys",
"(",
")",
")",
".",
"difference",
"(",
"datasets",
")",... | Syncs the scene together with the given datasets to make sure we
have the proper number of items, by removing non-existant datasets
and adding new ones.
:param scene | <XChartScene>
datasets | <XChartDataset>
:return {<XChartDatase... | [
"Syncs",
"the",
"scene",
"together",
"with",
"the",
"given",
"datasets",
"to",
"make",
"sure",
"we",
"have",
"the",
"proper",
"number",
"of",
"items",
"by",
"removing",
"non",
"-",
"existant",
"datasets",
"and",
"adding",
"new",
"ones",
".",
":",
"param",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartrenderer.py#L297-L318 | train | Updates the given datasets together with the given scene. |
bitesofcode/projexui | projexui/widgets/xchart/xchartrenderer.py | XChartRenderer.drawAxis | def drawAxis(self, painter, rect, axis):
"""
Draws the axis for the given painter.
:param painter | <QPainter>
rect | <QRect>
"""
if not axis:
return
# draw the axis lines
painter.save()
... | python | def drawAxis(self, painter, rect, axis):
"""
Draws the axis for the given painter.
:param painter | <QPainter>
rect | <QRect>
"""
if not axis:
return
# draw the axis lines
painter.save()
... | [
"def",
"drawAxis",
"(",
"self",
",",
"painter",
",",
"rect",
",",
"axis",
")",
":",
"if",
"not",
"axis",
":",
"return",
"# draw the axis lines\r",
"painter",
".",
"save",
"(",
")",
"pen",
"=",
"QPen",
"(",
"self",
".",
"axisColor",
"(",
")",
")",
"pe... | Draws the axis for the given painter.
:param painter | <QPainter>
rect | <QRect> | [
"Draws",
"the",
"axis",
"for",
"the",
"given",
"painter",
".",
":",
"param",
"painter",
"|",
"<QPainter",
">",
"rect",
"|",
"<QRect",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartrenderer.py#L320-L369 | train | Draws the horizontal or vertical axis for the given axis. |
bitesofcode/projexui | projexui/widgets/xchart/xchartrenderer.py | XChartRenderer.drawGrid | def drawGrid(self, painter, rect, showGrid, showColumns, showRows):
"""
Draws the grid on the inputed painter
:param painter | <QPainter>
rect | <QRect>
showGrid | <bool>
showColumns | <bool>
... | python | def drawGrid(self, painter, rect, showGrid, showColumns, showRows):
"""
Draws the grid on the inputed painter
:param painter | <QPainter>
rect | <QRect>
showGrid | <bool>
showColumns | <bool>
... | [
"def",
"drawGrid",
"(",
"self",
",",
"painter",
",",
"rect",
",",
"showGrid",
",",
"showColumns",
",",
"showRows",
")",
":",
"if",
"not",
"(",
"self",
".",
"showGrid",
"(",
")",
"and",
"showGrid",
")",
":",
"return",
"# saves the painter state before continu... | Draws the grid on the inputed painter
:param painter | <QPainter>
rect | <QRect>
showGrid | <bool>
showColumns | <bool>
showRows | <bool> | [
"Draws",
"the",
"grid",
"on",
"the",
"inputed",
"painter",
":",
"param",
"painter",
"|",
"<QPainter",
">",
"rect",
"|",
"<QRect",
">",
"showGrid",
"|",
"<bool",
">",
"showColumns",
"|",
"<bool",
">",
"showRows",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartrenderer.py#L383-L423 | train | Draws the grid on the inputed painter |
bitesofcode/projexui | projexui/widgets/xchart/xchartrenderer.py | XChartRenderer.pointAt | def pointAt(self, axes, axis_values):
"""
Returns the point that best represents this graph information.
:param axes | [<XChartAxis>, ..]
axis_values | {<str> axisName, <variant> value
:return <QPointF>
"""
po... | python | def pointAt(self, axes, axis_values):
"""
Returns the point that best represents this graph information.
:param axes | [<XChartAxis>, ..]
axis_values | {<str> axisName, <variant> value
:return <QPointF>
"""
po... | [
"def",
"pointAt",
"(",
"self",
",",
"axes",
",",
"axis_values",
")",
":",
"point",
"=",
"QPointF",
"(",
")",
"rect",
"=",
"self",
".",
"_buildData",
".",
"get",
"(",
"'axis_rect'",
")",
"if",
"not",
"rect",
":",
"return",
"point",
"x_range",
"=",
"re... | Returns the point that best represents this graph information.
:param axes | [<XChartAxis>, ..]
axis_values | {<str> axisName, <variant> value
:return <QPointF> | [
"Returns",
"the",
"point",
"that",
"best",
"represents",
"this",
"graph",
"information",
".",
":",
"param",
"axes",
"|",
"[",
"<XChartAxis",
">",
"..",
"]",
"axis_values",
"|",
"{",
"<str",
">",
"axisName",
"<variant",
">",
"value",
":",
"return",
"<QPoint... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartrenderer.py#L454-L482 | train | Returns the point that best represents this graph information. |
bitesofcode/projexui | projexui/widgets/xchart/xchartrenderer.py | XChartRenderer.valueAt | def valueAt(self, axes, point):
"""
Returns the values for each axis at the given point within this
renderer's axis rectangle.
:param axes | [<XChartAxis>, ..]
point | <QPointF>
:return {<str> axis name: <variant> value}
... | python | def valueAt(self, axes, point):
"""
Returns the values for each axis at the given point within this
renderer's axis rectangle.
:param axes | [<XChartAxis>, ..]
point | <QPointF>
:return {<str> axis name: <variant> value}
... | [
"def",
"valueAt",
"(",
"self",
",",
"axes",
",",
"point",
")",
":",
"rect",
"=",
"self",
".",
"_buildData",
".",
"get",
"(",
"'axis_rect'",
")",
"if",
"not",
"rect",
":",
"return",
"dict",
"(",
"[",
"(",
"axis",
".",
"name",
"(",
")",
",",
"None"... | Returns the values for each axis at the given point within this
renderer's axis rectangle.
:param axes | [<XChartAxis>, ..]
point | <QPointF>
:return {<str> axis name: <variant> value} | [
"Returns",
"the",
"values",
"for",
"each",
"axis",
"at",
"the",
"given",
"point",
"within",
"this",
"renderer",
"s",
"axis",
"rectangle",
".",
":",
"param",
"axes",
"|",
"[",
"<XChartAxis",
">",
"..",
"]",
"point",
"|",
"<QPointF",
">",
":",
"return",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartrenderer.py#L623-L654 | train | Returns the values for each axis at the given point within this renderer s axis rectangle. |
bitesofcode/projexui | projexui/widgets/xchart/xchartrenderer.py | XChartRenderer.plugin | def plugin(name):
"""
Returns the plugin renderer based on the inputed name.
:param name | <str>
:return <XChartRenderer> || None
"""
cls = XChartRenderer._plugins.get(name)
if cls:
renderer = cls()
ren... | python | def plugin(name):
"""
Returns the plugin renderer based on the inputed name.
:param name | <str>
:return <XChartRenderer> || None
"""
cls = XChartRenderer._plugins.get(name)
if cls:
renderer = cls()
ren... | [
"def",
"plugin",
"(",
"name",
")",
":",
"cls",
"=",
"XChartRenderer",
".",
"_plugins",
".",
"get",
"(",
"name",
")",
"if",
"cls",
":",
"renderer",
"=",
"cls",
"(",
")",
"renderer",
".",
"setName",
"(",
"name",
")",
"return",
"renderer",
"return",
"No... | Returns the plugin renderer based on the inputed name.
:param name | <str>
:return <XChartRenderer> || None | [
"Returns",
"the",
"plugin",
"renderer",
"based",
"on",
"the",
"inputed",
"name",
".",
":",
"param",
"name",
"|",
"<str",
">",
":",
"return",
"<XChartRenderer",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartrenderer.py#L665-L678 | train | Returns the first renderer with the given name or None if no such renderer exists. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py | XOrbBrowserFactory.cardClass | def cardClass( self, record ):
"""
Returns the class that will be used by the createCard method to generate
card widgets for records.
:param record | <orb.Table>
:return <XAbstractCardWidget>
"""
return self._cardClasses.get(typ... | python | def cardClass( self, record ):
"""
Returns the class that will be used by the createCard method to generate
card widgets for records.
:param record | <orb.Table>
:return <XAbstractCardWidget>
"""
return self._cardClasses.get(typ... | [
"def",
"cardClass",
"(",
"self",
",",
"record",
")",
":",
"return",
"self",
".",
"_cardClasses",
".",
"get",
"(",
"type",
"(",
"record",
")",
",",
"self",
".",
"_cardClasses",
"[",
"None",
"]",
")"
] | Returns the class that will be used by the createCard method to generate
card widgets for records.
:param record | <orb.Table>
:return <XAbstractCardWidget> | [
"Returns",
"the",
"class",
"that",
"will",
"be",
"used",
"by",
"the",
"createCard",
"method",
"to",
"generate",
"card",
"widgets",
"for",
"records",
".",
":",
"param",
"record",
"|",
"<orb",
".",
"Table",
">",
":",
"return",
"<XAbstractCardWidget",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py#L36-L45 | train | Returns the class that should be used by the createCard method to generate a new card for the given record. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py | XOrbBrowserFactory.collectRecords | def collectRecords( self, column ):
"""
Collects records for the inputed column to choose from.
:param column | <orb.Column>
:return [<orb.Table>, ..]
"""
model = column.referenceModel()
if ( not model ):
return [... | python | def collectRecords( self, column ):
"""
Collects records for the inputed column to choose from.
:param column | <orb.Column>
:return [<orb.Table>, ..]
"""
model = column.referenceModel()
if ( not model ):
return [... | [
"def",
"collectRecords",
"(",
"self",
",",
"column",
")",
":",
"model",
"=",
"column",
".",
"referenceModel",
"(",
")",
"if",
"(",
"not",
"model",
")",
":",
"return",
"[",
"]",
"records",
"=",
"model",
".",
"select",
"(",
")",
"records",
".",
"sort",... | Collects records for the inputed column to choose from.
:param column | <orb.Column>
:return [<orb.Table>, ..] | [
"Collects",
"records",
"for",
"the",
"inputed",
"column",
"to",
"choose",
"from",
".",
":",
"param",
"column",
"|",
"<orb",
".",
"Column",
">",
":",
"return",
"[",
"<orb",
".",
"Table",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py#L47-L61 | train | Returns a list of records for the inputed column. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py | XOrbBrowserFactory.columnOptions | def columnOptions( self, tableType ):
"""
Returns the column options for the inputed table type.
:param tableType | <subclass of orb.Table>
:return [<str>, ..]
"""
if ( not tableType ):
return []
schema = ... | python | def columnOptions( self, tableType ):
"""
Returns the column options for the inputed table type.
:param tableType | <subclass of orb.Table>
:return [<str>, ..]
"""
if ( not tableType ):
return []
schema = ... | [
"def",
"columnOptions",
"(",
"self",
",",
"tableType",
")",
":",
"if",
"(",
"not",
"tableType",
")",
":",
"return",
"[",
"]",
"schema",
"=",
"tableType",
".",
"schema",
"(",
")",
"return",
"map",
"(",
"lambda",
"x",
":",
"x",
".",
"name",
"(",
")",... | Returns the column options for the inputed table type.
:param tableType | <subclass of orb.Table>
:return [<str>, ..] | [
"Returns",
"the",
"column",
"options",
"for",
"the",
"inputed",
"table",
"type",
".",
":",
"param",
"tableType",
"|",
"<subclass",
"of",
"orb",
".",
"Table",
">",
":",
"return",
"[",
"<str",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py#L63-L75 | train | Returns the column options for the inputed table type. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py | XOrbBrowserFactory.createCard | def createCard( self, parent, record ):
"""
Creates a new widget that will represent the card view for the inpued
record.
:param parent | <QWidget>
record | <orb.Table>
:return <QWidget> || None
"""
cls = se... | python | def createCard( self, parent, record ):
"""
Creates a new widget that will represent the card view for the inpued
record.
:param parent | <QWidget>
record | <orb.Table>
:return <QWidget> || None
"""
cls = se... | [
"def",
"createCard",
"(",
"self",
",",
"parent",
",",
"record",
")",
":",
"cls",
"=",
"self",
".",
"cardClass",
"(",
"record",
")",
"if",
"(",
"cls",
")",
":",
"card",
"=",
"cls",
"(",
"parent",
")",
"card",
".",
"setRecord",
"(",
"record",
")",
... | Creates a new widget that will represent the card view for the inpued
record.
:param parent | <QWidget>
record | <orb.Table>
:return <QWidget> || None | [
"Creates",
"a",
"new",
"widget",
"that",
"will",
"represent",
"the",
"card",
"view",
"for",
"the",
"inpued",
"record",
".",
":",
"param",
"parent",
"|",
"<QWidget",
">",
"record",
"|",
"<orb",
".",
"Table",
">",
":",
"return",
"<QWidget",
">",
"||",
"N... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py#L77-L92 | train | Creates a new widget that will represent the card view for the inpued
record. Returns None if no card is created. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py | XOrbBrowserFactory.createEditor | def createEditor( self, parent, schema, columnName, operatorType ):
"""
Returns an editor for the inputed table type, based on the column and
operator types.
:param schema | <orb.TableSchema>
columnName | <str>
op... | python | def createEditor( self, parent, schema, columnName, operatorType ):
"""
Returns an editor for the inputed table type, based on the column and
operator types.
:param schema | <orb.TableSchema>
columnName | <str>
op... | [
"def",
"createEditor",
"(",
"self",
",",
"parent",
",",
"schema",
",",
"columnName",
",",
"operatorType",
")",
":",
"column",
"=",
"schema",
".",
"column",
"(",
"columnName",
")",
"if",
"(",
"not",
"column",
")",
":",
"return",
"None",
"ctype",
"=",
"c... | Returns an editor for the inputed table type, based on the column and
operator types.
:param schema | <orb.TableSchema>
columnName | <str>
operatorType | <orb.Query.Op>
:return <QWidget> | [
"Returns",
"an",
"editor",
"for",
"the",
"inputed",
"table",
"type",
"based",
"on",
"the",
"column",
"and",
"operator",
"types",
".",
":",
"param",
"schema",
"|",
"<orb",
".",
"TableSchema",
">",
"columnName",
"|",
"<str",
">",
"operatorType",
"|",
"<orb",... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py#L94-L131 | train | Creates an editor for the inputed table type based on the inputed column and operator types. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py | XOrbBrowserFactory.editorData | def editorData( self, editor ):
"""
Pulls the value from the inputed editor.
:param editor | <QWidget>
:return <variant>
"""
# set the information from a multi-tag edit
if ( isinstance(editor, XMultiTagEdit) ):
retu... | python | def editorData( self, editor ):
"""
Pulls the value from the inputed editor.
:param editor | <QWidget>
:return <variant>
"""
# set the information from a multi-tag edit
if ( isinstance(editor, XMultiTagEdit) ):
retu... | [
"def",
"editorData",
"(",
"self",
",",
"editor",
")",
":",
"# set the information from a multi-tag edit\r",
"if",
"(",
"isinstance",
"(",
"editor",
",",
"XMultiTagEdit",
")",
")",
":",
"return",
"editor",
".",
"tags",
"(",
")",
"# set the information from a combo bo... | Pulls the value from the inputed editor.
:param editor | <QWidget>
:return <variant> | [
"Pulls",
"the",
"value",
"from",
"the",
"inputed",
"editor",
".",
":",
"param",
"editor",
"|",
"<QWidget",
">",
":",
"return",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py#L133-L153 | train | Gets the value from the inputed editor. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py | XOrbBrowserFactory.setEditorData | def setEditorData( self, editor, value ):
"""
Sets the value for the given editor to the inputed value.
:param editor | <QWidget>
value | <variant>
"""
# set the data for a multitagedit
if ( isinstance(editor, XMultiTag... | python | def setEditorData( self, editor, value ):
"""
Sets the value for the given editor to the inputed value.
:param editor | <QWidget>
value | <variant>
"""
# set the data for a multitagedit
if ( isinstance(editor, XMultiTag... | [
"def",
"setEditorData",
"(",
"self",
",",
"editor",
",",
"value",
")",
":",
"# set the data for a multitagedit\r",
"if",
"(",
"isinstance",
"(",
"editor",
",",
"XMultiTagEdit",
")",
")",
":",
"if",
"(",
"not",
"isinstance",
"(",
"value",
",",
"list",
")",
... | Sets the value for the given editor to the inputed value.
:param editor | <QWidget>
value | <variant> | [
"Sets",
"the",
"value",
"for",
"the",
"given",
"editor",
"to",
"the",
"inputed",
"value",
".",
":",
"param",
"editor",
"|",
"<QWidget",
">",
"value",
"|",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserfactory.py#L155-L182 | train | Sets the value for the given editor to the inputed value. |
datawire/scout.py | scout/scout.py | Scout.configmap_install_id_plugin | def configmap_install_id_plugin(scout, app, map_name=None, namespace="default"):
"""
Scout id_plugin that uses a Kubernetes configmap to store the install ID.
:param scout: Scout instance that's calling the plugin
:param app: Name of the application that's using Scout
:param map... | python | def configmap_install_id_plugin(scout, app, map_name=None, namespace="default"):
"""
Scout id_plugin that uses a Kubernetes configmap to store the install ID.
:param scout: Scout instance that's calling the plugin
:param app: Name of the application that's using Scout
:param map... | [
"def",
"configmap_install_id_plugin",
"(",
"scout",
",",
"app",
",",
"map_name",
"=",
"None",
",",
"namespace",
"=",
"\"default\"",
")",
":",
"plugin_response",
"=",
"None",
"if",
"not",
"map_name",
":",
"map_name",
"=",
"\"scout.config.{0}\"",
".",
"format",
... | Scout id_plugin that uses a Kubernetes configmap to store the install ID.
:param scout: Scout instance that's calling the plugin
:param app: Name of the application that's using Scout
:param map_name: Optional ConfigMap name to use; defaults to "scout.config.$app"
:param namespace: Opti... | [
"Scout",
"id_plugin",
"that",
"uses",
"a",
"Kubernetes",
"configmap",
"to",
"store",
"the",
"install",
"ID",
"."
] | fd4e866cf6eaa2dc4af87ea22790a2ade7444c58 | https://github.com/datawire/scout.py/blob/fd4e866cf6eaa2dc4af87ea22790a2ade7444c58/scout/scout.py#L190-L314 | train | This function returns the install ID of a plugin that uses a Kubernetes configmap to store the install ID of the application. |
Gbps/fastlog | fastlog/term.py | typeseq | def typeseq(types):
"""
Returns an escape for a terminal text formatting type, or a list of types.
Valid types are:
* 'i' for 'italic'
* 'b' for 'bold'
* 'u' for 'underline'
* 'r' for 'reverse'
"""
ret = ""
for t in types:
ret += termcap.get(fmttypes[t])
... | python | def typeseq(types):
"""
Returns an escape for a terminal text formatting type, or a list of types.
Valid types are:
* 'i' for 'italic'
* 'b' for 'bold'
* 'u' for 'underline'
* 'r' for 'reverse'
"""
ret = ""
for t in types:
ret += termcap.get(fmttypes[t])
... | [
"def",
"typeseq",
"(",
"types",
")",
":",
"ret",
"=",
"\"\"",
"for",
"t",
"in",
"types",
":",
"ret",
"+=",
"termcap",
".",
"get",
"(",
"fmttypes",
"[",
"t",
"]",
")",
"return",
"ret"
] | Returns an escape for a terminal text formatting type, or a list of types.
Valid types are:
* 'i' for 'italic'
* 'b' for 'bold'
* 'u' for 'underline'
* 'r' for 'reverse' | [
"Returns",
"an",
"escape",
"for",
"a",
"terminal",
"text",
"formatting",
"type",
"or",
"a",
"list",
"of",
"types",
"."
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/term.py#L117-L131 | train | Returns an escape for a terminal text formatting type or a list of types. |
Gbps/fastlog | fastlog/term.py | nametonum | def nametonum(name):
"""
Returns a color code number given the color name.
"""
code = colorcodes.get(name)
if code is None:
raise ValueError("%s is not a valid color name." % name)
else:
return code | python | def nametonum(name):
"""
Returns a color code number given the color name.
"""
code = colorcodes.get(name)
if code is None:
raise ValueError("%s is not a valid color name." % name)
else:
return code | [
"def",
"nametonum",
"(",
"name",
")",
":",
"code",
"=",
"colorcodes",
".",
"get",
"(",
"name",
")",
"if",
"code",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"%s is not a valid color name.\"",
"%",
"name",
")",
"else",
":",
"return",
"code"
] | Returns a color code number given the color name. | [
"Returns",
"a",
"color",
"code",
"number",
"given",
"the",
"color",
"name",
"."
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/term.py#L133-L141 | train | Returns a color code number given the color name. |
Gbps/fastlog | fastlog/term.py | fgseq | def fgseq(code):
"""
Returns the forground color terminal escape sequence for the given color code number or color name.
"""
if isinstance(code, str):
code = nametonum(code)
if code == -1:
return ""
s = termcap.get('setaf', code) or termcap.get('setf', code)
return ... | python | def fgseq(code):
"""
Returns the forground color terminal escape sequence for the given color code number or color name.
"""
if isinstance(code, str):
code = nametonum(code)
if code == -1:
return ""
s = termcap.get('setaf', code) or termcap.get('setf', code)
return ... | [
"def",
"fgseq",
"(",
"code",
")",
":",
"if",
"isinstance",
"(",
"code",
",",
"str",
")",
":",
"code",
"=",
"nametonum",
"(",
"code",
")",
"if",
"code",
"==",
"-",
"1",
":",
"return",
"\"\"",
"s",
"=",
"termcap",
".",
"get",
"(",
"'setaf'",
",",
... | Returns the forground color terminal escape sequence for the given color code number or color name. | [
"Returns",
"the",
"forground",
"color",
"terminal",
"escape",
"sequence",
"for",
"the",
"given",
"color",
"code",
"number",
"or",
"color",
"name",
"."
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/term.py#L143-L154 | train | Returns the terminal escape sequence for the given color code number or color name. |
Gbps/fastlog | fastlog/term.py | bgseq | def bgseq(code):
"""
Returns the background color terminal escape sequence for the given color code number.
"""
if isinstance(code, str):
code = nametonum(code)
if code == -1:
return ""
s = termcap.get('setab', code) or termcap.get('setb', code)
return s | python | def bgseq(code):
"""
Returns the background color terminal escape sequence for the given color code number.
"""
if isinstance(code, str):
code = nametonum(code)
if code == -1:
return ""
s = termcap.get('setab', code) or termcap.get('setb', code)
return s | [
"def",
"bgseq",
"(",
"code",
")",
":",
"if",
"isinstance",
"(",
"code",
",",
"str",
")",
":",
"code",
"=",
"nametonum",
"(",
"code",
")",
"if",
"code",
"==",
"-",
"1",
":",
"return",
"\"\"",
"s",
"=",
"termcap",
".",
"get",
"(",
"'setab'",
",",
... | Returns the background color terminal escape sequence for the given color code number. | [
"Returns",
"the",
"background",
"color",
"terminal",
"escape",
"sequence",
"for",
"the",
"given",
"color",
"code",
"number",
"."
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/term.py#L156-L167 | train | Returns the background color terminal escape sequence for the given color code number. |
Gbps/fastlog | fastlog/term.py | Style.parse | def parse(self, descriptor):
"""
Creates a text styling from a descriptor
A descriptor is a dictionary containing any of the following keys:
* fg: The foreground color (name or int)
See `bgseq`
* bg: The background color (name or int)
... | python | def parse(self, descriptor):
"""
Creates a text styling from a descriptor
A descriptor is a dictionary containing any of the following keys:
* fg: The foreground color (name or int)
See `bgseq`
* bg: The background color (name or int)
... | [
"def",
"parse",
"(",
"self",
",",
"descriptor",
")",
":",
"fg",
"=",
"descriptor",
".",
"get",
"(",
"'fg'",
")",
"bg",
"=",
"descriptor",
".",
"get",
"(",
"'bg'",
")",
"types",
"=",
"descriptor",
".",
"get",
"(",
"'fmt'",
")",
"ret",
"=",
"\"\"",
... | Creates a text styling from a descriptor
A descriptor is a dictionary containing any of the following keys:
* fg: The foreground color (name or int)
See `bgseq`
* bg: The background color (name or int)
See `fgseq`
* fmt: The types of s... | [
"Creates",
"a",
"text",
"styling",
"from",
"a",
"descriptor"
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/term.py#L78-L113 | train | Parses the text styling of a single entry in the log file. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiledialog.py | XViewProfileDialog.accept | def accept( self ):
"""
Saves the data to the profile before closing.
"""
if ( not self.uiNameTXT.text() ):
QMessageBox.information(self,
'Invalid Name',
'You need to supply a name for your layout.')... | python | def accept( self ):
"""
Saves the data to the profile before closing.
"""
if ( not self.uiNameTXT.text() ):
QMessageBox.information(self,
'Invalid Name',
'You need to supply a name for your layout.')... | [
"def",
"accept",
"(",
"self",
")",
":",
"if",
"(",
"not",
"self",
".",
"uiNameTXT",
".",
"text",
"(",
")",
")",
":",
"QMessageBox",
".",
"information",
"(",
"self",
",",
"'Invalid Name'",
",",
"'You need to supply a name for your layout.'",
")",
"return",
"p... | Saves the data to the profile before closing. | [
"Saves",
"the",
"data",
"to",
"the",
"profile",
"before",
"closing",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiledialog.py#L35-L54 | train | Accepts the dialog and returns the user s information. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiledialog.py | XViewProfileDialog.setProfile | def setProfile( self, profile ):
"""
Sets the profile instance for this dialog to the inputed profile.
:param profile | <projexui.widgets.xviewwidget.XViewProfile>
"""
self._profile = profile
if not profile:
self.uiNameTXT.setTe... | python | def setProfile( self, profile ):
"""
Sets the profile instance for this dialog to the inputed profile.
:param profile | <projexui.widgets.xviewwidget.XViewProfile>
"""
self._profile = profile
if not profile:
self.uiNameTXT.setTe... | [
"def",
"setProfile",
"(",
"self",
",",
"profile",
")",
":",
"self",
".",
"_profile",
"=",
"profile",
"if",
"not",
"profile",
":",
"self",
".",
"uiNameTXT",
".",
"setText",
"(",
"''",
")",
"self",
".",
"uiVersionSPN",
".",
"setValue",
"(",
"1.0",
")",
... | Sets the profile instance for this dialog to the inputed profile.
:param profile | <projexui.widgets.xviewwidget.XViewProfile> | [
"Sets",
"the",
"profile",
"instance",
"for",
"this",
"dialog",
"to",
"the",
"inputed",
"profile",
".",
":",
"param",
"profile",
"|",
"<projexui",
".",
"widgets",
".",
"xviewwidget",
".",
"XViewProfile",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiledialog.py#L64-L85 | train | Sets the profile for this dialog to the inputed profile. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiledialog.py | XViewProfileDialog.setVisible | def setVisible( self, state ):
"""
Handles the visibility operation for this dialog.
:param state | <bool>
"""
super(XViewProfileDialog, self).setVisible(state)
if ( state ):
self.activateWindow()
self.uiNameTXT.set... | python | def setVisible( self, state ):
"""
Handles the visibility operation for this dialog.
:param state | <bool>
"""
super(XViewProfileDialog, self).setVisible(state)
if ( state ):
self.activateWindow()
self.uiNameTXT.set... | [
"def",
"setVisible",
"(",
"self",
",",
"state",
")",
":",
"super",
"(",
"XViewProfileDialog",
",",
"self",
")",
".",
"setVisible",
"(",
"state",
")",
"if",
"(",
"state",
")",
":",
"self",
".",
"activateWindow",
"(",
")",
"self",
".",
"uiNameTXT",
".",
... | Handles the visibility operation for this dialog.
:param state | <bool> | [
"Handles",
"the",
"visibility",
"operation",
"for",
"this",
"dialog",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiledialog.py#L87-L98 | train | Sets the visibility of the dialog. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiledialog.py | XViewProfileDialog.edit | def edit(parent, profile):
"""
Edits the given profile.
:param parent | <QWidget>
profile | <projexui.widgets.xviewwidget.XViewProfile>
:return <bool>
"""
dlg = XViewProfileDialog(parent)
dlg.setProfile(pro... | python | def edit(parent, profile):
"""
Edits the given profile.
:param parent | <QWidget>
profile | <projexui.widgets.xviewwidget.XViewProfile>
:return <bool>
"""
dlg = XViewProfileDialog(parent)
dlg.setProfile(pro... | [
"def",
"edit",
"(",
"parent",
",",
"profile",
")",
":",
"dlg",
"=",
"XViewProfileDialog",
"(",
"parent",
")",
"dlg",
".",
"setProfile",
"(",
"profile",
")",
"if",
"(",
"dlg",
".",
"exec_",
"(",
")",
")",
":",
"return",
"True",
"return",
"False"
] | Edits the given profile.
:param parent | <QWidget>
profile | <projexui.widgets.xviewwidget.XViewProfile>
:return <bool> | [
"Edits",
"the",
"given",
"profile",
".",
":",
"param",
"parent",
"|",
"<QWidget",
">",
"profile",
"|",
"<projexui",
".",
"widgets",
".",
"xviewwidget",
".",
"XViewProfile",
">",
":",
"return",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiledialog.py#L101-L114 | train | Edit the given profile. |
bitesofcode/projexui | projexui/widgets/xlocationwidget.py | XLocationWidget.blockSignals | def blockSignals( self, state ):
"""
Blocks the signals for this widget and its sub-parts.
:param state | <bool>
"""
super(XLocationWidget, self).blockSignals(state)
self._locationEdit.blockSignals(state)
self._locationButton.blockSignals(sta... | python | def blockSignals( self, state ):
"""
Blocks the signals for this widget and its sub-parts.
:param state | <bool>
"""
super(XLocationWidget, self).blockSignals(state)
self._locationEdit.blockSignals(state)
self._locationButton.blockSignals(sta... | [
"def",
"blockSignals",
"(",
"self",
",",
"state",
")",
":",
"super",
"(",
"XLocationWidget",
",",
"self",
")",
".",
"blockSignals",
"(",
"state",
")",
"self",
".",
"_locationEdit",
".",
"blockSignals",
"(",
"state",
")",
"self",
".",
"_locationButton",
"."... | Blocks the signals for this widget and its sub-parts.
:param state | <bool> | [
"Blocks",
"the",
"signals",
"for",
"this",
"widget",
"and",
"its",
"sub",
"-",
"parts",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlocationwidget.py#L69-L77 | train | Blocks the signals for this widget and its sub - parts. |
bitesofcode/projexui | projexui/widgets/xlocationwidget.py | XLocationWidget.browseMaps | def browseMaps( self ):
"""
Brings up a web browser with the address in a Google map.
"""
url = self.urlTemplate()
params = urllib.urlencode({self.urlQueryKey(): self.location()})
url = url % {'params': params}
webbrowser.open(url) | python | def browseMaps( self ):
"""
Brings up a web browser with the address in a Google map.
"""
url = self.urlTemplate()
params = urllib.urlencode({self.urlQueryKey(): self.location()})
url = url % {'params': params}
webbrowser.open(url) | [
"def",
"browseMaps",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"urlTemplate",
"(",
")",
"params",
"=",
"urllib",
".",
"urlencode",
"(",
"{",
"self",
".",
"urlQueryKey",
"(",
")",
":",
"self",
".",
"location",
"(",
")",
"}",
")",
"url",
"=",
... | Brings up a web browser with the address in a Google map. | [
"Brings",
"up",
"a",
"web",
"browser",
"with",
"the",
"address",
"in",
"a",
"Google",
"map",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlocationwidget.py#L79-L87 | train | Browse the Google maps. |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._initialize_chrome_driver | def _initialize_chrome_driver(self):
"""Initializes chrome in headless mode"""
try:
print(colored('\nInitializing Headless Chrome...\n', 'yellow'))
self._initialize_chrome_options()
self._chromeDriver = webdriver.Chrome(
chrome_options=self._chromeOp... | python | def _initialize_chrome_driver(self):
"""Initializes chrome in headless mode"""
try:
print(colored('\nInitializing Headless Chrome...\n', 'yellow'))
self._initialize_chrome_options()
self._chromeDriver = webdriver.Chrome(
chrome_options=self._chromeOp... | [
"def",
"_initialize_chrome_driver",
"(",
"self",
")",
":",
"try",
":",
"print",
"(",
"colored",
"(",
"'\\nInitializing Headless Chrome...\\n'",
",",
"'yellow'",
")",
")",
"self",
".",
"_initialize_chrome_options",
"(",
")",
"self",
".",
"_chromeDriver",
"=",
"webd... | Initializes chrome in headless mode | [
"Initializes",
"chrome",
"in",
"headless",
"mode"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L72-L86 | train | Initializes chrome driver in headless mode |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor.initialize_arg_parser | def initialize_arg_parser():
"""
Initializes the option parser with the options -
-q --image-query {[str]} -- [Image Search Query]
-n --image-count {[int]} -- [Count of images that need to be downloaded]
-f --destination-folder {[str]} -- [Download Destination Folder]... | python | def initialize_arg_parser():
"""
Initializes the option parser with the options -
-q --image-query {[str]} -- [Image Search Query]
-n --image-count {[int]} -- [Count of images that need to be downloaded]
-f --destination-folder {[str]} -- [Download Destination Folder]... | [
"def",
"initialize_arg_parser",
"(",
")",
":",
"GoogleImageExtractor",
".",
"__argParser",
"=",
"ArgumentParser",
"(",
"description",
"=",
"'Utility to search and download images from google'",
")",
"# Add the required arguments",
"requiredArguments",
"=",
"GoogleImageExtractor",... | Initializes the option parser with the options -
-q --image-query {[str]} -- [Image Search Query]
-n --image-count {[int]} -- [Count of images that need to be downloaded]
-f --destination-folder {[str]} -- [Download Destination Folder]
-t --thread-count {[int]} -- [Count ... | [
"Initializes",
"the",
"option",
"parser",
"with",
"the",
"options",
"-",
"-",
"q",
"--",
"image",
"-",
"query",
"{",
"[",
"str",
"]",
"}",
"--",
"[",
"Image",
"Search",
"Query",
"]",
"-",
"n",
"--",
"image",
"-",
"count",
"{",
"[",
"int",
"]",
"}... | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L89-L121 | train | Initializes the argument parser with the options that are required by the user. |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor.extract_images | def extract_images(self, imageQuery, imageCount=100, destinationFolder='./', threadCount=4):
"""
Searches across Google Image Search with the specified image query and
downloads the specified count of images
Arguments:
imageQuery {[str]} -- [Image Search Query]
Keyw... | python | def extract_images(self, imageQuery, imageCount=100, destinationFolder='./', threadCount=4):
"""
Searches across Google Image Search with the specified image query and
downloads the specified count of images
Arguments:
imageQuery {[str]} -- [Image Search Query]
Keyw... | [
"def",
"extract_images",
"(",
"self",
",",
"imageQuery",
",",
"imageCount",
"=",
"100",
",",
"destinationFolder",
"=",
"'./'",
",",
"threadCount",
"=",
"4",
")",
":",
"# Initialize the chrome driver",
"self",
".",
"_initialize_chrome_driver",
"(",
")",
"# Initiali... | Searches across Google Image Search with the specified image query and
downloads the specified count of images
Arguments:
imageQuery {[str]} -- [Image Search Query]
Keyword Arguments:
imageCount {[int]} -- [Count of images that need to be downloaded]
destina... | [
"Searches",
"across",
"Google",
"Image",
"Search",
"with",
"the",
"specified",
"image",
"query",
"and",
"downloads",
"the",
"specified",
"count",
"of",
"images"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L129-L164 | train | This function downloads the specified number of images from Google Image Search with the specified image query and downloads the specified count of images from Google Image Search with the specified image query and saves the specified count of images to the specified destination folder. |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._get_image_urls | def _get_image_urls(self):
"""Retrieves the image URLS corresponding to the image query"""
print(colored('\nRetrieving Image URLs...', 'yellow'))
_imageQuery = self._imageQuery.replace(' ', '+')
self._chromeDriver.get('https://www.google.co.in/search?q=' + _imageQuery +
... | python | def _get_image_urls(self):
"""Retrieves the image URLS corresponding to the image query"""
print(colored('\nRetrieving Image URLs...', 'yellow'))
_imageQuery = self._imageQuery.replace(' ', '+')
self._chromeDriver.get('https://www.google.co.in/search?q=' + _imageQuery +
... | [
"def",
"_get_image_urls",
"(",
"self",
")",
":",
"print",
"(",
"colored",
"(",
"'\\nRetrieving Image URLs...'",
",",
"'yellow'",
")",
")",
"_imageQuery",
"=",
"self",
".",
"_imageQuery",
".",
"replace",
"(",
"' '",
",",
"'+'",
")",
"self",
".",
"_chromeDrive... | Retrieves the image URLS corresponding to the image query | [
"Retrieves",
"the",
"image",
"URLS",
"corresponding",
"to",
"the",
"image",
"query"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L177-L195 | train | Retrieves the image URLs corresponding to the image query |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._extract_image_urls | def _extract_image_urls(self):
"""Retrieves image URLs from the current page"""
resultsPage = self._chromeDriver.page_source
resultsPageSoup = BeautifulSoup(resultsPage, 'html.parser')
images = resultsPageSoup.find_all('div', class_='rg_meta')
images = [json.loads(image.content... | python | def _extract_image_urls(self):
"""Retrieves image URLs from the current page"""
resultsPage = self._chromeDriver.page_source
resultsPageSoup = BeautifulSoup(resultsPage, 'html.parser')
images = resultsPageSoup.find_all('div', class_='rg_meta')
images = [json.loads(image.content... | [
"def",
"_extract_image_urls",
"(",
"self",
")",
":",
"resultsPage",
"=",
"self",
".",
"_chromeDriver",
".",
"page_source",
"resultsPageSoup",
"=",
"BeautifulSoup",
"(",
"resultsPage",
",",
"'html.parser'",
")",
"images",
"=",
"resultsPageSoup",
".",
"find_all",
"(... | Retrieves image URLs from the current page | [
"Retrieves",
"image",
"URLs",
"from",
"the",
"current",
"page"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L197-L208 | train | Retrieves image URLs from the current page |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._page_scroll_down | def _page_scroll_down(self):
"""Scrolls down to get the next set of images"""
# Scroll down to request the next set of images
self._chromeDriver.execute_script(
'window.scroll(0, document.body.clientHeight)')
# Wait for the images to load completely
time.sleep(self.... | python | def _page_scroll_down(self):
"""Scrolls down to get the next set of images"""
# Scroll down to request the next set of images
self._chromeDriver.execute_script(
'window.scroll(0, document.body.clientHeight)')
# Wait for the images to load completely
time.sleep(self.... | [
"def",
"_page_scroll_down",
"(",
"self",
")",
":",
"# Scroll down to request the next set of images",
"self",
".",
"_chromeDriver",
".",
"execute_script",
"(",
"'window.scroll(0, document.body.clientHeight)'",
")",
"# Wait for the images to load completely",
"time",
".",
"sleep",... | Scrolls down to get the next set of images | [
"Scrolls",
"down",
"to",
"get",
"the",
"next",
"set",
"of",
"images"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L210-L226 | train | Scrolls down to get the next set of images |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._download_images | def _download_images(self):
"""
Downloads the images from the retrieved image URLs and
stores in the specified destination folder.
Multiprocessing is being used to minimize the download time
"""
print('\nDownloading Images for the Query: ' + self._imageQuery)
tr... | python | def _download_images(self):
"""
Downloads the images from the retrieved image URLs and
stores in the specified destination folder.
Multiprocessing is being used to minimize the download time
"""
print('\nDownloading Images for the Query: ' + self._imageQuery)
tr... | [
"def",
"_download_images",
"(",
"self",
")",
":",
"print",
"(",
"'\\nDownloading Images for the Query: '",
"+",
"self",
".",
"_imageQuery",
")",
"try",
":",
"self",
".",
"_initialize_progress_bar",
"(",
")",
"# Initialize and assign work to the threads in the threadpool",
... | Downloads the images from the retrieved image URLs and
stores in the specified destination folder.
Multiprocessing is being used to minimize the download time | [
"Downloads",
"the",
"images",
"from",
"the",
"retrieved",
"image",
"URLs",
"and",
"stores",
"in",
"the",
"specified",
"destination",
"folder",
".",
"Multiprocessing",
"is",
"being",
"used",
"to",
"minimize",
"the",
"download",
"time"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L228-L253 | train | Downloads the images from the retrieved image URLs and stores them in the specified destination folder. |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._initialize_progress_bar | def _initialize_progress_bar(self):
"""Initializes the progress bar"""
widgets = ['Download: ', Percentage(), ' ', Bar(),
' ', AdaptiveETA(), ' ', FileTransferSpeed()]
self._downloadProgressBar = ProgressBar(
widgets=widgets, max_value=self._imageCount).start() | python | def _initialize_progress_bar(self):
"""Initializes the progress bar"""
widgets = ['Download: ', Percentage(), ' ', Bar(),
' ', AdaptiveETA(), ' ', FileTransferSpeed()]
self._downloadProgressBar = ProgressBar(
widgets=widgets, max_value=self._imageCount).start() | [
"def",
"_initialize_progress_bar",
"(",
"self",
")",
":",
"widgets",
"=",
"[",
"'Download: '",
",",
"Percentage",
"(",
")",
",",
"' '",
",",
"Bar",
"(",
")",
",",
"' '",
",",
"AdaptiveETA",
"(",
")",
",",
"' '",
",",
"FileTransferSpeed",
"(",
")",
"]",... | Initializes the progress bar | [
"Initializes",
"the",
"progress",
"bar"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L255-L262 | train | Initializes the progress bar |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._download_image | def _download_image(self, imageURL):
"""
Downloads an image file from the given image URL
Arguments:
imageURL {[str]} -- [Image URL]
"""
# If the required count of images have been download,
# refrain from downloading the remainder of the images
if(s... | python | def _download_image(self, imageURL):
"""
Downloads an image file from the given image URL
Arguments:
imageURL {[str]} -- [Image URL]
"""
# If the required count of images have been download,
# refrain from downloading the remainder of the images
if(s... | [
"def",
"_download_image",
"(",
"self",
",",
"imageURL",
")",
":",
"# If the required count of images have been download,",
"# refrain from downloading the remainder of the images",
"if",
"(",
"self",
".",
"_imageCounter",
">=",
"self",
".",
"_imageCount",
")",
":",
"return"... | Downloads an image file from the given image URL
Arguments:
imageURL {[str]} -- [Image URL] | [
"Downloads",
"an",
"image",
"file",
"from",
"the",
"given",
"image",
"URL"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L264-L301 | train | Downloads an image file from the given image URL and saves it to the given storage folder. |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._create_storage_folder | def _create_storage_folder(self):
'''
Creates a storage folder using the query name by replacing
spaces in the query with '_' (underscore)
'''
try:
print(colored('\nCreating Storage Folder...', 'yellow'))
self._storageFolder = os.path.join(
... | python | def _create_storage_folder(self):
'''
Creates a storage folder using the query name by replacing
spaces in the query with '_' (underscore)
'''
try:
print(colored('\nCreating Storage Folder...', 'yellow'))
self._storageFolder = os.path.join(
... | [
"def",
"_create_storage_folder",
"(",
"self",
")",
":",
"try",
":",
"print",
"(",
"colored",
"(",
"'\\nCreating Storage Folder...'",
",",
"'yellow'",
")",
")",
"self",
".",
"_storageFolder",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_destinatio... | Creates a storage folder using the query name by replacing
spaces in the query with '_' (underscore) | [
"Creates",
"a",
"storage",
"folder",
"using",
"the",
"query",
"name",
"by",
"replacing",
"spaces",
"in",
"the",
"query",
"with",
"_",
"(",
"underscore",
")"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L317-L336 | train | Creates a storage folder using the query name. |
bitesofcode/projexui | projexui/widgets/xscintillaedit/xlanguage.py | XLanguage.byFileType | def byFileType( fileType ):
"""
Looks up the language plugin by the inputed file type.
:param fileType | <str>
:return <XLanguage> || None
"""
XLanguage.load()
for lang in XLanguage._plugins.values():
if ( fileType i... | python | def byFileType( fileType ):
"""
Looks up the language plugin by the inputed file type.
:param fileType | <str>
:return <XLanguage> || None
"""
XLanguage.load()
for lang in XLanguage._plugins.values():
if ( fileType i... | [
"def",
"byFileType",
"(",
"fileType",
")",
":",
"XLanguage",
".",
"load",
"(",
")",
"for",
"lang",
"in",
"XLanguage",
".",
"_plugins",
".",
"values",
"(",
")",
":",
"if",
"(",
"fileType",
"in",
"lang",
".",
"fileTypes",
"(",
")",
")",
":",
"return",
... | Looks up the language plugin by the inputed file type.
:param fileType | <str>
:return <XLanguage> || None | [
"Looks",
"up",
"the",
"language",
"plugin",
"by",
"the",
"inputed",
"file",
"type",
".",
":",
"param",
"fileType",
"|",
"<str",
">",
":",
"return",
"<XLanguage",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xscintillaedit/xlanguage.py#L256-L269 | train | Returns the language plugin by the inputed file type. |
bitesofcode/projexui | projexui/widgets/xscintillaedit/xlanguage.py | XLanguage.byLexer | def byLexer( lexer ):
"""
Looks up the language plugin by the lexer class of the inputed lexer.
:param lexer | <QsciLexer>
:return <XLanguage> || None
"""
XLanguage.load()
lexerType = type(lexer)
for lang in XLanguage._p... | python | def byLexer( lexer ):
"""
Looks up the language plugin by the lexer class of the inputed lexer.
:param lexer | <QsciLexer>
:return <XLanguage> || None
"""
XLanguage.load()
lexerType = type(lexer)
for lang in XLanguage._p... | [
"def",
"byLexer",
"(",
"lexer",
")",
":",
"XLanguage",
".",
"load",
"(",
")",
"lexerType",
"=",
"type",
"(",
"lexer",
")",
"for",
"lang",
"in",
"XLanguage",
".",
"_plugins",
".",
"values",
"(",
")",
":",
"if",
"(",
"lang",
".",
"lexerType",
"(",
")... | Looks up the language plugin by the lexer class of the inputed lexer.
:param lexer | <QsciLexer>
:return <XLanguage> || None | [
"Looks",
"up",
"the",
"language",
"plugin",
"by",
"the",
"lexer",
"class",
"of",
"the",
"inputed",
"lexer",
".",
":",
"param",
"lexer",
"|",
"<QsciLexer",
">",
":",
"return",
"<XLanguage",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xscintillaedit/xlanguage.py#L272-L286 | train | Look up the language plugin by the lexer class. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.eventFilter | def eventFilter( self, object, event ):
"""
Resizes this widget with the parent when its resize event is triggered.
:param object | <QObject>
event | <QEvent>
:return <bool> | consumed
"""
if event.type() == event.Resize:
... | python | def eventFilter( self, object, event ):
"""
Resizes this widget with the parent when its resize event is triggered.
:param object | <QObject>
event | <QEvent>
:return <bool> | consumed
"""
if event.type() == event.Resize:
... | [
"def",
"eventFilter",
"(",
"self",
",",
"object",
",",
"event",
")",
":",
"if",
"event",
".",
"type",
"(",
")",
"==",
"event",
".",
"Resize",
":",
"self",
".",
"resize",
"(",
"event",
".",
"size",
"(",
")",
")",
"elif",
"event",
".",
"type",
"(",... | Resizes this widget with the parent when its resize event is triggered.
:param object | <QObject>
event | <QEvent>
:return <bool> | consumed | [
"Resizes",
"this",
"widget",
"with",
"the",
"parent",
"when",
"its",
"resize",
"event",
"is",
"triggered",
".",
":",
"param",
"object",
"|",
"<QObject",
">",
"event",
"|",
"<QEvent",
">",
":",
"return",
"<bool",
">",
"|",
"consumed"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L174-L193 | train | Resizes this widget with the parent when its resize event is triggered. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.increment | def increment(self, amount=1):
"""
Increments the main progress bar by amount.
"""
self._primaryProgressBar.setValue(self.value() + amount)
QApplication.instance().processEvents() | python | def increment(self, amount=1):
"""
Increments the main progress bar by amount.
"""
self._primaryProgressBar.setValue(self.value() + amount)
QApplication.instance().processEvents() | [
"def",
"increment",
"(",
"self",
",",
"amount",
"=",
"1",
")",
":",
"self",
".",
"_primaryProgressBar",
".",
"setValue",
"(",
"self",
".",
"value",
"(",
")",
"+",
"amount",
")",
"QApplication",
".",
"instance",
"(",
")",
".",
"processEvents",
"(",
")"
... | Increments the main progress bar by amount. | [
"Increments",
"the",
"main",
"progress",
"bar",
"by",
"amount",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L195-L200 | train | Increments the main progress bar by amount. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.incrementSub | def incrementSub(self, amount=1):
"""
Increments the sub-progress bar by amount.
"""
self._subProgressBar.setValue(self.subValue() + amount)
QApplication.instance().processEvents() | python | def incrementSub(self, amount=1):
"""
Increments the sub-progress bar by amount.
"""
self._subProgressBar.setValue(self.subValue() + amount)
QApplication.instance().processEvents() | [
"def",
"incrementSub",
"(",
"self",
",",
"amount",
"=",
"1",
")",
":",
"self",
".",
"_subProgressBar",
".",
"setValue",
"(",
"self",
".",
"subValue",
"(",
")",
"+",
"amount",
")",
"QApplication",
".",
"instance",
"(",
")",
".",
"processEvents",
"(",
")... | Increments the sub-progress bar by amount. | [
"Increments",
"the",
"sub",
"-",
"progress",
"bar",
"by",
"amount",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L202-L207 | train | Increments the sub - progress bar by amount. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.resize | def resize(self, size):
"""
Handles when the loader is too small for an area.
:param event | <QResizeEvent>
"""
super(XLoaderWidget, self).resize(size)
# show small loader
if size.width() < self._loaderFrame.width() or \
... | python | def resize(self, size):
"""
Handles when the loader is too small for an area.
:param event | <QResizeEvent>
"""
super(XLoaderWidget, self).resize(size)
# show small loader
if size.width() < self._loaderFrame.width() or \
... | [
"def",
"resize",
"(",
"self",
",",
"size",
")",
":",
"super",
"(",
"XLoaderWidget",
",",
"self",
")",
".",
"resize",
"(",
"size",
")",
"# show small loader\r",
"if",
"size",
".",
"width",
"(",
")",
"<",
"self",
".",
"_loaderFrame",
".",
"width",
"(",
... | Handles when the loader is too small for an area.
:param event | <QResizeEvent> | [
"Handles",
"when",
"the",
"loader",
"is",
"too",
"small",
"for",
"an",
"area",
".",
":",
"param",
"event",
"|",
"<QResizeEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L225-L242 | train | Resize the loader frame. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.setCurrentMode | def setCurrentMode( self, mode ):
"""
Sets what mode this loader will be in.
:param mode | <XLoaderWidget.Mode>
"""
if ( mode == self._currentMode ):
return
self._currentMode = mode
ajax = mode == XLoaderWidget.Mode.... | python | def setCurrentMode( self, mode ):
"""
Sets what mode this loader will be in.
:param mode | <XLoaderWidget.Mode>
"""
if ( mode == self._currentMode ):
return
self._currentMode = mode
ajax = mode == XLoaderWidget.Mode.... | [
"def",
"setCurrentMode",
"(",
"self",
",",
"mode",
")",
":",
"if",
"(",
"mode",
"==",
"self",
".",
"_currentMode",
")",
":",
"return",
"self",
".",
"_currentMode",
"=",
"mode",
"ajax",
"=",
"mode",
"==",
"XLoaderWidget",
".",
"Mode",
".",
"Spinner",
"s... | Sets what mode this loader will be in.
:param mode | <XLoaderWidget.Mode> | [
"Sets",
"what",
"mode",
"this",
"loader",
"will",
"be",
"in",
".",
":",
"param",
"mode",
"|",
"<XLoaderWidget",
".",
"Mode",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L252-L266 | train | Sets the current mode of the loader. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.setMovie | def setMovie( self, movie ):
"""
Sets the movie for this loader to the inputed movie.
:param movie | <QMovie>
"""
self._movieLabel.setMovie(movie)
self._smallMovieLabel.setMovie(movie) | python | def setMovie( self, movie ):
"""
Sets the movie for this loader to the inputed movie.
:param movie | <QMovie>
"""
self._movieLabel.setMovie(movie)
self._smallMovieLabel.setMovie(movie) | [
"def",
"setMovie",
"(",
"self",
",",
"movie",
")",
":",
"self",
".",
"_movieLabel",
".",
"setMovie",
"(",
"movie",
")",
"self",
".",
"_smallMovieLabel",
".",
"setMovie",
"(",
"movie",
")"
] | Sets the movie for this loader to the inputed movie.
:param movie | <QMovie> | [
"Sets",
"the",
"movie",
"for",
"this",
"loader",
"to",
"the",
"inputed",
"movie",
".",
":",
"param",
"movie",
"|",
"<QMovie",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L276-L283 | train | Sets the movie for this loader to the inputed movie. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.setTotal | def setTotal( self, amount ):
"""
Sets the total amount for the main progress bar.
:param amount | <int>
"""
self._primaryProgressBar.setValue(0)
self._primaryProgressBar.setMaximum(amount)
if amount:
self.setCurrentMode(XLoaderW... | python | def setTotal( self, amount ):
"""
Sets the total amount for the main progress bar.
:param amount | <int>
"""
self._primaryProgressBar.setValue(0)
self._primaryProgressBar.setMaximum(amount)
if amount:
self.setCurrentMode(XLoaderW... | [
"def",
"setTotal",
"(",
"self",
",",
"amount",
")",
":",
"self",
".",
"_primaryProgressBar",
".",
"setValue",
"(",
"0",
")",
"self",
".",
"_primaryProgressBar",
".",
"setMaximum",
"(",
"amount",
")",
"if",
"amount",
":",
"self",
".",
"setCurrentMode",
"(",... | Sets the total amount for the main progress bar.
:param amount | <int> | [
"Sets",
"the",
"total",
"amount",
"for",
"the",
"main",
"progress",
"bar",
".",
":",
"param",
"amount",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L285-L295 | train | Sets the total amount for the main progress bar. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.setSubTotal | def setSubTotal( self, amount ):
"""
Sets the total value for the sub progress bar.
:param amount | <int>
"""
self._subProgressBar.setValue(0)
self._subProgressBar.setMaximum(amount)
if amount:
self.setShowSubProgress(True) | python | def setSubTotal( self, amount ):
"""
Sets the total value for the sub progress bar.
:param amount | <int>
"""
self._subProgressBar.setValue(0)
self._subProgressBar.setMaximum(amount)
if amount:
self.setShowSubProgress(True) | [
"def",
"setSubTotal",
"(",
"self",
",",
"amount",
")",
":",
"self",
".",
"_subProgressBar",
".",
"setValue",
"(",
"0",
")",
"self",
".",
"_subProgressBar",
".",
"setMaximum",
"(",
"amount",
")",
"if",
"amount",
":",
"self",
".",
"setShowSubProgress",
"(",
... | Sets the total value for the sub progress bar.
:param amount | <int> | [
"Sets",
"the",
"total",
"value",
"for",
"the",
"sub",
"progress",
"bar",
".",
":",
"param",
"amount",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L297-L306 | train | Sets the total value for the sub progress bar. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.setShowSubProgress | def setShowSubProgress( self, state ):
"""
Toggles whether or not the sub progress bar should be visible.
:param state | <bool>
"""
ajax = self.currentMode() == XLoaderWidget.Mode.Spinner
self._showSubProgress = state
self._subProgressBar.setVisible(... | python | def setShowSubProgress( self, state ):
"""
Toggles whether or not the sub progress bar should be visible.
:param state | <bool>
"""
ajax = self.currentMode() == XLoaderWidget.Mode.Spinner
self._showSubProgress = state
self._subProgressBar.setVisible(... | [
"def",
"setShowSubProgress",
"(",
"self",
",",
"state",
")",
":",
"ajax",
"=",
"self",
".",
"currentMode",
"(",
")",
"==",
"XLoaderWidget",
".",
"Mode",
".",
"Spinner",
"self",
".",
"_showSubProgress",
"=",
"state",
"self",
".",
"_subProgressBar",
".",
"se... | Toggles whether or not the sub progress bar should be visible.
:param state | <bool> | [
"Toggles",
"whether",
"or",
"not",
"the",
"sub",
"progress",
"bar",
"should",
"be",
"visible",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L316-L324 | train | Sets whether or not the sub progress bar should be visible. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.getMovie | def getMovie():
"""
Returns the movie instance for the loader widget.
:return <QMovie>
"""
if not XLoaderWidget.MOVIE:
filename = projexui.resources.find('img/ajax_loader.gif')
XLoaderWidget.MOVIE = QMovie()
XLoaderWidget.MOVIE.set... | python | def getMovie():
"""
Returns the movie instance for the loader widget.
:return <QMovie>
"""
if not XLoaderWidget.MOVIE:
filename = projexui.resources.find('img/ajax_loader.gif')
XLoaderWidget.MOVIE = QMovie()
XLoaderWidget.MOVIE.set... | [
"def",
"getMovie",
"(",
")",
":",
"if",
"not",
"XLoaderWidget",
".",
"MOVIE",
":",
"filename",
"=",
"projexui",
".",
"resources",
".",
"find",
"(",
"'img/ajax_loader.gif'",
")",
"XLoaderWidget",
".",
"MOVIE",
"=",
"QMovie",
"(",
")",
"XLoaderWidget",
".",
... | Returns the movie instance for the loader widget.
:return <QMovie> | [
"Returns",
"the",
"movie",
"instance",
"for",
"the",
"loader",
"widget",
".",
":",
"return",
"<QMovie",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L360-L372 | train | Returns the movie instance for the loader widget. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.start | def start(widget, processEvents=True, style=None, movie=None):
"""
Starts a loader widget on the inputed widget.
:param widget | <QWidget>
:return <XLoaderWidget>
"""
if style is None:
style = os.environ.get('PROJEXUI_LOAD... | python | def start(widget, processEvents=True, style=None, movie=None):
"""
Starts a loader widget on the inputed widget.
:param widget | <QWidget>
:return <XLoaderWidget>
"""
if style is None:
style = os.environ.get('PROJEXUI_LOAD... | [
"def",
"start",
"(",
"widget",
",",
"processEvents",
"=",
"True",
",",
"style",
"=",
"None",
",",
"movie",
"=",
"None",
")",
":",
"if",
"style",
"is",
"None",
":",
"style",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'PROJEXUI_LOADER_STYLE'",
",",
"... | Starts a loader widget on the inputed widget.
:param widget | <QWidget>
:return <XLoaderWidget> | [
"Starts",
"a",
"loader",
"widget",
"on",
"the",
"inputed",
"widget",
".",
":",
"param",
"widget",
"|",
"<QWidget",
">",
":",
"return",
"<XLoaderWidget",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L375-L416 | train | Starts a new loader widget on the inputed widget. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.stop | def stop(widget, force=False):
"""
Stops a loader widget on the inputed widget.
:param widget | <QWidget>
"""
# make sure we have a widget to stop
loader = getattr(widget, '_private_xloader_widget', None)
if not loader:
return
... | python | def stop(widget, force=False):
"""
Stops a loader widget on the inputed widget.
:param widget | <QWidget>
"""
# make sure we have a widget to stop
loader = getattr(widget, '_private_xloader_widget', None)
if not loader:
return
... | [
"def",
"stop",
"(",
"widget",
",",
"force",
"=",
"False",
")",
":",
"# make sure we have a widget to stop\r",
"loader",
"=",
"getattr",
"(",
"widget",
",",
"'_private_xloader_widget'",
",",
"None",
")",
"if",
"not",
"loader",
":",
"return",
"# decrement the number... | Stops a loader widget on the inputed widget.
:param widget | <QWidget> | [
"Stops",
"a",
"loader",
"widget",
"on",
"the",
"inputed",
"widget",
".",
":",
"param",
"widget",
"|",
"<QWidget",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L419-L442 | train | Stops a loader widget on the inputed widget. |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.stopAll | def stopAll(widget):
"""
Stops all loader widgets from this parent down, cleaning out the \
memory for them.
:param widget | <QWidget>
"""
for loader in widget.findChildren(XLoaderWidget):
loader.setParent(None)
loader.deleteLater() | python | def stopAll(widget):
"""
Stops all loader widgets from this parent down, cleaning out the \
memory for them.
:param widget | <QWidget>
"""
for loader in widget.findChildren(XLoaderWidget):
loader.setParent(None)
loader.deleteLater() | [
"def",
"stopAll",
"(",
"widget",
")",
":",
"for",
"loader",
"in",
"widget",
".",
"findChildren",
"(",
"XLoaderWidget",
")",
":",
"loader",
".",
"setParent",
"(",
"None",
")",
"loader",
".",
"deleteLater",
"(",
")"
] | Stops all loader widgets from this parent down, cleaning out the \
memory for them.
:param widget | <QWidget> | [
"Stops",
"all",
"loader",
"widgets",
"from",
"this",
"parent",
"down",
"cleaning",
"out",
"the",
"\\",
"memory",
"for",
"them",
".",
":",
"param",
"widget",
"|",
"<QWidget",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L445-L454 | train | Stops all loader widgets from this parent down cleaning out the memory for them. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart._addDatasetAction | def _addDatasetAction(self, dataset):
"""
Adds an action for the inputed dataset to the toolbar
:param dataset | <XChartDataset>
"""
# create the toolbar action
action = QAction(dataset.name(), self)
action.setIcon(XColorIcon(dataset.color())... | python | def _addDatasetAction(self, dataset):
"""
Adds an action for the inputed dataset to the toolbar
:param dataset | <XChartDataset>
"""
# create the toolbar action
action = QAction(dataset.name(), self)
action.setIcon(XColorIcon(dataset.color())... | [
"def",
"_addDatasetAction",
"(",
"self",
",",
"dataset",
")",
":",
"# create the toolbar action\r",
"action",
"=",
"QAction",
"(",
"dataset",
".",
"name",
"(",
")",
",",
"self",
")",
"action",
".",
"setIcon",
"(",
"XColorIcon",
"(",
"dataset",
".",
"color",
... | Adds an action for the inputed dataset to the toolbar
:param dataset | <XChartDataset> | [
"Adds",
"an",
"action",
"for",
"the",
"inputed",
"dataset",
"to",
"the",
"toolbar",
":",
"param",
"dataset",
"|",
"<XChartDataset",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L154-L168 | train | Adds an action for the inputed dataset to the toolbar. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart._drawBackground | def _drawBackground(self, scene, painter, rect):
"""
Draws the backgroud for a particular scene within the charts.
:param scene | <XChartScene>
painter | <QPainter>
rect | <QRectF>
"""
rect = scene.sceneRect()
... | python | def _drawBackground(self, scene, painter, rect):
"""
Draws the backgroud for a particular scene within the charts.
:param scene | <XChartScene>
painter | <QPainter>
rect | <QRectF>
"""
rect = scene.sceneRect()
... | [
"def",
"_drawBackground",
"(",
"self",
",",
"scene",
",",
"painter",
",",
"rect",
")",
":",
"rect",
"=",
"scene",
".",
"sceneRect",
"(",
")",
"if",
"scene",
"==",
"self",
".",
"uiChartVIEW",
".",
"scene",
"(",
")",
":",
"self",
".",
"renderer",
"(",
... | Draws the backgroud for a particular scene within the charts.
:param scene | <XChartScene>
painter | <QPainter>
rect | <QRectF> | [
"Draws",
"the",
"backgroud",
"for",
"a",
"particular",
"scene",
"within",
"the",
"charts",
".",
":",
"param",
"scene",
"|",
"<XChartScene",
">",
"painter",
"|",
"<QPainter",
">",
"rect",
"|",
"<QRectF",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L170-L188 | train | Draw the background for a particular scene. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart._drawForeground | def _drawForeground(self, scene, painter, rect):
"""
Draws the backgroud for a particular scene within the charts.
:param scene | <XChartScene>
painter | <QPainter>
rect | <QRectF>
"""
rect = scene.sceneRect()
... | python | def _drawForeground(self, scene, painter, rect):
"""
Draws the backgroud for a particular scene within the charts.
:param scene | <XChartScene>
painter | <QPainter>
rect | <QRectF>
"""
rect = scene.sceneRect()
... | [
"def",
"_drawForeground",
"(",
"self",
",",
"scene",
",",
"painter",
",",
"rect",
")",
":",
"rect",
"=",
"scene",
".",
"sceneRect",
"(",
")",
"if",
"scene",
"==",
"self",
".",
"uiChartVIEW",
".",
"scene",
"(",
")",
":",
"self",
".",
"renderer",
"(",
... | Draws the backgroud for a particular scene within the charts.
:param scene | <XChartScene>
painter | <QPainter>
rect | <QRectF> | [
"Draws",
"the",
"backgroud",
"for",
"a",
"particular",
"scene",
"within",
"the",
"charts",
".",
":",
"param",
"scene",
"|",
"<XChartScene",
">",
"painter",
"|",
"<QPainter",
">",
"rect",
"|",
"<QRectF",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L190-L204 | train | Draw the foreground for a particular scene within the charts. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.addDataset | def addDataset(self, dataset):
"""
Adds the given data set to this chart widget.
:param dataSet | <XChartDataset>
"""
self._datasets.append(dataset)
self._dataChanged = True
self._addDatasetAction(dataset) | python | def addDataset(self, dataset):
"""
Adds the given data set to this chart widget.
:param dataSet | <XChartDataset>
"""
self._datasets.append(dataset)
self._dataChanged = True
self._addDatasetAction(dataset) | [
"def",
"addDataset",
"(",
"self",
",",
"dataset",
")",
":",
"self",
".",
"_datasets",
".",
"append",
"(",
"dataset",
")",
"self",
".",
"_dataChanged",
"=",
"True",
"self",
".",
"_addDatasetAction",
"(",
"dataset",
")"
] | Adds the given data set to this chart widget.
:param dataSet | <XChartDataset> | [
"Adds",
"the",
"given",
"data",
"set",
"to",
"this",
"chart",
"widget",
".",
":",
"param",
"dataSet",
"|",
"<XChartDataset",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L217-L225 | train | Adds the given dataset to this chart widget. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.assignRenderer | def assignRenderer(self, action):
"""
Assigns the renderer for this chart to the current selected
renderer.
"""
name = nativestring(action.text()).split(' ')[0]
self._renderer = XChartRenderer.plugin(name)
self.uiTypeBTN.setDefaultAction(action)
se... | python | def assignRenderer(self, action):
"""
Assigns the renderer for this chart to the current selected
renderer.
"""
name = nativestring(action.text()).split(' ')[0]
self._renderer = XChartRenderer.plugin(name)
self.uiTypeBTN.setDefaultAction(action)
se... | [
"def",
"assignRenderer",
"(",
"self",
",",
"action",
")",
":",
"name",
"=",
"nativestring",
"(",
"action",
".",
"text",
"(",
")",
")",
".",
"split",
"(",
"' '",
")",
"[",
"0",
"]",
"self",
".",
"_renderer",
"=",
"XChartRenderer",
".",
"plugin",
"(",
... | Assigns the renderer for this chart to the current selected
renderer. | [
"Assigns",
"the",
"renderer",
"for",
"this",
"chart",
"to",
"the",
"current",
"selected",
"renderer",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L235-L243 | train | Assigns the renderer for this chart to the current selected one |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.axes | def axes(self):
"""
Returns all the axes that have been defined for this chart.
:return [<projexui.widgets.xchart.XChartAxis>, ..]
"""
out = self._axes[:]
if self._horizontalAxis:
out.append(self._horizontalAxis)
if self._vertical... | python | def axes(self):
"""
Returns all the axes that have been defined for this chart.
:return [<projexui.widgets.xchart.XChartAxis>, ..]
"""
out = self._axes[:]
if self._horizontalAxis:
out.append(self._horizontalAxis)
if self._vertical... | [
"def",
"axes",
"(",
"self",
")",
":",
"out",
"=",
"self",
".",
"_axes",
"[",
":",
"]",
"if",
"self",
".",
"_horizontalAxis",
":",
"out",
".",
"append",
"(",
"self",
".",
"_horizontalAxis",
")",
"if",
"self",
".",
"_verticalAxis",
":",
"out",
".",
"... | Returns all the axes that have been defined for this chart.
:return [<projexui.widgets.xchart.XChartAxis>, ..] | [
"Returns",
"all",
"the",
"axes",
"that",
"have",
"been",
"defined",
"for",
"this",
"chart",
".",
":",
"return",
"[",
"<projexui",
".",
"widgets",
".",
"xchart",
".",
"XChartAxis",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L245-L256 | train | Returns a list of all the axes that have been defined for this chart. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.axis | def axis(self, name):
"""
Looks up an axis for this chart by the given name.
:return <projexui.widgets.xchart.XChartAxis> || None
"""
for axis in self.axes():
if axis.name() == name:
return axis
return None | python | def axis(self, name):
"""
Looks up an axis for this chart by the given name.
:return <projexui.widgets.xchart.XChartAxis> || None
"""
for axis in self.axes():
if axis.name() == name:
return axis
return None | [
"def",
"axis",
"(",
"self",
",",
"name",
")",
":",
"for",
"axis",
"in",
"self",
".",
"axes",
"(",
")",
":",
"if",
"axis",
".",
"name",
"(",
")",
"==",
"name",
":",
"return",
"axis",
"return",
"None"
] | Looks up an axis for this chart by the given name.
:return <projexui.widgets.xchart.XChartAxis> || None | [
"Looks",
"up",
"an",
"axis",
"for",
"this",
"chart",
"by",
"the",
"given",
"name",
".",
":",
"return",
"<projexui",
".",
"widgets",
".",
"xchart",
".",
"XChartAxis",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L258-L267 | train | Returns the axis with the given name or None if no axis exists. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.compareValues | def compareValues(self, a, b):
"""
Compares two values based on their values for this axis.
:param a | <variant>
b | <variant>
"""
values = self.values()
try:
return cmp(values.index(a), values.index(b))
exce... | python | def compareValues(self, a, b):
"""
Compares two values based on their values for this axis.
:param a | <variant>
b | <variant>
"""
values = self.values()
try:
return cmp(values.index(a), values.index(b))
exce... | [
"def",
"compareValues",
"(",
"self",
",",
"a",
",",
"b",
")",
":",
"values",
"=",
"self",
".",
"values",
"(",
")",
"try",
":",
"return",
"cmp",
"(",
"values",
".",
"index",
"(",
"a",
")",
",",
"values",
".",
"index",
"(",
"b",
")",
")",
"except... | Compares two values based on their values for this axis.
:param a | <variant>
b | <variant> | [
"Compares",
"two",
"values",
"based",
"on",
"their",
"values",
"for",
"this",
"axis",
".",
":",
"param",
"a",
"|",
"<variant",
">",
"b",
"|",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L297-L308 | train | Compares two values based on their values for this axis. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.datasets | def datasets(self, visible=True):
"""
Returns a list of the data sets that are assigned with this
chart widget.
:param visible | <bool>
:return [<XChartDataSet>, ..]
"""
if visible is not None:
return filter(lambda ... | python | def datasets(self, visible=True):
"""
Returns a list of the data sets that are assigned with this
chart widget.
:param visible | <bool>
:return [<XChartDataSet>, ..]
"""
if visible is not None:
return filter(lambda ... | [
"def",
"datasets",
"(",
"self",
",",
"visible",
"=",
"True",
")",
":",
"if",
"visible",
"is",
"not",
"None",
":",
"return",
"filter",
"(",
"lambda",
"x",
":",
"x",
".",
"isVisible",
"(",
")",
",",
"self",
".",
"_datasets",
")",
"return",
"self",
".... | Returns a list of the data sets that are assigned with this
chart widget.
:param visible | <bool>
:return [<XChartDataSet>, ..] | [
"Returns",
"a",
"list",
"of",
"the",
"data",
"sets",
"that",
"are",
"assigned",
"with",
"this",
"chart",
"widget",
".",
":",
"param",
"visible",
"|",
"<bool",
">",
":",
"return",
"[",
"<XChartDataSet",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L310-L321 | train | Returns a list of all the data sets assigned with this chart widget. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.pointAt | def pointAt(self, **axis_values):
"""
Returns the point on the chart where the inputed values are located.
:return <QPointF>
"""
scene_point = self.renderer().pointAt(self.axes(), axis_values)
chart_point = self.uiChartVIEW.mapFromScene(scene_point)
... | python | def pointAt(self, **axis_values):
"""
Returns the point on the chart where the inputed values are located.
:return <QPointF>
"""
scene_point = self.renderer().pointAt(self.axes(), axis_values)
chart_point = self.uiChartVIEW.mapFromScene(scene_point)
... | [
"def",
"pointAt",
"(",
"self",
",",
"*",
"*",
"axis_values",
")",
":",
"scene_point",
"=",
"self",
".",
"renderer",
"(",
")",
".",
"pointAt",
"(",
"self",
".",
"axes",
"(",
")",
",",
"axis_values",
")",
"chart_point",
"=",
"self",
".",
"uiChartVIEW",
... | Returns the point on the chart where the inputed values are located.
:return <QPointF> | [
"Returns",
"the",
"point",
"on",
"the",
"chart",
"where",
"the",
"inputed",
"values",
"are",
"located",
".",
":",
"return",
"<QPointF",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L353-L361 | train | Returns the point on the chart where the inputed values are located. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.recalculate | def recalculate(self):
"""
Recalculates the information for this chart.
"""
if not (self.isVisible() and self.renderer()):
return
# update dynamic range
if self._dataChanged:
for axis in self.axes():
if axis.useDy... | python | def recalculate(self):
"""
Recalculates the information for this chart.
"""
if not (self.isVisible() and self.renderer()):
return
# update dynamic range
if self._dataChanged:
for axis in self.axes():
if axis.useDy... | [
"def",
"recalculate",
"(",
"self",
")",
":",
"if",
"not",
"(",
"self",
".",
"isVisible",
"(",
")",
"and",
"self",
".",
"renderer",
"(",
")",
")",
":",
"return",
"# update dynamic range\r",
"if",
"self",
".",
"_dataChanged",
":",
"for",
"axis",
"in",
"s... | Recalculates the information for this chart. | [
"Recalculates",
"the",
"information",
"for",
"this",
"chart",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L369-L420 | train | Recalculates the information for this chart. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.removeAxis | def removeAxis(self, axis):
"""
Removes an axis from this chart either by direct reference or by
name.
:param axis | <projexui.widgets.XChartAxis> || <str>
"""
if not isinstance(axis, XChartAxis):
axis = self.axis(nativestring(axis))
... | python | def removeAxis(self, axis):
"""
Removes an axis from this chart either by direct reference or by
name.
:param axis | <projexui.widgets.XChartAxis> || <str>
"""
if not isinstance(axis, XChartAxis):
axis = self.axis(nativestring(axis))
... | [
"def",
"removeAxis",
"(",
"self",
",",
"axis",
")",
":",
"if",
"not",
"isinstance",
"(",
"axis",
",",
"XChartAxis",
")",
":",
"axis",
"=",
"self",
".",
"axis",
"(",
"nativestring",
"(",
"axis",
")",
")",
"try",
":",
"self",
".",
"_axes",
".",
"remo... | Removes an axis from this chart either by direct reference or by
name.
:param axis | <projexui.widgets.XChartAxis> || <str> | [
"Removes",
"an",
"axis",
"from",
"this",
"chart",
"either",
"by",
"direct",
"reference",
"or",
"by",
"name",
".",
":",
"param",
"axis",
"|",
"<projexui",
".",
"widgets",
".",
"XChartAxis",
">",
"||",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L422-L435 | train | Removes an axis from this chart either by direct reference or by name. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.resizeEvent | def resizeEvent(self, event):
"""
Recalculates the chart information when the widget resizes.
:param event | <QResizeEvent>
"""
super(XChart, self).resizeEvent(event)
if self.isVisible():
self.recalculate() | python | def resizeEvent(self, event):
"""
Recalculates the chart information when the widget resizes.
:param event | <QResizeEvent>
"""
super(XChart, self).resizeEvent(event)
if self.isVisible():
self.recalculate() | [
"def",
"resizeEvent",
"(",
"self",
",",
"event",
")",
":",
"super",
"(",
"XChart",
",",
"self",
")",
".",
"resizeEvent",
"(",
"event",
")",
"if",
"self",
".",
"isVisible",
"(",
")",
":",
"self",
".",
"recalculate",
"(",
")"
] | Recalculates the chart information when the widget resizes.
:param event | <QResizeEvent> | [
"Recalculates",
"the",
"chart",
"information",
"when",
"the",
"widget",
"resizes",
".",
":",
"param",
"event",
"|",
"<QResizeEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L453-L462 | train | Recalculates the chart information when the widget resizes. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.setRenderer | def setRenderer(self, renderer):
"""
Sets the current renderer associated with this plot.
:param renderer | <XChartRenderer> || <str>
:return <bool> | success
"""
if not isinstance(renderer, XChartRenderer):
renderer = XChar... | python | def setRenderer(self, renderer):
"""
Sets the current renderer associated with this plot.
:param renderer | <XChartRenderer> || <str>
:return <bool> | success
"""
if not isinstance(renderer, XChartRenderer):
renderer = XChar... | [
"def",
"setRenderer",
"(",
"self",
",",
"renderer",
")",
":",
"if",
"not",
"isinstance",
"(",
"renderer",
",",
"XChartRenderer",
")",
":",
"renderer",
"=",
"XChartRenderer",
".",
"plugin",
"(",
"nativestring",
"(",
"renderer",
")",
")",
"if",
"renderer",
"... | Sets the current renderer associated with this plot.
:param renderer | <XChartRenderer> || <str>
:return <bool> | success | [
"Sets",
"the",
"current",
"renderer",
"associated",
"with",
"this",
"plot",
".",
":",
"param",
"renderer",
"|",
"<XChartRenderer",
">",
"||",
"<str",
">",
":",
"return",
"<bool",
">",
"|",
"success"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L486-L507 | train | Sets the current renderer associated with this plot. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.setDatasets | def setDatasets(self, datasets):
"""
Sets the dataset list for this chart to the inputed data.
:param datasets | [<XChartDataset>, ..]
"""
self.clearDatasets()
self._datasets = datasets
for dataset in datasets:
self._ad... | python | def setDatasets(self, datasets):
"""
Sets the dataset list for this chart to the inputed data.
:param datasets | [<XChartDataset>, ..]
"""
self.clearDatasets()
self._datasets = datasets
for dataset in datasets:
self._ad... | [
"def",
"setDatasets",
"(",
"self",
",",
"datasets",
")",
":",
"self",
".",
"clearDatasets",
"(",
")",
"self",
".",
"_datasets",
"=",
"datasets",
"for",
"dataset",
"in",
"datasets",
":",
"self",
".",
"_addDatasetAction",
"(",
"dataset",
")",
"self",
".",
... | Sets the dataset list for this chart to the inputed data.
:param datasets | [<XChartDataset>, ..] | [
"Sets",
"the",
"dataset",
"list",
"for",
"this",
"chart",
"to",
"the",
"inputed",
"data",
".",
":",
"param",
"datasets",
"|",
"[",
"<XChartDataset",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L517-L530 | train | Sets the dataset list for this chart to the inputed data. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.setHorizontalAxis | def setHorizontalAxis(self, axis):
"""
Sets the horizontal axis for this chart.
:param axis | <XChartAxis>
"""
self._horizontalAxis = axis
if axis:
axis.setOrientation(Qt.Horizontal)
self.uiXAxisVIEW.setFixedHeight(axis.minim... | python | def setHorizontalAxis(self, axis):
"""
Sets the horizontal axis for this chart.
:param axis | <XChartAxis>
"""
self._horizontalAxis = axis
if axis:
axis.setOrientation(Qt.Horizontal)
self.uiXAxisVIEW.setFixedHeight(axis.minim... | [
"def",
"setHorizontalAxis",
"(",
"self",
",",
"axis",
")",
":",
"self",
".",
"_horizontalAxis",
"=",
"axis",
"if",
"axis",
":",
"axis",
".",
"setOrientation",
"(",
"Qt",
".",
"Horizontal",
")",
"self",
".",
"uiXAxisVIEW",
".",
"setFixedHeight",
"(",
"axis"... | Sets the horizontal axis for this chart.
:param axis | <XChartAxis> | [
"Sets",
"the",
"horizontal",
"axis",
"for",
"this",
"chart",
".",
":",
"param",
"axis",
"|",
"<XChartAxis",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L540-L551 | train | Sets the horizontal axis for this chart. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.setVerticalAxis | def setVerticalAxis(self, axis):
"""
Sets the vertical axis for this chart.
:param axis | <XChartAxis>
"""
self._verticalAxis = axis
if axis:
axis.setOrientation(Qt.Vertical)
self.uiYAxisVIEW.setFixedWidth(axis.minimumLabelWi... | python | def setVerticalAxis(self, axis):
"""
Sets the vertical axis for this chart.
:param axis | <XChartAxis>
"""
self._verticalAxis = axis
if axis:
axis.setOrientation(Qt.Vertical)
self.uiYAxisVIEW.setFixedWidth(axis.minimumLabelWi... | [
"def",
"setVerticalAxis",
"(",
"self",
",",
"axis",
")",
":",
"self",
".",
"_verticalAxis",
"=",
"axis",
"if",
"axis",
":",
"axis",
".",
"setOrientation",
"(",
"Qt",
".",
"Vertical",
")",
"self",
".",
"uiYAxisVIEW",
".",
"setFixedWidth",
"(",
"axis",
"."... | Sets the vertical axis for this chart.
:param axis | <XChartAxis> | [
"Sets",
"the",
"vertical",
"axis",
"for",
"this",
"chart",
".",
":",
"param",
"axis",
"|",
"<XChartAxis",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L553-L564 | train | Sets the vertical axis for this chart. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.setShowDatasetToolbar | def setShowDatasetToolbar(self, state):
"""
Sets whether or not the dataset toolbar is visible.
:param state | <bool>
"""
self._showDatasetToolbar = state
if not state:
self.uiDatasetTBAR.hide()
else:
self.uiDatasetT... | python | def setShowDatasetToolbar(self, state):
"""
Sets whether or not the dataset toolbar is visible.
:param state | <bool>
"""
self._showDatasetToolbar = state
if not state:
self.uiDatasetTBAR.hide()
else:
self.uiDatasetT... | [
"def",
"setShowDatasetToolbar",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_showDatasetToolbar",
"=",
"state",
"if",
"not",
"state",
":",
"self",
".",
"uiDatasetTBAR",
".",
"hide",
"(",
")",
"else",
":",
"self",
".",
"uiDatasetTBAR",
".",
"show",
... | Sets whether or not the dataset toolbar is visible.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"the",
"dataset",
"toolbar",
"is",
"visible",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L574-L584 | train | Sets whether or not the dataset toolbar is visible. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.setShowTypeButton | def setShowTypeButton(self, state):
"""
Sets whether or not the type button is visible.
:param state | <bool>
"""
self._showTypeButton = state
if not state:
self.uiTypeBTN.hide()
else:
self.uiTypeBTN.show() | python | def setShowTypeButton(self, state):
"""
Sets whether or not the type button is visible.
:param state | <bool>
"""
self._showTypeButton = state
if not state:
self.uiTypeBTN.hide()
else:
self.uiTypeBTN.show() | [
"def",
"setShowTypeButton",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_showTypeButton",
"=",
"state",
"if",
"not",
"state",
":",
"self",
".",
"uiTypeBTN",
".",
"hide",
"(",
")",
"else",
":",
"self",
".",
"uiTypeBTN",
".",
"show",
"(",
")"
] | Sets whether or not the type button is visible.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"the",
"type",
"button",
"is",
"visible",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L602-L612 | train | Sets whether or not the type button is visible. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.syncScrollbars | def syncScrollbars(self):
"""
Synchronizes the various scrollbars within this chart.
"""
chart_hbar = self.uiChartVIEW.horizontalScrollBar()
chart_vbar = self.uiChartVIEW.verticalScrollBar()
x_hbar = self.uiXAxisVIEW.horizontalScrollBar()
x_vbar =... | python | def syncScrollbars(self):
"""
Synchronizes the various scrollbars within this chart.
"""
chart_hbar = self.uiChartVIEW.horizontalScrollBar()
chart_vbar = self.uiChartVIEW.verticalScrollBar()
x_hbar = self.uiXAxisVIEW.horizontalScrollBar()
x_vbar =... | [
"def",
"syncScrollbars",
"(",
"self",
")",
":",
"chart_hbar",
"=",
"self",
".",
"uiChartVIEW",
".",
"horizontalScrollBar",
"(",
")",
"chart_vbar",
"=",
"self",
".",
"uiChartVIEW",
".",
"verticalScrollBar",
"(",
")",
"x_hbar",
"=",
"self",
".",
"uiXAxisVIEW",
... | Synchronizes the various scrollbars within this chart. | [
"Synchronizes",
"the",
"various",
"scrollbars",
"within",
"this",
"chart",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L692-L712 | train | Updates the scrollbars of the current chart with the new ones. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.toggleDataset | def toggleDataset(self, state, dataset=None):
"""
Toggles the dataset based on the given action or dataset.
:param state | <bool>
dataset | <XChartDataset>
"""
if dataset is None and self.sender():
dataset = unwrapVariant(self... | python | def toggleDataset(self, state, dataset=None):
"""
Toggles the dataset based on the given action or dataset.
:param state | <bool>
dataset | <XChartDataset>
"""
if dataset is None and self.sender():
dataset = unwrapVariant(self... | [
"def",
"toggleDataset",
"(",
"self",
",",
"state",
",",
"dataset",
"=",
"None",
")",
":",
"if",
"dataset",
"is",
"None",
"and",
"self",
".",
"sender",
"(",
")",
":",
"dataset",
"=",
"unwrapVariant",
"(",
"self",
".",
"sender",
"(",
")",
".",
"data",
... | Toggles the dataset based on the given action or dataset.
:param state | <bool>
dataset | <XChartDataset> | [
"Toggles",
"the",
"dataset",
"based",
"on",
"the",
"given",
"action",
"or",
"dataset",
".",
":",
"param",
"state",
"|",
"<bool",
">",
"dataset",
"|",
"<XChartDataset",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L714-L726 | train | Toggles the dataset based on the given action or dataset. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.valueAt | def valueAt(self, point):
"""
Returns the value within the chart for the given point.
:param point | <QPoint>
:return {<str> axis name: <variant> value, ..}
"""
chart_point = self.uiChartVIEW.mapFromParent(point)
scene_point = s... | python | def valueAt(self, point):
"""
Returns the value within the chart for the given point.
:param point | <QPoint>
:return {<str> axis name: <variant> value, ..}
"""
chart_point = self.uiChartVIEW.mapFromParent(point)
scene_point = s... | [
"def",
"valueAt",
"(",
"self",
",",
"point",
")",
":",
"chart_point",
"=",
"self",
".",
"uiChartVIEW",
".",
"mapFromParent",
"(",
"point",
")",
"scene_point",
"=",
"self",
".",
"uiChartVIEW",
".",
"mapToScene",
"(",
"chart_point",
")",
"return",
"self",
".... | Returns the value within the chart for the given point.
:param point | <QPoint>
:return {<str> axis name: <variant> value, ..} | [
"Returns",
"the",
"value",
"within",
"the",
"chart",
"for",
"the",
"given",
"point",
".",
":",
"param",
"point",
"|",
"<QPoint",
">",
":",
"return",
"{",
"<str",
">",
"axis",
"name",
":",
"<variant",
">",
"value",
"..",
"}"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L728-L738 | train | Returns the value at the given point. |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.values | def values(self, axis):
"""
Returns the values of the given axis from all the datasets within
this chart.
:param axis | <str>
:return [<variant>, ..]
"""
output = []
for dataset in self.datasets():
output +... | python | def values(self, axis):
"""
Returns the values of the given axis from all the datasets within
this chart.
:param axis | <str>
:return [<variant>, ..]
"""
output = []
for dataset in self.datasets():
output +... | [
"def",
"values",
"(",
"self",
",",
"axis",
")",
":",
"output",
"=",
"[",
"]",
"for",
"dataset",
"in",
"self",
".",
"datasets",
"(",
")",
":",
"output",
"+=",
"dataset",
".",
"values",
"(",
"axis",
")",
"return",
"output"
] | Returns the values of the given axis from all the datasets within
this chart.
:param axis | <str>
:return [<variant>, ..] | [
"Returns",
"the",
"values",
"of",
"the",
"given",
"axis",
"from",
"all",
"the",
"datasets",
"within",
"this",
"chart",
".",
":",
"param",
"axis",
"|",
"<str",
">",
":",
"return",
"[",
"<variant",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L740-L753 | train | Returns the values of the given axis from all the datasets within the given axis. |
bitesofcode/projexui | projexui/xwidgetvalue.py | setWidgetValue | def setWidgetValue( widget, value ):
"""
Sets the value for the inputed widget to the given value. This will be \
controlled by the type of widget it is. You can define new types by \
calling the registerWidgetValue method.
:param widget | <QWidget>
value | <varia... | python | def setWidgetValue( widget, value ):
"""
Sets the value for the inputed widget to the given value. This will be \
controlled by the type of widget it is. You can define new types by \
calling the registerWidgetValue method.
:param widget | <QWidget>
value | <varia... | [
"def",
"setWidgetValue",
"(",
"widget",
",",
"value",
")",
":",
"for",
"wtype",
"in",
"reversed",
"(",
"_widgetValueTypes",
")",
":",
"if",
"isinstance",
"(",
"widget",
",",
"wtype",
"[",
"0",
"]",
")",
":",
"try",
":",
"wtype",
"[",
"2",
"]",
"(",
... | Sets the value for the inputed widget to the given value. This will be \
controlled by the type of widget it is. You can define new types by \
calling the registerWidgetValue method.
:param widget | <QWidget>
value | <variant>
:return <bool> success | [
"Sets",
"the",
"value",
"for",
"the",
"inputed",
"widget",
"to",
"the",
"given",
"value",
".",
"This",
"will",
"be",
"\\",
"controlled",
"by",
"the",
"type",
"of",
"widget",
"it",
"is",
".",
"You",
"can",
"define",
"new",
"types",
"by",
"\\",
"calling"... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xwidgetvalue.py#L54-L72 | train | Sets the value for the given widget. |
bitesofcode/projexui | projexui/xwidgetvalue.py | widgetValue | def widgetValue( widget ):
"""
Returns the value for the inputed widget based on its type.
:param widget | <QWidget>
:return (<variant> value, <bool> success)
"""
for wtype in reversed(_widgetValueTypes):
if isinstance(widget, wtype[0]):
try:
... | python | def widgetValue( widget ):
"""
Returns the value for the inputed widget based on its type.
:param widget | <QWidget>
:return (<variant> value, <bool> success)
"""
for wtype in reversed(_widgetValueTypes):
if isinstance(widget, wtype[0]):
try:
... | [
"def",
"widgetValue",
"(",
"widget",
")",
":",
"for",
"wtype",
"in",
"reversed",
"(",
"_widgetValueTypes",
")",
":",
"if",
"isinstance",
"(",
"widget",
",",
"wtype",
"[",
"0",
"]",
")",
":",
"try",
":",
"return",
"(",
"wtype",
"[",
"1",
"]",
"(",
"... | Returns the value for the inputed widget based on its type.
:param widget | <QWidget>
:return (<variant> value, <bool> success) | [
"Returns",
"the",
"value",
"for",
"the",
"inputed",
"widget",
"based",
"on",
"its",
"type",
".",
":",
"param",
"widget",
"|",
"<QWidget",
">",
":",
"return",
"(",
"<variant",
">",
"value",
"<bool",
">",
"success",
")"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xwidgetvalue.py#L74-L88 | train | Returns the value for the given widget based on its type. |
bitesofcode/projexui | projexui/xwidgetvalue.py | getComboValue | def getComboValue(combo):
"""
Checks to see if there is a dataType custom property set to determine
whether to return an integer or a string.
:param combo | <QComboBox>
:return <int> || <str>
"""
dataType = unwrapVariant(combo.property('dataType'))
if ... | python | def getComboValue(combo):
"""
Checks to see if there is a dataType custom property set to determine
whether to return an integer or a string.
:param combo | <QComboBox>
:return <int> || <str>
"""
dataType = unwrapVariant(combo.property('dataType'))
if ... | [
"def",
"getComboValue",
"(",
"combo",
")",
":",
"dataType",
"=",
"unwrapVariant",
"(",
"combo",
".",
"property",
"(",
"'dataType'",
")",
")",
"if",
"dataType",
"==",
"'string'",
":",
"return",
"combo",
".",
"currentText",
"(",
")",
"elif",
"dataType",
"=="... | Checks to see if there is a dataType custom property set to determine
whether to return an integer or a string.
:param combo | <QComboBox>
:return <int> || <str> | [
"Checks",
"to",
"see",
"if",
"there",
"is",
"a",
"dataType",
"custom",
"property",
"set",
"to",
"determine",
"whether",
"to",
"return",
"an",
"integer",
"or",
"a",
"string",
".",
":",
"param",
"combo",
"|",
"<QComboBox",
">",
":",
"return",
"<int",
">",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xwidgetvalue.py#L92-L107 | train | Returns the value of the current item in the combo |
bitesofcode/projexui | projexui/xwidgetvalue.py | setComboValue | def setComboValue(combo, value):
"""
Checks to see if there is a dataType custom property set to determine
whether to return an integer or a string.
:param combo | <QComboBox>
:return <int> || <str>
"""
dataType = unwrapVariant(combo.property('dataType'))
... | python | def setComboValue(combo, value):
"""
Checks to see if there is a dataType custom property set to determine
whether to return an integer or a string.
:param combo | <QComboBox>
:return <int> || <str>
"""
dataType = unwrapVariant(combo.property('dataType'))
... | [
"def",
"setComboValue",
"(",
"combo",
",",
"value",
")",
":",
"dataType",
"=",
"unwrapVariant",
"(",
"combo",
".",
"property",
"(",
"'dataType'",
")",
")",
"if",
"dataType",
"==",
"'string'",
":",
"return",
"combo",
".",
"setCurrentIndex",
"(",
"combo",
".... | Checks to see if there is a dataType custom property set to determine
whether to return an integer or a string.
:param combo | <QComboBox>
:return <int> || <str> | [
"Checks",
"to",
"see",
"if",
"there",
"is",
"a",
"dataType",
"custom",
"property",
"set",
"to",
"determine",
"whether",
"to",
"return",
"an",
"integer",
"or",
"a",
"string",
".",
":",
"param",
"combo",
"|",
"<QComboBox",
">",
":",
"return",
"<int",
">",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xwidgetvalue.py#L109-L127 | train | Sets the value of the item in the combo. |
mikhaildubov/AST-text-analysis | east/asts/ast_naive.py | NaiveAnnotatedSuffixTree._construct | def _construct(self, strings_collection):
"""
Naive generalized suffix tree construction algorithm,
with quadratic [O(n_1^2 + ... + n_m^2)] worst-case time complexity,
where m is the number of strings in collection.
"""
# 0. Add a unique character to eac... | python | def _construct(self, strings_collection):
"""
Naive generalized suffix tree construction algorithm,
with quadratic [O(n_1^2 + ... + n_m^2)] worst-case time complexity,
where m is the number of strings in collection.
"""
# 0. Add a unique character to eac... | [
"def",
"_construct",
"(",
"self",
",",
"strings_collection",
")",
":",
"# 0. Add a unique character to each string in the collection,",
"# to preserve simplicity while building the tree",
"strings_collection",
"=",
"utils",
".",
"make_unique_endings",
"(",
"strings_collection",
... | Naive generalized suffix tree construction algorithm,
with quadratic [O(n_1^2 + ... + n_m^2)] worst-case time complexity,
where m is the number of strings in collection. | [
"Naive",
"generalized",
"suffix",
"tree",
"construction",
"algorithm",
"with",
"quadratic",
"[",
"O",
"(",
"n_1^2",
"+",
"...",
"+",
"n_m^2",
")",
"]",
"worst",
"-",
"case",
"time",
"complexity",
"where",
"m",
"is",
"the",
"number",
"of",
"strings",
"in",
... | 055ad8d2492c100bbbaa25309ec1074bdf1dfaa5 | https://github.com/mikhaildubov/AST-text-analysis/blob/055ad8d2492c100bbbaa25309ec1074bdf1dfaa5/east/asts/ast_naive.py#L12-L76 | train | This method is used to construct the tree from the given collection of strings. |
johnnoone/aioconsul | aioconsul/client/catalog_endpoint.py | CatalogEndpoint.register | async def register(self, node, *,
check=None, service=None, write_token=None):
"""Registers a new node, service or check
Parameters:
node (Object): Node definition
check (Object): Check definition
service (Object or ObjectID): Service
... | python | async def register(self, node, *,
check=None, service=None, write_token=None):
"""Registers a new node, service or check
Parameters:
node (Object): Node definition
check (Object): Check definition
service (Object or ObjectID): Service
... | [
"async",
"def",
"register",
"(",
"self",
",",
"node",
",",
"*",
",",
"check",
"=",
"None",
",",
"service",
"=",
"None",
",",
"write_token",
"=",
"None",
")",
":",
"node_id",
",",
"node",
"=",
"prepare_node",
"(",
"node",
")",
"service_id",
",",
"serv... | Registers a new node, service or check
Parameters:
node (Object): Node definition
check (Object): Check definition
service (Object or ObjectID): Service
write_token (ObjectID): Token ID
Returns:
bool: ``True`` on success
.. note:: it ... | [
"Registers",
"a",
"new",
"node",
"service",
"or",
"check"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/catalog_endpoint.py#L41-L159 | train | Registers a new node service or check with the agent. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.