






"""simple docstring"""



from datetime import datetime

import requests
from bsa import BeautifulSoup

if __name__ == "__main__":
 SCREAMING_SNAKE_CASE_					:	Union[str, Any]							  =						input('Enter image url: ').strip()
 print(f"""Downloading image from {url} ...""")
 SCREAMING_SNAKE_CASE_					:	int							  =						BeautifulSoup(requests.get(url).content, 'html.parser')
 # The image URL is in the content field of the first meta tag with property og:image
 SCREAMING_SNAKE_CASE_					:	Optional[int]							  =						soup.find('meta', {'property': 'og:image'})['content']
 SCREAMING_SNAKE_CASE_					:	Optional[Any]							  =						requests.get(image_url).content
 SCREAMING_SNAKE_CASE_					:	Union[str, Any]							  =						f"""{datetime.now():%Y-%m-%d_%H:%M:%S}.jpg"""
 with open(file_name, 'wb') as fp:
  fp.write(image_data)
 print(f"""Done. Image saved to disk as {file_name}.""")









"""simple docstring"""



from collections.abc import Callable





def  _snake_case     (    UpperCAmelCase_  :					Callable[[float], float]					,   UpperCAmelCase_  :					float					,   UpperCAmelCase_  :					float			):
     A__										=  a
     A__										=  b
     if function(UpperCAmelCase_			) == 0:  # one of the a or b is a root for the function
          return a
     elif function(UpperCAmelCase_			) == 0:
          return b
     elif (
         function(UpperCAmelCase_			) * function(UpperCAmelCase_			) > 0
     ):  # if none of these are root and they are both positive or negative,
          # then this algorithm can't find the root
          raise ValueError("""could not find root in given interval."""			)
     else:
          A__										=  start + (end - start) / 2.0
          while abs(start - mid			) > 10**-7:  # until precisely equals to 10^-7
               if function(UpperCAmelCase_			) == 0:
                    return mid
               elif function(UpperCAmelCase_			) * function(UpperCAmelCase_			) < 0:
                    A__										=  mid
               else:
                    A__										=  mid
               A__										=  start + (end - start) / 2.0
          return mid





def  _snake_case     (    UpperCAmelCase_  :					float			):
     return x**3 - 2 * x - 5


if __name__ == "__main__":
 print(bisection(f, 1, 1_0_0_0))

 import doctest

 doctest.testmod()






