code: def test_is_nan_mark_as_invalid(tmp_path):
      oracle = OracleStub(
          directory=tmp_path,
          objective="val_loss",
          max_retries_per_trial=1,
      )
      trial = oracle.create_trial(tuner_id="a")
      oracle.update_trial(
          trial.trial_id, metrics={"val_loss": float("nan")}
      )
      trial.status = trial_module.TrialStatus.COMPLETED
      trial.message = "error1"
      oracle.end_trial(trial)
      assert (
          oracle.trials[trial.trial_id].status
          == trial_module.TrialStatus.INVALID
      )
  
imports: import datetime
  import threading
  import time
  import numpy
  import pytest
  import keras_tuner
  from keras_tuner.engine import oracle
  from keras_tuner.engine import trial
  from keras_tuner.tuners import gridsearch
label_desc: Use image node_id 14 for calling a global function with example usage: test_is_nan_mark_as_invalid(tmp_path) without return types