



'''simple docstring'''






import logging
import os

from .state import PartialState

class 							a__(      logging.LoggerAdapter			):







    @staticmethod
    def     lowercase_ (   __snake_case				:						List[str]			):
      a		:      Tuple       =  PartialState()
      return not main_process_only or (main_process_only and state.is_main_process)







    def     lowercase_ (   self				:						int		,    __snake_case				:						str		,    __snake_case				:						Tuple		,    *__snake_case				:						Optional[int]		,    **__snake_case				:						List[Any]			):
      if PartialState._shared_state == {}:
        raise RuntimeError(
            'You must initialize the accelerate state by calling either `PartialState()` or `Accelerator()` before using the logging utility.'			)
      a		:      int       =  kwargs.pop('main_process_only'		,    __snake_case			)
      a		:      Tuple       =  kwargs.pop('in_order'		,    __snake_case			)

      if self.isEnabledFor(__snake_case			):
        if self._should_log(__snake_case			):
          a     ,			a		:      int       =  self.process(__snake_case		,    __snake_case			)
          self.logger.log(__snake_case		,    __snake_case		,    *__snake_case		,    **__snake_case			)

        elif in_order:
          a		:      List[Any]       =  PartialState()
          for i in range(state.num_processes			):
            if i == state.process_index:
              a     ,			a		:      Tuple       =  self.process(__snake_case		,    __snake_case			)
              self.logger.log(__snake_case		,    __snake_case		,    *__snake_case		,    **__snake_case			)
            state.wait_for_everyone()
def    lowerCamelCase__ (		_A				,    _A = None       ):
  if log_level is None:
    a		:      Any       =  os.environ.get('ACCELERATE_LOG_LEVEL'				,    _A       )
  a		:      Optional[Any]       =  logging.getLogger(_A       )
  if log_level is not None:
    logger.setLevel(log_level.upper()       )
    logger.root.setLevel(log_level.upper()       )
  return MultiProcessAdapter(_A				,    {}       )




'''simple docstring'''






import warnings

from ...utils import logging
from .image_processing_chinese_clip import ChineseCLIPImageProcessor


lowerCAmelCase:      Optional[Any]		 =		logging.get_logger(__name__)

class 							a__(      lowerCamelCase__			):







    def __init__(   self				:						Union[str, Any]		,    *__snake_case				:						List[str]		,    **__snake_case				:						Union[str, Any]			):
      warnings.warn(
          'The class ChineseCLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers.'
          ' Please use ChineseCLIPImageProcessor instead.'		,    __snake_case		,    )
      super().__init__(*__snake_case		,    **__snake_case			)