Set a value in a task context stack
170798
def stack_push(self, key, value):
        
        task = Task.current_task()
        try:
            context = task._context_stack
        except AttributeError:
            task._context_stack = context = {}
        if key not in context:
            context[key] = []
        context[key].append(value)
844153
def _set_tasks_state(self, value):
        
        if value not in states.state_numbers.keys():
            raise ValueError(obj=self._uid,
                             attribute='set_tasks_state',
                             expected_value=states.state_numbers.keys(),
                             actual_value=value)

        for task in self._tasks:
            task.state = value
1252006
private void submit(final ActiveContext context) {
    try {
      LOG.log(Level.INFO, "Send task to context: {0}", new Object[]{context});
      if (JobDriver.this.handlerManager.getActiveContextHandler() == 0) {
        throw new RuntimeException("Active Context Handler not initialized by CLR.");
      }
      final ActiveContextBridge activeContextBridge = activeContextBridgeFactory.getActiveContextBridge(context);
      NativeInterop.clrSystemActiveContextHandlerOnNext(JobDriver.this.handlerManager.getActiveContextHandler(),
          activeContextBridge, JobDriver.this.interopLogger);
    } catch (final Exception ex) {
      LOG.log(Level.SEVERE, "Fail to submit task to active context");
      context.close();
      throw new RuntimeException(ex);
    }
  }
891285
public static void pre(OpcodeStack stack, int opcode) {
        if (sawGOTO) {
            return;
        }
        sawGOTO = (opcode == Const.GOTO) || (opcode == Const.GOTO_W);
        if (sawGOTO) {
            int depth = stack.getStackDepth();
            if (depth > 0) {
                userValues.clear();
                for (int i = 0; i < depth; i++) {
                    OpcodeStack.Item item = stack.getStackItem(i);
                    userValues.add(item.getUserValue());
                }
            }
        }
    }
774721
function(){
      var value = this.get();
      var cursor = this;

      while (cursor = cursor.handler)
        cursor.fn.call(cursor.context, value);
    }
804157
def set_execution_context(self, execution_context):
        """"""
        if self._execution_context:
            raise errors.AlreadyInContextError

        self._execution_context = execution_context
1333298
def ensure_context(**vars):
    
    ctx = _context_stack.top
    stacked = False
    if not ctx:
        ctx = Context()
        stacked = True
        _context_stack.push(ctx)
    ctx.update(vars)
    try:
        yield ctx
    finally:
        if stacked:
            _context_stack.pop()
1139069
function(getterSetter, context, eventName) {
		this._set = context ? getterSetter.bind(context) : getterSetter;
		this._get = context ? getterSetter.bind(context) : getterSetter;
		this._canObserve = eventName === false ? false : true;
		// The helper provides the on and off methods that use `getValueAndBind`.
		var handlers = setupComputeHandlers(this, getterSetter, context || this);

		assign(this, handlers);
	}
892545
function(context, descriptor, args, stack) {
		var data = stack.shift(),
			templ = args[1],
			failTempl = args[2];
		if (data.ok)
			secondPass(templ, context, descriptor, stack);
		else if (failTempl)
			secondPass(failTempl, context, descriptor, stack);
	}
951926
public void setItem(String itemName, Object value) {
        if (value == null) {
            setItem(itemName, (String) null);
        } else {
            @SuppressWarnings("unchecked")
            ISerializer<Object> contextSerializer = (ISerializer<Object>) ContextSerializerRegistry.getInstance()
                    .get(value.getClass());

            if (contextSerializer == null) {
                throw new ContextException("No serializer found for type " + value.getClass().getName());
            }

            setItem(itemName, contextSerializer.serialize(value));
        }
    }
252066
public static void runUITask(Object context, int uiTaskId, final Object... args) {

		if(!ProfileService.getInstance(context).isActive(context, Profile.THREADING)) {
		
			StringBuilder builder = new StringBuilder()
			.append("UI task with ID ")
			.append(uiTaskId)
			.append("cannot be run since the threading profile is inactive.");
			
			Log.w("Async task cannot ", builder.toString());
			
			return;
		}
		
		TaskManagers.UI.execute(context, uiTaskId, args);
	}
1147131
def stack(self, value):
        
        if value == self._defaults['stack'] and 'stack' in self._values:
            del self._values['stack']
        else:
            self._values['stack'] = value
977278
function setContext(req, res, next) {
    currentContext = {req: req, res: res};
    next();
}
1214124
protected void pushContext(Context c) {
		Stack<Context> stack = threadSafeContextStack.get();
		if (stack == null) {
			stack = new Stack<Context>();
			stack.push(c);
			threadSafeContextStack.set(stack);
		} else {
			threadSafeContextStack.get().push(c);
		}
	}
230602
public void setValue(Enum key, double value) {
    this._task.put(key, Double.toString(value));
  }
702390
public void invokeHookEmit(List<Object> values, String stream, Collection<Integer> outTasks) {
    if (taskHooks.size() != 0) {
      EmitInfo emitInfo = new EmitInfo(values, stream, getThisTaskId(), outTasks);
      for (ITaskHook taskHook : taskHooks) {
        taskHook.emit(emitInfo);
      }
    }
  }
1142427
public void set(T value) {
        EventImpl event = (EventImpl) CurrentEvent.get();
        if (null != event) {
            event.set(this, value);
        }
    }