where '%s' is replaced with migration_name and app_label. migrations_to_squash is a list created dynamically with elements: return value of the method executor.loader.get_migration called,
migrations_to_squash = [ executor . loader . get_migration ( al , mn ) for al , mn in executor . loader . graph . forwards_plan ( ( migration . app_label , migration . name ) ) if al == migration . app_label ]