code: def one_cycle_phases(
      steps: int,
      lr: Tuple[float, float] = (0.1, 1),
      momentum: Tuple[float, float] = (0.95, 0.85),
      finetune_lr: float = 0.01,
      finetune_fraction: float = 0.1,
  ) -> List[Phase]:
      """
      The "one-cycle" policy as described in the paper `Super-Convergence: Very Fast Training of
      Neural Networks Using Large Learning Rates <https://arxiv.org/abs/1708.07120>`_.
  
      You might want to read the paper and adjust the parameters.
  
      Args:
          steps (int): the total number of steps to take.
          lr (Tuple[float, float]): tuple for the triangular learning rate (start, middle).
          momentum (Tuple[float, float]): tuple for the triangular momentum (start, middle).
          finetune_lr (float): target learning rate for the final fine tuning. Should be smaller than
              `min(lr)`.
          finetune_fraction (float): fraction of steps used for the fine tuning.
              Must be between 0 and 1.
  
      Returns:
          A list of configured :class:`~poutyne.Phase` instances.
  
      References:
          `Super-Convergence: Very Fast Training of Neural Networks Using Large Learning Rates
          <https://arxiv.org/abs/1708.07120>`_
      """
      steps_annealing = int(steps * finetune_fraction)
      steps_up = (steps - steps_annealing) // 2
      steps_down = steps - steps_annealing - steps_up
      return [
          Phase(
              lr=linspace(lr[0], lr[1], steps_up),
              momentum=linspace(momentum[0], momentum[1], steps_up),
          ),
          Phase(
              lr=linspace(lr[1], lr[0], steps_down),
              momentum=linspace(momentum[1], momentum[0], steps_down),
          ),
          Phase(
              lr=linspace(lr[0], finetune_lr, steps_annealing),
              momentum=linspace(
                  momentum[0], momentum[0], steps_annealing
              ),
          ),
      ]
  
imports: import contextlib
  from collections import OrderedDict
  from itertools import chain, islice
  from math import cos, pi
  from typing import Dict, List, Optional, Tuple
  from poutyne.framework.callbacks.callbacks import Callback
label_desc: Use image node_id 1 for calling a global function with example usage: one_cycle_phases(steps, lr, momentum, finetune_lr, finetune_fraction) and returns: list