Dict row factory for subdomains

def subdomain_row_factory(cls, cursor, row):
        """
        Dict row factory for subdomains
        """
        d = {}
        for idx, col in enumerate(cursor.description):
            d[col[0]] = row[idx]

        return d