

'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


lowercase__            =     {"configuration_vilt": ["VILT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViltConfig"]}

try:
 if not is_vision_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowercase__            =     ["ViltFeatureExtractor"]
 lowercase__            =     ["ViltImageProcessor"]
 lowercase__            =     ["ViltProcessor"]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowercase__            =     [
     "VILT_PRETRAINED_MODEL_ARCHIVE_LIST",
     "ViltForImageAndTextRetrieval",
     "ViltForImagesAndTextClassification",
     "ViltForTokenClassification",
     "ViltForMaskedLM",
     "ViltForQuestionAnswering",
     "ViltLayer",
     "ViltModel",
     "ViltPreTrainedModel",
 ]


if TYPE_CHECKING:
 from .configuration_vilt import VILT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViltConfig

 try:
  if not is_vision_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .feature_extraction_vilt import ViltFeatureExtractor
  from .image_processing_vilt import ViltImageProcessor
  from .processing_vilt import ViltProcessor

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_vilt import (
      VILT_PRETRAINED_MODEL_ARCHIVE_LIST,
      ViltForImageAndTextRetrieval,
      ViltForImagesAndTextClassification,
      ViltForMaskedLM,
      ViltForQuestionAnswering,
      ViltForTokenClassification,
      ViltLayer,
      ViltModel,
      ViltPreTrainedModel,
  )


else:
 import sys

 lowercase__            =     _LazyModule(__name__, globals()["__file__"], _import_structure)







'''simple docstring'''

from __future__ import annotations

from collections.abc import Callable




def  UpperCamelCase(	UpperCAmelCase_    ,			UpperCAmelCase_    ,			UpperCAmelCase_    ,			UpperCAmelCase_ = 1_00    ,			):
 UpperCAmelCase			:      Any		   =					x_start
 UpperCAmelCase			:      int		   =					fnc(UpperCAmelCase_      )
 UpperCAmelCase			:      str		   =					0.0

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

  # Increment step
  UpperCAmelCase			:      List[str]		   =					xa
  UpperCAmelCase			:      List[Any]		   =					fxa
 return area


if __name__ == "__main__":




 def  UpperCamelCase(	UpperCAmelCase_      ):
  return x**3

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




