def deserialize(data):
    try:
        if not isinstance(data, str):
            data = data.decode('utf-8')
        data = json.loads(data)
        if 'key' not in data or 'uri' not in data:
            raise ValueError("Missing 'key' or 'uri' fields.")
        return Account(key=load_private_key(data['key'].encode('utf8')), uri=data['uri'])
    except (__HOLE__, ValueError, AttributeError) as e:
        raise IOError("Invalid account structure: {}".format(e))
dataset/ETHPy150Open veeti/manuale/manuale/account.py/deserialize