



"""simple docstring"""






import inspect
import unittest

from transformers import YolosConfig
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
				import torch
				from torch import nn

				from transformers import YolosForObjectDetection, YolosModel
				from transformers.models.yolos.modeling_yolos import YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
				from PIL import Image

				from transformers import AutoImageProcessor

class 						__lowerCAmelCase				:


					'''simple docstring'''


					def __init__(   self     ,							a     ,							a=13     ,							a=[30, 30]     ,							a=2     ,							a=3     ,							a=True     ,							a=True     ,							a=32     ,							a=5     ,							a=4     ,							a=37     ,							a="gelu"     ,							a=0.1     ,							a=0.1     ,							a=10     ,							a=0.02     ,							a=3     ,							a=None     ,							a=8     ,							a=10     ,							):




										"""simple docstring"""





										snake_case_    :List[str]										=    parent
										snake_case_    :List[str]										=    batch_size
										snake_case_    :Tuple										=    image_size
										snake_case_    :int										=    patch_size
										snake_case_    :int										=    num_channels
										snake_case_    :Union[str, Any]										=    is_training
										snake_case_    :Optional[Any]										=    use_labels
										snake_case_    :int										=    hidden_size
										snake_case_    :Optional[int]										=    num_hidden_layers
										snake_case_    :str										=    num_attention_heads
										snake_case_    :Any										=    intermediate_size
										snake_case_    :Tuple										=    hidden_act
										snake_case_    :Tuple										=    hidden_dropout_prob
										snake_case_    :Union[str, Any]										=    attention_probs_dropout_prob
										snake_case_    :int										=    type_sequence_label_size
										snake_case_    :Tuple										=    initializer_range
										snake_case_    :Any										=    num_labels
										snake_case_    :Optional[int]										=    scope
										snake_case_    :Union[str, Any]										=    n_targets
										snake_case_    :Union[str, Any]										=    num_detection_tokens
										# we set the expected sequence length (which is used in several tests)
										# expected sequence length = num_patches + 1 (we add 1 for the [CLS] token) + num_detection_tokens
										snake_case_    :List[Any]										=    (image_size[1] // patch_size) * (image_size[0] // patch_size)
										snake_case_    :int										=    num_patches + 1 + self.num_detection_tokens







					def 		_a			(   self ):




										"""simple docstring"""





										snake_case_    :Union[str, Any]										=    floats_tensor([self.batch_size, self.num_channels, self.image_size[0], self.image_size[1]] )

										snake_case_    :int										=    None
										if self.use_labels:
															# labels is a list of Dict (each Dict being the labels for a given example in the batch)
															snake_case_    :int										=    []
															for i in range(self.batch_size ):
																				snake_case_    :Optional[Any]										=    {}
																				snake_case_    :Any										=    torch.randint(
																				    high=self.num_labels     ,							size=(self.n_targets,)     ,							device=__SCREAMING_SNAKE_CASE )
																				snake_case_    :int										=    torch.rand(self.n_targets     ,							4     ,							device=__SCREAMING_SNAKE_CASE )
																				labels.append(__SCREAMING_SNAKE_CASE )

										snake_case_    :Any										=    self.get_config()

										return config, pixel_values, labels







					def 		_a			(   self ):




										"""simple docstring"""





										return YolosConfig(
										    image_size=self.image_size     ,							patch_size=self.patch_size     ,							num_channels=self.num_channels     ,							hidden_size=self.hidden_size     ,							num_hidden_layers=self.num_hidden_layers     ,							num_attention_heads=self.num_attention_heads     ,							intermediate_size=self.intermediate_size     ,							hidden_act=self.hidden_act     ,							hidden_dropout_prob=self.hidden_dropout_prob     ,							attention_probs_dropout_prob=self.attention_probs_dropout_prob     ,							is_decoder=__SCREAMING_SNAKE_CASE     ,							initializer_range=self.initializer_range     ,							num_detection_tokens=self.num_detection_tokens     ,							num_labels=self.num_labels     ,							)







					def 		_a			(   self     ,							a     ,							a     ,							a ):




										"""simple docstring"""





										snake_case_    :Optional[Any]										=    YolosModel(config=__SCREAMING_SNAKE_CASE )
										model.to(__SCREAMING_SNAKE_CASE )
										model.eval()
										snake_case_    :Any										=    model(__SCREAMING_SNAKE_CASE )
										self.parent.assertEqual(
										    result.last_hidden_state.shape     ,							(self.batch_size, self.expected_seq_len, self.hidden_size) )







					def 		_a			(   self     ,							a     ,							a     ,							a ):




										"""simple docstring"""





										snake_case_    :str										=    YolosForObjectDetection(__SCREAMING_SNAKE_CASE )
										model.to(__SCREAMING_SNAKE_CASE )
										model.eval()

										snake_case_    :List[Any]										=    model(pixel_values=__SCREAMING_SNAKE_CASE )
										snake_case_    :Any										=    model(__SCREAMING_SNAKE_CASE )

										self.parent.assertEqual(result.logits.shape     ,							(self.batch_size, self.num_detection_tokens, self.num_labels + 1) )
										self.parent.assertEqual(result.pred_boxes.shape     ,							(self.batch_size, self.num_detection_tokens, 4) )

										snake_case_    :Optional[int]										=    model(pixel_values=__SCREAMING_SNAKE_CASE     ,							labels=__SCREAMING_SNAKE_CASE )

										self.parent.assertEqual(result.loss.shape     ,							() )
										self.parent.assertEqual(result.logits.shape     ,							(self.batch_size, self.num_detection_tokens, self.num_labels + 1) )
										self.parent.assertEqual(result.pred_boxes.shape     ,							(self.batch_size, self.num_detection_tokens, 4) )







					def 		_a			(   self ):




										"""simple docstring"""





										snake_case_    :List[str]										=    self.prepare_config_and_inputs()
										snake_case_						,	snake_case_						,	snake_case_    :Any										=    config_and_inputs
										snake_case_    :str										=    {"pixel_values": pixel_values}
										return config, inputs_dict



@require_torch
class 						__lowerCAmelCase				(_lowercase       ,_lowercase       ,unittest.TestCase	):


					'''simple docstring'''


					a__          =  (YolosModel, YolosForObjectDetection) if is_torch_available() else ()
					a__          =  (
					    {'feature-extraction': YolosModel, 'object-detection': YolosForObjectDetection} if is_torch_available() else {}
					)

					a__          =  False
					a__          =  False
					a__          =  False
					a__          =  False







					def 		_a			(   self     ,							a     ,							a     ,							a=False ):




										"""simple docstring"""





										snake_case_    :Dict										=    super()._prepare_for_class(__SCREAMING_SNAKE_CASE     ,							__SCREAMING_SNAKE_CASE     ,							return_labels=__SCREAMING_SNAKE_CASE )

										if return_labels:
															if model_class.__name__ == "YolosForObjectDetection":
																				snake_case_    :Tuple										=    []
																				for i in range(self.model_tester.batch_size ):
																									snake_case_    :int										=    {}
																									snake_case_    :Dict										=    torch.ones(
																									    size=(self.model_tester.n_targets,)     ,							device=__SCREAMING_SNAKE_CASE     ,							dtype=torch.long )
																									snake_case_    :str										=    torch.ones(
																									    self.model_tester.n_targets     ,							4     ,							device=__SCREAMING_SNAKE_CASE     ,							dtype=torch.float )
																									labels.append(__SCREAMING_SNAKE_CASE )
																				snake_case_    :int										=    labels

										return inputs_dict







					def 		_a			(   self ):




										"""simple docstring"""





										snake_case_    :Optional[int]										=    YolosModelTester(self )
										snake_case_    :Tuple										=    ConfigTester(self     ,							config_class=__SCREAMING_SNAKE_CASE     ,							has_text_modality=__SCREAMING_SNAKE_CASE     ,							hidden_size=37 )







					def 		_a			(   self ):




										"""simple docstring"""





										self.config_tester.run_common_tests()







					def 		_a			(   self ):




										"""simple docstring"""





										pass







					def 		_a			(   self ):




										"""simple docstring"""





										snake_case_						,	snake_case_    :Optional[int]										=    self.model_tester.prepare_config_and_inputs_for_common()

										for model_class in self.all_model_classes:
															snake_case_    :Dict										=    model_class(__SCREAMING_SNAKE_CASE )
															self.assertIsInstance(model.get_input_embeddings()     ,							(nn.Module) )
															snake_case_    :Any										=    model.get_output_embeddings()
															self.assertTrue(x is None or isinstance(__SCREAMING_SNAKE_CASE     ,							nn.Linear ) )







					def 		_a			(   self ):




										"""simple docstring"""





										snake_case_						,	snake_case_    :Optional[Any]										=    self.model_tester.prepare_config_and_inputs_for_common()

										for model_class in self.all_model_classes:
															snake_case_    :List[Any]										=    model_class(__SCREAMING_SNAKE_CASE )
															snake_case_    :str										=    inspect.signature(model.forward )
															# signature.parameters is an OrderedDict => so arg_names order is deterministic
															snake_case_    :Union[str, Any]										=    [*signature.parameters.keys()]

															snake_case_    :Optional[int]										=    ["pixel_values"]
															self.assertListEqual(arg_names[:1]     ,							__SCREAMING_SNAKE_CASE )







					def 		_a			(   self ):




										"""simple docstring"""





										snake_case_    :Optional[Any]										=    self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_model(*__SCREAMING_SNAKE_CASE )







					def 		_a			(   self ):




										"""simple docstring"""





										snake_case_						,	snake_case_    :Union[str, Any]										=    self.model_tester.prepare_config_and_inputs_for_common()
										snake_case_    :int										=    True

										# in YOLOS, the seq_len is different
										snake_case_    :Dict										=    self.model_tester.expected_seq_len
										for model_class in self.all_model_classes:
															snake_case_    :Optional[Any]										=    True
															snake_case_    :Any										=    False
															snake_case_    :List[str]										=    True
															snake_case_    :Dict										=    model_class(__SCREAMING_SNAKE_CASE )
															model.to(__SCREAMING_SNAKE_CASE )
															model.eval()
															with torch.no_grad():
																				snake_case_    :List[str]										=    model(**self._prepare_for_class(__SCREAMING_SNAKE_CASE     ,							__SCREAMING_SNAKE_CASE ) )
															snake_case_    :Optional[Any]										=    outputs.attentions
															self.assertEqual(len(__SCREAMING_SNAKE_CASE )     ,							self.model_tester.num_hidden_layers )

															# check that output_attentions also work using config
															del inputs_dict["output_attentions"]
															snake_case_    :List[str]										=    True
															snake_case_    :Optional[Any]										=    model_class(__SCREAMING_SNAKE_CASE )
															model.to(__SCREAMING_SNAKE_CASE )
															model.eval()
															with torch.no_grad():
																				snake_case_    :List[str]										=    model(**self._prepare_for_class(__SCREAMING_SNAKE_CASE     ,							__SCREAMING_SNAKE_CASE ) )
															snake_case_    :str										=    outputs.attentions
															self.assertEqual(len(__SCREAMING_SNAKE_CASE )     ,							self.model_tester.num_hidden_layers )

															self.assertListEqual(
															    list(attentions[0].shape[-3:] )     ,							[self.model_tester.num_attention_heads, seq_len, seq_len]     ,							)
															snake_case_    :Optional[Any]										=    len(__SCREAMING_SNAKE_CASE )

															# Check attention is always last and order is fine
															snake_case_    :Tuple										=    True
															snake_case_    :List[str]										=    True
															snake_case_    :int										=    model_class(__SCREAMING_SNAKE_CASE )
															model.to(__SCREAMING_SNAKE_CASE )
															model.eval()
															with torch.no_grad():
																				snake_case_    :Optional[int]										=    model(**self._prepare_for_class(__SCREAMING_SNAKE_CASE     ,							__SCREAMING_SNAKE_CASE ) )

															snake_case_    :Tuple										=    1
															self.assertEqual(out_len + added_hidden_states     ,							len(__SCREAMING_SNAKE_CASE ) )

															snake_case_    :Tuple										=    outputs.attentions

															self.assertEqual(len(__SCREAMING_SNAKE_CASE )     ,							self.model_tester.num_hidden_layers )
															self.assertListEqual(
															    list(self_attentions[0].shape[-3:] )     ,							[self.model_tester.num_attention_heads, seq_len, seq_len]     ,							)







					def 		_a			(   self ):




										"""simple docstring"""





										def check_hidden_states_output(a     ,							a     ,							a ):
															snake_case_    :List[str]										=    model_class(__SCREAMING_SNAKE_CASE )
															model.to(__SCREAMING_SNAKE_CASE )
															model.eval()

															with torch.no_grad():
																				snake_case_    :Optional[int]										=    model(**self._prepare_for_class(__SCREAMING_SNAKE_CASE     ,							__SCREAMING_SNAKE_CASE ) )

															snake_case_    :List[Any]										=    outputs.hidden_states

															snake_case_    :List[Any]										=    getattr(
															    self.model_tester     ,							"expected_num_hidden_layers"     ,							self.model_tester.num_hidden_layers + 1 )
															self.assertEqual(len(__SCREAMING_SNAKE_CASE )     ,							__SCREAMING_SNAKE_CASE )

															# YOLOS has a different seq_length
															snake_case_    :List[str]										=    self.model_tester.expected_seq_len

															self.assertListEqual(
															    list(hidden_states[0].shape[-2:] )     ,							[seq_length, self.model_tester.hidden_size]     ,							)

										snake_case_						,	snake_case_    :List[Any]										=    self.model_tester.prepare_config_and_inputs_for_common()

										for model_class in self.all_model_classes:
															snake_case_    :Dict										=    True
															check_hidden_states_output(__SCREAMING_SNAKE_CASE     ,							__SCREAMING_SNAKE_CASE     ,							__SCREAMING_SNAKE_CASE )

															# check that output_hidden_states also work using config
															del inputs_dict["output_hidden_states"]
															snake_case_    :Any										=    True

															check_hidden_states_output(__SCREAMING_SNAKE_CASE     ,							__SCREAMING_SNAKE_CASE     ,							__SCREAMING_SNAKE_CASE )







					def 		_a			(   self ):




										"""simple docstring"""





										snake_case_    :str										=    self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_object_detection(*__SCREAMING_SNAKE_CASE )







					@slow
					def 		_a			(   self ):




										"""simple docstring"""





										for model_name in YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
															snake_case_    :List[Any]										=    YolosModel.from_pretrained(__SCREAMING_SNAKE_CASE )
															self.assertIsNotNone(__SCREAMING_SNAKE_CASE )



def   A   (      ):




					"""simple docstring"""
					snake_case_    :List[Any]										=    Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"				)
					return image

@require_torch
@require_vision
class 						__lowerCAmelCase				(unittest.TestCase	):


					'''simple docstring'''


					@cached_property
					def 		_a			(   self ):




										"""simple docstring"""





										return AutoImageProcessor.from_pretrained("hustvl/yolos-small" ) if is_vision_available() else None







					@slow
					def 		_a			(   self ):




										"""simple docstring"""





										snake_case_    :Any										=    YolosForObjectDetection.from_pretrained("hustvl/yolos-small" ).to(__SCREAMING_SNAKE_CASE )

										snake_case_    :List[str]										=    self.default_image_processor
										snake_case_    :int										=    prepare_img()
										snake_case_    :Any										=    image_processor(images=__SCREAMING_SNAKE_CASE     ,							return_tensors="pt" ).to(__SCREAMING_SNAKE_CASE )

										# forward pass
										with torch.no_grad():
															snake_case_    :List[str]										=    model(inputs.pixel_values )

										# verify outputs
										snake_case_    :str										=    torch.Size((1, 1_00, 92) )
										self.assertEqual(outputs.logits.shape     ,							__SCREAMING_SNAKE_CASE )

										snake_case_    :Optional[int]										=    torch.tensor(
										    [[-24.0248, -10.3024, -14.8290], [-42.0392, -16.8200, -27.4334], [-27.2743, -11.8154, -18.7148]]     ,							device=__SCREAMING_SNAKE_CASE     ,							)
										snake_case_    :Tuple										=    torch.tensor(
										    [[0.2559, 0.5455, 0.4706], [0.2989, 0.7279, 0.1875], [0.7732, 0.4017, 0.4462]]     ,							device=__SCREAMING_SNAKE_CASE )
										self.assertTrue(torch.allclose(outputs.logits[0, :3, :3]     ,							__SCREAMING_SNAKE_CASE     ,							atol=1e-4 ) )
										self.assertTrue(torch.allclose(outputs.pred_boxes[0, :3, :3]     ,							__SCREAMING_SNAKE_CASE     ,							atol=1e-4 ) )

										# verify postprocessing
										snake_case_    :str										=    image_processor.post_process_object_detection(
										    __SCREAMING_SNAKE_CASE     ,							threshold=0.3     ,							target_sizes=[image.size[::-1]] )[0]
										snake_case_    :Union[str, Any]										=    torch.tensor([0.9994, 0.9790, 0.9964, 0.9972, 0.9861] ).to(__SCREAMING_SNAKE_CASE )
										snake_case_    :Tuple										=    [75, 75, 17, 63, 17]
										snake_case_    :List[str]										=    torch.tensor([3_35.06_09, 79.3848, 3_75.42_16, 1_87.24_95] ).to(__SCREAMING_SNAKE_CASE )

										self.assertEqual(len(results["scores"] )     ,							5 )
										self.assertTrue(torch.allclose(results["scores"]     ,							__SCREAMING_SNAKE_CASE     ,							atol=1e-4 ) )
										self.assertSequenceEqual(results["labels"].tolist()     ,							__SCREAMING_SNAKE_CASE )
										self.assertTrue(torch.allclose(results["boxes"][0, :]     ,							__SCREAMING_SNAKE_CASE ) )



"""simple docstring"""




from collections import deque







class     lowercase:



     def __init__(							self     ,				__SCREAMING_SNAKE_CASE     ,				__SCREAMING_SNAKE_CASE     ,				__SCREAMING_SNAKE_CASE   )		->     None:







         """simple docstring"""



         a__		=			process_name  # process name
         a__		=			arrival_time  # arrival time of the process
         # completion time of finished process or last interrupted time
         a__		=			arrival_time
         a__		=			burst_time  # remaining burst time
         a__		=			0  # total time of the process wait in ready queue
         a__		=			0  # time from arrival time to completion time







class     lowercase:



     def __init__(							self     ,				__SCREAMING_SNAKE_CASE     ,				__SCREAMING_SNAKE_CASE     ,				__SCREAMING_SNAKE_CASE     ,				__SCREAMING_SNAKE_CASE     ,				)		->     None:







         """simple docstring"""



         a__		=			number_of_queues
         # time slice of queues that round robin algorithm applied
         a__		=			time_slices
         # unfinished process is in this ready_queue
         a__		=			queue
         # current time
         a__		=			current_time
         # finished process is in this sequence queue
         a__		=			deque()



     def 			lowercase__  (							self   )		->     list[str]:







         """simple docstring"""



         a__		=			[]
         for i in range(len(self.finish_queue   )   ):
             sequence.append(self.finish_queue[i].process_name   )
         return sequence



     def 			lowercase__  (							self     ,				__SCREAMING_SNAKE_CASE   )		->     list[int]:







         """simple docstring"""



         a__		=			[]
         for i in range(len(__SCREAMING_SNAKE_CASE   )   ):
             waiting_times.append(queue[i].waiting_time   )
         return waiting_times



     def 			lowercase__  (							self     ,				__SCREAMING_SNAKE_CASE   )		->     list[int]:







         """simple docstring"""



         a__		=			[]
         for i in range(len(__SCREAMING_SNAKE_CASE   )   ):
             turnaround_times.append(queue[i].turnaround_time   )
         return turnaround_times



     def 			lowercase__  (							self     ,				__SCREAMING_SNAKE_CASE   )		->     list[int]:







         """simple docstring"""



         a__		=			[]
         for i in range(len(__SCREAMING_SNAKE_CASE   )   ):
             completion_times.append(queue[i].stop_time   )
         return completion_times



     def 			lowercase__  (							self     ,				__SCREAMING_SNAKE_CASE   )		->     list[int]:







         """simple docstring"""



         return [q.burst_time for q in queue]



     def 			lowercase__  (							self     ,				__SCREAMING_SNAKE_CASE   )		->     int:







         """simple docstring"""



         process.waiting_time += self.current_time - process.stop_time
         return process.waiting_time



     def 			lowercase__  (							self     ,				__SCREAMING_SNAKE_CASE   )		->     deque[Process]:







         """simple docstring"""



         a__		=			deque()  # sequence deque of finished process
         while len(__SCREAMING_SNAKE_CASE   ) != 0:
             a__		=			ready_queue.popleft()  # current process

             # if process's arrival time is later than current time, update current time
             if self.current_time < cp.arrival_time:
                 self.current_time += cp.arrival_time

             # update waiting time of current process
             self.update_waiting_time(__SCREAMING_SNAKE_CASE   )
             # update current time
             self.current_time += cp.burst_time
             # finish the process and set the process's burst-time 0
             a__		=			0
             # set the process's turnaround time because it is finished
             a__		=			self.current_time - cp.arrival_time
             # set the completion time
             a__		=			self.current_time
             # add the process to queue that has finished queue
             finished.append(__SCREAMING_SNAKE_CASE   )

         self.finish_queue.extend(__SCREAMING_SNAKE_CASE   )  # add finished process to finish queue
         # FCFS will finish all remaining processes
         return finished



     def 			lowercase__  (							self     ,				__SCREAMING_SNAKE_CASE     ,				__SCREAMING_SNAKE_CASE   )		->     tuple[deque[Process], deque[Process]]:







         """simple docstring"""



         a__		=			deque()  # sequence deque of terminated process
         # just for 1 cycle and unfinished processes will go back to queue
         for _ in range(len(__SCREAMING_SNAKE_CASE   )   ):
             a__		=			ready_queue.popleft()  # current process

             # if process's arrival time is later than current time, update current time
             if self.current_time < cp.arrival_time:
                 self.current_time += cp.arrival_time

             # update waiting time of unfinished processes
             self.update_waiting_time(__SCREAMING_SNAKE_CASE   )
             # if the burst time of process is bigger than time-slice
             if cp.burst_time > time_slice:
                 # use CPU for only time-slice
                 self.current_time += time_slice
                 # update remaining burst time
                 cp.burst_time -= time_slice
                 # update end point time
                 a__		=			self.current_time
                 # locate the process behind the queue because it is not finished
                 ready_queue.append(__SCREAMING_SNAKE_CASE   )
             else:
                 # use CPU for remaining burst time
                 self.current_time += cp.burst_time
                 # set burst time 0 because the process is finished
                 a__		=			0
                 # set the finish time
                 a__		=			self.current_time
                 # update the process' turnaround time because it is finished
                 a__		=			self.current_time - cp.arrival_time
                 # add the process to queue that has finished queue
                 finished.append(__SCREAMING_SNAKE_CASE   )

         self.finish_queue.extend(__SCREAMING_SNAKE_CASE   )  # add finished process to finish queue
         # return finished processes queue and remaining processes queue
         return finished, ready_queue




     def 			lowercase__  (							self   )		->     deque[Process]:







         """simple docstring"""



         for i in range(self.number_of_queues - 1   ):
             a__	,     a__		=			self.round_robin(
                 self.ready_queue     ,				self.time_slices[i]   )
         #  the last queue has first_come_first_served algorithm
         self.first_come_first_served(self.ready_queue   )

         return self.finish_queue


if __name__ == "__main__":
    import doctest

    a		:       List[str]     						=       Process('P1', 0, 53)
    a		:       Optional[int]     						=       Process('P2', 0, 17)
    a		:       Union[str, Any]     						=       Process('P3', 0, 68)
    a		:       Optional[int]     						=       Process('P4', 0, 24)
    a		:       Optional[int]     						=       3
    a		:       Optional[Any]     						=       [17, 25]
    a		:       Union[str, Any]     						=       deque([Pa, Pa, Pa, Pa])

    if len(time_slices) != number_of_queues - 1:
        raise SystemExit(0)

    doctest.testmod(extraglobs={'queue': deque([Pa, Pa, Pa, Pa])})

    a		:       Union[str, Any]     						=       Process('P1', 0, 53)
    a		:       Optional[int]     						=       Process('P2', 0, 17)
    a		:       Optional[Any]     						=       Process('P3', 0, 68)
    a		:       str     						=       Process('P4', 0, 24)
    a		:       Optional[Any]     						=       3
    a		:       Tuple     						=       [17, 25]
    a		:       int     						=       deque([Pa, Pa, Pa, Pa])
    a		:       Tuple     						=       MLFQ(number_of_queues, time_slices, queue, 0)
    a		:       Optional[int]     						=       mlfq.multi_level_feedback_queue()

    # print total waiting times of processes(P1, P2, P3, P4)
    print(
        F'''waiting time:\
        \t\t\t{MLFQ.calculate_waiting_time(mlfq, [Pa, Pa, Pa, Pa])}'''
    )
    # print completion times of processes(P1, P2, P3, P4)
    print(
        F'''completion time:\
        \t\t{MLFQ.calculate_completion_time(mlfq, [Pa, Pa, Pa, Pa])}'''
    )
    # print total turnaround times of processes(P1, P2, P3, P4)
    print(
        F'''turnaround time:\
        \t\t{MLFQ.calculate_turnaround_time(mlfq, [Pa, Pa, Pa, Pa])}'''
    )
    # print sequence of finished processes
    print(
        F'''sequence of finished processes:\
        {mlfq.calculate_sequence_of_finish_queue()}'''
    )


