def _url_from_target(self, target):
        if isinstance(target, Connectable):
            return target.engine.url
        elif isinstance(target, six.string_types):
            if "://" not in target:
                target_url = sa_url.make_url("%s://" % target)
            else:
                target_url = sa_url.make_url(target)
            return target_url
        elif isinstance(target, sa_url.URL):
            return target
        else:
            raise ValueError("Invalid target type: %r" % target)
dataset/ETHPy150Open openstack/oslo.db/oslo_db/sqlalchemy/utils.py/DialectFunctionDispatcher._url_from_target/original