





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


snake_case								=							{
    """configuration_timesformer""": ["""TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""", """TimesformerConfig"""],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      snake_case								=							[
          """TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """TimesformerModel""",
          """TimesformerForVideoClassification""",
          """TimesformerPreTrainedModel""",
      ]

if TYPE_CHECKING:
      from .configuration_timesformer import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_timesformer import (
                TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
                TimesformerForVideoClassification,
                TimesformerModel,
                TimesformerPreTrainedModel,
            )

else:
      import sys

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



class     __UpperCAmelCase							:


     """simple docstring"""


     def __init__(	self  ,       __A    ):
        __a					=  set_counts
        __a					=  max(__A    )
        __a					=  len(__A    )
        __a					=  [1] * num_sets
        __a					=  list(range(__A    )    )


     def 	snake_case_  (	self  ,       __A  ,       __A    ):
        __a					=  self.get_parent(__A    )
        __a					=  self.get_parent(__A    )

        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]
           __a					=  0
           __a					=  dst_parent
           if self.ranks[dst_parent] == self.ranks[src_parent]:
              self.ranks[dst_parent] += 1
           __a					=  self.set_counts[dst_parent]
        else:
           self.set_counts[src_parent] += self.set_counts[dst_parent]
           __a					=  0
           __a					=  src_parent
           __a					=  self.set_counts[src_parent]

        __a					=  max(self.max_set  ,       __A    )
        return True


     def 	snake_case_  (	self  ,       __A    ):
        if self.parents[disj_set] == disj_set:
           return disj_set
        __a					=  self.get_parent(self.parents[disj_set]    )
        return self.parents[disj_set]



