parameters: (self, query, args=None)
return_statement: return query % tuple(args)
docstring: obj.literal(query, args=None) -> processed query
docstring_summary: obj.literal(query, args=None) -> processed query
docstring_tokens: obj . literal ( query args = None ) - > processed query
function: def literal(self, query, args=None):
          """
          obj.literal(query, args=None) -> processed query
          """
          conv = {int: str,
                  str: lambda x: '"%s"'%x,
                  float: str,
                  bool: str,
                  type(None): lambda x: 'NULL',
                  _pydt.datetime: lambda x: x.strftime('"%Y-%m-%d %H:%M:%S"'),
                  _pydt.date: lambda x: x.strftime('"%Y-%m-%d"'),
                  _pydt.time: lambda x: x.strftime('"%H:%M:%S"'),
                  _pydt.timedelta: lambda x: '"%d:%02d:%02d"' % \
                                                  (x.seconds/3600+x.days*24,
                                                   x.seconds%3600/60,
                                                   x.seconds%60),
                  _pyt.struct_time: lambda x: _pyt.\
                                          strftime('"%Y-%m-%d %H:%M:%S"',x)}
  
          if args is None:
              return query
  
          args = list(args)
          for i, arg in enumerate(args):
              for k,v in conv.items():
                  if isinstance(arg, k):
                      args[i] = v(arg)
                      break
              else:
                  args[i] = str(arg)
  
          query = query.replace('?', '%s')
          return query % tuple(args)
function_tokens: def literal ( self , query , args = None ) : conv = { int : str , str : lambda x : '"%s"' % x , float : str , bool : str , type ( None ) : lambda x : 'NULL' , _pydt . datetime : lambda x : x . strftime ( '"%Y-%m-%d %H:%M:%S"' ) , _pydt . date : lambda x : x . strftime ( '"%Y-%m-%d"' ) , _pydt . time : lambda x : x . strftime ( '"%H:%M:%S"' ) , _pydt . timedelta : lambda x : '"%d:%02d:%02d"' % ( x . seconds / 3600 + x . days * 24 , x . seconds % 3600 / 60 , x . seconds % 60 ) , _pyt . struct_time : lambda x : _pyt . strftime ( '"%Y-%m-%d %H:%M:%S"' , x ) } if args is None : return query args = list ( args ) for i , arg in enumerate ( args ) : for k , v in conv . items ( ) : if isinstance ( arg , k ) : args [ i ] = v ( arg ) break else : args [ i ] = str ( arg ) query = query . replace ( '?' , '%s' ) return query % tuple ( args )