def METHOD_NAME(relation, context_log_message):
    if isinstance(relation, basestring):
        release_relation = 'UNKNOWN'
        lowercase_rel = relation.lower()
        if lowercase_rel == 'contained' or lowercase_rel == 'contains':
            release_relation = 'CONTAINED'
        elif lowercase_rel == 'refers' or lowercase_rel == 'referred':
            release_relation = 'REFERRED'
        elif lowercase_rel != '':
            print (u'WARN: %s. relation "%s" is not recognizable and has been converted to UNKNOWN' % (context_log_message, relation)).encode('utf-8')
        mainline_state = 'OPEN'
        prr = {'releaseRelation': release_relation, 'mainlineState': mainline_state}
        return prr
    else:
        return relation