<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _expand(self):
 """ Expand the free pool, if possible. If out of capacity w.r.t. the defined ID value range, ValueError is raised. """

        assert not self._free  # free pool is empty
        expand_end = self._expand_start + self._expand_len
        if expand_end > self._range_end:
            # This happens if the size of the value range is not a multiple
            # of the expansion chunk size.
            expand_end = self._range_end
        if self._expand_start == expand_end:
            raise ValueError("Out of capacity in ID pool")
        self._free = set(range(self._expand_start, expand_end))
        self._expand_start = expand_end