





from itertools import zip_longest

import requests
from bsa import BeautifulSoup
from pandas import DataFrame







def       A__							(   SCREAMING_SNAKE_CASE__ = "laptop")       ->   DataFrame:
  __snake_case:						Dict			  =						F'''https://www.amazon.in/laptop/s?k={product}'''
  __snake_case:						Any			  =						{
      """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""",
  }
  __snake_case:						List[Any]			  =						BeautifulSoup(requests.get(SCREAMING_SNAKE_CASE__ , headers=SCREAMING_SNAKE_CASE__).text)
  # Initialize a Pandas dataframe with the column titles
  __snake_case:						str			  =						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:
      __snake_case:						List[Any]			  =						item.ha.text
      __snake_case:						Tuple			  =						"""https://www.amazon.in/""" + item.ha.a["""href"""]
      __snake_case:						Union[str, Any]			  =						item.find("""span""" , attrs={"""class""": """a-offscreen"""}).text
      try:
        __snake_case:						Any			  =						item.find("""span""" , attrs={"""class""": """a-icon-alt"""}).text
      except AttributeError:
        __snake_case:						Any			  =						"""Not available"""
      try:
        __snake_case:						List[Any]			  =						(
            """₹"""
            + item.find(
                """span""" , attrs={"""class""": """a-price a-text-price"""}).text.split("""₹""")[1]
        )
      except AttributeError:
        __snake_case:						Union[str, Any]			  =						""""""
      try:
        __snake_case:						List[Any]			  =						float(
            (
                (
                    float(product_mrp.strip("""₹""").replace(""",""" , """"""))
                    - float(product_price.strip("""₹""").replace(""",""" , """"""))
                )
                / float(product_mrp.strip("""₹""").replace(""",""" , """"""))
            )
            * 100)
      except ValueError:
        __snake_case:						Tuple			  =						float("""nan""")
    except AttributeError:
      pass
    __snake_case:						str			  =						[
        product_title,
        product_link,
        product_price,
        product_rating,
        product_mrp,
        discount,
    ]
  __snake_case:						Optional[int]			  =						""" """
  __snake_case:						Optional[Any]			  =						""" """
  data_frame.index += 1
  return data_frame


if __name__ == "__main__":
      __UpperCAmelCase	:       Optional[Any]    	=							"headphones"
      get_amazon_product_data(product).to_csv(f'Amazon Product Data for {product}.csv')













import math

import numpy as np
import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute







def       A__							(   SCREAMING_SNAKE_CASE__ = 3)       ->   qiskit.result.counts.Counts:
  if isinstance(SCREAMING_SNAKE_CASE__ , SCREAMING_SNAKE_CASE__):
    raise TypeError("""number of qubits must be a integer.""")
  if number_of_qubits <= 0:
    raise ValueError("""number of qubits must be > 0.""")
  if math.floor(SCREAMING_SNAKE_CASE__) != number_of_qubits:
    raise ValueError("""number of qubits must be exact integer.""")
  if number_of_qubits > 10:
    raise ValueError("""number of qubits too large to simulate(>10).""")

  __snake_case:						int			  =						QuantumRegister(SCREAMING_SNAKE_CASE__ , """qr""")
  __snake_case:						List[str]			  =						ClassicalRegister(SCREAMING_SNAKE_CASE__ , """cr""")

  __snake_case:						Optional[Any]			  =						QuantumCircuit(SCREAMING_SNAKE_CASE__ , SCREAMING_SNAKE_CASE__)

  __snake_case:						Tuple			  =						number_of_qubits

  for i in range(SCREAMING_SNAKE_CASE__):
    quantum_circuit.h(number_of_qubits - i - 1)
    counter -= 1
    for j in range(SCREAMING_SNAKE_CASE__):
      quantum_circuit.cp(np.pi / 2 ** (counter - j) , SCREAMING_SNAKE_CASE__ , SCREAMING_SNAKE_CASE__)

  for k in range(number_of_qubits // 2):
    quantum_circuit.swap(SCREAMING_SNAKE_CASE__ , number_of_qubits - k - 1)

  # measure all the qubits
  quantum_circuit.measure(SCREAMING_SNAKE_CASE__ , SCREAMING_SNAKE_CASE__)
  # simulate with 10000 shots
  __snake_case:						Union[str, Any]			  =						Aer.get_backend("""qasm_simulator""")
  __snake_case:						Optional[Any]			  =						execute(SCREAMING_SNAKE_CASE__ , SCREAMING_SNAKE_CASE__ , shots=1_0000)

  return job.result().get_counts(SCREAMING_SNAKE_CASE__)


if __name__ == "__main__":
      print(
          f'Total count for quantum fourier transform state is: \
    {quantum_fourier_transform(3)}'
      )






