def set_default(item, default, use_default):
    """if an item provided is None and boolean use_default is set to True,
       return the default. Otherwise, return the item.
    """
    if item is None and use_default:
        return default
    return item
