title: The number of times a function gets called
body: <p>Let's say I want to integrate <code>x**2</code> from 0 to 1. I do it using the <code>scipy.integrate.quad</code>: </p>
  
  <pre><code>from scipy import integrate
  def f(x): return x**2
  I = integrate.quad(f, 0, 1)[0]
  print(I)
  </code></pre>
  
  <p><strong>Questions:</strong> Is there any way to know how many times the user-defined function <code>f</code> gets called by the <code>quad</code>? I want to do it as I am interested to know how many have been utilized by <code>quad</code> to evaluate the integral. </p>