code: def test_X_normalization_transformer():
      """Tests normalization transformer."""
      solubility_dataset = load_solubility_data()
      normalization_transformer = dc.trans.NormalizationTransformer(
          transform_X=True, dataset=solubility_dataset
      )
      X, y, w, ids = (
          solubility_dataset.X,
          solubility_dataset.y,
          solubility_dataset.w,
          solubility_dataset.ids,
      )
      solubility_dataset = normalization_transformer.transform(
          solubility_dataset
      )
      X_t, y_t, w_t, ids_t = (
          solubility_dataset.X,
          solubility_dataset.y,
          solubility_dataset.w,
          solubility_dataset.ids,
      )
      # Check ids are unchanged.
      for id_elt, id_t_elt in zip(ids, ids_t):
          assert id_elt == id_t_elt
      # Check y is unchanged since this is a X transformer
      np.testing.assert_allclose(y, y_t)
      # Check w is unchanged since this is a y transformer
      np.testing.assert_allclose(w, w_t)
      # Check that X_t has zero mean, unit std.
      # np.set_printoptions(threshold='nan')
      mean = X_t.mean(axis=0)
      assert np.amax(np.abs(mean - np.zeros_like(mean))) < 1e-7
      orig_std_array = X.std(axis=0)
      std_array = X_t.std(axis=0)
      # Entries with zero std are not normalized
      for orig_std, std in zip(orig_std_array, std_array):
          if not np.isclose(orig_std, 0):
              assert np.isclose(std, 1)
  
      # Check that untransform does the right thing.
      np.testing.assert_allclose(
          normalization_transformer.untransform(X_t), X, atol=1e-7
      )
  
file_path: deepchem/deepchem/trans/tests/test_normalization.py
imports: import os
  import deepchem
  import numpy
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: test_X_normalization_transformer() without return types