'Returns a simplified form or a value of DiracDelta depending on the
argument passed by the DiracDelta object.
The ``eval()`` method is automatically called when the ``DiracDelta`` 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 DiracDelta, S, Subs
>>> from sympy.abc import x
>>> DiracDelta(x)
DiracDelta(x)
>>> DiracDelta(x,1)
DiracDelta(x, 1)
>>> DiracDelta(1)
0
>>> DiracDelta(5,1)
0
>>> DiracDelta(0)
DiracDelta(0)
>>> DiracDelta(-1)
0
>>> DiracDelta(S.NaN)
nan
>>> DiracDelta(x).eval(1)
0
>>> DiracDelta(x - 100).subs(x, 5)
0
>>> DiracDelta(x - 100).subs(x, 100)
DiracDelta(0)'

@classmethod
def eval(cls, arg, k=0):

    k = sympify(k)
    if ((not k.is_Integer) or k.is_negative):
        raise ValueError(('Error:    the    second    argument    of    DiracDelta    must    be                                                    a    non-negative    integer,    %s    given    instead.' % (k,)))
    arg = sympify(arg)
    if (arg is S.NaN):
        return S.NaN
    if arg.is_nonzero:
        return S.Zero
    if 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))))
