def median(data):

    if len(data) == 0:
        return None

    data.sort()
    return float((data[len(data) / 2] + data[(len(data) - 1) / 2]) / 2.)
Handle a single message from tworld, or throw an exception.
dataset/ETHPy150Open yvesalexandre/bandicoot/bandicoot/helper/tools.py/median--crossover with--dataset/ETHPy150Open erkyrath/tworld/lib/tweblib/servers.py/ServerMgr.handle_tworld_message