





import numpy as np
from cva import destroyAllWindows, imread, imshow, waitKey







class   __lowerCAmelCase			:





   def __init__( self					,			snake_case					,			snake_case					,			snake_case      )				->  str:
      """simple docstring"""





      if dst_width < 0 or dst_height < 0:
         raise ValueError("Destination width/height should be > 0"      )

      a__	:						int      		=  img
      a__	:						Optional[Any]      		=  img.shape[1]
      a__	:						Tuple      		=  img.shape[0]
      a__	:						Tuple      		=  dst_width
      a__	:						List[Any]      		=  dst_height

      a__	:						Optional[int]      		=  self.src_w / self.dst_w
      a__	:						Union[str, Any]      		=  self.src_h / self.dst_h

      a__	:						List[Any]      		=  (
          np.ones((self.dst_h, self.dst_w, 3)					,			np.uinta      ) * 255
      )





   def 	_snake_case ( self      )				->  Dict:
      """simple docstring"""





      for i in range(self.dst_h      ):
         for j in range(self.dst_w      ):
            a__	:						Tuple      		=  self.img[self.get_y(snake_case      )][self.get_x(snake_case      )]





   def 	_snake_case ( self					,			snake_case      )				->  Optional[Any]:
      """simple docstring"""





      return int(self.ratio_x * x      )





   def 	_snake_case ( self					,			snake_case      )				->  int:
      """simple docstring"""





      return int(self.ratio_y * y      )


if __name__ == "__main__":
  SCREAMING_SNAKE_CASE__      ,     SCREAMING_SNAKE_CASE__       :			Optional[Any]			      =						8_0_0, 6_0_0
  SCREAMING_SNAKE_CASE__       :			Optional[int]			      =						imread("""image_data/lena.jpg""", 1)
  SCREAMING_SNAKE_CASE__       :			Dict			      =						NearestNeighbour(im, dst_w, dst_h)
  n.process()

  imshow(
      f'Image resized from: {im.shape[1]}x{im.shape[0]} to {dst_w}x{dst_h}', n.output
  )
  waitKey(0)
  destroyAllWindows()










from typing import TYPE_CHECKING

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


SCREAMING_SNAKE_CASE__       :			str			      =						{
    """configuration_distilbert""": [
        """DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """DistilBertConfig""",
        """DistilBertOnnxConfig""",
    ],
    """tokenization_distilbert""": ["""DistilBertTokenizer"""],
}

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  SCREAMING_SNAKE_CASE__       :			Optional[int]			      =						["""DistilBertTokenizerFast"""]

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  SCREAMING_SNAKE_CASE__       :			Tuple			      =						[
      """DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """DistilBertForMaskedLM""",
      """DistilBertForMultipleChoice""",
      """DistilBertForQuestionAnswering""",
      """DistilBertForSequenceClassification""",
      """DistilBertForTokenClassification""",
      """DistilBertModel""",
      """DistilBertPreTrainedModel""",
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  SCREAMING_SNAKE_CASE__       :			List[Any]			      =						[
      """TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """TFDistilBertForMaskedLM""",
      """TFDistilBertForMultipleChoice""",
      """TFDistilBertForQuestionAnswering""",
      """TFDistilBertForSequenceClassification""",
      """TFDistilBertForTokenClassification""",
      """TFDistilBertMainLayer""",
      """TFDistilBertModel""",
      """TFDistilBertPreTrainedModel""",
  ]

try:
  if not is_flax_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  SCREAMING_SNAKE_CASE__       :			Any			      =						[
      """FlaxDistilBertForMaskedLM""",
      """FlaxDistilBertForMultipleChoice""",
      """FlaxDistilBertForQuestionAnswering""",
      """FlaxDistilBertForSequenceClassification""",
      """FlaxDistilBertForTokenClassification""",
      """FlaxDistilBertModel""",
      """FlaxDistilBertPreTrainedModel""",
  ]


if TYPE_CHECKING:
  from .configuration_distilbert import (
      DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
      DistilBertConfig,
      DistilBertOnnxConfig,
  )
  from .tokenization_distilbert import DistilBertTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_distilbert_fast import DistilBertTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_distilbert import (
        DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        DistilBertForMaskedLM,
        DistilBertForMultipleChoice,
        DistilBertForQuestionAnswering,
        DistilBertForSequenceClassification,
        DistilBertForTokenClassification,
        DistilBertModel,
        DistilBertPreTrainedModel,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_distilbert import (
        TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFDistilBertForMaskedLM,
        TFDistilBertForMultipleChoice,
        TFDistilBertForQuestionAnswering,
        TFDistilBertForSequenceClassification,
        TFDistilBertForTokenClassification,
        TFDistilBertMainLayer,
        TFDistilBertModel,
        TFDistilBertPreTrainedModel,
    )

  try:
    if not is_flax_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_flax_distilbert import (
        FlaxDistilBertForMaskedLM,
        FlaxDistilBertForMultipleChoice,
        FlaxDistilBertForQuestionAnswering,
        FlaxDistilBertForSequenceClassification,
        FlaxDistilBertForTokenClassification,
        FlaxDistilBertModel,
        FlaxDistilBertPreTrainedModel,
    )

else:
  import sys

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

