code: def copy_heroku_to_local(id):
      
      heroku_app = HerokuApp(dallinger_uid=id)
      try:
          subprocess.call(["dropdb", heroku_app.name])
      except Exception:
          pass
  
      heroku_app.pg_pull()
docs: Copy a Heroku database locally.