code: def check_groupby_pattern(
      table_ref: TableRef, groupby_string: str
  ) -> None:
      # match the pattern of group by clause (e.g., 16 frames or 8 samples)
      pattern = re.search(
          r"^\d+\s*(?:frames|samples|paragraphs)$", groupby_string
      )
      # if valid pattern
      if not pattern:
          err_msg = "Incorrect GROUP BY pattern: {}".format(
              groupby_string
          )
          raise BinderError(err_msg)
      match_string = pattern.group(0)
      suffix_string = re.sub(r"^\d+\s*", "", match_string)
  
      if suffix_string not in ["frames", "samples", "paragraphs"]:
          err_msg = "Grouping only supported by frames for videos, by samples for audio, and by paragraphs for documents"
          raise BinderError(err_msg)
  
      if suffix_string == "frames" and not is_video_table(
          table_ref.table.table_obj
      ):
          err_msg = "Grouping by frames only supported for videos"
          raise BinderError(err_msg)
  
      if suffix_string == "samples" and not is_video_table(
          table_ref.table.table_obj
      ):
          err_msg = "Grouping by samples only supported for videos"
          raise BinderError(err_msg)
  
      if suffix_string == "paragraphs" and not is_pdf_table(
          table_ref.table.table_obj
      ):
          err_msg = (
              "Grouping by paragraphs only supported for pdf tables"
          )
          raise BinderError(err_msg)
  
imports: from __future__ import annotations
  import re
  from typing import TYPE_CHECKING, List
  import pandas
  from evadb.catalog.catalog_type import ColumnType, TableType
  from evadb.catalog.catalog_utils import get_video_table_column_definitions, is_document_table, is_pdf_table, is_string_col, is_video_table
  from evadb.catalog.models.column_catalog import ColumnCatalogEntry
  from evadb.catalog.models.table_catalog import TableCatalogEntry
  from evadb.catalog.sql_config import IDENTIFIER_COLUMN
  from evadb.catalog.sql_config import ROW_NUM_COLUMN
  from evadb.expression.abstract_expression import AbstractExpression, ExpressionType
  from evadb.expression.function_expression import FunctionExpression
  from evadb.expression.tuple_value_expression import TupleValueExpression
  from evadb.parser.alias import Alias
  from evadb.parser.create_statement import ColumnDefinition
  from evadb.parser.table_ref import TableInfo, TableRef
  from evadb.third_party.databases.interface import get_database_handler
  from evadb.utils.logging_manager import logger
label_desc: Use image node_id 8 for calling a global function with example usage: check_groupby_pattern(table_ref, groupby_string) without return types