def optionalFlagParse(raw: str) ->bool:
    """
	Parses the allowed values for the optional JSON and TIMESTAMP
	configuration flags, and returns their value as a boolean.
	"""
    try:
        return bool(int(raw))
    except ValueError:
        try:
            return {'FALSE': False, 'TRUE': True}[raw]
        except KeyError:
            raise ValueError('Invalid value: %s' % raw)
