


"""simple docstring"""






from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding


class     __lowerCamelCase  (					a__				):

     '''simple docstring'''
     A_       :	List[Any]    =		['image_processor', 'tokenizer']
     A_       :	Optional[int]    =		'AutoImageProcessor'
     A_       :	Union[str, Any]    =		'AutoTokenizer'


     def __init__(      self    ,				__UpperCAmelCase    ,				__UpperCAmelCase							)       ->							Any:
          super().__init__(__UpperCAmelCase    ,				__UpperCAmelCase							)
          _a    	=				self.image_processor


     def __call__(      self    ,				__UpperCAmelCase=None    ,				__UpperCAmelCase=None    ,				__UpperCAmelCase=None    ,				**__UpperCAmelCase							)       ->							Dict:

          if text is None and images is None:
               raise ValueError('''You have to specify either text or images. Both cannot be none.'''							)

          if text is not None:
               _a    	=				self.tokenizer(__UpperCAmelCase    ,				return_tensors=__UpperCAmelCase    ,				**__UpperCAmelCase							)

          if images is not None:
               _a    	=				self.image_processor(__UpperCAmelCase    ,				return_tensors=__UpperCAmelCase    ,				**__UpperCAmelCase							)

          if text is not None and images is not None:
               _a    	=				image_features.pixel_values
               return encoding
          elif text is not None:
               return encoding
          else:
               return BatchEncoding(data=dict(**__UpperCAmelCase							)    ,				tensor_type=__UpperCAmelCase							)


     def 							_UpperCAmelCase      (      self    ,				*__UpperCAmelCase    ,				**__UpperCAmelCase							)       ->							Any:
          return self.tokenizer.batch_decode(*__UpperCAmelCase    ,				**__UpperCAmelCase							)


     def 							_UpperCAmelCase      (      self    ,				*__UpperCAmelCase    ,				**__UpperCAmelCase							)       ->							str:
          return self.tokenizer.decode(*__UpperCAmelCase    ,				**__UpperCAmelCase							)





     @property
     def 							_UpperCAmelCase      (      self							)       ->							str:
          return ["input_ids", "attention_mask", "pixel_values"]



"""simple docstring"""






from typing import Any
def       A_   (   _lowerCAmelCase     :					list       ):






     """simple docstring"""

     if not input_list:
          return []
     _a    	=				[input_list.count(_lowerCAmelCase       ) for value in input_list]
     _a    	=				max(_lowerCAmelCase       )  # Gets the maximum count in the input list.
     # Gets values of modes
     return sorted({input_list[i] for i, value in enumerate(_lowerCAmelCase       ) if value == y}       )


if __name__ == "__main__":
   import doctest

   doctest.testmod()