input: Write a python function to check if a website's response time exceeds a threshold and send an email alert.
  assert check_website_response()=='Email sent successfully' or check_website_response()=='Website response time is within threshold'
  assert check_website_response(WEBSITE_URL, THRESHOLD_TIME) in ['Email sent successfully', 'Website response time is within threshold']
  assert check_website_response('http://www.google.com', 10) in ['Email sent successfully', 'Website response time is within threshold']
output: import smtplib
  import requests
  from email.mime.text import MIMEText
  
  def check_website_response(url='http://www.google.com', threshold_time=10):
      try:
          response = requests.get(url)
          response_time = response.elapsed.total_seconds()
          
          if response_time > threshold_time:
              send_email_alert(url, response_time)
              return 'Email sent successfully'
          else:
              return 'Website response time is within threshold'
      except requests.RequestException as e:
          return f'Error: {e}'
  
  def send_email_alert(url, response_time):
      from_email = 'youremail@example.com'
      to_email = 'alert@example.com'
      subject = 'Website Response Time Alert'
      body = f'The website {url} took {response_time} seconds to respond, exceeding the threshold.'
  
      msg = MIMEText(body)
      msg['Subject'] = subject
      msg['From'] = from_email
      msg['To'] = to_email
  
      with smtplib.SMTP('smtp.example.com', 587) as server:
          server.starttls()
          server.login('yourusername', 'yourpassword')
          server.sendmail(from_email, to_email, msg.as_string())