from typing import Union
from typing import Tuple


def wrangle_id(asset_id: Union[str, int, float]) -> Tuple[bool, str]:
    """
    Converts ID to string and checks if it's a valid ID.

    Args:
        asset_id (any): asset ID (video or playlist).

    Returns:
        (bool, str): True and string representation of ID if valid, False and None otherwise.
    """
    is_valid = False
    work_id = ''

    # is it an int?
    if isinstance(asset_id, int) and asset_id > 0:
            work_id = str(asset_id)
            is_valid = True
    # is it a string?
    elif isinstance(asset_id, str):
        if asset_id.startswith('ref:') and len(asset_id)<=154:
            work_id = asset_id
            is_valid = True
        else:
            try:
                work_id = str(int(asset_id))
            except ValueError:
                is_valid = False
            else:
                is_valid = True
    # is it a float?
    elif isinstance(asset_id, float):
        if asset_id.is_integer():
            work_id = str(int(asset_id))
            is_valid = True

    return is_valid, work_id