input: Write a python function to download a file from a URL and extract its contents.
  assert download_and_extract('https://github.com/angr/vex/archive/master.tar.gz', 'vex-master')==True
  assert os.path.exists('vex-master')==True
  assert os.path.isdir('vex-master')==True
output: def download_and_extract(url, extract_to):
      import os
      import requests
      import tarfile
      from io import BytesIO
  
      # Download the file from the URL
      response = requests.get(url)
      if response.status_code != 200:
          return False
  
      # Open the file as a tarfile
      file = BytesIO(response.content)
      with tarfile.open(fileobj=file, mode="r:gz") as tar:
          # Extract all the contents into the specified directory
          tar.extractall(path=extract_to)
  
      return True