

'''simple docstring'''
from ...processing_utils import ProcessorMixin







class 							A__   (	A__  ):
  A__					=    ['image_processor', 'feature_extractor']
  A__					=    'TvltImageProcessor'
  A__					=    'TvltFeatureExtractor'





  def __init__(		self				:     Any							, _a				:     Tuple							, _a				:     List[str]			)     ->   Optional[Any]:





       '''simple docstring'''






       super().__init__(image_processor=_a							, feature_extractor=_a			)

       _SCREAMING_SNAKE_CASE							   =image_processor
       _SCREAMING_SNAKE_CASE							   =feature_extractor





  def __call__(		self				:     str							, _a				:     str=None							, _a				:     Tuple=None							, _a				:     Optional[int]=None							, _a				:     Tuple=None							, _a				:     Any=False							, _a				:     str=False							, *_a				:     List[Any]							, **_a				:     int							, )     ->   List[str]:





       '''simple docstring'''






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

       _SCREAMING_SNAKE_CASE							   =None
       if images is not None:
            _SCREAMING_SNAKE_CASE							   =self.image_processor(_a							, mask_pixel=_a							, *_a							, **_a			)
       if images_mixed is not None:
            _SCREAMING_SNAKE_CASE							   =self.image_processor(_a							, is_mixed=_a							, *_a							, **_a			)
       if audio is not None:
            _SCREAMING_SNAKE_CASE							   =self.feature_extractor(
                _a							, *_a							, sampling_rate=_a							, mask_audio=_a							, **_a			)

       _SCREAMING_SNAKE_CASE							   ={}
       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 						A  (		self				:     List[Any]			)     ->   Union[str, Any]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							   =self.image_processor.model_input_names
       _SCREAMING_SNAKE_CASE							   =self.feature_extractor.model_input_names
       return list(dict.fromkeys(image_processor_input_names + feature_extractor_input_names			)			)



'''simple docstring'''
from math import factorial


def 	_lowerCAmelCase (						_UpperCamelCase						:					int							,			_UpperCamelCase						:					int							,			_UpperCamelCase						:					float    )				->      float:
     """simple docstring"""




     if successes > trials:
          raise ValueError('successes must be lower or equal to trials'    )
     if trials < 0 or successes < 0:
          raise ValueError('the function is defined for non-negative integers'    )
     if not isinstance(_UpperCamelCase							,			_UpperCamelCase    ) or not isinstance(_UpperCamelCase							,			_UpperCamelCase    ):
          raise ValueError('the function is defined for non-negative integers'    )
     if not 0 < prob < 1:
          raise ValueError('prob has to be in range of 1 - 0'    )
     _SCREAMING_SNAKE_CASE							   =(prob**successes) * ((1 - prob) ** (trials - successes))
     # Calculate the binomial coefficient: n! / k!(n-k)!
     _SCREAMING_SNAKE_CASE							   =float(factorial(_UpperCamelCase    )    )
     coefficient /= factorial(_UpperCamelCase    ) * factorial(trials - successes    )
     return probability * coefficient


if __name__ == "__main__":
     from doctest import testmod

     testmod()
     print("Probability of 2 successes out of 4 trails")
     print("with probability of 0.75 is:", end=" ")
     print(binomial_distribution(2, 4, 0.7_5))
