code: def _preprocess_ja(sentence: str) -> str:
      """Preprocess japanese sentences.
  
      Copy from https://github.com/rwth-i6/ExtendedEditDistance/blob/master/util.py.
  
      Raises:
          ValueError: If input sentence is not of a type `str`.
  
      """
      if not isinstance(sentence, str):
          raise ValueError(
              f"Only strings allowed during preprocessing step, found {type(sentence)} instead"
          )
  
      sentence = sentence.rstrip()  # trailing space, tab, newline
      # characters which look identical actually are identical
      return unicodedata.normalize("NFKC", sentence)
  
file_path: torchmetrics/src/torchmetrics/functional/text/eed.py
imports: import re
  import unicodedata
  from math import inf
  from typing import List, Optional, Sequence, Tuple, Union
  from torch import Tensor, stack, tensor
  from typing_extensions import Literal
  from torchmetrics.functional.text.helper import _validate_inputs
label_desc: Use image node_id 4 for calling a global function with example usage: _preprocess_ja(sentence) and returns: unicodedata