code: def _fragment_3_1(norm_info, n0, tol, m_max=55, ell=2):
      """
      A helper function for the _expm_multiply_* functions.
  
      Parameters
      ----------
      norm_info : LazyOperatorNormInfo
          Information about norms of certain linear operators of interest.
      n0 : int
          Number of columns in the _expm_multiply_* B matrix.
      tol : float
          Expected to be
          :math:`2^{-24}` for single precision or
          :math:`2^{-53}` for double precision.
      m_max : int
          A value related to a bound.
      ell : int
          The number of columns used in the 1-norm approximation.
          This is usually taken to be small, maybe between 1 and 5.
  
      Returns
      -------
      best_m : int
          Related to bounds for error control.
      best_s : int
          Amount of scaling.
  
      Notes
      -----
      This is code fragment (3.1) in Al-Mohy and Higham (2011).
      The discussion of default values for m_max and ell
      is given between the definitions of equation (3.11)
      and the definition of equation (3.12).
  
      """
      if ell < 1:
          raise ValueError("expected ell to be a positive integer")
      best_m = None
      best_s = None
      if _condition_3_13(norm_info.onenorm(), n0, m_max, ell):
          for m, theta in _theta.items():
              s = int(np.ceil(norm_info.onenorm() / theta))
              if best_m is None or m * s < best_m * best_s:
                  best_m = m
                  best_s = s
      else:
          # Equation (3.11).
          for p in range(2, _compute_p_max(m_max) + 1):
              for m in range(p * (p - 1) - 1, m_max + 1):
                  if m in _theta:
                      s = _compute_cost_div_m(m, p, norm_info)
                      if best_m is None or m * s < best_m * best_s:
                          best_m = m
                          best_s = s
          best_s = max(best_s, 1)
      return best_m, best_s
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  import scipy.linalg
  import scipy.sparse.linalg
  from scipy.sparse.linalg import aslinearoperator
label_desc: Use image node_id 11 for calling a global function with example usage: _fragment_3_1(norm_info, n0, tol, m_max, ell) and returns: best_m,  best_s