code: def export(self):
          
          export_job = ExportJob(self.client, self.get_id())
          export_job.run()
  
          export_job.refresh()
  
          count = 0
          while export_job.state in ("exporting", "enqueued", "pending"):
              if count >= MAX_NUMBER_OF_RETRIES:
                  raise CartoException(_("Maximum number of retries exceeded \
                                         when polling the import API for \
                                         visualization export"))
              time.sleep(INTERVAL_BETWEEN_RETRIES_S)
              export_job.refresh()
              count += 1
  
          if export_job.state == "failure":
              raise CartoException(_("Visualization export failed"))
  
          if (export_job.state != "complete" and export_job.state != "created"):
              raise CartoException(_("Unexpected problem on visualization export \
                                     (state: {state})").
                                   format(state=export_job.state))
  
          return export_job.url
docs: Make the actual request to the Import API (exporting is part of the
          Import API) to export a map visualization as a .carto file
  
          :return: A URL pointing to the .carto file
          :rtype: str
  
          :raise: CartoException
  
          .. warning:: Non-public API. It may change with no previous notice
  
          .. note:: The export is asynchronous, but this method waits for the export to complete. See `MAX_NUMBER_OF_RETRIES` and `INTERVAL_BETWEEN_RETRIES_S`