input: from typing import Optional
  
  def read_url(url: str) -> Optional[str]:
      """ Read the contents from a given URL and return the text if the request was successful.
      >>> read_url('http://example.com')
      'Example Domain...'
      >>> read_url('http://nonexistent.url')
      None
      """
      import requests
      r = requests.get(url)
      if r.status_code == 200:
          return r.text
      else:
          return None
output:     import requests
      r = requests.get(url)
      if r.status_code == 200:
          return r.text
      else:
          return None