@tornado.gen.coroutine
    def eval(self, key, evaltype=EVALTYPE_SYMBOL, locals=None):
        self.task.tick()
        if not (self.caps & EVALCAP_RUN):
            raise Exception('EvalPropContext does not have permissions to do anything!')
        
        # Initialize per-invocation fields.
        self.accum = None
        self.cooked = False
        self.textstate = RunOnNode
        self.linktargets = None
        self.dependencies = set()
        self.wasspecial = False

        # These will be filled in if and when a gentext starts.
        self.gentexting = False
        self.genseed = None
        self.gencount = None
        self.genparams = None

        # We start with no frames and a depth of zero. (When we add frames,
        # the self.frame will always be the current stack frame, which is
        # the last entry of self.frames.)
        self.frame = None
        self.frames = []

        try:
            EvalPropContext.context_stack.append(self)
            res = yield self.evalobj(key, evaltype=evaltype, locals=locals)
        finally:
            assert (self.depth == 0) and (self.frame is None), 'EvalPropContext did not pop all the way!'
            assert (EvalPropContext.context_stack[-1] is self), 'EvalPropContext.context_stack did not nest properly!'
            EvalPropContext.context_stack.pop()

        # At this point, if the value was a {text}, the accum will contain
        # the desired description.
        
        if (self.level == LEVEL_RAW):
            return res
        if (self.level == LEVEL_FLAT):
            if twcommon.misc.is_typed_dict(res, 'text'):
                res = res.get('text', '')
            return str_or_null(res)
        if (self.level == LEVEL_MESSAGE):
            if self.accum:
                # Skip all styles, links, etc. Just paste together strings.
                return ''.join([ val for val in self.accum if type(val) is str ]) + str_or_null(res)
            return str_or_null(res)
        if (self.level == LEVEL_DISPLAY):
            if self.accum:
                if not (res is None or res == ''):
                    self.accum.append(str(res))
                optimize_accum(self.accum)
                return self.accum
            return str_or_null(res)
        if (self.level == LEVEL_DISPSPECIAL):
            if self.wasspecial:
                return res
            if self.accum:
                if not (res is None or res == ''):
                    self.accum.append(str(res))
                optimize_accum(self.accum)
                return self.accum
            return str_or_null(res)
        if (self.level == LEVEL_EXECUTE):
            if self.accum:
                if not (res is None or res == ''):
                    self.accum.append(str(res))
                optimize_accum(self.accum)
                return self.accum
            return res
        raise Exception('unrecognized eval level: %d' % (self.level,))
Returns a TraitGridSelection object specifying the data stored
dataset/ETHPy150Open erkyrath/tworld/lib/two/evalctx.py/EvalPropContext.eval--crossover with--dataset/ETHPy150Open enthought/traitsui/traitsui/wx/table_model.py/TableModel.get_cell_selection_value