code: def make_cursor(path, init_statements=(), _connectioncache={}):
      
      connection = _connectioncache.get(path)
      if not connection:
          is_new = not os.path.exists(path) or not os.path.getsize(path)
          try: is_new and os.makedirs(os.path.dirname(path))
          except OSError: pass
          connection = sqlite3.connect(path, isolation_level=None,
              check_same_thread=False, detect_types=sqlite3.PARSE_DECLTYPES)
          for x in init_statements or (): connection.execute(x)
          try: is_new and ":memory:" not in path.lower() and os.chmod(path, 0707)
          except OSError: pass
          connection.row_factory = lambda cur, row: dict(sqlite3.Row(cur, row))
          _connectioncache[path] = connection
      return connection.cursor()
docs: Returns a cursor to the database, making new connection if not cached.