# Path: impala/util.py
# def _escape(s):
#     e = s
#     e = e.replace('\\', '\\\\')
#     e = e.replace('\n', '\\n')
#     e = e.replace('\r', '\\r')
#     e = e.replace("'", "\\'")
#     e = e.replace('"', '\\"')
#     log.debug('%s => %s', s, e)
#     return e
# 
# Path: impala/error.py
# class Error(Exception):
#     pass
# 
# class Warning(Exception):
#     pass
# 
# class InterfaceError(Error):
#     pass
# 
# class DatabaseError(Error):
#     pass
# 
# class InternalError(DatabaseError):
#     pass
# 
# class OperationalError(DatabaseError):
#     pass
# 
# class ProgrammingError(DatabaseError):
#     pass
# 
# class IntegrityError(DatabaseError):
#     pass
# 
# class DataError(DatabaseError):
#     pass
# 
# class NotSupportedError(DatabaseError):
#     pass


import datetime
import re
import six
from six import reraise
from impala.util import _escape
from impala.error import (  # pylint: disable=unused-import
    Error, Warning, InterfaceError, DatabaseError, InternalError,
    OperationalError, ProgrammingError, IntegrityError, DataError,
    NotSupportedError)
        from thrift_sasl import TSaslClientTransport
        raise ProgrammingError(
            "paramstyle '%s' is not compatible with parameters passed as List."
            "please use a dict for you parameters instead or specify"
            " a different paramstyle",
            paramstyle
        )

    return operation


def _bind_parameters_list(operation, parameters, paramstyle):
    string_parameters = []
    for value in parameters:
        if value is None:
            string_parameters.append('NULL')
        elif isinstance(value, six.string_types):
            string_parameters.append("'" + _escape(value) + "'")
        else:
            string_parameters.append(str(value))

    # replace qmark and numeric parameters
    return _replace_numeric_markers(operation, string_parameters, paramstyle)


def _bind_parameters_dict(operation, parameters):
    string_parameters = {}
    for (name, value) in six.iteritems(parameters):
        if value is None:
            string_parameters[name] = 'NULL'
        elif isinstance(value, six.string_types):

# Path: impala/util.py
# def _escape(s):
#     e = s
#     e = e.replace('\\', '\\\\')
#     e = e.replace('\n', '\\n')
#     e = e.replace('\r', '\\r')
#     e = e.replace("'", "\\'")
#     e = e.replace('"', '\\"')
#     log.debug('%s => %s', s, e)
#     return e
# 
# Path: impala/error.py
# class Error(Exception):
#     pass
# 
# class Warning(Exception):
#     pass
# 
# class InterfaceError(Error):
#     pass
# 
# class DatabaseError(Error):
#     pass
# 
# class InternalError(DatabaseError):
#     pass
# 
# class OperationalError(DatabaseError):
#     pass
# 
# class ProgrammingError(DatabaseError):
#     pass
# 
# class IntegrityError(DatabaseError):
#     pass
# 
# class DataError(DatabaseError):
#     pass
# 
# class NotSupportedError(DatabaseError):
#     pass


# Path: impala/interface.py
import datetime
import re
import six
from six import reraise
from impala.util import _escape
from impala.error import (  # pylint: disable=unused-import
    Error, Warning, InterfaceError, DatabaseError, InternalError,
    OperationalError, ProgrammingError, IntegrityError, DataError,
    NotSupportedError)
        from thrift_sasl import TSaslClientTransport

        raise ProgrammingError(
            "paramstyle '%s' is not compatible with parameters passed as List."
            "please use a dict for you parameters instead or specify"
            " a different paramstyle",
            paramstyle
        )

    return operation


def _bind_parameters_list(operation, parameters, paramstyle):
    string_parameters = []
    for value in parameters:
        if value is None:
            string_parameters.append('NULL')
        elif isinstance(value, six.string_types):
            string_parameters.append("'" + _escape(value) + "'")
        else:
            string_parameters.append(str(value))

    # replace qmark and numeric parameters
    return _replace_numeric_markers(operation, string_parameters, paramstyle)


def _bind_parameters_dict(operation, parameters):
    string_parameters = {}
    for (name, value) in six.iteritems(parameters):
        if value is None:
            string_parameters[name] = 'NULL'
        elif isinstance(value, six.string_types):

            string_parameters[name] = "'" + _escape(value) + "'"