from typing import Union
from typing import List


def find_mesh_color_and_scaling(wiggle_num: int,
                                mesh_color_scaling: Union[List[str], str] = 'auto',
                                mesh_color_range: Union[List[float], float] = 15.0):
    """
    Find number of mesh color and scaling values if input is only int and string. Coded to avoid retyping same values
    over and over in cases where stations have only one type of sensor.

    :param wiggle_num: number of wiggles in df
    :param mesh_color_scaling: optional, colorbar scaling, "auto" or "range". Default is 'auto'. The parameter common_colorbar
        needs to be set to False to apply mesh_color_scaling
    :param mesh_color_range: optional, range of colorbar. Default is 15. The parameter common_colorbar needs to be set
        to False and mesh_color_scaling to "range "to apply mesh_color_range
    :return:
    """

    if (isinstance(mesh_color_range, float) is True or isinstance(mesh_color_range, int) is True) and isinstance(mesh_color_scaling, str):
        list_mesh_color_range = [mesh_color_range] * wiggle_num
        list_mesh_color_scaling = [mesh_color_scaling] * wiggle_num
        return list_mesh_color_scaling, list_mesh_color_range

    else:
        return mesh_color_scaling, mesh_color_range