def ParseBool(text):
    """Parse a boolean value.

  Args:
    text: Text to parse.

  Returns:
    Boolean values parsed

  Raises:
    ValueError: If text is not a valid boolean.
  """
    if text in (b'true', b't', b'1'):
        return True
    elif text in (b'false', b'f', b'0'):
        return False
    else:
        raise ValueError('Expected "true" or "false".')
