docstr: Returns all matching fingerprint entries associated with
  the given hash as parameter, if None is passed it returns all entries.
  
  :param fingerprint: part of a sha1 hash, in hexadecimal format
  :return: a list of fingerprint records stored in the db.
docstr_tok: ["Returns","all","matching","fingerprint","entries","associated","with","the","given","hash","as","parameter",",","if","None","is","passed","it","returns","all","entries",".",":","param","fingerprint",":","part","of","a","sha1","hash",",","in","hexadecimal","format",":","return",":","a","list","of","fingerprint","records","stored","in","the","db","."]
code: def query(self, fingerprint: str = None) -> List[Tuple]:
      """
      Returns all matching fingerprint entries associated with
      the given hash as parameter, if None is passed it returns all entries.
  
      :param fingerprint: part of a sha1 hash, in hexadecimal format
      :return: a list of fingerprint records stored in the db.
      """
      with self.cursor() as cur:
          if fingerprint:
              cur.execute(self.SELECT, (fingerprint,))
          else:  # select all if no key
              cur.execute(self.SELECT_ALL)
          return list(cur)
  
imports: import abc
  from typing import Dict, List, Tuple
  from dejavu.base_classes.base_database import BaseDatabase
label_desc: Use image node_id 14 for calling the CommonDatabase obj's underlying member method code with example usage: obj.query(fingerprint) and returns: list