code: def _sort_lows_and_highs(func):
      "Decorator for extract_cycles"
      @functools.wraps(func)
      def wrapper(*args, **kwargs):
          for low, high, mult in func(*args, **kwargs):
              if low < high:
                  yield low, high, mult
              else:
                  yield high, low, mult
      return wrappef _sort_lows_and_highs(func):
      "Decorator for extract_cycles"
      @functools.wraps(func)
      def wrapper(*args, **kwargs):
          for low, high, mult in func(*args, **kwargs):
              if low < high:
                  yield low, high, mult
              else:
                  yield high, low, mult
      return wrapper
docs: Decorator for extract_cycles