def _bind_parameters(operation, parameters):
 string_parameters = {}
 for (name, value) in parameters.iteritems():
  if (value is None):
   string_parameters[name] = 'NULL'
  elif isinstance(value, basestring):
   string_parameters[name] = (("'" + _escape(value)) + "'")
  else:
   string_parameters[name] = str(value)
 return (operation % string_parameters)

def _bind_parameters ( operation , parameters ) : string_parameters = { } for ( name , value ) in parameters . iteritems ( ) : if ( value is None ) : string_parameters [ name ] = 'NULL' elif isinstance ( value , basestring ) : string_parameters [ name ] = ( ( "'" + _escape ( value ) ) + "'" ) else : string_parameters [ name ] = str ( value ) return ( operation % string_parameters )
helper method that binds parameters to a sql query .