






"""simple docstring"""


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowercase_				     =     {
    'configuration_pegasus_x': ['PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP', 'PegasusXConfig'],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowercase_				     =     [
           'PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST',
           'PegasusXForConditionalGeneration',
           'PegasusXModel',
           'PegasusXPreTrainedModel',
       ]


if TYPE_CHECKING:
       from .configuration_pegasus_x import PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusXConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_pegasus_x import (
                  PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST,
                  PegasusXForConditionalGeneration,
                  PegasusXModel,
                  PegasusXPreTrainedModel,
              )


else:
       import sys

       lowercase_				     =     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)












"""simple docstring"""


class 					snake_case		:


   '''simple docstring'''

   def __init__(	self :     List[str],       _lowerCamelCase :     list[int]  ):

     '''simple docstring'''
     __A									= len(_lowerCamelCase  )
     __A									= [0] * len_array

     if len_array > 0:
       __A									= array[0]

     for i in range(1,       _lowerCamelCase  ):
       __A									= self.prefix_sum[i - 1] + array[i]


   def 				_SCREAMING_SNAKE_CASE				(	self :     List[Any],       _lowerCamelCase :     int,       _lowerCamelCase :     int  ):

     '''simple docstring'''
     if start == 0:
       return self.prefix_sum[end]

     return self.prefix_sum[end] - self.prefix_sum[start - 1]






   def 				_SCREAMING_SNAKE_CASE				(	self :     List[str],       _lowerCamelCase :     int  ):

     '''simple docstring'''
     __A									= {0}
     for sum_item in self.prefix_sum:
       if sum_item - target_sum in sums:
         return True

       sums.add(_lowerCamelCase  )

     return False


if __name__ == "__main__":
       import doctest

       doctest.testmod()




