class_docstr: Decorator that caches the value and derivative(s) of function each
  time it is called.
  
  This is a simplistic memoizer that calls and caches a single value
  of `f(x, *args)`.
  It assumes that `args` does not change between invocations.
  It supports the use case of a root-finder where `args` is fixed,
  `x` changes, and only rarely, if at all, does x assume the same value
  more than once.
class_docstr_tok: ["Decorator","that","caches","the","value","and","derivative","(","s",")","of","function","each","time","it","is","called",".","This","is","a","simplistic","memoizer","that","calls","and","caches","a","single","value","of","`","f","(","x",",","*","args",")","`",".","It","assumes","that","`","args","`","does","not","change","between","invocations",".","It","supports","the","use","case","of","a","root-finder","where","`","args","`","is","fixed",",","`","x","`","changes",",","and","only","rarely",",","if","at","all",",","does","x","assume","the","same","value","more","than","once","."]
code: def ncalls(self):
      return self.n_calls
  
file_path: scipy/scipy/optimize/_root_scalar.py
imports: import numpy
  from .None import _zeros_py
  from ._numdiff import approx_derivative
label_desc: Use image node_id 5 for calling the MemoizeDer obj's underlying member method code with example usage: obj.ncalls() and returns: self