def getABFgroups(files):
children=[]<EOL>groups={}<EOL>for fname in sorted(files):<EOL><INDENT>if fname.endswith("<STR_LIT>"):<EOL><INDENT>if fname.replace("<STR_LIT>","<STR_LIT>") in files: <EOL><INDENT>if len(children):<EOL><INDENT>groups[children[<NUM_LIT:0>]]=children<EOL><DEDENT>children=[os.path.basename(fname)[:-<NUM_LIT:4>]]<EOL><DEDENT>else:<EOL><INDENT>children.append(os.path.basename(fname)[:-<NUM_LIT:4>])<EOL><DEDENT><DEDENT><DEDENT>groups[children[<NUM_LIT:0>]]=children<EOL>return groups<EOL>
given a list of ALL files (not just ABFs), return a dict[ID]=[ID,ID,ID].
Parents are determined if a .abf matches a .TIF.
This is made to assign children files to parent ABF IDs.