code: def fit_toy_potential(orbit, force_harmonic_oscillator=False):
      
      circulation = orbit.circulation()
      if np.any(circulation == 1) and not force_harmonic_oscillator:  # tube orbit
          logger.debug("===== Tube orbit =====")
          logger.debug("Using Isochrone toy potential")
  
          toy_potential = fit_isochrone(orbit)
          logger.debug("Best m={}, b={}".format(toy_potential.parameters['m'],
                                                toy_potential.parameters['b']))
  
      else:  # box orbit
          logger.debug("===== Box orbit =====")
          logger.debug("Using triaxial harmonic oscillator toy potential")
  
          toy_potential = fit_harmonic_oscillator(orbit)
          logger.debug("Best omegas ({})"
                       .format(toy_potential.parameters['omega']))
  
      return toy_potential
docs: Fit a best fitting toy potential to the orbit provided. If the orbit is a
      tube (loop) orbit, use the Isochrone potential. If the orbit is a box
      potential, use the harmonic oscillator potential. An option is available to
      force using the harmonic oscillator (`force_harmonic_oscillator`).
  
      See the docstrings for ~`gala.dynamics.fit_isochrone()` and
      ~`gala.dynamics.fit_harmonic_oscillator()` for more information.
  
      Parameters
      ----------
      orbit : `~gala.dynamics.Orbit`
      force_harmonic_oscillator : bool (optional)
          Force using the harmonic oscillator potential as the toy potential.
  
      Returns
      -------
      potential : :class:`~gala.potential.IsochronePotential` or :class:`~gala.potential.HarmonicOscillatorPotential`
          The best-fit potential object.