'Given a cursor and ClauseParameters, call the appropriate
style of ``setinputsizes()`` on the cursor, using DB-API types
from the bind parameter\'s ``TypeEngine`` objects.
This method only called by those dialects which require it,
currently cx_oracle.'

def set_input_sizes(self, translate=None, exclude_types=None):

    if (not hasattr(self.compiled, 'bind_names')):
        return
    types = dict(((self.compiled.bind_names[bindparam], bindparam.type) for bindparam in self.compiled.bind_names))
    if self.dialect.positional:
        inputsizes = []
        for key in self.compiled.positiontup:
            typeengine = types[key]
            dbtype = typeengine.dialect_impl(self.dialect).get_dbapi_type(self.dialect.dbapi)
            if ((dbtype is not None) and ((not exclude_types) or (dbtype not in exclude_types))):
                inputsizes.append(dbtype)
        try:
            self.cursor.setinputsizes(*inputsizes)
        except Exception as e:
            self.root_connection._handle_dbapi_exception(e, None, None, None, self)
    else:
        inputsizes = {}
        for key in self.compiled.bind_names.values():
            typeengine = types[key]
            dbtype = typeengine.dialect_impl(self.dialect).get_dbapi_type(self.dialect.dbapi)
            if ((dbtype is not None) and ((not exclude_types) or (dbtype not in exclude_types))):
                if translate:
                    key = translate.get(key, key)
                if (not self.dialect.supports_unicode_binds):
                    key = self.dialect._encoder(key)[0]
                inputsizes[key] = dbtype
        try:
            self.cursor.setinputsizes(**inputsizes)
        except Exception as e:
            self.root_connection._handle_dbapi_exception(e, None, None, None, self)
