def Validate(self, value):
    """Validates a schedule."""
    if value is None:
      raise validation.MissingAttribute('schedule must be specified')
    if not isinstance(value, basestring):
      raise TypeError('schedule must be a string, not \'%r\''%type(value))
    schedule = groc.CreateParser(value)
    try:
      schedule.timespec()
    except groc.GrocException, e:
      raise validation.ValidationError('schedule \'%s\' failed to parse: %s'%(
          value, e.args[0]))
    return value
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/api/croninfo.py/GrocValidator.Validate/original