Sets the current global context dictionary. All the attributes to be set
    should be set. Otherwise, it will result in unpredictable behavior.
343797
def set_context(context):
    """"""
    global _context
    _context = {k: v for k, v in context.items()}
1344389
function globalReset (self) {
    // reset data for all instances
    _.each(global.__immutable_global__, instance => instance.reset())
    // reset internal data
    if (self) {
        global.__immutable_global__ = {}
    }
}
1058503
def update_context(self, ctx):
        
        assert isinstance(ctx, dict)
        ctx[str(self.context_id)] = self.value
157204
private boolean setLocation(String global, String context, Map<String, Object> properties) {
        String locationKey = "location." + context;
        Object propvalue = properties.get(locationKey);
        if (propvalue == null) {
            properties.put(locationKey, global);
        } else if (propvalue.getClass().isArray()) {
            Object[] locations = (Object[]) propvalue;
            if (ArrayUtils.contains(locations, global)) {
                return false;
            }
            Object[] newArray = Arrays.copyOf(locations, locations.length + 1);
            newArray[locations.length] = global;
            properties.put(locationKey, newArray);
        } else {
            if (((String) propvalue).equals(global)) {
                return false;
            }
            Object[] newArray = new Object[2];
            newArray[0] = propvalue;
            newArray[1] = global;
            properties.put(locationKey, newArray);
        }
        return true;
    }
1334977
public void set(String key, Object value) {
		if (globalVar == null) globalVar = new HashMap<String, Object>();
		globalVar.put(key, value);
	}
1118706
def Set(self, value, context=None):
    """"""
    if self.has_error: return
    if self.value is None:
      self.value = value
      self._context["old_value"] = value
      self._context.update({"old_" + k: v for k, v in context.items()})
    elif self.value != value:
      self.has_error = True
      self._context["new_value"] = value
      self._context.update({"new_" + k: v for k, v in context.items()})
212032
function(context) {
      this._context = context;
      if (this.scenes) {
        _.each(this.scenes, function(scene) {
          scene.setContext(context);
        });
      }
    }
814339
def update(self, **kwargs):
        
        for kw in kwargs:
            setattr(self, kw, kwargs[kw])
605870
def set_context(self, serializer_field):
        
        # Determine the underlying model field name. This may not be the
        # same as the serializer field name if `source=<>` is set.
        self.field_name = serializer_field.source_attrs[0]
        # Determine the existing instance, if this is an update operation.
        self.instance = getattr(serializer_field.parent, 'instance', None)
368095
def set_attr(self):
        
        setattr(self.attrs, self.kind_attr, self.values)
        setattr(self.attrs, self.meta_attr, self.meta)
        if self.dtype is not None:
            setattr(self.attrs, self.dtype_attr, self.dtype)
514913
def set_attributes(self, **kwargs):
        
        for field, value in kwargs.items():
            if field in self.Meta.attributes:
                setattr(self, field, value)
583429
public synchronized static void initGlobal(ContextFactory factory)
    {
        if (factory == null) {
            throw new IllegalArgumentException();
        }
        if (hasCustomGlobal) {
            throw new IllegalStateException();
        }
        hasCustomGlobal = true;
        global = factory;
    }
1004099
def setcontext(context, _local=local):
    
    oldcontext = getcontext()
    _local.__bigfloat_context__ = oldcontext + context
1070526
def set_context(self, context):
        """"""
        self._set_context(context, emit=False)
        self._modified = (not context.load_path)
        self.dataChanged.emit(self.CONTEXT_CHANGED |
                              self.REQUEST_CHANGED |
                              self.PACKAGES_PATH_CHANGED |
                              self.LOCKS_CHANGED |
                              self.LOADPATH_CHANGED |
                              self.PACKAGE_FILTER_CHANGED |
                              self.CACHING_CHANGED)
1008246
public static void onGlobalEnd ()
  {
    s_aGlobalLock.locked ( () -> {
      /**
       * This code removes all attributes set for the global context. This is
       * necessary, since the attributes would survive a Tomcat servlet context
       * reload if we don't kill them manually.<br>
       * Global scope variable may be null if onGlobalBegin() was never called!
       */
      if (s_aGlobalScope != null)
      {
        // Invoke SPI
        ScopeSPIManager.getInstance ().onGlobalScopeEnd (s_aGlobalScope);

        // Destroy and invalidate scope
        final String sDestroyedScopeID = s_aGlobalScope.getID ();
        s_aGlobalScope.destroyScope ();
        s_aGlobalScope = null;

        // done
        if (ScopeHelper.debugGlobalScopeLifeCycle (LOGGER))
          LOGGER.info ("Global scope '" + sDestroyedScopeID + "' shut down!", ScopeHelper.getDebugStackTrace ());
      }
      else
        LOGGER.warn ("No global scope present that could be shut down!");
    });
  }
539861
def _set_attributes(self, response, attribute_dict):
        
        status_code = response.get(
            'HTTPStatusCode',
            response['ResponseMetadata']['HTTPStatusCode']
        )
        if status_code == 200:
            for k, v in attribute_dict.items():
                setattr(self, k, v)
567800
def update(self, dictionary):
        """"""
        allowed_attrs = list(self.__attributes__.keys())
        allowed_attrs += [a.alias for a in self.__attributes__.values()]
        for k in dictionary:
            # We only update existing attributes
            if k in allowed_attrs:
                setattr(self, k, dictionary[k])
        return self