code: def cumulative_distribution(distribution):
      """Returns normalized cumulative distribution from discrete distribution."""
  
      cdf = [0.0]
      psum = sum(distribution)
      for i in range(len(distribution)):
          cdf.append(cdf[i] + distribution[i] / psum)
      return cdf
  
file_path: networkx/networkx/utils/random_sequence.py
imports: import networkx
  from networkx.utils import py_random_state
label_desc: Use image node_id 3 for calling a global function with example usage: cumulative_distribution(distribution) and returns: cdf