code: def cprint(
      printable: Union[Any, str],
      style: Optional[str] = None,
      black_format: bool = False,
  ) -> None:
      """Print TVMScript string with Pygments highlight and Black auto-formatting.
  
      Parameters
      ----------
      printable : Union[IRModule, PrimFunc, str]
  
          The TVMScript to be printed
  
      style : str, optional
  
          Pygmentize printing style, auto-detected if None.
  
      black_format: bool
  
          If true, use the formatter Black to format the TVMScript
  
      Notes
      -----
  
      The style parameter follows the Pygments style names or Style objects. Three
      built-in styles are extended: "light", "dark" and "ansi". By default, "light"
      will be used for notebook environment and terminal style will be "ansi" for
      better style consistency. As an fallback when the optional Pygment library is
      not installed, plain text will be printed with a one-time warning to suggest
      installing the Pygment library. Other Pygment styles can be found in
      https://pygments.org/styles/
  
      The default pygmentize style can also be set with the environment
      variable "TVM_PYGMENTIZE_STYLE".
      """
      if hasattr(printable, "script") and callable(
          getattr(printable, "script")
      ):
          printable = printable.script()
      elif not isinstance(printable, str):
          raise TypeError(
              f"Only can print strings or objects with `script` method, but got: {type(printable)}"
          )
  
      if black_format:
          printable = _format(printable)
  
      is_in_notebook = (
          "ipykernel" in sys.modules
      )  # in notebook env (support html display).
  
      style = _get_pygments_style(style, is_in_notebook)
  
      if style is None:
          print(printable)
          return
  
      # pylint: disable=import-outside-toplevel
      from pygments import highlight
      from pygments.formatters import (
          HtmlFormatter,
          Terminal256Formatter,
      )
      from pygments.lexers.python import Python3Lexer
  
      if is_in_notebook:
          from IPython import (
              display,
          )  # pylint: disable=import-outside-toplevel
  
          formatter = HtmlFormatter(style=style)
          formatter.noclasses = True  # inline styles
          html = highlight(printable, Python3Lexer(), formatter)
          display.display(display.HTML(html))
      else:
          print(
              highlight(
                  printable,
                  Python3Lexer(),
                  Terminal256Formatter(style=style),
              )
          )
  
imports: import os
  import sys
  import warnings
  from typing import Any, Optional, Union
label_desc: Use image node_id 1 for calling a global function with example usage: cprint(printable, style, black_format) without return types