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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
johnnoone/aioconsul | aioconsul/client/catalog_endpoint.py | CatalogEndpoint.deregister | async def deregister(self, node, *,
check=None, service=None, write_token=None):
"""Deregisters a node, service or check
Parameters:
node (Object or ObjectID): Node
check (ObjectID): Check ID
service (ObjectID): Service ID
write_t... | python | async def deregister(self, node, *,
check=None, service=None, write_token=None):
"""Deregisters a node, service or check
Parameters:
node (Object or ObjectID): Node
check (ObjectID): Check ID
service (ObjectID): Service ID
write_t... | [
"async",
"def",
"deregister",
"(",
"self",
",",
"node",
",",
"*",
",",
"check",
"=",
"None",
",",
"service",
"=",
"None",
",",
"write_token",
"=",
"None",
")",
":",
"entry",
"=",
"{",
"}",
"if",
"isinstance",
"(",
"node",
",",
"str",
")",
":",
"e... | Deregisters a node, service or check
Parameters:
node (Object or ObjectID): Node
check (ObjectID): Check ID
service (ObjectID): Service ID
write_token (ObjectID): Token ID
Returns:
bool: ``True`` on success
**Node** expects a body tha... | [
"Deregisters",
"a",
"node",
"service",
"or",
"check"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/catalog_endpoint.py#L193-L266 | train | Deregisters a node service or check from the cache. |
johnnoone/aioconsul | aioconsul/client/catalog_endpoint.py | CatalogEndpoint.nodes | async def nodes(self, *,
dc=None, near=None, watch=None, consistency=None):
"""Lists nodes in a given DC
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
near (str): Sort the node list... | python | async def nodes(self, *,
dc=None, near=None, watch=None, consistency=None):
"""Lists nodes in a given DC
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
near (str): Sort the node list... | [
"async",
"def",
"nodes",
"(",
"self",
",",
"*",
",",
"dc",
"=",
"None",
",",
"near",
"=",
"None",
",",
"watch",
"=",
"None",
",",
"consistency",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"dc\"",
":",
"dc",
",",
"\"near\"",
":",
"near",
"}",
... | Lists nodes in a given DC
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
near (str): Sort the node list in ascending order based on the
estimated round trip time from that node.
... | [
"Lists",
"nodes",
"in",
"a",
"given",
"DC"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/catalog_endpoint.py#L288-L328 | train | Lists the nodes in a given DC. |
johnnoone/aioconsul | aioconsul/client/catalog_endpoint.py | CatalogEndpoint.services | async def services(self, *, dc=None, watch=None, consistency=None):
"""Lists services in a given DC
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (Blocking): Do a blocking query
consi... | python | async def services(self, *, dc=None, watch=None, consistency=None):
"""Lists services in a given DC
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (Blocking): Do a blocking query
consi... | [
"async",
"def",
"services",
"(",
"self",
",",
"*",
",",
"dc",
"=",
"None",
",",
"watch",
"=",
"None",
",",
"consistency",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"dc\"",
":",
"dc",
"}",
"response",
"=",
"await",
"self",
".",
"_api",
".",
"ge... | Lists services in a given DC
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (Blocking): Do a blocking query
consistency (Consistency): Force consistency
Returns:
ObjectMeta... | [
"Lists",
"services",
"in",
"a",
"given",
"DC"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/catalog_endpoint.py#L330-L360 | train | Lists services in a given DC |
bitesofcode/projexui | projexui/xtimer.py | XTimer._startTimer | def _startTimer(self, interval):
"""
Starts the internal timer.
:param interval | <int>
"""
if not self.__timer:
self.__timer = QtCore.QTimer(self)
self.__timer.setSingleShot(self.__singleShot)
self.__timer.setInterval(in... | python | def _startTimer(self, interval):
"""
Starts the internal timer.
:param interval | <int>
"""
if not self.__timer:
self.__timer = QtCore.QTimer(self)
self.__timer.setSingleShot(self.__singleShot)
self.__timer.setInterval(in... | [
"def",
"_startTimer",
"(",
"self",
",",
"interval",
")",
":",
"if",
"not",
"self",
".",
"__timer",
":",
"self",
".",
"__timer",
"=",
"QtCore",
".",
"QTimer",
"(",
"self",
")",
"self",
".",
"__timer",
".",
"setSingleShot",
"(",
"self",
".",
"__singleSho... | Starts the internal timer.
:param interval | <int> | [
"Starts",
"the",
"internal",
"timer",
".",
":",
"param",
"interval",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xtimer.py#L97-L113 | train | Starts the internal timer. |
bitesofcode/projexui | projexui/xtimer.py | XTimer.setInterval | def setInterval(self, msecs):
"""
Sets the interval in milliseconds for this timer.
:param msecs | <int>
"""
with QtCore.QWriteLocker(self.__lock):
self.__interval = msecs
self._intervalChanged.emit(msecs) | python | def setInterval(self, msecs):
"""
Sets the interval in milliseconds for this timer.
:param msecs | <int>
"""
with QtCore.QWriteLocker(self.__lock):
self.__interval = msecs
self._intervalChanged.emit(msecs) | [
"def",
"setInterval",
"(",
"self",
",",
"msecs",
")",
":",
"with",
"QtCore",
".",
"QWriteLocker",
"(",
"self",
".",
"__lock",
")",
":",
"self",
".",
"__interval",
"=",
"msecs",
"self",
".",
"_intervalChanged",
".",
"emit",
"(",
"msecs",
")"
] | Sets the interval in milliseconds for this timer.
:param msecs | <int> | [
"Sets",
"the",
"interval",
"in",
"milliseconds",
"for",
"this",
"timer",
".",
":",
"param",
"msecs",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xtimer.py#L155-L163 | train | Sets the interval in milliseconds for this timer. |
bitesofcode/projexui | projexui/xtimer.py | XTimer.setSingleShot | def setSingleShot(self, state):
"""
Sets whether or not this timer is setup for a single entry or not.
:param state | <bool>
"""
with QtCore.QWriteLocker(self.__lock):
self.__singleShot = state
self._singleShotChanged.emit(state) | python | def setSingleShot(self, state):
"""
Sets whether or not this timer is setup for a single entry or not.
:param state | <bool>
"""
with QtCore.QWriteLocker(self.__lock):
self.__singleShot = state
self._singleShotChanged.emit(state) | [
"def",
"setSingleShot",
"(",
"self",
",",
"state",
")",
":",
"with",
"QtCore",
".",
"QWriteLocker",
"(",
"self",
".",
"__lock",
")",
":",
"self",
".",
"__singleShot",
"=",
"state",
"self",
".",
"_singleShotChanged",
".",
"emit",
"(",
"state",
")"
] | Sets whether or not this timer is setup for a single entry or not.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"this",
"timer",
"is",
"setup",
"for",
"a",
"single",
"entry",
"or",
"not",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xtimer.py#L165-L173 | train | Sets whether or not this timer is setup for a single entry or not. |
bitesofcode/projexui | projexui/xtimer.py | XTimer.start | def start(self, interval=None):
"""
Emits the start requested signal for this timer, effectively starting
its internal timer.
:param interval | <int>
"""
# update the interval value
with QtCore.QReadLocker(self.__lock):
if interv... | python | def start(self, interval=None):
"""
Emits the start requested signal for this timer, effectively starting
its internal timer.
:param interval | <int>
"""
# update the interval value
with QtCore.QReadLocker(self.__lock):
if interv... | [
"def",
"start",
"(",
"self",
",",
"interval",
"=",
"None",
")",
":",
"# update the interval value\r",
"with",
"QtCore",
".",
"QReadLocker",
"(",
"self",
".",
"__lock",
")",
":",
"if",
"interval",
"is",
"None",
":",
"interval",
"=",
"self",
".",
"__interval... | Emits the start requested signal for this timer, effectively starting
its internal timer.
:param interval | <int> | [
"Emits",
"the",
"start",
"requested",
"signal",
"for",
"this",
"timer",
"effectively",
"starting",
"its",
"internal",
"timer",
".",
":",
"param",
"interval",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xtimer.py#L175-L190 | train | Emits the start requested signal for this timer effectively starting it s internal timer. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileAction.setProfile | def setProfile(self, profile):
"""
Sets the profile linked with this action.
:param profile | <projexui.widgets.xviewwidget.XViewProfile>
"""
self._profile = profile
# update the interface
self.setIcon(profile.icon())
self.... | python | def setProfile(self, profile):
"""
Sets the profile linked with this action.
:param profile | <projexui.widgets.xviewwidget.XViewProfile>
"""
self._profile = profile
# update the interface
self.setIcon(profile.icon())
self.... | [
"def",
"setProfile",
"(",
"self",
",",
"profile",
")",
":",
"self",
".",
"_profile",
"=",
"profile",
"# update the interface\r",
"self",
".",
"setIcon",
"(",
"profile",
".",
"icon",
"(",
")",
")",
"self",
".",
"setText",
"(",
"profile",
".",
"name",
"(",... | Sets the profile linked with this action.
:param profile | <projexui.widgets.xviewwidget.XViewProfile> | [
"Sets",
"the",
"profile",
"linked",
"with",
"this",
"action",
".",
":",
"param",
"profile",
"|",
"<projexui",
".",
"widgets",
".",
"xviewwidget",
".",
"XViewProfile",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L74-L85 | train | Sets the profile linked with this action. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.addProfile | def addProfile(self, profile):
"""
Adds the inputed profile as an action to the toolbar.
:param profile | <projexui.widgets.xviewwidget.XViewProfile>
"""
# use the existing version
for exist in self.profiles():
if exist.name() == profile.... | python | def addProfile(self, profile):
"""
Adds the inputed profile as an action to the toolbar.
:param profile | <projexui.widgets.xviewwidget.XViewProfile>
"""
# use the existing version
for exist in self.profiles():
if exist.name() == profile.... | [
"def",
"addProfile",
"(",
"self",
",",
"profile",
")",
":",
"# use the existing version\r",
"for",
"exist",
"in",
"self",
".",
"profiles",
"(",
")",
":",
"if",
"exist",
".",
"name",
"(",
")",
"==",
"profile",
".",
"name",
"(",
")",
":",
"if",
"exist",
... | Adds the inputed profile as an action to the toolbar.
:param profile | <projexui.widgets.xviewwidget.XViewProfile> | [
"Adds",
"the",
"inputed",
"profile",
"as",
"an",
"action",
"to",
"the",
"toolbar",
".",
":",
"param",
"profile",
"|",
"<projexui",
".",
"widgets",
".",
"xviewwidget",
".",
"XViewProfile",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L117-L135 | train | Adds the inputed profile as an action to the toolbar. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.createProfile | def createProfile(self, profile=None, clearLayout=True):
"""
Prompts the user to create a new profile.
"""
if profile:
prof = profile
elif not self.viewWidget() or clearLayout:
prof = XViewProfile()
else:
prof = self.viewWidget... | python | def createProfile(self, profile=None, clearLayout=True):
"""
Prompts the user to create a new profile.
"""
if profile:
prof = profile
elif not self.viewWidget() or clearLayout:
prof = XViewProfile()
else:
prof = self.viewWidget... | [
"def",
"createProfile",
"(",
"self",
",",
"profile",
"=",
"None",
",",
"clearLayout",
"=",
"True",
")",
":",
"if",
"profile",
":",
"prof",
"=",
"profile",
"elif",
"not",
"self",
".",
"viewWidget",
"(",
")",
"or",
"clearLayout",
":",
"prof",
"=",
"XView... | Prompts the user to create a new profile. | [
"Prompts",
"the",
"user",
"to",
"create",
"a",
"new",
"profile",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L164-L192 | train | Prompts the user to create a new profile. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.editProfile | def editProfile(self, profile):
"""
Prompts the user to edit the given profile.
:param profile | <projexui.widgets.xviewwidget.XViewProfile>
"""
mod = XViewProfileDialog.edit(self.window(), profile)
if not mod:
return False
... | python | def editProfile(self, profile):
"""
Prompts the user to edit the given profile.
:param profile | <projexui.widgets.xviewwidget.XViewProfile>
"""
mod = XViewProfileDialog.edit(self.window(), profile)
if not mod:
return False
... | [
"def",
"editProfile",
"(",
"self",
",",
"profile",
")",
":",
"mod",
"=",
"XViewProfileDialog",
".",
"edit",
"(",
"self",
".",
"window",
"(",
")",
",",
"profile",
")",
"if",
"not",
"mod",
":",
"return",
"False",
"# update the action interface\r",
"for",
"ac... | Prompts the user to edit the given profile.
:param profile | <projexui.widgets.xviewwidget.XViewProfile> | [
"Prompts",
"the",
"user",
"to",
"edit",
"the",
"given",
"profile",
".",
":",
"param",
"profile",
"|",
"<projexui",
".",
"widgets",
".",
"xviewwidget",
".",
"XViewProfile",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L195-L216 | train | Prompts the user to edit the given profile. Returns True if the user has changed the profile otherwise False. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.exportProfile | def exportProfile(self, profile, filename=None):
"""
Exports this toolbar to the given filename.
:param profile | <XViewProfile>
filename | <str> || None
"""
if not filename:
filename = QFileDialog.getSaveFileName(self,
... | python | def exportProfile(self, profile, filename=None):
"""
Exports this toolbar to the given filename.
:param profile | <XViewProfile>
filename | <str> || None
"""
if not filename:
filename = QFileDialog.getSaveFileName(self,
... | [
"def",
"exportProfile",
"(",
"self",
",",
"profile",
",",
"filename",
"=",
"None",
")",
":",
"if",
"not",
"filename",
":",
"filename",
"=",
"QFileDialog",
".",
"getSaveFileName",
"(",
"self",
",",
"'Export Profile'",
",",
"''",
",",
"'XML Files (*.xml)'",
")... | Exports this toolbar to the given filename.
:param profile | <XViewProfile>
filename | <str> || None | [
"Exports",
"this",
"toolbar",
"to",
"the",
"given",
"filename",
".",
":",
"param",
"profile",
"|",
"<XViewProfile",
">",
"filename",
"|",
"<str",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L218-L237 | train | Exports this toolbar to the given filename. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.handleActionTrigger | def handleActionTrigger(self, action):
"""
Handles when an action has been triggered. If the inputed action is a
XViewProfileAction, then the currentProfileChanged signal will emit.
:param action | <QAction>
"""
# trigger a particular profile
... | python | def handleActionTrigger(self, action):
"""
Handles when an action has been triggered. If the inputed action is a
XViewProfileAction, then the currentProfileChanged signal will emit.
:param action | <QAction>
"""
# trigger a particular profile
... | [
"def",
"handleActionTrigger",
"(",
"self",
",",
"action",
")",
":",
"# trigger a particular profile\r",
"if",
"isinstance",
"(",
"action",
",",
"XViewProfileAction",
")",
":",
"# if the user CTRL+Clicks on the action, then attempt\r",
"# to load it in a new window\r",
"if",
"... | Handles when an action has been triggered. If the inputed action is a
XViewProfileAction, then the currentProfileChanged signal will emit.
:param action | <QAction> | [
"Handles",
"when",
"an",
"action",
"has",
"been",
"triggered",
".",
"If",
"the",
"inputed",
"action",
"is",
"a",
"XViewProfileAction",
"then",
"the",
"currentProfileChanged",
"signal",
"will",
"emit",
".",
":",
"param",
"action",
"|",
"<QAction",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L239-L255 | train | Handles the action triggered by the user. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.importProfile | def importProfile(self, filename=None):
"""
Imports the profiles from the given filename.
:param filename | <str> || None
"""
if not filename:
filename = QFileDialog.getOpenFileName( self,
'Impo... | python | def importProfile(self, filename=None):
"""
Imports the profiles from the given filename.
:param filename | <str> || None
"""
if not filename:
filename = QFileDialog.getOpenFileName( self,
'Impo... | [
"def",
"importProfile",
"(",
"self",
",",
"filename",
"=",
"None",
")",
":",
"if",
"not",
"filename",
":",
"filename",
"=",
"QFileDialog",
".",
"getOpenFileName",
"(",
"self",
",",
"'Import Perspective'",
",",
"''",
",",
"'XML Files (*.xml)'",
")",
"if",
"ty... | Imports the profiles from the given filename.
:param filename | <str> || None | [
"Imports",
"the",
"profiles",
"from",
"the",
"given",
"filename",
".",
":",
"param",
"filename",
"|",
"<str",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L257-L277 | train | Imports the profiles from the given file. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.loadString | def loadString(self, profilestr, merge=False, loadProfile=True):
"""
Loads the information for this toolbar from the inputed string.
:param profilestr | <str>
"""
try:
xtoolbar = ElementTree.fromstring(nativestring(profilestr))
except Exp... | python | def loadString(self, profilestr, merge=False, loadProfile=True):
"""
Loads the information for this toolbar from the inputed string.
:param profilestr | <str>
"""
try:
xtoolbar = ElementTree.fromstring(nativestring(profilestr))
except Exp... | [
"def",
"loadString",
"(",
"self",
",",
"profilestr",
",",
"merge",
"=",
"False",
",",
"loadProfile",
"=",
"True",
")",
":",
"try",
":",
"xtoolbar",
"=",
"ElementTree",
".",
"fromstring",
"(",
"nativestring",
"(",
"profilestr",
")",
")",
"except",
"ExpatErr... | Loads the information for this toolbar from the inputed string.
:param profilestr | <str> | [
"Loads",
"the",
"information",
"for",
"this",
"toolbar",
"from",
"the",
"inputed",
"string",
".",
":",
"param",
"profilestr",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L295-L321 | train | Load the information for this toolbar from the inputed string. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.profiles | def profiles(self):
"""
Returns a list of profiles for this toolbar.
:return <projexui.widgets.xviewwidget.XViewProfile>
"""
output = []
for act in self.actions():
if ( isinstance(act, XViewProfileAction) ):
output.append(... | python | def profiles(self):
"""
Returns a list of profiles for this toolbar.
:return <projexui.widgets.xviewwidget.XViewProfile>
"""
output = []
for act in self.actions():
if ( isinstance(act, XViewProfileAction) ):
output.append(... | [
"def",
"profiles",
"(",
"self",
")",
":",
"output",
"=",
"[",
"]",
"for",
"act",
"in",
"self",
".",
"actions",
"(",
")",
":",
"if",
"(",
"isinstance",
"(",
"act",
",",
"XViewProfileAction",
")",
")",
":",
"output",
".",
"append",
"(",
"act",
".",
... | Returns a list of profiles for this toolbar.
:return <projexui.widgets.xviewwidget.XViewProfile> | [
"Returns",
"a",
"list",
"of",
"profiles",
"for",
"this",
"toolbar",
".",
":",
"return",
"<projexui",
".",
"widgets",
".",
"xviewwidget",
".",
"XViewProfile",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L329-L339 | train | Returns a list of profiles for this toolbar. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.restoreSettings | def restoreSettings(self, settings, merge=False, loadProfile=True):
"""
Restores this profile from settings.
:param settings | <QSettings>
"""
value = unwrapVariant(settings.value('profile_toolbar'))
if not value:
return
... | python | def restoreSettings(self, settings, merge=False, loadProfile=True):
"""
Restores this profile from settings.
:param settings | <QSettings>
"""
value = unwrapVariant(settings.value('profile_toolbar'))
if not value:
return
... | [
"def",
"restoreSettings",
"(",
"self",
",",
"settings",
",",
"merge",
"=",
"False",
",",
"loadProfile",
"=",
"True",
")",
":",
"value",
"=",
"unwrapVariant",
"(",
"settings",
".",
"value",
"(",
"'profile_toolbar'",
")",
")",
"if",
"not",
"value",
":",
"r... | Restores this profile from settings.
:param settings | <QSettings> | [
"Restores",
"this",
"profile",
"from",
"settings",
".",
":",
"param",
"settings",
"|",
"<QSettings",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L350-L360 | train | Restores this profile from settings. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.removeProfile | def removeProfile(self, profile, silent=False):
"""
Removes the given profile from the toolbar.
:param profile | <projexui.widgets.xviewwidget.XViewProfile>
"""
if not profile:
return
if not silent:
title = 'Remove ... | python | def removeProfile(self, profile, silent=False):
"""
Removes the given profile from the toolbar.
:param profile | <projexui.widgets.xviewwidget.XViewProfile>
"""
if not profile:
return
if not silent:
title = 'Remove ... | [
"def",
"removeProfile",
"(",
"self",
",",
"profile",
",",
"silent",
"=",
"False",
")",
":",
"if",
"not",
"profile",
":",
"return",
"if",
"not",
"silent",
":",
"title",
"=",
"'Remove {0}'",
".",
"format",
"(",
"self",
".",
"profileText",
"(",
")",
")",
... | Removes the given profile from the toolbar.
:param profile | <projexui.widgets.xviewwidget.XViewProfile> | [
"Removes",
"the",
"given",
"profile",
"from",
"the",
"toolbar",
".",
":",
"param",
"profile",
"|",
"<projexui",
".",
"widgets",
".",
"xviewwidget",
".",
"XViewProfile",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L363-L408 | train | Removes the given profile from the toolbar. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.setViewWidget | def setViewWidget(self, viewWidget):
"""
Sets the view widget linked with this toolbar.
:param viewWidget | <XViewWidget>
"""
self._viewWidget = viewWidget
if viewWidget:
viewWidget.resetFinished.connect(self.clearActive) | python | def setViewWidget(self, viewWidget):
"""
Sets the view widget linked with this toolbar.
:param viewWidget | <XViewWidget>
"""
self._viewWidget = viewWidget
if viewWidget:
viewWidget.resetFinished.connect(self.clearActive) | [
"def",
"setViewWidget",
"(",
"self",
",",
"viewWidget",
")",
":",
"self",
".",
"_viewWidget",
"=",
"viewWidget",
"if",
"viewWidget",
":",
"viewWidget",
".",
"resetFinished",
".",
"connect",
"(",
"self",
".",
"clearActive",
")"
] | Sets the view widget linked with this toolbar.
:param viewWidget | <XViewWidget> | [
"Sets",
"the",
"view",
"widget",
"linked",
"with",
"this",
"toolbar",
".",
":",
"param",
"viewWidget",
"|",
"<XViewWidget",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L418-L426 | train | Sets the view widget linked with this toolbar. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.saveProfileLayout | def saveProfileLayout(self, profile):
"""
Saves the profile layout to the inputed profile.
:param profile | <projexui.widgets.xviewwidget.XViewProfile>
"""
if not self.viewWidget():
text = self.profileText()
QMessageBox.information(se... | python | def saveProfileLayout(self, profile):
"""
Saves the profile layout to the inputed profile.
:param profile | <projexui.widgets.xviewwidget.XViewProfile>
"""
if not self.viewWidget():
text = self.profileText()
QMessageBox.information(se... | [
"def",
"saveProfileLayout",
"(",
"self",
",",
"profile",
")",
":",
"if",
"not",
"self",
".",
"viewWidget",
"(",
")",
":",
"text",
"=",
"self",
".",
"profileText",
"(",
")",
"QMessageBox",
".",
"information",
"(",
"self",
".",
"window",
"(",
")",
",",
... | Saves the profile layout to the inputed profile.
:param profile | <projexui.widgets.xviewwidget.XViewProfile> | [
"Saves",
"the",
"profile",
"layout",
"to",
"the",
"inputed",
"profile",
".",
":",
"param",
"profile",
"|",
"<projexui",
".",
"widgets",
".",
"xviewwidget",
".",
"XViewProfile",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L439-L458 | train | Saves the profile layout to the inputed profile. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.setCurrentProfile | def setCurrentProfile(self, prof):
"""
Sets the current profile for this toolbar to the inputed profile.
:param prof | <projexui.widgets.xviewwidget.XViewProfile> || <str>
"""
if prof is None:
self.clearActive()
return
... | python | def setCurrentProfile(self, prof):
"""
Sets the current profile for this toolbar to the inputed profile.
:param prof | <projexui.widgets.xviewwidget.XViewProfile> || <str>
"""
if prof is None:
self.clearActive()
return
... | [
"def",
"setCurrentProfile",
"(",
"self",
",",
"prof",
")",
":",
"if",
"prof",
"is",
"None",
":",
"self",
".",
"clearActive",
"(",
")",
"return",
"# loop through the profiles looking for a match\r",
"profile",
"=",
"None",
"blocked",
"=",
"self",
".",
"signalsBlo... | Sets the current profile for this toolbar to the inputed profile.
:param prof | <projexui.widgets.xviewwidget.XViewProfile> || <str> | [
"Sets",
"the",
"current",
"profile",
"for",
"this",
"toolbar",
"to",
"the",
"inputed",
"profile",
".",
":",
"param",
"prof",
"|",
"<projexui",
".",
"widgets",
".",
"xviewwidget",
".",
"XViewProfile",
">",
"||",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L461-L493 | train | Sets the current profile for this toolbar to the inputed profile. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.showProfileMenu | def showProfileMenu(self, point):
"""
Prompts the user for profile menu options. Editing needs to be enabled
for this to work.
"""
if not self.isEditingEnabled():
return
trigger = self.actionAt(point)
if (isinstance(trigger, XViewPro... | python | def showProfileMenu(self, point):
"""
Prompts the user for profile menu options. Editing needs to be enabled
for this to work.
"""
if not self.isEditingEnabled():
return
trigger = self.actionAt(point)
if (isinstance(trigger, XViewPro... | [
"def",
"showProfileMenu",
"(",
"self",
",",
"point",
")",
":",
"if",
"not",
"self",
".",
"isEditingEnabled",
"(",
")",
":",
"return",
"trigger",
"=",
"self",
".",
"actionAt",
"(",
"point",
")",
"if",
"(",
"isinstance",
"(",
"trigger",
",",
"XViewProfileA... | Prompts the user for profile menu options. Editing needs to be enabled
for this to work. | [
"Prompts",
"the",
"user",
"for",
"profile",
"menu",
"options",
".",
"Editing",
"needs",
"to",
"be",
"enabled",
"for",
"this",
"to",
"work",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L504-L611 | train | Show the user for the profile menu options. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.toXml | def toXml(self):
"""
Saves this profile toolbar as XML information.
:return <xml.etree.ElementTree.Element>
"""
xtoolbar = ElementTree.Element('toolbar')
prof = self._currentProfile
if prof is not None:
xtoolbar.set('cur... | python | def toXml(self):
"""
Saves this profile toolbar as XML information.
:return <xml.etree.ElementTree.Element>
"""
xtoolbar = ElementTree.Element('toolbar')
prof = self._currentProfile
if prof is not None:
xtoolbar.set('cur... | [
"def",
"toXml",
"(",
"self",
")",
":",
"xtoolbar",
"=",
"ElementTree",
".",
"Element",
"(",
"'toolbar'",
")",
"prof",
"=",
"self",
".",
"_currentProfile",
"if",
"prof",
"is",
"not",
"None",
":",
"xtoolbar",
".",
"set",
"(",
"'current'",
",",
"prof",
".... | Saves this profile toolbar as XML information.
:return <xml.etree.ElementTree.Element> | [
"Saves",
"this",
"profile",
"toolbar",
"as",
"XML",
"information",
".",
":",
"return",
"<xml",
".",
"etree",
".",
"ElementTree",
".",
"Element",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L621-L636 | train | Returns a new XML element tree with the current profile toolbar as its XML information. |
xflr6/fileconfig | fileconfig/stack.py | ConfigStack.insert | def insert(self, index, filename):
"""Insert a new subclass with filename at index, mockup __module__."""
base = self._base
dct = {'__module__': base.__module__, 'filename': filename, '_stack': self}
cls = type(base.__name__, (base,), dct)
self._map[cls.filename] = cls
s... | python | def insert(self, index, filename):
"""Insert a new subclass with filename at index, mockup __module__."""
base = self._base
dct = {'__module__': base.__module__, 'filename': filename, '_stack': self}
cls = type(base.__name__, (base,), dct)
self._map[cls.filename] = cls
s... | [
"def",
"insert",
"(",
"self",
",",
"index",
",",
"filename",
")",
":",
"base",
"=",
"self",
".",
"_base",
"dct",
"=",
"{",
"'__module__'",
":",
"base",
".",
"__module__",
",",
"'filename'",
":",
"filename",
",",
"'_stack'",
":",
"self",
"}",
"cls",
"... | Insert a new subclass with filename at index, mockup __module__. | [
"Insert",
"a",
"new",
"subclass",
"with",
"filename",
"at",
"index",
"mockup",
"__module__",
"."
] | 473d65f6442eb1ac49ada0b6e56cab45f8018c15 | https://github.com/xflr6/fileconfig/blob/473d65f6442eb1ac49ada0b6e56cab45f8018c15/fileconfig/stack.py#L16-L23 | train | Insert a new subclass with filename at index mockup __module__. |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py | XQueryBuilderWidget.addLineWidget | def addLineWidget( self, query = None ):
"""
Adds a new line widget to the system with the given values.
:param query | (<str> term, <str> operator, <str> vlaue) || None
"""
widget = XQueryLineWidget(self)
widget.setTerms(sorted(self._rules.keys()))
... | python | def addLineWidget( self, query = None ):
"""
Adds a new line widget to the system with the given values.
:param query | (<str> term, <str> operator, <str> vlaue) || None
"""
widget = XQueryLineWidget(self)
widget.setTerms(sorted(self._rules.keys()))
... | [
"def",
"addLineWidget",
"(",
"self",
",",
"query",
"=",
"None",
")",
":",
"widget",
"=",
"XQueryLineWidget",
"(",
"self",
")",
"widget",
".",
"setTerms",
"(",
"sorted",
"(",
"self",
".",
"_rules",
".",
"keys",
"(",
")",
")",
")",
"widget",
".",
"setQ... | Adds a new line widget to the system with the given values.
:param query | (<str> term, <str> operator, <str> vlaue) || None | [
"Adds",
"a",
"new",
"line",
"widget",
"to",
"the",
"system",
"with",
"the",
"given",
"values",
".",
":",
"param",
"query",
"|",
"(",
"<str",
">",
"term",
"<str",
">",
"operator",
"<str",
">",
"vlaue",
")",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py#L70-L87 | train | Adds a new line widget to the system with the given values. |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py | XQueryBuilderWidget.addRule | def addRule( self, rule ):
"""
Adds a rule to the system.
:param rule | <XQueryRule>
"""
self._rules[rule.term()] = rule
self.updateRules() | python | def addRule( self, rule ):
"""
Adds a rule to the system.
:param rule | <XQueryRule>
"""
self._rules[rule.term()] = rule
self.updateRules() | [
"def",
"addRule",
"(",
"self",
",",
"rule",
")",
":",
"self",
".",
"_rules",
"[",
"rule",
".",
"term",
"(",
")",
"]",
"=",
"rule",
"self",
".",
"updateRules",
"(",
")"
] | Adds a rule to the system.
:param rule | <XQueryRule> | [
"Adds",
"a",
"rule",
"to",
"the",
"system",
".",
":",
"param",
"rule",
"|",
"<XQueryRule",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py#L89-L96 | train | Adds a rule to the system. |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py | XQueryBuilderWidget.currentQuery | def currentQuery( self ):
"""
Returns the current query string for this widget.
:return [(<str> term, <str> operator, <str> value), ..]
"""
widgets = self.lineWidgets()
output = []
for widget in widgets:
output.append(widget.query())
... | python | def currentQuery( self ):
"""
Returns the current query string for this widget.
:return [(<str> term, <str> operator, <str> value), ..]
"""
widgets = self.lineWidgets()
output = []
for widget in widgets:
output.append(widget.query())
... | [
"def",
"currentQuery",
"(",
"self",
")",
":",
"widgets",
"=",
"self",
".",
"lineWidgets",
"(",
")",
"output",
"=",
"[",
"]",
"for",
"widget",
"in",
"widgets",
":",
"output",
".",
"append",
"(",
"widget",
".",
"query",
"(",
")",
")",
"return",
"output... | Returns the current query string for this widget.
:return [(<str> term, <str> operator, <str> value), ..] | [
"Returns",
"the",
"current",
"query",
"string",
"for",
"this",
"widget",
".",
":",
"return",
"[",
"(",
"<str",
">",
"term",
"<str",
">",
"operator",
"<str",
">",
"value",
")",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py#L123-L133 | train | Returns the current query string for this widget. |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py | XQueryBuilderWidget.keyPressEvent | def keyPressEvent( self, event ):
"""
Emits the save requested signal for this builder for when the enter
or return press is clicked.
:param event | <QKeyEvent>
"""
if ( event.key() in (Qt.Key_Enter, Qt.Key_Return) ):
self.emitSaveRequested()
... | python | def keyPressEvent( self, event ):
"""
Emits the save requested signal for this builder for when the enter
or return press is clicked.
:param event | <QKeyEvent>
"""
if ( event.key() in (Qt.Key_Enter, Qt.Key_Return) ):
self.emitSaveRequested()
... | [
"def",
"keyPressEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"(",
"event",
".",
"key",
"(",
")",
"in",
"(",
"Qt",
".",
"Key_Enter",
",",
"Qt",
".",
"Key_Return",
")",
")",
":",
"self",
".",
"emitSaveRequested",
"(",
")",
"super",
"(",
"XQuery... | Emits the save requested signal for this builder for when the enter
or return press is clicked.
:param event | <QKeyEvent> | [
"Emits",
"the",
"save",
"requested",
"signal",
"for",
"this",
"builder",
"for",
"when",
"the",
"enter",
"or",
"return",
"press",
"is",
"clicked",
".",
":",
"param",
"event",
"|",
"<QKeyEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py#L143-L153 | train | Emits the save requested signal for this builder for when the enter key is clicked. |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py | XQueryBuilderWidget.setCurrentQuery | def setCurrentQuery( self, query ):
"""
Sets the query for this system to the inputed query.
:param query | [(<str> term, <str> operator, <str> value), ..]
"""
self.clear()
for entry in query:
self.addLineWidget(entry)
#... | python | def setCurrentQuery( self, query ):
"""
Sets the query for this system to the inputed query.
:param query | [(<str> term, <str> operator, <str> value), ..]
"""
self.clear()
for entry in query:
self.addLineWidget(entry)
#... | [
"def",
"setCurrentQuery",
"(",
"self",
",",
"query",
")",
":",
"self",
".",
"clear",
"(",
")",
"for",
"entry",
"in",
"query",
":",
"self",
".",
"addLineWidget",
"(",
"entry",
")",
"# make sure we have the minimum number of widgets",
"for",
"i",
"in",
"range",
... | Sets the query for this system to the inputed query.
:param query | [(<str> term, <str> operator, <str> value), ..] | [
"Sets",
"the",
"query",
"for",
"this",
"system",
"to",
"the",
"inputed",
"query",
".",
":",
"param",
"query",
"|",
"[",
"(",
"<str",
">",
"term",
"<str",
">",
"operator",
"<str",
">",
"value",
")",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py#L228-L241 | train | Sets the current query for this system to the inputed query. |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py | XQueryBuilderWidget.setRules | def setRules( self, rules ):
"""
Sets all the rules for this builder.
:param rules | [<XQueryRule>, ..]
"""
if ( type(rules) in (list, tuple) ):
self._rules = dict([(x.term(), x) for x in rules])
self.updateRules()
return True
... | python | def setRules( self, rules ):
"""
Sets all the rules for this builder.
:param rules | [<XQueryRule>, ..]
"""
if ( type(rules) in (list, tuple) ):
self._rules = dict([(x.term(), x) for x in rules])
self.updateRules()
return True
... | [
"def",
"setRules",
"(",
"self",
",",
"rules",
")",
":",
"if",
"(",
"type",
"(",
"rules",
")",
"in",
"(",
"list",
",",
"tuple",
")",
")",
":",
"self",
".",
"_rules",
"=",
"dict",
"(",
"[",
"(",
"x",
".",
"term",
"(",
")",
",",
"x",
")",
"for... | Sets all the rules for this builder.
:param rules | [<XQueryRule>, ..] | [
"Sets",
"all",
"the",
"rules",
"for",
"this",
"builder",
".",
":",
"param",
"rules",
"|",
"[",
"<XQueryRule",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py#L261-L278 | train | Sets all the rules for this builder. |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py | XQueryBuilderWidget.setTerms | def setTerms( self, terms ):
"""
Sets a simple rule list by accepting a list of strings for terms. \
This is a convenience method for the setRules method.
:param rules | [<str> term, ..]
"""
return self.setRules([XQueryRule(term = term) for term in terms]) | python | def setTerms( self, terms ):
"""
Sets a simple rule list by accepting a list of strings for terms. \
This is a convenience method for the setRules method.
:param rules | [<str> term, ..]
"""
return self.setRules([XQueryRule(term = term) for term in terms]) | [
"def",
"setTerms",
"(",
"self",
",",
"terms",
")",
":",
"return",
"self",
".",
"setRules",
"(",
"[",
"XQueryRule",
"(",
"term",
"=",
"term",
")",
"for",
"term",
"in",
"terms",
"]",
")"
] | Sets a simple rule list by accepting a list of strings for terms. \
This is a convenience method for the setRules method.
:param rules | [<str> term, ..] | [
"Sets",
"a",
"simple",
"rule",
"list",
"by",
"accepting",
"a",
"list",
"of",
"strings",
"for",
"terms",
".",
"\\",
"This",
"is",
"a",
"convenience",
"method",
"for",
"the",
"setRules",
"method",
".",
":",
"param",
"rules",
"|",
"[",
"<str",
">",
"term"... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py#L280-L287 | train | Sets a simple rule list by accepting a list of strings for terms. |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py | XQueryBuilderWidget.updateRemoveEnabled | def updateRemoveEnabled( self ):
"""
Updates the remove enabled baesd on the current number of line widgets.
"""
lineWidgets = self.lineWidgets()
count = len(lineWidgets)
state = self.minimumCount() < count
for widget in lineWidgets:
... | python | def updateRemoveEnabled( self ):
"""
Updates the remove enabled baesd on the current number of line widgets.
"""
lineWidgets = self.lineWidgets()
count = len(lineWidgets)
state = self.minimumCount() < count
for widget in lineWidgets:
... | [
"def",
"updateRemoveEnabled",
"(",
"self",
")",
":",
"lineWidgets",
"=",
"self",
".",
"lineWidgets",
"(",
")",
"count",
"=",
"len",
"(",
"lineWidgets",
")",
"state",
"=",
"self",
".",
"minimumCount",
"(",
")",
"<",
"count",
"for",
"widget",
"in",
"lineWi... | Updates the remove enabled baesd on the current number of line widgets. | [
"Updates",
"the",
"remove",
"enabled",
"baesd",
"on",
"the",
"current",
"number",
"of",
"line",
"widgets",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py#L289-L298 | train | Updates the remove enabled baesd on the current number of line widgets. |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py | XQueryBuilderWidget.updateRules | def updateRules( self ):
"""
Updates the query line items to match the latest rule options.
"""
terms = sorted(self._rules.keys())
for child in self.lineWidgets():
child.setTerms(terms) | python | def updateRules( self ):
"""
Updates the query line items to match the latest rule options.
"""
terms = sorted(self._rules.keys())
for child in self.lineWidgets():
child.setTerms(terms) | [
"def",
"updateRules",
"(",
"self",
")",
":",
"terms",
"=",
"sorted",
"(",
"self",
".",
"_rules",
".",
"keys",
"(",
")",
")",
"for",
"child",
"in",
"self",
".",
"lineWidgets",
"(",
")",
":",
"child",
".",
"setTerms",
"(",
"terms",
")"
] | Updates the query line items to match the latest rule options. | [
"Updates",
"the",
"query",
"line",
"items",
"to",
"match",
"the",
"latest",
"rule",
"options",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py#L300-L306 | train | Updates the query line items to match the latest rule options. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofilemanager.py | XViewProfileManager.addProfile | def addProfile(self, profile):
"""
Adds the inputed profile to the system.
:param profile | <XViewProfile>
"""
if ( profile in self._profiles ):
return
self._profiles.append(profile)
self._profileCombo.blockSignals(True)
... | python | def addProfile(self, profile):
"""
Adds the inputed profile to the system.
:param profile | <XViewProfile>
"""
if ( profile in self._profiles ):
return
self._profiles.append(profile)
self._profileCombo.blockSignals(True)
... | [
"def",
"addProfile",
"(",
"self",
",",
"profile",
")",
":",
"if",
"(",
"profile",
"in",
"self",
".",
"_profiles",
")",
":",
"return",
"self",
".",
"_profiles",
".",
"append",
"(",
"profile",
")",
"self",
".",
"_profileCombo",
".",
"blockSignals",
"(",
... | Adds the inputed profile to the system.
:param profile | <XViewProfile> | [
"Adds",
"the",
"inputed",
"profile",
"to",
"the",
"system",
".",
":",
"param",
"profile",
"|",
"<XViewProfile",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanager.py#L62-L75 | train | Adds the inputed profile to the system. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofilemanager.py | XViewProfileManager.currentProfile | def currentProfile(self):
"""
Returns the currently selected profile from the system.
:return <XViewProfile>
"""
index = self._profileCombo.currentIndex()
if 0 <= index and index < len(self._profiles):
return self._profiles[index]
... | python | def currentProfile(self):
"""
Returns the currently selected profile from the system.
:return <XViewProfile>
"""
index = self._profileCombo.currentIndex()
if 0 <= index and index < len(self._profiles):
return self._profiles[index]
... | [
"def",
"currentProfile",
"(",
"self",
")",
":",
"index",
"=",
"self",
".",
"_profileCombo",
".",
"currentIndex",
"(",
")",
"if",
"0",
"<=",
"index",
"and",
"index",
"<",
"len",
"(",
"self",
".",
"_profiles",
")",
":",
"return",
"self",
".",
"_profiles"... | Returns the currently selected profile from the system.
:return <XViewProfile> | [
"Returns",
"the",
"currently",
"selected",
"profile",
"from",
"the",
"system",
".",
":",
"return",
"<XViewProfile",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanager.py#L77-L87 | train | Returns the currently selected profile from the system. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofilemanager.py | XViewProfileManager.handleProfileChange | def handleProfileChange(self):
"""
Emits that the current profile has changed.
"""
# restore the profile settings
prof = self.currentProfile()
vwidget = self.viewWidget()
if vwidget:
prof.restore(vwidget)
if not self.signalsBlocked(... | python | def handleProfileChange(self):
"""
Emits that the current profile has changed.
"""
# restore the profile settings
prof = self.currentProfile()
vwidget = self.viewWidget()
if vwidget:
prof.restore(vwidget)
if not self.signalsBlocked(... | [
"def",
"handleProfileChange",
"(",
"self",
")",
":",
"# restore the profile settings",
"prof",
"=",
"self",
".",
"currentProfile",
"(",
")",
"vwidget",
"=",
"self",
".",
"viewWidget",
"(",
")",
"if",
"vwidget",
":",
"prof",
".",
"restore",
"(",
"vwidget",
")... | Emits that the current profile has changed. | [
"Emits",
"that",
"the",
"current",
"profile",
"has",
"changed",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanager.py#L89-L100 | train | Emits that the current profile has changed. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofilemanager.py | XViewProfileManager.removeProfile | def removeProfile(self, profile):
"""
Adds the inputed profile to the system.
:param profile | <XViewProfile>
"""
if not profile in self._profiles:
return
index = self._profiles.index(profile)
self._profiles.remove(profile)
... | python | def removeProfile(self, profile):
"""
Adds the inputed profile to the system.
:param profile | <XViewProfile>
"""
if not profile in self._profiles:
return
index = self._profiles.index(profile)
self._profiles.remove(profile)
... | [
"def",
"removeProfile",
"(",
"self",
",",
"profile",
")",
":",
"if",
"not",
"profile",
"in",
"self",
".",
"_profiles",
":",
"return",
"index",
"=",
"self",
".",
"_profiles",
".",
"index",
"(",
"profile",
")",
"self",
".",
"_profiles",
".",
"remove",
"(... | Adds the inputed profile to the system.
:param profile | <XViewProfile> | [
"Adds",
"the",
"inputed",
"profile",
"to",
"the",
"system",
".",
":",
"param",
"profile",
"|",
"<XViewProfile",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanager.py#L118-L131 | train | Removes the inputed profile from the system. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofilemanager.py | XViewProfileManager.restoreSettings | def restoreSettings(self, settings):
"""
Restores settings from the application.
:param settings | <QSettings>
"""
settings.beginGroup(self.objectName())
curr_prof = None
curr_name = unwrapVariant(settings.value('current'))
... | python | def restoreSettings(self, settings):
"""
Restores settings from the application.
:param settings | <QSettings>
"""
settings.beginGroup(self.objectName())
curr_prof = None
curr_name = unwrapVariant(settings.value('current'))
... | [
"def",
"restoreSettings",
"(",
"self",
",",
"settings",
")",
":",
"settings",
".",
"beginGroup",
"(",
"self",
".",
"objectName",
"(",
")",
")",
"curr_prof",
"=",
"None",
"curr_name",
"=",
"unwrapVariant",
"(",
"settings",
".",
"value",
"(",
"'current'",
")... | Restores settings from the application.
:param settings | <QSettings> | [
"Restores",
"settings",
"from",
"the",
"application",
".",
":",
"param",
"settings",
"|",
"<QSettings",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanager.py#L133-L169 | train | Restores the current settings from the application. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofilemanager.py | XViewProfileManager.saveSettings | def saveSettings(self, settings):
"""
Saves the settings for this widget to the application
:param settings | <QSettings>
"""
settings.beginGroup(self.objectName())
curr_prof = self.currentProfile()
if curr_prof:
settings.setValu... | python | def saveSettings(self, settings):
"""
Saves the settings for this widget to the application
:param settings | <QSettings>
"""
settings.beginGroup(self.objectName())
curr_prof = self.currentProfile()
if curr_prof:
settings.setValu... | [
"def",
"saveSettings",
"(",
"self",
",",
"settings",
")",
":",
"settings",
".",
"beginGroup",
"(",
"self",
".",
"objectName",
"(",
")",
")",
"curr_prof",
"=",
"self",
".",
"currentProfile",
"(",
")",
"if",
"curr_prof",
":",
"settings",
".",
"setValue",
"... | Saves the settings for this widget to the application
:param settings | <QSettings> | [
"Saves",
"the",
"settings",
"for",
"this",
"widget",
"to",
"the",
"application",
":",
"param",
"settings",
"|",
"<QSettings",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanager.py#L171-L188 | train | Saves the current settings for this widget to the application s internal settings. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofilemanager.py | XViewProfileManager.setCurrentProfile | def setCurrentProfile(self, profile):
"""
Sets the current profile to the inputed profile.
:param profile | <XViewProfile>
"""
try:
index = self._profiles.index(profile)
except ValueError:
index = -1
self._profileComb... | python | def setCurrentProfile(self, profile):
"""
Sets the current profile to the inputed profile.
:param profile | <XViewProfile>
"""
try:
index = self._profiles.index(profile)
except ValueError:
index = -1
self._profileComb... | [
"def",
"setCurrentProfile",
"(",
"self",
",",
"profile",
")",
":",
"try",
":",
"index",
"=",
"self",
".",
"_profiles",
".",
"index",
"(",
"profile",
")",
"except",
"ValueError",
":",
"index",
"=",
"-",
"1",
"self",
".",
"_profileCombo",
".",
"setCurrentI... | Sets the current profile to the inputed profile.
:param profile | <XViewProfile> | [
"Sets",
"the",
"current",
"profile",
"to",
"the",
"inputed",
"profile",
".",
":",
"param",
"profile",
"|",
"<XViewProfile",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanager.py#L190-L201 | train | Sets the current profile to the inputed profile. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofilemanager.py | XViewProfileManager.setProfiles | def setProfiles(self, profiles):
"""
Sets a list of profiles to be the options for the manager.
:param profiles | [<XViewProfile>, ..]
"""
self.blockSignals(True)
self._profileCombo.blockSignals(True)
self._profiles = profiles[:]
sel... | python | def setProfiles(self, profiles):
"""
Sets a list of profiles to be the options for the manager.
:param profiles | [<XViewProfile>, ..]
"""
self.blockSignals(True)
self._profileCombo.blockSignals(True)
self._profiles = profiles[:]
sel... | [
"def",
"setProfiles",
"(",
"self",
",",
"profiles",
")",
":",
"self",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"_profileCombo",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"_profiles",
"=",
"profiles",
"[",
":",
"]",
"self",
".",
"_p... | Sets a list of profiles to be the options for the manager.
:param profiles | [<XViewProfile>, ..] | [
"Sets",
"a",
"list",
"of",
"profiles",
"to",
"be",
"the",
"options",
"for",
"the",
"manager",
".",
":",
"param",
"profiles",
"|",
"[",
"<XViewProfile",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanager.py#L211-L225 | train | Sets the list of profiles to be the options for the manager. |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofilemanager.py | XViewProfileManager.showOptionsMenu | def showOptionsMenu(self):
"""
Displays the options menu. If the option menu policy is set to
CustomContextMenu, then the optionMenuRequested signal will be emitted,
otherwise the default context menu will be displayed.
"""
point = QPoint(0, self._optionsButton.h... | python | def showOptionsMenu(self):
"""
Displays the options menu. If the option menu policy is set to
CustomContextMenu, then the optionMenuRequested signal will be emitted,
otherwise the default context menu will be displayed.
"""
point = QPoint(0, self._optionsButton.h... | [
"def",
"showOptionsMenu",
"(",
"self",
")",
":",
"point",
"=",
"QPoint",
"(",
"0",
",",
"self",
".",
"_optionsButton",
".",
"height",
"(",
")",
")",
"global_point",
"=",
"self",
".",
"_optionsButton",
".",
"mapToGlobal",
"(",
"point",
")",
"# prompt the cu... | Displays the options menu. If the option menu policy is set to
CustomContextMenu, then the optionMenuRequested signal will be emitted,
otherwise the default context menu will be displayed. | [
"Displays",
"the",
"options",
"menu",
".",
"If",
"the",
"option",
"menu",
"policy",
"is",
"set",
"to",
"CustomContextMenu",
"then",
"the",
"optionMenuRequested",
"signal",
"will",
"be",
"emitted",
"otherwise",
"the",
"default",
"context",
"menu",
"will",
"be",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanager.py#L235-L252 | train | Displays the options menu. |
faxir/faxir-python | faxir/api/outbox_api.py | OutboxApi.delete_outbox_fax | def delete_outbox_fax(self, outbox_fax_id, **kwargs): # noqa: E501
"""Delete a fax from outbox # noqa: E501
Delete a fax that is being sent and is still in your outbox # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please p... | python | def delete_outbox_fax(self, outbox_fax_id, **kwargs): # noqa: E501
"""Delete a fax from outbox # noqa: E501
Delete a fax that is being sent and is still in your outbox # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please p... | [
"def",
"delete_outbox_fax",
"(",
"self",
",",
"outbox_fax_id",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async'",
")",
":",
"return",
"self",
".",
"del... | Delete a fax from outbox # noqa: E501
Delete a fax that is being sent and is still in your outbox # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_outbox_fax(outbox_fax_id, async=... | [
"Delete",
"a",
"fax",
"from",
"outbox",
"#",
"noqa",
":",
"E501"
] | 75ed2ea487a6be537342baea1077a02b0c8e70c1 | https://github.com/faxir/faxir-python/blob/75ed2ea487a6be537342baea1077a02b0c8e70c1/faxir/api/outbox_api.py#L36-L56 | train | Delete a fax from an existing outbox. |
faxir/faxir-python | faxir/api/outbox_api.py | OutboxApi.get_outbox_fax | def get_outbox_fax(self, outbox_fax_id, **kwargs): # noqa: E501
"""Get an outbox record # noqa: E501
Get an outbox fax record information # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thr... | python | def get_outbox_fax(self, outbox_fax_id, **kwargs): # noqa: E501
"""Get an outbox record # noqa: E501
Get an outbox fax record information # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thr... | [
"def",
"get_outbox_fax",
"(",
"self",
",",
"outbox_fax_id",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async'",
")",
":",
"return",
"self",
".",
"get_ou... | Get an outbox record # noqa: E501
Get an outbox fax record information # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_outbox_fax(outbox_fax_id, async=True)
>>> result = thr... | [
"Get",
"an",
"outbox",
"record",
"#",
"noqa",
":",
"E501"
] | 75ed2ea487a6be537342baea1077a02b0c8e70c1 | https://github.com/faxir/faxir-python/blob/75ed2ea487a6be537342baea1077a02b0c8e70c1/faxir/api/outbox_api.py#L135-L155 | train | Get an outbox fax record |
faxir/faxir-python | faxir/api/outbox_api.py | OutboxApi.list_outbox_faxes | def list_outbox_faxes(self, **kwargs): # noqa: E501
"""Get outbox records # noqa: E501
Get outbox fax records information # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.list_o... | python | def list_outbox_faxes(self, **kwargs): # noqa: E501
"""Get outbox records # noqa: E501
Get outbox fax records information # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.list_o... | [
"def",
"list_outbox_faxes",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async'",
")",
":",
"return",
"self",
".",
"list_outbox_faxes_with_http_i... | Get outbox records # noqa: E501
Get outbox fax records information # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.list_outbox_faxes(async=True)
>>> result = thread.get()
... | [
"Get",
"outbox",
"records",
"#",
"noqa",
":",
"E501"
] | 75ed2ea487a6be537342baea1077a02b0c8e70c1 | https://github.com/faxir/faxir-python/blob/75ed2ea487a6be537342baea1077a02b0c8e70c1/faxir/api/outbox_api.py#L234-L253 | train | List all outbox fax records. |
faxir/faxir-python | faxir/api/outbox_api.py | OutboxApi.send_fax | def send_fax(self, payload_outbox, **kwargs): # noqa: E501
"""Send a fax # noqa: E501
With this API call you will be able to send a fax (one or more files) to one or more destinations. If you are a corporate member and you don't have a fax number set your **from** parameter to **NO_NUMBER** # noqa: ... | python | def send_fax(self, payload_outbox, **kwargs): # noqa: E501
"""Send a fax # noqa: E501
With this API call you will be able to send a fax (one or more files) to one or more destinations. If you are a corporate member and you don't have a fax number set your **from** parameter to **NO_NUMBER** # noqa: ... | [
"def",
"send_fax",
"(",
"self",
",",
"payload_outbox",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async'",
")",
":",
"return",
"self",
".",
"send_fax_wi... | Send a fax # noqa: E501
With this API call you will be able to send a fax (one or more files) to one or more destinations. If you are a corporate member and you don't have a fax number set your **from** parameter to **NO_NUMBER** # noqa: E501
This method makes a synchronous HTTP request by default. T... | [
"Send",
"a",
"fax",
"#",
"noqa",
":",
"E501"
] | 75ed2ea487a6be537342baea1077a02b0c8e70c1 | https://github.com/faxir/faxir-python/blob/75ed2ea487a6be537342baea1077a02b0c8e70c1/faxir/api/outbox_api.py#L325-L345 | train | Send a fax to one or more destinations. |
faxir/faxir-python | faxir/api/outbox_api.py | OutboxApi.update_outbox_fax | def update_outbox_fax(self, outbox_fax_id, payload_outbox_modification, **kwargs): # noqa: E501
"""Modify a fax record in outbox # noqa: E501
Modify outbox record's comment # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, ple... | python | def update_outbox_fax(self, outbox_fax_id, payload_outbox_modification, **kwargs): # noqa: E501
"""Modify a fax record in outbox # noqa: E501
Modify outbox record's comment # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, ple... | [
"def",
"update_outbox_fax",
"(",
"self",
",",
"outbox_fax_id",
",",
"payload_outbox_modification",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async'",
")",
... | Modify a fax record in outbox # noqa: E501
Modify outbox record's comment # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_outbox_fax(outbox_fax_id, payload_outbox_modification, a... | [
"Modify",
"a",
"fax",
"record",
"in",
"outbox",
"#",
"noqa",
":",
"E501"
] | 75ed2ea487a6be537342baea1077a02b0c8e70c1 | https://github.com/faxir/faxir-python/blob/75ed2ea487a6be537342baea1077a02b0c8e70c1/faxir/api/outbox_api.py#L424-L445 | train | Update an existing fax record in an existing outbox. |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.accept | def accept(self):
"""
Prompts the user for the filepath to save and then saves the image.
"""
filetypes = 'PNG Files (*.png);;JPG Files (*.jpg);;All Files (*.*)'
filename = QFileDialog.getSaveFileName(None,
'Save Snapshot',
... | python | def accept(self):
"""
Prompts the user for the filepath to save and then saves the image.
"""
filetypes = 'PNG Files (*.png);;JPG Files (*.jpg);;All Files (*.*)'
filename = QFileDialog.getSaveFileName(None,
'Save Snapshot',
... | [
"def",
"accept",
"(",
"self",
")",
":",
"filetypes",
"=",
"'PNG Files (*.png);;JPG Files (*.jpg);;All Files (*.*)'",
"filename",
"=",
"QFileDialog",
".",
"getSaveFileName",
"(",
"None",
",",
"'Save Snapshot'",
",",
"self",
".",
"filepath",
"(",
")",
",",
"filetypes"... | Prompts the user for the filepath to save and then saves the image. | [
"Prompts",
"the",
"user",
"for",
"the",
"filepath",
"to",
"save",
"and",
"then",
"saves",
"the",
"image",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L46-L64 | train | Prompts the user for the filepath to save and then saves the image. |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.keyPressEvent | def keyPressEvent(self, event):
"""
Listens for the escape key to cancel out from this snapshot.
:param event | <QKeyPressEvent>
"""
# reject on a cancel
if event.key() == Qt.Key_Escape:
self.reject()
super(XSnapshotWid... | python | def keyPressEvent(self, event):
"""
Listens for the escape key to cancel out from this snapshot.
:param event | <QKeyPressEvent>
"""
# reject on a cancel
if event.key() == Qt.Key_Escape:
self.reject()
super(XSnapshotWid... | [
"def",
"keyPressEvent",
"(",
"self",
",",
"event",
")",
":",
"# reject on a cancel\r",
"if",
"event",
".",
"key",
"(",
")",
"==",
"Qt",
".",
"Key_Escape",
":",
"self",
".",
"reject",
"(",
")",
"super",
"(",
"XSnapshotWidget",
",",
"self",
")",
".",
"ke... | Listens for the escape key to cancel out from this snapshot.
:param event | <QKeyPressEvent> | [
"Listens",
"for",
"the",
"escape",
"key",
"to",
"cancel",
"out",
"from",
"this",
"snapshot",
".",
":",
"param",
"event",
"|",
"<QKeyPressEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L82-L92 | train | Cancels the current snapshot when the escape key is pressed. |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.mousePressEvent | def mousePressEvent(self, event):
"""
Starts the selection process for this widget and snapshot area.
:param event | <QMousePressEvent>
"""
self._region.setX(event.pos().x())
self._region.setY(event.pos().y())
super(XSnapshotWidget, self).mou... | python | def mousePressEvent(self, event):
"""
Starts the selection process for this widget and snapshot area.
:param event | <QMousePressEvent>
"""
self._region.setX(event.pos().x())
self._region.setY(event.pos().y())
super(XSnapshotWidget, self).mou... | [
"def",
"mousePressEvent",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"_region",
".",
"setX",
"(",
"event",
".",
"pos",
"(",
")",
".",
"x",
"(",
")",
")",
"self",
".",
"_region",
".",
"setY",
"(",
"event",
".",
"pos",
"(",
")",
".",
"y",
... | Starts the selection process for this widget and snapshot area.
:param event | <QMousePressEvent> | [
"Starts",
"the",
"selection",
"process",
"for",
"this",
"widget",
"and",
"snapshot",
"area",
".",
":",
"param",
"event",
"|",
"<QMousePressEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L94-L102 | train | Starts the selection process for this widget and snapshot area. |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.mouseMoveEvent | def mouseMoveEvent(self, event):
"""
Drags the selection view for this widget.
:param event | <QMouseMoveEvent>
"""
w = event.pos().x() - self._region.x()
h = event.pos().y() - self._region.y()
self._region.setWidth(w)
self... | python | def mouseMoveEvent(self, event):
"""
Drags the selection view for this widget.
:param event | <QMouseMoveEvent>
"""
w = event.pos().x() - self._region.x()
h = event.pos().y() - self._region.y()
self._region.setWidth(w)
self... | [
"def",
"mouseMoveEvent",
"(",
"self",
",",
"event",
")",
":",
"w",
"=",
"event",
".",
"pos",
"(",
")",
".",
"x",
"(",
")",
"-",
"self",
".",
"_region",
".",
"x",
"(",
")",
"h",
"=",
"event",
".",
"pos",
"(",
")",
".",
"y",
"(",
")",
"-",
... | Drags the selection view for this widget.
:param event | <QMouseMoveEvent> | [
"Drags",
"the",
"selection",
"view",
"for",
"this",
"widget",
".",
":",
"param",
"event",
"|",
"<QMouseMoveEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L104-L117 | train | Adjust the width and height of the region for this widget. |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.mouseReleaseEvent | def mouseReleaseEvent(self, event):
"""
Finishes the selection event.
:param event | <QMouseReleaseEvent>
"""
self.accept()
super(XSnapshotWidget, self).mouseReleaseEvent(event) | python | def mouseReleaseEvent(self, event):
"""
Finishes the selection event.
:param event | <QMouseReleaseEvent>
"""
self.accept()
super(XSnapshotWidget, self).mouseReleaseEvent(event) | [
"def",
"mouseReleaseEvent",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"accept",
"(",
")",
"super",
"(",
"XSnapshotWidget",
",",
"self",
")",
".",
"mouseReleaseEvent",
"(",
"event",
")"
] | Finishes the selection event.
:param event | <QMouseReleaseEvent> | [
"Finishes",
"the",
"selection",
"event",
".",
":",
"param",
"event",
"|",
"<QMouseReleaseEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L119-L126 | train | Handles the mouse release event. |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.paintEvent | def paintEvent(self, event):
"""
Handles the drawing for this widget and its selection region.
:param event | <QPaintEvent>
"""
pen = QPen(Qt.DashLine)
pen.setColor(QColor('red'))
with XPainter(self) as painter:
painter.setPen(pe... | python | def paintEvent(self, event):
"""
Handles the drawing for this widget and its selection region.
:param event | <QPaintEvent>
"""
pen = QPen(Qt.DashLine)
pen.setColor(QColor('red'))
with XPainter(self) as painter:
painter.setPen(pe... | [
"def",
"paintEvent",
"(",
"self",
",",
"event",
")",
":",
"pen",
"=",
"QPen",
"(",
"Qt",
".",
"DashLine",
")",
"pen",
".",
"setColor",
"(",
"QColor",
"(",
"'red'",
")",
")",
"with",
"XPainter",
"(",
"self",
")",
"as",
"painter",
":",
"painter",
"."... | Handles the drawing for this widget and its selection region.
:param event | <QPaintEvent> | [
"Handles",
"the",
"drawing",
"for",
"this",
"widget",
"and",
"its",
"selection",
"region",
".",
":",
"param",
"event",
"|",
"<QPaintEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L128-L142 | train | Handles the drawing for this widget and its selection region. |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.reject | def reject(self):
"""
Rejects the snapshot and closes the widget.
"""
if self.hideWindow():
self.hideWindow().show()
self.close()
self.deleteLater() | python | def reject(self):
"""
Rejects the snapshot and closes the widget.
"""
if self.hideWindow():
self.hideWindow().show()
self.close()
self.deleteLater() | [
"def",
"reject",
"(",
"self",
")",
":",
"if",
"self",
".",
"hideWindow",
"(",
")",
":",
"self",
".",
"hideWindow",
"(",
")",
".",
"show",
"(",
")",
"self",
".",
"close",
"(",
")",
"self",
".",
"deleteLater",
"(",
")"
] | Rejects the snapshot and closes the widget. | [
"Rejects",
"the",
"snapshot",
"and",
"closes",
"the",
"widget",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L144-L152 | train | Rejects the snapshot and closes the widget. |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.save | def save(self):
"""
Saves the snapshot based on the current region.
"""
# close down the snapshot widget
if self.hideWindow():
self.hideWindow().hide()
self.hide()
QApplication.processEvents()
time.sleep(1)
... | python | def save(self):
"""
Saves the snapshot based on the current region.
"""
# close down the snapshot widget
if self.hideWindow():
self.hideWindow().hide()
self.hide()
QApplication.processEvents()
time.sleep(1)
... | [
"def",
"save",
"(",
"self",
")",
":",
"# close down the snapshot widget\r",
"if",
"self",
".",
"hideWindow",
"(",
")",
":",
"self",
".",
"hideWindow",
"(",
")",
".",
"hide",
"(",
")",
"self",
".",
"hide",
"(",
")",
"QApplication",
".",
"processEvents",
"... | Saves the snapshot based on the current region. | [
"Saves",
"the",
"snapshot",
"based",
"on",
"the",
"current",
"region",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L162-L194 | train | Saves the current region to the current snapshot. |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.show | def show(self):
"""
Shows this widget and hides the specified window if necessary.
"""
super(XSnapshotWidget, self).show()
if self.hideWindow():
self.hideWindow().hide()
QApplication.processEvents() | python | def show(self):
"""
Shows this widget and hides the specified window if necessary.
"""
super(XSnapshotWidget, self).show()
if self.hideWindow():
self.hideWindow().hide()
QApplication.processEvents() | [
"def",
"show",
"(",
"self",
")",
":",
"super",
"(",
"XSnapshotWidget",
",",
"self",
")",
".",
"show",
"(",
")",
"if",
"self",
".",
"hideWindow",
"(",
")",
":",
"self",
".",
"hideWindow",
"(",
")",
".",
"hide",
"(",
")",
"QApplication",
".",
"proces... | Shows this widget and hides the specified window if necessary. | [
"Shows",
"this",
"widget",
"and",
"hides",
"the",
"specified",
"window",
"if",
"necessary",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L196-L204 | train | Shows this widget and hides the specified window if necessary. |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.capture | def capture(rect=None, filepath='', prompt=True, hideWindow=None):
"""
Prompts the user to capture the screen.
:param rect | <QRect>
filepath | <str>
prompt | <bool>
:return (<str> filepath, <bool> accepted)... | python | def capture(rect=None, filepath='', prompt=True, hideWindow=None):
"""
Prompts the user to capture the screen.
:param rect | <QRect>
filepath | <str>
prompt | <bool>
:return (<str> filepath, <bool> accepted)... | [
"def",
"capture",
"(",
"rect",
"=",
"None",
",",
"filepath",
"=",
"''",
",",
"prompt",
"=",
"True",
",",
"hideWindow",
"=",
"None",
")",
":",
"widget",
"=",
"XSnapshotWidget",
"(",
"QApplication",
".",
"desktop",
"(",
")",
")",
"widget",
".",
"setRegio... | Prompts the user to capture the screen.
:param rect | <QRect>
filepath | <str>
prompt | <bool>
:return (<str> filepath, <bool> accepted) | [
"Prompts",
"the",
"user",
"to",
"capture",
"the",
"screen",
".",
":",
"param",
"rect",
"|",
"<QRect",
">",
"filepath",
"|",
"<str",
">",
"prompt",
"|",
"<bool",
">",
":",
"return",
"(",
"<str",
">",
"filepath",
"<bool",
">",
"accepted",
")"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L233-L253 | train | Prompts the user to capture the screen. |
mikhaildubov/AST-text-analysis | east/applications.py | keyphrases_table | def keyphrases_table(keyphrases, texts, similarity_measure=None, synonimizer=None,
language=consts.Language.ENGLISH):
"""
Constructs the keyphrases table, containing their matching scores in a set of texts.
The resulting table is stored as a dictionary of dictionaries,
where the en... | python | def keyphrases_table(keyphrases, texts, similarity_measure=None, synonimizer=None,
language=consts.Language.ENGLISH):
"""
Constructs the keyphrases table, containing their matching scores in a set of texts.
The resulting table is stored as a dictionary of dictionaries,
where the en... | [
"def",
"keyphrases_table",
"(",
"keyphrases",
",",
"texts",
",",
"similarity_measure",
"=",
"None",
",",
"synonimizer",
"=",
"None",
",",
"language",
"=",
"consts",
".",
"Language",
".",
"ENGLISH",
")",
":",
"similarity_measure",
"=",
"similarity_measure",
"or",... | Constructs the keyphrases table, containing their matching scores in a set of texts.
The resulting table is stored as a dictionary of dictionaries,
where the entry table["keyphrase"]["text"] corresponds
to the matching score (0 <= score <= 1) of keyphrase "keyphrase"
in the text named "text".
... | [
"Constructs",
"the",
"keyphrases",
"table",
"containing",
"their",
"matching",
"scores",
"in",
"a",
"set",
"of",
"texts",
"."
] | 055ad8d2492c100bbbaa25309ec1074bdf1dfaa5 | https://github.com/mikhaildubov/AST-text-analysis/blob/055ad8d2492c100bbbaa25309ec1074bdf1dfaa5/east/applications.py#L11-L56 | train | Constructs a keyphrases table containing their matching scores in a set of texts. |
mikhaildubov/AST-text-analysis | east/applications.py | keyphrases_graph | def keyphrases_graph(keyphrases, texts, referral_confidence=0.6, relevance_threshold=0.25,
support_threshold=1, similarity_measure=None, synonimizer=None,
language=consts.Language.ENGLISH):
"""
Constructs the keyphrases relation graph based on the given texts corpus.
... | python | def keyphrases_graph(keyphrases, texts, referral_confidence=0.6, relevance_threshold=0.25,
support_threshold=1, similarity_measure=None, synonimizer=None,
language=consts.Language.ENGLISH):
"""
Constructs the keyphrases relation graph based on the given texts corpus.
... | [
"def",
"keyphrases_graph",
"(",
"keyphrases",
",",
"texts",
",",
"referral_confidence",
"=",
"0.6",
",",
"relevance_threshold",
"=",
"0.25",
",",
"support_threshold",
"=",
"1",
",",
"similarity_measure",
"=",
"None",
",",
"synonimizer",
"=",
"None",
",",
"langua... | Constructs the keyphrases relation graph based on the given texts corpus.
The graph construction algorithm is based on the analysis of co-occurrences of key phrases
in the text corpus. A key phrase is considered to imply another one if that second phrase
occurs frequently enough in the same texts as the fi... | [
"Constructs",
"the",
"keyphrases",
"relation",
"graph",
"based",
"on",
"the",
"given",
"texts",
"corpus",
"."
] | 055ad8d2492c100bbbaa25309ec1074bdf1dfaa5 | https://github.com/mikhaildubov/AST-text-analysis/blob/055ad8d2492c100bbbaa25309ec1074bdf1dfaa5/east/applications.py#L59-L149 | train | Constructs a keyphrases relation graph based on the given texts corpus. |
core/uricore | uricore/wkz_internal.py | _decode_unicode | def _decode_unicode(value, charset, errors):
"""Like the regular decode function but this one raises an
`HTTPUnicodeError` if errors is `strict`."""
fallback = None
if errors.startswith('fallback:'):
fallback = errors[9:]
errors = 'strict'
try:
return value.decode(charset, er... | python | def _decode_unicode(value, charset, errors):
"""Like the regular decode function but this one raises an
`HTTPUnicodeError` if errors is `strict`."""
fallback = None
if errors.startswith('fallback:'):
fallback = errors[9:]
errors = 'strict'
try:
return value.decode(charset, er... | [
"def",
"_decode_unicode",
"(",
"value",
",",
"charset",
",",
"errors",
")",
":",
"fallback",
"=",
"None",
"if",
"errors",
".",
"startswith",
"(",
"'fallback:'",
")",
":",
"fallback",
"=",
"errors",
"[",
"9",
":",
"]",
"errors",
"=",
"'strict'",
"try",
... | Like the regular decode function but this one raises an
`HTTPUnicodeError` if errors is `strict`. | [
"Like",
"the",
"regular",
"decode",
"function",
"but",
"this",
"one",
"raises",
"an",
"HTTPUnicodeError",
"if",
"errors",
"is",
"strict",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_internal.py#L12-L25 | train | Like the regular decode function but this one raises an HTTPUnicodeError. |
bitesofcode/projexui | projexui/widgets/xiconbutton.py | XIconButton.dropEvent | def dropEvent( self, event ):
"""
Handles a drop event.
"""
url = event.mimeData().urls()[0]
url_path = nativestring(url.toString())
# download an icon from the web
if ( not url_path.startswith('file:') ):
filename = os.path.basename... | python | def dropEvent( self, event ):
"""
Handles a drop event.
"""
url = event.mimeData().urls()[0]
url_path = nativestring(url.toString())
# download an icon from the web
if ( not url_path.startswith('file:') ):
filename = os.path.basename... | [
"def",
"dropEvent",
"(",
"self",
",",
"event",
")",
":",
"url",
"=",
"event",
".",
"mimeData",
"(",
")",
".",
"urls",
"(",
")",
"[",
"0",
"]",
"url_path",
"=",
"nativestring",
"(",
"url",
".",
"toString",
"(",
")",
")",
"# download an icon from the web... | Handles a drop event. | [
"Handles",
"a",
"drop",
"event",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xiconbutton.py#L90-L109 | train | Handles a drop event. |
bitesofcode/projexui | projexui/widgets/xiconbutton.py | XIconButton.pickFilepath | def pickFilepath( self ):
"""
Picks the image file to use for this icon path.
"""
filepath = QFileDialog.getOpenFileName( self,
'Select Image File',
QDir.currentPath(),
... | python | def pickFilepath( self ):
"""
Picks the image file to use for this icon path.
"""
filepath = QFileDialog.getOpenFileName( self,
'Select Image File',
QDir.currentPath(),
... | [
"def",
"pickFilepath",
"(",
"self",
")",
":",
"filepath",
"=",
"QFileDialog",
".",
"getOpenFileName",
"(",
"self",
",",
"'Select Image File'",
",",
"QDir",
".",
"currentPath",
"(",
")",
",",
"self",
".",
"fileTypes",
"(",
")",
")",
"if",
"type",
"(",
"fi... | Picks the image file to use for this icon path. | [
"Picks",
"the",
"image",
"file",
"to",
"use",
"for",
"this",
"icon",
"path",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xiconbutton.py#L111-L124 | train | Picks the image file to use for this icon path. |
bitesofcode/projexui | projexui/widgets/xiconbutton.py | XIconButton.setFilepath | def setFilepath( self, filepath ):
"""
Sets the filepath for this button to the inputed path.
:param filepath | <str>
"""
self._filepath = nativestring(filepath)
self.setIcon(QIcon(filepath))
if ( not self.signalsBlocked() ):
self.filepat... | python | def setFilepath( self, filepath ):
"""
Sets the filepath for this button to the inputed path.
:param filepath | <str>
"""
self._filepath = nativestring(filepath)
self.setIcon(QIcon(filepath))
if ( not self.signalsBlocked() ):
self.filepat... | [
"def",
"setFilepath",
"(",
"self",
",",
"filepath",
")",
":",
"self",
".",
"_filepath",
"=",
"nativestring",
"(",
"filepath",
")",
"self",
".",
"setIcon",
"(",
"QIcon",
"(",
"filepath",
")",
")",
"if",
"(",
"not",
"self",
".",
"signalsBlocked",
"(",
")... | Sets the filepath for this button to the inputed path.
:param filepath | <str> | [
"Sets",
"the",
"filepath",
"for",
"this",
"button",
"to",
"the",
"inputed",
"path",
".",
":",
"param",
"filepath",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xiconbutton.py#L126-L135 | train | Sets the filepath for this button to the inputed path. |
bitesofcode/projexui | projexui/widgets/xiconbutton.py | XIconButton.buildIcon | def buildIcon(icon):
"""
Builds an icon from the inputed information.
:param icon | <variant>
"""
if icon is None:
return QIcon()
if type(icon) == buffer:
try:
icon = QIcon(projexui.generatePixmap(i... | python | def buildIcon(icon):
"""
Builds an icon from the inputed information.
:param icon | <variant>
"""
if icon is None:
return QIcon()
if type(icon) == buffer:
try:
icon = QIcon(projexui.generatePixmap(i... | [
"def",
"buildIcon",
"(",
"icon",
")",
":",
"if",
"icon",
"is",
"None",
":",
"return",
"QIcon",
"(",
")",
"if",
"type",
"(",
"icon",
")",
"==",
"buffer",
":",
"try",
":",
"icon",
"=",
"QIcon",
"(",
"projexui",
".",
"generatePixmap",
"(",
"icon",
")"... | Builds an icon from the inputed information.
:param icon | <variant> | [
"Builds",
"an",
"icon",
"from",
"the",
"inputed",
"information",
".",
":",
"param",
"icon",
"|",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xiconbutton.py#L146-L166 | train | Builds an icon from the inputed information. |
johnnoone/aioconsul | aioconsul/client/event_endpoint.py | EventEndpoint.fire | async def fire(self, name, payload=None, *,
dc=None, node=None, service=None, tag=None):
"""Fires a new event
Parameters:
name (str): Event name
payload (Payload): Opaque data
node (Filter): Regular expression to filter by node name
ser... | python | async def fire(self, name, payload=None, *,
dc=None, node=None, service=None, tag=None):
"""Fires a new event
Parameters:
name (str): Event name
payload (Payload): Opaque data
node (Filter): Regular expression to filter by node name
ser... | [
"async",
"def",
"fire",
"(",
"self",
",",
"name",
",",
"payload",
"=",
"None",
",",
"*",
",",
"dc",
"=",
"None",
",",
"node",
"=",
"None",
",",
"service",
"=",
"None",
",",
"tag",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"dc\"",
":",
"dc",
... | Fires a new event
Parameters:
name (str): Event name
payload (Payload): Opaque data
node (Filter): Regular expression to filter by node name
service (Filter): Regular expression to filter by service
tag (Filter): Regular expression to filter by servic... | [
"Fires",
"a",
"new",
"event"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/event_endpoint.py#L10-L53 | train | Fires a new event and returns the ID of the event. |
johnnoone/aioconsul | aioconsul/client/event_endpoint.py | EventEndpoint.items | async def items(self, name=None, *, watch=None):
"""Lists the most recent events an agent has seen
Parameters:
name (str): Filter events by name.
watch (Blocking): Do a blocking query
Returns:
CollectionMeta: where value is a list of events
It return... | python | async def items(self, name=None, *, watch=None):
"""Lists the most recent events an agent has seen
Parameters:
name (str): Filter events by name.
watch (Blocking): Do a blocking query
Returns:
CollectionMeta: where value is a list of events
It return... | [
"async",
"def",
"items",
"(",
"self",
",",
"name",
"=",
"None",
",",
"*",
",",
"watch",
"=",
"None",
")",
":",
"path",
"=",
"\"/v1/event/list\"",
"params",
"=",
"{",
"\"name\"",
":",
"name",
"}",
"response",
"=",
"await",
"self",
".",
"_api",
".",
... | Lists the most recent events an agent has seen
Parameters:
name (str): Filter events by name.
watch (Blocking): Do a blocking query
Returns:
CollectionMeta: where value is a list of events
It returns a JSON body like this::
[
{
... | [
"Lists",
"the",
"most",
"recent",
"events",
"an",
"agent",
"has",
"seen"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/event_endpoint.py#L55-L84 | train | Lists the most recent events an agent has seen. |
bitesofcode/projexui | projexui/dialogs/xconfigdialog/xconfigplugin.py | XConfigPlugin.createWidget | def createWidget( self, parent ):
"""
Creates a new widget for this plugin for the inputed parent.
:param parent | <QWidget>
:return <QWidget>
"""
widget = self.widgetClass()(parent, self.uiFile())
widget.setPlugin(self)
return w... | python | def createWidget( self, parent ):
"""
Creates a new widget for this plugin for the inputed parent.
:param parent | <QWidget>
:return <QWidget>
"""
widget = self.widgetClass()(parent, self.uiFile())
widget.setPlugin(self)
return w... | [
"def",
"createWidget",
"(",
"self",
",",
"parent",
")",
":",
"widget",
"=",
"self",
".",
"widgetClass",
"(",
")",
"(",
"parent",
",",
"self",
".",
"uiFile",
"(",
")",
")",
"widget",
".",
"setPlugin",
"(",
"self",
")",
"return",
"widget"
] | Creates a new widget for this plugin for the inputed parent.
:param parent | <QWidget>
:return <QWidget> | [
"Creates",
"a",
"new",
"widget",
"for",
"this",
"plugin",
"for",
"the",
"inputed",
"parent",
".",
":",
"param",
"parent",
"|",
"<QWidget",
">",
":",
"return",
"<QWidget",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xconfigdialog/xconfigplugin.py#L57-L67 | train | Creates a new widget for this plugin for the inputed parent. |
bitesofcode/projexui | projexui/dialogs/xconfigdialog/xconfigplugin.py | XConfigPlugin.restoreSettings | def restoreSettings( self, settings ):
"""
Restores the settings from the inputed settings instance.
:param settings | <QSettings>
:return <bool> success
"""
dataSet = self.dataSet()
if ( not dataSet ):
return False
... | python | def restoreSettings( self, settings ):
"""
Restores the settings from the inputed settings instance.
:param settings | <QSettings>
:return <bool> success
"""
dataSet = self.dataSet()
if ( not dataSet ):
return False
... | [
"def",
"restoreSettings",
"(",
"self",
",",
"settings",
")",
":",
"dataSet",
"=",
"self",
".",
"dataSet",
"(",
")",
"if",
"(",
"not",
"dataSet",
")",
":",
"return",
"False",
"projexui",
".",
"restoreDataSet",
"(",
"settings",
",",
"self",
".",
"uniqueNam... | Restores the settings from the inputed settings instance.
:param settings | <QSettings>
:return <bool> success | [
"Restores",
"the",
"settings",
"from",
"the",
"inputed",
"settings",
"instance",
".",
":",
"param",
"settings",
"|",
"<QSettings",
">",
":",
"return",
"<bool",
">",
"success"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xconfigdialog/xconfigplugin.py#L92-L111 | train | Restores the settings from the inputed settings instance. |
bitesofcode/projexui | projexui/dialogs/xconfigdialog/xconfigplugin.py | XConfigPlugin.saveSettings | def saveSettings( self, settings ):
"""
Saves the plugin data to the inputed settings system.
:param settings | <QSettings>
:return <bool> success
"""
dataSet = self.dataSet()
if ( not dataSet ):
return False
... | python | def saveSettings( self, settings ):
"""
Saves the plugin data to the inputed settings system.
:param settings | <QSettings>
:return <bool> success
"""
dataSet = self.dataSet()
if ( not dataSet ):
return False
... | [
"def",
"saveSettings",
"(",
"self",
",",
"settings",
")",
":",
"dataSet",
"=",
"self",
".",
"dataSet",
"(",
")",
"if",
"(",
"not",
"dataSet",
")",
":",
"return",
"False",
"projexui",
".",
"saveDataSet",
"(",
"settings",
",",
"self",
".",
"uniqueName",
... | Saves the plugin data to the inputed settings system.
:param settings | <QSettings>
:return <bool> success | [
"Saves",
"the",
"plugin",
"data",
"to",
"the",
"inputed",
"settings",
"system",
".",
":",
"param",
"settings",
"|",
"<QSettings",
">",
":",
"return",
"<bool",
">",
"success"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xconfigdialog/xconfigplugin.py#L124-L140 | train | Saves the plugin data to the inputed settings system. |
bitesofcode/projexui | projexui/widgets/xorbtreewidget/xorbrecorditem.py | XOrbRecordItem.addRecordState | def addRecordState( self, state ):
"""
Adds the inputed record state to the set for this item.
:param state | <XOrbRecordItem.State>
"""
curr_state = self.recordState()
self.setRecordState(curr_state | state) | python | def addRecordState( self, state ):
"""
Adds the inputed record state to the set for this item.
:param state | <XOrbRecordItem.State>
"""
curr_state = self.recordState()
self.setRecordState(curr_state | state) | [
"def",
"addRecordState",
"(",
"self",
",",
"state",
")",
":",
"curr_state",
"=",
"self",
".",
"recordState",
"(",
")",
"self",
".",
"setRecordState",
"(",
"curr_state",
"|",
"state",
")"
] | Adds the inputed record state to the set for this item.
:param state | <XOrbRecordItem.State> | [
"Adds",
"the",
"inputed",
"record",
"state",
"to",
"the",
"set",
"for",
"this",
"item",
".",
":",
"param",
"state",
"|",
"<XOrbRecordItem",
".",
"State",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbtreewidget/xorbrecorditem.py#L63-L70 | train | Adds the inputed record state to the set for this item. |
bitesofcode/projexui | projexui/widgets/xorbtreewidget/xorbrecorditem.py | XOrbRecordItem.childRecords | def childRecords(self):
"""
Returns a record set of children for this item based on the record. If
no record set is manually set for this instance, then it will use the
hierarchyColumn value from the tree widget with this record. If no
hierarchyColumn is speified, then a b... | python | def childRecords(self):
"""
Returns a record set of children for this item based on the record. If
no record set is manually set for this instance, then it will use the
hierarchyColumn value from the tree widget with this record. If no
hierarchyColumn is speified, then a b... | [
"def",
"childRecords",
"(",
"self",
")",
":",
"if",
"self",
".",
"_childRecords",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_childRecords",
"tree",
"=",
"self",
".",
"treeWidget",
"(",
")",
"try",
":",
"table",
",",
"column",
"=",
"tree",
".",
... | Returns a record set of children for this item based on the record. If
no record set is manually set for this instance, then it will use the
hierarchyColumn value from the tree widget with this record. If no
hierarchyColumn is speified, then a blank record set is returned.
... | [
"Returns",
"a",
"record",
"set",
"of",
"children",
"for",
"this",
"item",
"based",
"on",
"the",
"record",
".",
"If",
"no",
"record",
"set",
"is",
"manually",
"set",
"for",
"this",
"instance",
"then",
"it",
"will",
"use",
"the",
"hierarchyColumn",
"value",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbtreewidget/xorbrecorditem.py#L72-L96 | train | Returns a record set of children for this information item based on the record set hierarchyColumn value. |
bitesofcode/projexui | projexui/widgets/xorbtreewidget/xorbrecorditem.py | XOrbRecordItem.findItemsByState | def findItemsByState( self, state ):
"""
Looks up all the items within this record based on the state.
:param state | <XOrbRecordItem.State>
:return [<XOrbRecordItem>, ..]
"""
out = []
if ( self.hasRecordState(state) ):
... | python | def findItemsByState( self, state ):
"""
Looks up all the items within this record based on the state.
:param state | <XOrbRecordItem.State>
:return [<XOrbRecordItem>, ..]
"""
out = []
if ( self.hasRecordState(state) ):
... | [
"def",
"findItemsByState",
"(",
"self",
",",
"state",
")",
":",
"out",
"=",
"[",
"]",
"if",
"(",
"self",
".",
"hasRecordState",
"(",
"state",
")",
")",
":",
"out",
".",
"append",
"(",
"self",
")",
"for",
"c",
"in",
"range",
"(",
"self",
".",
"chi... | Looks up all the items within this record based on the state.
:param state | <XOrbRecordItem.State>
:return [<XOrbRecordItem>, ..] | [
"Looks",
"up",
"all",
"the",
"items",
"within",
"this",
"record",
"based",
"on",
"the",
"state",
".",
":",
"param",
"state",
"|",
"<XOrbRecordItem",
".",
"State",
">",
":",
"return",
"[",
"<XOrbRecordItem",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbtreewidget/xorbrecorditem.py#L114-L129 | train | Returns a list of items in this record based on the state. |
bitesofcode/projexui | projexui/widgets/xorbtreewidget/xorbrecorditem.py | XOrbRecordItem.hasRecords | def hasRecords(self):
"""
Returns whether or not this record has children.
:return <bool>
"""
records = self.childRecords()
if records and len(records) > 0:
return True
return False | python | def hasRecords(self):
"""
Returns whether or not this record has children.
:return <bool>
"""
records = self.childRecords()
if records and len(records) > 0:
return True
return False | [
"def",
"hasRecords",
"(",
"self",
")",
":",
"records",
"=",
"self",
".",
"childRecords",
"(",
")",
"if",
"records",
"and",
"len",
"(",
"records",
")",
">",
"0",
":",
"return",
"True",
"return",
"False"
] | Returns whether or not this record has children.
:return <bool> | [
"Returns",
"whether",
"or",
"not",
"this",
"record",
"has",
"children",
".",
":",
"return",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbtreewidget/xorbrecorditem.py#L131-L140 | train | Returns whether or not this record has children. |
bitesofcode/projexui | projexui/widgets/xorbtreewidget/xorbrecorditem.py | XOrbRecordItem.load | def load(self):
"""
Loads the children for this record item.
:return <bool> | changed
"""
if self.__loaded:
return False
self.__loaded = True
self.setChildIndicatorPolicy(self.DontShowIndicatorWhenChildless)
... | python | def load(self):
"""
Loads the children for this record item.
:return <bool> | changed
"""
if self.__loaded:
return False
self.__loaded = True
self.setChildIndicatorPolicy(self.DontShowIndicatorWhenChildless)
... | [
"def",
"load",
"(",
"self",
")",
":",
"if",
"self",
".",
"__loaded",
":",
"return",
"False",
"self",
".",
"__loaded",
"=",
"True",
"self",
".",
"setChildIndicatorPolicy",
"(",
"self",
".",
"DontShowIndicatorWhenChildless",
")",
"# loads the children for this widge... | Loads the children for this record item.
:return <bool> | changed | [
"Loads",
"the",
"children",
"for",
"this",
"record",
"item",
".",
":",
"return",
"<bool",
">",
"|",
"changed"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbtreewidget/xorbrecorditem.py#L152-L174 | train | Loads the children for this record item. |
bitesofcode/projexui | projexui/widgets/xorbtreewidget/xorbrecorditem.py | XOrbRecordItem.removeRecordState | def removeRecordState( self, state ):
"""
Removes the state from this item.
:param state | <XOrbRecordItem.State>
"""
curr_state = self.recordState()
if curr_state & state:
self.setRecordState(curr_state ^ state) | python | def removeRecordState( self, state ):
"""
Removes the state from this item.
:param state | <XOrbRecordItem.State>
"""
curr_state = self.recordState()
if curr_state & state:
self.setRecordState(curr_state ^ state) | [
"def",
"removeRecordState",
"(",
"self",
",",
"state",
")",
":",
"curr_state",
"=",
"self",
".",
"recordState",
"(",
")",
"if",
"curr_state",
"&",
"state",
":",
"self",
".",
"setRecordState",
"(",
"curr_state",
"^",
"state",
")"
] | Removes the state from this item.
:param state | <XOrbRecordItem.State> | [
"Removes",
"the",
"state",
"from",
"this",
"item",
".",
":",
"param",
"state",
"|",
"<XOrbRecordItem",
".",
"State",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbtreewidget/xorbrecorditem.py#L192-L200 | train | Removes the state from this item. |
bitesofcode/projexui | projexui/widgets/xorbtreewidget/xorbrecorditem.py | XOrbRecordItem.setDragTable | def setDragTable(self, table):
"""
Sets the table that will be linked with the drag query for this
record. This information will be added to the drag & drop information
when this record is dragged from the tree and will be set into
the application/x-table format for mime da... | python | def setDragTable(self, table):
"""
Sets the table that will be linked with the drag query for this
record. This information will be added to the drag & drop information
when this record is dragged from the tree and will be set into
the application/x-table format for mime da... | [
"def",
"setDragTable",
"(",
"self",
",",
"table",
")",
":",
"if",
"table",
"and",
"table",
".",
"schema",
"(",
")",
":",
"self",
".",
"setDragData",
"(",
"'application/x-orb-table'",
",",
"table",
".",
"schema",
"(",
")",
".",
"name",
"(",
")",
")",
... | Sets the table that will be linked with the drag query for this
record. This information will be added to the drag & drop information
when this record is dragged from the tree and will be set into
the application/x-table format for mime data.
:sa setDragQuery, XTreeWid... | [
"Sets",
"the",
"table",
"that",
"will",
"be",
"linked",
"with",
"the",
"drag",
"query",
"for",
"this",
"record",
".",
"This",
"information",
"will",
"be",
"added",
"to",
"the",
"drag",
"&",
"drop",
"information",
"when",
"this",
"record",
"is",
"dragged",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbtreewidget/xorbrecorditem.py#L213-L227 | train | Sets the table that will be dragged from the tree. |
bitesofcode/projexui | projexui/widgets/xorbtreewidget/xorbrecorditem.py | XOrbRecordItem.setDragQuery | def setDragQuery(self, query):
"""
Sets the query that should be used when this record is dragged. This
value will be set into the application/x-query format for mime
data.
:param query | <orb.Query> || None
"""
if query is not None:
... | python | def setDragQuery(self, query):
"""
Sets the query that should be used when this record is dragged. This
value will be set into the application/x-query format for mime
data.
:param query | <orb.Query> || None
"""
if query is not None:
... | [
"def",
"setDragQuery",
"(",
"self",
",",
"query",
")",
":",
"if",
"query",
"is",
"not",
"None",
":",
"self",
".",
"setDragData",
"(",
"'application/x-orb-query'",
",",
"query",
".",
"toXmlString",
"(",
")",
")",
"else",
":",
"self",
".",
"setDragData",
"... | Sets the query that should be used when this record is dragged. This
value will be set into the application/x-query format for mime
data.
:param query | <orb.Query> || None | [
"Sets",
"the",
"query",
"that",
"should",
"be",
"used",
"when",
"this",
"record",
"is",
"dragged",
".",
"This",
"value",
"will",
"be",
"set",
"into",
"the",
"application",
"/",
"x",
"-",
"query",
"format",
"for",
"mime",
"data",
".",
":",
"param",
"que... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbtreewidget/xorbrecorditem.py#L229-L240 | train | Sets the query that should be used when this record is dragged. |
bitesofcode/projexui | projexui/widgets/xorbtreewidget/xorbrecorditem.py | XOrbRecordItem.setRecordState | def setRecordState( self, recordState ):
"""
Sets the record state for this item to the inputed state.
:param recordState | <XOrbRecordItem.State>
"""
self._recordState = recordState
try:
is_colored = self.treeWidget().isColored... | python | def setRecordState( self, recordState ):
"""
Sets the record state for this item to the inputed state.
:param recordState | <XOrbRecordItem.State>
"""
self._recordState = recordState
try:
is_colored = self.treeWidget().isColored... | [
"def",
"setRecordState",
"(",
"self",
",",
"recordState",
")",
":",
"self",
".",
"_recordState",
"=",
"recordState",
"try",
":",
"is_colored",
"=",
"self",
".",
"treeWidget",
"(",
")",
".",
"isColored",
"(",
")",
"except",
"AttributeError",
":",
"return",
... | Sets the record state for this item to the inputed state.
:param recordState | <XOrbRecordItem.State> | [
"Sets",
"the",
"record",
"state",
"for",
"this",
"item",
"to",
"the",
"inputed",
"state",
".",
":",
"param",
"recordState",
"|",
"<XOrbRecordItem",
".",
"State",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbtreewidget/xorbrecorditem.py#L251-L286 | train | Sets the record state for this item based on the inputed state. |
bitesofcode/projexui | projexui/widgets/xorbtreewidget/xorbrecorditem.py | XOrbRecordItem.updateRecordValues | def updateRecordValues(self):
"""
Updates the ui to show the latest record values.
"""
record = self.record()
if not record:
return
# update the record information
tree = self.treeWidget()
if not isinstance(tree, XTreeWidget)... | python | def updateRecordValues(self):
"""
Updates the ui to show the latest record values.
"""
record = self.record()
if not record:
return
# update the record information
tree = self.treeWidget()
if not isinstance(tree, XTreeWidget)... | [
"def",
"updateRecordValues",
"(",
"self",
")",
":",
"record",
"=",
"self",
".",
"record",
"(",
")",
"if",
"not",
"record",
":",
"return",
"# update the record information\r",
"tree",
"=",
"self",
".",
"treeWidget",
"(",
")",
"if",
"not",
"isinstance",
"(",
... | Updates the ui to show the latest record values. | [
"Updates",
"the",
"ui",
"to",
"show",
"the",
"latest",
"record",
"values",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbtreewidget/xorbrecorditem.py#L288-L318 | train | Updates the ui to show the latest record values. |
bitesofcode/projexui | projexui/widgets/xorbtreewidget/xorbrecorditem.py | XOrbRecordItem.updateColumnValue | def updateColumnValue(self, column, value, index=None):
"""
Assigns the value for the column of this record to the inputed value.
:param index | <int>
value | <variant>
"""
if index is None:
index = self.treeWidget().column(co... | python | def updateColumnValue(self, column, value, index=None):
"""
Assigns the value for the column of this record to the inputed value.
:param index | <int>
value | <variant>
"""
if index is None:
index = self.treeWidget().column(co... | [
"def",
"updateColumnValue",
"(",
"self",
",",
"column",
",",
"value",
",",
"index",
"=",
"None",
")",
":",
"if",
"index",
"is",
"None",
":",
"index",
"=",
"self",
".",
"treeWidget",
"(",
")",
".",
"column",
"(",
"column",
".",
"name",
"(",
")",
")"... | Assigns the value for the column of this record to the inputed value.
:param index | <int>
value | <variant> | [
"Assigns",
"the",
"value",
"for",
"the",
"column",
"of",
"this",
"record",
"to",
"the",
"inputed",
"value",
".",
":",
"param",
"index",
"|",
"<int",
">",
"value",
"|",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbtreewidget/xorbrecorditem.py#L320-L360 | train | Updates the value of the given column in the current record. |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | CRC16.extract_bits | def extract_bits(self, val):
"""Extras the 4 bits, XORS the message data, and does table lookups."""
# Step one, extract the Most significant 4 bits of the CRC register
thisval = self.high >> 4
# XOR in the Message Data into the extracted bits
thisval = thisval ^ val
... | python | def extract_bits(self, val):
"""Extras the 4 bits, XORS the message data, and does table lookups."""
# Step one, extract the Most significant 4 bits of the CRC register
thisval = self.high >> 4
# XOR in the Message Data into the extracted bits
thisval = thisval ^ val
... | [
"def",
"extract_bits",
"(",
"self",
",",
"val",
")",
":",
"# Step one, extract the Most significant 4 bits of the CRC register\r",
"thisval",
"=",
"self",
".",
"high",
">>",
"4",
"# XOR in the Message Data into the extracted bits\r",
"thisval",
"=",
"thisval",
"^",
"val",
... | Extras the 4 bits, XORS the message data, and does table lookups. | [
"Extras",
"the",
"4",
"bits",
"XORS",
"the",
"message",
"data",
"and",
"does",
"table",
"lookups",
"."
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L37-L52 | train | Extras the 4 bits XORS the message data and does table lookups. |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | CRC16.run | def run(self, message):
"""Calculates a CRC"""
for value in message:
self.update(value)
return [self.low, self.high] | python | def run(self, message):
"""Calculates a CRC"""
for value in message:
self.update(value)
return [self.low, self.high] | [
"def",
"run",
"(",
"self",
",",
"message",
")",
":",
"for",
"value",
"in",
"message",
":",
"self",
".",
"update",
"(",
"value",
")",
"return",
"[",
"self",
".",
"low",
",",
"self",
".",
"high",
"]"
] | Calculates a CRC | [
"Calculates",
"a",
"CRC"
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L59-L63 | train | Calculates a CRC |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat._hm_form_message | def _hm_form_message(
self,
thermostat_id,
protocol,
source,
function,
start,
payload
):
"""Forms a message payload, excluding CRC"""
if protocol == constants.HMV3_ID:
start_low = (start & cons... | python | def _hm_form_message(
self,
thermostat_id,
protocol,
source,
function,
start,
payload
):
"""Forms a message payload, excluding CRC"""
if protocol == constants.HMV3_ID:
start_low = (start & cons... | [
"def",
"_hm_form_message",
"(",
"self",
",",
"thermostat_id",
",",
"protocol",
",",
"source",
",",
"function",
",",
"start",
",",
"payload",
")",
":",
"if",
"protocol",
"==",
"constants",
".",
"HMV3_ID",
":",
"start_low",
"=",
"(",
"start",
"&",
"constants... | Forms a message payload, excluding CRC | [
"Forms",
"a",
"message",
"payload",
"excluding",
"CRC"
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L80-L117 | train | Forms a message payload including CRC |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat._hm_form_message_crc | def _hm_form_message_crc(
self,
thermostat_id,
protocol,
source,
function,
start,
payload
):
"""Forms a message payload, including CRC"""
data = self._hm_form_message(
thermostat_id, protocol, ... | python | def _hm_form_message_crc(
self,
thermostat_id,
protocol,
source,
function,
start,
payload
):
"""Forms a message payload, including CRC"""
data = self._hm_form_message(
thermostat_id, protocol, ... | [
"def",
"_hm_form_message_crc",
"(",
"self",
",",
"thermostat_id",
",",
"protocol",
",",
"source",
",",
"function",
",",
"start",
",",
"payload",
")",
":",
"data",
"=",
"self",
".",
"_hm_form_message",
"(",
"thermostat_id",
",",
"protocol",
",",
"source",
","... | Forms a message payload, including CRC | [
"Forms",
"a",
"message",
"payload",
"including",
"CRC"
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L119-L133 | train | Forms a message payload including CRC |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat._hm_verify_message_crc_uk | def _hm_verify_message_crc_uk(
self,
thermostat_id,
protocol,
source,
expectedFunction,
expectedLength,
datal
):
"""Verifies message appears legal"""
# expectedLength only used for read msgs as always 7 for... | python | def _hm_verify_message_crc_uk(
self,
thermostat_id,
protocol,
source,
expectedFunction,
expectedLength,
datal
):
"""Verifies message appears legal"""
# expectedLength only used for read msgs as always 7 for... | [
"def",
"_hm_verify_message_crc_uk",
"(",
"self",
",",
"thermostat_id",
",",
"protocol",
",",
"source",
",",
"expectedFunction",
",",
"expectedLength",
",",
"datal",
")",
":",
"# expectedLength only used for read msgs as always 7 for write\r",
"badresponse",
"=",
"0",
"if"... | Verifies message appears legal | [
"Verifies",
"message",
"appears",
"legal"
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L135-L238 | train | Verifies that a message is legal and that the CRC is correct. |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat._hm_send_msg | def _hm_send_msg(self, message):
"""This is the only interface to the serial connection."""
try:
serial_message = message
self.conn.write(serial_message) # Write a string
except serial.SerialTimeoutException:
serror = "Write timeout error: \n"
... | python | def _hm_send_msg(self, message):
"""This is the only interface to the serial connection."""
try:
serial_message = message
self.conn.write(serial_message) # Write a string
except serial.SerialTimeoutException:
serror = "Write timeout error: \n"
... | [
"def",
"_hm_send_msg",
"(",
"self",
",",
"message",
")",
":",
"try",
":",
"serial_message",
"=",
"message",
"self",
".",
"conn",
".",
"write",
"(",
"serial_message",
")",
"# Write a string\r",
"except",
"serial",
".",
"SerialTimeoutException",
":",
"serror",
"... | This is the only interface to the serial connection. | [
"This",
"is",
"the",
"only",
"interface",
"to",
"the",
"serial",
"connection",
"."
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L240-L252 | train | Send a message to the HM. |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat._hm_read_address | def _hm_read_address(self):
"""Reads from the DCB and maps to yaml config file."""
response = self._hm_send_address(self.address, 0, 0, 0)
lookup = self.config['keys']
offset = self.config['offset']
keydata = {}
for i in lookup:
try:
kd... | python | def _hm_read_address(self):
"""Reads from the DCB and maps to yaml config file."""
response = self._hm_send_address(self.address, 0, 0, 0)
lookup = self.config['keys']
offset = self.config['offset']
keydata = {}
for i in lookup:
try:
kd... | [
"def",
"_hm_read_address",
"(",
"self",
")",
":",
"response",
"=",
"self",
".",
"_hm_send_address",
"(",
"self",
".",
"address",
",",
"0",
",",
"0",
",",
"0",
")",
"lookup",
"=",
"self",
".",
"config",
"[",
"'keys'",
"]",
"offset",
"=",
"self",
".",
... | Reads from the DCB and maps to yaml config file. | [
"Reads",
"from",
"the",
"DCB",
"and",
"maps",
"to",
"yaml",
"config",
"file",
"."
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L284-L300 | train | Reads from the DCB and maps to yaml config file. |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat.read_dcb | def read_dcb(self):
"""
Returns the full DCB, only use for non read-only operations
Use self.dcb for read-only operations.
"""
logging.info("Getting latest data from DCB....")
self.dcb = self._hm_read_address()
return self.dcb | python | def read_dcb(self):
"""
Returns the full DCB, only use for non read-only operations
Use self.dcb for read-only operations.
"""
logging.info("Getting latest data from DCB....")
self.dcb = self._hm_read_address()
return self.dcb | [
"def",
"read_dcb",
"(",
"self",
")",
":",
"logging",
".",
"info",
"(",
"\"Getting latest data from DCB....\"",
")",
"self",
".",
"dcb",
"=",
"self",
".",
"_hm_read_address",
"(",
")",
"return",
"self",
".",
"dcb"
] | Returns the full DCB, only use for non read-only operations
Use self.dcb for read-only operations. | [
"Returns",
"the",
"full",
"DCB",
"only",
"use",
"for",
"non",
"read",
"-",
"only",
"operations",
"Use",
"self",
".",
"dcb",
"for",
"read",
"-",
"only",
"operations",
"."
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L302-L309 | train | Returns the full DCB only use for non read - only operations |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat.set_target_temp | def set_target_temp(self, temperature):
"""
Sets the target temperature, to the requested int
"""
if 35 < temperature < 5:
logging.info("Refusing to set temp outside of allowed range")
return False
else:
self._hm_send_address(self.addre... | python | def set_target_temp(self, temperature):
"""
Sets the target temperature, to the requested int
"""
if 35 < temperature < 5:
logging.info("Refusing to set temp outside of allowed range")
return False
else:
self._hm_send_address(self.addre... | [
"def",
"set_target_temp",
"(",
"self",
",",
"temperature",
")",
":",
"if",
"35",
"<",
"temperature",
"<",
"5",
":",
"logging",
".",
"info",
"(",
"\"Refusing to set temp outside of allowed range\"",
")",
"return",
"False",
"else",
":",
"self",
".",
"_hm_send_addr... | Sets the target temperature, to the requested int | [
"Sets",
"the",
"target",
"temperature",
"to",
"the",
"requested",
"int"
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L384-L393 | train | Sets the target temperature to the requested temperature. |
johnnoone/aioconsul | aioconsul/client/health_endpoint.py | HealthEndpoint.node | async def node(self, node, *, dc=None, watch=None, consistency=None):
"""Returns the health info of a node.
Parameters:
node (ObjectID): Node ID
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (Blo... | python | async def node(self, node, *, dc=None, watch=None, consistency=None):
"""Returns the health info of a node.
Parameters:
node (ObjectID): Node ID
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (Blo... | [
"async",
"def",
"node",
"(",
"self",
",",
"node",
",",
"*",
",",
"dc",
"=",
"None",
",",
"watch",
"=",
"None",
",",
"consistency",
"=",
"None",
")",
":",
"node_id",
"=",
"extract_attr",
"(",
"node",
",",
"keys",
"=",
"[",
"\"Node\"",
",",
"\"ID\"",... | Returns the health info of a node.
Parameters:
node (ObjectID): Node ID
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (Blocking): Do a blocking query
consistency (Consistency): Force consiste... | [
"Returns",
"the",
"health",
"info",
"of",
"a",
"node",
"."
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/health_endpoint.py#L16-L69 | train | Returns the health info of a node. |
johnnoone/aioconsul | aioconsul/client/health_endpoint.py | HealthEndpoint.checks | async def checks(self, service, *,
dc=None, near=None, watch=None, consistency=None):
"""Returns the checks of a service
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
near (str): W... | python | async def checks(self, service, *,
dc=None, near=None, watch=None, consistency=None):
"""Returns the checks of a service
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
near (str): W... | [
"async",
"def",
"checks",
"(",
"self",
",",
"service",
",",
"*",
",",
"dc",
"=",
"None",
",",
"near",
"=",
"None",
",",
"watch",
"=",
"None",
",",
"consistency",
"=",
"None",
")",
":",
"service_id",
"=",
"extract_attr",
"(",
"service",
",",
"keys",
... | Returns the checks of a service
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
near (str): With a node name will sort the node list in ascending
order based on the estimated round trip t... | [
"Returns",
"the",
"checks",
"of",
"a",
"service"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/health_endpoint.py#L71-L92 | train | Returns the checks of a service |
bitesofcode/projexui | projexui/widgets/xprogressfeedbackwidget/xprogressfeedbackwidget.py | XProgressFeedbackWidget.setProgress | def setProgress(self, value):
"""
Sets the progress value for this widget to the inputed value.
:param value | <int>
"""
if value == 0:
self.uiFeedbackLBL.setText('')
self.uiLoggerEDIT.clear()
self.uiProgressBAR.set... | python | def setProgress(self, value):
"""
Sets the progress value for this widget to the inputed value.
:param value | <int>
"""
if value == 0:
self.uiFeedbackLBL.setText('')
self.uiLoggerEDIT.clear()
self.uiProgressBAR.set... | [
"def",
"setProgress",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
"==",
"0",
":",
"self",
".",
"uiFeedbackLBL",
".",
"setText",
"(",
"''",
")",
"self",
".",
"uiLoggerEDIT",
".",
"clear",
"(",
")",
"self",
".",
"uiProgressBAR",
".",
"setValue",
... | Sets the progress value for this widget to the inputed value.
:param value | <int> | [
"Sets",
"the",
"progress",
"value",
"for",
"this",
"widget",
"to",
"the",
"inputed",
"value",
".",
":",
"param",
"value",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xprogressfeedbackwidget/xprogressfeedbackwidget.py#L61-L71 | train | Sets the current progress value for this widget. |
bitesofcode/projexui | projexui/widgets/xprogressfeedbackwidget/xprogressfeedbackwidget.py | XProgressFeedbackWidget.setShowSecondaryProgress | def setShowSecondaryProgress(self, state):
"""
Sets whether or not to display the secondary progress widget.
:param state | <bool>
"""
self._showSecondary = state
self.uiSecondaryProgressBAR.setVisible(state) | python | def setShowSecondaryProgress(self, state):
"""
Sets whether or not to display the secondary progress widget.
:param state | <bool>
"""
self._showSecondary = state
self.uiSecondaryProgressBAR.setVisible(state) | [
"def",
"setShowSecondaryProgress",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_showSecondary",
"=",
"state",
"self",
".",
"uiSecondaryProgressBAR",
".",
"setVisible",
"(",
"state",
")"
] | Sets whether or not to display the secondary progress widget.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"to",
"display",
"the",
"secondary",
"progress",
"widget",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xprogressfeedbackwidget/xprogressfeedbackwidget.py#L81-L88 | train | Sets whether or not to display the secondary progress bar. |
bitesofcode/projexui | projexui/widgets/xprogressfeedbackwidget/xprogressfeedbackwidget.py | XProgressFeedbackWidget.showMessage | def showMessage(self, level, message):
"""
Logs the inputed message for the given level. This will update
both the feedback label and the details widget.
:param level | <int>
message | <str>
"""
self.uiFeedbackLBL.setText(messa... | python | def showMessage(self, level, message):
"""
Logs the inputed message for the given level. This will update
both the feedback label and the details widget.
:param level | <int>
message | <str>
"""
self.uiFeedbackLBL.setText(messa... | [
"def",
"showMessage",
"(",
"self",
",",
"level",
",",
"message",
")",
":",
"self",
".",
"uiFeedbackLBL",
".",
"setText",
"(",
"message",
")",
"self",
".",
"uiLoggerEDIT",
".",
"log",
"(",
"level",
",",
"message",
")"
] | Logs the inputed message for the given level. This will update
both the feedback label and the details widget.
:param level | <int>
message | <str> | [
"Logs",
"the",
"inputed",
"message",
"for",
"the",
"given",
"level",
".",
"This",
"will",
"update",
"both",
"the",
"feedback",
"label",
"and",
"the",
"details",
"widget",
".",
":",
"param",
"level",
"|",
"<int",
">",
"message",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xprogressfeedbackwidget/xprogressfeedbackwidget.py#L95-L104 | train | Shows the inputed message for the given level. |
core/uricore | uricore/wkz_wsgi.py | make_limited_stream | def make_limited_stream(stream, limit):
"""Makes a stream limited."""
if not isinstance(stream, LimitedStream):
if limit is None:
raise TypeError('stream not limited and no limit provided.')
stream = LimitedStream(stream, limit)
return stream | python | def make_limited_stream(stream, limit):
"""Makes a stream limited."""
if not isinstance(stream, LimitedStream):
if limit is None:
raise TypeError('stream not limited and no limit provided.')
stream = LimitedStream(stream, limit)
return stream | [
"def",
"make_limited_stream",
"(",
"stream",
",",
"limit",
")",
":",
"if",
"not",
"isinstance",
"(",
"stream",
",",
"LimitedStream",
")",
":",
"if",
"limit",
"is",
"None",
":",
"raise",
"TypeError",
"(",
"'stream not limited and no limit provided.'",
")",
"strea... | Makes a stream limited. | [
"Makes",
"a",
"stream",
"limited",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_wsgi.py#L172-L178 | train | Makes a stream limited. |
core/uricore | uricore/wkz_wsgi.py | make_chunk_iter | def make_chunk_iter(stream, separator, limit=None, buffer_size=10 * 1024):
"""Works like :func:`make_line_iter` but accepts a separator
which divides chunks. If you want newline based processing
you should use :func:`make_limited_stream` instead as it
supports arbitrary newline markers.
.. version... | python | def make_chunk_iter(stream, separator, limit=None, buffer_size=10 * 1024):
"""Works like :func:`make_line_iter` but accepts a separator
which divides chunks. If you want newline based processing
you should use :func:`make_limited_stream` instead as it
supports arbitrary newline markers.
.. version... | [
"def",
"make_chunk_iter",
"(",
"stream",
",",
"separator",
",",
"limit",
"=",
"None",
",",
"buffer_size",
"=",
"10",
"*",
"1024",
")",
":",
"_read",
"=",
"make_chunk_iter_func",
"(",
"stream",
",",
"limit",
",",
"buffer_size",
")",
"_split",
"=",
"re",
"... | Works like :func:`make_line_iter` but accepts a separator
which divides chunks. If you want newline based processing
you should use :func:`make_limited_stream` instead as it
supports arbitrary newline markers.
.. versionadded:: 0.8
.. versionadded:: 0.9
added support for iterators as input... | [
"Works",
"like",
":",
"func",
":",
"make_line_iter",
"but",
"accepts",
"a",
"separator",
"which",
"divides",
"chunks",
".",
"If",
"you",
"want",
"newline",
"based",
"processing",
"you",
"should",
"use",
":",
"func",
":",
"make_limited_stream",
"instead",
"as",... | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_wsgi.py#L181-L216 | train | A generator function that returns a chunk of content from a stream. |
core/uricore | uricore/wkz_wsgi.py | LimitedStream.exhaust | def exhaust(self, chunk_size=1024 * 16):
"""Exhaust the stream. This consumes all the data left until the
limit is reached.
:param chunk_size: the size for a chunk. It will read the chunk
until the stream is exhausted and throw away
the re... | python | def exhaust(self, chunk_size=1024 * 16):
"""Exhaust the stream. This consumes all the data left until the
limit is reached.
:param chunk_size: the size for a chunk. It will read the chunk
until the stream is exhausted and throw away
the re... | [
"def",
"exhaust",
"(",
"self",
",",
"chunk_size",
"=",
"1024",
"*",
"16",
")",
":",
"to_read",
"=",
"self",
".",
"limit",
"-",
"self",
".",
"_pos",
"chunk",
"=",
"chunk_size",
"while",
"to_read",
">",
"0",
":",
"chunk",
"=",
"min",
"(",
"to_read",
... | Exhaust the stream. This consumes all the data left until the
limit is reached.
:param chunk_size: the size for a chunk. It will read the chunk
until the stream is exhausted and throw away
the results. | [
"Exhaust",
"the",
"stream",
".",
"This",
"consumes",
"all",
"the",
"data",
"left",
"until",
"the",
"limit",
"is",
"reached",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_wsgi.py#L85-L98 | train | This method exhausts the stream. |
core/uricore | uricore/wkz_wsgi.py | LimitedStream.read | def read(self, size=None):
"""Read `size` bytes or if size is not provided everything is read.
:param size: the number of bytes read.
"""
if self._pos >= self.limit:
return self.on_exhausted()
if size is None or size == -1: # -1 is for consistence with file
... | python | def read(self, size=None):
"""Read `size` bytes or if size is not provided everything is read.
:param size: the number of bytes read.
"""
if self._pos >= self.limit:
return self.on_exhausted()
if size is None or size == -1: # -1 is for consistence with file
... | [
"def",
"read",
"(",
"self",
",",
"size",
"=",
"None",
")",
":",
"if",
"self",
".",
"_pos",
">=",
"self",
".",
"limit",
":",
"return",
"self",
".",
"on_exhausted",
"(",
")",
"if",
"size",
"is",
"None",
"or",
"size",
"==",
"-",
"1",
":",
"# -1 is f... | Read `size` bytes or if size is not provided everything is read.
:param size: the number of bytes read. | [
"Read",
"size",
"bytes",
"or",
"if",
"size",
"is",
"not",
"provided",
"everything",
"is",
"read",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_wsgi.py#L100-L117 | train | Read size bytes or return None if there are no more data. |
core/uricore | uricore/wkz_wsgi.py | LimitedStream.readline | def readline(self, size=None):
"""Reads one line from the stream."""
if self._pos >= self.limit:
return self.on_exhausted()
if size is None:
size = self.limit - self._pos
else:
size = min(size, self.limit - self._pos)
try:
line = se... | python | def readline(self, size=None):
"""Reads one line from the stream."""
if self._pos >= self.limit:
return self.on_exhausted()
if size is None:
size = self.limit - self._pos
else:
size = min(size, self.limit - self._pos)
try:
line = se... | [
"def",
"readline",
"(",
"self",
",",
"size",
"=",
"None",
")",
":",
"if",
"self",
".",
"_pos",
">=",
"self",
".",
"limit",
":",
"return",
"self",
".",
"on_exhausted",
"(",
")",
"if",
"size",
"is",
"None",
":",
"size",
"=",
"self",
".",
"limit",
"... | Reads one line from the stream. | [
"Reads",
"one",
"line",
"from",
"the",
"stream",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_wsgi.py#L119-L134 | train | Reads one line from the stream. |
core/uricore | uricore/wkz_wsgi.py | LimitedStream.readlines | def readlines(self, size=None):
"""Reads a file into a list of strings. It calls :meth:`readline`
until the file is read to the end. It does support the optional
`size` argument if the underlaying stream supports it for
`readline`.
"""
last_pos = self._pos
resul... | python | def readlines(self, size=None):
"""Reads a file into a list of strings. It calls :meth:`readline`
until the file is read to the end. It does support the optional
`size` argument if the underlaying stream supports it for
`readline`.
"""
last_pos = self._pos
resul... | [
"def",
"readlines",
"(",
"self",
",",
"size",
"=",
"None",
")",
":",
"last_pos",
"=",
"self",
".",
"_pos",
"result",
"=",
"[",
"]",
"if",
"size",
"is",
"not",
"None",
":",
"end",
"=",
"min",
"(",
"self",
".",
"limit",
",",
"last_pos",
"+",
"size"... | Reads a file into a list of strings. It calls :meth:`readline`
until the file is read to the end. It does support the optional
`size` argument if the underlaying stream supports it for
`readline`. | [
"Reads",
"a",
"file",
"into",
"a",
"list",
"of",
"strings",
".",
"It",
"calls",
":",
"meth",
":",
"readline",
"until",
"the",
"file",
"is",
"read",
"to",
"the",
"end",
".",
"It",
"does",
"support",
"the",
"optional",
"size",
"argument",
"if",
"the",
... | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_wsgi.py#L136-L156 | train | Reads a file into a list of strings. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.