





# Algorithm for the pigeonhole sorting






def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	)       ->     int:
  lowercase__			    =						min(_SCREAMING_SNAKE_CASE	)  # min() finds the minimum value
  lowercase__			    =						max(_SCREAMING_SNAKE_CASE	)  # max() finds the maximum value

  lowercase__			    =						max_val - min_val + 1  # size is difference of max and min values plus one

  # list of pigeonholes of size equal to the variable size
  lowercase__			    =						[0] * size

  # Populate the pigeonholes.
  for x in a:
    assert isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	), "integers only please"
    holes[x - min_val] += 1

  # Putting the elements back into the array in an order.
  lowercase__			    =						0
  for count in range(_SCREAMING_SNAKE_CASE	):
    while holes[count] > 0:
      holes[count] -= 1
      lowercase__			    =						count + min_val
      i += 1




def     __UpperCamelCase						()       ->     str:
  lowercase__			    =						[8, 3, 2, 7, 4, 6, 8]
  pigeonhole_sort(_SCREAMING_SNAKE_CASE	)
  print('Sorted order is:'	,		' '.join(_SCREAMING_SNAKE_CASE	)	)


if __name__ == "__main__":
      main()









from PIL import Image




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)       ->     Image:

  def brightness(_SCREAMING_SNAKE_CASE	) -> float:
    return 128 + level + (c - 128)

  if not -2_5_5.0 <= level <= 2_5_5.0:
    raise ValueError('level must be between -255.0 (black) and 255.0 (white)'	)
  return img.point(_SCREAMING_SNAKE_CASE	)


if __name__ == "__main__":
      # Load image
      with Image.open("""image_data/lena.jpg""") as img:
            # Change brightness to 100
            lowercase_					     =	change_brightness(img, 100)
            brigt_img.save("""image_data/lena_brightness.png""", format="""png""")


