code: def test_array_newton_failures():
      """Test that array newton fails as expected"""
      # p = 0.68  # [MPa]
      # dp = -0.068 * 1e6  # [Pa]
      # T = 323  # [K]
      diameter = 0.10  # [m]
      # L = 100  # [m]
      roughness = 0.00015  # [m]
      rho = 988.1  # [kg/m**3]
      mu = 5.4790e-04  # [Pa*s]
      u = 2.488  # [m/s]
      reynolds_number = rho * u * diameter / mu  # Reynolds number
  
      def colebrook_eqn(darcy_friction, re, dia):
          return 1 / np.sqrt(darcy_friction) + 2 * np.log10(
              roughness / 3.7 / dia
              + 2.51 / re / np.sqrt(darcy_friction)
          )
  
      # only some failures
      with pytest.warns(RuntimeWarning):
          result = zeros.newton(
              colebrook_eqn,
              x0=[0.01, 0.2, 0.02223, 0.3],
              maxiter=2,
              args=[reynolds_number, diameter],
              full_output=True,
          )
          assert not result.converged.all()
      # they all fail
      with pytest.raises(RuntimeError):
          result = zeros.newton(
              colebrook_eqn,
              x0=[0.01] * 2,
              maxiter=2,
              args=[reynolds_number, diameter],
              full_output=True,
          )
  
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 12 for calling a global function with example usage: test_array_newton_failures() and returns: unknown