'Returns a simplified form or a value of Heaviside depending on the
argument passed by the Heaviside object.
The ``eval()`` method is automatically called when the ``Heaviside`` class
is about to be instantiated and it returns either some simplified instance
or the unevaluated instance depending on the argument passed. In other words,
``eval()`` method is not needed to be called explicitly, it is being called
and evaluated once the object is called.
Examples
>>> from sympy import Heaviside, S
>>> from sympy.abc import x
>>> Heaviside(x)
Heaviside(x)
>>> Heaviside(19)
1
>>> Heaviside(0)
Heaviside(0)
>>> Heaviside(0, 1)
1
>>> Heaviside(-5)
0
>>> Heaviside(S.NaN)
nan
>>> Heaviside(x).eval(100)
1
>>> Heaviside(x - 100).subs(x, 5)
0
>>> Heaviside(x - 100).subs(x, 105)
1'

@classmethod
def eval(cls, arg, H0=None):

    H0 = sympify(H0)
    arg = sympify(arg)
    if arg.is_negative:
        return S.Zero
    elif arg.is_positive:
        return S.One
    elif arg.is_zero:
        return H0
    elif (arg is S.NaN):
        return S.NaN
    elif fuzzy_not(im(arg).is_zero):
        raise ValueError(('Function    defined    only    for    Real    Values.    Complex    part:    %s        found    in    %s    .' % (repr(im(arg)), repr(arg))))
