code: def log_to_database(db):
      """Save the tuning records to a database object.
  
      Parameters
      ----------
      db: Database
          The database
      """
  
      def _callback(_, inputs, results):
          """Callback implementation"""
          for inp, result in zip(inputs, results):
              db.save(inp, result)
  
      return _callback
  
file_path: tvm/python/tvm/autotvm/tuner/callback.py
imports: import sys
  import time
  import logging
  import numpy
  from ..None import record
  from ..utils import format_si_prefix
label_desc: Use image node_id 2 for calling a global function with example usage: log_to_database(db) and returns: _callback