def falsey_to_none(var):
    """Certain parameters return invalid 0 when they should be False

    This function takes a variable, checks if its 'falsey' and return it
    with the value of None if it is.
    :param var: The variable to check
    :return: The variable that was given, with value of None if it was falsey
    """
    if not var:
        var = None
    return var