Register a feature with the namespace variable `var`.

        If the feature is already registered or part of the default :xep:`30`
        features, a :class:`ValueError` is raised.
972424
def register_feature(self, var):
        
        if var in self._features or var in self.STATIC_FEATURES:
            raise ValueError("feature already claimed: {!r}".format(var))
        self._features.add(var)
        self.on_info_changed()
414850
def _add_variable(self, variable):
        
        # TODO: Add feature for accepting additional properties of states.
        variable_data = self.data['probnet']['Variables'][variable]
        variable_element = etree.SubElement(self.variables, 'Variable', attrib={'name': variable,
                                                                                'type': variable_data['type'],
                                                                                'role': variable_data['role']})

        try:
            etree.SubElement(variable_element, 'Comment').text = variable_data['Comment']
        except KeyError:
            pass
        try:
            etree.SubElement(variable_element, 'Coordinates', variable_data['Coordinates'])
        except KeyError:
            pass

        try:
            for key, value in sorted(variable_data['AdditionalProperties'].items()):
                etree.SubElement(variable_element, 'Property', attrib={'name': key, 'value': value})
        except KeyError:
            etree.SubElement(variable_element, 'AdditionalProperties')
        states = etree.SubElement(variable_element, 'States')
        for s in sorted(variable_data['States']):
            state = etree.SubElement(states, 'State', attrib={'name': s})
            try:
                self._add_additional_properties(state, variable_data['States'][s]['AdditionalProperties'])
            except KeyError:
                etree.SubElement(state, 'AdditionalProperties')
1101164
def set(cls, var_name: str, value: Any) -> 'Configuration':
        
        with cls._lock:
            if var_name not in cls().cache:
                cls().cache[var_name] = value
            else:
                raise ConfigurationError(
                    f'Value for {var_name} already set')
        return cls()
1295861
def set_variable(var, val, override=false)

      fexp, v = locate_set_var(var, override) || locate_var(var)

      fexp.un_set_variable(:set, v, val, (fexp.h.fei != h.fei)) if fexp
    end
1110306
def compile(self, X, verbose=False):
        
        for term in self._terms:
            term.compile(X, verbose=False)

        if self.by is not None and self.by >= X.shape[1]:
            raise ValueError('by variable requires feature {}, '\
                             'but X has only {} dimensions'\
                             .format(self.by, X.shape[1]))
        return self
1315375
def register(self, entry_point):
        
        if entry_point in self.registered_extensions:
            raise ValueError('Extension already registered')

        ep = EntryPoint.parse(entry_point)
        if ep.name in self.names():
            raise ValueError('An extension with the same name already exist')

        ext = self._load_one_plugin(ep, False, (), {}, False)
        self.extensions.append(ext)
        if self._extensions_by_name is not None:
            self._extensions_by_name[ext.name] = ext
        self.registered_extensions.insert(0, entry_point)
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))
1336574
def _create_variables(self, n_features):
        
        if self.do_pretrain:
            self._create_variables_pretrain()
        else:
            self._create_variables_no_pretrain(n_features)
1146481
def declare_variable(self, id_, lineno, type_, default_value=None):
        
        assert isinstance(type_, symbols.TYPEREF)
        if not self.check_is_undeclared(id_, lineno, scope=self.current_scope, show_error=False):
            entry = self.get_entry(id_)
            if entry.scope == SCOPE.parameter:
                syntax_error(lineno,
                             "Variable '%s' already declared as a parameter "
                             "at %s:%i" % (id_, entry.filename, entry.lineno))
            else:
                syntax_error(lineno, "Variable '%s' already declared at "
                                     "%s:%i" % (id_, entry.filename, entry.lineno))
            return None

        if not self.check_class(id_, CLASS.var, lineno, scope=self.current_scope):
            return None

        entry = (self.get_entry(id_, scope=self.current_scope) or
                 self.declare(id_, lineno, symbols.VAR(id_, lineno, class_=CLASS.var)))
        __DEBUG__("Entry %s declared with class %s at scope %i" % (entry.name, CLASS.to_string(entry.class_),
                                                                   self.current_scope))

        if entry.type_ is None or entry.type_ == self.basic_types[TYPE.unknown]:
            entry.type_ = type_

        if entry.type_ != type_:
            if not type_.implicit and entry.type_ is not None:
                syntax_error(lineno,
                             "'%s' suffix is for type '%s' but it was "
                             "declared as '%s'" %
                             (id_, entry.type_, type_))
                return None
                # type_ = entry.type_  # TODO: Unused??

        entry.scope = SCOPE.global_ if self.current_scope == self.global_scope else SCOPE.local
        entry.callable = False
        entry.class_ = CLASS.var  # HINT: class_ attribute could be erased if access_id was used.
        entry.declared = True  # marks it as declared

        if entry.type_.implicit and entry.type_ != self.basic_types[TYPE.unknown]:
            warning_implicit_type(lineno, id_, entry.type_.name)

        if default_value is not None and entry.type_ != default_value.type_:
            if is_number(default_value):
                default_value = symbols.TYPECAST.make_node(entry.type_, default_value,
                                                           lineno)
                if default_value is None:
                    return None
            else:
                syntax_error(lineno,
                             "Variable '%s' declared as '%s' but initialized "
                             "with a '%s' value" %
                             (id_, entry.type_, default_value.type_))
                return None

        entry.default_value = default_value
        return entry
999147
def register_value_proxy(namespace, value_proxy, help_text):
    """"""
    namespace.register_proxy(value_proxy)
    config.config_help.add(
        value_proxy.config_key, value_proxy.validator, value_proxy.default,
        namespace.get_name(), help_text)
572164
def register_namespace(self, namespace_handler):
        
        if not isinstance(namespace_handler, namespace.ClientNamespace):
            raise ValueError('Not a namespace instance')
        if self.is_asyncio_based() != namespace_handler.is_asyncio_based():
            raise ValueError('Not a valid namespace class for this client')
        namespace_handler._set_client(self)
        self.namespace_handlers[namespace_handler.namespace] = \
            namespace_handler
128506
def validate_vars(env):
    """"""
    if 'PCH' in env and env['PCH']:
        if 'PCHSTOP' not in env:
            raise SCons.Errors.UserError("The PCHSTOP construction must be defined if PCH is defined.")
        if not SCons.Util.is_String(env['PCHSTOP']):
            raise SCons.Errors.UserError("The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP'])
459674
def set(self, key, value):
        ''''''
        if hasattr(value, 'labels'):
            if 'VARIABLE' in env.config['SOS_DEBUG'] or 'ALL' in env.config[
                    'SOS_DEBUG']:
                env.log_to_file(
                    'VARIABLE',
                    f"Set {key} to {short_repr(value)} with labels {short_repr(value.labels)}"
                )
        else:
            if 'VARIABLE' in env.config['SOS_DEBUG'] or 'ALL' in env.config[
                    'SOS_DEBUG']:
                env.log_to_file(
                    'VARIABLE',
                    f"Set {key} to {short_repr(value)} of type {value.__class__.__name__}"
                )
        self._dict[key] = value
142965
def var_set(self, session, **kwargs):
        
        if not kwargs:
            session.write_line(
                self._utils.make_table(
                    ("Name", "Value"), session.variables.items()
                )
            )
        else:
            for name, value in kwargs.items():
                name = name.strip()
                session.set(name, value)
                session.write_line("{0}={1}", name, value)
576487
@Override
	public void setFeature(String feature, boolean value) {
		if (XmlPullParser.FEATURE_PROCESS_NAMESPACES.equals(feature)) {
			processNsp = value;
		} else if (XmlPullParser.FEATURE_PROCESS_DOCDECL.equals(feature)) {
			processDocDecl = value;
		} else if (FEATURE_RELAXED.equals(feature)) {
			relaxed = value;
		} else {
			throw new KriptonRuntimeException("unsupported feature: " + feature, true, this.getLineNumber(), this.getColumnNumber(), getPositionDescription(), null);
		}
	}
730940
def register(self, dtype):
        
        if not issubclass(dtype, (PandasExtensionDtype, ExtensionDtype)):
            raise ValueError("can only register pandas extension dtypes")

        self.dtypes.append(dtype)
123930
def make_var(self, op_name, name, shape):
        ''''''
        if op_name in self.weights and name in self.weights[op_name]:
            if self.verbose:
                print("Using: {} {}".format(op_name, name))
            initializer = tf.constant(self.weights[op_name][name], shape=shape)
            return tf.get_variable(name, initializer=initializer, trainable=self.trainable)
        return tf.get_variable(name, shape, trainable=self.trainable)