

def positions(keyword='', serps='', topkeyword=''):
    'Return a position/url paired JSON dict of all results for keyword.'
    if topkeyword:
        keyword = topkeyword
    if (not serps):

        def gserps(keyword):
            global serps
            return serps(keyword)
        serps = gserps(keyword)
    elif serps:
        serps = json.loads(serps)
        easydict = {
            
        }
        serpos = 1
        rd = serps[0]['responseData']
        if (rd == None):
            return 'API quota likely exceeded'
        for serpage in serps:
            try:
                serpage = serpage['responseData']['results']
                for result in serpage:
                    easydict[serpos] = result['url']
                    serpos += 1
            except:
                pass
        return json.dumps(easydict)
    else:
        return 'Error'

dataset/ETHPy150Open miklevin/pipulate/common.py positions/original