def sq(x, response):
    """
    An RPC handler function that sends the square root of the input.
    """
    if isinstance(x, int):
        response.send(x * x)
    else:
        response.error('sq received unexpected input')
