
'''simple docstring'''


from ...processing_utils import ProcessorMixin

class 	__lowercase				(  _lowercase    ):
			lowerCamelCase			:		int	      =			["image_processor", "feature_extractor"]
			lowerCamelCase			:		str	      =			"TvltImageProcessor"
			lowerCamelCase			:		Optional[int]	      =			"TvltFeatureExtractor"

			def __init__(self			,   A			,   A      ):
								super().__init__(image_processor=A			,   feature_extractor=A      )

								lowerCamelCase_					:      Optional[Any]     =		image_processor
								lowerCamelCase_					:      Dict     =		feature_extractor

			def __call__(self			,   A=None			,   A=None			,   A=None			,   A=None			,   A=False			,   A=False			,   *A			,   **A			,   ):

								if images is None and audio is None:
													raise ValueError('''You need to specify either an `images` or `audio` input to process.'''      )

								lowerCamelCase_					:      Dict     =		None
								if images is not None:
													lowerCamelCase_					:      Union[str, Any]     =		self.image_processor(A			,   mask_pixel=A			,   *A			,   **A      )
								if images_mixed is not None:
													lowerCamelCase_					:      Any     =		self.image_processor(A			,   is_mixed=A			,   *A			,   **A      )
								if audio is not None:
													lowerCamelCase_					:      Optional[Any]     =		self.feature_extractor(
													    A			,   *A			,   sampling_rate=A			,   mask_audio=A			,   **A      )

								lowerCamelCase_					:      Union[str, Any]     =		{}
								if audio is not None:
													output_dict.update(A      )
								if images is not None:
													output_dict.update(A      )
								if images_mixed_dict is not None:
													output_dict.update(A      )
								return output_dict






			@property
			def        UpperCAmelCase__ (self      ):
								lowerCamelCase_					:      int     =		self.image_processor.model_input_names
								lowerCamelCase_					:      Optional[int]     =		self.feature_extractor.model_input_names
								return list(dict.fromkeys(image_processor_input_names + feature_extractor_input_names      )      )




'''simple docstring'''


from collections import namedtuple

__lowercase							:   List[Any]					=     namedtuple('''from_to''', '''from_ to''')

__lowercase							:   Optional[Any]					=     {
    '''cubicmeter''': from_to(1, 1),
    '''litre''': from_to(0.0_01, 1000),
    '''kilolitre''': from_to(1, 1),
    '''gallon''': from_to(0.0_04_54, 2_64.1_72),
    '''cubicyard''': from_to(0.7_64_55, 1.3_07_95),
    '''cubicfoot''': from_to(0.0_28, 35.31_47),
    '''cup''': from_to(0.0_00_23_65_88, 42_26.75),
}




def lowercase_	(   _lowercase			,       _lowercase			,       _lowercase				)     ->							float:
					'''simple docstring'''

					if from_type not in METRIC_CONVERSION:
										raise ValueError(
										    F"""Invalid 'from_type' value: {from_type!r}  Supported values are:\n"""
										    + ''', '''.join(_lowercase				)				)
					if to_type not in METRIC_CONVERSION:
										raise ValueError(
										    F"""Invalid 'to_type' value: {to_type!r}.  Supported values are:\n"""
										    + ''', '''.join(_lowercase				)				)
					return value * METRIC_CONVERSION[from_type].from_ * METRIC_CONVERSION[to_type].to


if __name__ == "__main__":
					import doctest

					doctest.testmod()


