def checkNoneOption(value):
    """
    Check if a given option has been set to the string 'None' and return
    None if so. Otherwise return the value unchanged
    """
    if value is None:
        return value
    if value == 'None':
        return None
    if isinstance(value, list):
        if len(value) == 1 and value[0] == 'None':
            return None
    return value