use the result as an argument for the call to the self.stdout.write. call the self.sync_apps method with connection and executor.loader.unmigrated_apps as arguments, substitute it for created_models.
created_models = self . sync_apps ( connection , executor . loader . unmigrated_apps )