def ns2nsfit(ns, num):
    """
    Returns a list of distances or ps for performing fits.

    If ds == 5 and num == 3:
        -> [5, 5, 5]

    If ds == [3, 5, 7] and num == 3:
        -> [3, 3, 3, 5, 5, 5, 7, 7, 7]

    Likewise for ps.

    Args:
        ds:
        num:

    Returns:

    """
    if isinstance(ns, int):
        return [ns]*num

    else:
        new_list = []

        for i in ns:
            new_list.extend([i]*num)
        return new_list