def _as_vw_string(x, y=None):
    """Convert {feature: value} to something _VW understands

    Parameters
    ----------
    x : {<feature>: <value>}
    y : int or float
    """
    result = str(y)
    x = " ".join(["%s:%f" % (key, value) for (key, value) in list(x.items())])
    return result + " | " + x