parameters: (cache, estimator, method, *args, **kwargs)
docstring: Call estimator with method and args and kwargs.
docstring_summary: Call estimator with method and args and kwargs.
docstring_tokens: Call estimator with method and args and kwargs .
function: def _cached_call(cache, estimator, method, *args, **kwargs):
      """Call estimator with method and args and kwargs."""
      if cache is None:
          return getattr(estimator, method)(*args, **kwargs)
  
      try:
          return cache[method]
      except KeyError:
          result = getattr(estimator, method)(*args, **kwargs)
          cache[method] = result
          return result
function_tokens: def _cached_call ( cache , estimator , method , * args , * * kwargs ) : if cache is None : return getattr ( estimator , method ) ( * args , * * kwargs ) try : return cache [ method ] except KeyError : result = getattr ( estimator , method ) ( * args , * * kwargs ) cache [ method ] = result return result