def lookup_hash_prefix(self, cues):
        """Lookup hash prefixes by cue (first 4 bytes of hash)

        Returns a tuple of (value, negative_cache_expired).
        """
        q = '''SELECT value, MAX(negative_expires_at < current_timestamp) AS negative_cache_expired
                FROM hash_prefix WHERE cue IN ({}) GROUP BY 1
        '''
        output = []
        with self.get_cursor() as dbc:
            dbc.execute(q.format(','.join(['?'] * len(cues))), [sqlite3.Binary(cue) for cue in cues])
            for h in dbc.fetchall():
                value, negative_cache_expired = h
                output.append((bytes(value), negative_cache_expired))
        return output
def lookup_hash_prefix ( self , cues ) : q = '''SELECT value, MAX(negative_expires_at < current_timestamp) AS negative_cache_expired
                FROM hash_prefix WHERE cue IN ({}) GROUP BY 1
        ''' output = [ ] with self . get_cursor ( ) as dbc : dbc . execute ( q . format ( ',' . join ( [ '?' ] * len ( cues ) ) ) , [ sqlite3 . Binary ( cue ) for cue in cues ] ) for h in dbc . fetchall ( ) : value , negative_cache_expired = h output . append ( ( bytes ( value ) , negative_cache_expired ) ) return output
Lookup hash prefixes by cue (first 4 bytes of hash)

        Returns a tuple of (value, negative_cache_expired).