def parse_samples_limit(limit: str | None) -> int | tuple[int, int] | None:
    if limit is not None:
        if "," not in limit:
            return int(limit)
        else:
            limit_split = [int(r) for r in limit.split(",")]
            return (limit_split[0] - 1, limit_split[1])
    else:
        return None
