repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
bitesofcode/projexui | projexui/widgets/xtoolbar.py | XToolBar.refreshButton | def refreshButton(self):
"""
Refreshes the button for this toolbar.
"""
collapsed = self.isCollapsed()
btn = self._collapseButton
if not btn:
return
btn.setMaximumSize(MAX_SIZE, MAX_SIZE)
# set up a vertical... | python | def refreshButton(self):
"""
Refreshes the button for this toolbar.
"""
collapsed = self.isCollapsed()
btn = self._collapseButton
if not btn:
return
btn.setMaximumSize(MAX_SIZE, MAX_SIZE)
# set up a vertical... | [
"def",
"refreshButton",
"(",
"self",
")",
":",
"collapsed",
"=",
"self",
".",
"isCollapsed",
"(",
")",
"btn",
"=",
"self",
".",
"_collapseButton",
"if",
"not",
"btn",
":",
"return",
"btn",
".",
"setMaximumSize",
"(",
"MAX_SIZE",
",",
"MAX_SIZE",
")",
"if... | Refreshes the button for this toolbar. | [
"Refreshes",
"the",
"button",
"for",
"this",
"toolbar",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtoolbar.py#L138-L194 | train |
ubernostrum/django-soapbox | soapbox/models.py | MessageManager.match | def match(self, url):
"""
Return a list of all active Messages which match the given
URL.
"""
return list({
message for message in self.active() if
message.is_global or message.match(url)
}) | python | def match(self, url):
"""
Return a list of all active Messages which match the given
URL.
"""
return list({
message for message in self.active() if
message.is_global or message.match(url)
}) | [
"def",
"match",
"(",
"self",
",",
"url",
")",
":",
"return",
"list",
"(",
"{",
"message",
"for",
"message",
"in",
"self",
".",
"active",
"(",
")",
"if",
"message",
".",
"is_global",
"or",
"message",
".",
"match",
"(",
"url",
")",
"}",
")"
] | Return a list of all active Messages which match the given
URL. | [
"Return",
"a",
"list",
"of",
"all",
"active",
"Messages",
"which",
"match",
"the",
"given",
"URL",
"."
] | f9189e1ddf47175f2392b92c7a0a902817ee1e93 | https://github.com/ubernostrum/django-soapbox/blob/f9189e1ddf47175f2392b92c7a0a902817ee1e93/soapbox/models.py#L36-L45 | train |
bitesofcode/projexui | projexui/widgets/xchart/xchartdatasetitem.py | XChartDatasetItem.paint | def paint(self, painter, option, widget):
"""
Draws this item with the inputed painter. This will call the
scene's renderer to draw this item.
"""
scene = self.scene()
if not scene:
return
scene.chart().renderer().drawItem(self, pain... | python | def paint(self, painter, option, widget):
"""
Draws this item with the inputed painter. This will call the
scene's renderer to draw this item.
"""
scene = self.scene()
if not scene:
return
scene.chart().renderer().drawItem(self, pain... | [
"def",
"paint",
"(",
"self",
",",
"painter",
",",
"option",
",",
"widget",
")",
":",
"scene",
"=",
"self",
".",
"scene",
"(",
")",
"if",
"not",
"scene",
":",
"return",
"scene",
".",
"chart",
"(",
")",
".",
"renderer",
"(",
")",
".",
"drawItem",
"... | Draws this item with the inputed painter. This will call the
scene's renderer to draw this item. | [
"Draws",
"this",
"item",
"with",
"the",
"inputed",
"painter",
".",
"This",
"will",
"call",
"the",
"scene",
"s",
"renderer",
"to",
"draw",
"this",
"item",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchartdatasetitem.py#L78-L87 | train |
scottwoodall/python-pgextras | pgextras/__init__.py | PgExtras.is_pg_at_least_nine_two | def is_pg_at_least_nine_two(self):
"""
Some queries have different syntax depending what version of postgres
we are querying against.
:returns: boolean
"""
if self._is_pg_at_least_nine_two is None:
results = self.version()
regex = re.compile("Pos... | python | def is_pg_at_least_nine_two(self):
"""
Some queries have different syntax depending what version of postgres
we are querying against.
:returns: boolean
"""
if self._is_pg_at_least_nine_two is None:
results = self.version()
regex = re.compile("Pos... | [
"def",
"is_pg_at_least_nine_two",
"(",
"self",
")",
":",
"if",
"self",
".",
"_is_pg_at_least_nine_two",
"is",
"None",
":",
"results",
"=",
"self",
".",
"version",
"(",
")",
"regex",
"=",
"re",
".",
"compile",
"(",
"\"PostgreSQL (\\d+\\.\\d+\\.\\d+) on\"",
")",
... | Some queries have different syntax depending what version of postgres
we are querying against.
:returns: boolean | [
"Some",
"queries",
"have",
"different",
"syntax",
"depending",
"what",
"version",
"of",
"postgres",
"we",
"are",
"querying",
"against",
"."
] | d3aa83081d41b14b7c1f003cd837c812a2b5fff5 | https://github.com/scottwoodall/python-pgextras/blob/d3aa83081d41b14b7c1f003cd837c812a2b5fff5/pgextras/__init__.py#L104-L123 | train |
scottwoodall/python-pgextras | pgextras/__init__.py | PgExtras.execute | def execute(self, statement):
"""
Execute the given sql statement.
:param statement: sql statement to run
:returns: list
"""
# Make the sql statement easier to read in case some of the queries we
# run end up in the output
sql = statement.replace('\n', '... | python | def execute(self, statement):
"""
Execute the given sql statement.
:param statement: sql statement to run
:returns: list
"""
# Make the sql statement easier to read in case some of the queries we
# run end up in the output
sql = statement.replace('\n', '... | [
"def",
"execute",
"(",
"self",
",",
"statement",
")",
":",
"sql",
"=",
"statement",
".",
"replace",
"(",
"'\\n'",
",",
"''",
")",
"sql",
"=",
"' '",
".",
"join",
"(",
"sql",
".",
"split",
"(",
")",
")",
"self",
".",
"cursor",
".",
"execute",
"(",... | Execute the given sql statement.
:param statement: sql statement to run
:returns: list | [
"Execute",
"the",
"given",
"sql",
"statement",
"."
] | d3aa83081d41b14b7c1f003cd837c812a2b5fff5 | https://github.com/scottwoodall/python-pgextras/blob/d3aa83081d41b14b7c1f003cd837c812a2b5fff5/pgextras/__init__.py#L132-L146 | train |
scottwoodall/python-pgextras | pgextras/__init__.py | PgExtras.calls | def calls(self, truncate=False):
"""
Show 10 most frequently called queries. Requires the pg_stat_statements
Postgres module to be installed.
Record(
query='BEGIN;',
exec_time=datetime.timedelta(0, 0, 288174),
prop_exec_time='0.0%',
ncalls... | python | def calls(self, truncate=False):
"""
Show 10 most frequently called queries. Requires the pg_stat_statements
Postgres module to be installed.
Record(
query='BEGIN;',
exec_time=datetime.timedelta(0, 0, 288174),
prop_exec_time='0.0%',
ncalls... | [
"def",
"calls",
"(",
"self",
",",
"truncate",
"=",
"False",
")",
":",
"if",
"self",
".",
"pg_stat_statement",
"(",
")",
":",
"if",
"truncate",
":",
"select",
"=",
"else",
":",
"select",
"=",
"'SELECT query,'",
"return",
"self",
".",
"execute",
"(",
"sq... | Show 10 most frequently called queries. Requires the pg_stat_statements
Postgres module to be installed.
Record(
query='BEGIN;',
exec_time=datetime.timedelta(0, 0, 288174),
prop_exec_time='0.0%',
ncalls='845590',
sync_io_time=datetime.timedelt... | [
"Show",
"10",
"most",
"frequently",
"called",
"queries",
".",
"Requires",
"the",
"pg_stat_statements",
"Postgres",
"module",
"to",
"be",
"installed",
"."
] | d3aa83081d41b14b7c1f003cd837c812a2b5fff5 | https://github.com/scottwoodall/python-pgextras/blob/d3aa83081d41b14b7c1f003cd837c812a2b5fff5/pgextras/__init__.py#L177-L208 | train |
scottwoodall/python-pgextras | pgextras/__init__.py | PgExtras.blocking | def blocking(self):
"""
Display queries holding locks other queries are waiting to be
released.
Record(
pid=40821,
source='',
running_for=datetime.timedelta(0, 0, 2857),
waiting=False,
query='SELECT pg_sleep(10);'
)
... | python | def blocking(self):
"""
Display queries holding locks other queries are waiting to be
released.
Record(
pid=40821,
source='',
running_for=datetime.timedelta(0, 0, 2857),
waiting=False,
query='SELECT pg_sleep(10);'
)
... | [
"def",
"blocking",
"(",
"self",
")",
":",
"return",
"self",
".",
"execute",
"(",
"sql",
".",
"BLOCKING",
".",
"format",
"(",
"query_column",
"=",
"self",
".",
"query_column",
",",
"pid_column",
"=",
"self",
".",
"pid_column",
")",
")"
] | Display queries holding locks other queries are waiting to be
released.
Record(
pid=40821,
source='',
running_for=datetime.timedelta(0, 0, 2857),
waiting=False,
query='SELECT pg_sleep(10);'
)
:returns: list of Records | [
"Display",
"queries",
"holding",
"locks",
"other",
"queries",
"are",
"waiting",
"to",
"be",
"released",
"."
] | d3aa83081d41b14b7c1f003cd837c812a2b5fff5 | https://github.com/scottwoodall/python-pgextras/blob/d3aa83081d41b14b7c1f003cd837c812a2b5fff5/pgextras/__init__.py#L210-L231 | train |
scottwoodall/python-pgextras | pgextras/__init__.py | PgExtras.outliers | def outliers(self, truncate=False):
"""
Show 10 queries that have longest execution time in aggregate. Requires
the pg_stat_statments Postgres module to be installed.
Record(
qry='UPDATE pgbench_tellers SET tbalance = tbalance + ?;',
exec_time=datetime.timedelta(... | python | def outliers(self, truncate=False):
"""
Show 10 queries that have longest execution time in aggregate. Requires
the pg_stat_statments Postgres module to be installed.
Record(
qry='UPDATE pgbench_tellers SET tbalance = tbalance + ?;',
exec_time=datetime.timedelta(... | [
"def",
"outliers",
"(",
"self",
",",
"truncate",
"=",
"False",
")",
":",
"if",
"self",
".",
"pg_stat_statement",
"(",
")",
":",
"if",
"truncate",
":",
"query",
"=",
"else",
":",
"query",
"=",
"'query'",
"return",
"self",
".",
"execute",
"(",
"sql",
"... | Show 10 queries that have longest execution time in aggregate. Requires
the pg_stat_statments Postgres module to be installed.
Record(
qry='UPDATE pgbench_tellers SET tbalance = tbalance + ?;',
exec_time=datetime.timedelta(0, 19944, 993099),
prop_exec_time='67.1%',
... | [
"Show",
"10",
"queries",
"that",
"have",
"longest",
"execution",
"time",
"in",
"aggregate",
".",
"Requires",
"the",
"pg_stat_statments",
"Postgres",
"module",
"to",
"be",
"installed",
"."
] | d3aa83081d41b14b7c1f003cd837c812a2b5fff5 | https://github.com/scottwoodall/python-pgextras/blob/d3aa83081d41b14b7c1f003cd837c812a2b5fff5/pgextras/__init__.py#L233-L263 | train |
scottwoodall/python-pgextras | pgextras/__init__.py | PgExtras.long_running_queries | def long_running_queries(self):
"""
Show all queries longer than five minutes by descending duration.
Record(
pid=19578,
duration=datetime.timedelta(0, 19944, 993099),
query='SELECT * FROM students'
)
:returns: list of Records
"""
... | python | def long_running_queries(self):
"""
Show all queries longer than five minutes by descending duration.
Record(
pid=19578,
duration=datetime.timedelta(0, 19944, 993099),
query='SELECT * FROM students'
)
:returns: list of Records
"""
... | [
"def",
"long_running_queries",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_pg_at_least_nine_two",
"(",
")",
":",
"idle",
"=",
"\"AND state <> 'idle'\"",
"else",
":",
"idle",
"=",
"\"AND current_query <> '<IDLE>'\"",
"return",
"self",
".",
"execute",
"(",
"sql",
... | Show all queries longer than five minutes by descending duration.
Record(
pid=19578,
duration=datetime.timedelta(0, 19944, 993099),
query='SELECT * FROM students'
)
:returns: list of Records | [
"Show",
"all",
"queries",
"longer",
"than",
"five",
"minutes",
"by",
"descending",
"duration",
"."
] | d3aa83081d41b14b7c1f003cd837c812a2b5fff5 | https://github.com/scottwoodall/python-pgextras/blob/d3aa83081d41b14b7c1f003cd837c812a2b5fff5/pgextras/__init__.py#L303-L327 | train |
scottwoodall/python-pgextras | pgextras/__init__.py | PgExtras.locks | def locks(self):
"""
Display queries with active locks.
Record(
procpid=31776,
relname=None,
transactionid=None,
granted=True,
query_snippet='select * from hello;',
age=datetime.timedelta(0, 0, 288174),
)
:... | python | def locks(self):
"""
Display queries with active locks.
Record(
procpid=31776,
relname=None,
transactionid=None,
granted=True,
query_snippet='select * from hello;',
age=datetime.timedelta(0, 0, 288174),
)
:... | [
"def",
"locks",
"(",
"self",
")",
":",
"return",
"self",
".",
"execute",
"(",
"sql",
".",
"LOCKS",
".",
"format",
"(",
"pid_column",
"=",
"self",
".",
"pid_column",
",",
"query_column",
"=",
"self",
".",
"query_column",
")",
")"
] | Display queries with active locks.
Record(
procpid=31776,
relname=None,
transactionid=None,
granted=True,
query_snippet='select * from hello;',
age=datetime.timedelta(0, 0, 288174),
)
:returns: list of Records | [
"Display",
"queries",
"with",
"active",
"locks",
"."
] | d3aa83081d41b14b7c1f003cd837c812a2b5fff5 | https://github.com/scottwoodall/python-pgextras/blob/d3aa83081d41b14b7c1f003cd837c812a2b5fff5/pgextras/__init__.py#L422-L443 | train |
scottwoodall/python-pgextras | pgextras/__init__.py | PgExtras.ps | def ps(self):
"""
View active queries with execution time.
Record(
pid=28023,
source='pgbench',
running_for=datetime.timedelta(0, 0, 288174),
waiting=0,
query='UPDATE pgbench_accounts SET abalance = abalance + 423;'
)
... | python | def ps(self):
"""
View active queries with execution time.
Record(
pid=28023,
source='pgbench',
running_for=datetime.timedelta(0, 0, 288174),
waiting=0,
query='UPDATE pgbench_accounts SET abalance = abalance + 423;'
)
... | [
"def",
"ps",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_pg_at_least_nine_two",
"(",
")",
":",
"idle",
"=",
"\"AND state <> 'idle'\"",
"else",
":",
"idle",
"=",
"\"AND current_query <> '<IDLE>'\"",
"return",
"self",
".",
"execute",
"(",
"sql",
".",
"PS",
"... | View active queries with execution time.
Record(
pid=28023,
source='pgbench',
running_for=datetime.timedelta(0, 0, 288174),
waiting=0,
query='UPDATE pgbench_accounts SET abalance = abalance + 423;'
)
:returns: list of Records | [
"View",
"active",
"queries",
"with",
"execution",
"time",
"."
] | d3aa83081d41b14b7c1f003cd837c812a2b5fff5 | https://github.com/scottwoodall/python-pgextras/blob/d3aa83081d41b14b7c1f003cd837c812a2b5fff5/pgextras/__init__.py#L460-L486 | train |
intelsdi-x/snap-plugin-lib-py | examples/publisher/file.py | File.publish | def publish(self, metrics, config):
"""Publishes metrics to a file in JSON format.
This method is called by the Snap deamon during the collection phase
of the execution of a Snap workflow.
In this example we are writing the metrics to a file in json format.
We obtain the path t... | python | def publish(self, metrics, config):
"""Publishes metrics to a file in JSON format.
This method is called by the Snap deamon during the collection phase
of the execution of a Snap workflow.
In this example we are writing the metrics to a file in json format.
We obtain the path t... | [
"def",
"publish",
"(",
"self",
",",
"metrics",
",",
"config",
")",
":",
"if",
"len",
"(",
"metrics",
")",
">",
"0",
":",
"with",
"open",
"(",
"config",
"[",
"\"file\"",
"]",
",",
"'a'",
")",
"as",
"outfile",
":",
"for",
"metric",
"in",
"metrics",
... | Publishes metrics to a file in JSON format.
This method is called by the Snap deamon during the collection phase
of the execution of a Snap workflow.
In this example we are writing the metrics to a file in json format.
We obtain the path to the file through the config (`ConfigMap`) arg... | [
"Publishes",
"metrics",
"to",
"a",
"file",
"in",
"JSON",
"format",
"."
] | 8da5d00ac5f9d2b48a7239563ac7788209891ca4 | https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/examples/publisher/file.py#L37-L59 | train |
neithere/eav-django | eav/forms.py | BaseSchemaForm.clean_name | def clean_name(self):
"Avoid name clashes between static and dynamic attributes."
name = self.cleaned_data['name']
reserved_names = self._meta.model._meta.get_all_field_names()
if name not in reserved_names:
return name
raise ValidationError(_('Attribute name must not... | python | def clean_name(self):
"Avoid name clashes between static and dynamic attributes."
name = self.cleaned_data['name']
reserved_names = self._meta.model._meta.get_all_field_names()
if name not in reserved_names:
return name
raise ValidationError(_('Attribute name must not... | [
"def",
"clean_name",
"(",
"self",
")",
":",
"\"Avoid name clashes between static and dynamic attributes.\"",
"name",
"=",
"self",
".",
"cleaned_data",
"[",
"'name'",
"]",
"reserved_names",
"=",
"self",
".",
"_meta",
".",
"model",
".",
"_meta",
".",
"get_all_field_na... | Avoid name clashes between static and dynamic attributes. | [
"Avoid",
"name",
"clashes",
"between",
"static",
"and",
"dynamic",
"attributes",
"."
] | 7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7 | https://github.com/neithere/eav-django/blob/7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7/eav/forms.py#L40-L47 | train |
neithere/eav-django | eav/forms.py | BaseDynamicEntityForm.save | def save(self, commit=True):
"""
Saves this ``form``'s cleaned_data into model instance ``self.instance``
and related EAV attributes.
Returns ``instance``.
"""
if self.errors:
raise ValueError("The %s could not be saved because the data didn't"
... | python | def save(self, commit=True):
"""
Saves this ``form``'s cleaned_data into model instance ``self.instance``
and related EAV attributes.
Returns ``instance``.
"""
if self.errors:
raise ValueError("The %s could not be saved because the data didn't"
... | [
"def",
"save",
"(",
"self",
",",
"commit",
"=",
"True",
")",
":",
"if",
"self",
".",
"errors",
":",
"raise",
"ValueError",
"(",
"\"The %s could not be saved because the data didn't\"",
"\" validate.\"",
"%",
"self",
".",
"instance",
".",
"_meta",
".",
"object_na... | Saves this ``form``'s cleaned_data into model instance ``self.instance``
and related EAV attributes.
Returns ``instance``. | [
"Saves",
"this",
"form",
"s",
"cleaned_data",
"into",
"model",
"instance",
"self",
".",
"instance",
"and",
"related",
"EAV",
"attributes",
"."
] | 7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7 | https://github.com/neithere/eav-django/blob/7f2e9fe17bbe740622cfb38f6ce0e8413b7da3d7/eav/forms.py#L122-L146 | train |
bitesofcode/projexui | projexui/completers/xorbsearchcompleter.py | XOrbSearchCompleter.refresh | def refresh(self):
"""
Refreshes the contents of the completer based on the current text.
"""
table = self.tableType()
search = nativestring(self._pywidget.text())
if search == self._lastSearch:
return
self._lastSearch = search
... | python | def refresh(self):
"""
Refreshes the contents of the completer based on the current text.
"""
table = self.tableType()
search = nativestring(self._pywidget.text())
if search == self._lastSearch:
return
self._lastSearch = search
... | [
"def",
"refresh",
"(",
"self",
")",
":",
"table",
"=",
"self",
".",
"tableType",
"(",
")",
"search",
"=",
"nativestring",
"(",
"self",
".",
"_pywidget",
".",
"text",
"(",
")",
")",
"if",
"search",
"==",
"self",
".",
"_lastSearch",
":",
"return",
"sel... | Refreshes the contents of the completer based on the current text. | [
"Refreshes",
"the",
"contents",
"of",
"the",
"completer",
"based",
"on",
"the",
"current",
"text",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/completers/xorbsearchcompleter.py#L130-L153 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xview.py | XView.initialize | def initialize(self, force=False):
"""
Initializes the view if it is visible or being loaded.
"""
if force or (self.isVisible() and \
not self.isInitialized() and \
not self.signalsBlocked()):
self._initialized = True
... | python | def initialize(self, force=False):
"""
Initializes the view if it is visible or being loaded.
"""
if force or (self.isVisible() and \
not self.isInitialized() and \
not self.signalsBlocked()):
self._initialized = True
... | [
"def",
"initialize",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"if",
"force",
"or",
"(",
"self",
".",
"isVisible",
"(",
")",
"and",
"not",
"self",
".",
"isInitialized",
"(",
")",
"and",
"not",
"self",
".",
"signalsBlocked",
"(",
")",
")",
... | Initializes the view if it is visible or being loaded. | [
"Initializes",
"the",
"view",
"if",
"it",
"is",
"visible",
"or",
"being",
"loaded",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xview.py#L321-L330 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xview.py | XView.destroySingleton | def destroySingleton(cls):
"""
Destroys the singleton instance of this class, if one exists.
"""
singleton_key = '_{0}__singleton'.format(cls.__name__)
singleton = getattr(cls, singleton_key, None)
if singleton is not None:
setattr(cls, singleton_key,... | python | def destroySingleton(cls):
"""
Destroys the singleton instance of this class, if one exists.
"""
singleton_key = '_{0}__singleton'.format(cls.__name__)
singleton = getattr(cls, singleton_key, None)
if singleton is not None:
setattr(cls, singleton_key,... | [
"def",
"destroySingleton",
"(",
"cls",
")",
":",
"singleton_key",
"=",
"'_{0}__singleton'",
".",
"format",
"(",
"cls",
".",
"__name__",
")",
"singleton",
"=",
"getattr",
"(",
"cls",
",",
"singleton_key",
",",
"None",
")",
"if",
"singleton",
"is",
"not",
"N... | Destroys the singleton instance of this class, if one exists. | [
"Destroys",
"the",
"singleton",
"instance",
"of",
"this",
"class",
"if",
"one",
"exists",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xview.py#L739-L750 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywidget.py | XOverlayWidget.adjustSize | def adjustSize(self):
"""
Adjusts the size of this widget as the parent resizes.
"""
# adjust the close button
align = self.closeAlignment()
if align & QtCore.Qt.AlignTop:
y = 6
else:
y = self.height() - 38
if align & QtCore.Qt.Ali... | python | def adjustSize(self):
"""
Adjusts the size of this widget as the parent resizes.
"""
# adjust the close button
align = self.closeAlignment()
if align & QtCore.Qt.AlignTop:
y = 6
else:
y = self.height() - 38
if align & QtCore.Qt.Ali... | [
"def",
"adjustSize",
"(",
"self",
")",
":",
"align",
"=",
"self",
".",
"closeAlignment",
"(",
")",
"if",
"align",
"&",
"QtCore",
".",
"Qt",
".",
"AlignTop",
":",
"y",
"=",
"6",
"else",
":",
"y",
"=",
"self",
".",
"height",
"(",
")",
"-",
"38",
... | Adjusts the size of this widget as the parent resizes. | [
"Adjusts",
"the",
"size",
"of",
"this",
"widget",
"as",
"the",
"parent",
"resizes",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywidget.py#L48-L70 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywidget.py | XOverlayWidget.keyPressEvent | def keyPressEvent(self, event):
"""
Exits the modal window on an escape press.
:param event | <QtCore.QKeyPressEvent>
"""
if event.key() == QtCore.Qt.Key_Escape:
self.reject()
super(XOverlayWidget, self).keyPressEvent(event) | python | def keyPressEvent(self, event):
"""
Exits the modal window on an escape press.
:param event | <QtCore.QKeyPressEvent>
"""
if event.key() == QtCore.Qt.Key_Escape:
self.reject()
super(XOverlayWidget, self).keyPressEvent(event) | [
"def",
"keyPressEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"key",
"(",
")",
"==",
"QtCore",
".",
"Qt",
".",
"Key_Escape",
":",
"self",
".",
"reject",
"(",
")",
"super",
"(",
"XOverlayWidget",
",",
"self",
")",
".",
"keyPressEven... | Exits the modal window on an escape press.
:param event | <QtCore.QKeyPressEvent> | [
"Exits",
"the",
"modal",
"window",
"on",
"an",
"escape",
"press",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywidget.py#L97-L106 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywidget.py | XOverlayWidget.eventFilter | def eventFilter(self, object, event):
"""
Resizes this overlay as the widget resizes.
:param object | <QtCore.QObject>
event | <QtCore.QEvent>
:return <bool>
"""
if object == self.parent() and event.type() == QtCore.QEvent.Resize:
... | python | def eventFilter(self, object, event):
"""
Resizes this overlay as the widget resizes.
:param object | <QtCore.QObject>
event | <QtCore.QEvent>
:return <bool>
"""
if object == self.parent() and event.type() == QtCore.QEvent.Resize:
... | [
"def",
"eventFilter",
"(",
"self",
",",
"object",
",",
"event",
")",
":",
"if",
"object",
"==",
"self",
".",
"parent",
"(",
")",
"and",
"event",
".",
"type",
"(",
")",
"==",
"QtCore",
".",
"QEvent",
".",
"Resize",
":",
"self",
".",
"resize",
"(",
... | Resizes this overlay as the widget resizes.
:param object | <QtCore.QObject>
event | <QtCore.QEvent>
:return <bool> | [
"Resizes",
"this",
"overlay",
"as",
"the",
"widget",
"resizes",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywidget.py#L108-L121 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywidget.py | XOverlayWidget.resizeEvent | def resizeEvent(self, event):
"""
Handles a resize event for this overlay, centering the central widget if
one is found.
:param event | <QtCore.QEvent>
"""
super(XOverlayWidget, self).resizeEvent(event)
self.adjustSize() | python | def resizeEvent(self, event):
"""
Handles a resize event for this overlay, centering the central widget if
one is found.
:param event | <QtCore.QEvent>
"""
super(XOverlayWidget, self).resizeEvent(event)
self.adjustSize() | [
"def",
"resizeEvent",
"(",
"self",
",",
"event",
")",
":",
"super",
"(",
"XOverlayWidget",
",",
"self",
")",
".",
"resizeEvent",
"(",
"event",
")",
"self",
".",
"adjustSize",
"(",
")"
] | Handles a resize event for this overlay, centering the central widget if
one is found.
:param event | <QtCore.QEvent> | [
"Handles",
"a",
"resize",
"event",
"for",
"this",
"overlay",
"centering",
"the",
"central",
"widget",
"if",
"one",
"is",
"found",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywidget.py#L153-L161 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywidget.py | XOverlayWidget.setCentralWidget | def setCentralWidget(self, widget):
"""
Sets the central widget for this overlay to the inputed widget.
:param widget | <QtGui.QWidget>
"""
self._centralWidget = widget
if widget is not None:
widget.setParent(self)
widget.installEventFilter... | python | def setCentralWidget(self, widget):
"""
Sets the central widget for this overlay to the inputed widget.
:param widget | <QtGui.QWidget>
"""
self._centralWidget = widget
if widget is not None:
widget.setParent(self)
widget.installEventFilter... | [
"def",
"setCentralWidget",
"(",
"self",
",",
"widget",
")",
":",
"self",
".",
"_centralWidget",
"=",
"widget",
"if",
"widget",
"is",
"not",
"None",
":",
"widget",
".",
"setParent",
"(",
"self",
")",
"widget",
".",
"installEventFilter",
"(",
"self",
")",
... | Sets the central widget for this overlay to the inputed widget.
:param widget | <QtGui.QWidget> | [
"Sets",
"the",
"central",
"widget",
"for",
"this",
"overlay",
"to",
"the",
"inputed",
"widget",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywidget.py#L163-L181 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywidget.py | XOverlayWidget.setClosable | def setClosable(self, state):
"""
Sets whether or not the user should be able to close this overlay widget.
:param state | <bool>
"""
self._closable = state
if state:
self._closeButton.show()
else:
self._closeButton.hide() | python | def setClosable(self, state):
"""
Sets whether or not the user should be able to close this overlay widget.
:param state | <bool>
"""
self._closable = state
if state:
self._closeButton.show()
else:
self._closeButton.hide() | [
"def",
"setClosable",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_closable",
"=",
"state",
"if",
"state",
":",
"self",
".",
"_closeButton",
".",
"show",
"(",
")",
"else",
":",
"self",
".",
"_closeButton",
".",
"hide",
"(",
")"
] | Sets whether or not the user should be able to close this overlay widget.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"the",
"user",
"should",
"be",
"able",
"to",
"close",
"this",
"overlay",
"widget",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywidget.py#L183-L193 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywidget.py | XOverlayWidget.setVisible | def setVisible(self, state):
"""
Closes this widget and kills the result.
"""
super(XOverlayWidget, self).setVisible(state)
if not state:
self.setResult(0) | python | def setVisible(self, state):
"""
Closes this widget and kills the result.
"""
super(XOverlayWidget, self).setVisible(state)
if not state:
self.setResult(0) | [
"def",
"setVisible",
"(",
"self",
",",
"state",
")",
":",
"super",
"(",
"XOverlayWidget",
",",
"self",
")",
".",
"setVisible",
"(",
"state",
")",
"if",
"not",
"state",
":",
"self",
".",
"setResult",
"(",
"0",
")"
] | Closes this widget and kills the result. | [
"Closes",
"this",
"widget",
"and",
"kills",
"the",
"result",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywidget.py#L211-L218 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywidget.py | XOverlayWidget.showEvent | def showEvent(self, event):
"""
Ensures this widget is the top-most widget for its parent.
:param event | <QtCore.QEvent>
"""
super(XOverlayWidget, self).showEvent(event)
# raise to the top
self.raise_()
self._closeButton.setVisible(self.isClosable(... | python | def showEvent(self, event):
"""
Ensures this widget is the top-most widget for its parent.
:param event | <QtCore.QEvent>
"""
super(XOverlayWidget, self).showEvent(event)
# raise to the top
self.raise_()
self._closeButton.setVisible(self.isClosable(... | [
"def",
"showEvent",
"(",
"self",
",",
"event",
")",
":",
"super",
"(",
"XOverlayWidget",
",",
"self",
")",
".",
"showEvent",
"(",
"event",
")",
"self",
".",
"raise_",
"(",
")",
"self",
".",
"_closeButton",
".",
"setVisible",
"(",
"self",
".",
"isClosab... | Ensures this widget is the top-most widget for its parent.
:param event | <QtCore.QEvent> | [
"Ensures",
"this",
"widget",
"is",
"the",
"top",
"-",
"most",
"widget",
"for",
"its",
"parent",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywidget.py#L220-L251 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywidget.py | XOverlayWidget.modal | def modal(widget, parent=None, align=QtCore.Qt.AlignTop | QtCore.Qt.AlignRight, blurred=True):
"""
Creates a modal dialog for this overlay with the inputed widget. If the user
accepts the widget, then 1 will be returned, otherwise, 0 will be returned.
:param widget | <QtCore.QWidg... | python | def modal(widget, parent=None, align=QtCore.Qt.AlignTop | QtCore.Qt.AlignRight, blurred=True):
"""
Creates a modal dialog for this overlay with the inputed widget. If the user
accepts the widget, then 1 will be returned, otherwise, 0 will be returned.
:param widget | <QtCore.QWidg... | [
"def",
"modal",
"(",
"widget",
",",
"parent",
"=",
"None",
",",
"align",
"=",
"QtCore",
".",
"Qt",
".",
"AlignTop",
"|",
"QtCore",
".",
"Qt",
".",
"AlignRight",
",",
"blurred",
"=",
"True",
")",
":",
"if",
"parent",
"is",
"None",
":",
"parent",
"="... | Creates a modal dialog for this overlay with the inputed widget. If the user
accepts the widget, then 1 will be returned, otherwise, 0 will be returned.
:param widget | <QtCore.QWidget> | [
"Creates",
"a",
"modal",
"dialog",
"for",
"this",
"overlay",
"with",
"the",
"inputed",
"widget",
".",
"If",
"the",
"user",
"accepts",
"the",
"widget",
"then",
"1",
"will",
"be",
"returned",
"otherwise",
"0",
"will",
"be",
"returned",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywidget.py#L254-L269 | train |
bitesofcode/projexui | projexui/widgets/xconsoleedit.py | XConsoleEdit.applyCommand | def applyCommand(self):
"""
Applies the current line of code as an interactive python command.
"""
# generate the command information
cursor = self.textCursor()
cursor.movePosition(cursor.EndOfLine)
line = projex.text.nativestring(curs... | python | def applyCommand(self):
"""
Applies the current line of code as an interactive python command.
"""
# generate the command information
cursor = self.textCursor()
cursor.movePosition(cursor.EndOfLine)
line = projex.text.nativestring(curs... | [
"def",
"applyCommand",
"(",
"self",
")",
":",
"cursor",
"=",
"self",
".",
"textCursor",
"(",
")",
"cursor",
".",
"movePosition",
"(",
"cursor",
".",
"EndOfLine",
")",
"line",
"=",
"projex",
".",
"text",
".",
"nativestring",
"(",
"cursor",
".",
"block",
... | Applies the current line of code as an interactive python command. | [
"Applies",
"the",
"current",
"line",
"of",
"code",
"as",
"an",
"interactive",
"python",
"command",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xconsoleedit.py#L198-L277 | train |
bitesofcode/projexui | projexui/widgets/xconsoleedit.py | XConsoleEdit.gotoHome | def gotoHome(self):
"""
Navigates to the home position for the edit.
"""
mode = QTextCursor.MoveAnchor
# select the home
if QApplication.instance().keyboardModifiers() == Qt.ShiftModifier:
mode = QTextCursor.KeepAnchor
curso... | python | def gotoHome(self):
"""
Navigates to the home position for the edit.
"""
mode = QTextCursor.MoveAnchor
# select the home
if QApplication.instance().keyboardModifiers() == Qt.ShiftModifier:
mode = QTextCursor.KeepAnchor
curso... | [
"def",
"gotoHome",
"(",
"self",
")",
":",
"mode",
"=",
"QTextCursor",
".",
"MoveAnchor",
"if",
"QApplication",
".",
"instance",
"(",
")",
".",
"keyboardModifiers",
"(",
")",
"==",
"Qt",
".",
"ShiftModifier",
":",
"mode",
"=",
"QTextCursor",
".",
"KeepAncho... | Navigates to the home position for the edit. | [
"Navigates",
"to",
"the",
"home",
"position",
"for",
"the",
"edit",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xconsoleedit.py#L452-L472 | train |
bitesofcode/projexui | projexui/widgets/xconsoleedit.py | XConsoleEdit.waitForInput | def waitForInput(self):
"""
Inserts a new input command into the console editor.
"""
self._waitingForInput = False
try:
if self.isDestroyed() or self.isReadOnly():
return
except RuntimeError:
return
... | python | def waitForInput(self):
"""
Inserts a new input command into the console editor.
"""
self._waitingForInput = False
try:
if self.isDestroyed() or self.isReadOnly():
return
except RuntimeError:
return
... | [
"def",
"waitForInput",
"(",
"self",
")",
":",
"self",
".",
"_waitingForInput",
"=",
"False",
"try",
":",
"if",
"self",
".",
"isDestroyed",
"(",
")",
"or",
"self",
".",
"isReadOnly",
"(",
")",
":",
"return",
"except",
"RuntimeError",
":",
"return",
"self"... | Inserts a new input command into the console editor. | [
"Inserts",
"a",
"new",
"input",
"command",
"into",
"the",
"console",
"editor",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xconsoleedit.py#L771-L797 | train |
bitesofcode/projexui | projexui/dialogs/xconfigdialog/xconfigdialog.py | XConfigDialog.accept | def accept( self ):
"""
Saves all the current widgets and closes down.
"""
for i in range(self.uiConfigSTACK.count()):
widget = self.uiConfigSTACK.widget(i)
if ( not widget ):
continue
if ( not widget.save() ):
... | python | def accept( self ):
"""
Saves all the current widgets and closes down.
"""
for i in range(self.uiConfigSTACK.count()):
widget = self.uiConfigSTACK.widget(i)
if ( not widget ):
continue
if ( not widget.save() ):
... | [
"def",
"accept",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"uiConfigSTACK",
".",
"count",
"(",
")",
")",
":",
"widget",
"=",
"self",
".",
"uiConfigSTACK",
".",
"widget",
"(",
"i",
")",
"if",
"(",
"not",
"widget",
")",
":... | Saves all the current widgets and closes down. | [
"Saves",
"all",
"the",
"current",
"widgets",
"and",
"closes",
"down",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xconfigdialog/xconfigdialog.py#L71-L95 | train |
bitesofcode/projexui | projexui/dialogs/xconfigdialog/xconfigdialog.py | XConfigDialog.reject | def reject( self ):
"""
Overloads the reject method to clear up the instance variable.
"""
if ( self == XConfigDialog._instance ):
XConfigDialog._instance = None
super(XConfigDialog, self).reject() | python | def reject( self ):
"""
Overloads the reject method to clear up the instance variable.
"""
if ( self == XConfigDialog._instance ):
XConfigDialog._instance = None
super(XConfigDialog, self).reject() | [
"def",
"reject",
"(",
"self",
")",
":",
"if",
"(",
"self",
"==",
"XConfigDialog",
".",
"_instance",
")",
":",
"XConfigDialog",
".",
"_instance",
"=",
"None",
"super",
"(",
"XConfigDialog",
",",
"self",
")",
".",
"reject",
"(",
")"
] | Overloads the reject method to clear up the instance variable. | [
"Overloads",
"the",
"reject",
"method",
"to",
"clear",
"up",
"the",
"instance",
"variable",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xconfigdialog/xconfigdialog.py#L127-L134 | train |
bitesofcode/projexui | projexui/dialogs/xconfigdialog/xconfigdialog.py | XConfigDialog.showConfig | def showConfig( self ):
"""
Show the config widget for the currently selected plugin.
"""
item = self.uiPluginTREE.currentItem()
if not isinstance(item, PluginItem):
return
plugin = item.plugin()
widget = self.findChild(QWidget, plugin.uniqueN... | python | def showConfig( self ):
"""
Show the config widget for the currently selected plugin.
"""
item = self.uiPluginTREE.currentItem()
if not isinstance(item, PluginItem):
return
plugin = item.plugin()
widget = self.findChild(QWidget, plugin.uniqueN... | [
"def",
"showConfig",
"(",
"self",
")",
":",
"item",
"=",
"self",
".",
"uiPluginTREE",
".",
"currentItem",
"(",
")",
"if",
"not",
"isinstance",
"(",
"item",
",",
"PluginItem",
")",
":",
"return",
"plugin",
"=",
"item",
".",
"plugin",
"(",
")",
"widget",... | Show the config widget for the currently selected plugin. | [
"Show",
"the",
"config",
"widget",
"for",
"the",
"currently",
"selected",
"plugin",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xconfigdialog/xconfigdialog.py#L209-L225 | train |
talkincode/txradius | txradius/openvpn/client_kill.py | cli | def cli(server,port,client):
""" OpenVPN client_kill method
"""
tn = telnetlib.Telnet(host=server,port=port)
tn.write('kill %s\n'%client.encode('utf-8'))
tn.write('exit\n')
os._exit(0) | python | def cli(server,port,client):
""" OpenVPN client_kill method
"""
tn = telnetlib.Telnet(host=server,port=port)
tn.write('kill %s\n'%client.encode('utf-8'))
tn.write('exit\n')
os._exit(0) | [
"def",
"cli",
"(",
"server",
",",
"port",
",",
"client",
")",
":",
"tn",
"=",
"telnetlib",
".",
"Telnet",
"(",
"host",
"=",
"server",
",",
"port",
"=",
"port",
")",
"tn",
".",
"write",
"(",
"'kill %s\\n'",
"%",
"client",
".",
"encode",
"(",
"'utf-8... | OpenVPN client_kill method | [
"OpenVPN",
"client_kill",
"method"
] | b86fdbc9be41183680b82b07d3a8e8ea10926e01 | https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/openvpn/client_kill.py#L11-L17 | train |
bitesofcode/projexui | projexui/widgets/xtabwidget.py | XTabWidget.adjustButtons | def adjustButtons( self ):
"""
Updates the position of the buttons based on the current geometry.
"""
tabbar = self.tabBar()
tabbar.adjustSize()
w = self.width() - self._optionsButton.width() - 2
self._optionsButton.move(w, 0)
if self... | python | def adjustButtons( self ):
"""
Updates the position of the buttons based on the current geometry.
"""
tabbar = self.tabBar()
tabbar.adjustSize()
w = self.width() - self._optionsButton.width() - 2
self._optionsButton.move(w, 0)
if self... | [
"def",
"adjustButtons",
"(",
"self",
")",
":",
"tabbar",
"=",
"self",
".",
"tabBar",
"(",
")",
"tabbar",
".",
"adjustSize",
"(",
")",
"w",
"=",
"self",
".",
"width",
"(",
")",
"-",
"self",
".",
"_optionsButton",
".",
"width",
"(",
")",
"-",
"2",
... | Updates the position of the buttons based on the current geometry. | [
"Updates",
"the",
"position",
"of",
"the",
"buttons",
"based",
"on",
"the",
"current",
"geometry",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtabwidget.py#L101-L131 | train |
viatoriche/microservices | microservices/queues/client.py | _exchange.publish | def publish(self, message, routing_key=None):
"""Publish message to exchange
:param message: message for publishing
:type message: any serializable object
:param routing_key: routing key for queue
:return: None
"""
if routing_key is None:
routing_key ... | python | def publish(self, message, routing_key=None):
"""Publish message to exchange
:param message: message for publishing
:type message: any serializable object
:param routing_key: routing key for queue
:return: None
"""
if routing_key is None:
routing_key ... | [
"def",
"publish",
"(",
"self",
",",
"message",
",",
"routing_key",
"=",
"None",
")",
":",
"if",
"routing_key",
"is",
"None",
":",
"routing_key",
"=",
"self",
".",
"routing_key",
"return",
"self",
".",
"client",
".",
"publish_to_exchange",
"(",
"self",
".",... | Publish message to exchange
:param message: message for publishing
:type message: any serializable object
:param routing_key: routing key for queue
:return: None | [
"Publish",
"message",
"to",
"exchange"
] | 3510563edd15dc6131b8a948d6062856cd904ac7 | https://github.com/viatoriche/microservices/blob/3510563edd15dc6131b8a948d6062856cd904ac7/microservices/queues/client.py#L32-L42 | train |
viatoriche/microservices | microservices/queues/client.py | _queue.publish | def publish(self, message):
"""Publish message to queue
:param message: message for publishing
:type message: any serializable object
:return: None
"""
return self.client.publish_to_queue(self.name, message=message) | python | def publish(self, message):
"""Publish message to queue
:param message: message for publishing
:type message: any serializable object
:return: None
"""
return self.client.publish_to_queue(self.name, message=message) | [
"def",
"publish",
"(",
"self",
",",
"message",
")",
":",
"return",
"self",
".",
"client",
".",
"publish_to_queue",
"(",
"self",
".",
"name",
",",
"message",
"=",
"message",
")"
] | Publish message to queue
:param message: message for publishing
:type message: any serializable object
:return: None | [
"Publish",
"message",
"to",
"queue"
] | 3510563edd15dc6131b8a948d6062856cd904ac7 | https://github.com/viatoriche/microservices/blob/3510563edd15dc6131b8a948d6062856cd904ac7/microservices/queues/client.py#L63-L70 | train |
bitesofcode/projexui | projexui/widgets/xpopupwidget.py | XPopupWidget.adjustContentsMargins | def adjustContentsMargins( self ):
"""
Adjusts the contents for this widget based on the anchor and \
mode.
"""
anchor = self.anchor()
mode = self.currentMode()
# margins for a dialog
if ( mode == XPopupWidget.Mode.Dialog ):
... | python | def adjustContentsMargins( self ):
"""
Adjusts the contents for this widget based on the anchor and \
mode.
"""
anchor = self.anchor()
mode = self.currentMode()
# margins for a dialog
if ( mode == XPopupWidget.Mode.Dialog ):
... | [
"def",
"adjustContentsMargins",
"(",
"self",
")",
":",
"anchor",
"=",
"self",
".",
"anchor",
"(",
")",
"mode",
"=",
"self",
".",
"currentMode",
"(",
")",
"if",
"(",
"mode",
"==",
"XPopupWidget",
".",
"Mode",
".",
"Dialog",
")",
":",
"self",
".",
"set... | Adjusts the contents for this widget based on the anchor and \
mode. | [
"Adjusts",
"the",
"contents",
"for",
"this",
"widget",
"based",
"on",
"the",
"anchor",
"and",
"\\",
"mode",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xpopupwidget.py#L188-L222 | train |
bitesofcode/projexui | projexui/widgets/xpopupwidget.py | XPopupWidget.adjustMask | def adjustMask(self):
"""
Updates the alpha mask for this popup widget.
"""
if self.currentMode() == XPopupWidget.Mode.Dialog:
self.clearMask()
return
path = self.borderPath()
bitmap = QBitmap(self.width(), self.height())
... | python | def adjustMask(self):
"""
Updates the alpha mask for this popup widget.
"""
if self.currentMode() == XPopupWidget.Mode.Dialog:
self.clearMask()
return
path = self.borderPath()
bitmap = QBitmap(self.width(), self.height())
... | [
"def",
"adjustMask",
"(",
"self",
")",
":",
"if",
"self",
".",
"currentMode",
"(",
")",
"==",
"XPopupWidget",
".",
"Mode",
".",
"Dialog",
":",
"self",
".",
"clearMask",
"(",
")",
"return",
"path",
"=",
"self",
".",
"borderPath",
"(",
")",
"bitmap",
"... | Updates the alpha mask for this popup widget. | [
"Updates",
"the",
"alpha",
"mask",
"for",
"this",
"popup",
"widget",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xpopupwidget.py#L224-L244 | train |
bitesofcode/projexui | projexui/widgets/xpopupwidget.py | XPopupWidget.adjustSize | def adjustSize(self):
"""
Adjusts the size of this popup to best fit the new widget size.
"""
widget = self.centralWidget()
if widget is None:
super(XPopupWidget, self).adjustSize()
return
widget.adjustSize()
hint = widge... | python | def adjustSize(self):
"""
Adjusts the size of this popup to best fit the new widget size.
"""
widget = self.centralWidget()
if widget is None:
super(XPopupWidget, self).adjustSize()
return
widget.adjustSize()
hint = widge... | [
"def",
"adjustSize",
"(",
"self",
")",
":",
"widget",
"=",
"self",
".",
"centralWidget",
"(",
")",
"if",
"widget",
"is",
"None",
":",
"super",
"(",
"XPopupWidget",
",",
"self",
")",
".",
"adjustSize",
"(",
")",
"return",
"widget",
".",
"adjustSize",
"(... | Adjusts the size of this popup to best fit the new widget size. | [
"Adjusts",
"the",
"size",
"of",
"this",
"popup",
"to",
"best",
"fit",
"the",
"new",
"widget",
"size",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xpopupwidget.py#L246-L305 | train |
bitesofcode/projexui | projexui/widgets/xpopupwidget.py | XPopupWidget.close | def close(self):
"""
Closes the popup widget and central widget.
"""
widget = self.centralWidget()
if widget and not widget.close():
return
super(XPopupWidget, self).close() | python | def close(self):
"""
Closes the popup widget and central widget.
"""
widget = self.centralWidget()
if widget and not widget.close():
return
super(XPopupWidget, self).close() | [
"def",
"close",
"(",
"self",
")",
":",
"widget",
"=",
"self",
".",
"centralWidget",
"(",
")",
"if",
"widget",
"and",
"not",
"widget",
".",
"close",
"(",
")",
":",
"return",
"super",
"(",
"XPopupWidget",
",",
"self",
")",
".",
"close",
"(",
")"
] | Closes the popup widget and central widget. | [
"Closes",
"the",
"popup",
"widget",
"and",
"central",
"widget",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xpopupwidget.py#L530-L538 | train |
bitesofcode/projexui | projexui/widgets/xpageswidget.py | XPagesWidget.refreshLabels | def refreshLabels( self ):
"""
Refreshes the labels to display the proper title and count information.
"""
itemCount = self.itemCount()
title = self.itemsTitle()
if ( not itemCount ):
self._itemsLabel.setText(' %s per page' % title)
e... | python | def refreshLabels( self ):
"""
Refreshes the labels to display the proper title and count information.
"""
itemCount = self.itemCount()
title = self.itemsTitle()
if ( not itemCount ):
self._itemsLabel.setText(' %s per page' % title)
e... | [
"def",
"refreshLabels",
"(",
"self",
")",
":",
"itemCount",
"=",
"self",
".",
"itemCount",
"(",
")",
"title",
"=",
"self",
".",
"itemsTitle",
"(",
")",
"if",
"(",
"not",
"itemCount",
")",
":",
"self",
".",
"_itemsLabel",
".",
"setText",
"(",
"' %s per ... | Refreshes the labels to display the proper title and count information. | [
"Refreshes",
"the",
"labels",
"to",
"display",
"the",
"proper",
"title",
"and",
"count",
"information",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xpageswidget.py#L207-L218 | train |
mikhaildubov/AST-text-analysis | east/utils.py | import_modules_from_package | def import_modules_from_package(package):
"""Import modules from package and append into sys.modules
:param package: full package name, e.g. east.asts
"""
path = [os.path.dirname(__file__), '..'] + package.split('.')
path = os.path.join(*path)
for root, dirs, files in os.walk(path):
for... | python | def import_modules_from_package(package):
"""Import modules from package and append into sys.modules
:param package: full package name, e.g. east.asts
"""
path = [os.path.dirname(__file__), '..'] + package.split('.')
path = os.path.join(*path)
for root, dirs, files in os.walk(path):
for... | [
"def",
"import_modules_from_package",
"(",
"package",
")",
":",
"path",
"=",
"[",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",
",",
"'..'",
"]",
"+",
"package",
".",
"split",
"(",
"'.'",
")",
"path",
"=",
"os",
".",
"path",
".",
"join",
... | Import modules from package and append into sys.modules
:param package: full package name, e.g. east.asts | [
"Import",
"modules",
"from",
"package",
"and",
"append",
"into",
"sys",
".",
"modules"
] | 055ad8d2492c100bbbaa25309ec1074bdf1dfaa5 | https://github.com/mikhaildubov/AST-text-analysis/blob/055ad8d2492c100bbbaa25309ec1074bdf1dfaa5/east/utils.py#L119-L133 | train |
bearyinnovative/bearychat.py | bearychat/openapi/client.py | Requester.request | def request(self, request_method, api_method, *args, **kwargs):
"""Perform a request.
Args:
request_method: HTTP method for this request.
api_method: API method name for this request.
*args: Extra arguments to pass to the request.
**kwargs: Extra keyword ... | python | def request(self, request_method, api_method, *args, **kwargs):
"""Perform a request.
Args:
request_method: HTTP method for this request.
api_method: API method name for this request.
*args: Extra arguments to pass to the request.
**kwargs: Extra keyword ... | [
"def",
"request",
"(",
"self",
",",
"request_method",
",",
"api_method",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"api_method",
")",
"resp",
"=",
"requests",
".",
"request",
"(",
"request_method",
",",
... | Perform a request.
Args:
request_method: HTTP method for this request.
api_method: API method name for this request.
*args: Extra arguments to pass to the request.
**kwargs: Extra keyword arguments to pass to the request.
Returns:
A dict cont... | [
"Perform",
"a",
"request",
"."
] | 6c7af2d215c2ff7135bb5af66ca333d0ea1089fd | https://github.com/bearyinnovative/bearychat.py/blob/6c7af2d215c2ff7135bb5af66ca333d0ea1089fd/bearychat/openapi/client.py#L82-L109 | train |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnode.py | XNodeAnimation.updateCurrentValue | def updateCurrentValue(self, value):
"""
Disables snapping during the current value update to ensure a smooth
transition for node animations. Since this can only be called via
code, we don't need to worry about snapping to the grid for a user.
"""
xsnap = None
ys... | python | def updateCurrentValue(self, value):
"""
Disables snapping during the current value update to ensure a smooth
transition for node animations. Since this can only be called via
code, we don't need to worry about snapping to the grid for a user.
"""
xsnap = None
ys... | [
"def",
"updateCurrentValue",
"(",
"self",
",",
"value",
")",
":",
"xsnap",
"=",
"None",
"ysnap",
"=",
"None",
"if",
"value",
"!=",
"self",
".",
"endValue",
"(",
")",
":",
"xsnap",
"=",
"self",
".",
"targetObject",
"(",
")",
".",
"isXSnappedToGrid",
"("... | Disables snapping during the current value update to ensure a smooth
transition for node animations. Since this can only be called via
code, we don't need to worry about snapping to the grid for a user. | [
"Disables",
"snapping",
"during",
"the",
"current",
"value",
"update",
"to",
"ensure",
"a",
"smooth",
"transition",
"for",
"node",
"animations",
".",
"Since",
"this",
"can",
"only",
"be",
"called",
"via",
"code",
"we",
"don",
"t",
"need",
"to",
"worry",
"a... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnode.py#L69-L89 | train |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnode.py | XNode.adjustTitleFont | def adjustTitleFont(self):
"""
Adjusts the font used for the title based on the current with and \
display name.
"""
left, top, right, bottom = self.contentsMargins()
r = self.roundingRadius()
# include text padding
left += 5 + r / 2
top +... | python | def adjustTitleFont(self):
"""
Adjusts the font used for the title based on the current with and \
display name.
"""
left, top, right, bottom = self.contentsMargins()
r = self.roundingRadius()
# include text padding
left += 5 + r / 2
top +... | [
"def",
"adjustTitleFont",
"(",
"self",
")",
":",
"left",
",",
"top",
",",
"right",
",",
"bottom",
"=",
"self",
".",
"contentsMargins",
"(",
")",
"r",
"=",
"self",
".",
"roundingRadius",
"(",
")",
"left",
"+=",
"5",
"+",
"r",
"/",
"2",
"top",
"+=",
... | Adjusts the font used for the title based on the current with and \
display name. | [
"Adjusts",
"the",
"font",
"used",
"for",
"the",
"title",
"based",
"on",
"the",
"current",
"with",
"and",
"\\",
"display",
"name",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnode.py#L196-L224 | train |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnode.py | XNode.adjustSize | def adjustSize( self ):
"""
Adjusts the size of this node to support the length of its contents.
"""
cell = self.scene().cellWidth() * 2
minheight = cell
minwidth = 2 * cell
# fit to the grid size
metrics = QFontMetrics(QApplication.font())
... | python | def adjustSize( self ):
"""
Adjusts the size of this node to support the length of its contents.
"""
cell = self.scene().cellWidth() * 2
minheight = cell
minwidth = 2 * cell
# fit to the grid size
metrics = QFontMetrics(QApplication.font())
... | [
"def",
"adjustSize",
"(",
"self",
")",
":",
"cell",
"=",
"self",
".",
"scene",
"(",
")",
".",
"cellWidth",
"(",
")",
"*",
"2",
"minheight",
"=",
"cell",
"minwidth",
"=",
"2",
"*",
"cell",
"metrics",
"=",
"QFontMetrics",
"(",
"QApplication",
".",
"fon... | Adjusts the size of this node to support the length of its contents. | [
"Adjusts",
"the",
"size",
"of",
"this",
"node",
"to",
"support",
"the",
"length",
"of",
"its",
"contents",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnode.py#L226-L261 | train |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnode.py | XNode.isEnabled | def isEnabled( self ):
"""
Returns whether or not this node is enabled.
"""
if ( self._disableWithLayer and self._layer ):
lenabled = self._layer.isEnabled()
else:
lenabled = True
return self._enabled and lenabled | python | def isEnabled( self ):
"""
Returns whether or not this node is enabled.
"""
if ( self._disableWithLayer and self._layer ):
lenabled = self._layer.isEnabled()
else:
lenabled = True
return self._enabled and lenabled | [
"def",
"isEnabled",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"_disableWithLayer",
"and",
"self",
".",
"_layer",
")",
":",
"lenabled",
"=",
"self",
".",
"_layer",
".",
"isEnabled",
"(",
")",
"else",
":",
"lenabled",
"=",
"True",
"return",
"self",
... | Returns whether or not this node is enabled. | [
"Returns",
"whether",
"or",
"not",
"this",
"node",
"is",
"enabled",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnode.py#L1052-L1061 | train |
core/uricore | uricore/wkz_datastructures.py | MultiDict.popitem | def popitem(self):
"""Pop an item from the dict."""
try:
item = dict.popitem(self)
return (item[0], item[1][0])
except KeyError, e:
raise BadRequestKeyError(str(e)) | python | def popitem(self):
"""Pop an item from the dict."""
try:
item = dict.popitem(self)
return (item[0], item[1][0])
except KeyError, e:
raise BadRequestKeyError(str(e)) | [
"def",
"popitem",
"(",
"self",
")",
":",
"try",
":",
"item",
"=",
"dict",
".",
"popitem",
"(",
"self",
")",
"return",
"(",
"item",
"[",
"0",
"]",
",",
"item",
"[",
"1",
"]",
"[",
"0",
"]",
")",
"except",
"KeyError",
",",
"e",
":",
"raise",
"B... | Pop an item from the dict. | [
"Pop",
"an",
"item",
"from",
"the",
"dict",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_datastructures.py#L333-L339 | train |
bitesofcode/projexui | projexui/widgets/xorbrecordbox.py | XOrbRecordBox.emitCurrentRecordChanged | def emitCurrentRecordChanged(self):
"""
Emits the current record changed signal for this combobox, provided \
the signals aren't blocked.
"""
record = unwrapVariant(self.itemData(self.currentIndex(), Qt.UserRole))
if not Table.recordcheck(record):
recor... | python | def emitCurrentRecordChanged(self):
"""
Emits the current record changed signal for this combobox, provided \
the signals aren't blocked.
"""
record = unwrapVariant(self.itemData(self.currentIndex(), Qt.UserRole))
if not Table.recordcheck(record):
recor... | [
"def",
"emitCurrentRecordChanged",
"(",
"self",
")",
":",
"record",
"=",
"unwrapVariant",
"(",
"self",
".",
"itemData",
"(",
"self",
".",
"currentIndex",
"(",
")",
",",
"Qt",
".",
"UserRole",
")",
")",
"if",
"not",
"Table",
".",
"recordcheck",
"(",
"reco... | Emits the current record changed signal for this combobox, provided \
the signals aren't blocked. | [
"Emits",
"the",
"current",
"record",
"changed",
"signal",
"for",
"this",
"combobox",
"provided",
"\\",
"the",
"signals",
"aren",
"t",
"blocked",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordbox.py#L358-L370 | train |
bitesofcode/projexui | projexui/widgets/xorbrecordbox.py | XOrbRecordBox.emitCurrentRecordEdited | def emitCurrentRecordEdited(self):
"""
Emits the current record edited signal for this combobox, provided the
signals aren't blocked and the record has changed since the last time.
"""
if self._changedRecord == -1:
return
if self.signalsBlocke... | python | def emitCurrentRecordEdited(self):
"""
Emits the current record edited signal for this combobox, provided the
signals aren't blocked and the record has changed since the last time.
"""
if self._changedRecord == -1:
return
if self.signalsBlocke... | [
"def",
"emitCurrentRecordEdited",
"(",
"self",
")",
":",
"if",
"self",
".",
"_changedRecord",
"==",
"-",
"1",
":",
"return",
"if",
"self",
".",
"signalsBlocked",
"(",
")",
":",
"return",
"record",
"=",
"self",
".",
"_changedRecord",
"self",
".",
"_changedR... | Emits the current record edited signal for this combobox, provided the
signals aren't blocked and the record has changed since the last time. | [
"Emits",
"the",
"current",
"record",
"edited",
"signal",
"for",
"this",
"combobox",
"provided",
"the",
"signals",
"aren",
"t",
"blocked",
"and",
"the",
"record",
"has",
"changed",
"since",
"the",
"last",
"time",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordbox.py#L372-L385 | train |
bitesofcode/projexui | projexui/widgets/xorbrecordbox.py | XOrbRecordBox.focusInEvent | def focusInEvent(self, event):
"""
When this widget loses focus, try to emit the record changed event
signal.
"""
self._changedRecord = -1
super(XOrbRecordBox, self).focusInEvent(event) | python | def focusInEvent(self, event):
"""
When this widget loses focus, try to emit the record changed event
signal.
"""
self._changedRecord = -1
super(XOrbRecordBox, self).focusInEvent(event) | [
"def",
"focusInEvent",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"_changedRecord",
"=",
"-",
"1",
"super",
"(",
"XOrbRecordBox",
",",
"self",
")",
".",
"focusInEvent",
"(",
"event",
")"
] | When this widget loses focus, try to emit the record changed event
signal. | [
"When",
"this",
"widget",
"loses",
"focus",
"try",
"to",
"emit",
"the",
"record",
"changed",
"event",
"signal",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordbox.py#L480-L486 | train |
bitesofcode/projexui | projexui/widgets/xorbrecordbox.py | XOrbRecordBox.hidePopup | def hidePopup(self):
"""
Overloads the hide popup method to handle when the user hides
the popup widget.
"""
if self._treePopupWidget and self.showTreePopup():
self._treePopupWidget.close()
super(XOrbRecordBox, self).hidePopup() | python | def hidePopup(self):
"""
Overloads the hide popup method to handle when the user hides
the popup widget.
"""
if self._treePopupWidget and self.showTreePopup():
self._treePopupWidget.close()
super(XOrbRecordBox, self).hidePopup() | [
"def",
"hidePopup",
"(",
"self",
")",
":",
"if",
"self",
".",
"_treePopupWidget",
"and",
"self",
".",
"showTreePopup",
"(",
")",
":",
"self",
".",
"_treePopupWidget",
".",
"close",
"(",
")",
"super",
"(",
"XOrbRecordBox",
",",
"self",
")",
".",
"hidePopu... | Overloads the hide popup method to handle when the user hides
the popup widget. | [
"Overloads",
"the",
"hide",
"popup",
"method",
"to",
"handle",
"when",
"the",
"user",
"hides",
"the",
"popup",
"widget",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordbox.py#L499-L507 | train |
bitesofcode/projexui | projexui/widgets/xorbrecordbox.py | XOrbRecordBox.markLoadingStarted | def markLoadingStarted(self):
"""
Marks this widget as loading records.
"""
if self.isThreadEnabled():
XLoaderWidget.start(self)
if self.showTreePopup():
tree = self.treePopupWidget()
tree.setCursor(Qt.WaitCursor)
... | python | def markLoadingStarted(self):
"""
Marks this widget as loading records.
"""
if self.isThreadEnabled():
XLoaderWidget.start(self)
if self.showTreePopup():
tree = self.treePopupWidget()
tree.setCursor(Qt.WaitCursor)
... | [
"def",
"markLoadingStarted",
"(",
"self",
")",
":",
"if",
"self",
".",
"isThreadEnabled",
"(",
")",
":",
"XLoaderWidget",
".",
"start",
"(",
"self",
")",
"if",
"self",
".",
"showTreePopup",
"(",
")",
":",
"tree",
"=",
"self",
".",
"treePopupWidget",
"(",... | Marks this widget as loading records. | [
"Marks",
"this",
"widget",
"as",
"loading",
"records",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordbox.py#L573-L604 | train |
bitesofcode/projexui | projexui/widgets/xorbrecordbox.py | XOrbRecordBox.markLoadingFinished | def markLoadingFinished(self):
"""
Marks this widget as finished loading records.
"""
XLoaderWidget.stop(self, force=True)
hint, tree_hint = self._baseHints
self.setHint(hint)
# set the tree widget
if self.showTreePopup():
... | python | def markLoadingFinished(self):
"""
Marks this widget as finished loading records.
"""
XLoaderWidget.stop(self, force=True)
hint, tree_hint = self._baseHints
self.setHint(hint)
# set the tree widget
if self.showTreePopup():
... | [
"def",
"markLoadingFinished",
"(",
"self",
")",
":",
"XLoaderWidget",
".",
"stop",
"(",
"self",
",",
"force",
"=",
"True",
")",
"hint",
",",
"tree_hint",
"=",
"self",
".",
"_baseHints",
"self",
".",
"setHint",
"(",
"hint",
")",
"if",
"self",
".",
"show... | Marks this widget as finished loading records. | [
"Marks",
"this",
"widget",
"as",
"finished",
"loading",
"records",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordbox.py#L606-L626 | train |
bitesofcode/projexui | projexui/widgets/xtreewidget/xtreewidgetitem.py | XTreeWidgetItem.destroy | def destroy(self):
"""
Destroyes this item by disconnecting any signals that may exist. This
is called when the tree clears itself or is deleted. If you are
manually removing an item, you should call the destroy method yourself.
This is required since Python allows for non... | python | def destroy(self):
"""
Destroyes this item by disconnecting any signals that may exist. This
is called when the tree clears itself or is deleted. If you are
manually removing an item, you should call the destroy method yourself.
This is required since Python allows for non... | [
"def",
"destroy",
"(",
"self",
")",
":",
"try",
":",
"tree",
"=",
"self",
".",
"treeWidget",
"(",
")",
"tree",
".",
"destroyed",
".",
"disconnect",
"(",
"self",
".",
"destroy",
")",
"except",
"StandardError",
":",
"pass",
"for",
"movie",
"in",
"set",
... | Destroyes this item by disconnecting any signals that may exist. This
is called when the tree clears itself or is deleted. If you are
manually removing an item, you should call the destroy method yourself.
This is required since Python allows for non-QObject connections, and
since ... | [
"Destroyes",
"this",
"item",
"by",
"disconnecting",
"any",
"signals",
"that",
"may",
"exist",
".",
"This",
"is",
"called",
"when",
"the",
"tree",
"clears",
"itself",
"or",
"is",
"deleted",
".",
"If",
"you",
"are",
"manually",
"removing",
"an",
"item",
"you... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtreewidget/xtreewidgetitem.py#L125-L144 | train |
bitesofcode/projexui | projexui/widgets/xtreewidget/xtreewidgetitem.py | XTreeWidgetItem.ensureVisible | def ensureVisible(self):
"""
Expands all the parents of this item to ensure that it is visible
to the user.
"""
parent = self.parent()
while parent:
parent.setExpanded(True)
parent = parent.parent() | python | def ensureVisible(self):
"""
Expands all the parents of this item to ensure that it is visible
to the user.
"""
parent = self.parent()
while parent:
parent.setExpanded(True)
parent = parent.parent() | [
"def",
"ensureVisible",
"(",
"self",
")",
":",
"parent",
"=",
"self",
".",
"parent",
"(",
")",
"while",
"parent",
":",
"parent",
".",
"setExpanded",
"(",
"True",
")",
"parent",
"=",
"parent",
".",
"parent",
"(",
")"
] | Expands all the parents of this item to ensure that it is visible
to the user. | [
"Expands",
"all",
"the",
"parents",
"of",
"this",
"item",
"to",
"ensure",
"that",
"it",
"is",
"visible",
"to",
"the",
"user",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtreewidget/xtreewidgetitem.py#L173-L181 | train |
bitesofcode/projexui | projexui/widgets/xtreewidget/xtreewidgetitem.py | XTreeWidgetItem.initGroupStyle | def initGroupStyle(self, useIcons=True, columnCount=None):
"""
Initialzes this item with a grouping style option.
"""
flags = self.flags()
if flags & QtCore.Qt.ItemIsSelectable:
flags ^= QtCore.Qt.ItemIsSelectable
self.setFlags(flags)
... | python | def initGroupStyle(self, useIcons=True, columnCount=None):
"""
Initialzes this item with a grouping style option.
"""
flags = self.flags()
if flags & QtCore.Qt.ItemIsSelectable:
flags ^= QtCore.Qt.ItemIsSelectable
self.setFlags(flags)
... | [
"def",
"initGroupStyle",
"(",
"self",
",",
"useIcons",
"=",
"True",
",",
"columnCount",
"=",
"None",
")",
":",
"flags",
"=",
"self",
".",
"flags",
"(",
")",
"if",
"flags",
"&",
"QtCore",
".",
"Qt",
".",
"ItemIsSelectable",
":",
"flags",
"^=",
"QtCore",... | Initialzes this item with a grouping style option. | [
"Initialzes",
"this",
"item",
"with",
"a",
"grouping",
"style",
"option",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtreewidget/xtreewidgetitem.py#L242-L290 | train |
bitesofcode/projexui | projexui/widgets/xtreewidget/xtreewidgetitem.py | XTreeWidgetItem.takeFromTree | def takeFromTree(self):
"""
Takes this item from the tree.
"""
tree = self.treeWidget()
parent = self.parent()
if parent:
parent.takeChild(parent.indexOfChild(self))
else:
tree.takeTopLevelItem(tree.indexOfTopLevelItem(se... | python | def takeFromTree(self):
"""
Takes this item from the tree.
"""
tree = self.treeWidget()
parent = self.parent()
if parent:
parent.takeChild(parent.indexOfChild(self))
else:
tree.takeTopLevelItem(tree.indexOfTopLevelItem(se... | [
"def",
"takeFromTree",
"(",
"self",
")",
":",
"tree",
"=",
"self",
".",
"treeWidget",
"(",
")",
"parent",
"=",
"self",
".",
"parent",
"(",
")",
"if",
"parent",
":",
"parent",
".",
"takeChild",
"(",
"parent",
".",
"indexOfChild",
"(",
"self",
")",
")"... | Takes this item from the tree. | [
"Takes",
"this",
"item",
"from",
"the",
"tree",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtreewidget/xtreewidgetitem.py#L548-L558 | train |
jdrumgoole/mongodbshell | mongodbshell/__init__.py | MongoDB.find | def find(self, *args, **kwargs):
"""
Run the pymongo find command against the default database and collection
and paginate the output to the screen.
"""
# print(f"database.collection: '{self.database.name}.{self.collection.name}'")
self.print_cursor(self.collection.find(*... | python | def find(self, *args, **kwargs):
"""
Run the pymongo find command against the default database and collection
and paginate the output to the screen.
"""
# print(f"database.collection: '{self.database.name}.{self.collection.name}'")
self.print_cursor(self.collection.find(*... | [
"def",
"find",
"(",
"self",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"self",
".",
"print_cursor",
"(",
"self",
".",
"collection",
".",
"find",
"(",
"*",
"args",
",",
"**",
"kwargs",
")",
")"
] | Run the pymongo find command against the default database and collection
and paginate the output to the screen. | [
"Run",
"the",
"pymongo",
"find",
"command",
"against",
"the",
"default",
"database",
"and",
"collection",
"and",
"paginate",
"the",
"output",
"to",
"the",
"screen",
"."
] | 7e194247ea2adc1f124532935507cdffafa2c1f6 | https://github.com/jdrumgoole/mongodbshell/blob/7e194247ea2adc1f124532935507cdffafa2c1f6/mongodbshell/__init__.py#L247-L253 | train |
jdrumgoole/mongodbshell | mongodbshell/__init__.py | MongoDB.find_one | def find_one(self, *args, **kwargs):
"""
Run the pymongo find_one command against the default database and collection
and paginate the output to the screen.
"""
# print(f"database.collection: '{self.database.name}.{self.collection.name}'")
self.print_doc(self.collection.f... | python | def find_one(self, *args, **kwargs):
"""
Run the pymongo find_one command against the default database and collection
and paginate the output to the screen.
"""
# print(f"database.collection: '{self.database.name}.{self.collection.name}'")
self.print_doc(self.collection.f... | [
"def",
"find_one",
"(",
"self",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"self",
".",
"print_doc",
"(",
"self",
".",
"collection",
".",
"find_one",
"(",
"*",
"args",
",",
"**",
"kwargs",
")",
")"
] | Run the pymongo find_one command against the default database and collection
and paginate the output to the screen. | [
"Run",
"the",
"pymongo",
"find_one",
"command",
"against",
"the",
"default",
"database",
"and",
"collection",
"and",
"paginate",
"the",
"output",
"to",
"the",
"screen",
"."
] | 7e194247ea2adc1f124532935507cdffafa2c1f6 | https://github.com/jdrumgoole/mongodbshell/blob/7e194247ea2adc1f124532935507cdffafa2c1f6/mongodbshell/__init__.py#L255-L261 | train |
jdrumgoole/mongodbshell | mongodbshell/__init__.py | MongoDB.insert_one | def insert_one(self, *args, **kwargs):
"""
Run the pymongo insert_one command against the default database and collection
and returne the inserted ID.
"""
# print(f"database.collection: '{self.database.name}.{self.collection.name}'")
result = self.collection.insert_one(*a... | python | def insert_one(self, *args, **kwargs):
"""
Run the pymongo insert_one command against the default database and collection
and returne the inserted ID.
"""
# print(f"database.collection: '{self.database.name}.{self.collection.name}'")
result = self.collection.insert_one(*a... | [
"def",
"insert_one",
"(",
"self",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"result",
"=",
"self",
".",
"collection",
".",
"insert_one",
"(",
"*",
"args",
",",
"**",
"kwargs",
")",
"return",
"result",
".",
"inserted_id"
] | Run the pymongo insert_one command against the default database and collection
and returne the inserted ID. | [
"Run",
"the",
"pymongo",
"insert_one",
"command",
"against",
"the",
"default",
"database",
"and",
"collection",
"and",
"returne",
"the",
"inserted",
"ID",
"."
] | 7e194247ea2adc1f124532935507cdffafa2c1f6 | https://github.com/jdrumgoole/mongodbshell/blob/7e194247ea2adc1f124532935507cdffafa2c1f6/mongodbshell/__init__.py#L263-L270 | train |
jdrumgoole/mongodbshell | mongodbshell/__init__.py | MongoDB.insert_many | def insert_many(self, *args, **kwargs):
"""
Run the pymongo insert_many command against the default database and collection
and return the list of inserted IDs.
"""
# print(f"database.collection: '{self.database.name}.{self.collection.name}'")
result = self.collection.ins... | python | def insert_many(self, *args, **kwargs):
"""
Run the pymongo insert_many command against the default database and collection
and return the list of inserted IDs.
"""
# print(f"database.collection: '{self.database.name}.{self.collection.name}'")
result = self.collection.ins... | [
"def",
"insert_many",
"(",
"self",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"result",
"=",
"self",
".",
"collection",
".",
"insert_many",
"(",
"*",
"args",
",",
"**",
"kwargs",
")",
"return",
"result",
".",
"inserted_ids"
] | Run the pymongo insert_many command against the default database and collection
and return the list of inserted IDs. | [
"Run",
"the",
"pymongo",
"insert_many",
"command",
"against",
"the",
"default",
"database",
"and",
"collection",
"and",
"return",
"the",
"list",
"of",
"inserted",
"IDs",
"."
] | 7e194247ea2adc1f124532935507cdffafa2c1f6 | https://github.com/jdrumgoole/mongodbshell/blob/7e194247ea2adc1f124532935507cdffafa2c1f6/mongodbshell/__init__.py#L272-L279 | train |
jdrumgoole/mongodbshell | mongodbshell/__init__.py | MongoDB.delete_one | def delete_one(self, *args, **kwargs):
"""
Run the pymongo delete_one command against the default database and collection
and return the deleted IDs.
"""
result = self.collection.delete_one(*args, **kwargs)
return result.raw_result | python | def delete_one(self, *args, **kwargs):
"""
Run the pymongo delete_one command against the default database and collection
and return the deleted IDs.
"""
result = self.collection.delete_one(*args, **kwargs)
return result.raw_result | [
"def",
"delete_one",
"(",
"self",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"result",
"=",
"self",
".",
"collection",
".",
"delete_one",
"(",
"*",
"args",
",",
"**",
"kwargs",
")",
"return",
"result",
".",
"raw_result"
] | Run the pymongo delete_one command against the default database and collection
and return the deleted IDs. | [
"Run",
"the",
"pymongo",
"delete_one",
"command",
"against",
"the",
"default",
"database",
"and",
"collection",
"and",
"return",
"the",
"deleted",
"IDs",
"."
] | 7e194247ea2adc1f124532935507cdffafa2c1f6 | https://github.com/jdrumgoole/mongodbshell/blob/7e194247ea2adc1f124532935507cdffafa2c1f6/mongodbshell/__init__.py#L281-L287 | train |
jdrumgoole/mongodbshell | mongodbshell/__init__.py | MongoDB.delete_many | def delete_many(self, *args, **kwargs):
"""
Run the pymongo delete_many command against the default database and collection
and return the deleted IDs.
"""
result = self.collection.delete_many(*args, **kwargs)
return result.raw_result | python | def delete_many(self, *args, **kwargs):
"""
Run the pymongo delete_many command against the default database and collection
and return the deleted IDs.
"""
result = self.collection.delete_many(*args, **kwargs)
return result.raw_result | [
"def",
"delete_many",
"(",
"self",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"result",
"=",
"self",
".",
"collection",
".",
"delete_many",
"(",
"*",
"args",
",",
"**",
"kwargs",
")",
"return",
"result",
".",
"raw_result"
] | Run the pymongo delete_many command against the default database and collection
and return the deleted IDs. | [
"Run",
"the",
"pymongo",
"delete_many",
"command",
"against",
"the",
"default",
"database",
"and",
"collection",
"and",
"return",
"the",
"deleted",
"IDs",
"."
] | 7e194247ea2adc1f124532935507cdffafa2c1f6 | https://github.com/jdrumgoole/mongodbshell/blob/7e194247ea2adc1f124532935507cdffafa2c1f6/mongodbshell/__init__.py#L289-L295 | train |
jdrumgoole/mongodbshell | mongodbshell/__init__.py | MongoDB.count_documents | def count_documents(self, filter={}, *args, **kwargs):
"""
Count all the documents in a collection accurately
"""
result = self.collection.count_documents(filter, *args, **kwargs)
return result | python | def count_documents(self, filter={}, *args, **kwargs):
"""
Count all the documents in a collection accurately
"""
result = self.collection.count_documents(filter, *args, **kwargs)
return result | [
"def",
"count_documents",
"(",
"self",
",",
"filter",
"=",
"{",
"}",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"result",
"=",
"self",
".",
"collection",
".",
"count_documents",
"(",
"filter",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
"return... | Count all the documents in a collection accurately | [
"Count",
"all",
"the",
"documents",
"in",
"a",
"collection",
"accurately"
] | 7e194247ea2adc1f124532935507cdffafa2c1f6 | https://github.com/jdrumgoole/mongodbshell/blob/7e194247ea2adc1f124532935507cdffafa2c1f6/mongodbshell/__init__.py#L297-L302 | train |
jdrumgoole/mongodbshell | mongodbshell/__init__.py | MongoDB._get_collections | def _get_collections(self, db_names=None):
"""
Internal function to return all the collections for every database.
include a list of db_names to filter the list of collections.
"""
if db_names:
db_list = db_names
else:
db_list = self.client.list_da... | python | def _get_collections(self, db_names=None):
"""
Internal function to return all the collections for every database.
include a list of db_names to filter the list of collections.
"""
if db_names:
db_list = db_names
else:
db_list = self.client.list_da... | [
"def",
"_get_collections",
"(",
"self",
",",
"db_names",
"=",
"None",
")",
":",
"if",
"db_names",
":",
"db_list",
"=",
"db_names",
"else",
":",
"db_list",
"=",
"self",
".",
"client",
".",
"list_database_names",
"(",
")",
"for",
"db_name",
"in",
"db_list",
... | Internal function to return all the collections for every database.
include a list of db_names to filter the list of collections. | [
"Internal",
"function",
"to",
"return",
"all",
"the",
"collections",
"for",
"every",
"database",
".",
"include",
"a",
"list",
"of",
"db_names",
"to",
"filter",
"the",
"list",
"of",
"collections",
"."
] | 7e194247ea2adc1f124532935507cdffafa2c1f6 | https://github.com/jdrumgoole/mongodbshell/blob/7e194247ea2adc1f124532935507cdffafa2c1f6/mongodbshell/__init__.py#L337-L351 | train |
jdrumgoole/mongodbshell | mongodbshell/__init__.py | MongoDB.pager | def pager(self, lines):
"""
Outputs lines to a terminal. It uses
`shutil.get_terminal_size` to determine the height of the terminal.
It expects an iterator that returns a line at a time and those lines
should be terminated by a valid newline sequence.
Behaviour is contro... | python | def pager(self, lines):
"""
Outputs lines to a terminal. It uses
`shutil.get_terminal_size` to determine the height of the terminal.
It expects an iterator that returns a line at a time and those lines
should be terminated by a valid newline sequence.
Behaviour is contro... | [
"def",
"pager",
"(",
"self",
",",
"lines",
")",
":",
"try",
":",
"line_count",
"=",
"0",
"if",
"self",
".",
"_output_filename",
":",
"print",
"(",
"f\"Output is also going to '{self.output_file}'\"",
")",
"self",
".",
"_output_file",
"=",
"open",
"(",
"self",
... | Outputs lines to a terminal. It uses
`shutil.get_terminal_size` to determine the height of the terminal.
It expects an iterator that returns a line at a time and those lines
should be terminated by a valid newline sequence.
Behaviour is controlled by a number of external class propertie... | [
"Outputs",
"lines",
"to",
"a",
"terminal",
".",
"It",
"uses",
"shutil",
".",
"get_terminal_size",
"to",
"determine",
"the",
"height",
"of",
"the",
"terminal",
".",
"It",
"expects",
"an",
"iterator",
"that",
"returns",
"a",
"line",
"at",
"a",
"time",
"and",... | 7e194247ea2adc1f124532935507cdffafa2c1f6 | https://github.com/jdrumgoole/mongodbshell/blob/7e194247ea2adc1f124532935507cdffafa2c1f6/mongodbshell/__init__.py#L454-L536 | train |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbquerywidget.py | XOrbQueryWidget.groupQuery | def groupQuery( self ):
"""
Groups the selected items together into a sub query
"""
items = self.uiQueryTREE.selectedItems()
if ( not len(items) > 2 ):
return
if ( isinstance(items[-1], XJoinItem) ):
items = items[:-1]
... | python | def groupQuery( self ):
"""
Groups the selected items together into a sub query
"""
items = self.uiQueryTREE.selectedItems()
if ( not len(items) > 2 ):
return
if ( isinstance(items[-1], XJoinItem) ):
items = items[:-1]
... | [
"def",
"groupQuery",
"(",
"self",
")",
":",
"items",
"=",
"self",
".",
"uiQueryTREE",
".",
"selectedItems",
"(",
")",
"if",
"(",
"not",
"len",
"(",
"items",
")",
">",
"2",
")",
":",
"return",
"if",
"(",
"isinstance",
"(",
"items",
"[",
"-",
"1",
... | Groups the selected items together into a sub query | [
"Groups",
"the",
"selected",
"items",
"together",
"into",
"a",
"sub",
"query"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbquerywidget.py#L575-L607 | train |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbquerywidget.py | XOrbQueryWidget.removeQuery | def removeQuery( self ):
"""
Removes the currently selected query.
"""
items = self.uiQueryTREE.selectedItems()
tree = self.uiQueryTREE
for item in items:
parent = item.parent()
if ( parent ):
parent.takeChild(parent.index... | python | def removeQuery( self ):
"""
Removes the currently selected query.
"""
items = self.uiQueryTREE.selectedItems()
tree = self.uiQueryTREE
for item in items:
parent = item.parent()
if ( parent ):
parent.takeChild(parent.index... | [
"def",
"removeQuery",
"(",
"self",
")",
":",
"items",
"=",
"self",
".",
"uiQueryTREE",
".",
"selectedItems",
"(",
")",
"tree",
"=",
"self",
".",
"uiQueryTREE",
"for",
"item",
"in",
"items",
":",
"parent",
"=",
"item",
".",
"parent",
"(",
")",
"if",
"... | Removes the currently selected query. | [
"Removes",
"the",
"currently",
"selected",
"query",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbquerywidget.py#L631-L644 | train |
bitesofcode/projexui | projexui/dialogs/xwizardbrowserdialog/xwizardbrowserdialog.py | XWizardBrowserDialog.runWizard | def runWizard( self ):
"""
Runs the current wizard.
"""
plugin = self.currentPlugin()
if ( plugin and plugin.runWizard(self) ):
self.accept() | python | def runWizard( self ):
"""
Runs the current wizard.
"""
plugin = self.currentPlugin()
if ( plugin and plugin.runWizard(self) ):
self.accept() | [
"def",
"runWizard",
"(",
"self",
")",
":",
"plugin",
"=",
"self",
".",
"currentPlugin",
"(",
")",
"if",
"(",
"plugin",
"and",
"plugin",
".",
"runWizard",
"(",
"self",
")",
")",
":",
"self",
".",
"accept",
"(",
")"
] | Runs the current wizard. | [
"Runs",
"the",
"current",
"wizard",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xwizardbrowserdialog/xwizardbrowserdialog.py#L133-L139 | train |
bitesofcode/projexui | projexui/dialogs/xwizardbrowserdialog/xwizardbrowserdialog.py | XWizardBrowserDialog.showDescription | def showDescription( self ):
"""
Shows the description for the current plugin in the interface.
"""
plugin = self.currentPlugin()
if ( not plugin ):
self.uiDescriptionTXT.setText('')
else:
self.uiDescriptionTXT.setText(plugin.description()) | python | def showDescription( self ):
"""
Shows the description for the current plugin in the interface.
"""
plugin = self.currentPlugin()
if ( not plugin ):
self.uiDescriptionTXT.setText('')
else:
self.uiDescriptionTXT.setText(plugin.description()) | [
"def",
"showDescription",
"(",
"self",
")",
":",
"plugin",
"=",
"self",
".",
"currentPlugin",
"(",
")",
"if",
"(",
"not",
"plugin",
")",
":",
"self",
".",
"uiDescriptionTXT",
".",
"setText",
"(",
"''",
")",
"else",
":",
"self",
".",
"uiDescriptionTXT",
... | Shows the description for the current plugin in the interface. | [
"Shows",
"the",
"description",
"for",
"the",
"current",
"plugin",
"in",
"the",
"interface",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xwizardbrowserdialog/xwizardbrowserdialog.py#L208-L216 | train |
bitesofcode/projexui | projexui/dialogs/xwizardbrowserdialog/xwizardbrowserdialog.py | XWizardBrowserDialog.showWizards | def showWizards( self ):
"""
Show the wizards widget for the currently selected plugin.
"""
self.uiWizardTABLE.clear()
item = self.uiPluginTREE.currentItem()
if ( not (item and item.parent()) ):
plugins = []
else:
wlang = n... | python | def showWizards( self ):
"""
Show the wizards widget for the currently selected plugin.
"""
self.uiWizardTABLE.clear()
item = self.uiPluginTREE.currentItem()
if ( not (item and item.parent()) ):
plugins = []
else:
wlang = n... | [
"def",
"showWizards",
"(",
"self",
")",
":",
"self",
".",
"uiWizardTABLE",
".",
"clear",
"(",
")",
"item",
"=",
"self",
".",
"uiPluginTREE",
".",
"currentItem",
"(",
")",
"if",
"(",
"not",
"(",
"item",
"and",
"item",
".",
"parent",
"(",
")",
")",
"... | Show the wizards widget for the currently selected plugin. | [
"Show",
"the",
"wizards",
"widget",
"for",
"the",
"currently",
"selected",
"plugin",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xwizardbrowserdialog/xwizardbrowserdialog.py#L218-L268 | train |
bitesofcode/projexui | projexui/xcolorset.py | XColorSet.registerToDataTypes | def registerToDataTypes( cls ):
"""
Registers this class as a valid datatype for saving and loading via
the datatype system.
"""
from projexui.xdatatype import registerDataType
registerDataType(cls.__name__,
lambda pyvalue: pyvalue.toString(),
lam... | python | def registerToDataTypes( cls ):
"""
Registers this class as a valid datatype for saving and loading via
the datatype system.
"""
from projexui.xdatatype import registerDataType
registerDataType(cls.__name__,
lambda pyvalue: pyvalue.toString(),
lam... | [
"def",
"registerToDataTypes",
"(",
"cls",
")",
":",
"from",
"projexui",
".",
"xdatatype",
"import",
"registerDataType",
"registerDataType",
"(",
"cls",
".",
"__name__",
",",
"lambda",
"pyvalue",
":",
"pyvalue",
".",
"toString",
"(",
")",
",",
"lambda",
"qvaria... | Registers this class as a valid datatype for saving and loading via
the datatype system. | [
"Registers",
"this",
"class",
"as",
"a",
"valid",
"datatype",
"for",
"saving",
"and",
"loading",
"via",
"the",
"datatype",
"system",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xcolorset.py#L184-L192 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelItem.enterEvent | def enterEvent(self, event):
"""
Mark the hovered state as being true.
:param event | <QtCore.QEnterEvent>
"""
super(XViewPanelItem, self).enterEvent(event)
# store the hover state and mark for a repaint
self._hovered = True
self.update() | python | def enterEvent(self, event):
"""
Mark the hovered state as being true.
:param event | <QtCore.QEnterEvent>
"""
super(XViewPanelItem, self).enterEvent(event)
# store the hover state and mark for a repaint
self._hovered = True
self.update() | [
"def",
"enterEvent",
"(",
"self",
",",
"event",
")",
":",
"super",
"(",
"XViewPanelItem",
",",
"self",
")",
".",
"enterEvent",
"(",
"event",
")",
"self",
".",
"_hovered",
"=",
"True",
"self",
".",
"update",
"(",
")"
] | Mark the hovered state as being true.
:param event | <QtCore.QEnterEvent> | [
"Mark",
"the",
"hovered",
"state",
"as",
"being",
"true",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L134-L144 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelItem.leaveEvent | def leaveEvent(self, event):
"""
Mark the hovered state as being false.
:param event | <QtCore.QLeaveEvent>
"""
super(XViewPanelItem, self).leaveEvent(event)
# store the hover state and mark for a repaint
self._hovered = False
self.update() | python | def leaveEvent(self, event):
"""
Mark the hovered state as being false.
:param event | <QtCore.QLeaveEvent>
"""
super(XViewPanelItem, self).leaveEvent(event)
# store the hover state and mark for a repaint
self._hovered = False
self.update() | [
"def",
"leaveEvent",
"(",
"self",
",",
"event",
")",
":",
"super",
"(",
"XViewPanelItem",
",",
"self",
")",
".",
"leaveEvent",
"(",
"event",
")",
"self",
".",
"_hovered",
"=",
"False",
"self",
".",
"update",
"(",
")"
] | Mark the hovered state as being false.
:param event | <QtCore.QLeaveEvent> | [
"Mark",
"the",
"hovered",
"state",
"as",
"being",
"false",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L146-L156 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelItem.mousePressEvent | def mousePressEvent(self, event):
"""
Creates the mouse event for dragging or activating this tab.
:param event | <QtCore.QMousePressEvent>
"""
self._moveItemStarted = False
rect = QtCore.QRect(0, 0, 12, self.height())
# drag the tab off
if not self... | python | def mousePressEvent(self, event):
"""
Creates the mouse event for dragging or activating this tab.
:param event | <QtCore.QMousePressEvent>
"""
self._moveItemStarted = False
rect = QtCore.QRect(0, 0, 12, self.height())
# drag the tab off
if not self... | [
"def",
"mousePressEvent",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"_moveItemStarted",
"=",
"False",
"rect",
"=",
"QtCore",
".",
"QRect",
"(",
"0",
",",
"0",
",",
"12",
",",
"self",
".",
"height",
"(",
")",
")",
"if",
"not",
"self",
".",
... | Creates the mouse event for dragging or activating this tab.
:param event | <QtCore.QMousePressEvent> | [
"Creates",
"the",
"mouse",
"event",
"for",
"dragging",
"or",
"activating",
"this",
"tab",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L214-L251 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelItem.setFixedHeight | def setFixedHeight(self, height):
"""
Sets the fixed height for this item to the inputed height amount.
:param height | <int>
"""
super(XViewPanelItem, self).setFixedHeight(height)
self._dragLabel.setFixedHeight(height)
self._titleLabel.setFixedHeight(heigh... | python | def setFixedHeight(self, height):
"""
Sets the fixed height for this item to the inputed height amount.
:param height | <int>
"""
super(XViewPanelItem, self).setFixedHeight(height)
self._dragLabel.setFixedHeight(height)
self._titleLabel.setFixedHeight(heigh... | [
"def",
"setFixedHeight",
"(",
"self",
",",
"height",
")",
":",
"super",
"(",
"XViewPanelItem",
",",
"self",
")",
".",
"setFixedHeight",
"(",
"height",
")",
"self",
".",
"_dragLabel",
".",
"setFixedHeight",
"(",
"height",
")",
"self",
".",
"_titleLabel",
".... | Sets the fixed height for this item to the inputed height amount.
:param height | <int> | [
"Sets",
"the",
"fixed",
"height",
"for",
"this",
"item",
"to",
"the",
"inputed",
"height",
"amount",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L274-L285 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelBar.clear | def clear(self):
"""
Clears out all the items from this tab bar.
"""
self.blockSignals(True)
items = list(self.items())
for item in items:
item.close()
self.blockSignals(False)
self._currentIndex = -1
self.currentIndexChanged.emit(self... | python | def clear(self):
"""
Clears out all the items from this tab bar.
"""
self.blockSignals(True)
items = list(self.items())
for item in items:
item.close()
self.blockSignals(False)
self._currentIndex = -1
self.currentIndexChanged.emit(self... | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"blockSignals",
"(",
"True",
")",
"items",
"=",
"list",
"(",
"self",
".",
"items",
"(",
")",
")",
"for",
"item",
"in",
"items",
":",
"item",
".",
"close",
"(",
")",
"self",
".",
"blockSignals",
... | Clears out all the items from this tab bar. | [
"Clears",
"out",
"all",
"the",
"items",
"from",
"this",
"tab",
"bar",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L407-L418 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelBar.closeTab | def closeTab(self, item):
"""
Requests a close for the inputed tab item.
:param item | <XViewPanelItem>
"""
index = self.indexOf(item)
if index != -1:
self.tabCloseRequested.emit(index) | python | def closeTab(self, item):
"""
Requests a close for the inputed tab item.
:param item | <XViewPanelItem>
"""
index = self.indexOf(item)
if index != -1:
self.tabCloseRequested.emit(index) | [
"def",
"closeTab",
"(",
"self",
",",
"item",
")",
":",
"index",
"=",
"self",
".",
"indexOf",
"(",
"item",
")",
"if",
"index",
"!=",
"-",
"1",
":",
"self",
".",
"tabCloseRequested",
".",
"emit",
"(",
"index",
")"
] | Requests a close for the inputed tab item.
:param item | <XViewPanelItem> | [
"Requests",
"a",
"close",
"for",
"the",
"inputed",
"tab",
"item",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L420-L428 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelBar.items | def items(self):
"""
Returns a list of all the items associated with this panel.
:return [<XViewPanelItem>, ..]
"""
output = []
for i in xrange(self.layout().count()):
item = self.layout().itemAt(i)
try:
widget = item.widget()
... | python | def items(self):
"""
Returns a list of all the items associated with this panel.
:return [<XViewPanelItem>, ..]
"""
output = []
for i in xrange(self.layout().count()):
item = self.layout().itemAt(i)
try:
widget = item.widget()
... | [
"def",
"items",
"(",
"self",
")",
":",
"output",
"=",
"[",
"]",
"for",
"i",
"in",
"xrange",
"(",
"self",
".",
"layout",
"(",
")",
".",
"count",
"(",
")",
")",
":",
"item",
"=",
"self",
".",
"layout",
"(",
")",
".",
"itemAt",
"(",
"i",
")",
... | Returns a list of all the items associated with this panel.
:return [<XViewPanelItem>, ..] | [
"Returns",
"a",
"list",
"of",
"all",
"the",
"items",
"associated",
"with",
"this",
"panel",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L488-L506 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelBar.moveTab | def moveTab(self, fromIndex, toIndex):
"""
Moves the tab from the inputed index to the given index.
:param fromIndex | <int>
toIndex | <int>
"""
try:
item = self.layout().itemAt(fromIndex)
self.layout().insertItem(toIndex, item.... | python | def moveTab(self, fromIndex, toIndex):
"""
Moves the tab from the inputed index to the given index.
:param fromIndex | <int>
toIndex | <int>
"""
try:
item = self.layout().itemAt(fromIndex)
self.layout().insertItem(toIndex, item.... | [
"def",
"moveTab",
"(",
"self",
",",
"fromIndex",
",",
"toIndex",
")",
":",
"try",
":",
"item",
"=",
"self",
".",
"layout",
"(",
")",
".",
"itemAt",
"(",
"fromIndex",
")",
"self",
".",
"layout",
"(",
")",
".",
"insertItem",
"(",
"toIndex",
",",
"ite... | Moves the tab from the inputed index to the given index.
:param fromIndex | <int>
toIndex | <int> | [
"Moves",
"the",
"tab",
"from",
"the",
"inputed",
"index",
"to",
"the",
"given",
"index",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L508-L519 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelBar.removeTab | def removeTab(self, index):
"""
Removes the tab at the inputed index.
:param index | <int>
"""
curr_index = self.currentIndex()
items = list(self.items())
item = items[index]
item.close()
if index <= curr_index:
self._currentInde... | python | def removeTab(self, index):
"""
Removes the tab at the inputed index.
:param index | <int>
"""
curr_index = self.currentIndex()
items = list(self.items())
item = items[index]
item.close()
if index <= curr_index:
self._currentInde... | [
"def",
"removeTab",
"(",
"self",
",",
"index",
")",
":",
"curr_index",
"=",
"self",
".",
"currentIndex",
"(",
")",
"items",
"=",
"list",
"(",
"self",
".",
"items",
"(",
")",
")",
"item",
"=",
"items",
"[",
"index",
"]",
"item",
".",
"close",
"(",
... | Removes the tab at the inputed index.
:param index | <int> | [
"Removes",
"the",
"tab",
"at",
"the",
"inputed",
"index",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L546-L558 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelBar.requestAddMenu | def requestAddMenu(self):
"""
Emits the add requested signal.
"""
point = QtCore.QPoint(self._addButton.width(), 0)
point = self._addButton.mapToGlobal(point)
self.addRequested.emit(point) | python | def requestAddMenu(self):
"""
Emits the add requested signal.
"""
point = QtCore.QPoint(self._addButton.width(), 0)
point = self._addButton.mapToGlobal(point)
self.addRequested.emit(point) | [
"def",
"requestAddMenu",
"(",
"self",
")",
":",
"point",
"=",
"QtCore",
".",
"QPoint",
"(",
"self",
".",
"_addButton",
".",
"width",
"(",
")",
",",
"0",
")",
"point",
"=",
"self",
".",
"_addButton",
".",
"mapToGlobal",
"(",
"point",
")",
"self",
".",... | Emits the add requested signal. | [
"Emits",
"the",
"add",
"requested",
"signal",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L560-L566 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelBar.requestOptionsMenu | def requestOptionsMenu(self):
"""
Emits the options request signal.
"""
point = QtCore.QPoint(0, self._optionsButton.height())
point = self._optionsButton.mapToGlobal(point)
self.optionsRequested.emit(point) | python | def requestOptionsMenu(self):
"""
Emits the options request signal.
"""
point = QtCore.QPoint(0, self._optionsButton.height())
point = self._optionsButton.mapToGlobal(point)
self.optionsRequested.emit(point) | [
"def",
"requestOptionsMenu",
"(",
"self",
")",
":",
"point",
"=",
"QtCore",
".",
"QPoint",
"(",
"0",
",",
"self",
".",
"_optionsButton",
".",
"height",
"(",
")",
")",
"point",
"=",
"self",
".",
"_optionsButton",
".",
"mapToGlobal",
"(",
"point",
")",
"... | Emits the options request signal. | [
"Emits",
"the",
"options",
"request",
"signal",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L568-L574 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelBar.setCurrentIndex | def setCurrentIndex(self, index):
"""
Sets the current item to the item at the inputed index.
:param index | <int>
"""
if self._currentIndex == index:
return
self._currentIndex = index
self.currentIndexChanged.emit(index)
for i, item in... | python | def setCurrentIndex(self, index):
"""
Sets the current item to the item at the inputed index.
:param index | <int>
"""
if self._currentIndex == index:
return
self._currentIndex = index
self.currentIndexChanged.emit(index)
for i, item in... | [
"def",
"setCurrentIndex",
"(",
"self",
",",
"index",
")",
":",
"if",
"self",
".",
"_currentIndex",
"==",
"index",
":",
"return",
"self",
".",
"_currentIndex",
"=",
"index",
"self",
".",
"currentIndexChanged",
".",
"emit",
"(",
"index",
")",
"for",
"i",
"... | Sets the current item to the item at the inputed index.
:param index | <int> | [
"Sets",
"the",
"current",
"item",
"to",
"the",
"item",
"at",
"the",
"inputed",
"index",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L576-L590 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelBar.setFixedHeight | def setFixedHeight(self, height):
"""
Sets the fixed height for this bar to the inputed height.
:param height | <int>
"""
super(XViewPanelBar, self).setFixedHeight(height)
# update the layout
if self.layout():
for i in xrange(self.layout().count... | python | def setFixedHeight(self, height):
"""
Sets the fixed height for this bar to the inputed height.
:param height | <int>
"""
super(XViewPanelBar, self).setFixedHeight(height)
# update the layout
if self.layout():
for i in xrange(self.layout().count... | [
"def",
"setFixedHeight",
"(",
"self",
",",
"height",
")",
":",
"super",
"(",
"XViewPanelBar",
",",
"self",
")",
".",
"setFixedHeight",
"(",
"height",
")",
"if",
"self",
".",
"layout",
"(",
")",
":",
"for",
"i",
"in",
"xrange",
"(",
"self",
".",
"layo... | Sets the fixed height for this bar to the inputed height.
:param height | <int> | [
"Sets",
"the",
"fixed",
"height",
"for",
"this",
"bar",
"to",
"the",
"inputed",
"height",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L610-L624 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanelBar.setTabText | def setTabText(self, index, text):
"""
Returns the text for the tab at the inputed index.
:param index | <int>
:return <str>
"""
try:
self.items()[index].setText(text)
except IndexError:
pass | python | def setTabText(self, index, text):
"""
Returns the text for the tab at the inputed index.
:param index | <int>
:return <str>
"""
try:
self.items()[index].setText(text)
except IndexError:
pass | [
"def",
"setTabText",
"(",
"self",
",",
"index",
",",
"text",
")",
":",
"try",
":",
"self",
".",
"items",
"(",
")",
"[",
"index",
"]",
".",
"setText",
"(",
"text",
")",
"except",
"IndexError",
":",
"pass"
] | Returns the text for the tab at the inputed index.
:param index | <int>
:return <str> | [
"Returns",
"the",
"text",
"for",
"the",
"tab",
"at",
"the",
"inputed",
"index",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L626-L637 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanel.closePanel | def closePanel(self):
"""
Closes a full view panel.
"""
# make sure we can close all the widgets in the view first
for i in range(self.count()):
if not self.widget(i).canClose():
return False
container = self.parentWidget()
viewWidget ... | python | def closePanel(self):
"""
Closes a full view panel.
"""
# make sure we can close all the widgets in the view first
for i in range(self.count()):
if not self.widget(i).canClose():
return False
container = self.parentWidget()
viewWidget ... | [
"def",
"closePanel",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"count",
"(",
")",
")",
":",
"if",
"not",
"self",
".",
"widget",
"(",
"i",
")",
".",
"canClose",
"(",
")",
":",
"return",
"False",
"container",
"=",
"self",
... | Closes a full view panel. | [
"Closes",
"a",
"full",
"view",
"panel",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L935-L993 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanel.ensureVisible | def ensureVisible(self, viewType):
"""
Find and switch to the first tab of the specified view type. If the
type does not exist, add it.
:param viewType | <subclass of XView>
:return <XView> || None
"""
# make sure we're not trying to switch to the same ty... | python | def ensureVisible(self, viewType):
"""
Find and switch to the first tab of the specified view type. If the
type does not exist, add it.
:param viewType | <subclass of XView>
:return <XView> || None
"""
# make sure we're not trying to switch to the same ty... | [
"def",
"ensureVisible",
"(",
"self",
",",
"viewType",
")",
":",
"view",
"=",
"self",
".",
"currentView",
"(",
")",
"if",
"type",
"(",
"view",
")",
"==",
"viewType",
":",
"return",
"view",
"self",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"s... | Find and switch to the first tab of the specified view type. If the
type does not exist, add it.
:param viewType | <subclass of XView>
:return <XView> || None | [
"Find",
"and",
"switch",
"to",
"the",
"first",
"tab",
"of",
"the",
"specified",
"view",
"type",
".",
"If",
"the",
"type",
"does",
"not",
"exist",
"add",
"it",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L1121-L1150 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanel.insertTab | def insertTab(self, index, widget, title):
"""
Inserts a new tab for this widget.
:param index | <int>
widget | <QtGui.QWidget>
title | <str>
"""
self.insertWidget(index, widget)
tab = self.tabBar().insertTab(index, title)
... | python | def insertTab(self, index, widget, title):
"""
Inserts a new tab for this widget.
:param index | <int>
widget | <QtGui.QWidget>
title | <str>
"""
self.insertWidget(index, widget)
tab = self.tabBar().insertTab(index, title)
... | [
"def",
"insertTab",
"(",
"self",
",",
"index",
",",
"widget",
",",
"title",
")",
":",
"self",
".",
"insertWidget",
"(",
"index",
",",
"widget",
")",
"tab",
"=",
"self",
".",
"tabBar",
"(",
")",
".",
"insertTab",
"(",
"index",
",",
"title",
")",
"ta... | Inserts a new tab for this widget.
:param index | <int>
widget | <QtGui.QWidget>
title | <str> | [
"Inserts",
"a",
"new",
"tab",
"for",
"this",
"widget",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L1225-L1235 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanel.markCurrentChanged | def markCurrentChanged(self):
"""
Marks that the current widget has changed.
"""
view = self.currentView()
if view:
view.setCurrent()
self.setFocus()
view.setFocus()
self._hintLabel.hide()
else:
self._hintLabel.s... | python | def markCurrentChanged(self):
"""
Marks that the current widget has changed.
"""
view = self.currentView()
if view:
view.setCurrent()
self.setFocus()
view.setFocus()
self._hintLabel.hide()
else:
self._hintLabel.s... | [
"def",
"markCurrentChanged",
"(",
"self",
")",
":",
"view",
"=",
"self",
".",
"currentView",
"(",
")",
"if",
"view",
":",
"view",
".",
"setCurrent",
"(",
")",
"self",
".",
"setFocus",
"(",
")",
"view",
".",
"setFocus",
"(",
")",
"self",
".",
"_hintLa... | Marks that the current widget has changed. | [
"Marks",
"that",
"the",
"current",
"widget",
"has",
"changed",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L1254-L1271 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanel.refreshTitles | def refreshTitles(self):
"""
Refreshes the titles for each view within this tab panel.
"""
for index in range(self.count()):
widget = self.widget(index)
self.setTabText(index, widget.windowTitle()) | python | def refreshTitles(self):
"""
Refreshes the titles for each view within this tab panel.
"""
for index in range(self.count()):
widget = self.widget(index)
self.setTabText(index, widget.windowTitle()) | [
"def",
"refreshTitles",
"(",
"self",
")",
":",
"for",
"index",
"in",
"range",
"(",
"self",
".",
"count",
"(",
")",
")",
":",
"widget",
"=",
"self",
".",
"widget",
"(",
"index",
")",
"self",
".",
"setTabText",
"(",
"index",
",",
"widget",
".",
"wind... | Refreshes the titles for each view within this tab panel. | [
"Refreshes",
"the",
"titles",
"for",
"each",
"view",
"within",
"this",
"tab",
"panel",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L1301-L1307 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanel.setCurrentIndex | def setCurrentIndex(self, index):
"""
Sets the current index on self and on the tab bar to keep the two insync.
:param index | <int>
"""
super(XViewPanel, self).setCurrentIndex(index)
self.tabBar().setCurrentIndex(index) | python | def setCurrentIndex(self, index):
"""
Sets the current index on self and on the tab bar to keep the two insync.
:param index | <int>
"""
super(XViewPanel, self).setCurrentIndex(index)
self.tabBar().setCurrentIndex(index) | [
"def",
"setCurrentIndex",
"(",
"self",
",",
"index",
")",
":",
"super",
"(",
"XViewPanel",
",",
"self",
")",
".",
"setCurrentIndex",
"(",
"index",
")",
"self",
".",
"tabBar",
"(",
")",
".",
"setCurrentIndex",
"(",
"index",
")"
] | Sets the current index on self and on the tab bar to keep the two insync.
:param index | <int> | [
"Sets",
"the",
"current",
"index",
"on",
"self",
"and",
"on",
"the",
"tab",
"bar",
"to",
"keep",
"the",
"two",
"insync",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L1452-L1459 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewpanel.py | XViewPanel.switchCurrentView | def switchCurrentView(self, viewType):
"""
Swaps the current tab view for the inputed action's type.
:param action | <QAction>
:return <XView> || None
"""
if not self.count():
return self.addView(viewType)
# make sure we're not trying to sw... | python | def switchCurrentView(self, viewType):
"""
Swaps the current tab view for the inputed action's type.
:param action | <QAction>
:return <XView> || None
"""
if not self.count():
return self.addView(viewType)
# make sure we're not trying to sw... | [
"def",
"switchCurrentView",
"(",
"self",
",",
"viewType",
")",
":",
"if",
"not",
"self",
".",
"count",
"(",
")",
":",
"return",
"self",
".",
"addView",
"(",
"viewType",
")",
"view",
"=",
"self",
".",
"currentView",
"(",
")",
"if",
"type",
"(",
"view"... | Swaps the current tab view for the inputed action's type.
:param action | <QAction>
:return <XView> || None | [
"Swaps",
"the",
"current",
"tab",
"view",
"for",
"the",
"inputed",
"action",
"s",
"type",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewpanel.py#L1503-L1540 | train |
johnnoone/aioconsul | aioconsul/client/kv_endpoint.py | ReadMixin.keys | async def keys(self, prefix, *,
dc=None, separator=None, watch=None, consistency=None):
"""Returns a list of the keys under the given prefix
Parameters:
prefix (str): Prefix to fetch
separator (str): List only up to a given separator
dc (str): Spec... | python | async def keys(self, prefix, *,
dc=None, separator=None, watch=None, consistency=None):
"""Returns a list of the keys under the given prefix
Parameters:
prefix (str): Prefix to fetch
separator (str): List only up to a given separator
dc (str): Spec... | [
"async",
"def",
"keys",
"(",
"self",
",",
"prefix",
",",
"*",
",",
"dc",
"=",
"None",
",",
"separator",
"=",
"None",
",",
"watch",
"=",
"None",
",",
"consistency",
"=",
"None",
")",
":",
"response",
"=",
"await",
"self",
".",
"_read",
"(",
"prefix"... | Returns a list of the keys under the given prefix
Parameters:
prefix (str): Prefix to fetch
separator (str): List only up to a given separator
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (B... | [
"Returns",
"a",
"list",
"of",
"the",
"keys",
"under",
"the",
"given",
"prefix"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/kv_endpoint.py#L39-L68 | train |
johnnoone/aioconsul | aioconsul/client/kv_endpoint.py | ReadMixin.get_tree | async def get_tree(self, prefix, *,
dc=None, separator=None, watch=None, consistency=None):
"""Gets all keys with a prefix of Key during the transaction.
Parameters:
prefix (str): Prefix to fetch
separator (str): List only up to a given separator
... | python | async def get_tree(self, prefix, *,
dc=None, separator=None, watch=None, consistency=None):
"""Gets all keys with a prefix of Key during the transaction.
Parameters:
prefix (str): Prefix to fetch
separator (str): List only up to a given separator
... | [
"async",
"def",
"get_tree",
"(",
"self",
",",
"prefix",
",",
"*",
",",
"dc",
"=",
"None",
",",
"separator",
"=",
"None",
",",
"watch",
"=",
"None",
",",
"consistency",
"=",
"None",
")",
":",
"response",
"=",
"await",
"self",
".",
"_read",
"(",
"pre... | Gets all keys with a prefix of Key during the transaction.
Parameters:
prefix (str): Prefix to fetch
separator (str): List only up to a given separator
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
... | [
"Gets",
"all",
"keys",
"with",
"a",
"prefix",
"of",
"Key",
"during",
"the",
"transaction",
"."
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/kv_endpoint.py#L141-L168 | train |
johnnoone/aioconsul | aioconsul/client/kv_endpoint.py | WriteMixin.cas | async def cas(self, key, value, *, flags=None, index):
"""Sets the key to the given value with check-and-set semantics.
Parameters:
key (str): Key to set
value (Payload): Value to set, It will be encoded by flags
index (ObjectIndex): Index ID
flags (int):... | python | async def cas(self, key, value, *, flags=None, index):
"""Sets the key to the given value with check-and-set semantics.
Parameters:
key (str): Key to set
value (Payload): Value to set, It will be encoded by flags
index (ObjectIndex): Index ID
flags (int):... | [
"async",
"def",
"cas",
"(",
"self",
",",
"key",
",",
"value",
",",
"*",
",",
"flags",
"=",
"None",
",",
"index",
")",
":",
"value",
"=",
"encode_value",
"(",
"value",
",",
"flags",
")",
"index",
"=",
"extract_attr",
"(",
"index",
",",
"keys",
"=",
... | Sets the key to the given value with check-and-set semantics.
Parameters:
key (str): Key to set
value (Payload): Value to set, It will be encoded by flags
index (ObjectIndex): Index ID
flags (int): Flags to set with value
Response:
bool: ``Tru... | [
"Sets",
"the",
"key",
"to",
"the",
"given",
"value",
"with",
"check",
"-",
"and",
"-",
"set",
"semantics",
"."
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/kv_endpoint.py#L187-L208 | train |
johnnoone/aioconsul | aioconsul/client/kv_endpoint.py | WriteMixin.lock | async def lock(self, key, value, *, flags=None, session):
"""Locks the Key with the given Session.
Parameters:
key (str): Key to set
value (Payload): Value to set, It will be encoded by flags
session (ObjectID): Session ID
flags (int): Flags to set with v... | python | async def lock(self, key, value, *, flags=None, session):
"""Locks the Key with the given Session.
Parameters:
key (str): Key to set
value (Payload): Value to set, It will be encoded by flags
session (ObjectID): Session ID
flags (int): Flags to set with v... | [
"async",
"def",
"lock",
"(",
"self",
",",
"key",
",",
"value",
",",
"*",
",",
"flags",
"=",
"None",
",",
"session",
")",
":",
"value",
"=",
"encode_value",
"(",
"value",
",",
"flags",
")",
"session_id",
"=",
"extract_attr",
"(",
"session",
",",
"keys... | Locks the Key with the given Session.
Parameters:
key (str): Key to set
value (Payload): Value to set, It will be encoded by flags
session (ObjectID): Session ID
flags (int): Flags to set with value
Response:
bool: ``True`` on success
... | [
"Locks",
"the",
"Key",
"with",
"the",
"given",
"Session",
"."
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/kv_endpoint.py#L210-L229 | train |
johnnoone/aioconsul | aioconsul/client/kv_endpoint.py | WriteMixin.unlock | async def unlock(self, key, value, *, flags=None, session):
"""Unlocks the Key with the given Session.
Parameters:
key (str): Key to set
value (Payload): Value to set, It will be encoded by flags
session (ObjectID): Session ID
flags (int): Flags to set wi... | python | async def unlock(self, key, value, *, flags=None, session):
"""Unlocks the Key with the given Session.
Parameters:
key (str): Key to set
value (Payload): Value to set, It will be encoded by flags
session (ObjectID): Session ID
flags (int): Flags to set wi... | [
"async",
"def",
"unlock",
"(",
"self",
",",
"key",
",",
"value",
",",
"*",
",",
"flags",
"=",
"None",
",",
"session",
")",
":",
"value",
"=",
"encode_value",
"(",
"value",
",",
"flags",
")",
"session_id",
"=",
"extract_attr",
"(",
"session",
",",
"ke... | Unlocks the Key with the given Session.
Parameters:
key (str): Key to set
value (Payload): Value to set, It will be encoded by flags
session (ObjectID): Session ID
flags (int): Flags to set with value
Response:
bool: ``True`` on success
... | [
"Unlocks",
"the",
"Key",
"with",
"the",
"given",
"Session",
"."
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/kv_endpoint.py#L231-L250 | train |
johnnoone/aioconsul | aioconsul/client/kv_endpoint.py | DeleteMixin.delete_tree | async def delete_tree(self, prefix, *, separator=None):
"""Deletes all keys with a prefix of Key.
Parameters:
key (str): Key to delete
separator (str): Delete only up to a given separator
Response:
bool: ``True`` on success
"""
response = awai... | python | async def delete_tree(self, prefix, *, separator=None):
"""Deletes all keys with a prefix of Key.
Parameters:
key (str): Key to delete
separator (str): Delete only up to a given separator
Response:
bool: ``True`` on success
"""
response = awai... | [
"async",
"def",
"delete_tree",
"(",
"self",
",",
"prefix",
",",
"*",
",",
"separator",
"=",
"None",
")",
":",
"response",
"=",
"await",
"self",
".",
"_discard",
"(",
"prefix",
",",
"recurse",
"=",
"True",
",",
"separator",
"=",
"separator",
")",
"retur... | Deletes all keys with a prefix of Key.
Parameters:
key (str): Key to delete
separator (str): Delete only up to a given separator
Response:
bool: ``True`` on success | [
"Deletes",
"all",
"keys",
"with",
"a",
"prefix",
"of",
"Key",
"."
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/kv_endpoint.py#L288-L300 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.