How to use print_banner method in localstack

Best Python code snippet using localstack_python

SchoolMS.py

Source:SchoolMS.py Github

copy

Full Screen

...26courses_menu_actions = {}27# =======================28# MENUS FUNCTIONS29# =======================30def print_banner(title="School Management System v0.02 - Author: Nikolaos Bikas"):31 print("""32.s5SSSs. .s5ssSs. .s5SSSs. 33sS SS. .s5SSSs. .s s. .s5SSSs. .s5SSSs. .s SS SS.S%S SS. 34sS `:; SS. SS SS SS. sS S%S sS S%S sS sS SS S%S sS 35SS sS `:; sS S%S sS S%S sS S%S sS SS :; S%S SS 36`:;;;;. SS SSSs. S%S SS S%S SS S%S SS SS S%S `:;;;;. 37 ;;. SS SS S%S SS S%S SS S%S SS SS S%S ;;. 38 `:; SS SS `:; SS `:; SS `:; SS SS `:; `:; 39.,; ;,. SS ;,. SS ;,. SS ;,. SS ;,. SS ;,. SS ;,. .,; ;,. 40`:;;;;;:' `:;;;;;:' :; ;:' `:;;;;;:' `:;;;;;:' `:;;;;;:' :; ;:' `:;;;;;:' 41""")42 total_len = 8043 if title:44 padding = total_len - len(title) - 445 print("= {} {}\n".format(title, "=" * padding))46 else:47 print("{}\n".format("=" * total_len)) 48# Main menu49def main_menu():50 clear()51 print_banner()52 print ("Main Menu:")53 print ("")54 print ("1 Manage Students")55 print ("2 Manage Trainers")56 print ("3 Manage Assignments")57 print ("4 Manage Courses")58 print ("0 Quit")59 print ("")60 choice = input("Enter your choice: ")61 exec_menu(choice)62 return63# Execute menu64def exec_menu(choice):65 clear()66 ch = choice.lower()67 if ch == '':68 menu_actions['main_menu']()69 else:70 try:71 menu_actions[ch]()72 except KeyError:73 print_banner()74 print ("Invalid selection, please try again.\n")75 time.sleep(2)76 menu_actions['main_menu']()77 return78# Execute students menu79def exec_menu_students(choice):80 clear()81 ch = choice.lower()82 if ch == '':83 students_menu_actions['students_menu']()84 else:85 try:86 students_menu_actions[ch]()87 except KeyError:88 print_banner()89 print ("Invalid selection, please try again.\n")90 time.sleep(2)91 students_menu_actions['students_menu']()92 return93# Execute trainers menu94def exec_menu_trainers(choice):95 clear()96 ch = choice.lower()97 if ch == '':98 trainers_menu_actions['trainers_menu']()99 else:100 try:101 trainers_menu_actions[ch]()102 except KeyError:103 print_banner()104 print ("Invalid selection, please try again.\n")105 time.sleep(2)106 trainers_menu_actions['trainers_menu']()107 return108# Execute assignments menu109def exec_menu_assignemts(choice):110 clear()111 ch = choice.lower()112 if ch == '':113 assignments_menu_actions['assignments_menu']()114 else:115 try:116 assignments_menu_actions[ch]()117 except KeyError:118 print_banner()119 print ("Invalid selection, please try again.\n")120 time.sleep(2)121 assignments_menu_actions['assignments_menu']()122 return123# Execute courses menu124def exec_menu_courses(choice):125 clear()126 ch = choice.lower()127 if ch == '':128 courses_menu_actions['courses_menu']()129 else:130 try:131 courses_menu_actions[ch]()132 except KeyError:133 print_banner()134 print ("Invalid selection, please try again.\n")135 time.sleep(2)136 courses_menu_actions['courses_menu']()137 return138# Students menu139def students_menu():140 clear()141 print_banner()142 print ("Students managment menu:")143 print ("")144 print ("1 Display a list of all students")145 print ("2 Add a new student")146 print ("3 Display Students per Course")147 print ("4 Display Students that attend more than one course")148 print ("9 Return to main menu")149 print ("")150 choice = input("Enter your choice: ")151 exec_menu_students(choice)152 return153# Menu Item Display all Students154def displayStudents():155 print_banner()156 # an object of Student class157 studentsToString("Students", Students.studentsList)158 print("") 159 input("Press Enter to return at the Students managment menu...")160 return students_menu()161# Menu Item Add a new Student162def addStudents():163 print_banner()164 studentsToString('Students',Students.studentsList)165 addNewStudent()166 input("Press Enter to return at the Students managment menu...")167 return students_menu()168# Menu Item Display Students per Course169def displayStudentsPerCourse():170 print_banner()171 print("")172 stdsPerCourseToString(Students.studentsList)173 print("") 174 input("Press Enter to return at the Students managment menu...")175 return students_menu()176# Menu Item Display Students that belong to more than one courses177def displayStudentsMultipleCourses():178 print_banner()179 stdsMultipleCoursesToString(Students.studentsMultipleCoursesList)180 print("")181 input("Press Enter to return at the Students managment menu...")182 return students_menu()183# Trainers Menu184def trainers_menu():185 clear()186 print_banner()187 print ("Trainers managment menu:")188 print ("")189 print ("1 Display a list of all trainers")190 print ("2 Add a new trainer")191 print ("3 Display Trainers per Course")192 print ("9 Return to main menu")193 print ("")194 choice = input("Enter your choice: ")195 exec_menu_trainers(choice)196 return197# Menu Item Display Trainers198def displayTrainers():199 print_banner()200 trainersToString("Trainers", Trainers.trainersList)201 print("")202 input("Press Enter to return at the Trainers managment menu...")203 return trainers_menu()204# Menu Item Add a new Trainer205def addTrainer():206 print_banner()207 trainersToString("Trainers", Trainers.trainersList)208 addNewTrainer()209 input("Press Enter to return at the Trainers managment menu...")210 return trainers_menu()211# Menu Item Display Trainers Per Course212def displayTrainersPerCourse():213 print_banner()214 print("")215 trainersPerCourseToString(Trainers.trainersList)216 print("")217 input("Press Enter to return at the Trainers managment menu...")218 return trainers_menu()219# Assignments Menu220def assignments_menu():221 clear()222 print_banner()223 print ("Assignments managment menu:")224 print ("")225 print ("1 Display a list of all Assignements")226 print ("2 Add a new assignement")227 print ("3 Display Assignements per Course")228 print ("4 Display Assignments per Student")229 print ("9 Return to main menu")230 print ("")231 choice = input("Enter your choice: ")232 exec_menu_assignemts(choice)233 return234def displayAssignments():235 clear()236 print_banner()237 print("\nAssignments are the following:")238 assignmentsToString("Assignmets",Assignments.assignmentsList)239 print("")240 input("Press Enter to return at the Assignments managment menu...") 241 return assignments_menu() 242# Menu Item Add a new Assignment243def addAssignment():244 print_banner()245 addNewAssignment()246 input("Press Enter to return at the Assignments managment menu...")247 return assignments_menu()248# Menu Item Display All Assignments per Course249def displayAssignmentsPerCourse():250 print_banner()251 assignmentsPerCourseToString(Assignments.assignmentsList)252 input("Press Enter to return at the Assignments managment menu...")253 return assignments_menu()254# Menu Item Display Al Assignments per Student255def displayAssignmentsPerStudents():256 print_banner()257 print("Not Yet Implemented!")258 input("Press Enter to return at the Assignments managment menu...")259 return assignments_menu()260# Courses Menu261def courses_menu():262 clear()263 print_banner()264 print ("Courses managment menu:")265 print ("")266 print ("1 Display list of Courses")267 print ("2 Add a new Course")268 print ("9 Return to main menu")269 print ("")270 choice = input("Enter your choice: ")271 exec_menu_courses(choice)272 return273# Menu Item Display Courses274def printCourses():275 clear()276 print_banner()277 coursesToString("Courses",Courses.coursesList)278 print("")279 input("Press Enter to return at the Courses managment menu...")280 return courses_menu()281# Menu Item Add Course282def addCourses():283 clear()284 print_banner()285 coursesToString("Courses",Courses.coursesList)286 addNewCourse()287 print("")288 input("Press Enter to return at the Courses managment menu...")289 return courses_menu()290# Back to main menu291def back():292 menu_actions['main_menu']()293# Exit program294def exit():295 sys.exit()296# =======================297# MENUS DEFINITIONS298# =======================...

Full Screen

Full Screen

process.py

Source:process.py Github

copy

Full Screen

...21 out_dir = pjoin(self.path, name)22 os.makedirs(out_dir, exist_ok=True)23 return out_dir24 def extract_frames(self, params):25 print_banner("Extracting PTS")26 self.video.extract_pts()27 print_banner("Extracting frames")28 self.video.extract_frames()29 def pipeline(self, params):30 self.extract_frames(params)31 print_banner("Downscaling frames (raw)")32 self.video.downscale_frames("color_down", params.size, "raw")33 print_banner("Downscaling frames (png)")34 self.video.downscale_frames("color_down_png", params.size, "png")35 print_banner("Downscaling frames (for flow)")36 self.video.downscale_frames("color_flow", Flow.max_size(), "png", align=64)37 frame_range = FrameRange(38 frame_range=params.frame_range.set, num_frames=self.video.frame_count,39 )40 frames = frame_range.frames()41 print_banner("Compute initial depth")42 ft = DepthFineTuner(self.out_dir, frames, params)43 initial_depth_dir = pjoin(self.path, f"depth_{params.model_type}")44 if not self.video.check_frames(pjoin(initial_depth_dir, "depth"), "raw"):45 ft.save_depth(initial_depth_dir)46 valid_frames = calibrate_scale(self.video, self.out_dir, frame_range, params)47 # frame range for finetuning:48 ft_frame_range = frame_range.intersection(OptionalSet(set(valid_frames)))49 print("Filtered out frames",50 sorted(set(frame_range.frames()) - set(ft_frame_range.frames())))51 print_banner("Compute flow")52 frame_pairs = sample_pairs(ft_frame_range, params.flow_ops)53 self.flow.compute_flow(frame_pairs, params.flow_checkpoint)54 print_banner("Compute flow masks")55 self.flow.mask_valid_correspondences()56 flow_list_path = self.flow.check_good_flow_pairs(57 frame_pairs, params.overlap_ratio58 )59 shutil.copyfile(flow_list_path, pjoin(self.path, "flow_list.json"))60 print_banner("Visualize flow")61 self.flow.visualize_flow(warp=True)62 print_banner("Fine-tuning")63 ft.fine_tune(writer=self.writer)64 print_banner("Compute final depth")65 if not self.video.check_frames(pjoin(ft.out_dir, "depth"), "raw", frames):66 ft.save_depth(ft.out_dir, frames)67 if params.make_video:68 print_banner("Export visualization videos")69 self.make_videos(params, ft.out_dir)70 return initial_depth_dir, ft.out_dir, frame_range.frames()71 def process(self, params):72 self.path = params.path73 os.makedirs(self.path, exist_ok=True)74 self.video_file = params.video_file75 self.out_dir = self.create_output_path(params)76 self.video = Video(params.path, params.video_file)77 self.flow = Flow(params.path, self.out_dir)78 print_title(f"Processing dataset '{self.path}'")79 print(f"Output directory: {self.out_dir}")80 if params.op == "all":81 return self.pipeline(params)82 elif params.op == "extract_frames":...

Full Screen

Full Screen

main.py

Source:main.py Github

copy

Full Screen

...9 "export": "\\export"10}11def main():12 export_dir = working_dir + required_folders["export"]13 print_banner("single", "header-start")14 if check_dir(export_dir):15 print_banner("double", "header-start", "check-dir-pos")16 else:17 print_banner("double", "header-start", "check-dir-neg")18 print_banner("double", "header-start", "user-options")19 selected = input("Please enter one of the above options here: ")20 if selected == "1":21 module_url = input("Please enter the module url below:\n")22 if module_url:23 if ms_learn(module_url, export_dir):24 print_banner("double", "header-start", "export-success")25 time.sleep(5)26 main()27 else:28 print_banner("double", "header-start", "export-fail")29 time.sleep(5)30 main()31 else:32 print_banner("double", "header-start", "url-invalid")33 time.sleep(5)34 main()35 elif selected == "2":36 print_banner("single", "header-stop")37 sys.exit(0)38 else:39 pass40if __name__ == "__main__":...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful