class_docstr: pass a custom callback function
  
  This makes sure it's being used. It also returns True after 10
  steps to ensure that it's stopping early.
class_docstr_tok: ["pass","a","custom","callback","function","This","makes","sure","it","'s","being","used",".","It","also","returns","True","after","10","steps","to","ensure","that","it","'s","stopping","early","."]
code: def __init__(self):
      self.been_called = False
      self.ncalls = 0
  
imports: import copy
  from numpy.testing import assert_almost_equal, assert_equal, assert_, assert_allclose
  import pytest
  from pytest import raises
  import numpy
  from numpy import cos, sin
  from scipy.optimize import basinhopping, OptimizeResult
  from scipy.optimize._basinhopping import Storage, RandomDisplacement, Metropolis, AdaptiveStepsize
label_desc: Use image node_id 1 to create a new MyCallBack object  with example: obj = MyCallBack()