code: def check_fit_args_fix(distfn, arg, rvs, method):
      with np.errstate(all="ignore"), npt.suppress_warnings() as sup:
          sup.filter(
              category=RuntimeWarning,
              message="The shape parameter of the erlang",
          )
  
          vals = distfn.fit(rvs, floc=0, method=method)
          vals2 = distfn.fit(rvs, fscale=1, method=method)
          npt.assert_(len(vals) == 2 + len(arg))
          npt.assert_(vals[-2] == 0)
          npt.assert_(vals2[-1] == 1)
          npt.assert_(len(vals2) == 2 + len(arg))
          if len(arg) > 0:
              vals3 = distfn.fit(rvs, f0=arg[0], method=method)
              npt.assert_(len(vals3) == 2 + len(arg))
              npt.assert_(vals3[0] == arg[0])
          if len(arg) > 1:
              vals4 = distfn.fit(rvs, f1=arg[1], method=method)
              npt.assert_(len(vals4) == 2 + len(arg))
              npt.assert_(vals4[1] == arg[1])
          if len(arg) > 2:
              vals5 = distfn.fit(rvs, f2=arg[2], method=method)
              npt.assert_(len(vals5) == 2 + len(arg))
              npt.assert_(vals5[2] == arg[2])
  
imports: import sys
  import numpy
  import numpy.testing
  import pytest
  from pytest import raises
  from scipy.integrate import IntegrationWarning
  import itertools
  from scipy import stats
  from .common_tests import check_normalization, check_moment, check_mean_expect, check_var_expect, check_skew_expect, check_kurt_expect, check_entropy, check_private_entropy, check_entropy_vect_scale, check_edge_support, check_named_args, check_random_state_property, check_meth_dtype, check_ppf_dtype, check_cmplx_deriv, check_pickling, check_rvs_broadcast, check_freezing, check_munp_expect
  from scipy.stats._distr_params import distcont
  from scipy.stats._distn_infrastructure import rv_continuous_frozen
label_desc: Use image node_id 35 for calling a global function with example usage: check_fit_args_fix(distfn, arg, rvs, method) without return types