def _ConvertFormatToQmark(statement, args):
 if isinstance(args, dict):
  return (statement % collections.defaultdict((lambda : '?')))
 elif args:
  qmarks = tuple(('?' * len(args)))
  return (statement % qmarks)
 return statement

def _ConvertFormatToQmark ( statement , args ) : if isinstance ( args , dict ) : return ( statement % collections . defaultdict ( ( lambda : '?' ) ) ) elif args : qmarks = tuple ( ( '?' * len ( args ) ) ) return ( statement % qmarks ) return statement
replaces %s or %s with ? .