def METHOD_NAME(self, num_regions) -> None:
    if not self.item.subject:
        return
    while num_regions > len(self.item.subject.region):
        region = self.item.subject.model.create(UML.Region)
        self.item.subject.region = region
    while num_regions < len(self.item.subject.region):
        region = self.item.subject.region[-1]
        region.unlink()