<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _cast_page(val):
 """ Convert the page limit & offset into int's & type check """


        try:
            val = int(val)
            if val < 0:
                raise ValueError
            return val
        except (TypeError, ValueError):
            raise ValueError