def get(self, state, dict_, passive=PASSIVE_OFF):
        """Retrieve a value from the given object.
        If a callable is assembled on this object's attribute, and
        passive is False, the callable will be executed and the
        resulting value will be set as the new value for this attribute.
        """
        if self.key in dict_:
            return dict_[self.key]
        else:
            # if history present, don't load
            key = self.key
            if key not in state.committed_state or \
                    state.committed_state[key] is NEVER_SET:
                if not passive & CALLABLES_OK:
                    return PASSIVE_NO_RESULT

                if key in state.callables:
                    callable_ = state.callables[key]
                    value = callable_(state, passive)
                elif self.callable_:
                    value = self.callable_(state, passive)
                else:
                    value = ATTR_EMPTY

                if value is PASSIVE_NO_RESULT or value is NEVER_SET:
                    return value
                elif value is ATTR_WAS_SET:
                    try:
                        return dict_[key]
                    except __HOLE__:
                        # TODO: no test coverage here.
                        raise KeyError(
                            "Deferred loader for attribute "
                            "%r failed to populate "
                            "correctly" % key)
                elif value is not ATTR_EMPTY:
                    return self.set_committed_value(state, dict_, value)

            if not passive & INIT_OK:
                return NEVER_SET
            else:
                # Return a new, empty value
                return self.initialize(state, dict_)
dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/orm/attributes.py/AttributeImpl.get