Best Python code snippet using localstack_python
replicate.py
Source:replicate.py
...30 cloud_links = set()31 for cfg in replication:32 ns = '%s.%s' % (self.session.database, cfg['ns'])33 if cfg['dir'] == 'bidi':34 local.set_replication('cloud', ns, ns, cfg['ops'])35 cloud.set_replication('local', ns, ns, cfg['ops'])36 local_links.add((ns,ns))37 cloud_links.add((ns,ns))38 elif cfg['dir'] == 'down':39 local.set_replication('cloud', ns, ns, cfg['ops'])40 local_links.add((ns,ns))41 elif cfg['dir'] == 'up':42 cloud.set_replication('local', ns, ns, cfg['ops'])43 cloud_links.add((ns,ns))44 else:45 raise ValueError, 'Illegal config: %s' % cfg46 47 # Turn off replication not in local/cloud_links48 for repl in local.dump_config()['cloud']['replication']:49 if (repl['dst'], repl['src']) not in local_links:50 local.unset_replication('cloud', repl['dst'])51 for repl in cloud.dump_config()['local']['replication']:52 if (repl['dst'], repl['src']) not in cloud_links:53 cloud.unset_replication('local', repl['dst'])...
urls.py
Source:urls.py
1from django.urls import path2from .views import get_hdfs_metrics, get_clusters, get_active_namenode, \3 get_datanodes, dowanload_file_to_host, upload_file, \4 download_file, get_block_info, get_hdfs_dir, mkdir, \5 delete_file, set_permission, set_owner, set_group, \6 set_replication, validate_target_dir, sqoop_import, \7 get_history_job_metrics, get_current_job_metrics, \8 update_finished_job, up_file, get_file_details9urlpatterns = [10 path('get_metrics/', get_hdfs_metrics, name="get_hdfs_metrics"),11 path('get_clusters/', get_clusters, name="get_clusters"),12 path('get_active_namenode/', get_active_namenode, name="get_active_namenode"),13 path('get_datanodes/', get_datanodes, name="get_datanodes"),14 path('dowanload_file_to_host/', dowanload_file_to_host, name="dowanload_file_to_host"),15 path('upload_file/', upload_file, name="upload_file"),16 path('up_file/', up_file, name="up_file"),17 path('download_file/', download_file, name='download_file'),18 path('get_block_info/', get_block_info, name='get_block_info'),19 path('get_file_details/', get_file_details, name='get_file_details'),20 path('get_hdfs_dir/', get_hdfs_dir, name='get_hdfs_dir'),21 path('mkdir/', mkdir, name='mkdir'),22 path('delete_file/', delete_file, name='delete_file'),23 path('set_permission/', set_permission, name='set_permission'),24 path('set_owner/', set_owner, name='set_owner'),25 path('set_group/', set_group, name='set_group'),26 path('set_replication/', set_replication, name='set_replication'),27 path('validate_target_dir/', validate_target_dir, name='validate_target_dir'),28 path('sqoop_import/', sqoop_import, name="sqoop_import"),29 path('get_history_job_metrics/', get_history_job_metrics, name="get_history_job_metrics"),30 path('get_current_job_metrics/', get_current_job_metrics, name='get_current_job_metrics'),31 path('update_finished_job/', update_finished_job, name='update_finished_job'),...
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!!