code: def check_convergence(
      p_new: np.ndarray,
      p_old: np.ndarray,
      turnbull_lookup: Dict[interval, List[interval]],
      weights: np.ndarray,
      tol: float,
      i: int,
      verbose=False,
  ) -> bool:
      old_ll = log_likelihood(p_old, turnbull_lookup, weights)
      new_ll = log_likelihood(p_new, turnbull_lookup, weights)
      delta = new_ll - old_ll
      if verbose:
          print("Iteration %d " % i)
          print("   delta log-likelihood: %.10f" % delta)
          print(
              "   log-like:             %.6f"
              % log_likelihood(p_new, turnbull_lookup, weights)
          )
      if (delta < tol) and (delta >= 0):
          return True
      return False
  
imports: from collections import defaultdict, namedtuple
  import warnings
  import numpy
  from numpy.linalg import norm
  import pandas
  from lifelines.exceptions import ConvergenceWarning
  from typing import *
label_desc: Use image node_id 7 for calling a global function with example usage: check_convergence(p_new, p_old, turnbull_lookup, weights, tol, i, verbose) and returns: False, True