code: def test_init(self):
      dict_file = "dicts/lower_english_digits.txt"
      dict_cfg = dict(
          type="Dictionary",
          dict_file=dict_file,
          with_start=True,
          with_end=True,
          same_start_end=True,
          with_padding=True,
          with_unknown=False,
      )
  
      with self.assertRaises(AssertionError):
          CEModuleLoss(dict_cfg, reduction=1)
      with self.assertRaises(AssertionError):
          CEModuleLoss(dict_cfg, reduction="avg")
      with self.assertRaises(AssertionError):
          CEModuleLoss(dict_cfg, flatten=1)
      with self.assertRaises(AssertionError):
          CEModuleLoss(dict_cfg, ignore_first_char=1)
      with self.assertRaises(AssertionError):
          CEModuleLoss(dict_cfg, ignore_char=["ignore"])
      ce_loss = CEModuleLoss(dict_cfg)
      self.assertEqual(ce_loss.ignore_index, 37)
      ce_loss = CEModuleLoss(dict_cfg, ignore_char=-1)
      self.assertEqual(ce_loss.ignore_index, -1)
      # with self.assertRaises(ValueError):
      with self.assertWarns(UserWarning):
          ce_loss = CEModuleLoss(dict_cfg, ignore_char="ignore")
      with self.assertWarns(UserWarning):
          ce_loss = CEModuleLoss(
              dict(
                  type="Dictionary",
                  dict_file=dict_file,
                  with_unknown=True,
              ),
              ignore_char="M",
              pad_with="none",
          )
      with self.assertWarns(UserWarning):
          ce_loss = CEModuleLoss(
              dict(
                  type="Dictionary",
                  dict_file=dict_file,
                  with_unknown=False,
              ),
              ignore_char="M",
              pad_with="none",
          )
      with self.assertWarns(UserWarning):
          ce_loss = CEModuleLoss(
              dict(
                  type="Dictionary",
                  dict_file=dict_file,
                  with_unknown=False,
              ),
              ignore_char="unknown",
              pad_with="none",
          )
      ce_loss = CEModuleLoss(dict_cfg, ignore_char="1")
      self.assertEqual(ce_loss.ignore_index, 1)
  
file_path: mmocr/tests/test_models/test_textrecog/test_module_losses/test_ce_module_loss.py
imports: from unittest import TestCase
  import torch
  from mmengine.structures import LabelData
  from mmocr.models.textrecog.module_losses import CEModuleLoss
  from mmocr.structures import TextRecogDataSample
label_desc: Use image node_id 2 for calling the TestCEModuleLoss obj's underlying member method code with example usage: obj.test_init() without return types