def _populate_volume_state_table():
        O = VolumeOperations
        S = VolumeStates
        table = pmap()

        def add_flow(operation, start, transient, end, sets_attach,
                     unsets_attach):
            """
            Helper to add expected volume states for given operation.
            """
            return table.set(operation,
                             VolumeStateFlow(start_state=start,
                                             transient_state=transient,
                                             end_state=end,
                                             sets_attach=sets_attach,
                                             unsets_attach=unsets_attach))

        table = add_flow(O.CREATE, S.EMPTY, S.CREATING, S.AVAILABLE,
                         False, False)
        table = add_flow(O.ATTACH, S.AVAILABLE, S.ATTACHING, S.IN_USE,
                         True, False)
        table = add_flow(O.DETACH, S.IN_USE, S.DETACHING, S.AVAILABLE,
                         False, True)
        table = add_flow(O.DESTROY, S.AVAILABLE, S.DELETING, S.EMPTY,
                         False, False)
        return table
A reduction to count the number of elements
dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/agents/ebs.py/VolumeStateTable._populate_volume_state_table--crossover with--dataset/ETHPy150Open dask/dask/dask/array/reductions.py/nannumel