code: def namedtuple_row_strategy(column_names):
      
      import collections
      # replace empty column names with placeholders
      column_names = [name if is_valid_identifier(name) else 'col%s_' % idx for idx, name in enumerate(column_names)]
      row_class = collections.namedtuple('Row', column_names)
  
      def row_factory(row):
          return row_class(*row)
  
      return row_factory
docs: Namedtuple row strategy, rows returned as named tuples
  
      Column names that are not valid Python identifiers will be replaced
      with col<number>_