import six


def _qe_val_formatter(val):
    """Format values for QE tags into strings."""
    if isinstance(val, bool):
        return ".{}.".format(str(val).lower())
    elif isinstance(val, six.string_types):
        return '"{}"'.format(val)
    else:
        return str(val)