def _convert_to_int_list(check_codes):
    """Takes a comma-separated string or list of strings and converts to list of ints.

    Args:
        check_codes: comma-separated string or list of strings

    Returns:
        list: the check codes as a list of integers

    Raises:
        ValueError: if conversion fails
        RuntimeError: if cannot determine how to convert input
    """
    if isinstance(check_codes, list):
        if all(isinstance(x, int) for x in check_codes):
            return check_codes  # good input
        else:
            return [int(x) for x in check_codes]  # list of str
    elif isinstance(check_codes, str):
        return [int(x) for x in check_codes.split(",")]  # str, comma-separated expected
    raise RuntimeError("Could not convert values: {} of type {}".format(check_codes, type(check_codes)))