updated get_agi_seq.py to use module-level functions
updated test to use module-level functions