def gqn(val):
 if isinstance(val, basestring):
  if isinstance(val, unicode):
   val = val.encode('ascii')
  return ("'%s'" % val)
 else:
  return str(val)

def gqn ( val ) : if isinstance ( val , basestring ) : if isinstance ( val , unicode ) : val = val . encode ( 'ascii' ) return ( "'%s'" % val ) else : return str ( val )
the geographic quote name function; used for quoting tables and geometries .