code: def get_fonts(
      cache_dir=None,
      alphabet=string.ascii_letters + string.digits,
      exclude_smallcaps=False,
  ):
      """Download a set of pre-reviewed fonts.
  
      Args:
          cache_dir: Where to save the dataset. By default, data will be
              saved to ~/.keras-ocr.
          alphabet: An alphabet which we will use to exclude fonts
              that are missing relevant characters. By default, this is
              set to `string.ascii_letters + string.digits`.
          exclude_smallcaps: If True, fonts that are known to use
              the same glyph for lowercase and uppercase characters
              are excluded.
  
      Returns:
          A list of font filepaths.
      """
      if cache_dir is None:
          cache_dir = os.path.expanduser(
              os.path.join("~", ".keras-ocr")
          )
      fonts_zip_path = tools.download_and_verify(
          url="https://github.com/faustomorales/keras-ocr/releases/download/v0.8.4/fonts.zip",
          sha256="d4d90c27a9bc4bf8fff1d2c0a00cfb174c7d5d10f60ed29d5f149ef04d45b700",
          filename="fonts.zip",
          cache_dir=cache_dir,
      )
      fonts_dir = os.path.join(cache_dir, "fonts")
      if len(glob.glob(os.path.join(fonts_dir, "**/*.ttf"))) != 2746:
          print("Unzipping fonts ZIP file.")
          with zipfile.ZipFile(fonts_zip_path) as zfile:
              zfile.extractall(fonts_dir)
      font_filepaths = glob.glob(os.path.join(fonts_dir, "**/*.ttf"))
      if exclude_smallcaps:
          with open(
              tools.download_and_verify(
                  url="https://github.com/faustomorales/keras-ocr/releases/download/v0.8.4/fonts_smallcaps.txt",
                  sha256="6531c700523c687f02852087530d1ab3c7cc0b59891bbecc77726fbb0aabe68e",
                  filename="fonts_smallcaps.txt",
                  cache_dir=cache_dir,
              ),
              "r",
              encoding="utf8",
          ) as f:
              smallcaps_fonts = f.read().split("\n")
              smallcaps_fonts = [
                  origpath.replace("/", os.path.sep)
                  for origpath in smallcaps_fonts
              ]
              font_filepaths = [
                  filepath
                  for filepath in font_filepaths
                  if os.path.join(*filepath.split(os.sep)[-2:])
                  not in smallcaps_fonts
              ]
      if alphabet != "":
          font_filepaths = [
              filepath
              for filepath in tqdm.tqdm(
                  font_filepaths, desc="Filtering fonts."
              )
              if font_supports_alphabet(
                  filepath=filepath, alphabet=alphabet
              )
          ]
      return font_filepaths
  
imports: import os
  import math
  import glob
  import typing
  import random
  import zipfile
  import string
  import itertools
  import cv2
  import tqdm
  import numpy
  import essential_generators
  import PIL.Image
  import PIL.ImageDraw
  import PIL.ImageFont
  import fontTools.ttLib
  from .None import tools
label_desc: Use image node_id 8 for calling a global function with example usage: get_fonts(cache_dir, alphabet, exclude_smallcaps) and returns: font_filepaths