code: def test_wandblogger():
      """Test logging to Weights & Biases."""
      # Load dataset and Models
      tasks, datasets, transformers = dc.molnet.load_delaney(
          featurizer="ECFP", splitter="random"
      )
      train_dataset, valid_dataset, test_dataset = datasets
      metric = dc.metrics.Metric(dc.metrics.pearson_r2_score)
      wandblogger = dc.models.WandbLogger(
          anonymous="allow", save_run_history=True
      )
  
      keras_model = tf.keras.Sequential(
          [
              tf.keras.layers.Dense(10, activation="relu"),
              tf.keras.layers.Dense(1),
          ]
      )
      model = dc.models.KerasModel(
          keras_model,
          dc.models.losses.L2Loss(),
          wandb_logger=wandblogger,
      )
      vc_train = dc.models.ValidationCallback(
          train_dataset, 1, [metric]
      )
      vc_valid = dc.models.ValidationCallback(
          valid_dataset, 1, [metric]
      )
      model.fit(
          train_dataset, nb_epoch=10, callbacks=[vc_train, vc_valid]
      )
      # call model.fit again to test multiple fit() calls
      model.fit(
          train_dataset, nb_epoch=10, callbacks=[vc_train, vc_valid]
      )
      wandblogger.finish()
  
      run_data = wandblogger.run_history
      valid_score = model.evaluate(
          valid_dataset, [metric], transformers
      )
  
      assert math.isclose(
          valid_score["pearson_r2_score"],
          run_data["eval/pearson_r2_score_(1)"],
          abs_tol=0.0005,
      )
  
file_path: deepchem/deepchem/models/tests/test_kerasmodel.py
imports: import os
  import math
  import deepchem
  import numpy
  import unittest
  import pytest
label_desc: Use image node_id 11 for calling a global function with example usage: test_wandblogger() without return types