def _validate_int(s, accept_none=False):
    """
	A validation method to convert input s to int or raise error if it is not convertable
	"""
    if s is None and accept_none:
        return None
    try:
        return int(s)
    except ValueError:
        raise ValueError('Could not convert "%s" to int' % s)
