docstr: Invoke newton through root_scalar()
docstr_tok: ["Invoke","newton","through","root_scalar","(",")"]
code: def test_newton_by_name(self):
      r"""Invoke newton through root_scalar()"""
      for f, f_1, f_2 in [(f1, f1_1, f1_2), (f2, f2_1, f2_2)]:
          r = root_scalar(
              f, method="newton", x0=3, fprime=f_1, xtol=1e-6
          )
          assert_allclose(f(r.root), 0, atol=1e-6)
  
imports: from __future__ import division, print_function, absolute_import
  import pytest
  from math import sqrt, exp, sin, cos
  from numpy.testing import assert_warns, assert_, assert_allclose, assert_equal, assert_array_equal
  import numpy
  from numpy import finfo, power, nan, isclose
  from scipy.optimize import zeros, newton, root_scalar
  from scipy._lib._util import getargspec_no_self
  from scipy.optimize._tstutils import get_tests, functions, fstrings
  from scipy._lib._numpy_compat import suppress_warnings
label_desc: Use image node_id 20 for calling the TestBasic obj's underlying member method code with example usage: obj.test_newton_by_name() without return types