




import unittest

from transformers.testing_utils import require_bsa
from transformers.utils import is_bsa_available

from ...test_feature_extraction_common import FeatureExtractionSavingTestMixin


if is_bsa_available():
     from transformers import MarkupLMFeatureExtractor

class     __a(	unittest.TestCase  ):






    """simple docstring"""





    def __init__( self  ,_SCREAMING_SNAKE_CASE    )					->						List[Any]:
         UpperCAmelCase_     :				Optional[Any]  =     parent





    def 				a__ ( self    )					->						List[str]:
         return {}







def lowerCamelCase__  (     ):

     '''simple docstring'''


     UpperCAmelCase_     :				int  =     '''<HTML>

    <HEAD>
    <TITLE>sample document</TITLE>
    </HEAD>

    <BODY BGCOLOR="FFFFFF">
    <HR>
    <a href="http://google.com">Goog</a>
    <H1>This is one header</H1>
    <H2>This is a another Header</H2>
    <P>Travel from
        <P>
        <B>SFO to JFK</B>
        <BR>
        <B><I>on May 2, 2015 at 2:00 pm. For details go to confirm.com </I></B>
        <HR>
        <div style="color:#0000FF">
            <h3>Traveler <b> name </b> is
            <p> John Doe </p>
        </div>'''

     UpperCAmelCase_     :				List[str]  =     '''
    <!DOCTYPE html>
    <html>
    <body>

    <h1>My First Heading</h1>
    <p>My first paragraph.</p>

    </body>
    </html>
    '''

     return [html_string_a, html_string_a]



@require_bsa
class     __a(	_a							,		unittest.TestCase  ):






    """simple docstring"""





    lowerCAmelCase         = MarkupLMFeatureExtractor if is_bsa_available() else None





    def 				a__ ( self    )					->						Tuple:
         UpperCAmelCase_     :				Optional[int]  =     MarkupLMFeatureExtractionTester(self    )





    @property
    def 				a__ ( self    )					->						Optional[Any]:
         return self.feature_extract_tester.prepare_feat_extract_dict()





    def 				a__ ( self    )					->						int:
         # Initialize feature_extractor
         UpperCAmelCase_     :				Dict  =     self.feature_extraction_class()

         # Test not batched input
         UpperCAmelCase_     :				Union[str, Any]  =     get_html_strings()[0]
         UpperCAmelCase_     :				Optional[Any]  =     feature_extractor(_SCREAMING_SNAKE_CASE    )

         # fmt: off
         UpperCAmelCase_     :				List[Any]  =     [['''sample document''', '''Goog''', '''This is one header''', '''This is a another Header''', '''Travel from''', '''SFO to JFK''', '''on May 2, 2015 at 2:00 pm. For details go to confirm.com''', '''Traveler''', '''name''', '''is''', '''John Doe''']]
         UpperCAmelCase_     :				Any  =     [['''/html/head/title''', '''/html/body/a''', '''/html/body/h1''', '''/html/body/h2''', '''/html/body/p''', '''/html/body/p/p/b[1]''', '''/html/body/p/p/b[2]/i''', '''/html/body/p/p/div/h3''', '''/html/body/p/p/div/h3/b''', '''/html/body/p/p/div/h3''', '''/html/body/p/p/div/h3/p''']]
         # fmt: on

         self.assertEqual(encoding.nodes  ,_SCREAMING_SNAKE_CASE    )
         self.assertEqual(encoding.xpaths  ,_SCREAMING_SNAKE_CASE    )

         # Test batched
         UpperCAmelCase_     :				str  =     get_html_strings()
         UpperCAmelCase_     :				Tuple  =     feature_extractor(_SCREAMING_SNAKE_CASE    )

         # fmt: off
         UpperCAmelCase_     :				str  =     expected_nodes + [['''My First Heading''', '''My first paragraph.''']]
         UpperCAmelCase_     :				str  =     expected_xpaths + [['''/html/body/h1''', '''/html/body/p''']]

         self.assertEqual(len(encoding.nodes    )  ,2    )
         self.assertEqual(len(encoding.xpaths    )  ,2    )

         self.assertEqual(encoding.nodes  ,_SCREAMING_SNAKE_CASE    )
         self.assertEqual(encoding.xpaths  ,_SCREAMING_SNAKE_CASE    )





from decimal import Decimal, getcontext
from math import ceil, factorial







def lowerCamelCase__  (     _lowercase ):

     '''simple docstring'''


     if not isinstance(_lowercase					,		_lowercase ):
          raise TypeError('''Undefined for non-integers''' )
     elif precision < 1:
          raise ValueError('''Undefined for non-natural numbers''' )

     UpperCAmelCase_     :				Tuple  =     precision
     UpperCAmelCase_     :				Optional[Any]  =     ceil(precision / 14 )
     UpperCAmelCase_     :				int  =     426880 * Decimal(10005 ).sqrt()
     UpperCAmelCase_     :				Tuple  =     1
     UpperCAmelCase_     :				List[Any]  =     13591409
     UpperCAmelCase_     :				Optional[Any]  =     Decimal(_lowercase )
     for k in range(1					,		_lowercase ):
          UpperCAmelCase_     :				List[str]  =     factorial(6 * k ) // (factorial(3 * k ) * factorial(_lowercase ) ** 3)
          linear_term += 545140134
          exponential_term *= -262537412640768000
          partial_sum += Decimal(multinomial_term * linear_term ) / exponential_term
     return str(constant_term / partial_sum )[:-1]


if __name__ == "__main__":
     __a							     =					50
     print(F"""The first {n} digits of pi is: {pi(n)}""")