

import collections
import tempfile
import unittest

import numpy as np

from transformers.testing_utils import (
    is_pt_flax_cross_test,
    require_flax,
    require_torch,
    require_vision,
    slow,
    torch_device,
)
from transformers.utils import is_flax_available, is_torch_available, is_vision_available

from ...test_modeling_flax_common import floats_tensor, ids_tensor, random_attention_mask
from ..bert.test_modeling_flax_bert import FlaxBertModelTester
from ..clip.test_modeling_flax_clip import FlaxCLIPVisionModelTester
from ..vit.test_modeling_flax_vit import FlaxViTModelTester


if is_flax_available():
					from transformers import (
					    FlaxBertModel,
					    FlaxCLIPVisionModel,
					    FlaxVisionTextDualEncoderModel,
					    FlaxViTModel,
					    VisionTextDualEncoderConfig,
					    VisionTextDualEncoderProcessor,
					)
					from transformers.modeling_flax_pytorch_utils import (
					    convert_pytorch_state_dict_to_flax,
					    load_flax_weights_in_pytorch_model,
					)


if is_torch_available():
					import torch

					from transformers import VisionTextDualEncoderModel

if is_vision_available():
					from PIL import Image

def 							__SCREAMING_SNAKE_CASE							(				lowerCAmelCase:  Any )   ->       Optional[int]:
				if isinstance(a_  ,      collections.abc.Iterable ):
								return x
				return (x, x)

@require_flax
class 				a  :


						def        _UpperCAmelCase				(       self						,					A_						,					A_	):







										'''simple docstring'''


										pass


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										pass


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										pass


						def        _UpperCAmelCase				(       self						,					A_						,					A_						,					A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		Union[str, Any] 		=    np.abs((a - b)	).max()
										self.assertLessEqual(_UpperCAmelCase						,					_UpperCAmelCase						,					f'Difference between torch and flax is {diff} (>= {tol}).'	)


						def        _UpperCAmelCase				(       self						,					A_						,					A_						,					A_						,					A_						,					A_=None						,					**A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		List[str] 		=    VisionTextDualEncoderConfig.from_vision_text_configs(_UpperCAmelCase						,					_UpperCAmelCase	)

										_UpperCAmelCase       :		Tuple 		=    FlaxVisionTextDualEncoderModel(_UpperCAmelCase	)

										_UpperCAmelCase       :		int 		=    model(input_ids=_UpperCAmelCase						,					pixel_values=_UpperCAmelCase						,					attention_mask=_UpperCAmelCase	)

										self.assertEqual(output["text_embeds"].shape						,					(input_ids.shape[0], config.projection_dim)	)
										self.assertEqual(output["image_embeds"].shape						,					(pixel_values.shape[0], config.projection_dim)	)


						def        _UpperCAmelCase				(       self						,					A_						,					A_						,					A_						,					A_						,					A_=None						,					**A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		Optional[Any] 		=    self.get_vision_text_model(_UpperCAmelCase						,					_UpperCAmelCase	)
										_UpperCAmelCase       :		str 		=    {'''vision_model''': vision_model, '''text_model''': text_model}
										_UpperCAmelCase       :		Optional[Any] 		=    FlaxVisionTextDualEncoderModel.from_vision_text_pretrained(**_UpperCAmelCase	)

										_UpperCAmelCase       :		List[Any] 		=    model(input_ids=_UpperCAmelCase						,					pixel_values=_UpperCAmelCase						,					attention_mask=_UpperCAmelCase	)

										self.assertEqual(output["text_embeds"].shape						,					(input_ids.shape[0], model.config.projection_dim)	)
										self.assertEqual(output["image_embeds"].shape						,					(pixel_values.shape[0], model.config.projection_dim)	)


						def        _UpperCAmelCase				(       self						,					A_						,					A_						,					A_						,					A_						,					A_=None						,					**A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		Optional[int] 		=    self.get_vision_text_model(_UpperCAmelCase						,					_UpperCAmelCase	)
										_UpperCAmelCase       :		int 		=    {'''vision_model''': vision_model, '''text_model''': text_model}
										_UpperCAmelCase       :		Tuple 		=    FlaxVisionTextDualEncoderModel.from_vision_text_pretrained(**_UpperCAmelCase	)

										_UpperCAmelCase       :		Optional[Any] 		=    model(input_ids=_UpperCAmelCase						,					pixel_values=_UpperCAmelCase						,					attention_mask=_UpperCAmelCase	)
										_UpperCAmelCase       :		List[Any] 		=    output[0]

										with tempfile.TemporaryDirectory() as tmpdirname:
														model.save_pretrained(_UpperCAmelCase	)
														_UpperCAmelCase       :		List[str] 		=    FlaxVisionTextDualEncoderModel.from_pretrained(_UpperCAmelCase	)

														_UpperCAmelCase       :		str 		=    model(input_ids=_UpperCAmelCase						,					pixel_values=_UpperCAmelCase						,					attention_mask=_UpperCAmelCase	)
														_UpperCAmelCase       :		Tuple 		=    after_output[0]
														_UpperCAmelCase       :		List[Any] 		=    np.amax(np.abs(out_a - out_a	)	)
														self.assertLessEqual(_UpperCAmelCase						,					1e-3	)


						def        _UpperCAmelCase				(       self						,					A_						,					A_						,					A_						,					A_						,					A_=None						,					**A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		str 		=    self.get_vision_text_model(_UpperCAmelCase						,					_UpperCAmelCase	)
										_UpperCAmelCase       :		Tuple 		=    {'''vision_model''': vision_model, '''text_model''': text_model}
										_UpperCAmelCase       :		Any 		=    FlaxVisionTextDualEncoderModel.from_vision_text_pretrained(**_UpperCAmelCase	)

										_UpperCAmelCase       :		Any 		=    model(
										    input_ids=_UpperCAmelCase						,					pixel_values=_UpperCAmelCase						,					attention_mask=_UpperCAmelCase						,					output_attentions=_UpperCAmelCase	)

										_UpperCAmelCase       :		List[Any] 		=    output.vision_model_output.attentions
										self.assertEqual(len(_UpperCAmelCase	)						,					vision_config.num_hidden_layers	)

										# in ViT, the seq_len equals the number of patches + 1 (we add 1 for the [CLS] token)
										_UpperCAmelCase       :		Any 		=    to_atuple(vision_model.config.image_size	)
										_UpperCAmelCase       :		Dict 		=    to_atuple(vision_model.config.patch_size	)
										_UpperCAmelCase       :		List[Any] 		=    (image_size[1] // patch_size[1]) * (image_size[0] // patch_size[0])
										_UpperCAmelCase       :		List[str] 		=    num_patches + 1
										self.assertEqual(vision_attentions[0].shape[-3:]						,					(vision_config.num_attention_heads, seq_len, seq_len)	)

										_UpperCAmelCase       :		Tuple 		=    output.text_model_output.attentions
										self.assertEqual(len(_UpperCAmelCase	)						,					text_config.num_hidden_layers	)

										self.assertEqual(
										    text_attentions[0].shape[-3:]						,					(text_config.num_attention_heads, input_ids.shape[-1], input_ids.shape[-1])						,					)


						def        _UpperCAmelCase				(       self						,					A_						,					A_						,					A_	):







										'''simple docstring'''


										pt_model.to(_UpperCAmelCase	)
										pt_model.eval()

										# prepare inputs
										_UpperCAmelCase       :		Dict 		=    inputs_dict
										_UpperCAmelCase       :		str 		=    {k: torch.tensor(v.tolist()	) for k, v in flax_inputs.items()}

										with torch.no_grad():
														_UpperCAmelCase       :		Optional[int] 		=    pt_model(**_UpperCAmelCase	).to_tuple()

										_UpperCAmelCase       :		int 		=    fx_model(**_UpperCAmelCase	).to_tuple()
										self.assertEqual(len(_UpperCAmelCase	)						,					len(_UpperCAmelCase	)						,					"Output lengths differ between Flax and PyTorch"	)
										for fx_output, pt_output in zip(fx_outputs[:4]						,					pt_outputs[:4]	):
														self.assert_almost_equals(_UpperCAmelCase						,					pt_output.numpy()						,					4e-2	)

										# PT -> Flax
										with tempfile.TemporaryDirectory() as tmpdirname:
														pt_model.save_pretrained(_UpperCAmelCase	)
														_UpperCAmelCase       :		Tuple 		=    FlaxVisionTextDualEncoderModel.from_pretrained(_UpperCAmelCase						,					from_pt=_UpperCAmelCase	)

										_UpperCAmelCase       :		Optional[Any] 		=    fx_model_loaded(**_UpperCAmelCase	).to_tuple()
										self.assertEqual(len(_UpperCAmelCase	)						,					len(_UpperCAmelCase	)						,					"Output lengths differ between Flax and PyTorch"	)
										for fx_output_loaded, pt_output in zip(fx_outputs_loaded[:4]						,					pt_outputs[:4]	):
														self.assert_almost_equals(_UpperCAmelCase						,					pt_output.numpy()						,					4e-2	)

										# Flax -> PT
										with tempfile.TemporaryDirectory() as tmpdirname:
														fx_model.save_pretrained(_UpperCAmelCase	)
														_UpperCAmelCase       :		Any 		=    VisionTextDualEncoderModel.from_pretrained(_UpperCAmelCase						,					from_flax=_UpperCAmelCase	)

										pt_model_loaded.to(_UpperCAmelCase	)
										pt_model_loaded.eval()

										with torch.no_grad():
														_UpperCAmelCase       :		Tuple 		=    pt_model_loaded(**_UpperCAmelCase	).to_tuple()

										self.assertEqual(len(_UpperCAmelCase	)						,					len(_UpperCAmelCase	)						,					"Output lengths differ between Flax and PyTorch"	)
										for fx_output, pt_output_loaded in zip(fx_outputs[:4]						,					pt_outputs_loaded[:4]	):
														self.assert_almost_equals(_UpperCAmelCase						,					pt_output_loaded.numpy()						,					4e-2	)


						def        _UpperCAmelCase				(       self						,					A_						,					A_						,					A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		List[Any] 		=    VisionTextDualEncoderConfig.from_vision_text_configs(_UpperCAmelCase						,					_UpperCAmelCase	)

										_UpperCAmelCase       :		List[Any] 		=    VisionTextDualEncoderModel(_UpperCAmelCase	)
										_UpperCAmelCase       :		Union[str, Any] 		=    FlaxVisionTextDualEncoderModel(_UpperCAmelCase	)

										_UpperCAmelCase       :		Tuple 		=    convert_pytorch_state_dict_to_flax(pt_model.state_dict()						,					_UpperCAmelCase	)
										_UpperCAmelCase       :		Tuple 		=    fx_state

										self.check_pt_flax_equivalence(_UpperCAmelCase						,					_UpperCAmelCase						,					_UpperCAmelCase	)


						def        _UpperCAmelCase				(       self						,					A_						,					A_						,					A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		str 		=    VisionTextDualEncoderConfig.from_vision_text_configs(_UpperCAmelCase						,					_UpperCAmelCase	)

										_UpperCAmelCase       :		str 		=    VisionTextDualEncoderModel(_UpperCAmelCase	)
										_UpperCAmelCase       :		Tuple 		=    FlaxVisionTextDualEncoderModel(_UpperCAmelCase	)

										_UpperCAmelCase       :		Any 		=    load_flax_weights_in_pytorch_model(_UpperCAmelCase						,					fx_model.params	)

										self.check_pt_flax_equivalence(_UpperCAmelCase						,					_UpperCAmelCase						,					_UpperCAmelCase	)


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		Optional[Any] 		=    self.prepare_config_and_inputs()
										self.check_model_from_pretrained_configs(**_UpperCAmelCase	)


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		Union[str, Any] 		=    self.prepare_config_and_inputs()
										self.check_vision_text_dual_encoder_from_pretrained(**_UpperCAmelCase	)


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		List[str] 		=    self.prepare_config_and_inputs()
										self.check_save_load(**_UpperCAmelCase	)


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		Dict 		=    self.prepare_config_and_inputs()
										self.check_vision_text_output_attention(**_UpperCAmelCase	)


						@is_pt_flax_cross_test
						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		Any 		=    self.prepare_config_and_inputs()
										_UpperCAmelCase       :		Tuple 		=    config_inputs_dict.pop("vision_config"	)
										_UpperCAmelCase       :		Dict 		=    config_inputs_dict.pop("text_config"	)

										_UpperCAmelCase       :		Optional[int] 		=    config_inputs_dict

										self.check_equivalence_pt_to_flax(_UpperCAmelCase						,					_UpperCAmelCase						,					_UpperCAmelCase	)
										self.check_equivalence_flax_to_pt(_UpperCAmelCase						,					_UpperCAmelCase						,					_UpperCAmelCase	)





						@slow
						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		List[Any] 		=    self.get_pretrained_model_and_inputs()

										_UpperCAmelCase       :		Any 		=    model_a(**_UpperCAmelCase	)
										_UpperCAmelCase       :		Any 		=    outputs[0]

										with tempfile.TemporaryDirectory() as tmp_dirname:
														model_a.save_pretrained(_UpperCAmelCase	)
														_UpperCAmelCase       :		Optional[int] 		=    FlaxVisionTextDualEncoderModel.from_pretrained(_UpperCAmelCase	)

														_UpperCAmelCase       :		Optional[Any] 		=    model_a(**_UpperCAmelCase	)
														_UpperCAmelCase       :		str 		=    after_outputs[0]
														_UpperCAmelCase       :		Optional[int] 		=    np.amax(np.abs(out_a - out_a	)	)
														self.assertLessEqual(_UpperCAmelCase						,					1e-5	)







@require_flax
class 				a  (	_UpperCamelCase							, unittest.TestCase				):


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		int 		=    FlaxVisionTextDualEncoderModel.from_vision_text_pretrained(
										    "hf-internal-testing/tiny-random-vit"						,					"hf-internal-testing/tiny-bert"						,					vision_from_pt=_UpperCAmelCase						,					text_from_pt=_UpperCAmelCase						,					)
										_UpperCAmelCase       :		List[Any] 		=    13
										_UpperCAmelCase       :		Union[str, Any] 		=    floats_tensor(
										    [
										        batch_size,
										        model.config.vision_config.num_channels,
										        model.config.vision_config.image_size,
										        model.config.vision_config.image_size,
										    ]	)
										_UpperCAmelCase       :		int 		=    ids_tensor([batch_size, 4]						,					model.config.text_config.vocab_size	)
										_UpperCAmelCase       :		List[str] 		=    random_attention_mask([batch_size, 4]	)
										_UpperCAmelCase       :		List[Any] 		=    {'''pixel_values''': pixel_values, '''input_ids''': input_ids, '''attention_mask''': attention_mask}

										return model, inputs


						def        _UpperCAmelCase				(       self						,					A_						,					A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		int 		=    FlaxViTModel(_UpperCAmelCase	)
										_UpperCAmelCase       :		Any 		=    FlaxBertModel(_UpperCAmelCase	)
										return vision_model, text_model





						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		Union[str, Any] 		=    FlaxViTModelTester(self	)
										_UpperCAmelCase       :		Optional[int] 		=    FlaxBertModelTester(self	)
										_UpperCAmelCase       :		Dict 		=    vit_model_tester.prepare_config_and_inputs()
										_UpperCAmelCase       :		Dict 		=    bert_model_tester.prepare_config_and_inputs()

										_UpperCAmelCase       :		Dict 		=    vision_config_and_inputs

										_UpperCAmelCase       :		Union[str, Any] 		=    text_config_and_inputs

										# make sure that cross attention layers are added
										return {
										    "text_config": text_config,
										    "vision_config": vision_config,
										    "pixel_values": pixel_values,
										    "attention_mask": attention_mask,
										    "input_ids": input_ids,
										    "token_type_ids": token_type_ids,
										}







@require_torch
class 				a  (	_UpperCamelCase							, unittest.TestCase				):


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		int 		=    FlaxVisionTextDualEncoderModel.from_vision_text_pretrained(
										    "hf-internal-testing/tiny-random-clip"						,					"hf-internal-testing/tiny-bert"						,					vision_from_pt=_UpperCAmelCase						,					text_from_pt=_UpperCAmelCase						,					)
										_UpperCAmelCase       :		Optional[Any] 		=    13
										_UpperCAmelCase       :		List[Any] 		=    floats_tensor(
										    [
										        batch_size,
										        model.config.vision_config.num_channels,
										        model.config.vision_config.image_size,
										        model.config.vision_config.image_size,
										    ]	)
										_UpperCAmelCase       :		List[Any] 		=    ids_tensor([batch_size, 4]						,					model.config.text_config.vocab_size	)
										_UpperCAmelCase       :		List[str] 		=    random_attention_mask([batch_size, 4]	)
										_UpperCAmelCase       :		Any 		=    {'''pixel_values''': pixel_values, '''input_ids''': input_ids, '''attention_mask''': attention_mask}

										return model, inputs


						def        _UpperCAmelCase				(       self						,					A_						,					A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		Union[str, Any] 		=    FlaxCLIPVisionModel(_UpperCAmelCase	)
										_UpperCAmelCase       :		Union[str, Any] 		=    FlaxBertModel(_UpperCAmelCase	)
										return vision_model, text_model





						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		Optional[Any] 		=    FlaxCLIPVisionModelTester(self	)
										_UpperCAmelCase       :		int 		=    FlaxBertModelTester(self	)
										_UpperCAmelCase       :		List[Any] 		=    clip_model_tester.prepare_config_and_inputs()
										_UpperCAmelCase       :		Optional[int] 		=    bert_model_tester.prepare_config_and_inputs()

										_UpperCAmelCase       :		int 		=    vision_config_and_inputs

										_UpperCAmelCase       :		Optional[Any] 		=    text_config_and_inputs

										# make sure that cross attention layers are added
										return {
										    "text_config": text_config,
										    "vision_config": vision_config,
										    "pixel_values": pixel_values,
										    "attention_mask": attention_mask,
										    "input_ids": input_ids,
										    "token_type_ids": token_type_ids,
										}







@require_flax
@require_vision
class 				a  (	unittest.TestCase				):


						@slow
						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		List[Any] 		=    FlaxVisionTextDualEncoderModel.from_pretrained("clip-italian/clip-italian"						,					logit_scale_init_value=1.0	)
										_UpperCAmelCase       :		List[Any] 		=    VisionTextDualEncoderProcessor.from_pretrained("clip-italian/clip-italian"	)

										_UpperCAmelCase       :		Dict 		=    Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"	)
										_UpperCAmelCase       :		Optional[int] 		=    processor(
										    text=["una foto di un gatto", "una foto di un cane"]						,					images=_UpperCAmelCase						,					padding=_UpperCAmelCase						,					return_tensors="np"	)

										_UpperCAmelCase       :		Optional[Any] 		=    model(**_UpperCAmelCase	)

										# verify the logits
										self.assertEqual(outputs.logits_per_image.shape						,					(inputs.pixel_values.shape[0], inputs.input_ids.shape[0])	)
										self.assertEqual(
										    outputs.logits_per_text.shape						,					(inputs.input_ids.shape[0], inputs.pixel_values.shape[0])						,					)

										_UpperCAmelCase       :		List[Any] 		=    np.array([[1.2_28_47_27, 0.3_10_41_22]]	)

										self.assertTrue(np.allclose(outputs.logits_per_image						,					_UpperCAmelCase						,					atol=1e-3	)	)





from __future__ import annotations

import pandas as pd

def 							__SCREAMING_SNAKE_CASE							(				lowerCAmelCase:  list[int]  ,      lowerCAmelCase:  list[int]  ,      lowerCAmelCase:  int )   ->       list[int]:
				_UpperCAmelCase       :		List[Any] 		=    [0] * no_of_processes
				_UpperCAmelCase       :		Dict 		=    [0] * no_of_processes
				# Copy the burst time into remaining_time[]
				for i in range(lowerCAmelCase ):
								_UpperCAmelCase       :		List[str] 		=    burst_time[i]

				_UpperCAmelCase       :		Any 		=    0
				_UpperCAmelCase       :		Union[str, Any] 		=    0
				_UpperCAmelCase       :		str 		=    9_9999_9999
				_UpperCAmelCase       :		List[Any] 		=    0
				_UpperCAmelCase       :		Any 		=    False

				# Process until all processes are completed
				while complete != no_of_processes:
								for j in range(lowerCAmelCase ):
												if arrival_time[j] <= increment_time and remaining_time[j] > 0:
																if remaining_time[j] < minm:
																				_UpperCAmelCase       :		Optional[int] 		=    remaining_time[j]
																				_UpperCAmelCase       :		int 		=    j
																				_UpperCAmelCase       :		Tuple 		=    True

								if not check:
												increment_time += 1
												continue
								remaining_time[short] -= 1

								_UpperCAmelCase       :		List[Any] 		=    remaining_time[short]
								if minm == 0:
												_UpperCAmelCase       :		List[Any] 		=    9_9999_9999

								if remaining_time[short] == 0:
												complete += 1
												_UpperCAmelCase       :		int 		=    False

												# Find finish time of current process
												_UpperCAmelCase       :		Optional[int] 		=    increment_time + 1

												# Calculate waiting time
												_UpperCAmelCase       :		str 		=    finish_time - arrival_time[short]
												_UpperCAmelCase       :		Union[str, Any] 		=    finar - burst_time[short]

												if waiting_time[short] < 0:
																_UpperCAmelCase       :		Optional[int] 		=    0

        # Increment time
								increment_time += 1
				return waiting_time

def 							__SCREAMING_SNAKE_CASE							(				lowerCAmelCase:  list[int]  ,      lowerCAmelCase:  int  ,      lowerCAmelCase:  list[int] )   ->       list[int]:
				_UpperCAmelCase       :		str 		=    [0] * no_of_processes
				for i in range(lowerCAmelCase ):
								_UpperCAmelCase       :		str 		=    burst_time[i] + waiting_time[i]
				return turn_around_time

def 							__SCREAMING_SNAKE_CASE							(				lowerCAmelCase:  list[int]  ,      lowerCAmelCase:  list[int]  ,      lowerCAmelCase:  int )   ->       None:
				_UpperCAmelCase       :		Dict 		=    0
				_UpperCAmelCase       :		List[str] 		=    0
				for i in range(lowerCAmelCase ):
								_UpperCAmelCase       :		Union[str, Any] 		=    total_waiting_time + waiting_time[i]
								_UpperCAmelCase       :		int 		=    total_turn_around_time + turn_around_time[i]
				print(F'Average waiting time = {total_waiting_time / no_of_processes:.5f}' )
				print("Average turn around time ="  ,      total_turn_around_time / no_of_processes )


if __name__ == "__main__":
					print('Enter how many process you want to analyze')
					SCREAMING_SNAKE_CASE_        =      int(input())
					SCREAMING_SNAKE_CASE_        =      [0] * no_of_processes
					SCREAMING_SNAKE_CASE_        =      [0] * no_of_processes
					SCREAMING_SNAKE_CASE_        =      list(range(1, no_of_processes + 1))

					for i in range(no_of_processes):
										print('Enter the arrival time and burst time for process:--' + str(i + 1))
										SCREAMING_SNAKE_CASE_    ,SCREAMING_SNAKE_CASE_        =      map(int, input().split())

					SCREAMING_SNAKE_CASE_        =      calculate_waitingtime(arrival_time, burst_time, no_of_processes)

					SCREAMING_SNAKE_CASE_        =      burst_time
					SCREAMING_SNAKE_CASE_        =      no_of_processes
					SCREAMING_SNAKE_CASE_        =      waiting_time
					SCREAMING_SNAKE_CASE_        =      calculate_turnaroundtime(bt, n, wt)

					calculate_average_times(waiting_time, turn_around_time, no_of_processes)

					SCREAMING_SNAKE_CASE_        =      pd.DataFrame(
					    list(zip(processes, burst_time, arrival_time, waiting_time, turn_around_time)),
					    columns=[
					        'Process',
					        'BurstTime',
					        'ArrivalTime',
					        'WaitingTime',
					        'TurnAroundTime',
					    ],
					)

					# Printing the dataFrame
					pd.set_option('display.max_rows', fcfs.shape[0] + 1)
					print(fcfs)


