code: def instrument_function_expression_cost(
      expr: Union[AbstractExpression, List[AbstractExpression]],
      catalog: "CatalogManager",
  ):
      """We are expecting an instance of a catalog. An optimization can be to avoid creating a catalog instance if there is no function expression. An easy fix is to pass the function handler and create the catalog instance only if there is a function expression. In the past, this was problematic because of Ray. We can revisit it again."""
  
      if expr is None:
          return
  
      list_expr = expr
      if not isinstance(expr, list):
          list_expr = [expr]
  
      # persist stats of function expression
      for expr in list_expr:
          for func_expr in expr.find_all(FunctionExpression):
              if func_expr.function_obj and func_expr._stats:
                  function_id = func_expr.function_obj.row_id
                  catalog.upsert_function_cost_catalog_entry(
                      function_id,
                      func_expr.function_obj.name,
                      func_expr._stats.prev_cost,
                  )
  
imports: import glob
  import os
  from pathlib import Path
  from typing import TYPE_CHECKING, Generator, List, Union
  from evadb.catalog.catalog_utils import xform_column_definitions_to_catalog_entries
  from evadb.catalog.models.utils import TableCatalogEntry
  from evadb.parser.create_statement import ColumnDefinition
  from evadb.catalog.catalog_type import TableType, VectorStoreType
  from evadb.expression.abstract_expression import AbstractExpression
  from evadb.expression.function_expression import FunctionExpression
  from evadb.models.storage.batch import Batch
  from evadb.parser.table_ref import TableInfo
  from evadb.parser.types import FileFormatType
  from evadb.readers.document.registry import SUPPORTED_TYPES
  from evadb.utils.generic_utils import try_to_import_cv2
  from evadb.utils.logging_manager import logger
label_desc: Use image node_id 1 for calling a global function with example usage: instrument_function_expression_cost(expr, catalog) without return types