code: def test_cer_whitespace(self):
      refs = ["were wolf"]
      preds = ["werewolf"]
      # S = 0, D = 0, I = 1, N = 9, CER = 1 / 9
      char_error_rate = cer.compute(predictions=preds, references=refs)
      self.assertTrue(abs(char_error_rate - 0.1111111) < 1e-6)
  
      refs = ["werewolf"]
      preds = ["weae     wolf"]
      # S = 1, D = 1, I = 0, N = 8, CER = 0.25
      char_error_rate = cer.compute(predictions=preds, references=refs)
      self.assertTrue(abs(char_error_rate - 0.25) < 1e-6)
  
      # consecutive whitespaces case 1
      refs = ["were wolf"]
      preds = ["were               wolf"]
      # S = 0, D = 0, I = 0, N = 9, CER = 0
      char_error_rate = cer.compute(predictions=preds, references=refs)
      self.assertTrue(abs(char_error_rate - 0.0) < 1e-6)
  
      # consecutive whitespaces case 2
      refs = ["were   wolf"]
      preds = ["were               wolf"]
      # S = 0, D = 0, I = 0, N = 9, CER = 0
      char_error_rate = cer.compute(predictions=preds, references=refs)
      self.assertTrue(abs(char_error_rate - 0.0) < 1e-6)
  
file_path: datasets/metrics/cer/test_cer.py
imports: import unittest
  from cer import CER
label_desc: Use image node_id 2 for calling the TestCER obj's underlying member method code with example usage: obj.test_cer_whitespace() without return types