def METHOD_NAME(obj):
    # obj is function
    if callable(obj):
        return obj
    # obj is regex object
    if hasattr(obj, 'match'):
        return regex_callable(obj)
    # obj is string
    return lambda x: obj in x