Set context value.

        Args:
            name (str):
                The name of the context value to change.
            value (Any):
                The new value for the selected context value
1012
def set(self, name, value):
        
        curr = self.values
        parts = name.split('.')

        for i, part in enumerate(parts[:-1]):
            try:
                curr = curr.setdefault(part, {})
            except AttributeError:
                raise InvalidPath('.'.join(parts[:i + 1]))

        try:
            curr[parts[-1]] = value
        except TypeError:
            raise InvalidPath('.'.join(parts[:-1]))
1273436
def set_variable(self, name, value):
        
        if value is None:
            # Unset the variable.
            if name in self._var:
                del self._var[name]
        self._var[name] = 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()})
417717
def set_header(self, name, value, append=False):
        '''  '''
        if append:
            self.add_header(name, value)
        else:
            self._headers[_hkey(name)] = [str(value)]
214322
def set(self, name, value, ex=None, px=None, nx=False, xx=False):
        
        self.client.set(name=name, value=value, px=px, nx=nx, xx=xx)
1262230
def set_name(self, value):
        
        if value is None:
            self.__name = value
        elif not isinstance(value, str):
            raise TypeError("Name must be set to a String")
        else:
            self.__name = value
647468
def set(self, name, default=0, editable=True, description=""):
        ''''''

        var, created = ConfigurationVariable.objects.get_or_create(name=name)

        if created:
            var.value = default

        if not editable:
            var.value = default

        var.editable = editable
        var.description = description
        var.save(reload=False)

        # ATTRIBUTES is accesible by any instance of VariablesManager
        self.ATTRIBUTES[var.name] = var.value
957607
def set_parameter(self, name, value):
        
        i = self.get_parameter_names(include_frozen=True).index(name)
        v = self.get_parameter_vector(include_frozen=True)
        v[i] = value
        self.set_parameter_vector(v, include_frozen=True)
882531
def setName(self, name):
        
        self._name = name
        
        tree = self.treeWidget()
        if tree:
            col = tree.column('Name')
            if col != -1:
                self.setData(col, Qt.EditRole, wrapVariant(name))
713292
def remove_from_context(self, name, *args):
        
        context = self.get_context(name=name)
        attrs_ = context['context']
        for a in args:
            del attrs_[a]
1081572
def set_header(self, name, value):
        
        self._headers[_hkey(name)] = [_hval(value)]
1202906
def global_add(self, key: str, value: Any) -> None:
        
        self.global_context[key] = value
800291
def set_context(self, definition: Definition, explanation: str) -> None:
        """"""
        self.definition = definition
        self.explanation = explanation
1058503
def update_context(self, ctx):
        
        assert isinstance(ctx, dict)
        ctx[str(self.context_id)] = self.value
1035965
def set_value(self, key, value):
        # type: (str, Any) -> None
        
        self._ensure_have_load_only()

        fname, parser = self._get_parser_to_modify()

        if parser is not None:
            section, name = _disassemble_key(key)

            # Modify the parser and the configuration
            if not parser.has_section(section):
                parser.add_section(section)
            parser.set(section, name, value)

        self._config[self.load_only][key] = value
        self._mark_as_modified(fname, parser)
1326064
def set_value(self, name, value, ignore_error=False, block_user_signals=False):
        
        # first clean up the name
        name = self._clean_up_name(name)

        # If we're supposed to, block the user signals for this parameter
        if block_user_signals: self.block_user_signals(name, ignore_error)        

        # now get the parameter object
        x = self._find_parameter(name.split('/'), quiet=ignore_error)

        # quit if it pooped.
        if x == None: return None
        
        # for lists, make sure the value exists!!
        if x.type() in ['list']:
            
            # Make sure it exists before trying to set it
            if str(value) in list(x.forward.keys()): x.setValue(str(value))
            
            # Otherwise default to the first key
            else: x.setValue(list(x.forward.keys())[0])
        
        # Bail to a hopeful set method for other types
        else: x.setValue(eval(x.opts['type'])(value))

        # If we're supposed to unblock the user signals for this parameter
        if block_user_signals: self.unblock_user_signals(name, ignore_error)

        return self
651708
def set_option(self, name, value):
        
        self.__validate_option_name(name)
        self.__options[name] = value