class_docstr: Object to wrap user cost function for optimize.brute, allowing picklability
class_docstr_tok: ["Object","to","wrap","user","cost","function","for","optimize.brute",",","allowing","picklability"]
code: def __call__(self, x):
      # flatten needed for one dimensional case.
      return self.f(np.asarray(x).flatten(), *self.args)
  
imports: import warnings
  import sys
  from numpy import atleast_1d, eye, argmin, zeros, shape, squeeze, asarray, sqrt, Inf, asfarray, isinf
  import numpy
  from .linesearch import line_search_wolfe1, line_search_wolfe2, line_search_wolfe2, LineSearchWarning
  from ._numdiff import approx_derivative
  from scipy._lib._util import getfullargspec_no_self
  from scipy._lib._util import MapWrapper
  from scipy.optimize._differentiable_functions import ScalarFunction, FD_METHODS
label_desc: Use image node_id 2 for calling the _Brute_Wrapper obj's underlying member method code with example usage: obj.__call__(x) and returns: self