def min_pos(x):
    """ return the smallest positive number in a given numeric list;
    in the case all values are negative, return the biggest one (generally the err code for timeout)

    Args:
        x (list of numeric)

    Returns:
        numeric
    """
    pos_x = [i for i in x if i > 0]
    if len(pos_x):
        return min(pos_x)
    else:
        return max(x)