def loadj(obj):
    """Read a game from serializable python objects

    Parameters
    ----------
    json : {...}
        The python object representation of a game encoded as json. Any valid
        game will be read and returned.
    """
    game_type, _ = obj.get('type', 'samplegame.').split('.', 1)
    if game_type == 'add':
        from gameanalysis import rsgame
        return rsgame.add_json(obj)
    elif game_type == 'aggfn':
        from gameanalysis import aggfn
        return aggfn.aggfn_json(obj)
    elif game_type == 'canon':
        from gameanalysis import canongame
        return canongame.canon_json(obj)
    elif game_type == 'const':
        from gameanalysis import rsgame
        return rsgame.const_json(obj)
    elif game_type == 'empty' or game_type == 'emptygame':
        from gameanalysis import rsgame
        return rsgame.empty_json(obj)
    elif game_type == 'game':
        from gameanalysis import paygame
        return paygame.game_json(obj)
    elif game_type == 'matrix':
        from gameanalysis import matgame
        return matgame.matgame_json(obj)
    elif game_type == 'neighbor':
        from gameanalysis import learning
        return learning.neighbor_json(obj)
    elif game_type == 'point':
        from gameanalysis import learning
        return learning.point_json(obj)
    elif game_type == 'rbf':
        from gameanalysis import learning
        return learning.rbfgame_json(obj)
    elif game_type == 'sample':
        from gameanalysis import learning
        return learning.sample_json(obj)
    elif game_type == 'samplegame':
        from gameanalysis import paygame
        return paygame.samplegame_json(obj)
    else:
        raise ValueError('unknown game type {}'.format(game_type))
