Best Python code snippet using autotest_python
bdp_hepler.py
Source:bdp_hepler.py
...104 22960, 812, 8197, 1039, 185, 674]]105 bdp_manager = BDPManager(TABLE_NAME)106 bdp_manager.insert_data(fields, data)107 bdp_manager.commit()108def insert_kernel(fields, data):109 bdp_manager = BDPManager(TABLE_NAME)110 bdp_manager.insert_data(fields, data)111 bdp_manager.commit()112 print "data commited"113def insert_one_day():114 # å¿
é¡»å idï¼å¦åé»è®¤ä¸º''ï¼ä¼è¦çä¹åçæ°æ®115 log_file_name1, ana_file_name1, bdp_file_name1, log_file_name2, ana_file_name2, bdp_file_name2, bdp_file_name = get_yesterday_log_filename()116 bdp_data = pickle_from_file(bdp_file_name)117 now = time.time()118 yesterday = now - 86400.0119 ds = timestamp2datetime(now)120 date_int = int(timestamp2date(yesterday))121 fields = ["created_date","id"]122 data0 = [ds,date_int]123 for field in bdp_data:124 cnt = bdp_data[field]125 print field, type(field)126 print cnt, type(cnt)127 fields.append(field)128 data0.append(cnt)129 print "fields", fields130 print "data0", data0131 data = [data0]132 insert_kernel(fields, data)133if __name__ == '__main__':134 mode = sys.argv[1]135 if mode == "test":136 test_insert()137 else:...
urls.py
Source:urls.py
1from django.contrib import admin2from django.urls import path3from .views import (insert_kernel,4 main_work,5 check_group,6 change_group,7 view_groups,8 view_group,9 categorizer,10 kernel_clean,11 load_kernel,12 insert_data,13 get_csv,14 split_kernel,15 split_kernel_clean,16 )17urlpatterns = [18 path('insertkernel/<str:mode>/', insert_kernel, name='insert_kernel'),19 path('mainwork/', main_work, name='main_work'),20 path('checkgroup/', check_group, name='check_group'),21 path('changegroup/<int:pk>/', change_group, name='change_group'),22 path('viewgroups/', view_groups, name='view_groups'),23 path('viewgroup/<int:pk>/', view_group, name='view_group'),24 path('categorizer/', categorizer, name='categorizer'),25 path('kernelclean/', kernel_clean, name='kernelclean'),26 path('loadkernel/', load_kernel, name='loadkernel'),27 path('insertdata/', insert_data, name='insertdata'),28 path('getcsv/<str:mode>/', get_csv, name='getcsv'),29 path('splitkernel/', split_kernel, name='splitkernel'),30 path('splitkernelclean/', split_kernel_clean, name='splitkernelclean'),...
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!!