files.new_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  ======================
  eHST Astroquery Module
  ======================
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  """
  from urllib.parse import urlencode
  
  from astropy import units
  from astropy.coordinates import SkyCoord
  from astropy.coordinates import Angle
  
  from astroquery.utils.tap import TapPlus
  from astroquery.query import BaseQuery
  import json
  import warnings
  from astropy.utils.exceptions import AstropyDeprecationWarning
  from astropy.utils.decorators import deprecated
  
  from . import conf
  from astroquery import log
  
  __all__ = ['ESAHubble', 'ESAHubbleClass']
  
  
  class ESAHubbleClass(BaseQuery):
      """
      Class to init ESA Hubble Module and communicate with eHST TAP
      """
      TIMEOUT = conf.TIMEOUT
      calibration_levels = {"AUXILIARY": 0, "RAW": 1, "CALIBRATED": 2,
                            "PRODUCT": 3}
      product_types = ["SCIENCE", "PREVIEW", "THUMBNAIL"
  
  [... the rest is omitted ...]
files.new_path: astroquery/esa/hubble/core.py
files.old_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  ======================
  eHST Astroquery Module
  ======================
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  """
  
  from astropy import units
  from astropy.coordinates import SkyCoord
  from astropy.coordinates import Angle
  
  from astroquery.utils.tap import TapPlus
  from astroquery.query import BaseQuery
  import json
  import warnings
  from astropy.utils.exceptions import AstropyDeprecationWarning
  from astropy.utils.decorators import deprecated
  
  from . import conf
  from astroquery import log
  
  __all__ = ['ESAHubble', 'ESAHubbleClass']
  
  
  class ESAHubbleClass(BaseQuery):
      """
      Class to init ESA Hubble Module and communicate with eHST TAP
      """
      TIMEOUT = conf.TIMEOUT
      calibration_levels = {"AUXILIARY": 0, "RAW": 1, "CALIBRATED": 2,
                            "PRODUCT": 3}
      product_types = ["SCIENCE", "PREVIEW", "THUMBNAIL" or "AUXILIARY"]
     
  
  [... the rest is omitted ...]
files.old_path: astroquery/esa/hubble/core.py
files.new_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =======================
  eJWST Astroquery Module
  =======================
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  """
  
  import binascii
  import gzip
  import os
  import shutil
  import tarfile
  import zipfile
  from datetime import datetime
  from urllib.parse import urlencode
  
  from astropy import log
  from astropy import units
  from astropy.coordinates import SkyCoord
  from astropy.table import vstack
  from astropy.units import Quantity
  from requests.exceptions import ConnectionError
  
  from astroquery.exceptions import RemoteServiceError
  from astroquery.ipac.ned import Ned
  from astroquery.query import BaseQuery
  from astroquery.simbad import Simbad
  from astroquery.utils import commons
  from astroquery.utils.tap import TapPlus
  from astroquery.vizier import Vizier
  from . import conf
  from .data_access import JwstDataHandler
  
  
  __all__ = ['Jwst', 'JwstClass']
  
  
  class JwstClass(BaseQuery):
  
      """
      Proxy class to default Tap
  
  [... the rest is omitted ...]
files.new_path: astroquery/esa/jwst/core.py
files.old_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =======================
  eJWST Astroquery Module
  =======================
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  """
  
  import binascii
  import gzip
  import os
  import shutil
  import tarfile
  import zipfile
  from datetime import datetime
  
  from astropy import log
  from astropy import units
  from astropy.coordinates import SkyCoord
  from astropy.table import vstack
  from astropy.units import Quantity
  from requests.exceptions import ConnectionError
  
  from astroquery.exceptions import RemoteServiceError
  from astroquery.ipac.ned import Ned
  from astroquery.query import BaseQuery
  from astroquery.simbad import Simbad
  from astroquery.utils import commons
  from astroquery.utils.tap import TapPlus
  from astroquery.vizier import Vizier
  from . import conf
  from .data_access import JwstDataHandler
  
  
  __all__ = ['Jwst', 'JwstClass']
  
  
  class JwstClass(BaseQuery):
  
      """
      Proxy class to default TapPlus object (pointing to JWST
  
  [... the rest is omitted ...]
files.old_path: astroquery/esa/jwst/core.py
files.new_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =============
  Gaia TAP plus
  =============
  
  @author: Juan Carlos Segovia
  @contact: juan.carlos.segovia@sciops.esa.int
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  Created on 30 jun. 2016
  
  
  """
  CONTENT_TYPE_POST_DEFAULT = "application/x-www-form-urlencoded"
  
  
  class DummyTapHandler:
  
      def __init__(self):
          self.__invokedMethod = None
          self.__parameters = {}
  
      def reset(self):
          self.__parameters = {}
          self.__invokedMethod = None
  
      def check_call(self, method_name, parameters):
          self.check_method(method_name)
          self.check_parameters(parameters, method_name)
  
      def execute_upload(self, data,
                         content_type=CONTENT_TYPE_POST_DEFAULT,
                         verbose=False):
          pass
  
      def check_method(self, method):
          if method == self.__invokedMethod:
              return
          else:
              raise Exception(f"Method '{method}' not invoked. (Invoked method is "
                              f"{self.__inv
  
  [... the rest is omitted ...]
files.new_path: astroquery/gaia/tests/DummyTapHandler.py
files.old_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =============
  Gaia TAP plus
  =============
  
  @author: Juan Carlos Segovia
  @contact: juan.carlos.segovia@sciops.esa.int
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  Created on 30 jun. 2016
  
  
  """
  from urllib.parse import urlencode
  
  CONTENT_TYPE_POST_DEFAULT = "application/x-www-form-urlencoded"
  
  
  class DummyTapHandler:
  
      def __init__(self):
          self.__invokedMethod = None
          self.__parameters = {}
  
      def reset(self):
          self.__parameters = {}
          self.__invokedMethod = None
  
      def check_call(self, method_name, parameters):
          self.check_method(method_name)
          self.check_parameters(parameters, method_name)
  
      def execute_upload(self, data,
                         content_type=CONTENT_TYPE_POST_DEFAULT,
                         verbose=False):
          pass
  
      def check_method(self, method):
          if method == self.__invokedMethod:
              return
          else:
              raise Exception(f"Method '{method}' not invoked. (Invoked method
  
  [... the rest is omitted ...]
files.old_path: astroquery/gaia/tests/DummyTapHandler.py
files.new_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =============
  TAP plus
  =============
  
  @author: Juan Carlos Segovia
  @contact: juan.carlos.segovia@sciops.esa.int
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  Created on 30 jun. 2016
  
  
  """
  
  try:
      # python 3
      import http.client as httplib
  except ImportError:
      # python 2
      import httplib
  import mimetypes
  import time
  
  from astroquery.utils.tap.xmlparser import utils
  from astroquery.utils.tap import taputils
  from astroquery import version
  
  import requests
  
  __all__ = ['TapConn']
  
  CONTENT_TYPE_POST_DEFAULT = "application/x-www-form-urlencoded"
  
  
  class TapConn:
      """TAP plus connection class
      Provides low level HTTP connection capabilities
      """
  
      def __init__(self, ishttps,
                   host,
                   server_context=None,
                   port=80,
                   sslport=443,
                   connhandler=None,
                   tap_context=None,
                   upload_context=None,
                   table_edit_context=None
  
  [... the rest is omitted ...]
files.new_path: astroquery/utils/tap/conn/tapconn.py
files.old_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =============
  TAP plus
  =============
  
  @author: Juan Carlos Segovia
  @contact: juan.carlos.segovia@sciops.esa.int
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  Created on 30 jun. 2016
  
  
  """
  
  try:
      # python 3
      import http.client as httplib
  except ImportError:
      # python 2
      import httplib
  import mimetypes
  import time
  
  from urllib.parse import urlencode
  
  from astroquery.utils.tap.xmlparser import utils
  from astroquery.utils.tap import taputils
  from astroquery import version
  
  import requests
  
  __all__ = ['TapConn']
  
  CONTENT_TYPE_POST_DEFAULT = "application/x-www-form-urlencoded"
  
  
  class TapConn:
      """TAP plus connection class
      Provides low level HTTP connection capabilities
      """
  
      def __init__(self, ishttps,
                   host,
                   server_context=None,
                   port=80,
                   sslport=443,
                   connhandler=None,
                   tap_context=None,
                   upload_context
  
  [... the rest is omitted ...]
files.old_path: astroquery/utils/tap/conn/tapconn.py
files.new_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =============
  TAP plus
  =============
  
  @author: Juan Carlos Segovia
  @contact: juan.carlos.segovia@sciops.esa.int
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  Created on 30 jun. 2016
  
  
  """
  from astroquery.utils.tap import taputils
  
  import requests
  
  
  class DummyConnHandler:
  
      def __init__(self):
          self.request = None
          self.data = None
          self.fileExt = ".ext"
          self.defaultResponse = None
          self.responses = {}
          self.errorFileOutput = None
          self.errorReceivedResponse = None
          self.contentType = None
          self.verbose = None
          self.query = None
          self.fileOutput = None
  
      def set_default_response(self, defaultResponse):
          self.defaultResponse = defaultResponse
  
      def get_default_response(self):
          return self.defaultResponse
  
      def get_last_request(self):
          return self.request
  
      def get_last_data(self):
          return self.data
  
      def get_last_query(self):
          return self.query
  
     
  
  [... the rest is omitted ...]
files.new_path: astroquery/utils/tap/conn/tests/DummyConnHandler.py
files.old_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =============
  TAP plus
  =============
  
  @author: Juan Carlos Segovia
  @contact: juan.carlos.segovia@sciops.esa.int
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  Created on 30 jun. 2016
  
  
  """
  from astroquery.utils.tap import taputils
  
  from urllib.parse import urlencode
  
  import requests
  
  
  class DummyConnHandler:
  
      def __init__(self):
          self.request = None
          self.data = None
          self.fileExt = ".ext"
          self.defaultResponse = None
          self.responses = {}
          self.errorFileOutput = None
          self.errorReceivedResponse = None
          self.contentType = None
          self.verbose = None
          self.query = None
          self.fileOutput = None
  
      def set_default_response(self, defaultResponse):
          self.defaultResponse = defaultResponse
  
      def get_default_response(self):
          return self.defaultResponse
  
      def get_last_request(self):
          return self.request
  
      def get_last_data(self):
          return self.data
  
      def get_last_query
  
  [... the rest is omitted ...]
files.old_path: astroquery/utils/tap/conn/tests/DummyConnHandler.py
files.new_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =============
  TAP plus
  =============
  
  @author: Juan Carlos Segovia
  @contact: juan.carlos.segovia@sciops.esa.int
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  Created on 30 jun. 2016
  Modified on 1 jun. 2021 by mhsarmiento
  """
  from urllib.parse import urlencode
  
  from astroquery.utils.tap import taputils
  from astroquery.utils.tap.conn.tapconn import TapConn
  from astroquery.utils.tap.xmlparser.tableSaxParser import TableSaxParser
  from astroquery.utils.tap.model.job import Job
  from astroquery.utils.tap.gui.login import LoginDialog
  from astroquery.utils.tap.xmlparser.jobSaxParser import JobSaxParser
  from astroquery.utils.tap.xmlparser.jobListSaxParser import JobListSaxParser
  from astroquery.utils.tap.xmlparser.groupSaxParser import GroupSaxParser
  from astroquery.utils.tap.xmlparser.sharedItemsSaxParser
  
  [... the rest is omitted ...]
files.new_path: astroquery/utils/tap/core.py
files.old_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =============
  TAP plus
  =============
  
  @author: Juan Carlos Segovia
  @contact: juan.carlos.segovia@sciops.esa.int
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  Created on 30 jun. 2016
  Modified on 1 jun. 2021 by mhsarmiento
  """
  from astroquery.utils.tap import taputils
  from astroquery.utils.tap.conn.tapconn import TapConn
  from astroquery.utils.tap.xmlparser.tableSaxParser import TableSaxParser
  from astroquery.utils.tap.model.job import Job
  from astroquery.utils.tap.gui.login import LoginDialog
  from astroquery.utils.tap.xmlparser.jobSaxParser import JobSaxParser
  from astroquery.utils.tap.xmlparser.jobListSaxParser import JobListSaxParser
  from astroquery.utils.tap.xmlparser.groupSaxParser import GroupSaxParser
  from astroquery.utils.tap.xmlparser.sharedItemsSaxParser import SharedItemsSaxParser  #
  
  [... the rest is omitted ...]
files.old_path: astroquery/utils/tap/core.py
files.new_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =============
  TAP plus
  =============
  
  @author: Juan Carlos Segovia
  @contact: juan.carlos.segovia@sciops.esa.int
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  Created on 30 jun. 2016
  
  
  """
  
  import time
  from urllib.parse import urlencode
  
  from astroquery.utils.tap.model import modelutils
  from astroquery.utils.tap.xmlparser import utils
  from astroquery.utils.tap import taputils
  from astropy.logger import log
  import requests
  
  
  __all__ = ['Job']
  
  
  class Job:
      """Job class
      """
  
      def __init__(self, async_job, query=None, connhandler=None):
          """Constructor
  
          Parameters
          ----------
          async_job : bool, mandatory
              'True' if the job is asynchronous
          query : str, optional, default None
              Query
          connhandler : TapConn, optional, default None
              Connection handler
          """
          # async is a reserved keyword starting python 3.7
          self.async
  
  [... the rest is omitted ...]
files.new_path: astroquery/utils/tap/model/job.py
files.old_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =============
  TAP plus
  =============
  
  @author: Juan Carlos Segovia
  @contact: juan.carlos.segovia@sciops.esa.int
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  Created on 30 jun. 2016
  
  
  """
  
  import time
  
  from astroquery.utils.tap.model import modelutils
  from astroquery.utils.tap.xmlparser import utils
  from astroquery.utils.tap import taputils
  from astropy.logger import log
  import requests
  
  
  __all__ = ['Job']
  
  
  class Job:
      """Job class
      """
  
      def __init__(self, async_job, query=None, connhandler=None):
          """Constructor
  
          Parameters
          ----------
          async_job : bool, mandatory
              'True' if the job is asynchronous
          query : str, optional, default None
              Query
          connhandler : TapConn, optional, default None
              Connection handler
          """
          # async is a reserved keyword starting python 3.7
          self.async_ = async_job
          self
  
  [... the rest is omitted ...]
files.old_path: astroquery/utils/tap/model/job.py
files.new_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =============
  TAP plus
  =============
  
  @author: Juan Carlos Segovia
  @contact: juan.carlos.segovia@sciops.esa.int
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  Created on 30 jun. 2016
  """
  import os
  from unittest.mock import patch
  from urllib.parse import quote_plus, urlencode
  
  import numpy as np
  import pytest
  from requests import HTTPError
  
  from astroquery.utils.tap.model.tapcolumn import TapColumn
  
  from astroquery.utils.tap.conn.tests.DummyConnHandler import DummyConnHandler
  from astroquery.utils.tap.conn.tests.DummyResponse import DummyResponse
  from astroquery.utils.tap.core import TapPlus
  from astroquery.utils.tap.xmlparser import utils
  from astroquery.utils.tap import taputils
  
  
  def data_path(filename):
      data_dir = os.path.join(os.path.dirname(__file__), 'data')
      return os.path.join(data_dir, filename)
  
  
  def test_load_tables():
      connHandler = DummyConn
  
  [... the rest is omitted ...]
files.new_path: astroquery/utils/tap/tests/test_tap.py
files.old_contents: # Licensed under a 3-clause BSD style license - see LICENSE.rst
  """
  =============
  TAP plus
  =============
  
  @author: Juan Carlos Segovia
  @contact: juan.carlos.segovia@sciops.esa.int
  
  European Space Astronomy Centre (ESAC)
  European Space Agency (ESA)
  
  Created on 30 jun. 2016
  """
  import os
  from unittest.mock import patch
  
  import numpy as np
  import pytest
  from requests import HTTPError
  
  from astroquery.utils.tap.model.tapcolumn import TapColumn
  
  from astroquery.utils.tap.conn.tests.DummyConnHandler import DummyConnHandler
  from astroquery.utils.tap.conn.tests.DummyResponse import DummyResponse
  from astroquery.utils.tap.core import TapPlus
  from astroquery.utils.tap.xmlparser import utils
  from astroquery.utils.tap import taputils
  
  
  def data_path(filename):
      data_dir = os.path.join(os.path.dirname(__file__), 'data')
      return os.path.join(data_dir, filename)
  
  
  def test_load_tables():
      connHandler = DummyConnHandler()
      tap = TapPlus("http://test:
  
  [... the rest is omitted ...]
files.old_path: astroquery/utils/tap/tests/test_tap.py