def load():
    datatype = require_alphanumeric (request.args[0])
    if len (request.args) > 1 and request.args[1]:
        kw = require_alphanumeric (request.args[1])
        rec = boolean (request.vars.get ('recommend'))
        if not rec:
            return '{data: ' + dm.global_load (datatype, [kw]).json () + '}'
        else:
            result = mongo.words.find ({'word': kw})
            if not result.count ():
                return '{data:[]}'
            keys = result[0]['kw'].items ()
            keys.sort (key = lambda x: x[1])
            keys.reverse ()
            top = len (keys) / 4
            words = map (lambda x: x[0], keys[0:top])
            return '{data: ' + dm.global_load (datatype, words).json () + '}'
    else:
        return '{data: ' + dm.global_load (datatype).json () + '}'
dataset/ETHPy150Open dotskapes/dotSkapes/controllers/data.py/load/original