Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUp(self):
self.parser = ttp.Parser(include_spans=True)
def setUp(self):
self.parser = ttp.Parser()
from hashlib import md5
import json
from urllib import urlencode
import urllib2
from django.core.cache import cache
from bleach import Bleach
import commonware.log
import jinja2
import ttp
from . import twitter_languages
log = commonware.log.getLogger('z.firefoxcup')
parser = ttp.Parser()
bleach = Bleach()
def _prepare_lang(lang):
lang = lang.split('-')[0]
if lang not in twitter_languages:
lang = 'all'
return lang
def _search_query(tags, lang):
return urlencode({
'ors': ' '.join(tags),
'lang': lang})