def compare_eval(a, b):
    """
    >>> compare_eval(1, "x%2==1")
    True
    >>> compare_eval(1, "0<x/3 and x/3 <=1.0")
    True
    >>> compare_eval("xyz", "len(x)==3")
    True
    >>> compare_eval("xyz", 'hash(x)!=hash("xyz")')
    False
    >>> compare_eval("xyz", 'x[2]=="z"')
    True
    >>> compare_eval("xyzxyz", 'x[:int(len(x)/2)]==x[int(len(x)/2):]')
    True
    >>> compare_eval("xyzxyz123123", 'x[:int(len(x)/2)]==x[int(len(x)/2):]')
    False
    """
    return eval(b, {}, {'x': a})
