Determine the relevant target or base variables (as defined by
        the given |ExchangeSpecification| object ) handled by the given
        |Selections| object and insert them into the given `device2variable`
        dictionary.
330259
def insert_variables(
            self, device2variable, exchangespec, selections) -> None:
        """"""
        if self.targetspecs.master in ('node', 'nodes'):
            for node in selections.nodes:
                variable = self._query_nodevariable(node, exchangespec)
                device2variable[node] = variable
        else:
            for element in self._iter_relevantelements(selections):
                variable = self._query_elementvariable(element, exchangespec)
                device2variable[element] = variable
652499
function updateVariable(key, value) {
            variableService.addOrUpdate({key: key, value: value}, function () {
                vm.variables[key] = value;
                vm.variable = {
                    key: undefined,
                    value: undefined
                };
            });
        }
1228688
def add_variables(
        self, variables: Union[List["Variable"], "Variable"], index: int = None
    ) -> None:
        
        if isinstance(variables, Variable):
            addvars = copy.deepcopy([variables])
        else:
            addvars = copy.deepcopy(variables)

        if index is None:
            self.variables.extend(addvars)
        else:
            self.variables[index:index] = addvars
1370160
def addVar(self, sig: object, name: str, sigType: VCD_SIG_TYPE, width: int,
               valueFormatter: Callable[["Value"], str]):
        
        vInf = self._writer._idScope.registerVariable(sig, name, self, width,
                                                      sigType, valueFormatter)
        self.children[vInf.name] = vInf
        self._writer._oFile.write("$var %s %d %s %s $end\n" % (
            sigType, vInf.width, vInf.vcdId, vInf.name))
478396
function addVariable() {
            variableService.addOrUpdate(vm.variable, function () {
                vm.variables[vm.variable.key] = vm.variable.value;
                vm.variable = {
                    key: undefined,
                    value: undefined
                };
            });
        }
1217277
def specify_data_set(self, x_input, y_input):
        
        self.x = x_input
        self.y = y_input
674714
def set_var(self, vardef):
        
        if not(vardef.default and self.cache['ctx'].get(vardef.name)):
            self.cache['ctx'][vardef.name] = vardef.expression.value
429788
protected void setVariable(String variableName, Object value, ExecutionEntity sourceExecution, boolean fetchAllVariables) {

    if (fetchAllVariables == true) {

      // If it's in the cache, it's more recent
      if (usedVariablesCache.containsKey(variableName)) {
        updateVariableInstance(usedVariablesCache.get(variableName), value, sourceExecution);
      }

      // If the variable exists on this scope, replace it
      if (hasVariableLocal(variableName)) {
        setVariableLocal(variableName, value, sourceExecution, true);
        return;
      }

      // Otherwise, go up the hierarchy (we're trying to put it as high as possible)
      VariableScopeImpl parentVariableScope = getParentVariableScope();
      if (parentVariableScope != null) {
        if (sourceExecution == null) {
          parentVariableScope.setVariable(variableName, value);
        } else {
          parentVariableScope.setVariable(variableName, value, sourceExecution, true);
        }
        return;
      }

      // We're as high as possible and the variable doesn't exist yet, so
      // we're creating it
      if (sourceExecution != null) {
        createVariableLocal(variableName, value, sourceExecution);
      } else {
        createVariableLocal(variableName, value);
      }

    } else {

      // Check local cache first
      if (usedVariablesCache.containsKey(variableName)) {

        updateVariableInstance(usedVariablesCache.get(variableName), value, sourceExecution);

      } else if (variableInstances != null && variableInstances.containsKey(variableName)) {

        updateVariableInstance(variableInstances.get(variableName), value, sourceExecution);

      } else {

        // Not in local cache, check if defined on this scope
        // Create it if it doesn't exist yet
        VariableInstanceEntity variable = getSpecificVariable(variableName);
        if (variable != null) {
          updateVariableInstance(variable, value, sourceExecution);
          usedVariablesCache.put(variableName, variable);
        } else {

          VariableScopeImpl parent = getParentVariableScope();
          if (parent != null) {
            if (sourceExecution == null) {
              parent.setVariable(variableName, value, fetchAllVariables);
            } else {
              parent.setVariable(variableName, value, sourceExecution, fetchAllVariables);
            }

            return;
          }

          variable = createVariableInstance(variableName, value, sourceExecution);
          usedVariablesCache.put(variableName, variable);

        }

      }

    }

  }
1156609
def __replace_base_variables(text, req_len, idx):
        
        return text \
            .replace("{i}", str(idx + 1)) \
            .replace("{n}", str(req_len))
300107
def check_platform_variable_attributes(self, ds):
        '''
        
        '''
        results = []
        platform_name = getattr(ds, 'platform', '')
        # There can be multiple platforms defined here (space separated)
        for platform in platform_name.split(' '):
            if platform in ds.variables:
                results += [
                    self._has_var_attr(ds, platform, 'long_name', 'Platform Long Name'),
                    self._has_var_attr(ds, platform, 'short_name', 'Platform Short Name'),
                    self._has_var_attr(ds, platform, 'ioos_code', 'Platform IOOS Code'),
                    self._has_var_attr(ds, platform, 'type', 'Platform Type')
                ]
        return results
478085
def convertVariable(self, key, varName, varValue):
        """"""
        if isinstance(varValue, encapsulation.FunctionEncapsulation):
            result = varValue.getFunction()

            # Update the global scope of the function to match the current module
            mainModule = sys.modules["__main__"]
            result.__name__ = varName
            result.__globals__.update(mainModule.__dict__)
            setattr(mainModule, varName, result)
            shared.elements[key].update({
                varName: result,
            })
216145
def _AddVariable(self, variable):
        
        if isinstance(variable, Signal):
            if not variable in self.signals:
                self.signals.append(variable)
        elif isinstance(variable, Variable):
            if not variable in self.variables:
                self.variables.append(variable)
        else:
            raise TypeError
        self._utd_graph = False
1030568
static void updateNetworkVariables( Map<String,String> instanceExports, String ipAddress ) {

		// Find the keys to update ( xxx.ip )
		Set<String> keysToUpdate = new HashSet<> ();
		for( Map.Entry<String,String> entry : instanceExports.entrySet()) {
			String suffix = parseVariableName( entry.getKey()).getValue();
			if( Constants.SPECIFIC_VARIABLE_IP.equalsIgnoreCase( suffix ))
				keysToUpdate.add( entry.getKey());
		}

		// Update them
		for( String key : keysToUpdate )
			instanceExports.put( key, ipAddress );
	}
108672
protected void setVariableRegistry(ServiceReference<VariableRegistry> ref) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "setVariableRegistry", ref);
        variableRegistryRef.setReference(ref);
    }
1371763
def variable_on_cpu(name, shape, initializer):
    
    """
    # Use the /cpu:0 device for scoped operations
    with tf.device(Config.cpu_device):
        # Create or get apropos variable
        var = tf.get_variable(name=name, shape=shape, initializer=initializer)
    return var
667472
def __set_target_variables_aux (manager, rule_or_module, ps):
    
    assert isinstance(rule_or_module, basestring)
    assert isinstance(ps, property_set.PropertySet)
    result = []

    for f in __flags.get(rule_or_module, []):

        if not f.condition or find_satisfied_condition (f.condition, ps):
            processed = []
            for v in f.values:
                # The value might be <feature-name> so needs special
                # treatment.
                processed += __handle_flag_value (manager, v, ps)

            for r in processed:
                result.append ((f.variable_name, r))

    # strip away last dot separated part and recurse.
    next = __re_split_last_segment.match(rule_or_module)

    if next:
        result.extend(__set_target_variables_aux(
            manager, next.group(1), ps))

    return result
994567
def set(self, variables: Dict[str, str]):
        
        current_variables = self.get()
        difference = DictDiffer(variables, current_variables)

        removed_keys = difference.removed()
        self.remove(removed_keys)

        changed_keys = difference.added() | difference.changed()
        changed = {key: variables[key] for key in changed_keys}
        self.add(changed, overwrite=True)