def _sort_modules(mods):
def compare(x, y):<EOL><INDENT>x = x[<NUM_LIT:1>]<EOL>y = y[<NUM_LIT:1>]<EOL>if x == y:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>if y.stem == "<STR_LIT>":<EOL><INDENT>return <NUM_LIT:1><EOL><DEDENT>if x.stem == "<STR_LIT>" or x < y:<EOL><INDENT>return -<NUM_LIT:1><EOL><DEDENT>return <NUM_LIT:1><EOL><DEDENT>return sorted(mods, key=cmp_to_key(compare))<EOL>
Always sort `index` or `README` as first filename in list.