text stringlengths 0 828 |
|---|
if (row[compare_fields] == |
data['video_config'][compare_fields]).all(): |
break |
else: |
i = None |
if i is None: |
logger.error('Unsupported video config:\n%s', data['video_config']) |
logger.error('Video configs:\n%s', |
self.parent.video_mode_slave.configs) |
self.parent.video_mode_slave.config_combo.set_active(0) |
else: |
logger.error('Set video config (%d):\n%s', i + 1, |
data['video_config']) |
self.parent.video_mode_slave.config_combo.set_active(i + 1)" |
4672,"def on_execute__set_surface_alphas(self, request): |
''' |
.. versionchanged:: 0.12 |
Queue redraw after setting surface alphas. |
''' |
data = decode_content_data(request) |
logger.debug('[on_execute__set_surface_alphas] %s', |
data['surface_alphas']) |
for name, alpha in data['surface_alphas'].iteritems(): |
self.parent.canvas_slave.set_surface_alpha(name, alpha) |
self.parent.canvas_slave.render() |
gobject.idle_add(self.parent.canvas_slave.draw)" |
4673,"def on_execute__set_dynamic_electrode_states(self, request): |
''' |
.. versionadded:: 0.15 |
Set dynamic electrode states. |
''' |
data = decode_content_data(request) |
self.parent.on_dynamic_electrode_states_set(data['electrode_states'])" |
4674,"def on_connect_button__clicked(self, event): |
''' |
Connect to Zero MQ plugin hub (`zmq_plugin.hub.Hub`) using the settings |
from the text entry fields (e.g., hub URI, plugin name). |
Emit `plugin-connected` signal with the new plugin instance after hub |
connection has been established. |
''' |
hub_uri = self.plugin_uri.get_text() |
ui_plugin_name = self.ui_plugin_name.get_text() |
plugin = self.create_plugin(ui_plugin_name, hub_uri) |
self.init_plugin(plugin) |
self.connect_button.set_sensitive(False) |
self.emit('plugin-connected', plugin)" |
4675,"def create_quali_api_instance(context, logger): |
"""""" |
Get needed attributes from context and create instance of QualiApiHelper |
:param context: |
:param logger: |
:return: |
"""""" |
if hasattr(context, 'reservation') and context.reservation: |
domain = context.reservation.domain |
elif hasattr(context, 'remote_reservation') and context.remote_reservation: |
domain = context.remote_reservation.domain |
else: |
domain = None |
address = context.connectivity.server_address |
token = context.connectivity.admin_auth_token |
if token: |
instance = QualiAPIHelper(address, logger, token=token, domain=domain) |
else: |
instance = QualiAPIHelper(address, logger, username='admin', password='admin', domain=domain) |
return instance" |
4676,"def login(self): |
"""""" |
Login |
:return: |
"""""" |
uri = 'API/Auth/Login' |
if self._token: |
json_data = {'token': self._token, 'domain': self._domain} |
else: |
json_data = {'username': self._username, 'password': self._password, 'domain': self._domain} |
result = self.__rest_client.request_put(uri, json_data) |
self.__rest_client.session.headers.update(authorization=""Basic {0}"".format(result.replace('""', '')))" |
4677,"def run_migrations_offline(): |
""""""Run migrations in 'offline' mode. |
This configures the context with just a URL |
and not an Engine, though an Engine is acceptable |
here as well. By skipping the Engine creation |
we don't even need a DBAPI to be available. |
Calls to context.execute() here emit the given string to the |
script output. |
"""""" |
url = winchester_config['database']['url'] |
context.configure(url=url) |
with context.begin_transaction(): |
context.run_migrations()" |
4678,"def run_migrations_online(): |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.