code: 
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  
  
  
  from typing import List
  
  import datasets
  from datasets.tasks import ImageClassification
  
  from ..folder_based_builder import folder_based_builder
  
  
  _a      :				Dict											=					datasets.utils.logging.get_logger(__name__)
  
  
  
  
  
  class 					_UpperCAmelCase							(		folder_based_builder.FolderBasedBuilderConfig     ):
  		a     :     List[str]     						=None
  		a     :     Any     						=None
  
  
  
  
  
  class 					_UpperCAmelCase							(		folder_based_builder.FolderBasedBuilder     ):
  		a     :     Dict     						=datasets.Image()
  		a     :     List[Any]     						="""image"""
  		a     :     str     						=ImageFolderConfig
  		a     :     Union[str, Any]     						=42  # definition at the bottom of the script
  		a     :     int     						=ImageClassification(image_column="""image"""			,      label_column="""label"""     )
  
  
  
  
  
  _a      :				List[Any]											=					[
      """.blp""",
      """.bmp""",
      """.dib""",
      """.bufr""",
      """.cur""",
      """.pcx""",
      """.dcx""",
      """.dds""",
      """.ps""",
      """.eps""",
      """.fit""",
      """.fits""",
      """.fli""",
      """.flc""",
      """.ftc""",
      """.ftu""",
      """.gbr""",
      """.gif""",
      """.grib""",
      """.h5""",
      """.hdf""",
      """.png""",
      """.apng""",
      """.jp2""",
      """.j2k""",
      """.jpc""",
      """.jpf""",
      """.jpx""",
      """.j2c""",
      """.icns""",
      """.ico""",
      """.im""",
      """.iim""",
      """.tif""",
      """.tiff""",
      """.jfif""",
      """.jpe""",
      """.jpg""",
      """.jpeg""",
      """.mpg""",
      """.mpeg""",
      """.msp""",
      """.pcd""",
      """.pxr""",
      """.pbm""",
      """.pgm""",
      """.ppm""",
      """.pnm""",
      """.psd""",
      """.bw""",
      """.rgb""",
      """.rgba""",
      """.sgi""",
      """.ras""",
      """.tga""",
      """.icb""",
      """.vda""",
      """.vst""",
      """.webp""",
      """.wmf""",
      """.emf""",
      """.xbm""",
      """.xpm""",
  ]
  _a      :				Optional[Any]											=					IMAGE_EXTENSIONS
style_context: 
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  
  
  
  from cva import destroyAllWindows, imread, imshow, waitKey
  
  
  
  
  
  def      _lowerCAmelCase		(		lowercase      ,			lowercase			)      ->      int:
  			__lowerCAmelCase		, __lowerCAmelCase      		=       img.shape[0], img.shape[1]
  
  			def to_grayscale(lowercase      ,			lowercase      ,			lowercase			):
  						return 0.21_26 * red + 0.5_87 * green + 0.1_14 * blue
  
  			def normalize(lowercase			):
  						return min(lowercase      ,			255			)
  
  			for i in range(lowercase			):
  						for j in range(lowercase			):
  									__lowerCAmelCase      		=       int(to_grayscale(*img[i][j]			)			)
  									__lowerCAmelCase      		=       [
  									    normalize(lowercase			),
  									    normalize(greyscale + factor			),
  									    normalize(greyscale + 2 * factor			),
  									]
  
  			return img
  
  
  if __name__ == "__main__":
  	# read original image
  	_a      :				Any											=					{
  	    percentage: imread("""image_data/lena.jpg""", 1) for percentage in (1_0, 2_0, 3_0, 4_0)
  	}
  
  	for percentage, img in images.items():
  		make_sepia(img, percentage)
  
  	for percentage, img in images.items():
  		imshow(f'Original image with sepia (factor: {percentage})', img)
  
  	waitKey(0)
  	destroyAllWindows()
  
  