@classmethod
def factory(cls, paramstyle, case_insensitive=False):
    """
        return a Binder subclass instance appropriate
        to the underlying db library paramstyle bind variable

        :param paramstyle: parameter style string as per PEP-249
        :case_insensitive: %(custid)s will match {"custid":1} or {"CUSTID":2}, with priority
        going to the initial case.  mixed-case keys (custId) will only match {"custId":3}

        """
    try:
        inst = cls._di_paramstyle[paramstyle]()
        if case_insensitive:
            inst._key_expand = inst._case_insensitive
        return inst
    except KeyError:
        msg = (
            """got:%s,
                  but expecting one of %s.
                  See
                  https://www.python.org/dev/peps/pep-0249/#paramstyle
                  for details"""
             % (paramstyle, '/'.join(list(cls._di_paramstyle.keys()))))
        raise ValueError(msg)
    except NotImplementedError:
        msg = '%s is not implemented yet' % paramstyle
        raise NotImplementedError(msg)
