Register support for the SHIM header with the given `name`.

        If the header has already been registered as supported,
        :class:`ValueError` is raised.
10173
def register_header(self, name):
        

        self._node.register_feature(
            "#".join([namespaces.xep0131_shim, name])
        )
1009113
def register_serialization_method(self, name, serialize_func):
        
        if name in self._default_serialization_methods:
            raise ValueError("Can't replace original %s serialization method")
        self._serialization_methods[name] = serialize_func
975624
def set_header(self, name: str, value: _HeaderTypes) -> None:
        
        self._headers[name] = self._convert_header_value(value)
946573
def add(self, name: str, value: str) -> None:
        """"""
        norm_name = _normalized_headers[name]
        self._last_key = norm_name
        if norm_name in self:
            self._dict[norm_name] = (
                native_str(self[norm_name]) + "," + native_str(value)
            )
            self._as_list[norm_name].append(value)
        else:
            self[norm_name] = value
922659
def set(self, name: str, value: str) -> None:
        
        name = name.casefold()
        self._headers[name] = value
281926
def getbyname(self, name):
        
        if name not in self._schbyname:
            raise KeyError('name {0} not registered'.format(name))

        return self._schbyname[name]
76884
public void addHeader(String name, boolean required, Object value) {
        RemotingHeader header = new RemotingHeader(name, required, value);
        headers.put(name, header);
    }
237799
def check_header_validity(header):
    
    name, value = header

    if isinstance(value, bytes):
        pat = _CLEAN_HEADER_REGEX_BYTE
    else:
        pat = _CLEAN_HEADER_REGEX_STR
    try:
        if not pat.match(value):
            raise InvalidHeader("Invalid return character or leading space in header: %s" % name)
    except TypeError:
        raise InvalidHeader("Value for header {%s: %s} must be of type str or "
                            "bytes, not %s" % (name, value, type(value)))
418706
def register(self, name: str):
        ''''''
        if name in self._callbacks:
            raise ValueError('Hook already registered')

        self._callbacks[name] = None

        if self._event_dispatcher is not None:
            self._event_dispatcher.register(name)
1347047
public void addHeader(String name, String value) {
        headerEntries.add(new HeaderEntry(name, value));
    }
1000625
def declare(self, name):
        

        if name in self._data:
            raise KeyError("Declared name {} that already existed".format(name))

        self._data[name] = self._loop.create_future()
80130
def register(name):
    
    assert isinstance(name, six.text_type)
    def decorator(handler):
        assert callable(handler)

        _readline_commands[name] = handler
        return handler
    return decorator
1079776
def _register_make(cls):
    ''''''
    assert cls.nxm_headers is not None
    assert cls.nxm_headers is not []
    for nxm_header in cls.nxm_headers:
        assert nxm_header not in _MF_FIELDS
        _MF_FIELDS[nxm_header] = cls.make
    return cls
684914
public void setHeader(String name, Object value) {
    verifyType(name, value);
    if (value != null) {
      // Modify header if necessary
      if (!ObjectUtils.nullSafeEquals(value, getHeader(name))) {
        this.modified = true;
        this.headers.put(name, value);
      }
    } else {
      // Remove header if available
      if (this.headers.containsKey(name)) {
        this.modified = true;
        this.headers.remove(name);
      }
    }
  }
104917
def validate_name(self, name: str):
        
        parts = self.NAME_SPLIT_RE.split(name)
        for part in parts:
            if not part.isidentifier() or keyword.iskeyword(part):
                raise ValueError('Incorrect route name {!r}, '
                                 'the name should be a sequence of '
                                 'python identifiers separated '
                                 'by dash, dot or column'.format(name))
        if name in self._named_resources:
            raise ValueError('Duplicate {!r}, '
                             'already handled by {!r}'
                             .format(name, self._named_resources[name]))
859381
public void includeRequestHeader(String name, String value) {
        checkUpdatable();
        this.headers.put(name, value);
    }
702491
def add_header(self, header):
        """"""
        if type(header) is dict:
            self._headers.update(header)
        else:
            raise ValueError(
                "Dictionary expected, got '%s' instead" % type(header)
            )