def alloc(self):
        """
        Allocate an ID value and return it.

        Raises:
            ValueError: Out of capacity in ID pool.
        """
        if not self._free:
            self._expand()
        id = self._free.pop()
        self._used.add(id)
        return id
Allocate an ID value and return it.

        Raises:
            ValueError: Out of capacity in ID pool.