




'''simple docstring'''





from ctypes import c_float, sizeof
from enum import Enum
from typing import TYPE_CHECKING, Optional, Union


if TYPE_CHECKING:
						from .. import AutoFeatureExtractor, AutoProcessor, AutoTokenizer  # tests_ignore



class       lowercase_		(SCREAMING_SNAKE_CASE__   ):
						lowerCAmelCase__ 			=c_float



						@property
						def   __a				( self  :      int     ):

								"""simple docstring"""

								return sizeof(self.value     )


def 				_a       (				lowerCAmelCase						,	lowerCAmelCase						,	lowerCAmelCase = 0   )->  int:







		if dimension <= 0:
				SCREAMING_SNAKE_CASE_							=       fixed_dimension

		dimension -= num_token_to_add
		return dimension


def 				_a       (				lowerCAmelCase						,	lowerCAmelCase   )->  int:
		return num_parameters * dtype.size




def 				_a       (				lowerCAmelCase   )->  Optional[Union["AutoTokenizer", "AutoFeatureExtractor", "AutoProcessor"]]:
		from .. import AutoFeatureExtractor, AutoProcessor, AutoTokenizer  # tests_ignore

		try:
				return AutoProcessor.from_pretrained(_UpperCamelCase   )
		except (ValueError, OSError, KeyError):
				SCREAMING_SNAKE_CASE_			,							SCREAMING_SNAKE_CASE_							=       None, None
				try:
						SCREAMING_SNAKE_CASE_							=       AutoTokenizer.from_pretrained(_UpperCamelCase   )
				except (OSError, KeyError):
						pass
				try:
						SCREAMING_SNAKE_CASE_							=       AutoFeatureExtractor.from_pretrained(_UpperCamelCase   )
				except (OSError, KeyError):
						pass

				if tokenizer is not None and feature_extractor is not None:
						raise ValueError(
						    F'''Couldn\'t auto-detect preprocessor for {model_name}. Found both a tokenizer and a feature extractor.'''   )
				elif tokenizer is None and feature_extractor is None:
						return None
				elif tokenizer is not None:
						return tokenizer
				else:
						return feature_extractor





from __future__ import annotations


def 				_a       (				lowerCAmelCase						,	lowerCAmelCase   )->  int:
		SCREAMING_SNAKE_CASE_			,							SCREAMING_SNAKE_CASE_							=       0, len(lowerCAmelCase   ) - 1
		while start_ind <= end_ind:
				if array[start_ind] == search_item:
						return start_ind
				elif array[end_ind] == search_item:
						return end_ind
				else:
						start_ind += 1
						end_ind -= 1
    # returns -1 if search_item is not found in array
		return -1


if __name__ == "__main__":
						print(double_linear_search(list(range(1_0_0)), 4_0))