code: def log_likelihood(
      p: np.ndarray, turnbull_interval_lookup, weights
  ) -> float:
      P = cumulative_sum(p)
      ix = np.array(list(turnbull_interval_lookup.values()))
      return (weights * np.log(P[ix[:, 1] + 1] - P[ix[:, 0]])).sum()
  
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 14 for calling a global function with example usage: log_likelihood(p, turnbull_interval_lookup, weights) and returns: unknown