def _get_chain_list(cursor, varname):
 cursor.execute('SELECT DISTINCT chain FROM [{}]'.format(varname))
 chains = [chain[0] for chain in cursor.fetchall()]
 chains.sort()
 return chains

def _get_chain_list ( cursor , varname ) : cursor . execute ( 'SELECT DISTINCT chain FROM [{}]' . format ( varname ) ) chains = [ chain [ 0 ] for chain in cursor . fetchall ( ) ] chains . sort ( ) return chains
return a list of sorted chains for varname .