code: def text_to_char_ngrams(
      text: str, n: int, *, pad: bool = False
  ) -> tuple[str, ...]:
      """
      Convert a text string into an ordered sequence of character ngrams.
  
      Args:
          text
          n: Number of characters to concatenate in each ``n``-gram.
          pad: If True, pad ``text`` by adding ``n - 1`` "_" characters on either side;
              if False, leave ``text`` as-is.
  
      Returns:
          Ordered sequence of character ngrams.
      """
      if pad is True and n > 1:
          pad_chars = "_" * (n - 1)
          text = f"{pad_chars}{text}{pad_chars}"
      return tuple(text[i : i + n] for i in range(len(text) - n + 1))
  
imports: from __future__ import annotations
  import inspect
  import logging
  import pathlib
  import sys
  import warnings
  from typing import Any, Callable, Collection, Iterable, Literal, Optional, Type, Union, cast
  from .None import errors
  from .None import types
label_desc: Use image node_id 15 for calling a global function with example usage: text_to_char_ngrams(text, n) and returns: tuple