code: def optimize_orientations(fwtour, clm, phase, cpus):
      
      # Prepare input files
      tour_contigs = clm.active_contigs
      tour = clm.tour
      oo = clm.oo
  
      print_tour(fwtour, tour, "FLIPALL{}".format(phase),
                 tour_contigs, oo, signs=clm.signs)
      tag1 = clm.flip_whole(tour)
      print_tour(fwtour, tour, "FLIPWHOLE{}".format(phase),
                 tour_contigs, oo, signs=clm.signs)
      tag2 = clm.flip_one(tour)
      print_tour(fwtour, tour, "FLIPONE{}".format(phase),
                 tour_contigs, oo, signs=clm.signs)
  
      return tag1, tag2
docs: Optimize the orientations of contigs by using heuristic flipping.