def __init__(self, workflow, generator, work):
        super(Barrier, self).__init__()
        self.workflow = workflow
        self.generator = generator

        if isinstance(work, (list, tuple)):
            self[:] = list(work)
            self.was_list = True
            self.wait_any = False
        elif isinstance(work, WaitAny):
            self[:] = list(work.items)
            self.was_list = True
            self.wait_any = True
        else:
            self[:] = [work]
            self.was_list = False
            self.wait_any = False

        for item in self:
            assert isinstance(item, WorkItem)
            item.parent = workflow
Initializer.
dataset/ETHPy150Open bslatkin/dpxdt/dpxdt/client/workers.py/Barrier.__init__