

'''simple docstring'''
from __future__ import annotations

from collections.abc import Callable


def  a__       (    _SCREAMING_SNAKE_CASE   :       Callable[[int | float], int | float]	,				_SCREAMING_SNAKE_CASE   :       int | float	,				_SCREAMING_SNAKE_CASE   :       int | float	,				_SCREAMING_SNAKE_CASE   :       int = 1_00	,				)     ->					float:


	"""simple docstring"""





	UpperCAmelCase_     :      Optional[int]						=  x_start
	UpperCAmelCase_     :      Optional[Any]						=  fnc(_SCREAMING_SNAKE_CASE				)
	UpperCAmelCase_     :      List[Any]						=  0.0
	for _ in range(_SCREAMING_SNAKE_CASE				):
		# Approximates small segments of curve as linear and solve
		# for trapezoidal area
		UpperCAmelCase_     :      int						=  (x_end - x_start) / steps + xa
		UpperCAmelCase_     :      str						=  fnc(_SCREAMING_SNAKE_CASE				)
		area += abs(fxa + fxa				) * (xa - xa) / 2
		# Increment step
		UpperCAmelCase_     :      Any						=  xa
		UpperCAmelCase_     :      List[Any]						=  fxa
	return area


if __name__ == "__main__":


					def  a__       (    _SCREAMING_SNAKE_CASE   :       Any				)     ->					int:


						"""simple docstring"""





						return x**3 + x**2

					print("""f(x) = x^3 + x^2""")
					print("""The area between the curve, x = -5, x = 5 and the x axis is:""")
					_lowerCamelCase      					=     10
					while i <= 10_0000:
										print(f"""with {i} steps: {trapezoidal_area(f, -5, 5, i)}""")
										i *= 10












"""simple docstring"""
from datetime import datetime

import requests
from bsa import BeautifulSoup

if __name__ == "__main__":
			lowerCAmelCase__    						=			input('Enter image url: ').strip()
			print(F'Downloading image from {url} ...')
			lowerCAmelCase__    						=			BeautifulSoup(requests.get(url).content, 'html.parser')
			# The image URL is in the content field of the first meta tag with property og:image
			lowerCAmelCase__    						=			soup.find('meta', {'property': 'og:image'})['content']
			lowerCAmelCase__    						=			requests.get(image_url).content
			lowerCAmelCase__    						=			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}.')

