def named_to_qmark(query, d):
  ''' Converts a query from qmark to named style using dict d '''
  params = []
  def f(mo):
    params.append(d[mo.group(1)])
    return '?'
  query = _named_to_qmark_re.sub(f, query)
  return query, params
 Converts a query from qmark to named style using dict d 
recipes/Python/578380_PythDBAPI_2_qmark_named/recipe-578380.py