def coerce_to_boolean(session):
    """Given a valid boolean value, ie True, 'true', 'false', False, 0, 1
    set the data to the python boolean type True or False

    :param session: Kim pipeline session instance
    """
    if session.data in session.field.opts.true_boolean_values:
        session.data = True
    else:
        session.data = False

    return session.data