





import doctest
import logging
import os
import unittest
from pathlib import Path
from typing import List, Union

import transformers
from transformers.testing_utils import require_tf, require_torch, slow


__lowercase	: Optional[int]       =logging.getLogger()

@unittest.skip('''Temporarily disable the doc tests.'''    )
@require_torch
@require_tf
@slow
class   A							(						unittest.TestCase    ):



      def 						lowerCAmelCase__     (						self:    str		,	_lowerCAmelCase:    Path		,	_lowerCAmelCase:    Union[str, None] = None		,	_lowerCAmelCase:    Union[List[str], None] = None		,	_lowerCAmelCase:    Union[str, List[str], None] = None		,	_lowerCAmelCase:    bool = True		,	)    ->     Dict:
         '''simple docstring'''

         UpperCAmelCase_           =[file for file in os.listdir(_lowerCAmelCase							) if os.path.isfile(os.path.join(_lowerCAmelCase		,	_lowerCAmelCase							)							)]

         if identifier is not None:
            UpperCAmelCase_           =[file for file in files if identifier in file]

         if n_identifier is not None:
            if isinstance(_lowerCAmelCase		,	_lowerCAmelCase							):
               for n_ in n_identifier:
                  UpperCAmelCase_           =[file for file in files if n_ not in file]
            else:
               UpperCAmelCase_           =[file for file in files if n_identifier not in file]

         UpperCAmelCase_           =ignore_files or []
         ignore_files.append("__init__.py"							)
         UpperCAmelCase_           =[file for file in files if file not in ignore_files]

         for file in files:
            # Open all files
            print("Testing"		,	_lowerCAmelCase							)

            if only_modules:
               UpperCAmelCase_           =file.split("."							)[0]
               try:
                  UpperCAmelCase_           =getattr(_lowerCAmelCase		,	_lowerCAmelCase							)
                  UpperCAmelCase_           =doctest.DocTestSuite(_lowerCAmelCase							)
                  UpperCAmelCase_           =unittest.TextTestRunner().run(_lowerCAmelCase							)
                  self.assertIs(len(result.failures							)		,	0							)
               except AttributeError:
                  logger.info(F'{module_identifier} is not a module.'							)
            else:
               UpperCAmelCase_           =doctest.testfile(str(".." / directory / file							)		,	optionflags=doctest.ELLIPSIS							)
               self.assertIs(result.failed		,	0							)



      def 						lowerCAmelCase__     (						self:    Optional[int]							)    ->     Tuple:
         '''simple docstring'''

         UpperCAmelCase_           =Path("src/transformers"							)
         UpperCAmelCase_           ="modeling"
         UpperCAmelCase_           =[
             "modeling_ctrl.py",
             "modeling_tf_ctrl.py",
         ]
         self.analyze_directory(_lowerCAmelCase		,	identifier=_lowerCAmelCase		,	ignore_files=_lowerCAmelCase							)



      def 						lowerCAmelCase__     (						self:    Tuple							)    ->     Optional[int]:
         '''simple docstring'''

         UpperCAmelCase_           =Path("src/transformers"							)
         UpperCAmelCase_           ="tokenization"
         self.analyze_directory(_lowerCAmelCase		,	identifier=_lowerCAmelCase							)



      def 						lowerCAmelCase__     (						self:    List[Any]							)    ->     Tuple:
         '''simple docstring'''

         UpperCAmelCase_           =Path("src/transformers"							)
         UpperCAmelCase_           ="configuration"
         self.analyze_directory(_lowerCAmelCase		,	identifier=_lowerCAmelCase							)



      def 						lowerCAmelCase__     (						self:    List[str]							)    ->     Union[str, Any]:
         '''simple docstring'''

         UpperCAmelCase_           =Path("src/transformers"							)
         UpperCAmelCase_           =["configuration", "modeling", "tokenization"]
         self.analyze_directory(_lowerCAmelCase		,	n_identifier=_lowerCAmelCase							)






      def 						lowerCAmelCase__     (						self:    List[Any]							)    ->     List[Any]:
         '''simple docstring'''

         UpperCAmelCase_           =Path("docs/source"							)
         UpperCAmelCase_           =["favicon.ico"]
         self.analyze_directory(_lowerCAmelCase		,	ignore_files=_lowerCAmelCase		,	only_modules=_lowerCAmelCase							)









import warnings

from ...utils import logging
from .image_processing_clip import CLIPImageProcessor


SCREAMING_SNAKE_CASE__   			=   logging.get_logger(__name__)


class   __lowerCAmelCase  (		UpperCAmelCase_   ):
					"""simple docstring"""






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






								"""simple docstring"""


								warnings.warn(
								    'The class CLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please'
								    ' use CLIPImageProcessor instead.'					,       _snake_case					,       )
								super().__init__(*_snake_case					,       **_snake_case       )




