code: def __init__(
      self,
      text_len: int,
      text_change_nth: Optional[int] = None,
      fonts: Optional[List[Tuple[Any, Optional[str]]]] = None,
      fontscales: Optional[Tuple[float, float]] = None,
      colors: Optional[List[Tuple[int, int, int]]] = None,
      thickness: Optional[int] = None,
      random_movement: bool = False,
      topleft: Optional[Tuple[float, float]] = None,
      bottomright: Optional[Tuple[float, float]] = None,
      **kwargs,
  ) -> None:
      assert text_len > 0, "Text length must be greater than zero"
      assert (
          text_change_nth is None or text_change_nth > 0
      ), "`text_change_nth` must be greater than zero"
      assert fonts is None or all(
          (
              isinstance(font, (str, ImageFont.ImageFont))
              or (font in CV2_FONTS)
          )
          and (chars is None or isinstance(chars, str))
          for font, chars in fonts
      ), "Fonts must be either None or a list of tuples of font (cv2 font, PIL ImageFont, or str path to a .ttf file) & chars file (str path or None)"
      assert fontscales is None or (
          fontscales[0] > 0 and fontscales[1] > fontscales[0]
      ), "Fontscale ranges must be greater than zero and the second value must be greater than the first"  # noqa: B950
      assert thickness is None or (
          type(thickness) == int and thickness > 0
      ), "Invalid thickness provided: must be set to None or be an integer greater than zero"  # noqa: B950
  
      super().__init__(
          1, random_movement, topleft, bottomright, **kwargs
      )
  
      self.texts = self.random_texts(text_len, text_change_nth)
      self.fonts = self.random_fonts(fonts)
      self.fontscales = self.random_fontscales(fontscales)
      self.colors = BaseCV2Augmenter.random_colors(colors)
      self.thickness = self.random_thickness(thickness)
  
file_path: AugLy/augly/video/augmenters/cv2/text.py
imports: import pickle
  import random
  import string
  from typing import Any, Iterator, List, Optional, Tuple
  import cv2
  import numpy
  from augly.utils import pathmgr
  from augly.video.augmenters.cv2.base_augmenter import BaseCV2Augmenter
  from PIL import Image, ImageDraw, ImageFont
label_desc: Use image node_id 1 to create a new VideoDistractorByText object from inherited base classes: BaseCV2Augmenter with example: obj = VideoDistractorByText(text_len, text_change_nth, fonts, fontscales, colors, thickness, random_movement, topleft, bottomright)