'Represents Heaviside in a Piecewise form
Examples
>>> from sympy import Heaviside, Piecewise, Symbol, pprint
>>> x = Symbol(\'x\')
>>> Heaviside(x).rewrite(Piecewise)
Piecewise((0, x < 0), (Heaviside(0), Eq(x, 0)), (1, x > 0))
>>> Heaviside(x - 5).rewrite(Piecewise)
Piecewise((0, x - 5 < 0), (Heaviside(0), Eq(x - 5, 0)), (1, x - 5 > 0))
>>> Heaviside(x**2 - 1).rewrite(Piecewise)
Piecewise((0, x**2 - 1 < 0), (Heaviside(0), Eq(x**2 - 1, 0)), (1, x**2 - 1 > 0))'

def _eval_rewrite_as_Piecewise(self, arg, H0=None):

    if (H0 is None):
        return Piecewise((0, (arg < 0)), (Heaviside(0), Eq(arg, 0)), (1, (arg > 0)))
    if (H0 == 0):
        return Piecewise((0, (arg <= 0)), (1, (arg > 0)))
    if (H0 == 1):
        return Piecewise((0, (arg < 0)), (1, (arg >= 0)))
    return Piecewise((0, (arg < 0)), (H0, Eq(arg, 0)), (1, (arg > 0)))
