code: def _get_characters(sentence: str, whitespace: bool) -> List[str]:
      """Split sentence into individual characters.
  
      Args:
          sentence: An input sentence to split.
          whitespace: An indication whether to keep whitespaces during character n-gram extraction.
  
      Return:
          A list of separated characters.
  
      """
      if whitespace:
          return list(sentence)
      return list(sentence.strip().replace(" ", ""))
  
file_path: torchmetrics/src/torchmetrics/functional/text/chrf.py
imports: from collections import defaultdict
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  import torch
  from torch import Tensor, tensor
  from torchmetrics.functional.text.helper import _validate_inputs
label_desc: Use image node_id 2 for calling a global function with example usage: _get_characters(sentence, whitespace) and returns: list, list