import re


def cassini_time(time):
    """Parse Cassini time.

    Parameters
    ----------
    time: str, int or float
        Cassini time.

    Returns
    -------
    float
        Parsed Cassini time as float.

    Raises
    ------
    ValueError
        If the input time pattern is invalid.

    Examples
    --------
    >>> cassini_time('v1487096932_1')
    1487096932.0

    >>> cassini_time(1483230358.172)
    1483230358.172

    """
    cassini_time = re.findall(r'(\d{10})(\.\d+)?', str(time))

    if not cassini_time:
        raise ValueError(f'Cassini time invalid: `{time}`')

    return float(''.join(cassini_time[0]))