code: def _adapt_bufs(bufs):
      # this is *horrible*
      # copy buffers into single list and pickle it:
      if bufs and isinstance(bufs[0], (bytes, memoryview)):
          return sqlite3.Binary(
              pickle.dumps(
                  [memoryview(buf).tobytes() for buf in bufs], -1
              )
          )
      elif bufs:
          return bufs
      else:
          return None
  
imports: import json
  import os
  from datetime import datetime
  from dateutil.parser import parse
  from tornado import ioloop
  from traitlets import Dict, Instance, List, Unicode
  from ..util import ensure_timezone, extract_dates
  from .dictdb import BaseDB
label_desc: Use image node_id 3 for calling a global function with example usage: _adapt_bufs(bufs) and returns: sqlite3, bufs, None