def __enter__(self): # Parse and run tasklet frame = inspect.stack()[1][0] filename = inspect.getframeinfo(frame).filename tasklet_ast = tasklet_runner.get_tasklet_ast(frame=frame) tasklet_runner.run_tasklet(tasklet_ast, filename, frame.f_globals, frame.f_locals)
def __enter__(self): if self.language != dtypes.Language.Python: raise NotImplementedError( 'Cannot run non-Python tasklet in Python') # Parse and run tasklet frame = inspect.stack()[1][0] filename = inspect.getframeinfo(frame, context=0).filename tasklet_ast = tasklet_runner.get_tasklet_ast(frame=frame) tasklet_runner.run_tasklet(tasklet_ast, filename, frame.f_globals, frame.f_locals)