def METHOD_NAME(self, connection):
    """Returns a dictionary."""
    # If we can't store it directly on the cursor, as happens for
    # types implemented in C, we use a weakkey dictionary.
    # pylint:disable=protected-access
    try:
        session_prep_stmts = connection._rs_prepared_statements
    except AttributeError:
        try:
            session_prep_stmts = connection._rs_prepared_statements = {}
        except AttributeError:
            session_prep_stmts = self._connection_cache.get(connection)
            if session_prep_stmts is None:
                session_prep_stmts = self._connection_cache[connection] = {}
    return session_prep_stmts