Best Python code snippet using avocado_python
urls.py
Source:urls.py
1# Copyright (C) 2012 Ion Torrent Systems, Inc. All Rights Reserved2from django.conf.urls import patterns, url, include3urlpatterns = patterns(4 "iondb.rundb.configure",5 url(r"^$", "views.configure", name="configure"),6 url(r"^about/$", "views.configure_about", name="configure_about"),7 url(r"^ionreporter/$", "views.configure_ionreporter", name="configure_ionreporter"),8 url(r"^account/$", "views.configure_account", name="configure_account"),9 url(10 r"^ampliseq/downloads/$",11 "views.configure_ampliseq_download",12 name="configure_ampliseq_download",13 ),14 url(15 r"^ampliseq/logout/$",16 "views.configure_ampliseq_logout",17 name="configure_ampliseq_logout",18 ),19 url(20 r"^ampliseq/getGridData/$",21 "views.configure_ampliseq_getGridData",22 name="configure_ampliseq_getGridData",23 ),24 url(r"^ampliseq/$", "views.configure_ampliseq", name="configure_ampliseq"),25 url(r"^plugins/$", "views.configure_plugins", name="configure_plugins"),26 url(r"^mesh/$", "views.configure_mesh", name="configure_mesh"),27 url(r"^mesh/link/$", "views.link_mesh_node", name="link_mesh_node"),28 url(29 r"^mesh/delete/(?P<pk>\d+)/$", "views.delete_mesh_node", name="delete_mesh_node"30 ),31 url(32 r"^plugins/plugin/install/$",33 "views.configure_plugins_plugin_install",34 name="configure_plugins_plugin_install",35 ),36 url(37 r"^plugins/plugin/(?P<pk>\d+)/configure/(?P<action>\w+)/$",38 "views.configure_plugins_plugin_configure",39 name="configure_plugins_plugin_configure",40 ),41 url(42 r"^plugins/plugin/(?P<pk>\d+)/configure/(?P<action>\w+)/pluginMedia/(?P<path>.*)$",43 "views.configure_plugins_pluginmedia",44 name="configure_plugins_pluginmedia",45 ),46 url(47 r"^plugins/plugin/(?P<pk>\d+)/uninstall/$",48 "views.configure_plugins_plugin_uninstall",49 name="configure_plugins_plugin_uninstall",50 ),51 url(52 r"^plugins/plugin/(?P<pk>\d+)/upgrade/$",53 "views.configure_plugins_plugin_upgrade",54 name="configure_plugins_plugin_upgrade",55 ),56 url(57 r"^plugins/plugin/(?P<pk>\d+)/(?P<version>[^/]+)/install_to_version/$",58 "views.configure_plugins_plugin_install_to_version",59 name="configure_plugins_plugin_install_to_version",60 ),61 url(62 r"^plugins/plugin/(?P<pk>\d+)/usage/$",63 "views.configure_plugins_plugin_usage",64 name="configure_plugins_plugin_usage",65 ),66 url(67 r"^plugins/plugin/upload/zip/$",68 "views.configure_plugins_plugin_zip_upload",69 name="configure_plugins_plugin_zip_upload",70 ),71 url(72 r"^plugins/plugin/enable/(\d+)/(\d)$",73 "views.configure_plugins_plugin_enable",74 name="configure_plugins_plugin_enable",75 ),76 url(77 r"^plugins/plugin/defaultSelected/(\d+)/(\d)$",78 "views.configure_plugins_plugin_default_selected",79 name="configure_plugins_plugin_default_selected",80 ),81 url(82 r"^plugins/publisher/install/$",83 "views.configure_publisher_install",84 name="configure_publisher_install",85 ),86 url(r"^references/$", "views.configure_references", name="configure_references"),87 url(r"^references/tf/$", "views.references_TF_edit", name="references_TF_edit"),88 url(89 r"^references/tf/(\d+)$", "views.references_TF_edit", name="references_TF_edit"90 ),91 url(92 r"^references/tf/(\d+)/delete/$",93 "views.references_TF_delete",94 name="references_TF_delete",95 ),96 url(97 r"^references/genome/download/$",98 "genomes.download_genome",99 name="references_genome_download",100 ),101 url(102 r"^references/genome/add/$",103 "genomes.add_custom_genome",104 name="add_custom_genome",105 ),106 url(107 r"^references/genome/upload/$",108 "genomes.file_upload",109 name="references_genome_file_upload",110 ),111 url(112 r"^references/genome/edit/(\w+)$",113 "genomes.edit_genome",114 name="references_genome_edit",115 ),116 url(117 r"^references/genome/delete/(\d+)$",118 "genomes.delete_genome",119 name="references_genome_delete",120 ),121 url(122 r"^references/genome/rebuild/(?P<reference_id>\w+)$",123 "genomes.start_index_rebuild",124 name="references_genome_start_index_rebuild",125 ),126 url(127 r"^references/genome/status/(\d+)$",128 "genomes.genome_status",129 name="references_genome_status",130 ),131 url(132 r"^references/genome/install_bedfiles/$",133 "genomes.start_install_bedfiles",134 name="start_install_bedfiles",135 ),136 url(137 r"^references/genome/install_annotationfiles/$",138 "genomes.start_install_annotationfiles",139 name="start_install_annotationfiles",140 ),141 url(142 r"^references/barcodeset/$",143 "views.references_barcodeset_add",144 name="references_barcodeset_add",145 ),146 url(147 r"^references/barcodeset/(?P<barcodesetid>\d+)/$",148 "views.references_barcodeset",149 name="references_barcodeset",150 ),151 url(152 r"^references/barcodeset/(?P<barcodesetid>\d+)/delete/$",153 "views.references_barcodeset_delete",154 name="references_barcodeset_delete",155 ),156 url(157 r"^references/barcodeset/(?P<barcodesetid>\d+)/csv/$",158 "views.reference_barcodeset_csv",159 name="references_barcodeset_csv",160 ),161 url(162 r"^references/barcodeset/(?P<barcodesetid>\d+)/barcode/add/$",163 "views.references_barcode_add",164 name="references_barcode_add",165 ),166 url(167 r"^references/barcodeset/(?P<barcodesetid>\d+)/barcode/(?P<pk>\d+)/$",168 "views.references_barcode_edit",169 name="references_barcode_edit",170 ),171 url(172 r"^references/barcodeset/(?P<barcodesetid>\d+)/barcode/(?P<pk>[\d,]+)/delete/$",173 "views.references_barcode_delete",174 name="references_barcode_delete",175 ),176 url(r"^services/$", "views.configure_services", name="configure_services"),177 url(178 r"^services/telemetry_services_toggle$",179 "views.configure_telemetry_services_toggle",180 name="configure_telemetry_services_toggle",181 ),182 url(r"^services/cache/$", "views.cache_status", name="cache_status"),183 url(r"^configure/$", "views.configure_configure", name="configure_configure"),184 url(r"^configure/editemail/(\d+)?$", "views.edit_email", name="edit_email"),185 url(r"^configure/deleteemail/(\d+)?$", "views.delete_email", name="delete_email"),186 url(187 r"^configure/auto_detect_timezone/$",188 "views.auto_detect_timezone",189 name="auto_detect_timezone",190 ),191 url(192 r"^configure/get_all_cities/(?P<zone>\w+)/$",193 "views.get_all_cities",194 name="get_all_cities",195 ),196 url(r"^configure/get_avail_mnts/(?P<ip>.*)/$", "views.get_avail_mnts"),197 url(198 r"^configure/get_avail_mnts/([0-2]?\d{0,2}\.){3}([0-2]?\d{0,2})$/",199 "views.get_avail_mnts",200 ),201 url(r"^configure/add_nas_storage/", "views.add_nas_storage"),202 url(r"^configure/get_current_mnts/", "views.get_current_mnts"),203 url(r"^configure/remove_nas_storage/", "views.remove_nas_storage"),204 url(r"^configure/get_nas_devices/", "views.get_nas_devices"),205 url(r"^configure/check_nas_perms/", "views.check_nas_perms"),206 url(r"^newupdates/$", "views.offcycle_updates", name="offcycle_updates"),207 url(208 r"^newupdates/(?P<offcycle_type>\w+)/$",209 "views.offcycle_updates",210 name="offcycle_updates",211 ),212 url(213 r"^newupdates/product/(.+)/(.+)/$",214 "views.offcycle_updates_install_product",215 name="update_product",216 ),217 url(218 r"^newupdates/package/(.+)/(.+)/$",219 "views.offcycle_updates_install_package",220 name="update_package",221 ),222 url(223 r"^newupdates/offline/bundle/$",224 "views.configure_offline_bundle",225 name="configure_offline_bundle",226 ),227 url(228 r"^newupdates/offline/bundle/upload/$",229 "views.configure_offline_bundle_upload",230 name="configure_offline_bundle_upload",231 ),232 url(233 r"^newupdates/offline/offcyle/install/$",234 "views.configure_offline_install",235 name="configure_offline_install",236 ),237 url(238 r"^services/controljob/(\d+)/((?:term)|(?:stop)|(?:cont))$",239 "views.control_job",240 name="control_job",241 ),242 url(r"^chips/$", "chips.showpage", name="configure_instrument_stats"),243 url(r"^info/$", "views.configure_system_stats", name="configure_system_stats"),244 url(245 r"^info/data$",246 "views.configure_system_stats_data",247 name="configure_system_stats_data",248 ),249 url(250 r"^info/SSA.zip",251 "views.system_support_archive",252 name="configure_support_archive",253 ),254 url(r"^raid_info/(\d+)/$", "views.raid_info"),255 url(256 r"^services/raid_info/refresh/$",257 "views.raid_info_refresh",258 name="raid_info_refresh",259 ),260 url(r"^timezone/$", "util.readTimezone"),261 url(r"^services/queueStat/$", "views.queueStatus"),262 url(r"^services/jobStat/(\d+)/$", "views.jobStatus"),263 url(r"^services/sgejob/(\d+)/$", "views.jobDetails"),264 url(265 r"^services/cluster_info/refresh/$",266 "views.cluster_info_refresh",267 name="cluster_info_refresh",268 ),269 url(270 r"^services/cluster_info/log/(?P<pk>\d+)/$",271 "views.cluster_info_log",272 name="cluster_info_log",273 ),274 url(275 r"^services/cluster_info/history/$",276 "views.cluster_info_history",277 name="cluster_info_history",278 ),279 url(280 r"^services/cluster_ctrl/(?P<name>\w+)/(?P<action>\w+)/$",281 "views.cluster_ctrl",282 name="cluster_ctrl",283 ),284 url(285 r"^services/torrent_nas_section/$",286 "views.torrent_nas_section",287 name="torrent_nas_section",288 ),289 (r"^getZip/(.+)$", "chips.getChipZip"),290 (r"^getChipLog/(.+)$", "chips.getChipLog"),291 (r"^getChipPdf/(.+)$", "chips.getChipPdf"),292 (r"^getProtonDiags/(.+)$", "chips.getProtonDiags"),293 url(294 r"^analysisargs/$",295 "views.configure_analysisargs",296 name="configure_analysisargs",297 ),298 url(299 r"^analysisargs/(?P<pk>\d+)/(?P<action>\w+)$",300 "views.configure_analysisargs_action",301 name="configure_analysisargs_action",302 ),...
ddl_references.py
Source:ddl_references.py
...13 """14 Return whether or not this instance references the specified column.15 """16 return False17 def rename_table_references(self, old_table, new_table):18 """19 Rename all references to the old_name to the new_table.20 """21 pass22 def rename_column_references(self, table, old_column, new_column):23 """24 Rename all references to the old_column to the new_column.25 """26 pass27 def __repr__(self):28 return '<%s %r>' % (self.__class__.__name__, str(self))29 def __str__(self):30 raise NotImplementedError('Subclasses must define how they should be converted to string.')31class Table(Reference):32 """Hold a reference to a table."""33 def __init__(self, table, quote_name):34 self.table = table35 self.quote_name = quote_name36 def references_table(self, table):37 return self.table == table38 def rename_table_references(self, old_table, new_table):39 if self.table == old_table:40 self.table = new_table41 def __str__(self):42 return self.quote_name(self.table)43class TableColumns(Table):44 """Base class for references to multiple columns of a table."""45 def __init__(self, table, columns):46 self.table = table47 self.columns = columns48 def references_column(self, table, column):49 return self.table == table and column in self.columns50 def rename_column_references(self, table, old_column, new_column):51 if self.table == table:52 for index, column in enumerate(self.columns):53 if column == old_column:54 self.columns[index] = new_column55class Columns(TableColumns):56 """Hold a reference to one or many columns."""57 def __init__(self, table, columns, quote_name, col_suffixes=()):58 self.quote_name = quote_name59 self.col_suffixes = col_suffixes60 super().__init__(table, columns)61 def __str__(self):62 def col_str(column, idx):63 try:64 return self.quote_name(column) + self.col_suffixes[idx]65 except IndexError:66 return self.quote_name(column)67 return ', '.join(col_str(column, idx) for idx, column in enumerate(self.columns))68class IndexName(TableColumns):69 """Hold a reference to an index name."""70 def __init__(self, table, columns, suffix, create_index_name):71 self.suffix = suffix72 self.create_index_name = create_index_name73 super().__init__(table, columns)74 def __str__(self):75 return self.create_index_name(self.table, self.columns, self.suffix)76class ForeignKeyName(TableColumns):77 """Hold a reference to a foreign key name."""78 def __init__(self, from_table, from_columns, to_table, to_columns, suffix_template, create_fk_name):79 self.to_reference = TableColumns(to_table, to_columns)80 self.suffix_template = suffix_template81 self.create_fk_name = create_fk_name82 super().__init__(from_table, from_columns,)83 def references_table(self, table):84 return super().references_table(table) or self.to_reference.references_table(table)85 def references_column(self, table, column):86 return (87 super().references_column(table, column) or88 self.to_reference.references_column(table, column)89 )90 def rename_table_references(self, old_table, new_table):91 super().rename_table_references(old_table, new_table)92 self.to_reference.rename_table_references(old_table, new_table)93 def rename_column_references(self, table, old_column, new_column):94 super().rename_column_references(table, old_column, new_column)95 self.to_reference.rename_column_references(table, old_column, new_column)96 def __str__(self):97 suffix = self.suffix_template % {98 'to_table': self.to_reference.table,99 'to_column': self.to_reference.columns[0],100 }101 return self.create_fk_name(self.table, self.columns, suffix)102class Statement(Reference):103 """104 Statement template and formatting parameters container.105 Allows keeping a reference to a statement without interpolating identifiers106 that might have to be adjusted if they're referencing a table or column107 that is removed108 """109 def __init__(self, template, **parts):110 self.template = template111 self.parts = parts112 def references_table(self, table):113 return any(114 hasattr(part, 'references_table') and part.references_table(table)115 for part in self.parts.values()116 )117 def references_column(self, table, column):118 return any(119 hasattr(part, 'references_column') and part.references_column(table, column)120 for part in self.parts.values()121 )122 def rename_table_references(self, old_table, new_table):123 for part in self.parts.values():124 if hasattr(part, 'rename_table_references'):125 part.rename_table_references(old_table, new_table)126 def rename_column_references(self, table, old_column, new_column):127 for part in self.parts.values():128 if hasattr(part, 'rename_column_references'):129 part.rename_column_references(table, old_column, new_column)130 def __str__(self):...
test_nessie_client.py
Source:test_nessie_client.py
...22 """Test client object against live server."""23 client = init()24 assert isinstance(client.get_base_url(), str)25 assert client.get_base_url() == "http://localhost:19120/api/v1"26 references = client.list_references().references27 assert len(references) == 128 assert references[0] == Branch("main", references[0].hash_)29 main_name = references[0].name30 main_commit = references[0].hash_31 with pytest.raises(NessieConflictException):32 client.create_branch("main")33 created_reference = client.create_branch("test", main_name, main_commit)34 references = client.list_references().references35 assert len(references) == 236 assert next(i for i in references if i.name == "main") == Branch("main", main_commit)37 assert next(i for i in references if i.name == "test") == Branch("test", main_commit)38 reference = client.get_reference("test")39 assert created_reference == reference40 tables = client.list_keys(reference.name, reference.hash_)41 assert isinstance(tables, Entries)42 assert len(tables.entries) == 043 assert isinstance(main_commit, str)44 client.delete_branch("test", main_commit)45 references = client.list_references().references...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!