code: def test_methods_with_lists(method, distname, args):
      # Test that the discrete distributions can accept Python lists
      # as arguments.
      try:
          dist = getattr(stats, distname)
      except TypeError:
          return
      if method in ["ppf", "isf"]:
          z = [0.1, 0.2]
      else:
          z = [0, 1]
      p2 = [[p] * 2 for p in args]
      loc = [0, 1]
      result = dist.pmf(z, *p2, loc=loc)
      npt.assert_allclose(
          result,
          [dist.pmf(*v) for v in zip(z, *p2, loc)],
          rtol=1e-15,
          atol=1e-15,
      )
  
imports: import numpy.testing
  from numpy.testing import assert_allclose
  import numpy
  import pytest
  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_edge_support, check_named_args, check_random_state_property, check_pickling, check_rvs_broadcast, check_freezing
  from scipy.stats._distr_params import distdiscrete, invdistdiscrete
  from scipy.stats._distn_infrastructure import rv_discrete_frozen
label_desc: Use image node_id 13 for calling a global function with example usage: test_methods_with_lists(method, distname, args) without return types