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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Gbps/fastlog | fastlog/log.py | FastLogger.hexdump | def hexdump(self, s, *args, **kwargs):
"""
Outputs a colorful hexdump of the first argument.
This function will attempt to 'flatten' iterable data passed to it until all remaining elements
are binary representable.
In python2, objects should be of type 'str', in python3, 'byte... | python | def hexdump(self, s, *args, **kwargs):
"""
Outputs a colorful hexdump of the first argument.
This function will attempt to 'flatten' iterable data passed to it until all remaining elements
are binary representable.
In python2, objects should be of type 'str', in python3, 'byte... | [
"def",
"hexdump",
"(",
"self",
",",
"s",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"levelOverride",
"=",
"kwargs",
".",
"get",
"(",
"'level'",
")",
"or",
"self",
".",
"_lastlevel",
"hexdmp",
"=",
"hexdump",
".",
"hexdump",
"(",
"self",
"... | Outputs a colorful hexdump of the first argument.
This function will attempt to 'flatten' iterable data passed to it until all remaining elements
are binary representable.
In python2, objects should be of type 'str', in python3, 'bytes' or 'bytearray' will work.
The level of the last... | [
"Outputs",
"a",
"colorful",
"hexdump",
"of",
"the",
"first",
"argument",
"."
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/log.py#L143-L163 | train | Prints a colorful hexdump of the first argument. |
faxir/faxir-python | faxir/api/files_api.py | FilesApi.get_file | def get_file(self, fax_id, **kwargs): # noqa: E501
"""get a file # noqa: E501
Get your fax archive file using it's id. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_file(... | python | def get_file(self, fax_id, **kwargs): # noqa: E501
"""get a file # noqa: E501
Get your fax archive file using it's id. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_file(... | [
"def",
"get_file",
"(",
"self",
",",
"fax_id",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async'",
")",
":",
"return",
"self",
".",
"get_file_with_http_... | get a file # noqa: E501
Get your fax archive file using it's id. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_file(fax_id, async=True)
>>> result = thread.get()
... | [
"get",
"a",
"file",
"#",
"noqa",
":",
"E501"
] | 75ed2ea487a6be537342baea1077a02b0c8e70c1 | https://github.com/faxir/faxir-python/blob/75ed2ea487a6be537342baea1077a02b0c8e70c1/faxir/api/files_api.py#L36-L57 | train | Get a file using it s id. |
faxir/faxir-python | faxir/api/files_api.py | FilesApi.upload_file | def upload_file(self, fax_file, **kwargs): # noqa: E501
"""upload a file # noqa: E501
Before sending a fax you need to upload your files using this API. In order to upload your fax file, you have to send a `multipart/form-data` request with your file. If the upload was successful you would receive a ... | python | def upload_file(self, fax_file, **kwargs): # noqa: E501
"""upload a file # noqa: E501
Before sending a fax you need to upload your files using this API. In order to upload your fax file, you have to send a `multipart/form-data` request with your file. If the upload was successful you would receive a ... | [
"def",
"upload_file",
"(",
"self",
",",
"fax_file",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async'",
")",
":",
"return",
"self",
".",
"upload_file_wi... | upload a file # noqa: E501
Before sending a fax you need to upload your files using this API. In order to upload your fax file, you have to send a `multipart/form-data` request with your file. If the upload was successful you would receive a `file_path` which you can use to send your fax. # noqa: E501
... | [
"upload",
"a",
"file",
"#",
"noqa",
":",
"E501"
] | 75ed2ea487a6be537342baea1077a02b0c8e70c1 | https://github.com/faxir/faxir-python/blob/75ed2ea487a6be537342baea1077a02b0c8e70c1/faxir/api/files_api.py#L139-L160 | train | Upload a file to a specific key. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.checkablePopup | def checkablePopup( self ):
"""
Returns the popup if this widget is checkable.
:return <QListView> || None
"""
if not self._checkablePopup and self.isCheckable():
popup = QListView(self)
popup.setSelectionMode(QListView.NoSelection)
... | python | def checkablePopup( self ):
"""
Returns the popup if this widget is checkable.
:return <QListView> || None
"""
if not self._checkablePopup and self.isCheckable():
popup = QListView(self)
popup.setSelectionMode(QListView.NoSelection)
... | [
"def",
"checkablePopup",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_checkablePopup",
"and",
"self",
".",
"isCheckable",
"(",
")",
":",
"popup",
"=",
"QListView",
"(",
"self",
")",
"popup",
".",
"setSelectionMode",
"(",
"QListView",
".",
"NoSelectio... | Returns the popup if this widget is checkable.
:return <QListView> || None | [
"Returns",
"the",
"popup",
"if",
"this",
"widget",
"is",
"checkable",
".",
":",
"return",
"<QListView",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L112-L127 | train | Returns the popup if this widget is checkable. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.checkModelIndex | def checkModelIndex( self, modelIndex ):
"""
Sets the current index as the checked index.
:param modelIndex | <QModelIndex>
"""
self.checkablePopup().hide()
if not self.isCheckable():
return
self.setCheckedIndexes([model... | python | def checkModelIndex( self, modelIndex ):
"""
Sets the current index as the checked index.
:param modelIndex | <QModelIndex>
"""
self.checkablePopup().hide()
if not self.isCheckable():
return
self.setCheckedIndexes([model... | [
"def",
"checkModelIndex",
"(",
"self",
",",
"modelIndex",
")",
":",
"self",
".",
"checkablePopup",
"(",
")",
".",
"hide",
"(",
")",
"if",
"not",
"self",
".",
"isCheckable",
"(",
")",
":",
"return",
"self",
".",
"setCheckedIndexes",
"(",
"[",
"modelIndex"... | Sets the current index as the checked index.
:param modelIndex | <QModelIndex> | [
"Sets",
"the",
"current",
"index",
"as",
"the",
"checked",
"index",
".",
":",
"param",
"modelIndex",
"|",
"<QModelIndex",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L129-L140 | train | Sets the current index as the checked index. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.currentText | def currentText(self):
"""
Returns the current text for this combobox, including the hint option \
if no text is set.
"""
lineEdit = self.lineEdit()
if lineEdit:
return lineEdit.currentText()
text = nativestring(super(XComboBox, self).currentText())
... | python | def currentText(self):
"""
Returns the current text for this combobox, including the hint option \
if no text is set.
"""
lineEdit = self.lineEdit()
if lineEdit:
return lineEdit.currentText()
text = nativestring(super(XComboBox, self).currentText())
... | [
"def",
"currentText",
"(",
"self",
")",
":",
"lineEdit",
"=",
"self",
".",
"lineEdit",
"(",
")",
"if",
"lineEdit",
":",
"return",
"lineEdit",
".",
"currentText",
"(",
")",
"text",
"=",
"nativestring",
"(",
"super",
"(",
"XComboBox",
",",
"self",
")",
"... | Returns the current text for this combobox, including the hint option \
if no text is set. | [
"Returns",
"the",
"current",
"text",
"for",
"this",
"combobox",
"including",
"the",
"hint",
"option",
"\\",
"if",
"no",
"text",
"is",
"set",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L142-L153 | train | Returns the current text for this combobox including the hint option \
|
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.checkedIndexes | def checkedIndexes( self ):
"""
Returns a list of checked indexes for this combobox.
:return [<int>, ..]
"""
if ( not self.isCheckable() ):
return []
model = self.model()
return [i for i in range(self.count()) if model.item(i).ch... | python | def checkedIndexes( self ):
"""
Returns a list of checked indexes for this combobox.
:return [<int>, ..]
"""
if ( not self.isCheckable() ):
return []
model = self.model()
return [i for i in range(self.count()) if model.item(i).ch... | [
"def",
"checkedIndexes",
"(",
"self",
")",
":",
"if",
"(",
"not",
"self",
".",
"isCheckable",
"(",
")",
")",
":",
"return",
"[",
"]",
"model",
"=",
"self",
".",
"model",
"(",
")",
"return",
"[",
"i",
"for",
"i",
"in",
"range",
"(",
"self",
".",
... | Returns a list of checked indexes for this combobox.
:return [<int>, ..] | [
"Returns",
"a",
"list",
"of",
"checked",
"indexes",
"for",
"this",
"combobox",
".",
":",
"return",
"[",
"<int",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L155-L165 | train | Returns a list of checked indexes for this combobox. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.checkedItems | def checkedItems( self ):
"""
Returns the checked items for this combobox.
:return [<str>, ..]
"""
if not self.isCheckable():
return []
return [nativestring(self.itemText(i)) for i in self.checkedIndexes()] | python | def checkedItems( self ):
"""
Returns the checked items for this combobox.
:return [<str>, ..]
"""
if not self.isCheckable():
return []
return [nativestring(self.itemText(i)) for i in self.checkedIndexes()] | [
"def",
"checkedItems",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"isCheckable",
"(",
")",
":",
"return",
"[",
"]",
"return",
"[",
"nativestring",
"(",
"self",
".",
"itemText",
"(",
"i",
")",
")",
"for",
"i",
"in",
"self",
".",
"checkedIndexes"... | Returns the checked items for this combobox.
:return [<str>, ..] | [
"Returns",
"the",
"checked",
"items",
"for",
"this",
"combobox",
".",
":",
"return",
"[",
"<str",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L167-L176 | train | Returns the items that are checked for this combobox. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.eventFilter | def eventFilter(self, object, event):
"""
Filters events for the popup widget.
:param object | <QObject>
event | <QEvent>
"""
# popup the editor when clicking in the line edit for a checkable state
if object == self.lineEdit() and self.i... | python | def eventFilter(self, object, event):
"""
Filters events for the popup widget.
:param object | <QObject>
event | <QEvent>
"""
# popup the editor when clicking in the line edit for a checkable state
if object == self.lineEdit() and self.i... | [
"def",
"eventFilter",
"(",
"self",
",",
"object",
",",
"event",
")",
":",
"# popup the editor when clicking in the line edit for a checkable state",
"if",
"object",
"==",
"self",
".",
"lineEdit",
"(",
")",
"and",
"self",
".",
"isEnabled",
"(",
")",
":",
"if",
"n... | Filters events for the popup widget.
:param object | <QObject>
event | <QEvent> | [
"Filters",
"events",
"for",
"the",
"popup",
"widget",
".",
":",
"param",
"object",
"|",
"<QObject",
">",
"event",
"|",
"<QEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L188-L218 | train | Filters events for the popup widget. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.hintColor | def hintColor(self):
"""
Returns the hint color for this combo box provided its line edit is
an XLineEdit instance.
:return <QColor>
"""
lineEdit = self.lineEdit()
if isinstance(lineEdit, XLineEdit):
return lineEdit.hintColor()
ret... | python | def hintColor(self):
"""
Returns the hint color for this combo box provided its line edit is
an XLineEdit instance.
:return <QColor>
"""
lineEdit = self.lineEdit()
if isinstance(lineEdit, XLineEdit):
return lineEdit.hintColor()
ret... | [
"def",
"hintColor",
"(",
"self",
")",
":",
"lineEdit",
"=",
"self",
".",
"lineEdit",
"(",
")",
"if",
"isinstance",
"(",
"lineEdit",
",",
"XLineEdit",
")",
":",
"return",
"lineEdit",
".",
"hintColor",
"(",
")",
"return",
"QColor",
"(",
")"
] | Returns the hint color for this combo box provided its line edit is
an XLineEdit instance.
:return <QColor> | [
"Returns",
"the",
"hint",
"color",
"for",
"this",
"combo",
"box",
"provided",
"its",
"line",
"edit",
"is",
"an",
"XLineEdit",
"instance",
".",
":",
"return",
"<QColor",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L228-L238 | train | Returns the hint color for this combo box provided its line edit is
an XLineEdit instance. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.lineEdit | def lineEdit(self):
"""
Returns the line editor associated with this combobox. This will
return the object stored at the reference for the editor since
sometimes the internal Qt process will raise a RuntimeError that
the C/C++ object has been deleted.
:return ... | python | def lineEdit(self):
"""
Returns the line editor associated with this combobox. This will
return the object stored at the reference for the editor since
sometimes the internal Qt process will raise a RuntimeError that
the C/C++ object has been deleted.
:return ... | [
"def",
"lineEdit",
"(",
"self",
")",
":",
"try",
":",
"edit",
"=",
"self",
".",
"_lineEdit",
"(",
")",
"except",
"TypeError",
":",
"edit",
"=",
"None",
"if",
"edit",
"is",
"None",
":",
"self",
".",
"_edit",
"=",
"None",
"return",
"edit"
] | Returns the line editor associated with this combobox. This will
return the object stored at the reference for the editor since
sometimes the internal Qt process will raise a RuntimeError that
the C/C++ object has been deleted.
:return <XLineEdit> || None | [
"Returns",
"the",
"line",
"editor",
"associated",
"with",
"this",
"combobox",
".",
"This",
"will",
"return",
"the",
"object",
"stored",
"at",
"the",
"reference",
"for",
"the",
"editor",
"since",
"sometimes",
"the",
"internal",
"Qt",
"process",
"will",
"raise",... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L269-L285 | train | Returns the line editor associated with this combobox. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.paintEvent | def paintEvent(self, event):
"""
Paints this combobox based on whether or not it is visible.
:param event | <QPaintEvent>
"""
if not self.autoRaise() or (self._hovered and self.isEnabled()):
super(XComboBox, self).paintEvent(event)
... | python | def paintEvent(self, event):
"""
Paints this combobox based on whether or not it is visible.
:param event | <QPaintEvent>
"""
if not self.autoRaise() or (self._hovered and self.isEnabled()):
super(XComboBox, self).paintEvent(event)
... | [
"def",
"paintEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"self",
".",
"autoRaise",
"(",
")",
"or",
"(",
"self",
".",
"_hovered",
"and",
"self",
".",
"isEnabled",
"(",
")",
")",
":",
"super",
"(",
"XComboBox",
",",
"self",
")",
".",
... | Paints this combobox based on whether or not it is visible.
:param event | <QPaintEvent> | [
"Paints",
"this",
"combobox",
"based",
"on",
"whether",
"or",
"not",
"it",
"is",
"visible",
".",
":",
"param",
"event",
"|",
"<QPaintEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L287-L322 | train | Paints this combobox based on whether or not it is visible. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.setAutoRaise | def setAutoRaise(self, state):
"""
Sets whether or not this combo box should automatically
raise up.
:param state | <bool>
"""
self._autoRaise = state
self.setMouseTracking(state)
try:
self.lineEdit().setVisible(not state)
... | python | def setAutoRaise(self, state):
"""
Sets whether or not this combo box should automatically
raise up.
:param state | <bool>
"""
self._autoRaise = state
self.setMouseTracking(state)
try:
self.lineEdit().setVisible(not state)
... | [
"def",
"setAutoRaise",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_autoRaise",
"=",
"state",
"self",
".",
"setMouseTracking",
"(",
"state",
")",
"try",
":",
"self",
".",
"lineEdit",
"(",
")",
".",
"setVisible",
"(",
"not",
"state",
")",
"except... | Sets whether or not this combo box should automatically
raise up.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"this",
"combo",
"box",
"should",
"automatically",
"raise",
"up",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L333-L345 | train | Sets whether or not this combo box should automatically raise up. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.setCheckedIndexes | def setCheckedIndexes(self, indexes):
"""
Sets a list of checked indexes for this combobox.
:param indexes | [<int>, ..]
"""
if not self.isCheckable():
return
model = self.model()
model.blockSignals(True)
for i in range(s... | python | def setCheckedIndexes(self, indexes):
"""
Sets a list of checked indexes for this combobox.
:param indexes | [<int>, ..]
"""
if not self.isCheckable():
return
model = self.model()
model.blockSignals(True)
for i in range(s... | [
"def",
"setCheckedIndexes",
"(",
"self",
",",
"indexes",
")",
":",
"if",
"not",
"self",
".",
"isCheckable",
"(",
")",
":",
"return",
"model",
"=",
"self",
".",
"model",
"(",
")",
"model",
".",
"blockSignals",
"(",
"True",
")",
"for",
"i",
"in",
"rang... | Sets a list of checked indexes for this combobox.
:param indexes | [<int>, ..] | [
"Sets",
"a",
"list",
"of",
"checked",
"indexes",
"for",
"this",
"combobox",
".",
":",
"param",
"indexes",
"|",
"[",
"<int",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L347-L371 | train | Sets a list of checked indexes for this combobox. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.setCheckedItems | def setCheckedItems(self, items):
"""
Returns the checked items for this combobox.
:return items | [<str>, ..]
"""
if not self.isCheckable():
return
model = self.model()
for i in range(self.count()):
item_text = self.i... | python | def setCheckedItems(self, items):
"""
Returns the checked items for this combobox.
:return items | [<str>, ..]
"""
if not self.isCheckable():
return
model = self.model()
for i in range(self.count()):
item_text = self.i... | [
"def",
"setCheckedItems",
"(",
"self",
",",
"items",
")",
":",
"if",
"not",
"self",
".",
"isCheckable",
"(",
")",
":",
"return",
"model",
"=",
"self",
".",
"model",
"(",
")",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"count",
"(",
")",
")",
":... | Returns the checked items for this combobox.
:return items | [<str>, ..] | [
"Returns",
"the",
"checked",
"items",
"for",
"this",
"combobox",
".",
":",
"return",
"items",
"|",
"[",
"<str",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L373-L393 | train | Sets the items for this combobox to the inputed items. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.setCheckable | def setCheckable( self, state ):
"""
Sets whether or not this combobox stores checkable items.
:param state | <bool>
"""
self._checkable = state
# need to be editable to be checkable
edit = self.lineEdit()
if state:
self.... | python | def setCheckable( self, state ):
"""
Sets whether or not this combobox stores checkable items.
:param state | <bool>
"""
self._checkable = state
# need to be editable to be checkable
edit = self.lineEdit()
if state:
self.... | [
"def",
"setCheckable",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_checkable",
"=",
"state",
"# need to be editable to be checkable",
"edit",
"=",
"self",
".",
"lineEdit",
"(",
")",
"if",
"state",
":",
"self",
".",
"setEditable",
"(",
"True",
")",
... | Sets whether or not this combobox stores checkable items.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"this",
"combobox",
"stores",
"checkable",
"items",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L395-L418 | train | Sets whether or not this combobox stores checkable items. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.setEditable | def setEditable( self, state ):
"""
Sets whether or not this combobox will be editable, updating its \
line edit to an XLineEdit if necessary.
:param state | <bool>
"""
super(XComboBox, self).setEditable(state)
if state:
edit = s... | python | def setEditable( self, state ):
"""
Sets whether or not this combobox will be editable, updating its \
line edit to an XLineEdit if necessary.
:param state | <bool>
"""
super(XComboBox, self).setEditable(state)
if state:
edit = s... | [
"def",
"setEditable",
"(",
"self",
",",
"state",
")",
":",
"super",
"(",
"XComboBox",
",",
"self",
")",
".",
"setEditable",
"(",
"state",
")",
"if",
"state",
":",
"edit",
"=",
"self",
".",
"lineEdit",
"(",
")",
"if",
"edit",
"and",
"isinstance",
"(",... | Sets whether or not this combobox will be editable, updating its \
line edit to an XLineEdit if necessary.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"this",
"combobox",
"will",
"be",
"editable",
"updating",
"its",
"\\",
"line",
"edit",
"to",
"an",
"XLineEdit",
"if",
"necessary",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L420-L439 | train | Sets whether or not this combobox will be editable updating its \
alid line edit to an XLineEdit instance. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.setLineEdit | def setLineEdit(self, edit):
"""
Sets the line edit for this widget.
:warning If the inputed edit is NOT an instance of XLineEdit, \
this method will destroy the edit and create a new \
XLineEdit instance.
:param edit | <X... | python | def setLineEdit(self, edit):
"""
Sets the line edit for this widget.
:warning If the inputed edit is NOT an instance of XLineEdit, \
this method will destroy the edit and create a new \
XLineEdit instance.
:param edit | <X... | [
"def",
"setLineEdit",
"(",
"self",
",",
"edit",
")",
":",
"if",
"edit",
"and",
"not",
"isinstance",
"(",
"edit",
",",
"XLineEdit",
")",
":",
"edit",
".",
"setParent",
"(",
"None",
")",
"edit",
".",
"deleteLater",
"(",
")",
"edit",
"=",
"XLineEdit",
"... | Sets the line edit for this widget.
:warning If the inputed edit is NOT an instance of XLineEdit, \
this method will destroy the edit and create a new \
XLineEdit instance.
:param edit | <XLineEdit> | [
"Sets",
"the",
"line",
"edit",
"for",
"this",
"widget",
".",
":",
"warning",
"If",
"the",
"inputed",
"edit",
"is",
"NOT",
"an",
"instance",
"of",
"XLineEdit",
"\\",
"this",
"method",
"will",
"destroy",
"the",
"edit",
"and",
"create",
"a",
"new",
"\\",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L441-L463 | train | Sets the line edit for this widget. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.setHint | def setHint( self, hint ):
"""
Sets the hint for this line edit that will be displayed when in \
editable mode.
:param hint | <str>
"""
self._hint = hint
lineEdit = self.lineEdit()
if isinstance(lineEdit, XLineEdit):
li... | python | def setHint( self, hint ):
"""
Sets the hint for this line edit that will be displayed when in \
editable mode.
:param hint | <str>
"""
self._hint = hint
lineEdit = self.lineEdit()
if isinstance(lineEdit, XLineEdit):
li... | [
"def",
"setHint",
"(",
"self",
",",
"hint",
")",
":",
"self",
".",
"_hint",
"=",
"hint",
"lineEdit",
"=",
"self",
".",
"lineEdit",
"(",
")",
"if",
"isinstance",
"(",
"lineEdit",
",",
"XLineEdit",
")",
":",
"lineEdit",
".",
"setHint",
"(",
"hint",
")"... | Sets the hint for this line edit that will be displayed when in \
editable mode.
:param hint | <str> | [
"Sets",
"the",
"hint",
"for",
"this",
"line",
"edit",
"that",
"will",
"be",
"displayed",
"when",
"in",
"\\",
"editable",
"mode",
".",
":",
"param",
"hint",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L465-L476 | train | Sets the hint for this line edit that will be displayed when in editable mode. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.setHintColor | def setHintColor(self, color):
"""
Sets the hint color for this combo box provided its line edit is
an XLineEdit instance.
:param color | <QColor>
"""
lineEdit = self.lineEdit()
if isinstance(lineEdit, XLineEdit):
lineEdit.setHintColor(co... | python | def setHintColor(self, color):
"""
Sets the hint color for this combo box provided its line edit is
an XLineEdit instance.
:param color | <QColor>
"""
lineEdit = self.lineEdit()
if isinstance(lineEdit, XLineEdit):
lineEdit.setHintColor(co... | [
"def",
"setHintColor",
"(",
"self",
",",
"color",
")",
":",
"lineEdit",
"=",
"self",
".",
"lineEdit",
"(",
")",
"if",
"isinstance",
"(",
"lineEdit",
",",
"XLineEdit",
")",
":",
"lineEdit",
".",
"setHintColor",
"(",
"color",
")"
] | Sets the hint color for this combo box provided its line edit is
an XLineEdit instance.
:param color | <QColor> | [
"Sets",
"the",
"hint",
"color",
"for",
"this",
"combo",
"box",
"provided",
"its",
"line",
"edit",
"is",
"an",
"XLineEdit",
"instance",
".",
":",
"param",
"color",
"|",
"<QColor",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L478-L487 | train | Sets the hint color for this combo box provided its line edit is
an instance of XLineEdit. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.showPopup | def showPopup( self ):
"""
Displays a custom popup widget for this system if a checkable state \
is setup.
"""
if not self.isCheckable():
return super(XComboBox, self).showPopup()
if not self.isVisible():
return
# update t... | python | def showPopup( self ):
"""
Displays a custom popup widget for this system if a checkable state \
is setup.
"""
if not self.isCheckable():
return super(XComboBox, self).showPopup()
if not self.isVisible():
return
# update t... | [
"def",
"showPopup",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"isCheckable",
"(",
")",
":",
"return",
"super",
"(",
"XComboBox",
",",
"self",
")",
".",
"showPopup",
"(",
")",
"if",
"not",
"self",
".",
"isVisible",
"(",
")",
":",
"return",
"#... | Displays a custom popup widget for this system if a checkable state \
is setup. | [
"Displays",
"a",
"custom",
"popup",
"widget",
"for",
"this",
"system",
"if",
"a",
"checkable",
"state",
"\\",
"is",
"setup",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L500-L527 | train | Shows a custom popup widget for this system. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.updateCheckState | def updateCheckState( self ):
"""
Updates the items to reflect the current check state system.
"""
checkable = self.isCheckable()
model = self.model()
flags = Qt.ItemIsSelectable | Qt.ItemIsEnabled
for i in range(self.count()):
item = ... | python | def updateCheckState( self ):
"""
Updates the items to reflect the current check state system.
"""
checkable = self.isCheckable()
model = self.model()
flags = Qt.ItemIsSelectable | Qt.ItemIsEnabled
for i in range(self.count()):
item = ... | [
"def",
"updateCheckState",
"(",
"self",
")",
":",
"checkable",
"=",
"self",
".",
"isCheckable",
"(",
")",
"model",
"=",
"self",
".",
"model",
"(",
")",
"flags",
"=",
"Qt",
".",
"ItemIsSelectable",
"|",
"Qt",
".",
"ItemIsEnabled",
"for",
"i",
"in",
"ran... | Updates the items to reflect the current check state system. | [
"Updates",
"the",
"items",
"to",
"reflect",
"the",
"current",
"check",
"state",
"system",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L529-L547 | train | Updates the check state of the items in the model to reflect the current check state system. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.updateCheckedText | def updateCheckedText(self):
"""
Updates the text in the editor to reflect the latest state.
"""
if not self.isCheckable():
return
indexes = self.checkedIndexes()
items = self.checkedItems()
if len(items) < 2 or self.separator():
... | python | def updateCheckedText(self):
"""
Updates the text in the editor to reflect the latest state.
"""
if not self.isCheckable():
return
indexes = self.checkedIndexes()
items = self.checkedItems()
if len(items) < 2 or self.separator():
... | [
"def",
"updateCheckedText",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"isCheckable",
"(",
")",
":",
"return",
"indexes",
"=",
"self",
".",
"checkedIndexes",
"(",
")",
"items",
"=",
"self",
".",
"checkedItems",
"(",
")",
"if",
"len",
"(",
"items"... | Updates the text in the editor to reflect the latest state. | [
"Updates",
"the",
"text",
"in",
"the",
"editor",
"to",
"reflect",
"the",
"latest",
"state",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L549-L566 | train | Updates the text in the editor to reflect the latest state of the items in the checked items. |
bitesofcode/projexui | projexui/widgets/xcombobox.py | XComboBox.toggleModelIndex | def toggleModelIndex(self, modelIndex):
"""
Toggles the index's check state.
:param modelIndex | <QModelIndex>
"""
if not self.isCheckable():
return
item = self.model().item(modelIndex.row())
if item.checkState() == Qt.Checke... | python | def toggleModelIndex(self, modelIndex):
"""
Toggles the index's check state.
:param modelIndex | <QModelIndex>
"""
if not self.isCheckable():
return
item = self.model().item(modelIndex.row())
if item.checkState() == Qt.Checke... | [
"def",
"toggleModelIndex",
"(",
"self",
",",
"modelIndex",
")",
":",
"if",
"not",
"self",
".",
"isCheckable",
"(",
")",
":",
"return",
"item",
"=",
"self",
".",
"model",
"(",
")",
".",
"item",
"(",
"modelIndex",
".",
"row",
"(",
")",
")",
"if",
"it... | Toggles the index's check state.
:param modelIndex | <QModelIndex> | [
"Toggles",
"the",
"index",
"s",
"check",
"state",
".",
":",
"param",
"modelIndex",
"|",
"<QModelIndex",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcombobox.py#L568-L583 | train | Toggles the check state of the index. |
intelsdi-x/snap-plugin-lib-py | examples/processor/tag.py | Tag.process | def process(self, metrics, config):
"""Processes metrics.
This method is called by the Snap deamon during the process phase
of the execution of a Snap workflow. Examples of processing metrics
include applying filtering, max, min, average functions as well as
adding additional c... | python | def process(self, metrics, config):
"""Processes metrics.
This method is called by the Snap deamon during the process phase
of the execution of a Snap workflow. Examples of processing metrics
include applying filtering, max, min, average functions as well as
adding additional c... | [
"def",
"process",
"(",
"self",
",",
"metrics",
",",
"config",
")",
":",
"LOG",
".",
"debug",
"(",
"\"Process called\"",
")",
"for",
"metric",
"in",
"metrics",
":",
"metric",
".",
"tags",
"[",
"\"instance-id\"",
"]",
"=",
"config",
"[",
"\"instance-id\"",
... | Processes metrics.
This method is called by the Snap deamon during the process phase
of the execution of a Snap workflow. Examples of processing metrics
include applying filtering, max, min, average functions as well as
adding additional context to the metrics to name just a few.
... | [
"Processes",
"metrics",
"."
] | 8da5d00ac5f9d2b48a7239563ac7788209891ca4 | https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/examples/processor/tag.py#L34-L55 | train | Processes the metrics. |
bitesofcode/projexui | projexui/widgets/xtoolbutton.py | XToolButton.blink | def blink(self, state=True):
"""
Starts or stops the blinking state for this button. This only
works for when the toolbutton is in Shadowed or Colored mode.
:param state | <bool>
:return <bool> | success
"""
if self._blinking =... | python | def blink(self, state=True):
"""
Starts or stops the blinking state for this button. This only
works for when the toolbutton is in Shadowed or Colored mode.
:param state | <bool>
:return <bool> | success
"""
if self._blinking =... | [
"def",
"blink",
"(",
"self",
",",
"state",
"=",
"True",
")",
":",
"if",
"self",
".",
"_blinking",
"==",
"state",
":",
"return",
"True",
"elif",
"not",
"self",
".",
"graphicsEffect",
"(",
")",
":",
"return",
"False",
"else",
":",
"self",
".",
"_blinki... | Starts or stops the blinking state for this button. This only
works for when the toolbutton is in Shadowed or Colored mode.
:param state | <bool>
:return <bool> | success | [
"Starts",
"or",
"stops",
"the",
"blinking",
"state",
"for",
"this",
"button",
".",
"This",
"only",
"works",
"for",
"when",
"the",
"toolbutton",
"is",
"in",
"Shadowed",
"or",
"Colored",
"mode",
".",
":",
"param",
"state",
"|",
"<bool",
">",
":",
"return",... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtoolbutton.py#L94-L110 | train | Starts or stops the blinking state for this toolbutton. |
bitesofcode/projexui | projexui/widgets/xtoolbutton.py | XToolButton.cleanup | def cleanup(self):
"""
Cleanup references to the movie when this button is destroyed.
"""
if self._movie is not None:
self._movie.frameChanged.disconnect(self._updateFrame)
self._movie = None | python | def cleanup(self):
"""
Cleanup references to the movie when this button is destroyed.
"""
if self._movie is not None:
self._movie.frameChanged.disconnect(self._updateFrame)
self._movie = None | [
"def",
"cleanup",
"(",
"self",
")",
":",
"if",
"self",
".",
"_movie",
"is",
"not",
"None",
":",
"self",
".",
"_movie",
".",
"frameChanged",
".",
"disconnect",
"(",
"self",
".",
"_updateFrame",
")",
"self",
".",
"_movie",
"=",
"None"
] | Cleanup references to the movie when this button is destroyed. | [
"Cleanup",
"references",
"to",
"the",
"movie",
"when",
"this",
"button",
"is",
"destroyed",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtoolbutton.py#L121-L127 | train | Cleanup references to the movie when this button is destroyed. |
bitesofcode/projexui | projexui/widgets/xtoolbutton.py | XToolButton.paintEvent | def paintEvent(self, event):
"""
Overloads the paint even to render this button.
"""
if self.isHoverable() and self.icon().isNull():
return
# initialize the painter
painter = QtGui.QStylePainter()
painter.begin(self)
try:
... | python | def paintEvent(self, event):
"""
Overloads the paint even to render this button.
"""
if self.isHoverable() and self.icon().isNull():
return
# initialize the painter
painter = QtGui.QStylePainter()
painter.begin(self)
try:
... | [
"def",
"paintEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"isHoverable",
"(",
")",
"and",
"self",
".",
"icon",
"(",
")",
".",
"isNull",
"(",
")",
":",
"return",
"# initialize the painter\r",
"painter",
"=",
"QtGui",
".",
"QStylePainter... | Overloads the paint even to render this button. | [
"Overloads",
"the",
"paint",
"even",
"to",
"render",
"this",
"button",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtoolbutton.py#L206-L237 | train | This method is called when the user hits the button. |
bitesofcode/projexui | projexui/widgets/xtoolbutton.py | XToolButton.setHoverable | def setHoverable(self, state):
"""
Sets whether or not this is a hoverable button. When in a hoverable state, the icon will only
be visible when the button is hovered on.
:param state | <bool>
"""
self._hoverable = state
self._hoverIcon = self.icon(... | python | def setHoverable(self, state):
"""
Sets whether or not this is a hoverable button. When in a hoverable state, the icon will only
be visible when the button is hovered on.
:param state | <bool>
"""
self._hoverable = state
self._hoverIcon = self.icon(... | [
"def",
"setHoverable",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_hoverable",
"=",
"state",
"self",
".",
"_hoverIcon",
"=",
"self",
".",
"icon",
"(",
")"
] | Sets whether or not this is a hoverable button. When in a hoverable state, the icon will only
be visible when the button is hovered on.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"this",
"is",
"a",
"hoverable",
"button",
".",
"When",
"in",
"a",
"hoverable",
"state",
"the",
"icon",
"will",
"only",
"be",
"visible",
"when",
"the",
"button",
"is",
"hovered",
"on",
".",
":",
"param",
"state",
"|",
"<b... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtoolbutton.py#L287-L295 | train | Sets whether or not this button is a hoverable button. |
bitesofcode/projexui | projexui/widgets/xtoolbutton.py | XToolButton.setEnabled | def setEnabled(self, state):
"""
Updates the drop shadow effect for this widget on enable/disable
state change.
:param state | <bool>
"""
super(XToolButton, self).setEnabled(state)
self.updateUi() | python | def setEnabled(self, state):
"""
Updates the drop shadow effect for this widget on enable/disable
state change.
:param state | <bool>
"""
super(XToolButton, self).setEnabled(state)
self.updateUi() | [
"def",
"setEnabled",
"(",
"self",
",",
"state",
")",
":",
"super",
"(",
"XToolButton",
",",
"self",
")",
".",
"setEnabled",
"(",
"state",
")",
"self",
".",
"updateUi",
"(",
")"
] | Updates the drop shadow effect for this widget on enable/disable
state change.
:param state | <bool> | [
"Updates",
"the",
"drop",
"shadow",
"effect",
"for",
"this",
"widget",
"on",
"enable",
"/",
"disable",
"state",
"change",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtoolbutton.py#L303-L312 | train | Updates the drop shadow effect for this widget on enable or disable change. |
bitesofcode/projexui | projexui/widgets/xtoolbutton.py | XToolButton.setMovie | def setMovie(self, movie):
"""
Sets the movie instance for this button.
:param movie | <QtGui.QMovie>
"""
if self._movie is not None:
self._movie.frameChanged.disconnect(self._updateFrame)
self._movie = movie
... | python | def setMovie(self, movie):
"""
Sets the movie instance for this button.
:param movie | <QtGui.QMovie>
"""
if self._movie is not None:
self._movie.frameChanged.disconnect(self._updateFrame)
self._movie = movie
... | [
"def",
"setMovie",
"(",
"self",
",",
"movie",
")",
":",
"if",
"self",
".",
"_movie",
"is",
"not",
"None",
":",
"self",
".",
"_movie",
".",
"frameChanged",
".",
"disconnect",
"(",
"self",
".",
"_updateFrame",
")",
"self",
".",
"_movie",
"=",
"movie",
... | Sets the movie instance for this button.
:param movie | <QtGui.QMovie> | [
"Sets",
"the",
"movie",
"instance",
"for",
"this",
"button",
".",
":",
"param",
"movie",
"|",
"<QtGui",
".",
"QMovie",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtoolbutton.py#L330-L344 | train | Sets the movie instance for this button. |
bitesofcode/projexui | projexui/widgets/xtoolbutton.py | XToolButton.setPalette | def setPalette(self, palette):
"""
Sets the palette for this button to the inputed palette. This will
update the drop shadow to the palette's Shadow color property if
the shadowed mode is on.
:param palette | <QtGui.QPalette>
"""
super(XTool... | python | def setPalette(self, palette):
"""
Sets the palette for this button to the inputed palette. This will
update the drop shadow to the palette's Shadow color property if
the shadowed mode is on.
:param palette | <QtGui.QPalette>
"""
super(XTool... | [
"def",
"setPalette",
"(",
"self",
",",
"palette",
")",
":",
"super",
"(",
"XToolButton",
",",
"self",
")",
".",
"setPalette",
"(",
"palette",
")",
"self",
".",
"updateUi",
"(",
")"
] | Sets the palette for this button to the inputed palette. This will
update the drop shadow to the palette's Shadow color property if
the shadowed mode is on.
:param palette | <QtGui.QPalette> | [
"Sets",
"the",
"palette",
"for",
"this",
"button",
"to",
"the",
"inputed",
"palette",
".",
"This",
"will",
"update",
"the",
"drop",
"shadow",
"to",
"the",
"palette",
"s",
"Shadow",
"color",
"property",
"if",
"the",
"shadowed",
"mode",
"is",
"on",
".",
":... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtoolbutton.py#L346-L355 | train | Sets the palette for this button to the inputed palette. |
starling-lab/rnlp | rnlp/__init__.py | converter | def converter(input_string, block_size=2):
"""
The cli tool as a built-in function.
:param input_string: A string that should be converted to a set of facts.
:type input_string: str.
:param blocks_size: Optional block size of sentences (Default: 2).
:type block_size: int.
"""
sentences... | python | def converter(input_string, block_size=2):
"""
The cli tool as a built-in function.
:param input_string: A string that should be converted to a set of facts.
:type input_string: str.
:param blocks_size: Optional block size of sentences (Default: 2).
:type block_size: int.
"""
sentences... | [
"def",
"converter",
"(",
"input_string",
",",
"block_size",
"=",
"2",
")",
":",
"sentences",
"=",
"textprocessing",
".",
"getSentences",
"(",
"input_string",
")",
"blocks",
"=",
"textprocessing",
".",
"getBlocks",
"(",
"sentences",
",",
"block_size",
")",
"par... | The cli tool as a built-in function.
:param input_string: A string that should be converted to a set of facts.
:type input_string: str.
:param blocks_size: Optional block size of sentences (Default: 2).
:type block_size: int. | [
"The",
"cli",
"tool",
"as",
"a",
"built",
"-",
"in",
"function",
"."
] | 72054cc2c0cbaea1d281bf3d56b271d4da29fc4a | https://github.com/starling-lab/rnlp/blob/72054cc2c0cbaea1d281bf3d56b271d4da29fc4a/rnlp/__init__.py#L82-L94 | train | This function is a built - in function that is used to convert a string to a set of facts. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagItem.setText | def setText( self, text ):
"""
Sets the text for this item and resizes it to fit the text and the
remove button.
:param text | <str>
"""
super(XMultiTagItem, self).setText(text)
metrics = QFontMetrics(self.font())
... | python | def setText( self, text ):
"""
Sets the text for this item and resizes it to fit the text and the
remove button.
:param text | <str>
"""
super(XMultiTagItem, self).setText(text)
metrics = QFontMetrics(self.font())
... | [
"def",
"setText",
"(",
"self",
",",
"text",
")",
":",
"super",
"(",
"XMultiTagItem",
",",
"self",
")",
".",
"setText",
"(",
"text",
")",
"metrics",
"=",
"QFontMetrics",
"(",
"self",
".",
"font",
"(",
")",
")",
"hint",
"=",
"QSize",
"(",
"metrics",
... | Sets the text for this item and resizes it to fit the text and the
remove button.
:param text | <str> | [
"Sets",
"the",
"text",
"for",
"this",
"item",
"and",
"resizes",
"it",
"to",
"fit",
"the",
"text",
"and",
"the",
"remove",
"button",
".",
":",
"param",
"text",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L49-L61 | train | Sets the text for this item and resizes it to fit the text and the remove button. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagDelegate.createEditor | def createEditor( self, parent, option, index ):
"""
Overloads the create editor method to assign the parent's completer to
any line edit created.
:param parent | <QWidget>
option | <QStyleOption>
index | <QModelIndex>
... | python | def createEditor( self, parent, option, index ):
"""
Overloads the create editor method to assign the parent's completer to
any line edit created.
:param parent | <QWidget>
option | <QStyleOption>
index | <QModelIndex>
... | [
"def",
"createEditor",
"(",
"self",
",",
"parent",
",",
"option",
",",
"index",
")",
":",
"multi_tag",
"=",
"projexui",
".",
"ancestor",
"(",
"self",
",",
"XMultiTagEdit",
")",
"edit",
"=",
"QLineEdit",
"(",
"parent",
")",
"edit",
".",
"setFrame",
"(",
... | Overloads the create editor method to assign the parent's completer to
any line edit created.
:param parent | <QWidget>
option | <QStyleOption>
index | <QModelIndex>
:return <QWidget> || None | [
"Overloads",
"the",
"create",
"editor",
"method",
"to",
"assign",
"the",
"parent",
"s",
"completer",
"to",
"any",
"line",
"edit",
"created",
".",
":",
"param",
"parent",
"|",
"<QWidget",
">",
"option",
"|",
"<QStyleOption",
">",
"index",
"|",
"<QModelIndex",... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L79-L97 | train | Create an editor for this item. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagDelegate.drawDisplay | def drawDisplay( self, painter, option, rect, text ):
"""
Handles the display drawing for this delegate.
:param painter | <QPainter>
option | <QStyleOption>
rect | <QRect>
text | <str>
"""
painter.se... | python | def drawDisplay( self, painter, option, rect, text ):
"""
Handles the display drawing for this delegate.
:param painter | <QPainter>
option | <QStyleOption>
rect | <QRect>
text | <str>
"""
painter.se... | [
"def",
"drawDisplay",
"(",
"self",
",",
"painter",
",",
"option",
",",
"rect",
",",
"text",
")",
":",
"painter",
".",
"setBrush",
"(",
"Qt",
".",
"NoBrush",
")",
"painter",
".",
"drawText",
"(",
"rect",
".",
"left",
"(",
")",
"+",
"3",
",",
"rect",... | Handles the display drawing for this delegate.
:param painter | <QPainter>
option | <QStyleOption>
rect | <QRect>
text | <str> | [
"Handles",
"the",
"display",
"drawing",
"for",
"this",
"delegate",
".",
":",
"param",
"painter",
"|",
"<QPainter",
">",
"option",
"|",
"<QStyleOption",
">",
"rect",
"|",
"<QRect",
">",
"text",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L99-L114 | train | Handles the display drawing for this delegate. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagDelegate.paint | def paint( self, painter, option, index ):
"""
Overloads the paint method from Qt to perform some additional painting
on items.
:param painter | <QPainter>
option | <QStyleOption>
index | <QModelIndex>
"""
... | python | def paint( self, painter, option, index ):
"""
Overloads the paint method from Qt to perform some additional painting
on items.
:param painter | <QPainter>
option | <QStyleOption>
index | <QModelIndex>
"""
... | [
"def",
"paint",
"(",
"self",
",",
"painter",
",",
"option",
",",
"index",
")",
":",
"# draw the background",
"edit",
"=",
"self",
".",
"parent",
"(",
")",
"item",
"=",
"edit",
".",
"item",
"(",
"index",
".",
"row",
"(",
")",
")",
"if",
"(",
"not",
... | Overloads the paint method from Qt to perform some additional painting
on items.
:param painter | <QPainter>
option | <QStyleOption>
index | <QModelIndex> | [
"Overloads",
"the",
"paint",
"method",
"from",
"Qt",
"to",
"perform",
"some",
"additional",
"painting",
"on",
"items",
".",
":",
"param",
"painter",
"|",
"<QPainter",
">",
"option",
"|",
"<QStyleOption",
">",
"index",
"|",
"<QModelIndex",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L116-L152 | train | Override this method to draw the background and border of the related items. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.addTag | def addTag( self, tag ):
"""
Adds a new tag to the edit.
:param tag | <str>
:return <bool>
"""
if ( not (tag and self.isTagValid(tag)) ):
return False
self.blockSignals(True)
create_item = self.cr... | python | def addTag( self, tag ):
"""
Adds a new tag to the edit.
:param tag | <str>
:return <bool>
"""
if ( not (tag and self.isTagValid(tag)) ):
return False
self.blockSignals(True)
create_item = self.cr... | [
"def",
"addTag",
"(",
"self",
",",
"tag",
")",
":",
"if",
"(",
"not",
"(",
"tag",
"and",
"self",
".",
"isTagValid",
"(",
"tag",
")",
")",
")",
":",
"return",
"False",
"self",
".",
"blockSignals",
"(",
"True",
")",
"create_item",
"=",
"self",
".",
... | Adds a new tag to the edit.
:param tag | <str>
:return <bool> | [
"Adds",
"a",
"new",
"tag",
"to",
"the",
"edit",
".",
":",
"param",
"tag",
"|",
"<str",
">",
":",
"return",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L206-L229 | train | Adds a new tag to the edit. Returns True if the edit was successfully added False otherwise. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.copy | def copy( self ):
"""
Copies the selected items to the clipboard.
"""
text = []
for item in self.selectedItems():
text.append(nativestring(item.text()))
QApplication.clipboard().setText(','.join(text)) | python | def copy( self ):
"""
Copies the selected items to the clipboard.
"""
text = []
for item in self.selectedItems():
text.append(nativestring(item.text()))
QApplication.clipboard().setText(','.join(text)) | [
"def",
"copy",
"(",
"self",
")",
":",
"text",
"=",
"[",
"]",
"for",
"item",
"in",
"self",
".",
"selectedItems",
"(",
")",
":",
"text",
".",
"append",
"(",
"nativestring",
"(",
"item",
".",
"text",
"(",
")",
")",
")",
"QApplication",
".",
"clipboard... | Copies the selected items to the clipboard. | [
"Copies",
"the",
"selected",
"items",
"to",
"the",
"clipboard",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L254-L262 | train | Copies the selected items to the clipboard. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.createItem | def createItem( self ):
"""
Returns a reference to the create item that is used for this edit.
:return <XMultiTagCreateItem>
"""
if not self.isEditable():
return None
if self._createItem is None:
self.blockSignals(Tr... | python | def createItem( self ):
"""
Returns a reference to the create item that is used for this edit.
:return <XMultiTagCreateItem>
"""
if not self.isEditable():
return None
if self._createItem is None:
self.blockSignals(Tr... | [
"def",
"createItem",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"isEditable",
"(",
")",
":",
"return",
"None",
"if",
"self",
".",
"_createItem",
"is",
"None",
":",
"self",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"_createItem",
"=",
... | Returns a reference to the create item that is used for this edit.
:return <XMultiTagCreateItem> | [
"Returns",
"a",
"reference",
"to",
"the",
"create",
"item",
"that",
"is",
"used",
"for",
"this",
"edit",
".",
":",
"return",
"<XMultiTagCreateItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L264-L281 | train | Returns a reference to the create item that is used for this edit. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.dragMoveEvent | def dragMoveEvent( self, event ):
"""
Handles the drag move event.
:param event | <QDragEvent>
"""
tags = nativestring(event.mimeData().text())
if ( event.source() == self ):
event.acceptProposedAction()
elif ( tags ):
... | python | def dragMoveEvent( self, event ):
"""
Handles the drag move event.
:param event | <QDragEvent>
"""
tags = nativestring(event.mimeData().text())
if ( event.source() == self ):
event.acceptProposedAction()
elif ( tags ):
... | [
"def",
"dragMoveEvent",
"(",
"self",
",",
"event",
")",
":",
"tags",
"=",
"nativestring",
"(",
"event",
".",
"mimeData",
"(",
")",
".",
"text",
"(",
")",
")",
"if",
"(",
"event",
".",
"source",
"(",
")",
"==",
"self",
")",
":",
"event",
".",
"acc... | Handles the drag move event.
:param event | <QDragEvent> | [
"Handles",
"the",
"drag",
"move",
"event",
".",
":",
"param",
"event",
"|",
"<QDragEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L298-L311 | train | Handles the drag move event. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.dropEvent | def dropEvent( self, event ):
"""
Handles the drop event.
:param event | <QDropEvent>
"""
tags = nativestring(event.mimeData().text())
# handle an internal move
if event.source() == self:
curr_item = self.selectedItems()[0... | python | def dropEvent( self, event ):
"""
Handles the drop event.
:param event | <QDropEvent>
"""
tags = nativestring(event.mimeData().text())
# handle an internal move
if event.source() == self:
curr_item = self.selectedItems()[0... | [
"def",
"dropEvent",
"(",
"self",
",",
"event",
")",
":",
"tags",
"=",
"nativestring",
"(",
"event",
".",
"mimeData",
"(",
")",
".",
"text",
"(",
")",
")",
"# handle an internal move",
"if",
"event",
".",
"source",
"(",
")",
"==",
"self",
":",
"curr_ite... | Handles the drop event.
:param event | <QDropEvent> | [
"Handles",
"the",
"drop",
"event",
".",
":",
"param",
"event",
"|",
"<QDropEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L313-L354 | train | Handles the drop event. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.eventFilter | def eventFilter(self, object, event):
"""
Filters the key press event on the editor object to look for backspace
key strokes on blank editors to remove previous tags.
:param object | <QObject>
event | <QEvent>
:return <bool> ... | python | def eventFilter(self, object, event):
"""
Filters the key press event on the editor object to look for backspace
key strokes on blank editors to remove previous tags.
:param object | <QObject>
event | <QEvent>
:return <bool> ... | [
"def",
"eventFilter",
"(",
"self",
",",
"object",
",",
"event",
")",
":",
"if",
"event",
".",
"type",
"(",
")",
"==",
"event",
".",
"KeyPress",
":",
"if",
"event",
".",
"key",
"(",
")",
"==",
"Qt",
".",
"Key_Backspace",
":",
"is_line_edit",
"=",
"i... | Filters the key press event on the editor object to look for backspace
key strokes on blank editors to remove previous tags.
:param object | <QObject>
event | <QEvent>
:return <bool> | consumed | [
"Filters",
"the",
"key",
"press",
"event",
"on",
"the",
"editor",
"object",
"to",
"look",
"for",
"backspace",
"key",
"strokes",
"on",
"blank",
"editors",
"to",
"remove",
"previous",
"tags",
".",
":",
"param",
"object",
"|",
"<QObject",
">",
"event",
"|",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L356-L379 | train | Filter the event for the object and event. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.finishEditing | def finishEditing(self, tag):
"""
Finishes editing the current item.
"""
curr_item = self.currentItem()
create_item = self.createItem()
self.closePersistentEditor(curr_item)
if curr_item == create_item:
self.addTag(tag)
... | python | def finishEditing(self, tag):
"""
Finishes editing the current item.
"""
curr_item = self.currentItem()
create_item = self.createItem()
self.closePersistentEditor(curr_item)
if curr_item == create_item:
self.addTag(tag)
... | [
"def",
"finishEditing",
"(",
"self",
",",
"tag",
")",
":",
"curr_item",
"=",
"self",
".",
"currentItem",
"(",
")",
"create_item",
"=",
"self",
".",
"createItem",
"(",
")",
"self",
".",
"closePersistentEditor",
"(",
"curr_item",
")",
"if",
"curr_item",
"=="... | Finishes editing the current item. | [
"Finishes",
"editing",
"the",
"current",
"item",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L381-L393 | train | Finishes editing the current item. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.handleTagChange | def handleTagChange( self, item ):
"""
Handles the tag change information for this widget.
:param item | <QListWidgetItem>
"""
# :note PySide == operator not defined for QListWidgetItem. In this
# in this case, we're just checking if the object... | python | def handleTagChange( self, item ):
"""
Handles the tag change information for this widget.
:param item | <QListWidgetItem>
"""
# :note PySide == operator not defined for QListWidgetItem. In this
# in this case, we're just checking if the object... | [
"def",
"handleTagChange",
"(",
"self",
",",
"item",
")",
":",
"# :note PySide == operator not defined for QListWidgetItem. In this\r",
"# in this case, we're just checking if the object is the exact\r",
"# same, so 'is' works just fine.\r",
"create_item",
"=",
"self",
".",
... | Handles the tag change information for this widget.
:param item | <QListWidgetItem> | [
"Handles",
"the",
"tag",
"change",
"information",
"for",
"this",
"widget",
".",
":",
"param",
"item",
"|",
"<QListWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L395-L409 | train | Handles the tag change information for this object. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.isTagValid | def isTagValid( self, tag ):
"""
Checks to see if the inputed tag is valid or not.
:param tag | <str>
:return <bool>
"""
if ( self._options is not None and \
not nativestring(tag) in self._options \
and not se... | python | def isTagValid( self, tag ):
"""
Checks to see if the inputed tag is valid or not.
:param tag | <str>
:return <bool>
"""
if ( self._options is not None and \
not nativestring(tag) in self._options \
and not se... | [
"def",
"isTagValid",
"(",
"self",
",",
"tag",
")",
":",
"if",
"(",
"self",
".",
"_options",
"is",
"not",
"None",
"and",
"not",
"nativestring",
"(",
"tag",
")",
"in",
"self",
".",
"_options",
"and",
"not",
"self",
".",
"isInsertAllowed",
"(",
")",
")"... | Checks to see if the inputed tag is valid or not.
:param tag | <str>
:return <bool> | [
"Checks",
"to",
"see",
"if",
"the",
"inputed",
"tag",
"is",
"valid",
"or",
"not",
".",
":",
"param",
"tag",
"|",
"<str",
">",
":",
"return",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L445-L461 | train | Checks to see if the tag is valid or not. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.itemFromTag | def itemFromTag( self, tag ):
"""
Returns the item assigned to the given tag.
:param tag | <str>
:return <XMultiTagItem> || None
"""
for row in range(self.count() - 1):
item = self.item(row)
if ( item and item.t... | python | def itemFromTag( self, tag ):
"""
Returns the item assigned to the given tag.
:param tag | <str>
:return <XMultiTagItem> || None
"""
for row in range(self.count() - 1):
item = self.item(row)
if ( item and item.t... | [
"def",
"itemFromTag",
"(",
"self",
",",
"tag",
")",
":",
"for",
"row",
"in",
"range",
"(",
"self",
".",
"count",
"(",
")",
"-",
"1",
")",
":",
"item",
"=",
"self",
".",
"item",
"(",
"row",
")",
"if",
"(",
"item",
"and",
"item",
".",
"text",
"... | Returns the item assigned to the given tag.
:param tag | <str>
:return <XMultiTagItem> || None | [
"Returns",
"the",
"item",
"assigned",
"to",
"the",
"given",
"tag",
".",
":",
"param",
"tag",
"|",
"<str",
">",
":",
"return",
"<XMultiTagItem",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L471-L483 | train | Returns the item assigned to the given tag. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.keyPressEvent | def keyPressEvent( self, event ):
"""
Handles the Ctrl+C/Ctrl+V events for copy & paste.
:param event | <QKeyEvent>
"""
if ( event.key() == Qt.Key_C and \
event.modifiers() == Qt.ControlModifier ):
self.copy()
event.accept()
... | python | def keyPressEvent( self, event ):
"""
Handles the Ctrl+C/Ctrl+V events for copy & paste.
:param event | <QKeyEvent>
"""
if ( event.key() == Qt.Key_C and \
event.modifiers() == Qt.ControlModifier ):
self.copy()
event.accept()
... | [
"def",
"keyPressEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"(",
"event",
".",
"key",
"(",
")",
"==",
"Qt",
".",
"Key_C",
"and",
"event",
".",
"modifiers",
"(",
")",
"==",
"Qt",
".",
"ControlModifier",
")",
":",
"self",
".",
"copy",
"(",
"... | Handles the Ctrl+C/Ctrl+V events for copy & paste.
:param event | <QKeyEvent> | [
"Handles",
"the",
"Ctrl",
"+",
"C",
"/",
"Ctrl",
"+",
"V",
"events",
"for",
"copy",
"&",
"paste",
".",
":",
"param",
"event",
"|",
"<QKeyEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L493-L524 | train | Handles the Ctrl + C and Ctrl + V events for copy & paste. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.mimeData | def mimeData( self, items ):
"""
Creates the mime data for the different items.
:param items | [<QListWidgetItem>, ..]
:return <QMimeData>
"""
text = []
for item in items:
text.append(nativestring(item.text()))
... | python | def mimeData( self, items ):
"""
Creates the mime data for the different items.
:param items | [<QListWidgetItem>, ..]
:return <QMimeData>
"""
text = []
for item in items:
text.append(nativestring(item.text()))
... | [
"def",
"mimeData",
"(",
"self",
",",
"items",
")",
":",
"text",
"=",
"[",
"]",
"for",
"item",
"in",
"items",
":",
"text",
".",
"append",
"(",
"nativestring",
"(",
"item",
".",
"text",
"(",
")",
")",
")",
"data",
"=",
"QMimeData",
"(",
")",
"data"... | Creates the mime data for the different items.
:param items | [<QListWidgetItem>, ..]
:return <QMimeData> | [
"Creates",
"the",
"mime",
"data",
"for",
"the",
"different",
"items",
".",
":",
"param",
"items",
"|",
"[",
"<QListWidgetItem",
">",
"..",
"]",
":",
"return",
"<QMimeData",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L526-L540 | train | Creates the mime data for the different items. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.mousePressEvent | def mousePressEvent( self, event ):
"""
Make sure on a mouse release event that we have a current item. If
no item is current, then our edit item will become current.
:param event | <QMouseReleaseEvent>
"""
item = self.itemAt(event.pos())
... | python | def mousePressEvent( self, event ):
"""
Make sure on a mouse release event that we have a current item. If
no item is current, then our edit item will become current.
:param event | <QMouseReleaseEvent>
"""
item = self.itemAt(event.pos())
... | [
"def",
"mousePressEvent",
"(",
"self",
",",
"event",
")",
":",
"item",
"=",
"self",
".",
"itemAt",
"(",
"event",
".",
"pos",
"(",
")",
")",
"# set the tag creation item as active\r",
"if",
"item",
"is",
"None",
":",
"create_item",
"=",
"self",
".",
"create... | Make sure on a mouse release event that we have a current item. If
no item is current, then our edit item will become current.
:param event | <QMouseReleaseEvent> | [
"Make",
"sure",
"on",
"a",
"mouse",
"release",
"event",
"that",
"we",
"have",
"a",
"current",
"item",
".",
"If",
"no",
"item",
"is",
"current",
"then",
"our",
"edit",
"item",
"will",
"become",
"current",
".",
":",
"param",
"event",
"|",
"<QMouseReleaseEv... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L542-L573 | train | Handles the mouse press event. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.paste | def paste( self ):
"""
Pastes text from the clipboard.
"""
text = nativestring(QApplication.clipboard().text())
for tag in text.split(','):
tag = tag.strip()
if ( self.isTagValid(tag) ):
self.addTag(tag) | python | def paste( self ):
"""
Pastes text from the clipboard.
"""
text = nativestring(QApplication.clipboard().text())
for tag in text.split(','):
tag = tag.strip()
if ( self.isTagValid(tag) ):
self.addTag(tag) | [
"def",
"paste",
"(",
"self",
")",
":",
"text",
"=",
"nativestring",
"(",
"QApplication",
".",
"clipboard",
"(",
")",
".",
"text",
"(",
")",
")",
"for",
"tag",
"in",
"text",
".",
"split",
"(",
"','",
")",
":",
"tag",
"=",
"tag",
".",
"strip",
"(",... | Pastes text from the clipboard. | [
"Pastes",
"text",
"from",
"the",
"clipboard",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L585-L593 | train | Pastes text from the clipboard. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.resizeEvent | def resizeEvent(self, event):
"""
Overloads the resize event to control if we are still editing.
If we are resizing, then we are no longer editing.
"""
curr_item = self.currentItem()
self.closePersistentEditor(curr_item)
super(XMultiTagE... | python | def resizeEvent(self, event):
"""
Overloads the resize event to control if we are still editing.
If we are resizing, then we are no longer editing.
"""
curr_item = self.currentItem()
self.closePersistentEditor(curr_item)
super(XMultiTagE... | [
"def",
"resizeEvent",
"(",
"self",
",",
"event",
")",
":",
"curr_item",
"=",
"self",
".",
"currentItem",
"(",
")",
"self",
".",
"closePersistentEditor",
"(",
"curr_item",
")",
"super",
"(",
"XMultiTagEdit",
",",
"self",
")",
".",
"resizeEvent",
"(",
"event... | Overloads the resize event to control if we are still editing.
If we are resizing, then we are no longer editing. | [
"Overloads",
"the",
"resize",
"event",
"to",
"control",
"if",
"we",
"are",
"still",
"editing",
".",
"If",
"we",
"are",
"resizing",
"then",
"we",
"are",
"no",
"longer",
"editing",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L595-L604 | train | Overloads the resize event to control if we are still editing. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.setCompleter | def setCompleter( self, completer ):
"""
Sets the text completer for this tag widget to the inputed completer.
:param completer | <QCompleter>
"""
if ( self._completer == completer ):
return
elif ( self._completer ):
self._co... | python | def setCompleter( self, completer ):
"""
Sets the text completer for this tag widget to the inputed completer.
:param completer | <QCompleter>
"""
if ( self._completer == completer ):
return
elif ( self._completer ):
self._co... | [
"def",
"setCompleter",
"(",
"self",
",",
"completer",
")",
":",
"if",
"(",
"self",
".",
"_completer",
"==",
"completer",
")",
":",
"return",
"elif",
"(",
"self",
".",
"_completer",
")",
":",
"self",
".",
"_completer",
".",
"activated",
".",
"disconnect",... | Sets the text completer for this tag widget to the inputed completer.
:param completer | <QCompleter> | [
"Sets",
"the",
"text",
"completer",
"for",
"this",
"tag",
"widget",
"to",
"the",
"inputed",
"completer",
".",
":",
"param",
"completer",
"|",
"<QCompleter",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L606-L620 | train | Sets the text completer for this tag widget to the inputed completer. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.setEditable | def setEditable(self, state):
"""
Sets whether or not the user can edit the items in the list by
typing.
:param state | <bool>
"""
self._editable = state
if state:
self.setEditTriggers(self.AllEditTriggers)
else:
... | python | def setEditable(self, state):
"""
Sets whether or not the user can edit the items in the list by
typing.
:param state | <bool>
"""
self._editable = state
if state:
self.setEditTriggers(self.AllEditTriggers)
else:
... | [
"def",
"setEditable",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_editable",
"=",
"state",
"if",
"state",
":",
"self",
".",
"setEditTriggers",
"(",
"self",
".",
"AllEditTriggers",
")",
"else",
":",
"self",
".",
"setEditTriggers",
"(",
"self",
"."... | Sets whether or not the user can edit the items in the list by
typing.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"the",
"user",
"can",
"edit",
"the",
"items",
"in",
"the",
"list",
"by",
"typing",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L622-L633 | train | Sets whether or not the user can edit the items in the list by changing the editTriggers of the items in the list. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.setOptions | def setOptions( self, options ):
"""
Sets the tag option list for this widget. If used, tags need to be
found within the list of options when added.
:param options | [<str>, ..]
"""
self._options = map(str, options)
if ( options ):... | python | def setOptions( self, options ):
"""
Sets the tag option list for this widget. If used, tags need to be
found within the list of options when added.
:param options | [<str>, ..]
"""
self._options = map(str, options)
if ( options ):... | [
"def",
"setOptions",
"(",
"self",
",",
"options",
")",
":",
"self",
".",
"_options",
"=",
"map",
"(",
"str",
",",
"options",
")",
"if",
"(",
"options",
")",
":",
"completer",
"=",
"QCompleter",
"(",
"options",
",",
"self",
")",
"completer",
".",
"set... | Sets the tag option list for this widget. If used, tags need to be
found within the list of options when added.
:param options | [<str>, ..] | [
"Sets",
"the",
"tag",
"option",
"list",
"for",
"this",
"widget",
".",
"If",
"used",
"tags",
"need",
"to",
"be",
"found",
"within",
"the",
"list",
"of",
"options",
"when",
"added",
".",
":",
"param",
"options",
"|",
"[",
"<str",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L653-L667 | train | Sets the list of options for this widget. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.setTags | def setTags( self, tags ):
"""
Sets the tags assigned to this item to the inputed list of tags.
:param tags | [<str>, ..]
"""
self.setUpdatesEnabled(False)
self.blockSignals(True)
self.clear()
for tag in tags:
... | python | def setTags( self, tags ):
"""
Sets the tags assigned to this item to the inputed list of tags.
:param tags | [<str>, ..]
"""
self.setUpdatesEnabled(False)
self.blockSignals(True)
self.clear()
for tag in tags:
... | [
"def",
"setTags",
"(",
"self",
",",
"tags",
")",
":",
"self",
".",
"setUpdatesEnabled",
"(",
"False",
")",
"self",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"clear",
"(",
")",
"for",
"tag",
"in",
"tags",
":",
"self",
".",
"addItem",
"(",
... | Sets the tags assigned to this item to the inputed list of tags.
:param tags | [<str>, ..] | [
"Sets",
"the",
"tags",
"assigned",
"to",
"this",
"item",
"to",
"the",
"inputed",
"list",
"of",
"tags",
".",
":",
"param",
"tags",
"|",
"[",
"<str",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L669-L683 | train | Sets the tags assigned to this item to the inputed list of tags. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.setViewMode | def setViewMode( self, viewMode ):
"""
Sets the view mode for this widget to the inputed mode.
:param viewMode | <QListWidget.ViewMode>
"""
ddrop_mode = self.dragDropMode()
super(XMultiTagEdit, self).setViewMode(viewMode)
self.setDragDropMode(ddrop_m... | python | def setViewMode( self, viewMode ):
"""
Sets the view mode for this widget to the inputed mode.
:param viewMode | <QListWidget.ViewMode>
"""
ddrop_mode = self.dragDropMode()
super(XMultiTagEdit, self).setViewMode(viewMode)
self.setDragDropMode(ddrop_m... | [
"def",
"setViewMode",
"(",
"self",
",",
"viewMode",
")",
":",
"ddrop_mode",
"=",
"self",
".",
"dragDropMode",
"(",
")",
"super",
"(",
"XMultiTagEdit",
",",
"self",
")",
".",
"setViewMode",
"(",
"viewMode",
")",
"self",
".",
"setDragDropMode",
"(",
"ddrop_m... | Sets the view mode for this widget to the inputed mode.
:param viewMode | <QListWidget.ViewMode> | [
"Sets",
"the",
"view",
"mode",
"for",
"this",
"widget",
"to",
"the",
"inputed",
"mode",
".",
":",
"param",
"viewMode",
"|",
"<QListWidget",
".",
"ViewMode",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L693-L701 | train | Sets the view mode for this widget to the inputed mode. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.tags | def tags( self ):
"""
Returns a list of all the tags assigned to this widget.
:return [<str>, ..]
"""
item = self.item(self.count() - 1)
count = self.count()
if ( item is self._createItem ):
count -= 1
return [... | python | def tags( self ):
"""
Returns a list of all the tags assigned to this widget.
:return [<str>, ..]
"""
item = self.item(self.count() - 1)
count = self.count()
if ( item is self._createItem ):
count -= 1
return [... | [
"def",
"tags",
"(",
"self",
")",
":",
"item",
"=",
"self",
".",
"item",
"(",
"self",
".",
"count",
"(",
")",
"-",
"1",
")",
"count",
"=",
"self",
".",
"count",
"(",
")",
"if",
"(",
"item",
"is",
"self",
".",
"_createItem",
")",
":",
"count",
... | Returns a list of all the tags assigned to this widget.
:return [<str>, ..] | [
"Returns",
"a",
"list",
"of",
"all",
"the",
"tags",
"assigned",
"to",
"this",
"widget",
".",
":",
"return",
"[",
"<str",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L719-L730 | train | Returns a list of all the tags assigned to this widget. |
bitesofcode/projexui | projexui/widgets/xmultitagedit.py | XMultiTagEdit.takeTag | def takeTag( self, tag ):
"""
Removes the inputed tag from the system.
:param tag | <str>
:return <XMultiTagItem> || None
"""
for row in range(self.count() - 1):
item = self.item(row)
if ( item and item.text() =... | python | def takeTag( self, tag ):
"""
Removes the inputed tag from the system.
:param tag | <str>
:return <XMultiTagItem> || None
"""
for row in range(self.count() - 1):
item = self.item(row)
if ( item and item.text() =... | [
"def",
"takeTag",
"(",
"self",
",",
"tag",
")",
":",
"for",
"row",
"in",
"range",
"(",
"self",
".",
"count",
"(",
")",
"-",
"1",
")",
":",
"item",
"=",
"self",
".",
"item",
"(",
"row",
")",
"if",
"(",
"item",
"and",
"item",
".",
"text",
"(",
... | Removes the inputed tag from the system.
:param tag | <str>
:return <XMultiTagItem> || None | [
"Removes",
"the",
"inputed",
"tag",
"from",
"the",
"system",
".",
":",
"param",
"tag",
"|",
"<str",
">",
":",
"return",
"<XMultiTagItem",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xmultitagedit.py#L732-L747 | train | Removes the specified tag from the system. Returns the item that was removed. |
intelsdi-x/snap-plugin-lib-py | snap_plugin/v1/publisher_proxy.py | PublisherProxy.Publish | def Publish(self, request, context):
"""Dispatches the request to the plugins publish method"""
LOG.debug("Publish called")
try:
self.plugin.publish(
[Metric(pb=m) for m in request.Metrics],
ConfigMap(pb=request.Config)
)
return... | python | def Publish(self, request, context):
"""Dispatches the request to the plugins publish method"""
LOG.debug("Publish called")
try:
self.plugin.publish(
[Metric(pb=m) for m in request.Metrics],
ConfigMap(pb=request.Config)
)
return... | [
"def",
"Publish",
"(",
"self",
",",
"request",
",",
"context",
")",
":",
"LOG",
".",
"debug",
"(",
"\"Publish called\"",
")",
"try",
":",
"self",
".",
"plugin",
".",
"publish",
"(",
"[",
"Metric",
"(",
"pb",
"=",
"m",
")",
"for",
"m",
"in",
"reques... | Dispatches the request to the plugins publish method | [
"Dispatches",
"the",
"request",
"to",
"the",
"plugins",
"publish",
"method"
] | 8da5d00ac5f9d2b48a7239563ac7788209891ca4 | https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/publisher_proxy.py#L35-L47 | train | Dispatches the request to the plugins publish method |
bitesofcode/projexui | projexui/widgets/xlocalebox.py | XLocaleBox.allLocales | def allLocales(self):
"""
Returns all the locales that are defined within the babel
architecture.
:return [<str>, ..]
"""
if self._allLocales:
return self._allLocales
expr = re.compile('[a-z]+_[A-Z]+')
locales =... | python | def allLocales(self):
"""
Returns all the locales that are defined within the babel
architecture.
:return [<str>, ..]
"""
if self._allLocales:
return self._allLocales
expr = re.compile('[a-z]+_[A-Z]+')
locales =... | [
"def",
"allLocales",
"(",
"self",
")",
":",
"if",
"self",
".",
"_allLocales",
":",
"return",
"self",
".",
"_allLocales",
"expr",
"=",
"re",
".",
"compile",
"(",
"'[a-z]+_[A-Z]+'",
")",
"locales",
"=",
"babel",
".",
"core",
".",
"localedata",
".",
"locale... | Returns all the locales that are defined within the babel
architecture.
:return [<str>, ..] | [
"Returns",
"all",
"the",
"locales",
"that",
"are",
"defined",
"within",
"the",
"babel",
"architecture",
".",
":",
"return",
"[",
"<str",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlocalebox.py#L50-L72 | train | Returns all the available locales in the language table. |
bitesofcode/projexui | projexui/widgets/xlocalebox.py | XLocaleBox.currentLocale | def currentLocale(self):
"""
Returns the current locale for this box.
:return <babel.Locale> || None
"""
try:
return babel.Locale.parse(self.itemData(self.currentIndex()))
except ImportError, err:
log.error('babel is not insta... | python | def currentLocale(self):
"""
Returns the current locale for this box.
:return <babel.Locale> || None
"""
try:
return babel.Locale.parse(self.itemData(self.currentIndex()))
except ImportError, err:
log.error('babel is not insta... | [
"def",
"currentLocale",
"(",
"self",
")",
":",
"try",
":",
"return",
"babel",
".",
"Locale",
".",
"parse",
"(",
"self",
".",
"itemData",
"(",
"self",
".",
"currentIndex",
"(",
")",
")",
")",
"except",
"ImportError",
",",
"err",
":",
"log",
".",
"erro... | Returns the current locale for this box.
:return <babel.Locale> || None | [
"Returns",
"the",
"current",
"locale",
"for",
"this",
"box",
".",
":",
"return",
"<babel",
".",
"Locale",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlocalebox.py#L94-L104 | train | Returns the current locale for this box or None if no locale is set. |
bitesofcode/projexui | projexui/widgets/xlocalebox.py | XLocaleBox.refresh | def refresh(self):
"""
Reloads the contents for this box based on the parameters.
:return <bool>
"""
self.setDirty(False)
self.blockSignals(True)
self.setUpdatesEnabled(False)
self.clear()
locales = self._availableL... | python | def refresh(self):
"""
Reloads the contents for this box based on the parameters.
:return <bool>
"""
self.setDirty(False)
self.blockSignals(True)
self.setUpdatesEnabled(False)
self.clear()
locales = self._availableL... | [
"def",
"refresh",
"(",
"self",
")",
":",
"self",
".",
"setDirty",
"(",
"False",
")",
"self",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"setUpdatesEnabled",
"(",
"False",
")",
"self",
".",
"clear",
"(",
")",
"locales",
"=",
"self",
".",
"_av... | Reloads the contents for this box based on the parameters.
:return <bool> | [
"Reloads",
"the",
"contents",
"for",
"this",
"box",
"based",
"on",
"the",
"parameters",
".",
":",
"return",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlocalebox.py#L114-L190 | train | Refreshes the contents of the current box based on the parameters. |
bitesofcode/projexui | projexui/widgets/xlocalebox.py | XLocaleBox.setAvailableLocales | def setAvailableLocales(self, locales):
"""
Sets a list of the available locales to use for displaying
the locale information for. This provides a way to filter the
interface for only locales that you care about.
:param locales | [<str>, ..]
"""
... | python | def setAvailableLocales(self, locales):
"""
Sets a list of the available locales to use for displaying
the locale information for. This provides a way to filter the
interface for only locales that you care about.
:param locales | [<str>, ..]
"""
... | [
"def",
"setAvailableLocales",
"(",
"self",
",",
"locales",
")",
":",
"try",
":",
"expr",
"=",
"re",
".",
"compile",
"(",
"'[a-z]+_[A-Z]+'",
")",
"babel_locales",
"=",
"[",
"]",
"for",
"locale",
"in",
"locales",
":",
"if",
"not",
"expr",
".",
"match",
"... | Sets a list of the available locales to use for displaying
the locale information for. This provides a way to filter the
interface for only locales that you care about.
:param locales | [<str>, ..] | [
"Sets",
"a",
"list",
"of",
"the",
"available",
"locales",
"to",
"use",
"for",
"displaying",
"the",
"locale",
"information",
"for",
".",
"This",
"provides",
"a",
"way",
"to",
"filter",
"the",
"interface",
"for",
"only",
"locales",
"that",
"you",
"care",
"ab... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlocalebox.py#L198-L226 | train | Sets the list of available locales for displaying the given locale information for the given list of locales. |
bitesofcode/projexui | projexui/widgets/xlocalebox.py | XLocaleBox.setBaseLocale | def setBaseLocale(self, locale):
"""
Sets the base locale that is used with in this widget. All displayed
information will be translated to this locale.
:param locale | <str>
"""
locale = str(locale)
if self._baseLocale == locale:
... | python | def setBaseLocale(self, locale):
"""
Sets the base locale that is used with in this widget. All displayed
information will be translated to this locale.
:param locale | <str>
"""
locale = str(locale)
if self._baseLocale == locale:
... | [
"def",
"setBaseLocale",
"(",
"self",
",",
"locale",
")",
":",
"locale",
"=",
"str",
"(",
"locale",
")",
"if",
"self",
".",
"_baseLocale",
"==",
"locale",
":",
"return",
"try",
":",
"babel",
".",
"Locale",
".",
"parse",
"(",
"locale",
")",
"except",
"... | Sets the base locale that is used with in this widget. All displayed
information will be translated to this locale.
:param locale | <str> | [
"Sets",
"the",
"base",
"locale",
"that",
"is",
"used",
"with",
"in",
"this",
"widget",
".",
"All",
"displayed",
"information",
"will",
"be",
"translated",
"to",
"this",
"locale",
".",
":",
"param",
"locale",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlocalebox.py#L228-L247 | train | Sets the base locale that is used with this widget. |
bitesofcode/projexui | projexui/widgets/xlocalebox.py | XLocaleBox.setCurrentLocale | def setCurrentLocale(self, locale):
"""
Sets the current locale for this box to the inputed locale.
:param locale | <babel.Locale> || <str>
:return <bool>
"""
locale = str(locale)
for i in xrange(self.count()):
if s... | python | def setCurrentLocale(self, locale):
"""
Sets the current locale for this box to the inputed locale.
:param locale | <babel.Locale> || <str>
:return <bool>
"""
locale = str(locale)
for i in xrange(self.count()):
if s... | [
"def",
"setCurrentLocale",
"(",
"self",
",",
"locale",
")",
":",
"locale",
"=",
"str",
"(",
"locale",
")",
"for",
"i",
"in",
"xrange",
"(",
"self",
".",
"count",
"(",
")",
")",
":",
"if",
"self",
".",
"itemData",
"(",
"i",
")",
"==",
"locale",
":... | Sets the current locale for this box to the inputed locale.
:param locale | <babel.Locale> || <str>
:return <bool> | [
"Sets",
"the",
"current",
"locale",
"for",
"this",
"box",
"to",
"the",
"inputed",
"locale",
".",
":",
"param",
"locale",
"|",
"<babel",
".",
"Locale",
">",
"||",
"<str",
">",
":",
"return",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlocalebox.py#L249-L262 | train | Sets the current locale for this box to the inputed locale. |
bitesofcode/projexui | projexui/widgets/xlocalebox.py | XLocaleBox.setShowLanguage | def setShowLanguage(self, state):
"""
Sets the display mode for this widget to the inputed mode.
:param state | <bool>
"""
if state == self._showLanguage:
return
self._showLanguage = state
self.setDirty() | python | def setShowLanguage(self, state):
"""
Sets the display mode for this widget to the inputed mode.
:param state | <bool>
"""
if state == self._showLanguage:
return
self._showLanguage = state
self.setDirty() | [
"def",
"setShowLanguage",
"(",
"self",
",",
"state",
")",
":",
"if",
"state",
"==",
"self",
".",
"_showLanguage",
":",
"return",
"self",
".",
"_showLanguage",
"=",
"state",
"self",
".",
"setDirty",
"(",
")"
] | Sets the display mode for this widget to the inputed mode.
:param state | <bool> | [
"Sets",
"the",
"display",
"mode",
"for",
"this",
"widget",
"to",
"the",
"inputed",
"mode",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlocalebox.py#L269-L279 | train | Sets the display mode for this widget to the inputed mode. |
bitesofcode/projexui | projexui/widgets/xlocalebox.py | XLocaleBox.setShowScriptName | def setShowScriptName(self, state):
"""
Sets the display mode for this widget to the inputed mode.
:param state | <bool>
"""
if state == self._showScriptName:
return
self._showScriptName = state
self.setDirty() | python | def setShowScriptName(self, state):
"""
Sets the display mode for this widget to the inputed mode.
:param state | <bool>
"""
if state == self._showScriptName:
return
self._showScriptName = state
self.setDirty() | [
"def",
"setShowScriptName",
"(",
"self",
",",
"state",
")",
":",
"if",
"state",
"==",
"self",
".",
"_showScriptName",
":",
"return",
"self",
".",
"_showScriptName",
"=",
"state",
"self",
".",
"setDirty",
"(",
")"
] | Sets the display mode for this widget to the inputed mode.
:param state | <bool> | [
"Sets",
"the",
"display",
"mode",
"for",
"this",
"widget",
"to",
"the",
"inputed",
"mode",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlocalebox.py#L281-L291 | train | Sets the display mode for this widget to the inputed mode. |
bitesofcode/projexui | projexui/widgets/xlocalebox.py | XLocaleBox.setShowTerritory | def setShowTerritory(self, state):
"""
Sets the display mode for this widget to the inputed mode.
:param state | <bool>
"""
if state == self._showTerritory:
return
self._showTerritory = state
self.setDirty() | python | def setShowTerritory(self, state):
"""
Sets the display mode for this widget to the inputed mode.
:param state | <bool>
"""
if state == self._showTerritory:
return
self._showTerritory = state
self.setDirty() | [
"def",
"setShowTerritory",
"(",
"self",
",",
"state",
")",
":",
"if",
"state",
"==",
"self",
".",
"_showTerritory",
":",
"return",
"self",
".",
"_showTerritory",
"=",
"state",
"self",
".",
"setDirty",
"(",
")"
] | Sets the display mode for this widget to the inputed mode.
:param state | <bool> | [
"Sets",
"the",
"display",
"mode",
"for",
"this",
"widget",
"to",
"the",
"inputed",
"mode",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlocalebox.py#L293-L303 | train | Sets the display mode for this widget to the inputed mode. |
deezer/template-remover | scripts/remove_template.py | main | def main():
"""Entry point for remove_template."""
# Wrap sys stdout for python 2, so print can understand unicode.
if sys.version_info[0] < 3:
sys.stdout = codecs.getwriter("utf-8")(sys.stdout)
options = docopt.docopt(__doc__,
help=True,
... | python | def main():
"""Entry point for remove_template."""
# Wrap sys stdout for python 2, so print can understand unicode.
if sys.version_info[0] < 3:
sys.stdout = codecs.getwriter("utf-8")(sys.stdout)
options = docopt.docopt(__doc__,
help=True,
... | [
"def",
"main",
"(",
")",
":",
"# Wrap sys stdout for python 2, so print can understand unicode.",
"if",
"sys",
".",
"version_info",
"[",
"0",
"]",
"<",
"3",
":",
"sys",
".",
"stdout",
"=",
"codecs",
".",
"getwriter",
"(",
"\"utf-8\"",
")",
"(",
"sys",
".",
"... | Entry point for remove_template. | [
"Entry",
"point",
"for",
"remove_template",
"."
] | de963f221612f57d4982fbc779acd21302c7b817 | https://github.com/deezer/template-remover/blob/de963f221612f57d4982fbc779acd21302c7b817/scripts/remove_template.py#L49-L62 | train | Entry point for remove_template. |
neithere/eav-django | eav/models.py | validate_range_value | def validate_range_value(value):
"""
Validates given value against `Schema.TYPE_RANGE` data type. Raises
TypeError or ValueError if something is wrong. Returns None if everything
is OK.
"""
if value == (None, None):
return
if not hasattr(value, '__iter__'):
raise TypeError('... | python | def validate_range_value(value):
"""
Validates given value against `Schema.TYPE_RANGE` data type. Raises
TypeError or ValueError if something is wrong. Returns None if everything
is OK.
"""
if value == (None, None):
return
if not hasattr(value, '__iter__'):
raise TypeError('... | [
"def",
"validate_range_value",
"(",
"value",
")",
":",
"if",
"value",
"==",
"(",
"None",
",",
"None",
")",
":",
"return",
"if",
"not",
"hasattr",
"(",
"value",
",",
"'__iter__'",
")",
":",
"raise",
"TypeError",
"(",
"'Range value must be an iterable, got \"%s\... | Validates given value against `Schema.TYPE_RANGE` data type. Raises
TypeError or ValueError if something is wrong. Returns None if everything
is OK. | [
"Validates",
"given",
"value",
"against",
"Schema",
".",
"TYPE_RANGE",
"data",
"type",
".",
"Raises",
"TypeError",
"or",
"ValueError",
"if",
"something",
"is",
"wrong",
".",
"Returns",
"None",
"if",
"everything",
"is",
"OK",
"."
] | 7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7 | https://github.com/neithere/eav-django/blob/7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7/eav/models.py#L357-L377 | train | Validates given value against schema. TYPE_RANGE data type. Raises TypeError ValueError if something is wrong. Returns None if everything is OK. |
neithere/eav-django | eav/models.py | BaseSchema.save_attr | def save_attr(self, entity, value):
"""
Saves given EAV attribute with given value for given entity.
If schema is not many-to-one, the value is saved to the corresponding
Attr instance (which is created or updated).
If schema is many-to-one, the value is processed thusly:
... | python | def save_attr(self, entity, value):
"""
Saves given EAV attribute with given value for given entity.
If schema is not many-to-one, the value is saved to the corresponding
Attr instance (which is created or updated).
If schema is many-to-one, the value is processed thusly:
... | [
"def",
"save_attr",
"(",
"self",
",",
"entity",
",",
"value",
")",
":",
"if",
"self",
".",
"datatype",
"==",
"self",
".",
"TYPE_MANY",
":",
"self",
".",
"_save_m2m_attr",
"(",
"entity",
",",
"value",
")",
"else",
":",
"self",
".",
"_save_single_attr",
... | Saves given EAV attribute with given value for given entity.
If schema is not many-to-one, the value is saved to the corresponding
Attr instance (which is created or updated).
If schema is many-to-one, the value is processed thusly:
* if value is iterable, all Attr instances for corre... | [
"Saves",
"given",
"EAV",
"attribute",
"with",
"given",
"value",
"for",
"given",
"entity",
"."
] | 7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7 | https://github.com/neithere/eav-django/blob/7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7/eav/models.py#L111-L132 | train | Saves given EAV attribute with given value for given entity. |
neithere/eav-django | eav/models.py | BaseSchema._save_single_attr | def _save_single_attr(self, entity, value=None, schema=None,
create_nulls=False, extra={}):
"""
Creates or updates an EAV attribute for given entity with given value.
:param schema: schema for attribute. Default it current schema instance.
:param create_nulls: ... | python | def _save_single_attr(self, entity, value=None, schema=None,
create_nulls=False, extra={}):
"""
Creates or updates an EAV attribute for given entity with given value.
:param schema: schema for attribute. Default it current schema instance.
:param create_nulls: ... | [
"def",
"_save_single_attr",
"(",
"self",
",",
"entity",
",",
"value",
"=",
"None",
",",
"schema",
"=",
"None",
",",
"create_nulls",
"=",
"False",
",",
"extra",
"=",
"{",
"}",
")",
":",
"# If schema is not many-to-one, the value is saved to the corresponding",
"# A... | Creates or updates an EAV attribute for given entity with given value.
:param schema: schema for attribute. Default it current schema instance.
:param create_nulls: boolean: if True, even attributes with value=None
are created (by default they are skipped).
:param extra: dict: addit... | [
"Creates",
"or",
"updates",
"an",
"EAV",
"attribute",
"for",
"given",
"entity",
"with",
"given",
"value",
"."
] | 7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7 | https://github.com/neithere/eav-django/blob/7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7/eav/models.py#L134-L157 | train | Save a single attribute for given entity. |
neithere/eav-django | eav/models.py | BaseEntity.save | def save(self, force_eav=False, **kwargs):
"""
Saves entity instance and creates/updates related attribute instances.
:param eav: if True (default), EAV attributes are saved along with entity.
"""
# save entity
super(BaseEntity, self).save(**kwargs)
# TODO: thin... | python | def save(self, force_eav=False, **kwargs):
"""
Saves entity instance and creates/updates related attribute instances.
:param eav: if True (default), EAV attributes are saved along with entity.
"""
# save entity
super(BaseEntity, self).save(**kwargs)
# TODO: thin... | [
"def",
"save",
"(",
"self",
",",
"force_eav",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# save entity",
"super",
"(",
"BaseEntity",
",",
"self",
")",
".",
"save",
"(",
"*",
"*",
"kwargs",
")",
"# TODO: think about use cases; are we doing it right?",
... | Saves entity instance and creates/updates related attribute instances.
:param eav: if True (default), EAV attributes are saved along with entity. | [
"Saves",
"entity",
"instance",
"and",
"creates",
"/",
"updates",
"related",
"attribute",
"instances",
"."
] | 7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7 | https://github.com/neithere/eav-django/blob/7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7/eav/models.py#L193-L213 | train | Saves the entity instance and creates or updates related attribute instances. |
bitesofcode/projexui | projexui/widgets/xcolorbutton.py | pickColor | def pickColor( self ):
"""
Prompts the user to select a color for this button.
"""
color = QColorDialog.getColor( self.color(), self )
if ( color.isValid() ):
self.setColor(color) | python | def pickColor( self ):
"""
Prompts the user to select a color for this button.
"""
color = QColorDialog.getColor( self.color(), self )
if ( color.isValid() ):
self.setColor(color) | [
"def",
"pickColor",
"(",
"self",
")",
":",
"color",
"=",
"QColorDialog",
".",
"getColor",
"(",
"self",
".",
"color",
"(",
")",
",",
"self",
")",
"if",
"(",
"color",
".",
"isValid",
"(",
")",
")",
":",
"self",
".",
"setColor",
"(",
"color",
")"
] | Prompts the user to select a color for this button. | [
"Prompts",
"the",
"user",
"to",
"select",
"a",
"color",
"for",
"this",
"button",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcolorbutton.py#L49-L56 | train | Prompts the user to select a color for this button. |
bitesofcode/projexui | projexui/widgets/xcolorbutton.py | setColor | def setColor( self, color ):
"""
Sets the color value for this button to the given color.
:param color | <QColor>
"""
self._color = color
palette = self.palette()
palette.setColor(palette.Button, color)
self.setPalette(palette)
... | python | def setColor( self, color ):
"""
Sets the color value for this button to the given color.
:param color | <QColor>
"""
self._color = color
palette = self.palette()
palette.setColor(palette.Button, color)
self.setPalette(palette)
... | [
"def",
"setColor",
"(",
"self",
",",
"color",
")",
":",
"self",
".",
"_color",
"=",
"color",
"palette",
"=",
"self",
".",
"palette",
"(",
")",
"palette",
".",
"setColor",
"(",
"palette",
".",
"Button",
",",
"color",
")",
"self",
".",
"setPalette",
"(... | Sets the color value for this button to the given color.
:param color | <QColor> | [
"Sets",
"the",
"color",
"value",
"for",
"this",
"button",
"to",
"the",
"given",
"color",
".",
":",
"param",
"color",
"|",
"<QColor",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcolorbutton.py#L58-L70 | train | Sets the color value for this button to the given color. |
bitesofcode/projexui | projexui/widgets/xcurrencyspinbox.py | XCurrencySpinBox.setCurrency | def setCurrency( self, currency ):
"""
Sets the currency for this widget.
:param currency | <str>
"""
self._currency = currency
self.setValue(self.value()) | python | def setCurrency( self, currency ):
"""
Sets the currency for this widget.
:param currency | <str>
"""
self._currency = currency
self.setValue(self.value()) | [
"def",
"setCurrency",
"(",
"self",
",",
"currency",
")",
":",
"self",
".",
"_currency",
"=",
"currency",
"self",
".",
"setValue",
"(",
"self",
".",
"value",
"(",
")",
")"
] | Sets the currency for this widget.
:param currency | <str> | [
"Sets",
"the",
"currency",
"for",
"this",
"widget",
".",
":",
"param",
"currency",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcurrencyspinbox.py#L37-L44 | train | Sets the currency for this widget. |
bitesofcode/projexui | projexui/widgets/xcurrencyspinbox.py | XCurrencySpinBox.valueFromText | def valueFromText( self, text ):
"""
Returns the value for this widgets text.
:param text | <str>
:return <float>
"""
value, currency = projex.money.fromString(text)
return value | python | def valueFromText( self, text ):
"""
Returns the value for this widgets text.
:param text | <str>
:return <float>
"""
value, currency = projex.money.fromString(text)
return value | [
"def",
"valueFromText",
"(",
"self",
",",
"text",
")",
":",
"value",
",",
"currency",
"=",
"projex",
".",
"money",
".",
"fromString",
"(",
"text",
")",
"return",
"value"
] | Returns the value for this widgets text.
:param text | <str>
:return <float> | [
"Returns",
"the",
"value",
"for",
"this",
"widgets",
"text",
".",
":",
"param",
"text",
"|",
"<str",
">",
":",
"return",
"<float",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcurrencyspinbox.py#L56-L66 | train | Returns the value for this widgets text. |
bitesofcode/projexui | projexui/widgets/xdropzonewidget.py | XDropZoneWidget.addRegion | def addRegion(self, name, text, row, column):
"""
Adds a new region for this zone at the given row and column.
:param name | <str>
text | <str>
row | <int>
column | <int>
"""
region = XDropZ... | python | def addRegion(self, name, text, row, column):
"""
Adds a new region for this zone at the given row and column.
:param name | <str>
text | <str>
row | <int>
column | <int>
"""
region = XDropZ... | [
"def",
"addRegion",
"(",
"self",
",",
"name",
",",
"text",
",",
"row",
",",
"column",
")",
":",
"region",
"=",
"XDropZoneRegion",
"(",
"self",
")",
"region",
".",
"setObjectName",
"(",
"name",
")",
"region",
".",
"setText",
"(",
"text",
")",
"region",
... | Adds a new region for this zone at the given row and column.
:param name | <str>
text | <str>
row | <int>
column | <int> | [
"Adds",
"a",
"new",
"region",
"for",
"this",
"zone",
"at",
"the",
"given",
"row",
"and",
"column",
".",
":",
"param",
"name",
"|",
"<str",
">",
"text",
"|",
"<str",
">",
"row",
"|",
"<int",
">",
"column",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xdropzonewidget.py#L115-L129 | train | Adds a new region to the zone at the given row and column. |
bitesofcode/projexui | projexui/widgets/xdropzonewidget.py | XDropZoneWidget.currentRegion | def currentRegion(self):
"""
Returns the current region based on the current cursor position.
:return <XDropZoneWidget>
"""
pos = QtGui.QCursor.pos()
pos = self.mapFromGlobal(pos)
for region in self.regions():
if region.testHovere... | python | def currentRegion(self):
"""
Returns the current region based on the current cursor position.
:return <XDropZoneWidget>
"""
pos = QtGui.QCursor.pos()
pos = self.mapFromGlobal(pos)
for region in self.regions():
if region.testHovere... | [
"def",
"currentRegion",
"(",
"self",
")",
":",
"pos",
"=",
"QtGui",
".",
"QCursor",
".",
"pos",
"(",
")",
"pos",
"=",
"self",
".",
"mapFromGlobal",
"(",
"pos",
")",
"for",
"region",
"in",
"self",
".",
"regions",
"(",
")",
":",
"if",
"region",
".",
... | Returns the current region based on the current cursor position.
:return <XDropZoneWidget> | [
"Returns",
"the",
"current",
"region",
"based",
"on",
"the",
"current",
"cursor",
"position",
".",
":",
"return",
"<XDropZoneWidget",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xdropzonewidget.py#L131-L142 | train | Returns the current region based on the current cursor position. |
bitesofcode/projexui | projexui/helpers/xanimatediconhelper.py | XAnimatedIconHelper.setMovie | def setMovie( self, movie ):
"""
Sets the movie for this icon.
:param movie | <QMovie> || None
"""
if ( self._movie ):
self._movie.frameChanged.disconnect(self.updateIcon)
self._movie = movie
if ( self._movie ):
... | python | def setMovie( self, movie ):
"""
Sets the movie for this icon.
:param movie | <QMovie> || None
"""
if ( self._movie ):
self._movie.frameChanged.disconnect(self.updateIcon)
self._movie = movie
if ( self._movie ):
... | [
"def",
"setMovie",
"(",
"self",
",",
"movie",
")",
":",
"if",
"(",
"self",
".",
"_movie",
")",
":",
"self",
".",
"_movie",
".",
"frameChanged",
".",
"disconnect",
"(",
"self",
".",
"updateIcon",
")",
"self",
".",
"_movie",
"=",
"movie",
"if",
"(",
... | Sets the movie for this icon.
:param movie | <QMovie> || None | [
"Sets",
"the",
"movie",
"for",
"this",
"icon",
".",
":",
"param",
"movie",
"|",
"<QMovie",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/helpers/xanimatediconhelper.py#L50-L62 | train | Sets the movie for this icon. |
damnit/pymite | pymite/adapters.py | DefaultReadAdapter.by_id | def by_id(self, id):
"""get adapter data by its id."""
path = partial(_path, self.adapter)
path = path(id)
return self._get(path) | python | def by_id(self, id):
"""get adapter data by its id."""
path = partial(_path, self.adapter)
path = path(id)
return self._get(path) | [
"def",
"by_id",
"(",
"self",
",",
"id",
")",
":",
"path",
"=",
"partial",
"(",
"_path",
",",
"self",
".",
"adapter",
")",
"path",
"=",
"path",
"(",
"id",
")",
"return",
"self",
".",
"_get",
"(",
"path",
")"
] | get adapter data by its id. | [
"get",
"adapter",
"data",
"by",
"its",
"id",
"."
] | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/adapters.py#L19-L23 | train | get adapter data by its id. |
damnit/pymite | pymite/adapters.py | DefaultReadAdapter.by_name | def by_name(self, name, archived=False, limit=None, page=None):
"""get adapter data by name."""
if not archived:
path = _path(self.adapter)
else:
path = _path(self.adapter, 'archived')
return self._get(path, name=name, limit=limit, page=page) | python | def by_name(self, name, archived=False, limit=None, page=None):
"""get adapter data by name."""
if not archived:
path = _path(self.adapter)
else:
path = _path(self.adapter, 'archived')
return self._get(path, name=name, limit=limit, page=page) | [
"def",
"by_name",
"(",
"self",
",",
"name",
",",
"archived",
"=",
"False",
",",
"limit",
"=",
"None",
",",
"page",
"=",
"None",
")",
":",
"if",
"not",
"archived",
":",
"path",
"=",
"_path",
"(",
"self",
".",
"adapter",
")",
"else",
":",
"path",
"... | get adapter data by name. | [
"get",
"adapter",
"data",
"by",
"name",
"."
] | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/adapters.py#L25-L31 | train | get adapter data by name. |
damnit/pymite | pymite/adapters.py | DefaultReadAdapter.all | def all(self, archived=False, limit=None, page=None):
"""get all adapter data."""
path = partial(_path, self.adapter)
if not archived:
path = _path(self.adapter)
else:
path = _path(self.adapter, 'archived')
return self._get(path, limit=limit, page=page) | python | def all(self, archived=False, limit=None, page=None):
"""get all adapter data."""
path = partial(_path, self.adapter)
if not archived:
path = _path(self.adapter)
else:
path = _path(self.adapter, 'archived')
return self._get(path, limit=limit, page=page) | [
"def",
"all",
"(",
"self",
",",
"archived",
"=",
"False",
",",
"limit",
"=",
"None",
",",
"page",
"=",
"None",
")",
":",
"path",
"=",
"partial",
"(",
"_path",
",",
"self",
".",
"adapter",
")",
"if",
"not",
"archived",
":",
"path",
"=",
"_path",
"... | get all adapter data. | [
"get",
"all",
"adapter",
"data",
"."
] | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/adapters.py#L33-L40 | train | get all adapter data. |
damnit/pymite | pymite/adapters.py | Projects.by_name | def by_name(self, name, archived=False, limit=None, page=None):
""" return a project by it's name.
this only works with the exact name of the project.
"""
# this only works with the exact name
return super(Projects, self).by_name(name, archived=archived,
... | python | def by_name(self, name, archived=False, limit=None, page=None):
""" return a project by it's name.
this only works with the exact name of the project.
"""
# this only works with the exact name
return super(Projects, self).by_name(name, archived=archived,
... | [
"def",
"by_name",
"(",
"self",
",",
"name",
",",
"archived",
"=",
"False",
",",
"limit",
"=",
"None",
",",
"page",
"=",
"None",
")",
":",
"# this only works with the exact name",
"return",
"super",
"(",
"Projects",
",",
"self",
")",
".",
"by_name",
"(",
... | return a project by it's name.
this only works with the exact name of the project. | [
"return",
"a",
"project",
"by",
"it",
"s",
"name",
".",
"this",
"only",
"works",
"with",
"the",
"exact",
"name",
"of",
"the",
"project",
"."
] | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/adapters.py#L56-L62 | train | return a project by it s name |
damnit/pymite | pymite/adapters.py | Users.by_mail | def by_mail(self, mail, archived=False, limit=None, page=None):
""" lookup users by mail address.
you may do in two ways:
- specify one address: foo@bar.com
- specify a domain : @bar.com
both will return a list.
the role 'Zeiterfasser' may not lookup users.
... | python | def by_mail(self, mail, archived=False, limit=None, page=None):
""" lookup users by mail address.
you may do in two ways:
- specify one address: foo@bar.com
- specify a domain : @bar.com
both will return a list.
the role 'Zeiterfasser' may not lookup users.
... | [
"def",
"by_mail",
"(",
"self",
",",
"mail",
",",
"archived",
"=",
"False",
",",
"limit",
"=",
"None",
",",
"page",
"=",
"None",
")",
":",
"path",
"=",
"partial",
"(",
"_path",
",",
"self",
".",
"adapter",
")",
"if",
"not",
"archived",
":",
"path",
... | lookup users by mail address.
you may do in two ways:
- specify one address: foo@bar.com
- specify a domain : @bar.com
both will return a list.
the role 'Zeiterfasser' may not lookup users. | [
"lookup",
"users",
"by",
"mail",
"address",
".",
"you",
"may",
"do",
"in",
"two",
"ways",
":",
"-",
"specify",
"one",
"address",
":",
"foo@bar",
".",
"com",
"-",
"specify",
"a",
"domain",
":",
"@bar",
".",
"com",
"both",
"will",
"return",
"a",
"list"... | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/adapters.py#L130-L144 | train | lookup users by email address. |
damnit/pymite | pymite/adapters.py | TimeEntries.query | def query(self, **kwargs):
"""a free query - you are responsible for the kwargs.
Object categories 'time_entry' and 'time_entry_group' are declassed.
See http://mite.yo.lk/en/api/time-entries.html for more information.
"""
path = partial(_path, self.adapter)
path = _path(... | python | def query(self, **kwargs):
"""a free query - you are responsible for the kwargs.
Object categories 'time_entry' and 'time_entry_group' are declassed.
See http://mite.yo.lk/en/api/time-entries.html for more information.
"""
path = partial(_path, self.adapter)
path = _path(... | [
"def",
"query",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"path",
"=",
"partial",
"(",
"_path",
",",
"self",
".",
"adapter",
")",
"path",
"=",
"_path",
"(",
"self",
".",
"adapter",
")",
"return",
"self",
".",
"_get",
"(",
"path",
",",
"*",
... | a free query - you are responsible for the kwargs.
Object categories 'time_entry' and 'time_entry_group' are declassed.
See http://mite.yo.lk/en/api/time-entries.html for more information. | [
"a",
"free",
"query",
"-",
"you",
"are",
"responsible",
"for",
"the",
"kwargs",
".",
"Object",
"categories",
"time_entry",
"and",
"time_entry_group",
"are",
"declassed",
".",
"See",
"http",
":",
"//",
"mite",
".",
"yo",
".",
"lk",
"/",
"en",
"/",
"api",
... | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/adapters.py#L179-L186 | train | a free query for the object category |
damnit/pymite | pymite/adapters.py | TimeEntries.create | def create(self, date_at=None, minutes=0, note='', user_id=None,
project_id=None, service_id=None):
""" date_at - date of time entry. Format YYYY-MM-DD. default: today
minutes - default: 0
note - default: '' (empty string)
user_id - default: actual user id (onl... | python | def create(self, date_at=None, minutes=0, note='', user_id=None,
project_id=None, service_id=None):
""" date_at - date of time entry. Format YYYY-MM-DD. default: today
minutes - default: 0
note - default: '' (empty string)
user_id - default: actual user id (onl... | [
"def",
"create",
"(",
"self",
",",
"date_at",
"=",
"None",
",",
"minutes",
"=",
"0",
",",
"note",
"=",
"''",
",",
"user_id",
"=",
"None",
",",
"project_id",
"=",
"None",
",",
"service_id",
"=",
"None",
")",
":",
"keywords",
"=",
"{",
"'date_at'",
"... | date_at - date of time entry. Format YYYY-MM-DD. default: today
minutes - default: 0
note - default: '' (empty string)
user_id - default: actual user id (only admin users can edit this)
project_id - default: None
service_id - default: None | [
"date_at",
"-",
"date",
"of",
"time",
"entry",
".",
"Format",
"YYYY",
"-",
"MM",
"-",
"DD",
".",
"default",
":",
"today",
"minutes",
"-",
"default",
":",
"0",
"note",
"-",
"default",
":",
"(",
"empty",
"string",
")",
"user_id",
"-",
"default",
":",
... | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/adapters.py#L189-L210 | train | Create a new entry in the cache. |
damnit/pymite | pymite/adapters.py | TimeEntries.delete | def delete(self, id):
""" delete a time entry. """
path = partial(_path, self.adapter)
path = path(id)
return self._delete(path) | python | def delete(self, id):
""" delete a time entry. """
path = partial(_path, self.adapter)
path = path(id)
return self._delete(path) | [
"def",
"delete",
"(",
"self",
",",
"id",
")",
":",
"path",
"=",
"partial",
"(",
"_path",
",",
"self",
".",
"adapter",
")",
"path",
"=",
"path",
"(",
"id",
")",
"return",
"self",
".",
"_delete",
"(",
"path",
")"
] | delete a time entry. | [
"delete",
"a",
"time",
"entry",
"."
] | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/adapters.py#L212-L216 | train | delete a time entry. |
damnit/pymite | pymite/adapters.py | Daily.at | def at(self, year, month, day):
""" time entries by year, month and day. """
path = partial(_path, self.adapter)
path = partial(path, int(year))
path = partial(path, int(month))
path = path(int(day))
return self._get(path) | python | def at(self, year, month, day):
""" time entries by year, month and day. """
path = partial(_path, self.adapter)
path = partial(path, int(year))
path = partial(path, int(month))
path = path(int(day))
return self._get(path) | [
"def",
"at",
"(",
"self",
",",
"year",
",",
"month",
",",
"day",
")",
":",
"path",
"=",
"partial",
"(",
"_path",
",",
"self",
".",
"adapter",
")",
"path",
"=",
"partial",
"(",
"path",
",",
"int",
"(",
"year",
")",
")",
"path",
"=",
"partial",
"... | time entries by year, month and day. | [
"time",
"entries",
"by",
"year",
"month",
"and",
"day",
"."
] | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/adapters.py#L226-L232 | train | Get the time entries by year month and day. |
damnit/pymite | pymite/adapters.py | Tracker.start | def start(self, id):
""" start a specific tracker. """
path = partial(_path, self.adapter)
path = path(id)
return self._put(path) | python | def start(self, id):
""" start a specific tracker. """
path = partial(_path, self.adapter)
path = path(id)
return self._put(path) | [
"def",
"start",
"(",
"self",
",",
"id",
")",
":",
"path",
"=",
"partial",
"(",
"_path",
",",
"self",
".",
"adapter",
")",
"path",
"=",
"path",
"(",
"id",
")",
"return",
"self",
".",
"_put",
"(",
"path",
")"
] | start a specific tracker. | [
"start",
"a",
"specific",
"tracker",
"."
] | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/adapters.py#L254-L258 | train | start a specific tracker. |
damnit/pymite | pymite/adapters.py | Tracker.stop | def stop(self, id):
""" stop the tracker. """
path = partial(_path, self.adapter)
path = path(id)
return self._delete(path) | python | def stop(self, id):
""" stop the tracker. """
path = partial(_path, self.adapter)
path = path(id)
return self._delete(path) | [
"def",
"stop",
"(",
"self",
",",
"id",
")",
":",
"path",
"=",
"partial",
"(",
"_path",
",",
"self",
".",
"adapter",
")",
"path",
"=",
"path",
"(",
"id",
")",
"return",
"self",
".",
"_delete",
"(",
"path",
")"
] | stop the tracker. | [
"stop",
"the",
"tracker",
"."
] | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | https://github.com/damnit/pymite/blob/1e9b9bf6aef790af2d8781f9f77c098c54ca0342/pymite/adapters.py#L261-L265 | train | stop the tracker. |
pmuller/versions | versions/operators.py | Operator.parse | def parse(cls, string):
"""Parses `string` and returns an :class:`Operator`
object.
:raises: :exc:`InvalidOperatorExpression` If `string` is not \
a valid operator.
Valid operators are ``==``, ``!=``, ``<``, ``>``, ``<=``, and ``>=``.
"""
if string in STR_TO_OP... | python | def parse(cls, string):
"""Parses `string` and returns an :class:`Operator`
object.
:raises: :exc:`InvalidOperatorExpression` If `string` is not \
a valid operator.
Valid operators are ``==``, ``!=``, ``<``, ``>``, ``<=``, and ``>=``.
"""
if string in STR_TO_OP... | [
"def",
"parse",
"(",
"cls",
",",
"string",
")",
":",
"if",
"string",
"in",
"STR_TO_OP_FUNC",
":",
"return",
"cls",
"(",
"STR_TO_OP_FUNC",
"[",
"string",
"]",
",",
"string",
")",
"else",
":",
"raise",
"InvalidOperatorExpression",
"(",
"string",
")"
] | Parses `string` and returns an :class:`Operator`
object.
:raises: :exc:`InvalidOperatorExpression` If `string` is not \
a valid operator.
Valid operators are ``==``, ``!=``, ``<``, ``>``, ``<=``, and ``>=``. | [
"Parses",
"string",
"and",
"returns",
"an",
":",
"class",
":",
"Operator",
"object",
"."
] | 951bc3fd99b6a675190f11ee0752af1d7ff5b440 | https://github.com/pmuller/versions/blob/951bc3fd99b6a675190f11ee0752af1d7ff5b440/versions/operators.py#L51-L64 | train | Parses a string and returns an instance of Operator object. |
bitesofcode/projexui | projexui/widgets/xrolloutwidget.py | XRolloutItem.paintEvent | def paintEvent( self, event ):
"""
Overloads the paint event to draw rounded edges on this widget.
:param event | <QPaintEvent>
"""
super(XRolloutItem, self).paintEvent(event)
with XPainter(self) as painter:
w = self.width() - 3
... | python | def paintEvent( self, event ):
"""
Overloads the paint event to draw rounded edges on this widget.
:param event | <QPaintEvent>
"""
super(XRolloutItem, self).paintEvent(event)
with XPainter(self) as painter:
w = self.width() - 3
... | [
"def",
"paintEvent",
"(",
"self",
",",
"event",
")",
":",
"super",
"(",
"XRolloutItem",
",",
"self",
")",
".",
"paintEvent",
"(",
"event",
")",
"with",
"XPainter",
"(",
"self",
")",
"as",
"painter",
":",
"w",
"=",
"self",
".",
"width",
"(",
")",
"-... | Overloads the paint event to draw rounded edges on this widget.
:param event | <QPaintEvent> | [
"Overloads",
"the",
"paint",
"event",
"to",
"draw",
"rounded",
"edges",
"on",
"this",
"widget",
".",
":",
"param",
"event",
"|",
"<QPaintEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xrolloutwidget.py#L106-L126 | train | Overloads the paint event to draw rounded edges on this widget. |
bitesofcode/projexui | projexui/widgets/xrolloutwidget.py | XRolloutItem.setExpanded | def setExpanded( self, state ):
"""
Sets whether or not this rollout is in the expanded state.
:param state | <bool>
"""
self._expanded = state
self._widget.setVisible(state)
if ( state ):
ico = projexui.resources.find('img/treev... | python | def setExpanded( self, state ):
"""
Sets whether or not this rollout is in the expanded state.
:param state | <bool>
"""
self._expanded = state
self._widget.setVisible(state)
if ( state ):
ico = projexui.resources.find('img/treev... | [
"def",
"setExpanded",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_expanded",
"=",
"state",
"self",
".",
"_widget",
".",
"setVisible",
"(",
"state",
")",
"if",
"(",
"state",
")",
":",
"ico",
"=",
"projexui",
".",
"resources",
".",
"find",
"(",... | Sets whether or not this rollout is in the expanded state.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"this",
"rollout",
"is",
"in",
"the",
"expanded",
"state",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xrolloutwidget.py#L152-L174 | train | Sets whether or not this rollout is in the expanded state. |
bitesofcode/projexui | projexui/widgets/xrolloutwidget.py | XRolloutWidget.clear | def clear( self ):
"""
Clears out all of the rollout items from the widget.
"""
self.blockSignals(True)
self.setUpdatesEnabled(False)
for child in self.findChildren(XRolloutItem):
child.setParent(None)
child.deleteLater()
self.setUpdatesEna... | python | def clear( self ):
"""
Clears out all of the rollout items from the widget.
"""
self.blockSignals(True)
self.setUpdatesEnabled(False)
for child in self.findChildren(XRolloutItem):
child.setParent(None)
child.deleteLater()
self.setUpdatesEna... | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"setUpdatesEnabled",
"(",
"False",
")",
"for",
"child",
"in",
"self",
".",
"findChildren",
"(",
"XRolloutItem",
")",
":",
"child",
".",
"setParent",
"(",
... | Clears out all of the rollout items from the widget. | [
"Clears",
"out",
"all",
"of",
"the",
"rollout",
"items",
"from",
"the",
"widget",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xrolloutwidget.py#L229-L239 | train | Clears out all of the rollout items from the widget. |
bitesofcode/projexui | projexui/widgets/xrolloutwidget.py | XRolloutWidget.addRollout | def addRollout( self, widget, title, expanded = False ):
"""
Adds a new widget to the rollout system.
:param widget | <QWidget>
title | <str>
expanded | <bool>
:return <XRolloutItem>
"""
layo... | python | def addRollout( self, widget, title, expanded = False ):
"""
Adds a new widget to the rollout system.
:param widget | <QWidget>
title | <str>
expanded | <bool>
:return <XRolloutItem>
"""
layo... | [
"def",
"addRollout",
"(",
"self",
",",
"widget",
",",
"title",
",",
"expanded",
"=",
"False",
")",
":",
"layout",
"=",
"self",
".",
"widget",
"(",
")",
".",
"layout",
"(",
")",
"item",
"=",
"XRolloutItem",
"(",
"self",
",",
"widget",
",",
"title",
... | Adds a new widget to the rollout system.
:param widget | <QWidget>
title | <str>
expanded | <bool>
:return <XRolloutItem> | [
"Adds",
"a",
"new",
"widget",
"to",
"the",
"rollout",
"system",
".",
":",
"param",
"widget",
"|",
"<QWidget",
">",
"title",
"|",
"<str",
">",
"expanded",
"|",
"<bool",
">",
":",
"return",
"<XRolloutItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xrolloutwidget.py#L241-L254 | train | Adds a new widget to the rollout system. |
bitesofcode/projexui | projexui/widgets/xrolloutwidget.py | XRolloutWidget.itemAt | def itemAt( self, index ):
"""
Returns the rollout item at the inputed index.
:return <XRolloutItem> || None
"""
layout = self.widget().layout()
if ( 0 <= index and index < (layout.count() - 1) ):
return layout.itemAt(index).widget()
retur... | python | def itemAt( self, index ):
"""
Returns the rollout item at the inputed index.
:return <XRolloutItem> || None
"""
layout = self.widget().layout()
if ( 0 <= index and index < (layout.count() - 1) ):
return layout.itemAt(index).widget()
retur... | [
"def",
"itemAt",
"(",
"self",
",",
"index",
")",
":",
"layout",
"=",
"self",
".",
"widget",
"(",
")",
".",
"layout",
"(",
")",
"if",
"(",
"0",
"<=",
"index",
"and",
"index",
"<",
"(",
"layout",
".",
"count",
"(",
")",
"-",
"1",
")",
")",
":",... | Returns the rollout item at the inputed index.
:return <XRolloutItem> || None | [
"Returns",
"the",
"rollout",
"item",
"at",
"the",
"inputed",
"index",
".",
":",
"return",
"<XRolloutItem",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xrolloutwidget.py#L264-L273 | train | Returns the rollout item at the inputed index. |
bitesofcode/projexui | projexui/widgets/xrolloutwidget.py | XRolloutWidget.items | def items( self ):
"""
Returns all the rollout items for this widget.
:return [<XRolloutItem>, ..]
"""
layout = self.widget().layout()
return [layout.itemAt(i).widget() for i in range(layout.count()-1)] | python | def items( self ):
"""
Returns all the rollout items for this widget.
:return [<XRolloutItem>, ..]
"""
layout = self.widget().layout()
return [layout.itemAt(i).widget() for i in range(layout.count()-1)] | [
"def",
"items",
"(",
"self",
")",
":",
"layout",
"=",
"self",
".",
"widget",
"(",
")",
".",
"layout",
"(",
")",
"return",
"[",
"layout",
".",
"itemAt",
"(",
"i",
")",
".",
"widget",
"(",
")",
"for",
"i",
"in",
"range",
"(",
"layout",
".",
"coun... | Returns all the rollout items for this widget.
:return [<XRolloutItem>, ..] | [
"Returns",
"all",
"the",
"rollout",
"items",
"for",
"this",
"widget",
".",
":",
"return",
"[",
"<XRolloutItem",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xrolloutwidget.py#L275-L282 | train | Returns all the rollout items for this widget. |
bitesofcode/projexui | projexui/widgets/xrolloutwidget.py | XRolloutWidget.takeAt | def takeAt( self, index ):
"""
Removes the widget from the rollout at the inputed index.
:param index | <int>
:return <QWidget> || None
"""
layout = self.widget().layout()
item = layout.takeAt(index)
if ( not item ):
... | python | def takeAt( self, index ):
"""
Removes the widget from the rollout at the inputed index.
:param index | <int>
:return <QWidget> || None
"""
layout = self.widget().layout()
item = layout.takeAt(index)
if ( not item ):
... | [
"def",
"takeAt",
"(",
"self",
",",
"index",
")",
":",
"layout",
"=",
"self",
".",
"widget",
"(",
")",
".",
"layout",
"(",
")",
"item",
"=",
"layout",
".",
"takeAt",
"(",
"index",
")",
"if",
"(",
"not",
"item",
")",
":",
"return",
"None",
"return"... | Removes the widget from the rollout at the inputed index.
:param index | <int>
:return <QWidget> || None | [
"Removes",
"the",
"widget",
"from",
"the",
"rollout",
"at",
"the",
"inputed",
"index",
".",
":",
"param",
"index",
"|",
"<int",
">",
":",
"return",
"<QWidget",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xrolloutwidget.py#L284-L297 | train | Removes the widget from the rollout at the inputed index. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.