code: def test_weights1():
      # tm = c(1, 3, 5, 6, 7, 8, 8, 9, 3, 4, 1, 3, 2)
      # st = c(1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0)
      # wt = c(1, 2, 3, 2, 3, 1, 2, 1, 1, 2, 2, 3, 1)
      # library(survival)
      # sf = survfit(Surv(tm, st) ~ 1, weights=wt, err='tsiatis')
  
      tm = np.r_[1, 3, 5, 6, 7, 8, 8, 9, 3, 4, 1, 3, 2]
      st = np.r_[1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0]
      wt = np.r_[1, 2, 3, 2, 3, 1, 2, 1, 1, 2, 2, 3, 1]
  
      sf = SurvfuncRight(tm, st, freq_weights=wt)
      assert_allclose(sf.surv_times, np.r_[1, 3, 6, 7, 9])
      assert_allclose(
          sf.surv_prob,
          np.r_[0.875, 0.65625, 0.51041667, 0.29166667, 0.0],
      )
      assert_allclose(
          sf.surv_prob_se,
          np.r_[
              0.07216878, 0.13307266, 0.20591185, 0.3219071, 1.05053519
          ],
      )
  
imports: import os
  import numpy
  from statsmodels.duration.survfunc import SurvfuncRight, survdiff, plot_survfunc, CumIncidenceRight
  from numpy.testing import assert_allclose
  import pandas
  import pytest
label_desc: Use image node_id 9 for calling a global function with example usage: test_weights1() without return types