

def extractkeywords(url):
    import rake, operator, re
    html = gethtml(url)
    if (not html):
        return None
    urlkws = urltokw(url)
    brandfilter = brand(url)
    title = scraper(html, '//title/text()')
    description = scraper(html, "//meta[translate(@name, 'ABCDEFGHJIKLMNOPQRSTUVWXYZ', 'abcdefghjiklmnopqrstuvwxyz')='description']/@content")
    scrubbed = barebones(html)
    newtxt = ('%s %s %s %s %s %s' % (title, title, urlkws, urlkws, description, scrubbed))
    newtxt = newtxt.replace('\n', ' ')
    newtxt = re.sub('<[^<]+?>', ' ', newtxt)
    newtxt = re.sub('%.*?%', ' ', newtxt)
    newtxt = re.sub(' +', ' ', newtxt)
    rake_object = rake.Rake('/var/pipulate/SmartStoplist.txt', 3, 4, 2)
    keywords = kw.run(newtxt)
    tuplist = []
    for keyword in keywords:
        kw = keyword[0]
        candidate = kw.split()
        if (len(candidate) > 1):
            if (kw.replace(' ', '') != brandfilter.replace(' ', '')):
                try:
                    tuplist.append((str(keyword[0]), round(keyword[1], 2)))
                except:
                    pass
    if tuplist:
        return tuplist
    else:
        return None

dataset/ETHPy150Open miklevin/pipulate/common.py extractkeywords/VarMisuse@162/278 `rake_object`->`kw`