

def 						lowerCamelCase__      ( __A    :float	,__A    :float	,__A    :float	,__A    :float	,__A    :float	,):


       """simple docstring"""




       __snake_case       	=							[redshift, radiation_density, matter_density, dark_energy]
       if any(p < 0 for p in parameters		):
              raise ValueError("""All input parameters must be positive"""		)

       if any(p > 1 for p in parameters[1:4]		):
              raise ValueError("""Relative densities cannot be greater than one"""		)
       else:
              __snake_case       	=							1 - (matter_density + radiation_density + dark_energy)

              __snake_case       	=							(
                  radiation_density * (redshift + 1) ** 4
                  + matter_density * (redshift + 1) ** 3
                  + curvature * (redshift + 1) ** 2
                  + dark_energy
              )

              __snake_case       	=							hubble_constant * e_a ** (1 / 2)
              return hubble


if __name__ == "__main__":
    import doctest

    # run doctest
    doctest.testmod()

    # demo LCDM approximation
    UpperCamelCase__		 =     0.3

    print(
        hubble_parameter(
            hubble_constant=68.3,
            radiation_density=1E-4,
            matter_density=matter_density,
            dark_energy=1 - matter_density,
            redshift=0,
        )
    )




from PIL import Image







def 						lowerCamelCase__      ( __A    :Image		):


       """simple docstring"""




       __snake_case	,    __snake_case       	=							image.size
       __snake_case       	=							0
       __snake_case       	=							image.load()
       for i in range(__A		):
              for j in range(__A		):
                     __snake_case       	=							pixels[j, i]
                     mean += pixel
       mean //= width * height

       for j in range(__A		):
              for i in range(__A		):
                     __snake_case       	=							2_5_5 if pixels[i, j] > mean else 0
       return image


if __name__ == "__main__":
    UpperCamelCase__		 =     mean_threshold(Image.open('''path_to_image''').convert('''L'''))
    image.save('''output_image_path''')

