code: def get_available_resource(self, username, rtype, rid_blacklist=None):
      rids = []
      if rid_blacklist:
          # Initial approach:
          # self.cursor.execute("SELECT rid FROM resource WHERE status = 'free' AND type = ? AND rid NOT IN ?;", (rtype, rid_blacklist))
          # However, this does not work with sqlite3, so the following approach was ultimately selected
          self.cursor.execute(
              "SELECT rid FROM resource WHERE status = 'free' AND type = ? AND rid NOT IN ({});".format(
                  ",".join("?" * len(rid_blacklist))
              ),
              (rtype,) + tuple(rid_blacklist),
          )
          rids = [i[0] for i in self.cursor.fetchall()]
      if not rids:
          # An attempt was made to filter out resources, but this was not possible (the only
          # available resource are the ones blacklisted)
          self.cursor.execute(
              "SELECT rid FROM resource WHERE status = 'free' AND instr(?, type) != 0;",
              (rtype,),
          )
          rids = [i[0] for i in self.cursor.fetchall()]
      return rids
  
imports: import logging
  import re
  import sqlite3
  import threading
  from time import sleep
  import json
  from datetime import datetime
  from .AbstractConnector import AbstractConnector
label_desc: Use image node_id 13 for calling the SQLiteConnector obj's underlying member method code with example usage: obj.get_available_resource(username, rtype, rid_blacklist) and returns: rids