code: from io import BytesIO
  from flask import Flask, jsonify
  import os
  # import tweepy
  from dotenv import load_dotenv
  from flask import request,jsonify
  import snscrape.modules.twitter as snstwitter
  import requests
  from goose3 import Goose
  from wordcloud import WordCloud, STOPWORDS
  import plotly.graph_objs as go
  import json
  import plotly
  import matplotlib.pyplot as plt
  from PIL import Image
  import numpy as np
  import base64
  import pandas as pd
  # from flask import send_file
  from flask import send_file
  import datetime
  import plotly.express as px
  from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
  import logging
  import sys
  from llama_index import GPTVectorStoreIndex, TwitterTweetReader
  import os
  import llama_index
  from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader
  
  import requests
  from bs4 import BeautifulSoup
  from urllib.parse import quote
  import serpapi
  from serpapi import GoogleSearch
  import os
  
  from langchain.llms import OpenAI
  from langchain.prompts import PromptTemplate
  from langchain.chains import LLMChain, SequentialChain
  from langchain.memory import ConversationBufferMemory
  # from langchain.utilities import WikipediaAPIWrapper
  from langchain.agents import load_tools
  from langchain.agents import initialize_agent
  from dotenv import load_dotenv
  
  from flask_cors import CORS
  from llama_index import SimpleDirectoryReader
  from llama_index import GPTVectorStoreIndex
  import llama_index
  
  import io
  import base64
  import matplotlib.pyplot as plt
  import seaborn as sns
  
  
  
  app = Flask(__name__)
  CORS(app)
  twitterData = None
  queryString = None
  
  # print(type(twitterData))
  
  load_dotenv()
  
  print(os.getenv("HUGGINGFACE_API"))
  print(os.getenv('OPENAI_API_KEY'))
  print(os.getenv('BEARER_TOKEN'))
  
  
  os.getenv('OPENAI_API_KEY')
  
  @app.route('/')
  def hello_geek():
      return '<h1>Hello from Flask & Docker</h2>'
  
  @app.route('/twitter')
  def twitter():
      query = request.args['query']
      retweet = 0
      likecount = 0
      hashtags = set([])
      i=0
      global twitterData
      global queryString
      print("Url: Twitter, data: ", twitterData)
      print("Url: Twitter, query: ", queryString)
      twitterData = snstwitter.TwitterSearchScraper(query).get_items()
          
      for tweet in twitterData: 
          print("looping through tweets")
          print(vars(tweet)) 
          likecount += tweet.likeCount
          retweet += tweet.retweetCount + tweet.quoteCount
          if(tweet.hashtags != None):
              for h in tweet.hashtags:
                  hashtags.add(h)
          
          i+= 1
          
          if(i==200):
              break
          
      tweets = {"likecount":likecount,"retweet":retweet,"hashtags":list(hashtags),"count":i}
      print(tweets)
      return jsonify({'result':tweets})
  os.getenv('SERPAPI_API_KEY')
  #For getting the realted link - by providing the URL
  @app.route('/search', methods=['GET'])
  def search():
      article_url = request.args.get('url')
      response = requests.get(article_url)
      soup = BeautifulSoup(response.url, 'html.parser')
  
      header = soup.find('h1').url.strip()
      search_query = quote(header)
  
      params = {
          'q': search_query,
          'hl': 'en',
          'gl': 'us',
          'api_key': os.getenv('SERPAPI_API_KEY')
      }
  
      search = GoogleSearch(params)
      results = search.get_dict().get('organic_results', [])
  
      links = [result['link'] for result in results]
  
      return jsonify({'article_header': header, 'related_links': links})
  
  # To use LLM to check the factual accuracy of the news
  @app.route('/classify_news', methods=['GET'])
  def classify_news():
  
      prompt = request.args['url']
  
      tool_names = ["serpapi"]
      tools = load_tools(tool_names)
  
      title_template = PromptTemplate(
      input_variables = ['topic'], 
      template='To classify the news: {topic} in to the categories like murder, fire, accident, natural disaster, etc'
  )
  
  #     script_template = PromptTemplate(
  #     input_variables = ['title', 'wikipedia_research'], 
  #     #template='Look for the authenticity and the accuracy of the news listed: {title} provide the explanation of whether it is factually correct or is there any information present on wikipedia and also provide the correct answer or result if there is:{wikipedia_research} '
  #     template='Please verify the authenticity and accuracy of the news provided in the {title} by cross-referencing it with the corresponding {wikipedia_research} page. Examine the information available on Wikipedia and determine whether the news is factually correct or accurate. Additionally, if there is any conflicting or misleading information, please provide the correct answer or result based on your research from Wikipedia. '
  # )
  
      title_memory = ConversationBufferMemory(input_key='topic', memory_key='chat_history')
      # script_memory = ConversationBufferMemory(input_key='title', memory_key='chat_history')
  
      llm = OpenAI(temperature=0.9) 
      title_chain = LLMChain(llm=llm, prompt=title_template, verbose=True, output_key='title', memory=title_memory)
      # script_chain = LLMChain(llm=llm, prompt=script_template, verbose=True, output_key='script', memory=script_memory)
      agent = initialize_agent(tools, llm, agent="zero-shot-react-description", verbose=True)
      # wiki = WikipediaAPIWrapper()
      
      if prompt: 
          title = title_chain.run(prompt)
          a=agent.run(f"{prompt}. Also, provide the realted links")
  
      return {
          'title': title_memory.buffer,
          'script': a
      }
  
  @app.route('/xyz')
  def xyz():
      query = request.args['query']
      tweets = []
      for tweet in snstwitter.TwitterProfileScraper(query).get_items():
          tweets.append(tweet.date)
      return tweets
  
  
  
  API_URL = "https://api-inference.huggingface.co/models/facebook/bart-large-cnn"
  headers = {"Authorization": "Bearer " +  os.getenv('HUGGINGFACE_API') }
  API_URL_PROP = "https://api-inference.huggingface.co/models/valurank/distilroberta-propaganda-2class"
  API_URL_HATE = "https://api-inference.huggingface.co/models/IMSyPP/hate_speech_en"
  
  
  
  def query(payload):
  	response = requests.post(API_URL, headers=headers, json=payload)
  	return response.json()
  
  def queryprop(payload):
  	response = requests.post(API_URL_PROP, headers=headers, json=payload)
  	return response.json()
  
  def query_hate(payload):
  	response = requests.post(API_URL_HATE, headers=headers, json=payload)
  	return response.json()
  
  
  
  @app.route('/sentiment')
  def sentiment():
      query = request.args['query']
      retweet = 0
      likecount = 0
      hashtags = []
      senti=[]
      i=0
      positive=0
      negative=0
      neutral=0
      global twitterData
      global queryString
      print("Url: Sentiment, data: ", twitterData)
      
      twitterData = snstwitter.TwitterSearchScraper(query).get_items()
          
      for tweet in twitterData: 
          if tweet.lang=="en":
              i+=1
              if(i==200):
                  break
              sentence= tweet.rawContent
              print(sentence)
              sid_obj = SentimentIntensityAnalyzer()
              sentiment_dict = sid_obj.polarity_scores([sentence])
              print(sentiment_dict['neg']*100, "% Negative")
              print(sentiment_dict['pos']*100, "% Positive")
              print("Review Overall Analysis", end = " ") 
              if sentiment_dict['compound'] >= 0.05 :
                  positive+=1
              elif sentiment_dict['compound'] <= -0.05 :
                  negative+=1
              else :
                  neutral+=1
      senti={"positive":positive, "negative":negative, "neutral":neutral}
      labels = list(senti.keys())
      values = list(senti.values())
          
      data = {"Target": ["Positive","Negative", "Neutral"], "Value": [positive, negative, neutral]}
      df = pd.DataFrame(data)
  
      target=["Positive","Negative", "Neutral"]
      value=[positive, negative, neutral]
  
      # palette_color = sns.color_palette('bright')
      #plt.pie(value, labels=target, colors=palette_color, autopct='%.0f%%')
      sns.barplot(x="Target" , y="Value", data=df, palette="Set2")
      plt.title("Sentiment Analysis on the Tweets related to Article")
  
      plt.savefig('senti.png')
  
      # fig = plt.gcf()
      # buf = io.BytesIO()
      # fig.savefig(buf, format="png")
      # buf.seek(0)
      # base64_string = base64.b64encode(buf.read()).decode("utf-8")
  
      # print(base64_string)
      # return base64_string
  
      # fig = plt.gcf()
  
      # buf = io.BytesIO()
      # fig.savefig(buf, format="png")
      # buf.seek(0)
      # base64_string = base64.b64encode(buf.read()).decode("utf-8")
  
      # print(base64_string)
      # return base64_string
      # # return {"labels":labels, "values":values}
  
      return send_file("./senti.png", mimetype='image/png')
  
  
              
  @app.route('/sentiment_article')
  def sentiment_article():
      senti=[]
      url = request.args['url']
      goose = Goose()
      articles = goose.extract(url)
      sentence1 = articles.cleaned_text
      sid_obj = SentimentIntensityAnalyzer()
      sentiment_dict = sid_obj.polarity_scores([sentence1])
      print(sentiment_dict['neg']*100, "% Negative")
      print(sentiment_dict['pos']*100, "% Positive")
      print("Review Overall Analysis", end = " ") 
      if sentiment_dict['compound'] >= 0.05 :
          senti.append("Positive")
      elif sentiment_dict['compound'] <= -0.05 :
          senti.append("Negative")
      else :
          senti.append("Neutral")
      return jsonify({"result":senti,"pos":sentiment_dict})
  
  
  @app.route('/summary')
  def summary():
      try:
  
          url = request.args['url']
          goose = Goose()
          articles = goose.extract(url)
          output = query({
          "inputs":  articles.cleaned_text
          })
          print(output)
      except:
          return "Please put the relevant url article"
  
      return jsonify({"result": output[0]['summary_text']})
  
  @app.route('/cloud2')
  def plotly_wordcloud2():
      url = request.args['url']
      goose = Goose()
      articles = goose.extract(url)
      url = articles.cleaned_text
      wordcloud = WordCloud(width=1280, height=853, margin=0,
                        colormap='Blues').generate(url)
      wordcloud.to_file("./wordcloud.png")
      plt.imshow(wordcloud, interpolation='bilinear')
      plt.axis('off')
      plt.margins(x=0, y=0)
  
      # fig = plt.gcf()
      # buf = io.BytesIO()
      # fig.savefig(buf, format="png")
      # buf.seek(0)
      # base64_string = base64.b64encode(buf.read()).decode("utf-8")
  
      # print(base64_string)
      # return base64_string
  
      return send_file("./wordcloud.png", mimetype='image/png')
      
  
      
  @app.route('/propaganda')
  def propaganda():
      url = request.args['url']
      goose = Goose()
      articles = goose.extract(url)
      output = queryprop({
  	"inputs":  articles.cleaned_text[0:600]
      })
      
      yes = output[0][0]['score']
      no = 1 - yes
      
      data = {"Target": ["Propagandastic","Non-Propagandastic"], "Value": [yes, no]}
      df = pd.DataFrame(data)
      sns.barplot(x="Target" , y="Value", data=df, palette="Set2")
      plt.title("Propagandastic Evaluation of the Article")
  
      # fig = plt.gcf()
      # buf = io.BytesIO()
      # fig.savefig(buf, format="png")
      # buf.seek(0)
      # base64_string = base64.b64encode(buf.read()).decode("utf-8")
      plt.savefig('propaganda.png')
  
      # fig = plt.gcf()
      # buf = io.BytesIO()
      # fig.savefig(buf, format="png")
      # buf.seek(0)
      # base64_string = base64.b64encode(buf.read()).decode("utf-8")
  
      # print(base64_string)
      # return base64_string
  
      return send_file("./propaganda.png", mimetype='image/png')
  
      # return base64_string
      # return jsonify({"yes": yes, "no": no})
  
  
  @app.route("/chat", methods=["GET"])
  def chat():
      # Get the query from the request body.
      query = request.args['url']
      # create an app in https://developer.twitter.com/en/apps
      # create reader, specify twitter handles
      reader = TwitterTweetReader(os.getenv('BEARER_TOKEN'))
      documents = reader.load_data(["ANI"])
      documents1 = reader.load_data(["ZeeNews"])
      documents2 = reader.load_data(["TV9Bharatvarsh"])
      documents3 = reader.load_data(["Republic_Bharat"])
      documents4 = reader.load_data(["AajTak"])
      
      # Create a new instance of the llama chatbot agent.
      agent = llama_index.GPTVectorStoreIndex.from_documents(documents1+documents+documents2+documents3+documents4)
      chat_engine = agent.as_chat_engine(verbose=True)
  
      # Get the response from the llama chatbot agent.
      response = chat_engine.chat(query)
  
      # Return the response as JSON.
      return jsonify({"response": response})
  
  
  @app.route('/hate-speech')
  def hate():
      url = request.args['url']
      goose = Goose()
      articles = goose.extract(url)
      url = articles.cleaned_text
      analyzer = SentimentIntensityAnalyzer() 
          # the object outputs the scores into a dict
      sentiment_dict = analyzer.polarity_scores(url) 
      if sentiment_dict['compound'] >= 0.05 : 
          category = ("Positive ")
      elif sentiment_dict['compound'] <= - 0.05 : 
          category = ("Negative ") 
      else : 
          category = ("Neutral ")
      print(category)
      
      if category == "Negative ":
          res='Hate Speech'
      else:
          res='Not Hate Speech'
      return jsonify({"sentiment":category,"verdict":res})
  @app.route('/multi-class')
  def category():
      url = request.args['url']
  
      # Print the output url.
      print(url)
      output=query_hate({
      "inputs": [str(url)],
      "keywords": ["LABEL_0", "LABEL_1", "LABEL_2", "LABEL_3"]})
      # print(output[0])
      result = {}
      if url:
          for data in output[0]:
              if data['label'] == "LABEL_0":
                  result["ACCEPTABLE"] = round(data['score']*100, 2)
              elif data['label'] == "LABEL_1":
                  result["INAPPROPRIATE"] = round(data['score']*100, 2)
              elif data['label'] == "LABEL_2":
                  result["OFFENSIVE"] = round(data['score']*100, 2)
              elif data['label'] == "LABEL_3":
                  result["VIOLENT"] = round(data['score']*100, 2)
  
          labels = list(result.keys())
          values = list(result.values())
  
  
      data = {"Target":list(result.keys()) , "Value": list(result.values())}
      df = pd.DataFrame(data)
      
      sns.barplot(x="Target" , y="Value", data=df, palette="Set2")
      plt.title("Hate Speech Params Detection present in Article")
  
      # fig = plt.gcf()
      # buf = io.BytesIO()
      # fig.savefig(buf, format="png")
      # buf.seek(0)
      # base64_string = base64.b64encode(buf.read()).decode("utf-8")
      plt.savefig('hate.png')
  
      # fig = plt.gcf()
      # buf = io.BytesIO()
      # fig.savefig(buf, format="png")
      # buf.seek(0)
      # base64_string = base64.b64encode(buf.read()).decode("utf-8")
  
      # print(base64_string)
      # return base64_string
  
      return send_file("./hate.png", mimetype='image/png')
  
  
      # return jsonify({"result":result})
  
             
  @app.route('/authenticity')
  def auth():
      url = request.args['url']
      lis = []
      df = pd.read_csv('blacklist.csv')
      for i in range(len(df)):
          lis.append(df.loc[i, "MBFC"])
  
      for l in lis:
          if(url.__contains__(l)):
              return {"authentic":False}
  
      return { "authentic": True }
  
  @app.route('/bot-activity')
  def botActivity():
      url = request.args['url']
      i=0
      usernames = []
      time = []
      finalusername = []
      for tweet in snstwitter.TwitterSearchScraper(url).get_items():
          usernames.append(tweet.user.username)
          time.append(tweet.date)
          if(i==150):
              break
          i+=1
  
      flag = False
      for i in range(len(time)-1):
          a = time[i]
          b = time[i+1]
          c = a-b
          if(c.seconds <= 60):            
              finalusername.append(usernames[i+1])
  
      print("username: ", finalusername)
      if(len(finalusername) > 3):
          flag = True
      return jsonify({"bots":list(set(finalusername)),"flag":flag})
  
  
  if __name__ == '__main__':
      app.run(host="0.0.0.0",port=5000,debug=True)
  
apis: llama_index.GPTVectorStoreIndex.from_documents
extract_api: [((1520, 1535), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1525, 1535), False, 'from flask import Flask, jsonify\n'), ((1536, 1545), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (1540, 1545), False, 'from flask_cors import CORS\n'), ((1613, 1626), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (1624, 1626), False, 'from dotenv import load_dotenv\n'), ((1734, 1761), 'os.getenv', 'os.getenv', (['"""OPENAI_API_KEY"""'], {}), "('OPENAI_API_KEY')\n", (1743, 1761), False, 'import os\n'), ((2726, 2754), 'os.getenv', 'os.getenv', (['"""SERPAPI_API_KEY"""'], {}), "('SERPAPI_API_KEY')\n", (2735, 2754), False, 'import os\n'), ((1634, 1662), 'os.getenv', 'os.getenv', (['"""HUGGINGFACE_API"""'], {}), "('HUGGINGFACE_API')\n", (1643, 1662), False, 'import os\n'), ((1670, 1697), 'os.getenv', 'os.getenv', (['"""OPENAI_API_KEY"""'], {}), "('OPENAI_API_KEY')\n", (1679, 1697), False, 'import os\n'), ((1705, 1730), 'os.getenv', 'os.getenv', (['"""BEARER_TOKEN"""'], {}), "('BEARER_TOKEN')\n", (1714, 1730), False, 'import os\n'), ((2699, 2726), 'flask.jsonify', 'jsonify', (["{'result': tweets}"], {}), "({'result': tweets})\n", (2706, 2726), False, 'from flask import request, jsonify\n'), ((2879, 2902), 'flask.request.args.get', 'request.args.get', (['"""url"""'], {}), "('url')\n", (2895, 2902), False, 'from flask import request, jsonify\n'), ((2918, 2943), 'requests.get', 'requests.get', (['article_url'], {}), '(article_url)\n', (2930, 2943), False, 'import requests\n'), ((2955, 2997), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.url', '"""html.parser"""'], {}), "(response.url, 'html.parser')\n", (2968, 2997), False, 'from bs4 import BeautifulSoup\n'), ((3059, 3072), 'urllib.parse.quote', 'quote', (['header'], {}), '(header)\n', (3064, 3072), False, 'from urllib.parse import quote\n'), ((3224, 3244), 'serpapi.GoogleSearch', 'GoogleSearch', (['params'], {}), '(params)\n', (3236, 3244), False, 'from serpapi import GoogleSearch\n'), ((3368, 3427), 'flask.jsonify', 'jsonify', (["{'article_header': header, 'related_links': links}"], {}), "({'article_header': header, 'related_links': links})\n", (3375, 3427), False, 'from flask import request, jsonify\n'), ((3627, 3649), 'langchain.agents.load_tools', 'load_tools', (['tool_names'], {}), '(tool_names)\n', (3637, 3649), False, 'from langchain.agents import load_tools\n'), ((3672, 3837), 'langchain.prompts.PromptTemplate', 'PromptTemplate', ([], {'input_variables': "['topic']", 'template': '"""To classify the news: {topic} in to the categories like murder, fire, accident, natural disaster, etc"""'}), "(input_variables=['topic'], template=\n    'To classify the news: {topic} in to the categories like murder, fire, accident, natural disaster, etc'\n    )\n", (3686, 3837), False, 'from langchain.prompts import PromptTemplate\n'), ((4677, 4747), 'langchain.memory.ConversationBufferMemory', 'ConversationBufferMemory', ([], {'input_key': '"""topic"""', 'memory_key': '"""chat_history"""'}), "(input_key='topic', memory_key='chat_history')\n", (4701, 4747), False, 'from langchain.memory import ConversationBufferMemory\n'), ((4852, 4875), 'langchain.llms.OpenAI', 'OpenAI', ([], {'temperature': '(0.9)'}), '(temperature=0.9)\n', (4858, 4875), False, 'from langchain.llms import OpenAI\n'), ((4895, 4994), 'langchain.chains.LLMChain', 'LLMChain', ([], {'llm': 'llm', 'prompt': 'title_template', 'verbose': '(True)', 'output_key': '"""title"""', 'memory': 'title_memory'}), "(llm=llm, prompt=title_template, verbose=True, output_key='title',\n    memory=title_memory)\n", (4903, 4994), False, 'from langchain.chains import LLMChain, SequentialChain\n'), ((5123, 5202), 'langchain.agents.initialize_agent', 'initialize_agent', (['tools', 'llm'], {'agent': '"""zero-shot-react-description"""', 'verbose': '(True)'}), "(tools, llm, agent='zero-shot-react-description', verbose=True)\n", (5139, 5202), False, 'from langchain.agents import initialize_agent\n'), ((6021, 6074), 'requests.post', 'requests.post', (['API_URL'], {'headers': 'headers', 'json': 'payload'}), '(API_URL, headers=headers, json=payload)\n', (6034, 6074), False, 'import requests\n'), ((6136, 6194), 'requests.post', 'requests.post', (['API_URL_PROP'], {'headers': 'headers', 'json': 'payload'}), '(API_URL_PROP, headers=headers, json=payload)\n', (6149, 6194), False, 'import requests\n'), ((6257, 6315), 'requests.post', 'requests.post', (['API_URL_HATE'], {'headers': 'headers', 'json': 'payload'}), '(API_URL_HATE, headers=headers, json=payload)\n', (6270, 6315), False, 'import requests\n'), ((7658, 7676), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (7670, 7676), True, 'import pandas as pd\n'), ((7894, 7953), 'seaborn.barplot', 'sns.barplot', ([], {'x': '"""Target"""', 'y': '"""Value"""', 'data': 'df', 'palette': '"""Set2"""'}), "(x='Target', y='Value', data=df, palette='Set2')\n", (7905, 7953), True, 'import seaborn as sns\n'), ((7959, 8023), 'matplotlib.pyplot.title', 'plt.title', (['"""Sentiment Analysis on the Tweets related to Article"""'], {}), "('Sentiment Analysis on the Tweets related to Article')\n", (7968, 8023), True, 'import matplotlib.pyplot as plt\n'), ((8029, 8053), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""senti.png"""'], {}), "('senti.png')\n", (8040, 8053), True, 'import matplotlib.pyplot as plt\n'), ((8567, 8613), 'flask.send_file', 'send_file', (['"""./senti.png"""'], {'mimetype': '"""image/png"""'}), "('./senti.png', mimetype='image/png')\n", (8576, 8613), False, 'from flask import send_file\n'), ((8742, 8749), 'goose3.Goose', 'Goose', ([], {}), '()\n', (8747, 8749), False, 'from goose3 import Goose\n'), ((8836, 8864), 'vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer', 'SentimentIntensityAnalyzer', ([], {}), '()\n', (8862, 8864), False, 'from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer\n'), ((9285, 9334), 'flask.jsonify', 'jsonify', (["{'result': senti, 'pos': sentiment_dict}"], {}), "({'result': senti, 'pos': sentiment_dict})\n", (9292, 9334), False, 'from flask import request, jsonify\n'), ((9654, 9700), 'flask.jsonify', 'jsonify', (["{'result': output[0]['summary_text']}"], {}), "({'result': output[0]['summary_text']})\n", (9661, 9700), False, 'from flask import request, jsonify\n'), ((9791, 9798), 'goose3.Goose', 'Goose', ([], {}), '()\n', (9796, 9798), False, 'from goose3 import Goose\n'), ((10024, 10071), 'matplotlib.pyplot.imshow', 'plt.imshow', (['wordcloud'], {'interpolation': '"""bilinear"""'}), "(wordcloud, interpolation='bilinear')\n", (10034, 10071), True, 'import matplotlib.pyplot as plt\n'), ((10076, 10091), 'matplotlib.pyplot.axis', 'plt.axis', (['"""off"""'], {}), "('off')\n", (10084, 10091), True, 'import matplotlib.pyplot as plt\n'), ((10096, 10117), 'matplotlib.pyplot.margins', 'plt.margins', ([], {'x': '(0)', 'y': '(0)'}), '(x=0, y=0)\n', (10107, 10117), True, 'import matplotlib.pyplot as plt\n'), ((10355, 10405), 'flask.send_file', 'send_file', (['"""./wordcloud.png"""'], {'mimetype': '"""image/png"""'}), "('./wordcloud.png', mimetype='image/png')\n", (10364, 10405), False, 'from flask import send_file\n'), ((10503, 10510), 'goose3.Goose', 'Goose', ([], {}), '()\n', (10508, 10510), False, 'from goose3 import Goose\n'), ((10769, 10787), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (10781, 10787), True, 'import pandas as pd\n'), ((10792, 10851), 'seaborn.barplot', 'sns.barplot', ([], {'x': '"""Target"""', 'y': '"""Value"""', 'data': 'df', 'palette': '"""Set2"""'}), "(x='Target', y='Value', data=df, palette='Set2')\n", (10803, 10851), True, 'import seaborn as sns\n'), ((10857, 10910), 'matplotlib.pyplot.title', 'plt.title', (['"""Propagandastic Evaluation of the Article"""'], {}), "('Propagandastic Evaluation of the Article')\n", (10866, 10910), True, 'import matplotlib.pyplot as plt\n'), ((11085, 11114), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""propaganda.png"""'], {}), "('propaganda.png')\n", (11096, 11114), True, 'import matplotlib.pyplot as plt\n'), ((11352, 11403), 'flask.send_file', 'send_file', (['"""./propaganda.png"""'], {'mimetype': '"""image/png"""'}), "('./propaganda.png', mimetype='image/png')\n", (11361, 11403), False, 'from flask import send_file\n'), ((12085, 12198), 'llama_index.GPTVectorStoreIndex.from_documents', 'llama_index.GPTVectorStoreIndex.from_documents', (['(documents1 + documents + documents2 + documents3 + documents4)'], {}), '(documents1 + documents +\n    documents2 + documents3 + documents4)\n', (12131, 12198), False, 'import llama_index\n'), ((12380, 12411), 'flask.jsonify', 'jsonify', (["{'response': response}"], {}), "({'response': response})\n", (12387, 12411), False, 'from flask import request, jsonify\n'), ((12495, 12502), 'goose3.Goose', 'Goose', ([], {}), '()\n', (12500, 12502), False, 'from goose3 import Goose\n'), ((12584, 12612), 'vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer', 'SentimentIntensityAnalyzer', ([], {}), '()\n', (12610, 12612), False, 'from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer\n'), ((13057, 13105), 'flask.jsonify', 'jsonify', (["{'sentiment': category, 'verdict': res}"], {}), "({'sentiment': category, 'verdict': res})\n", (13064, 13105), False, 'from flask import request, jsonify\n'), ((14023, 14041), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (14035, 14041), True, 'import pandas as pd\n'), ((14051, 14110), 'seaborn.barplot', 'sns.barplot', ([], {'x': '"""Target"""', 'y': '"""Value"""', 'data': 'df', 'palette': '"""Set2"""'}), "(x='Target', y='Value', data=df, palette='Set2')\n", (14062, 14110), True, 'import seaborn as sns\n'), ((14116, 14176), 'matplotlib.pyplot.title', 'plt.title', (['"""Hate Speech Params Detection present in Article"""'], {}), "('Hate Speech Params Detection present in Article')\n", (14125, 14176), True, 'import matplotlib.pyplot as plt\n'), ((14351, 14374), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""hate.png"""'], {}), "('hate.png')\n", (14362, 14374), True, 'import matplotlib.pyplot as plt\n'), ((14612, 14657), 'flask.send_file', 'send_file', (['"""./hate.png"""'], {'mimetype': '"""image/png"""'}), "('./hate.png', mimetype='image/png')\n", (14621, 14657), False, 'from flask import send_file\n'), ((14805, 14833), 'pandas.read_csv', 'pd.read_csv', (['"""blacklist.csv"""'], {}), "('blacklist.csv')\n", (14816, 14833), True, 'import pandas as pd\n'), ((3175, 3203), 'os.getenv', 'os.getenv', (['"""SERPAPI_API_KEY"""'], {}), "('SERPAPI_API_KEY')\n", (3184, 3203), False, 'import os\n'), ((5770, 5798), 'os.getenv', 'os.getenv', (['"""HUGGINGFACE_API"""'], {}), "('HUGGINGFACE_API')\n", (5779, 5798), False, 'import os\n'), ((9432, 9439), 'goose3.Goose', 'Goose', ([], {}), '()\n', (9437, 9439), False, 'from goose3 import Goose\n'), ((11741, 11766), 'os.getenv', 'os.getenv', (['"""BEARER_TOKEN"""'], {}), "('BEARER_TOKEN')\n", (11750, 11766), False, 'import os\n'), ((2142, 2180), 'snscrape.modules.twitter.TwitterSearchScraper', 'snstwitter.TwitterSearchScraper', (['query'], {}), '(query)\n', (2173, 2180), True, 'import snscrape.modules.twitter as snstwitter\n'), ((5541, 5580), 'snscrape.modules.twitter.TwitterProfileScraper', 'snstwitter.TwitterProfileScraper', (['query'], {}), '(query)\n', (5573, 5580), True, 'import snscrape.modules.twitter as snstwitter\n'), ((6654, 6692), 'snscrape.modules.twitter.TwitterSearchScraper', 'snstwitter.TwitterSearchScraper', (['query'], {}), '(query)\n', (6685, 6692), True, 'import snscrape.modules.twitter as snstwitter\n'), ((6926, 6954), 'vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer', 'SentimentIntensityAnalyzer', ([], {}), '()\n', (6952, 6954), False, 'from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer\n'), ((9881, 9942), 'wordcloud.WordCloud', 'WordCloud', ([], {'width': '(1280)', 'height': '(853)', 'margin': '(0)', 'colormap': '"""Blues"""'}), "(width=1280, height=853, margin=0, colormap='Blues')\n", (9890, 9942), False, 'from wordcloud import WordCloud, STOPWORDS\n'), ((15185, 15221), 'snscrape.modules.twitter.TwitterSearchScraper', 'snstwitter.TwitterSearchScraper', (['url'], {}), '(url)\n', (15216, 15221), True, 'import snscrape.modules.twitter as snstwitter\n')]