def args_to_list(csv, allow_empty, arg_type=int, allow_negative=True):
    """Convert comma-separated arguments to a list.

    Args:
        csv: Comma-separated list of arguments as a string.
        allow_empty: If True, allow the list to be empty. Otherwise return None instead of empty list.
        arg_type: Argument type in the list.
        allow_negative: If True, allow negative inputs.

    Returns:
        List of arguments, converted to `arg_type`.
    """
    arg_vals = [arg_type(d) for d in str(csv).split(',')]
    if not allow_negative:
        arg_vals = [v for v in arg_vals if v >= 0]
    if not allow_empty and len(arg_vals) == 0:
        return None
    return arg_vals