<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def a2s_ping(server_addr, timeout=2):
 """Ping a server .. warning:: This method for pinging is considered deprecated and may not work on certian servers. Use :func:`.a2s_info` instead. :param server_addr: (ip, port) for the server :type server_addr: tuple :param timeout: (optional) timeout in seconds :type timeout: float :raises: :class:`RuntimeError`, :class:`socket.timeout` :returns: ping response in milliseconds or `None` for timeout :rtype: :class:`float` """

    ss = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    ss.connect(server_addr)
    ss.settimeout(timeout)

    ss.send(_pack('<lc', -1, b'i'))
    start = _time()

    try:
        data = _handle_a2s_response(ss)
    finally:
        ss.close()

    ping = max(0.0, _time() - start) * 1000

    if data[4:5] == b'j':
        return ping