


"""simple docstring"""





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


UpperCamelCase_	:				List[Any]										= {
    """configuration_bridgetower""": [
        """BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """BridgeTowerConfig""",
        """BridgeTowerTextConfig""",
        """BridgeTowerVisionConfig""",
    ],
    """processing_bridgetower""": ["""BridgeTowerProcessor"""],
}

try:
    if not is_vision_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    UpperCamelCase_	:				Optional[int]										= ["""BridgeTowerImageProcessor"""]

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    UpperCamelCase_	:				Tuple										= [
        """BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST""",
        """BridgeTowerForContrastiveLearning""",
        """BridgeTowerForImageAndTextRetrieval""",
        """BridgeTowerForMaskedLM""",
        """BridgeTowerModel""",
        """BridgeTowerPreTrainedModel""",
    ]


if TYPE_CHECKING:
    from .configuration_bridgetower import (
        BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP,
        BridgeTowerConfig,
        BridgeTowerTextConfig,
        BridgeTowerVisionConfig,
    )
    from .processing_bridgetower import BridgeTowerProcessor

    try:
        if not is_vision_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .image_processing_bridgetower import BridgeTowerImageProcessor

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_bridgetower import (
            BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST,
            BridgeTowerForContrastiveLearning,
            BridgeTowerForImageAndTextRetrieval,
            BridgeTowerForMaskedLM,
            BridgeTowerModel,
            BridgeTowerPreTrainedModel,
        )


else:
    import sys

    UpperCamelCase_	:				List[Any]										= _LazyModule(__name__, globals()["""__file__"""], _import_structure)










"""simple docstring"""





from __future__ import annotations



def     __lowercase					(    a :				int       ,		a :				int )					->					list[str]:
      if partitions <= 0:
            raise ValueError('''partitions must be a positive number!''' )
      if partitions > number_of_bytes:
            raise ValueError('''partitions can not > number_of_bytes!''' )
      __snake_case      :    List[str]  			=number_of_bytes // partitions
      __snake_case      :    str  			=[]
      for i in range(a ):
            __snake_case      :    Optional[Any]  			=i * bytes_per_partition + 1
            __snake_case      :    Any  			=(
                number_of_bytes if i == partitions - 1 else (i + 1) * bytes_per_partition
            )
            allocation_list.append(f'''{start_bytes}-{end_bytes}''' )
      return allocation_list


if __name__ == "__main__":
    import doctest

    doctest.testmod()


