import argparse
import os
import re

import numpy as np
import PIL
import torch
from timm import create_model
from torch.optim.lr_scheduler import OneCycleLR
from torch.utils.data import DataLoader, Dataset
from torchvision.transforms import Compose, RandomResizedCrop, Resize, ToTensor

from accelerate import Accelerator






def    __lowerCamelCase	(		lowerCAmelCase__			):
							lowerCAmelCase__  			=      fname.split(os.path.sep			)[-1]
							return re.search(r'^(.*)_\d+\.jpg$'			,						lowerCAmelCase__			).groups()[0]
class        a_				(		a__		):






	'''simple docstring'''






	def __init__(    self      :						Optional[int]    ,					lowercase__      :						List[Any]    ,					lowercase__      :						Optional[int]=None    ,					lowercase__      :						Optional[int]=None):







								'''simple docstring'''



								lowerCAmelCase__  			=      file_names
								lowerCAmelCase__  			=      image_transform
								lowerCAmelCase__  			=      label_to_id




	def __len__(    self      :						int):







								'''simple docstring'''



								return len(self.file_names)




	def __getitem__(    self      :						int    ,					lowercase__      :						int):







								'''simple docstring'''



								lowerCAmelCase__  			=      self.file_names[idx]
								lowerCAmelCase__  			=      PIL.Image.open(__A)
								lowerCAmelCase__  			=      raw_image.convert('RGB')
								if self.image_transform is not None:
															lowerCAmelCase__  			=      self.image_transform(__A)
								lowerCAmelCase__  			=      extract_label(__A)
								if self.label_to_id is not None:
															lowerCAmelCase__  			=      self.label_to_id[label]
								return {"image": image, "label": label}






def    __lowerCamelCase	(		lowerCAmelCase__			,						lowerCAmelCase__			):
							lowerCAmelCase__  			=      Accelerator(cpu=args.cpu			,						mixed_precision=args.mixed_precision			)

							# Sample hyper-parameters for learning rate, batch size, seed and a few other HPs
							lowerCAmelCase__  			=      config["lr"]
							lowerCAmelCase__  			=      int(config['num_epochs']			)
							lowerCAmelCase__  			=      int(config['seed']			)
							lowerCAmelCase__  			=      int(config['batch_size']			)
							lowerCAmelCase__  			=      config["image_size"]
							if not isinstance(lowerCAmelCase__			,						(list, tuple)			):
														lowerCAmelCase__  			=      (image_size, image_size)

							# Grab all the image filenames
							lowerCAmelCase__  			=      [os.path.join(args.data_dir			,						lowerCAmelCase__			) for fname in os.listdir(args.data_dir			) if fname.endswith('.jpg'			)]

							# Build the label correspondences
							lowerCAmelCase__  			=      [extract_label(lowerCAmelCase__			) for fname in file_names]
							lowerCAmelCase__  			=      list(set(lowerCAmelCase__			)			)
							id_to_label.sort()
							lowerCAmelCase__  			=      {lbl: i for i, lbl in enumerate(lowerCAmelCase__			)}

							# Set the seed before splitting the data.
							np.random.seed(lowerCAmelCase__			)
							torch.manual_seed(lowerCAmelCase__			)
							torch.cuda.manual_seed_all(lowerCAmelCase__			)

							# Split our filenames between train and validation
							lowerCAmelCase__  			=      np.random.permutation(len(lowerCAmelCase__			)			)
							lowerCAmelCase__  			=      int(0.8 * len(lowerCAmelCase__			)			)
							lowerCAmelCase__  			=      random_perm[:cut]
							lowerCAmelCase__  			=      random_perm[cut:]

							# For training we use a simple RandomResizedCrop
							lowerCAmelCase__  			=      Compose([RandomResizedCrop(lowerCAmelCase__			,						scale=(0.5, 1.0)			), ToTensor()]			)
							lowerCAmelCase__  			=      PetsDataset(
							    [file_names[i] for i in train_split]			,						image_transform=lowerCAmelCase__			,						label_to_id=lowerCAmelCase__			)

							# For evaluation, we use a deterministic Resize
							lowerCAmelCase__  			=      Compose([Resize(lowerCAmelCase__			), ToTensor()]			)
							lowerCAmelCase__  			=      PetsDataset([file_names[i] for i in eval_split]			,						image_transform=lowerCAmelCase__			,						label_to_id=lowerCAmelCase__			)

							# Instantiate dataloaders.
							lowerCAmelCase__  			=      DataLoader(lowerCAmelCase__			,						shuffle=lowerCAmelCase__			,						batch_size=lowerCAmelCase__			,						num_workers=4			)
							lowerCAmelCase__  			=      DataLoader(lowerCAmelCase__			,						shuffle=lowerCAmelCase__			,						batch_size=lowerCAmelCase__			,						num_workers=4			)

							# Instantiate the model (we build the model here so that the seed also control new weights initialization)
							lowerCAmelCase__  			=      create_model('resnet50d'			,						pretrained=lowerCAmelCase__			,						num_classes=len(lowerCAmelCase__			)			)

							# We could avoid this line since the accelerator is set with `device_placement=True` (default value).
							# Note that if you are placing tensors on devices manually, this line absolutely needs to be before the optimizer
							# creation otherwise training will not work on TPU (`accelerate` will kindly throw an error to make us aware of that).
							lowerCAmelCase__  			=      model.to(accelerator.device			)

							# Freezing the base model
							for param in model.parameters():
														lowerCAmelCase__  			=      False
							for param in model.get_classifier().parameters():
														lowerCAmelCase__  			=      True

							# We normalize the batches of images to be a bit faster.
							lowerCAmelCase__  			=      torch.tensor(model.default_cfg['mean']			)[None, :, None, None].to(accelerator.device			)
							lowerCAmelCase__  			=      torch.tensor(model.default_cfg['std']			)[None, :, None, None].to(accelerator.device			)

							# Instantiate optimizer
							lowerCAmelCase__  			=      torch.optim.Adam(params=model.parameters()			,						lr=lr / 2_5			)

							# Instantiate learning rate scheduler
							lowerCAmelCase__  			=      OneCycleLR(optimizer=lowerCAmelCase__			,						max_lr=lowerCAmelCase__			,						epochs=lowerCAmelCase__			,						steps_per_epoch=len(lowerCAmelCase__			)			)

							# Prepare everything
							# There is no specific order to remember, we just need to unpack the objects in the same order we gave them to the
							# prepare method.
							lowerCAmelCase__  			=      accelerator.prepare(
							    lowerCAmelCase__			,						lowerCAmelCase__			,						lowerCAmelCase__			,						lowerCAmelCase__			,						lowerCAmelCase__			)

							# Now we train the model
							for epoch in range(lowerCAmelCase__			):
														model.train()
														for step, batch in enumerate(lowerCAmelCase__			):
																					# We could avoid this line since we set the accelerator with `device_placement=True`.
																					lowerCAmelCase__  			=      {k: v.to(accelerator.device			) for k, v in batch.items()}
																					lowerCAmelCase__  			=      (batch["image"] - mean) / std
																					lowerCAmelCase__  			=      model(lowerCAmelCase__			)
																					lowerCAmelCase__  			=      torch.nn.functional.cross_entropy(lowerCAmelCase__			,						batch['label']			)
																					accelerator.backward(lowerCAmelCase__			)
																					optimizer.step()
																					lr_scheduler.step()
																					optimizer.zero_grad()

														model.eval()
														lowerCAmelCase__  			=      0
														lowerCAmelCase__  			=      0
														for _, batch in enumerate(lowerCAmelCase__			):
																					# We could avoid this line since we set the accelerator with `device_placement=True`.
																					lowerCAmelCase__  			=      {k: v.to(accelerator.device			) for k, v in batch.items()}
																					lowerCAmelCase__  			=      (batch["image"] - mean) / std
																					with torch.no_grad():
																												lowerCAmelCase__  			=      model(lowerCAmelCase__			)
																					lowerCAmelCase__  			=      outputs.argmax(dim=-1			)
																					lowerCAmelCase__  			=      accelerator.gather_for_metrics((predictions, batch['label'])			)
																					lowerCAmelCase__  			=      predictions == references
																					num_elems += accurate_preds.shape[0]
																					accurate += accurate_preds.long().sum()

														lowerCAmelCase__  			=      accurate.item() / num_elems
														# Use accelerator.print to print only on the main process.
														accelerator.print(F"""epoch {epoch}: {1_0_0 * eval_metric:.2f}"""			)






def    __lowerCamelCase	(		):
							lowerCAmelCase__  			=      argparse.ArgumentParser(description='Simple example of training script.'			)
							parser.add_argument('--data_dir'			,						required=lowerCAmelCase__			,						help='The data folder on disk.'			)
							parser.add_argument(
							    '--mixed_precision'			,						type=lowerCAmelCase__			,						default=lowerCAmelCase__			,						choices=['no', 'fp16', 'bf16', 'fp8']			,						help='Whether to use mixed precision. Choose'
							    'between fp16 and bf16 (bfloat16). Bf16 requires PyTorch >= 1.10.'
							    'and an Nvidia Ampere GPU.'			,						)
							parser.add_argument(
							    '--checkpointing_steps'			,						type=lowerCAmelCase__			,						default=lowerCAmelCase__			,						help='Whether the various states should be saved at the end of every n steps, or \'epoch\' for each epoch.'			,						)
							parser.add_argument('--cpu'			,						action='store_true'			,						help='If passed, will train on the CPU.'			)
							lowerCAmelCase__  			=      parser.parse_args()
							lowerCAmelCase__  			=      {"lr": 3e-2, "num_epochs": 3, "seed": 4_2, "batch_size": 6_4, "image_size": 2_2_4}
							training_function(lowerCAmelCase__			,						lowerCAmelCase__			)


if __name__ == "__main__":
				main()

from ..utils import DummyObject, requires_backends
class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[str]    ,					*lowercase__      :						Any    ,					**lowercase__      :						List[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						str    ,					*lowercase__      :						List[str]    ,					**lowercase__      :						List[str]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						str    ,					*lowercase__      :						Dict    ,					**lowercase__      :						List[str]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Dict    ,					*lowercase__      :						int    ,					**lowercase__      :						Dict):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Optional[Any]    ,					*lowercase__      :						Dict    ,					**lowercase__      :						List[str]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Any    ,					*lowercase__      :						int    ,					**lowercase__      :						str):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						str    ,					*lowercase__      :						Dict    ,					**lowercase__      :						int):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[str]    ,					*lowercase__      :						Dict    ,					**lowercase__      :						Dict):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Any    ,					*lowercase__      :						Tuple    ,					**lowercase__      :						Dict):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[Any]    ,					*lowercase__      :						int    ,					**lowercase__      :						Tuple):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						int    ,					*lowercase__      :						Optional[Any]    ,					**lowercase__      :						Union[str, Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Tuple    ,					*lowercase__      :						Dict    ,					**lowercase__      :						Any):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Tuple    ,					*lowercase__      :						Optional[Any]    ,					**lowercase__      :						Any):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						str    ,					*lowercase__      :						Union[str, Any]    ,					**lowercase__      :						Dict):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						int    ,					*lowercase__      :						Tuple    ,					**lowercase__      :						List[str]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Optional[Any]    ,					*lowercase__      :						List[Any]    ,					**lowercase__      :						Union[str, Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[str]    ,					*lowercase__      :						List[Any]    ,					**lowercase__      :						Any):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						str    ,					*lowercase__      :						Optional[int]    ,					**lowercase__      :						Optional[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						str    ,					*lowercase__      :						Any    ,					**lowercase__      :						Tuple):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						int    ,					*lowercase__      :						Union[str, Any]    ,					**lowercase__      :						Tuple):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						str    ,					*lowercase__      :						List[str]    ,					**lowercase__      :						Tuple):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Any    ,					*lowercase__      :						Dict    ,					**lowercase__      :						Tuple):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						str    ,					*lowercase__      :						Tuple    ,					**lowercase__      :						List[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						int    ,					*lowercase__      :						Dict    ,					**lowercase__      :						Dict):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[str]    ,					*lowercase__      :						List[Any]    ,					**lowercase__      :						Optional[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[str]    ,					*lowercase__      :						Any    ,					**lowercase__      :						List[str]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						int    ,					*lowercase__      :						Union[str, Any]    ,					**lowercase__      :						Optional[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Tuple    ,					*lowercase__      :						Any    ,					**lowercase__      :						Tuple):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Dict    ,					*lowercase__      :						Optional[int]    ,					**lowercase__      :						Dict):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[Any]    ,					*lowercase__      :						str    ,					**lowercase__      :						List[str]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Optional[int]    ,					*lowercase__      :						Any    ,					**lowercase__      :						Union[str, Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Optional[int]    ,					*lowercase__      :						List[str]    ,					**lowercase__      :						Optional[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Dict    ,					*lowercase__      :						List[Any]    ,					**lowercase__      :						Tuple):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Any    ,					*lowercase__      :						Union[str, Any]    ,					**lowercase__      :						Optional[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[Any]    ,					*lowercase__      :						Tuple    ,					**lowercase__      :						Optional[int]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						int    ,					*lowercase__      :						Any    ,					**lowercase__      :						str):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Dict    ,					*lowercase__      :						Dict    ,					**lowercase__      :						List[str]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[Any]    ,					*lowercase__      :						str    ,					**lowercase__      :						Optional[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Optional[int]    ,					*lowercase__      :						str    ,					**lowercase__      :						List[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[str]    ,					*lowercase__      :						Any    ,					**lowercase__      :						Union[str, Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Optional[Any]    ,					*lowercase__      :						int    ,					**lowercase__      :						Tuple):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[Any]    ,					*lowercase__      :						Union[str, Any]    ,					**lowercase__      :						Optional[int]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[str]    ,					*lowercase__      :						Optional[int]    ,					**lowercase__      :						Optional[int]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Union[str, Any]    ,					*lowercase__      :						Optional[int]    ,					**lowercase__      :						Optional[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Optional[int]    ,					*lowercase__      :						Optional[int]    ,					**lowercase__      :						int):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Any    ,					*lowercase__      :						Dict    ,					**lowercase__      :						Optional[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Any    ,					*lowercase__      :						Tuple    ,					**lowercase__      :						List[str]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Union[str, Any]    ,					*lowercase__      :						Union[str, Any]    ,					**lowercase__      :						Tuple):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Optional[Any]    ,					*lowercase__      :						Tuple    ,					**lowercase__      :						Optional[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Union[str, Any]    ,					*lowercase__      :						Union[str, Any]    ,					**lowercase__      :						List[str]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Optional[int]    ,					*lowercase__      :						Optional[int]    ,					**lowercase__      :						str):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Optional[int]    ,					*lowercase__      :						Any    ,					**lowercase__      :						Any):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						str    ,					*lowercase__      :						Dict    ,					**lowercase__      :						Optional[Any]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						List[str]    ,					*lowercase__      :						str    ,					**lowercase__      :						Tuple):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Any    ,					*lowercase__      :						Dict    ,					**lowercase__      :						Tuple):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Tuple    ,					*lowercase__      :						Any    ,					**lowercase__      :						Dict):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Union[str, Any]    ,					*lowercase__      :						Optional[int]    ,					**lowercase__      :						Optional[int]):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])






class        a_				(		metaclass=SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      ['tokenizers']




 def __init__(    self      :						Dict    ,					*lowercase__      :						Optional[int]    ,					**lowercase__      :						str):







        '''simple docstring'''



        requires_backends(self    ,					['tokenizers'])
