<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _lval_add_towards_polarity(x, polarity):
 """Compute the appropriate Lval "kind" for the limit of value `x` towards `polarity`. Either 'toinf' or 'pastzero' depending on the sign of `x` and the infinity direction of polarity. """

    if x < 0:
        if polarity < 0:
            return Lval('toinf', x)
        return Lval('pastzero', x)
    elif polarity > 0:
        return Lval('toinf', x)
    return Lval('pastzero', x)