def _CheckQuery(query):
 _ValidateString(query, 'query', MAXIMUM_QUERY_LENGTH, empty_ok=True)
 if (query is None):
  raise TypeError('query must be unicode, got None')
 if query.strip():
  try:
   query_parser.Parse(query)
  except query_parser.QueryException as e:
   raise QueryError(('Failed to parse query "%s"' % query))
 return query

def _CheckQuery ( query ) : _ValidateString ( query , 'query' , MAXIMUM_QUERY_LENGTH , empty_ok = True ) if ( query is None ) : raise TypeError ( 'query must be unicode, got None' ) if query . strip ( ) : try : query_parser . Parse ( query ) except query_parser . QueryException as e : raise QueryError ( ( 'Failed to parse query "%s"' % query ) ) return query
checks a query is a valid query string .