@csrf_exempt
def popularity_of_words_get(request):
    print('popularity_of_words_get')
    df = ''
    if (request.method == 'POST'):
        queriesManager = QueriesManager()
        (name, locations, start_date, end_date, word_list, logic, exact) = parse_parameters(request)
        (word_list, pharase_list) = filter_strings(word_list)
        word_list = (word_list + phrase_list_to_word_list(pharase_list))
        days_list = generate_days_list(start_date, end_date)
        total_tweets = get_tweet_list(locations, get_user(name), days_list, word_list=word_list, asdocs=True, exact=exact)
        if isinstance(total_tweets, Exception):
            return JsonResponse(str(total_tweets), safe=False, status=500)
        elif (len(total_tweets) == 0):
            return JsonResponse('Error: No Tweets in location and date', safe=False, status=500)
        params = ['Popularity_of_word_bank_per_place', word_list]
        print(params)
        print(len(total_tweets))
        df = queriesManager.call_querie(params, total_tweets, [])
        if df.empty:
            return JsonResponse('Error: No appearances of search phrases in tweets', safe=False)
        rows = df.shape[0]
        df = df.to_json()
        df = df[:(- 1)]
        df = ((df + ', "rows": ') + str(rows))
        df = (((df + ', "word_list": ') + str(word_list)) + '}')
        print(df)
        df = df.replace("'", '"')
        print(df)
    return JsonResponse(df, safe=False)
@csrf_exempt
def popularity_of_words_get(request):
    print('popularity_of_words_get')
    df = 
    if (request.method == 'POST'):
        queriesManager = QueriesManager()
        (name, locations, start_date, end_date, word_list, logic, exact) = parse_parameters(request)
        (word_list, pharase_list) = filter_strings(word_list)
        word_list = (word_list + phrase_list_to_word_list(pharase_list))
        days_list = generate_days_list(start_date, end_date)
        total_tweets = get_tweet_list(locations, get_user(name), days_list, word_list=word_list, asdocs=True, exact=exact)
        if isinstance(total_tweets, Exception):
            return JsonResponse(str(total_tweets), safe=False, status=500)
        elif (len(total_tweets) == 0):
            return JsonResponse('Error: No Tweets in location and date', safe=False, status=500)
        params = ['Popularity_of_word_bank_per_place', word_list]
        print(params)
        print(len(total_tweets))
        df = queriesManager.call_querie(params, total_tweets, [])
        if df.empty:
            return JsonResponse('Error: No appearances of search phrases in tweets', safe=False)
        rows = df.shape[0]
        df = df.to_json()
        df = df[:(- 1)]
        df = ((df + ', "rows": ') + str(rows))
        df = (((df + ', "word_list": ') + str(word_list)) + '}')
        print(df)
        df = df.replace("'", '"')
        print(df)
    return JsonResponse(df, safe=False)