def dim_in_set(x, dim, set_):
    """Dimension in particular set of values indicator function"""

    z = x[dim]
    res = 0
    for item in set_:
        if z == item:
            res = 1
    return res