


from itertools import zip_longest

import requests
from bsa import BeautifulSoup
from pandas import DataFrame






def 							_lowercase    (		SCREAMING_SNAKE_CASE_   :		str = "laptop"	):





			"""simple docstring"""




			UpperCamelCase         =					f'https://www.amazon.in/laptop/s?k={product}'
			UpperCamelCase         =					{
			    """User-Agent""": """Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
        (KHTML, like Gecko)Chrome/44.0.2403.157 Safari/537.36""",
			    """Accept-Language""": """en-US, en;q=0.5""",
			}
			UpperCamelCase         =					BeautifulSoup(requests.get(SCREAMING_SNAKE_CASE_       ,  headers=SCREAMING_SNAKE_CASE_	).text	)
			# Initialize a Pandas dataframe with the column titles
			UpperCamelCase         =					DataFrame(
			    columns=[
			        """Product Title""",
			        """Product Link""",
			        """Current Price of the product""",
			        """Product Rating""",
			        """MRP of the product""",
			        """Discount""",
			    ]	)
			# Loop through each entry and store them in the dataframe
			for item, _ in zip_longest(
			    soup.find_all(
			        """div"""       ,  attrs={"""class""": """s-result-item""", """data-component-type""": """s-search-result"""}       ,  )       ,  soup.find_all("""div"""       ,  attrs={"""class""": """a-row a-size-base a-color-base"""}	)       ,  ):
						try:
									UpperCamelCase         =					item.ha.text
									UpperCamelCase         =					"""https://www.amazon.in/""" + item.ha.a["""href"""]
									UpperCamelCase         =					item.find("""span"""       ,  attrs={"""class""": """a-offscreen"""}	).text
									try:
												UpperCamelCase         =					item.find("""span"""       ,  attrs={"""class""": """a-icon-alt"""}	).text
									except AttributeError:
												UpperCamelCase         =					"""Not available"""
									try:
												UpperCamelCase         =					(
												    """₹"""
												    + item.find(
												        """span"""       ,  attrs={"""class""": """a-price a-text-price"""}	).text.split("""₹"""	)[1]
												)
									except AttributeError:
												UpperCamelCase         =					""""""
									try:
												UpperCamelCase         =					float(
												    (
												        (
												            float(product_mrp.strip("""₹"""	).replace(""","""       ,  """"""	)	)
												            - float(product_price.strip("""₹"""	).replace(""","""       ,  """"""	)	)
												        )
												        / float(product_mrp.strip("""₹"""	).replace(""","""       ,  """"""	)	)
												    )
												    * 100	)
									except ValueError:
												UpperCamelCase         =					float("""nan"""	)
						except AttributeError:
									pass
						UpperCamelCase         =					[
						    product_title,
						    product_link,
						    product_price,
						    product_rating,
						    product_mrp,
						    discount,
						]
			UpperCamelCase         =					""" """
			UpperCamelCase         =					""" """
			data_frame.index += 1
			return data_frame


if __name__ == "__main__":
			__snake_case            =   "headphones"
			get_amazon_product_data(product).to_csv(F'''Amazon Product Data for {product}.csv''')








import qiskit






def 							_lowercase    (		SCREAMING_SNAKE_CASE_   :		int = 2	):





			"""simple docstring"""




			UpperCamelCase         =					qubits

			# Using Aer's simulator
			UpperCamelCase         =					qiskit.Aer.get_backend("""aer_simulator"""	)

			# Creating a Quantum Circuit acting on the q register
			UpperCamelCase         =					qiskit.QuantumCircuit(SCREAMING_SNAKE_CASE_       ,  SCREAMING_SNAKE_CASE_	)

			# Adding a H gate on qubit 0 (now q0 in superposition)
			circuit.h(0	)

			for i in range(1       ,  SCREAMING_SNAKE_CASE_	):
						# Adding CX (CNOT) gate
						circuit.cx(i - 1       ,  SCREAMING_SNAKE_CASE_	)

			# Mapping the quantum measurement to the classical bits
			circuit.measure(list(range(SCREAMING_SNAKE_CASE_	)	)       ,  list(range(SCREAMING_SNAKE_CASE_	)	)	)

			# Now measuring any one qubit would affect other qubits to collapse
			# their super position and have same state as the measured one.

			# Executing the circuit on the simulator
			UpperCamelCase         =					qiskit.execute(SCREAMING_SNAKE_CASE_       ,  SCREAMING_SNAKE_CASE_       ,  shots=1_000	)

			return job.result().get_counts(SCREAMING_SNAKE_CASE_	)


if __name__ == "__main__":
			print(F'''Total count for various states are: {quantum_entanglement(3)}''')




