def _get_segmentation_id(self, segid):
        """Allocate segmentation id."""

        try:
            newseg = (segid, self.segmentation_pool.remove(segid)
                      if segid and segid in self.segmentation_pool else
                      self.segmentation_pool.pop())
            return newseg[0] if newseg[0] else newseg[1]
        except __HOLE__:
            LOG.exception(_LE('Error: Segmentation id pool is empty'))
            return 0
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/apps/saf/server/dfa_server.py/DfaServer._get_segmentation_id