def true_text(variable):
    """
    Deal with variables that should be True or False  even when a string
    (defaults to False)

    i.e. returns True if variable = True, 1, "True", "T", "t", "true" etc

    :param variable:
    :return:
    """
    # if variable is a True or 1 return True
    if variable in [True, 1]:
        return True
    # if variable is string test string Trues
    if isinstance(variable, str):
        if variable.upper() in ['TRUE', 'T', '1']:
            return True
    # else in all other cases return False
    return False