<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def boolify(value, nullable=False, return_string=False):
 """Convert a number, string, or sequence type into a pure boolean. Args: value (number, string, sequence):
 pretty much anything Returns: bool: boolean representation of the given value Examples: [True, False] [True, False, True, False, False, True, True] [True, True, True, True] [False, False, False, False, False] [False, False, False, False] [True, True, True, True] """

    # cast number types naturally
    if isinstance(value, BOOL_COERCEABLE_TYPES):
        return bool(value)
    # try to coerce string into number
    val = text_type(value).strip().lower().replace('.', '', 1)
    if val.isnumeric():
        return bool(float(val))
    elif val in BOOLISH_TRUE:
        return True
    elif nullable and val in NULL_STRINGS:
        return None
    elif val in BOOLISH_FALSE:
        return False
    else:  # must be False
        try:
            return bool(complex(val))
        except ValueError:
            if isinstance(value, string_types) and return_string:
                return value
            raise TypeCoercionError(value, "The value %r cannot be boolified." % value)