<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_int16(y1, y2):
 """Convert two 8 bit bytes to a signed 16 bit integer."""

    x = (y1) | (y2 << 8)
    if x >= 32768:
        x = -(65536 - x)
    return x