

def topurl(url, positions=''):
    'Return the top performing URL for a site given a positions object.'
    if (not url):
        return 'lite value required in column or Config tab.'
    apexdom = apex(url)
    if positions:
        urldict = json.loads(positions)
        if urldict:
            for (thepos, aurl) in urldict.iteritems():
                if (apexdom in aurl):
                    return aurl
        else:
            return None

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