def tuple_mul(tuple_item, num):
    """Perform element-wise multiplication by a scaler for a tuple or a number."""
    if not isinstance(tuple_item, tuple):
        return tuple_item * num
    List = []
    for item in tuple_item:
        if item is not None:
            List.append(item * num)
        else:
            List.append(None)
    return tuple(List)