code: def _convert_params(sql, params):
      
      args = [sql]
      if params is not None:
          if hasattr(params, 'keys'):  # test if params is a mapping
              args += [params]
          else:
              args += [list(params)]
      return args
docs: Convert SQL and params args to DBAPI2.0 compliant format.