How to use task3 method in locust

Best Python code snippet using locust

task3_plotter.py

Source:task3_plotter.py Github

copy

Full Screen

1import os2import json3import matplotlib.pyplot as plt4def file_reader():5 epoch_list = [0, 0.33, 0.66, 1]6 file1 = open("task3_test_acc.txt", "r")7 task3_test_acc = json.load(file1)8 file1.close()9 file2 = open("task3_train_acc.txt", "r")10 task3_train_acc = json.load(file2)11 file2.close()12 file3 = open("task3_val_acc.txt", "r")13 task3_val_acc = json.load(file3)14 file3.close()15 file4 = open("task3_test_loss.txt", "r")16 task3_test_loss = json.load(file4)17 file4.close()18 file5 = open("task3_train_loss.txt", "r")19 task3_train_loss = json.load(file5)20 file5.close()21 file6 = open("task3_val_loss.txt", "r")22 task3_val_loss = json.load(file6)23 file6.close()24 return task3_test_acc, task3_val_acc, task3_train_acc, task3_test_loss, task3_val_loss, task3_train_loss25if __name__ == "__main__":26 epoch_list = [0, 0.33, 0.66, 1]27 file1 = open("task3_test_acc.txt", "r")28 task3_test_acc = json.load(file1)29 file1.close()30 file2 = open("task3_train_acc.txt", "r")31 task3_train_acc = json.load(file2)32 file2.close()33 file3 = open("task3_val_acc.txt", "r")34 task3_val_acc = json.load(file3)35 file3.close()36 file4 = open("task3_test_loss.txt", "r")37 task3_test_loss = json.load(file4)38 file4.close()39 file5 = open("task3_train_loss.txt", "r")40 task3_train_loss = json.load(file5)41 file5.close()42 file6 = open("task3_val_loss.txt", "r")43 task3_val_loss = json.load(file6)44 file6.close()45 os.makedirs("plots", exist_ok=True)46 # Save plots and show them47 plt.figure(figsize=(12, 8))48 plt.title("Cross Entropy Loss")49 plt.plot(epoch_list, task3_val_loss, label="Validation loss")50 plt.plot(epoch_list, task3_train_loss, label="Training loss")51 plt.plot(epoch_list, task3_test_loss, label="Testing Loss")52 plt.legend()53 plt.savefig(os.path.join("plots", "final_loss.png"))54 plt.show()55 plt.figure(figsize=(12, 8))56 plt.title("Accuracy")57 plt.plot(epoch_list, task3_val_acc, label="Validation Accuracy")58 plt.plot(epoch_list, task3_train_acc, label="Training Accuracy")59 plt.plot(epoch_list, task3_test_acc, label="Testing Accuracy")60 plt.legend()61 plt.savefig(os.path.join("plots", "final_accuracy.png"))...

Full Screen

Full Screen

Технологии виртуальной, дополненной и смешанной реальности.py

Source:Технологии виртуальной, дополненной и смешанной реальности.py Github

copy

Full Screen

1#Для задания 1:2coord_1 = "97 2 74" # Координаты3radius_1 = 24 # Радиус45#Для задания 2:6coord_2 = "33 71 71" # Координаты7radius_2 = 36 # Радиус8height_2 = 15 # Высота9color_2 = "#3b05e3" # Цвет1011#Для задания 3:12width = 116 # Ширина13height = 22 # Высота14depth = 10 # Глубина15indent = 7 # Отступ (... ближайшего ребра параллелепипеда составлял ...)16ledge = 3.8 # Выступ (... грани параллелепипеда и выступало на ...)1718192021#Ничего не трогай ниже!!!22print('Упражнение 1:')23print('<a-sphere position="'+ coord_1 + '" radius="' + str(radius_1) + '"></a-sphere>' + '\n')24print('Упражнение 2:')25print('<a-cylinder position="' + coord_2 + '" radius="' + str(radius_2) + '" height="' + str(height_2) + '" color="' + color_2 + '"></a-cylinder>' + '\n')26print('Упражнение 3:')27task3_1_1 = (width - 4 * indent) / 428task3_1_2 = (height - 2 * indent) / 229if (task3_1_1 > task3_1_2):30 task3_1 = task3_1_231else:32 task3_1 = task3_1_133task3_2 = depth + ledge34task3_3_1 = width / 435task3_3_2 = ledge / 236if (task3_1 % 1 == 0):37 task3_1 = int(task3_1)38if (task3_2 % 1 == 0):39 task3_2 = int(task3_2)40if (task3_3_1 % 1 == 0):41 task3_3_1 = int(task3_3_1)42if (task3_3_2 % 1 == 0):43 task3_3_2 = int(task3_3_2)44print(task3_1)45print(task3_2)46print('<a-cylinder position="' + str(task3_3_1) + ' 0 ' + str(task3_3_2) + '" radius="' + str(task3_1) + '" height="' + str(task3_2) + '" color="#FFC65D" rotation="90 0 0"></a-cylinder>') ...

Full Screen

Full Screen

slove.py

Source:slove.py Github

copy

Full Screen

...28 variant2_task3 = dbworker.get_task_value(user_id, 'variant2_task3')29 lvl_1_task3 = dbworker.get_task_value(user_id, 'lvl_1_task3')30 lvl_2_task3 = dbworker.get_task_value(user_id, 'lvl_2_task3')31 worksheet = workbook.add_worksheet('Задание 3')32 tasks.task3(worksheet, dataset_task3, variant1_task3, variant2_task3, lvl_1_task3, lvl_2_task3)33 # close workbook file...

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 locust 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