


class 				_UpperCamelCase			:

   '''simple docstring'''







   def __init__(	self	:			Any							,	_lowerCamelCase	:			list				):






         '''simple docstring'''



         __lowerCamelCase  :   List[str]							    =    set_counts
         __lowerCamelCase  :   List[Any]							    =    max(_lowerCamelCase				)
         __lowerCamelCase  :   str							    =    len(_lowerCamelCase				)
         __lowerCamelCase  :   Dict							    =    [1] * num_sets
         __lowerCamelCase  :   int							    =    list(range(_lowerCamelCase				)				)

   def 	_snake_case     (	self	:			Tuple							,	_lowerCamelCase	:			int							,	_lowerCamelCase	:			int				):






         '''simple docstring'''



         __lowerCamelCase  :   List[str]							    =    self.get_parent(_lowerCamelCase				)
         __lowerCamelCase  :   Union[str, Any]							    =    self.get_parent(_lowerCamelCase				)

         if src_parent == dst_parent:
               return False

         if self.ranks[dst_parent] >= self.ranks[src_parent]:
               self.set_counts[dst_parent] += self.set_counts[src_parent]
               __lowerCamelCase  :   Union[str, Any]							    =    0
               __lowerCamelCase  :   int							    =    dst_parent
               if self.ranks[dst_parent] == self.ranks[src_parent]:
                     self.ranks[dst_parent] += 1
               __lowerCamelCase  :   str							    =    self.set_counts[dst_parent]
         else:
               self.set_counts[src_parent] += self.set_counts[dst_parent]
               __lowerCamelCase  :   Dict							    =    0
               __lowerCamelCase  :   Tuple							    =    src_parent
               __lowerCamelCase  :   List[Any]							    =    self.set_counts[src_parent]

         __lowerCamelCase  :   List[str]							    =    max(self.max_set							,	_lowerCamelCase				)
         return True


   def 	_snake_case     (	self	:			Optional[int]							,	_lowerCamelCase	:			int				):






         '''simple docstring'''



         if self.parents[disj_set] == disj_set:
               return disj_set
         __lowerCamelCase  :   Dict							    =    self.get_parent(self.parents[disj_set]				)
         return self.parents[disj_set]







from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


SCREAMING_SNAKE_CASE__     					=			{
    "configuration_owlvit": [
        "OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "OwlViTConfig",
        "OwlViTOnnxConfig",
        "OwlViTTextConfig",
        "OwlViTVisionConfig",
    ],
    "processing_owlvit": ["OwlViTProcessor"],
}


try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		SCREAMING_SNAKE_CASE__     					=			["OwlViTFeatureExtractor"]
		SCREAMING_SNAKE_CASE__     					=			["OwlViTImageProcessor"]

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		SCREAMING_SNAKE_CASE__     					=			[
		    "OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "OwlViTModel",
		    "OwlViTPreTrainedModel",
		    "OwlViTTextModel",
		    "OwlViTVisionModel",
		    "OwlViTForObjectDetection",
		]

if TYPE_CHECKING:
		from .configuration_owlvit import (
		    OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    OwlViTConfig,
		    OwlViTOnnxConfig,
		    OwlViTTextConfig,
		    OwlViTVisionConfig,
		)
		from .processing_owlvit import OwlViTProcessor

		try:
				if not is_vision_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_owlvit import OwlViTFeatureExtractor
				from .image_processing_owlvit import OwlViTImageProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_owlvit import (
				    OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    OwlViTForObjectDetection,
				    OwlViTModel,
				    OwlViTPreTrainedModel,
				    OwlViTTextModel,
				    OwlViTVisionModel,
				)

else:
		import sys

		SCREAMING_SNAKE_CASE__     					=			_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






