def should_switch_to_postcopy(memory_iteration, current_data_remaining, previous_data_remaining, migration_status):
 if ((migration_status == 'running (post-copy)') or (previous_data_remaining <= 0)):
  return False
 if (memory_iteration > 1):
  progress_percentage = round((((previous_data_remaining - current_data_remaining) * 100) / previous_data_remaining))
  if (progress_percentage < 10):
   return True
 return False

def should_switch_to_postcopy ( memory_iteration , current_data_remaining , previous_data_remaining , migration_status ) : if ( ( migration_status == 'running (post-copy)' ) or ( previous_data_remaining <= 0 ) ) : return False if ( memory_iteration > 1 ) : progress_percentage = round ( ( ( ( previous_data_remaining - current_data_remaining ) * 100 ) / previous_data_remaining ) ) if ( progress_percentage < 10 ) : return True return False
determine if the migration should be switched to postcopy mode .