<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_and_assert_slice_param(url_dict, param_name, default_int):
 """Return ``param_str`` converted to an int. If str cannot be converted to int or int is not zero or positive, raise InvalidRequest. """

    param_str = url_dict['query'].get(param_name, default_int)
    try:
        n = int(param_str)
    except ValueError:
        raise d1_common.types.exceptions.InvalidRequest(
            0,
            'Slice parameter is not a valid integer. {}="{}"'.format(
                param_name, param_str
            ),
        )
    if n < 0:
        raise d1_common.types.exceptions.InvalidRequest(
            0,
            'Slice parameter cannot be a negative number. {}="{}"'.format(
                param_name, param_str
            ),
        )
    return n