<s> """<STR_LIT>""" <EOL> import tables <EOL> def setUp ( filename ) : <EOL> fileh = tables . open_file ( filename , mode = "<STR_LIT:w>" , title = "<STR_LIT>" ) <EOL> fileh . create_group ( "<STR_LIT:/>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> fileh . create_group ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> fileh . create_array ( "<STR_LIT:/>" , "<STR_LIT>" , [ <NUM_LIT:1> , <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> fileh . enable_undo ( ) <EOL> return fileh <EOL> def tearDown ( fileh ) : <EOL> fileh . disable_undo ( ) <EOL> fileh . close ( ) <EOL> def demo_6times3marks ( ) : <EOL> """<STR_LIT>""" <EOL> fileh = setUp ( "<STR_LIT>" ) <EOL> fileh . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> fileh . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> fileh . mark ( ) <EOL> fileh . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:5> , <NUM_LIT:6> ] , "<STR_LIT>" ) <EOL> fileh . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:6> , <NUM_LIT:7> ] , "<STR_LIT>" ) <EOL> fileh . mark ( ) <EOL> fileh . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:7> , <NUM_LIT:8> ] , "<STR_LIT>" ) <EOL> fileh . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:8> , <NUM_LIT:9> ] , "<STR_LIT>" ) <EOL> fileh . undo ( ) <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> fileh . undo ( ) <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> fileh . undo ( ) <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> fileh . redo ( ) <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> fileh . redo ( ) <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> assert "<STR_LIT>" not in fileh <EOL> fileh . redo ( ) <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> assert "<STR_LIT>" in fileh <EOL> tearDown ( fileh ) <EOL> def demo_manyops ( ) : <EOL> """<STR_LIT>""" <EOL> fileh = setUp ( "<STR_LIT>" ) <EOL> fileh . create_array ( fileh . root , '<STR_LIT>' , [ <NUM_LIT:3> ] , "<STR_LIT>" ) <EOL> fileh . create_group ( fileh . root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> new_node = fileh . copy_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> new_node = fileh . copy_children ( '<STR_LIT>' , '<STR_LIT>' , recursive = <NUM_LIT:1> ) <EOL> fileh . rename_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> new_node = fileh . copy_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> fileh . remove_node ( '<STR_LIT>' ) <EOL> fileh . undo ( ) <EOL> assert '<STR_LIT>' not in fileh <EOL> assert '<STR_LIT>' not in fileh <EOL> assert '<STR_LIT>' not in fileh <EOL> assert '<STR_LIT>' not in fileh <EOL> assert '<STR_LIT>' not in fileh <EOL> assert '<STR_LIT>' in fileh <EOL> fileh . redo ( ) <EOL> assert '<STR_LIT>' in fileh <EOL> assert '<STR_LIT>' in fileh <EOL> assert '<STR_LIT>' in fileh <EOL> assert '<STR_LIT>' not in fileh <EOL> assert fileh . root . agroup . anarray3 is new_node <EOL> assert '<STR_LIT>' not in fileh <EOL> assert '<STR_LIT>' not in fileh <EOL> tearDown ( fileh ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> demo_6times3marks ( ) <EOL> demo_manyops ( ) </s>
