code: def test_fmin_fn():
      try:
          client = Client()
      except OSError:
          raise SkipTest()
  
      client[:].use_cloudpickle()
  
      trials = IPythonTrials(client, "log")
      assert not trials._testing_fmin_was_called
  
      def simple_objective(args):
          import hyperopt
  
          return {"loss": args**2, "status": hyperopt.STATUS_OK}
  
      space = hyperopt.hp.uniform("x", 0, 1)
  
      minval = hyperopt.fmin(
          simple_objective,
          space=space,
          algo=hyperopt.tpe.suggest,
          max_evals=25,
          trials=trials,
      )
  
      assert minval["x"] < 0.2
      assert trials._testing_fmin_was_called
  
file_path: hyperopt/hyperopt/tests/unit/test_ipy.py
imports: import sys
  from nose import SkipTest
  from hyperopt.ipy import IPythonTrials
  import hyperopt.hp
  import hyperopt.tpe
  import hyperopt
label_desc: Use image node_id 2 for calling a global function with example usage: test_fmin_fn() and returns: dict