def _literal(nonnumeric):
    """Convert a non-numeric blackbird literal to a Python literal.

    Args:
        nonnumeric (blackbirdParser.NonnumericContext): nonnumeric context
    Returns:
        str or bool
    """
    if nonnumeric.STR():
        return str(nonnumeric.getText().replace('"', ''))
    if nonnumeric.BOOL():
        val = nonnumeric.getText()
        if val == 'True':
            return True
        if val == 'False':
            return False
        raise ValueError('Unknown boolean value ' + nonnumeric.getText())
    raise ValueError('Unknown value ' + nonnumeric.getText())
