code: def test_npmle_with_weights():
      sol = np.array([0.2051282, 0.4102564, 0.0961539, 0.2884615])
  
      left, right = [1, 8, 8, 7, 7, 17, 37, 46, 46, 45], [
          7,
          8,
          10,
          16,
          14,
          np.inf,
          44,
          np.inf,
          np.inf,
          np.inf,
      ]
      weights = np.array([2, 2, 2, 1, 1, 1, 1, 1, 1, 1])
      npt.assert_allclose(
          npmle(left, right, weights=weights)[0], sol, rtol=1e-4
      )
  
      left, right = [1, 1, 8, 8, 8, 8, 7, 7, 17, 37, 46, 46, 45], [
          7,
          7,
          8,
          8,
          10,
          10,
          16,
          14,
          np.inf,
          44,
          np.inf,
          np.inf,
          np.inf,
      ]
      npt.assert_allclose(npmle(left, right)[0], sol, rtol=1e-4)
  
file_path: lifelines/lifelines/tests/test_npmle.py
imports: import pytest
  from lifelines.fitters.npmle import npmle, is_subset, create_turnbull_intervals, interval, reconstruct_survival_function
  from numpy import testing
  from lifelines.datasets import load_mice
  from lifelines import KaplanMeierFitter
  import numpy
  import pandas
label_desc: Use image node_id 5 for calling a global function with example usage: test_npmle_with_weights() without return types