<commit_before>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import ipywidgets as widgets\n",
    "from IPython.display import display\n",
    "from IPython.utils.traitlets import Unicode\n",
    "from pymongo import MongoClient\n",
    "\n",
    "print('Input your password to connect to MongoDB')\n",
    "password = widgets.Text(description=\"Password:\")\n",
    "login_btn = widgets.Button(description=\"Login\")\n",
    "\n",
    "def login(sender):\n",
    "    try:\n",
    "        client = MongoClient(\"mongodb://TeamProject:\"+password.value+\"@twitterdb-shard-00-00-qc9br.mongodb.net:27017,twitterdb-shard-00-01-qc9br.mongodb.net:27017,twitterdb-shard-00-02-qc9br.mongodb.net:27017/test?ssl=true&replicaSet=TwitterDB-shard-0&authSource=admin\")\n",
    "        global db\n",
    "        db = client.twitterdb\n",
    "        print('Connection established successfully')\n",
    "    except ValueError:\n",
    "        print(ValueError)\n",
    "\n",
    "db = login_btn.on_click(login)\n",
    "\n",
    "password.on_submit(login)  \n",
    "\n",
    "display(password, login_btn)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    ""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tweepy\n",<commit_msg>Updated version of ipywidgets and added historical data retrieval<commit_after>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import ipywidgets as widgets\n",
    "from IPython.display import display\n",
    "from IPython.utils.traitlets import Unicode\n",
    "from pymongo import MongoClient\n",
    "\n",
    "print('Input your password to connect to MongoDB')\n",
    "password = widgets.Text(description=\"Password:\")\n",
    "login_btn = widgets.Button(description=\"Login\")\n",
    "\n",
    "def login(sender):\n",
    "    try:\n",
    "        client = MongoClient(\"mongodb://TeamProject:\"+password.value+\"@twitterdb-shard-00-00-qc9br.mongodb.net:27017,twitterdb-shard-00-01-qc9br.mongodb.net:27017,twitterdb-shard-00-02-qc9br.mongodb.net:27017/test?ssl=true&replicaSet=TwitterDB-shard-0&authSource=admin\")\n",
    "        global db\n",
    "        db = client.twitterdb\n",
    "        print('Connection established successfully')\n",
    "    except ValueError:\n",
    "        print(ValueError)\n",
    "\n",
    "db = login_btn.on_click(login)\n",
    "\n",
    "password.on_submit(login)  \n",
    "\n",
    "display(password, login_btn)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "widgets.IntSlider(\n",
    "    value=7,\n",
    "    min=0,\n",
    "    max=10,\n",
    "    step=1,\n",
    "    description='Test:',\n",
    "    disabled=False,\n",
    "    continuous_update=False,\n",
    "    orientation='horizontal',\n",
    "    readout=True,\n",
    "    readout_format='i',\n",
    "    slider_color='white'\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    ""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tweepy\n",
{'fraction_non_alphanumeric': 0.20215241419429902, 'fraction_numerical': 0.019488074461896453, 'mean_word_length': 2.762582056892779, 'pattern_counts': {'":': 37, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7105704', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1244, 'n_words': 182}