






'''simple docstring'''

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




class     A    :






 """simple docstring"""





 def __init__(							self			,     __lowerCAmelCase			,     __lowerCAmelCase			,     __lowerCAmelCase ):
       if dst_width < 0 or dst_height < 0:
             raise ValueError("""Destination width/height should be > 0""" )

       UpperCamelCase_				:   Optional[int]					    =							img
       UpperCamelCase_				:   Optional[Any]					    =							img.shape[1]
       UpperCamelCase_				:   Tuple					    =							img.shape[0]
       UpperCamelCase_				:   Dict					    =							dst_width
       UpperCamelCase_				:   Tuple					    =							dst_height

       UpperCamelCase_				:   Union[str, Any]					    =							self.src_w / self.dst_w
       UpperCamelCase_				:   str					    =							self.src_h / self.dst_h

       UpperCamelCase_				:   Optional[Any]					    =							(
           np.ones((self.dst_h, self.dst_w, 3)			,     np.uinta ) * 2_55
       )
 def   _UpperCAmelCase       (							self ):
       for i in range(self.dst_h ):
             for j in range(self.dst_w ):
                   UpperCamelCase_				:   Union[str, Any]					    =							self.img[self.get_y(__lowerCAmelCase )][self.get_x(__lowerCAmelCase )]
 def   _UpperCAmelCase       (							self			,     __lowerCAmelCase ):
       return int(self.ratio_x * x )





 def   _UpperCAmelCase       (							self			,     __lowerCAmelCase ):
       return int(self.ratio_y * y )


if __name__ == "__main__":
      UpperCamelCase				,		UpperCamelCase							=800, 600
      UpperCamelCase							=imread("image_data/lena.jpg", 1)
      UpperCamelCase							=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()














'''simple docstring'''

import pytest

import datasets


# Import fixture modules as plugins
UpperCamelCase							=["tests.fixtures.files", "tests.fixtures.hub", "tests.fixtures.fsspec"]



def 							snake_case					(     a_							: List[str]    ,   a_							: Optional[Any]	)       ->				Union[str, Any]:





      """simple docstring"""

      for item in items:
            if any(marker in item.keywords for marker in ["""integration""", """unit"""]	):
                  continue
            item.add_marker(pytest.mark.unit	)



def 							snake_case					(     a_							: Optional[int]	)       ->				Optional[Any]:





      """simple docstring"""

      config.addinivalue_line("""markers"""    ,   """torchaudio_latest: mark test to run with torchaudio>=0.12"""	)



@pytest.fixture(autouse=a_	)
def 							snake_case					(     a_							: Any    ,   a_							: Optional[int]	)       ->				Tuple:





      """simple docstring"""

      UpperCamelCase_				:   Optional[Any]					    =							tmp_path_factory.getbasetemp() / """cache"""
      UpperCamelCase_				:   str					    =							test_hf_cache_home / """datasets"""
      UpperCamelCase_				:   Any					    =							test_hf_cache_home / """metrics"""
      UpperCamelCase_				:   List[Any]					    =							test_hf_cache_home / """modules"""
      monkeypatch.setattr("""datasets.config.HF_DATASETS_CACHE"""    ,   str(a_	)	)
      monkeypatch.setattr("""datasets.config.HF_METRICS_CACHE"""    ,   str(a_	)	)
      monkeypatch.setattr("""datasets.config.HF_MODULES_CACHE"""    ,   str(a_	)	)
      UpperCamelCase_				:   List[Any]					    =							test_hf_datasets_cache / """downloads"""
      monkeypatch.setattr("""datasets.config.DOWNLOADED_DATASETS_PATH"""    ,   str(a_	)	)
      UpperCamelCase_				:   Any					    =							test_hf_datasets_cache / """downloads""" / """extracted"""
      monkeypatch.setattr("""datasets.config.EXTRACTED_DATASETS_PATH"""    ,   str(a_	)	)



@pytest.fixture(autouse=a_    ,   scope="""session"""	)
def 							snake_case					(     )       ->				Any:





      """simple docstring"""

      datasets.disable_progress_bar()



@pytest.fixture(autouse=a_	)
def 							snake_case					(     a_							: Optional[int]	)       ->				Union[str, Any]:





      """simple docstring"""

      monkeypatch.setattr("""datasets.config.HF_UPDATE_DOWNLOAD_COUNTS"""    ,   a_	)



@pytest.fixture
def 							snake_case					(     a_							: int	)       ->				Union[str, Any]:





      """simple docstring"""

      monkeypatch.setattr("""sqlalchemy.util.deprecations.SILENCE_UBER_WARNING"""    ,   a_	)






