def METHOD_NAME(self, partition: int, active: bool) -> bool:
    return not self.partition_assigned(partition, active) and (
        active or not self.partition_assigned(partition, active=True)
    )