class_docstr: Heaviside step function.
  
  Explanation
  ===========
  
  The Heaviside step function has the following properties:
  
  1) $\frac{d}{d x} \theta(x) = \delta(x)$
  2) $\theta(x) = \begin{cases} 0 & \text{for}\: x < 0 \\ \frac{1}{2} &
     \text{for}\: x = 0 \\1 & \text{for}\: x > 0 \end{cases}$
  3) $\frac{d}{d x} \max(x, 0) = \theta(x)$
  
  Heaviside(x) is printed as $\theta(x)$ with the SymPy LaTeX printer.
  
  The value at 0 is set differently in different fields. SymPy uses 1/2,
  which is a convention from electronics and signal processing, and is
  consistent with solving improper integrals by Fourier transform and
  convolution.
  
  To specify a different value of Heaviside at ``x=0``, a second argument
  can be given. Using ``Heaviside(x, nan)`` gives an expression that will
  evaluate to nan for x=0.
  
  .. versionchanged:: 1.9 ``Heaviside(0)`` now returns 1/2 (before: undefined)
  
  Examples
  ========
  
  >>> from sympy import Heaviside, nan
  >>> from sympy.abc import x
  >>> Heaviside(9)
  1
  >>> Heaviside(-9)
  0
  >>> Heaviside(0)
  1/2
  >>> Heaviside(0, nan)
  nan
  >>> (Heaviside(x) + 1).replace(Heaviside(x), Heaviside(x, 1))
  Heaviside(x, 1) + 1
  
  See Also
  ========
  
  DiracDelta
  
  References
  ==========
  
  .. [1] https://mathworld.wolfram.com/HeavisideStepFunction.html
  .. [2] https://dlmf.nist.gov/1.16#iv
class_docstr_tok: ["Heaviside","step","function",".","Explanation","===========","The","Heaviside","step","function","has","the","following","properties",":","1",")","$","\\frac","{","d","}","{","d","x","}","\\theta","(","x",")","=","\\delta","(","x",")","$","2",")","$","\\theta","(","x",")","=","\\begin","{","cases","}","0","&","\\text","{","for","}","\\",":","x","<","0","\\\\","\\frac","{","1","}","{","2","}","&","\\text","{","for","}","\\",":","x","=","0","\\\\1","&","\\text","{","for","}","\\",":","x",">","0","\\end","{","cases","}","$","3",")","$","\\frac","{","d","}","{","d","x","}","\\max","(","x",",","0",")","=","\\theta","(","x",")","$","Heaviside","(","x",")","is","printed","as","$","\\theta","(","x",")","$","with","the","SymPy","LaTeX","printer",".","The","value","at","0","is","set","differently","in","different","fields",".","SymPy","uses","1\/2",",","which","is","a","convention","from","electronics","and","signal","processing",",","and","is","consistent","with","solving","improper","integrals","by","Fourier","transform","and","convolution",".","To","specify","a","different","value","of","Heaviside","at","``","x=0","``",",","a","second","argument","can","be","given",".","Using","``","Heaviside","(","x",",","nan",")","``","gives","an","expression","that","will","evaluate","to","nan","for","x=0",".","..","versionchanged",":",":","1.9","``","Heaviside","(","0",")","``","now","returns","1\/2","(","before",":","undefined",")","Examples","========",">",">",">","from","sympy","import","Heaviside",",","nan",">",">",">","from","sympy.abc","import","x",">",">",">","Heaviside","(","9",")","1",">",">",">","Heaviside","(","-9",")","0",">",">",">","Heaviside","(","0",")","1\/2",">",">",">","Heaviside","(","0",",","nan",")","nan",">",">",">","(","Heaviside","(","x",")","+","1",")",".replace","(","Heaviside","(","x",")",",","Heaviside","(","x",",","1",")",")","Heaviside","(","x",",","1",")","+","1","See","Also","========","DiracDelta","References","==========","..","[","1","]","https",":","\/\/mathworld.wolfram.com\/HeavisideStepFunction.html","..","[","2","]","https",":","\/\/dlmf.nist.gov\/1.16","#","iv"]
docstr: Returns a simplified form or a value of Heaviside depending on the
  argument passed by the Heaviside object.
  
  Explanation
  ===========
  
  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)
  1/2
  
  >>> Heaviside(0, 1)
  1
  
  >>> Heaviside(-5)
  0
  
  >>> Heaviside(S.NaN)
  nan
  
  >>> Heaviside(x - 100).subs(x, 5)
  0
  
  >>> Heaviside(x - 100).subs(x, 105)
  1
  
  Parameters
  ==========
  
  arg : argument passed by Heaviside object
  
  H0 : value of Heaviside(0)
docstr_tok: ["Returns","a","simplified","form","or","a","value","of","Heaviside","depending","on","the","argument","passed","by","the","Heaviside","object",".","Explanation","===========","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",")","1\/2",">",">",">","Heaviside","(","0",",","1",")","1",">",">",">","Heaviside","(","-5",")","0",">",">",">","Heaviside","(","S.NaN",")","nan",">",">",">","Heaviside","(","x","-","100",")",".subs","(","x",",","5",")","0",">",">",">","Heaviside","(","x","-","100",")",".subs","(","x",",","105",")","1","Parameters","==========","arg",":","argument","passed","by","Heaviside","object","H0",":","value","of","Heaviside","(","0",")"]
code: def eval(cls, arg, H0=S.Half):
      """
      Returns a simplified form or a value of Heaviside depending on the
      argument passed by the Heaviside object.
  
      Explanation
      ===========
  
      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)
      1/2
  
      >>> Heaviside(0, 1)
      1
  
      >>> Heaviside(-5)
      0
  
      >>> Heaviside(S.NaN)
      nan
  
      >>> Heaviside(x - 100).subs(x, 5)
      0
  
      >>> Heaviside(x - 100).subs(x, 105)
      1
  
      Parameters
      ==========
  
      arg : argument passed by Heaviside object
  
      H0 : value of Heaviside(0)
  
      """
      if arg.is_extended_negative:
          return S.Zero
      elif arg.is_extended_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))
          )
  
imports: from sympy.core import S, diff
  from sympy.core.function import Function, ArgumentIndexError
  from sympy.core.logic import fuzzy_not
  from sympy.core.relational import Eq, Ne
  from sympy.functions.elementary.complexes import im, sign
  from sympy.functions.elementary.piecewise import Piecewise
  from sympy.polys.polyerrors import PolynomialError
  from sympy.polys.polyroots import roots
  from sympy.utilities.misc import filldedent
label_desc: Use image node_id 4 for calling the Heaviside obj's underlying member method code with example usage: obj.eval(cls, arg, H0) and returns: S, S, H0, S