'''simple docstring'''
from PIL import Image



def 			__lowerCamelCase							(   _UpperCamelCase	:	Image       ):


      '''simple docstring'''


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

      for j in range(_A       ):
            for i in range(_A       ):
                  UpperCAmelCase_      =	255 if pixels[i, j] > mean else 0
      return image


if __name__ == "__main__":
      lowercase__	:   List[Any]										=       mean_threshold(Image.open("path_to_image").convert("L"))
      image.save("output_image_path")









import requests
from bsa import BeautifulSoup
def 							UpperCamelCase_(					_A :str = "AAPL"	)->		str:
			UpperCamelCase__       =							F'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}'''
			UpperCamelCase__       =							BeautifulSoup(requests.get(_A	).text					,  "html.parser"	)
			UpperCamelCase__       =							"My(6px) Pos(r) smartphone_Mt(6px)"
			return soup.find("div"					,  class_=class_	).find("span"	).text


if __name__ == "__main__":
						for symbol in "AAPL AMZN IBM GOOG MSFT ORCL".split():
												print(f'''Current {symbol:<4} stock price is {stock_price(symbol):>8}''')


