





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     UpperCamelCase__					(     unittest.TestCase				):






		'''simple docstring'''






		def __init__(							self,   snake_case__  )       -> Tuple:






									"""simple docstring"""
									lowercase_	:   List[Any]  				=     parent






		def 						snake_case__				(							self  )       -> Optional[int]:






									"""simple docstring"""
									return {}





def  __magic_name__  (				)				-> Dict:

							"""simple docstring"""



							lowercase_	:   List[Any]  				=     """<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>"""

							lowercase_	:   Any  				=     """
    <!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     UpperCamelCase__					(     lowerCamelCase__				, unittest.TestCase				):






		'''simple docstring'''






		__a       :       Optional[Any]       =	MarkupLMFeatureExtractor if is_bsa_available() else None






		def 						snake_case__				(							self  )       -> List[str]:






									"""simple docstring"""
									lowercase_	:   Any  				=     MarkupLMFeatureExtractionTester(self  )






		@property
		def 						snake_case__				(							self  )       -> List[Any]:






									"""simple docstring"""
									return self.feature_extract_tester.prepare_feat_extract_dict()






		def 						snake_case__				(							self  )       -> List[Any]:






									"""simple docstring"""
									# Initialize feature_extractor
									lowercase_	:   int  				=     self.feature_extraction_class()

									# Test not batched input
									lowercase_	:   Union[str, Any]  				=     get_html_strings()[0]
									lowercase_	:   Tuple  				=     feature_extractor(snake_case__  )

									# fmt: off
									lowercase_	:   str  				=     [["""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"""]]
									lowercase_	:   List[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,   snake_case__  )
									self.assertEqual(encoding.xpaths,   snake_case__  )

									# Test batched
									lowercase_	:   Tuple  				=     get_html_strings()
									lowercase_	:   List[str]  				=     feature_extractor(snake_case__  )

									# fmt: off
									lowercase_	:   int  				=     expected_nodes + [["""My First Heading""", """My first paragraph."""]]
									lowercase_	:   Dict  				=     expected_xpaths + [["""/html/body/h1""", """/html/body/p"""]]

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

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






def  __magic_name__  (				lowercase				)				-> list:

							"""simple docstring"""



							if n_term == "":
														return []
							lowercase_	:   list  				=     []
							for temp in range(int(lowercase				)				):
														series.append(f"""1/{temp + 1}""" if series else """1"""				)
							return series


if __name__ == "__main__":
							UpperCAmelCase_							=				input("""Enter the last number (nth term) of the Harmonic Series""")
							print("""Formula of Harmonic Series => 1+1/2+1/3 ..... 1/n""")
							print(harmonic_series(nth_term))