code: def db_cursor() -> Generator[psycopg.Cursor, None, None]:
      conn = psycopg.connect(
          dbname=DB_NAME,
          user=DB_USERNAME,
          password=DB_PASSWORD,
          host=DB_HOST,
          port=DB_PORT,
      )
      conn.cursor_factory = LoggingCursor
      cur = conn.cursor()
      yield cur
      conn.close()
  
file_path: determined/tools/scripts/replicate-metrics.py
imports: import concurrent.futures
  import contextlib
  import os
  import time
  from typing import Any, Dict, Generator, List, Set, Tuple, Union
  import psycopg
  from psycopg import sql
label_desc: Use image node_id 1 for calling a global function with example usage: db_cursor() without return types