def demo_manyops():
    """Checking many operations together."""

    # Initialize the data base with some nodes
    fileh = setUp("undo-redo-manyops.h5")

    # Create an array
    fileh.create_array(fileh.root, 'anarray3', [3], "Array title 3")
    # Create a group
    fileh.create_group(fileh.root, 'agroup3', "Group title 3")
    # /anarray => /agroup/agroup3/
    new_node = fileh.copy_node('/anarray3', '/agroup/agroup2')
    new_node = fileh.copy_children('/agroup', '/agroup3', recursive=1)
    # rename anarray
    fileh.rename_node('/anarray', 'anarray4')
    # Move anarray
    new_node = fileh.copy_node('/anarray3', '/agroup')
    # Remove anarray4
    fileh.remove_node('/anarray4')
    # Undo the actions
    fileh.undo()
    assert '/anarray4' not in fileh
    assert '/anarray3' not in fileh
    assert '/agroup/agroup2/anarray3' not in fileh
    assert '/agroup3' not in fileh
    assert '/anarray4' not in fileh
    assert fileh in '/anarray'

    # Redo the actions
    fileh.redo()
    # Check that the copied node exists again in the object tree.
    assert '/agroup/agroup2/anarray3' in fileh
    assert '/agroup/anarray3' in fileh
    assert '/agroup3/agroup2/anarray3' in fileh
    assert '/agroup3/anarray3' not in fileh
    assert fileh.root.agroup.anarray3 is new_node
    assert '/anarray' not in fileh
    assert '/anarray4' not in fileh

    # Tear down the file
    tearDown(fileh)
dataset/ETHPy150Open PyTables/PyTables/examples/undo-redo.py/demo_manyops/swapped operands of `in`