[
  {
    "path": "Alam_data.txt",
    "content": "12:31AM\n"
  },
  {
    "path": "Alert.py",
    "content": "import os\nfrom winotify import Notification, audio\nfrom os import getcwd\n\ndef Alert(Text):\n    icon_path = r\"C:\\Users\\chatu\\OneDrive\\Desktop\\Jarvis\\logo.png\"\n\n    toast = Notification(\n        app_id=\"🟢 J.A.R.V.I.S.\",\n        title=Text,\n        duration=\"long\",\n        icon=icon_path\n    )\n\n    toast.set_audio(audio.Default, loop=False)\n\n\n    toast.add_actions(label=\"Click me\", launch=\"https://www.google.com\")\n    toast.add_actions(label=\"Dismiss\", launch=\"https://www.google.com\")\n\n\n    toast.show()\n\n"
  },
  {
    "path": "Automation/Automation_Brain.py",
    "content": "from Automation.open_App import open_App\nfrom Automation.Web_Open import openweb\nimport pyautogui as gui\nfrom Automation.Play_Music_YT import play_music_on_youtube\nfrom TextToSpeech import Fast_DF_TTS\nfrom Automation.playmusic_Sfy import play_music_on_spotify\nfrom Automation.Battery import check_percentage\nfrom os import getcwd\nimport time\nfrom Automation.tab_automation import perform_browser_action\nfrom Automation.Youtube_play_back import perform_media_action\nimport pywhatkit\nfrom Automation.scrool_system import perform_scroll_action\nimport threading\nfrom TextToSpeech.Fast_DF_TTS import speak\n\ndef play():\n    gui.press(\"space\")\n    \ndef search_google(text):\n    pywhatkit.search(text)\n\ndef close():\n    gui.hotkey('alt','f4')\n    \ndef search(text):\n    gui.press(\"/\")\n    time.sleep(0.3)\n    gui.write(text)\n\ndef Open_Brain(text):\n    if \"website\" in text or \"open website named\" in text:\n        text = text.replace(\"open\",\"\").strip()\n        text = text.replace(\"website\",\"\").strip()\n        text = text.replace(\"open website named\",\"\").strip()\n        t1 = threading.Thread(target=speak,args=(f\"Navigating {text} website\",))\n        t2 = threading.Thread(target=openweb,args=(text,))\n        t1.start()\n        t2.start()\n        t1.join()\n        t2.join()\n    else:\n        text = text.replace(\"open\",\"\").strip()\n        text = text.replace(\"app\",\"\").strip()\n        t1 = threading.Thread(target=speak,args=(f\"Navigating {text} application\",))\n        t2 = threading.Thread(target=open_App,args=(text,))\n        t1.start()\n        t2.start()\n        t1.join()\n        t2.join()\n        \ndef clear_file():\n    with open(f\"{getcwd()}\\\\input.txt\",\"w\") as file:\n        file.truncate(0)\n\ndef Auto_main_brain(text):\n   try: \n    if text.startswith(\"open\"):\n        Open_Brain(text)\n    elif \"close\" in text:\n        close()\n    elif \"play music\" in text or \"play music on youtube\" in text:\n        Fast_DF_TTS.speak(\"which song do you want to play sir.\")\n        clear_file()\n        output_text = \"\"\n        while True:\n            with open(\"input.txt\",\"r\") as file:\n                input_text = file.read().lower()\n            if input_text != output_text:\n                output_text = input_text\n                if output_text.endswith(\"song\"):\n                    play_music_on_youtube(output_text)\n                    break\n                    \n        else:\n            pass\n        \n    elif \"play some music\" in text or \"play music on spotify\" in text:\n        Fast_DF_TTS.speak(\"Which song do you want to play, sir.\")\n        clear_file()\n        output_text = \"\"\n        while True:\n            with open(\"input.txt\", \"r\") as file:\n                input_text = file.read().lower()\n            if input_text != output_text:\n                output_text = input_text\n                if output_text.endswith(\"song\"):\n                    play_music_on_spotify(output_text)\n                    break\n\n    elif \"check battery percentage\" in text or \"check battery level\" in text:\n        check_percentage()\n    elif text.startswith(\"search\"):\n        text = text.replace(\"search\",\"\")\n        text = text.strip()\n        t1 = threading.Thread(target=speak,args=(f\"doing research about {text}\",))\n        t2 = threading.Thread(target=search,args=(text,))\n        t1.start()\n        t2.start()\n        t1.join()\n        t2.join()\n        time.sleep(0.5)\n        gui.press(\"enter\")\n    elif \"search in google\" in text:\n        text = text.replace(\"search in google\",\"\")\n        t1 = threading.Thread(target=speak,args=(f\"performing research about {text} in google search engine\",))\n        t2 = threading.Thread(target=search_google,args=(text,))\n        t1.start()\n        t2.start()\n        t1.join()\n        t2.join()\n    elif \"play\" in text or \"stop\" in text or \"pause\" in text:\n        play()\n    else:\n        perform_browser_action(text)\n        perform_media_action(text)\n        perform_scroll_action(text)\n        \n   except Exception as e:\n       print(\"error : \" + e)\n       "
  },
  {
    "path": "Automation/Battery.py",
    "content": "# pip install psutil\n# CTRL + J Terminal \n\nimport psutil\nimport time\nimport time\nfrom TextToSpeech.Fast_DF_TTS import speak\nimport threading\nfrom Alert import Alert\n\nbattery = psutil.sensors_battery()\n\ndef battery_Alert():\n    while True:\n        time.sleep(3)\n        percentage = int(battery.percent)\n        if percentage == 100:\n            t1 = threading.Thread(target=Alert,args=(\"100%charge\",))\n            t2 = threading.Thread(target=speak,args=(\"100% charged. Please unplug it.\",))\n            t1.start()\n            t2.start()\n            t1.join()\n            t2.join()\n        elif percentage <= 20:\n            t1 = threading.Thread(target=Alert,args=(\"Battery Low\",))\n            t2 = threading.Thread(target=speak,args=(\"Sir,Sorry to disturb you but battery is Low now\",))\n            t1.start()\n            t2.start()\n            t1.join()\n            t2.join()\n        elif percentage <=10:\n            t1 = threading.Thread(target=Alert,args=(\"Battery is too Low\",))\n            t2 = threading.Thread(target=speak,args=(\"Sir,Sorry to disturb you but we are running on very low battery power\",))\n            t1.start()\n            t2.start()\n            t1.join()\n            t2.join()\n        elif percentage <= 5:\n            t1 = threading.Thread(target=Alert,args=(\"Battery is going to died\",))\n            t2 = threading.Thread(target=speak,args=(\"Sir,Sorry to disturb you but this is your last chance sir , charge your system now\",))\n            t1.start()\n            t2.start()\n            t1.join()\n            t2.join()\n        time.sleep(10)\n\n\n\n\ndef check_plug():\n    print(\"_____started___\")\n    battery = psutil.sensors_battery()\n    previous_state = battery.power_plugged\n    while True:\n        battery = psutil.sensors_battery()\n        if battery.power_plugged != previous_state:\n            if battery.power_plugged:\n                t1 = threading.Thread(target=Alert,args=(\"Charging **STARTED**\",))\n                t2 = threading.Thread(target=speak,args=(\"Charging Started\",))\n                t1.start()\n                t2.start()\n                t1.join()\n                t2.join()\n            else:\n                t1 = threading.Thread(target=Alert,args=(\"Charging **STOP**\",))\n                t2 = threading.Thread(target=speak,args=(\"Charging Stop\",))\n                t1.start()\n                t2.start()\n                t1.join()\n                t2.join()\n      \n            previous_state = battery.power_plugged\n\n\n\ndef check_percentage():\n    battery = psutil.sensors_battery()\n    percent = int(battery.percent)\n    t1 = threading.Thread(target=Alert,args=(f\"The device is running on {percent}% power\",))\n    t2 = threading.Thread(target=speak,args=(f\"The device is running on {percent}% power\",))\n    t1.start()\n    t2.start()\n    t1.join()\n    t2.join()\n    \n\n"
  },
  {
    "path": "Automation/Play_Music_YT.py",
    "content": "import pywhatkit as pw\n\ndef play_music_on_youtube(Song_name):\n    pw.playonyt(Song_name)\n"
  },
  {
    "path": "Automation/Web_Data.py",
    "content": "websites = {\n    \"youtube\": \"www.youtube.com\",\n    \"facebook\": \"www.facebook.com\",\n    \"github\": \"www.github.com\",\n    \"youtube studio\": \"studio.youtube.com\",\n    \"twitter\": \"www.twitter.com\",\n    \"instagram\": \"www.instagram.com\",\n    \"linkedin\": \"www.linkedin.com\",\n    \"wikipedia\": \"www.wikipedia.org\",\n    \"reddit\": \"www.reddit.com\",\n    \"pinterest\": \"www.pinterest.com\",\n    \"quora\": \"www.quora.com\",\n    \"tumblr\": \"www.tumblr.com\",\n    \"flickr\": \"www.flickr.com\",\n    \"snapchat\": \"www.snapchat.com\",\n    \"tiktok\": \"www.tiktok.com\",\n    \"vimeo\": \"www.vimeo.com\",\n    \"dropbox\": \"www.dropbox.com\",\n    \"onedrive\": \"www.onedrive.com\",\n    \"google drive\": \"drive.google.com\",\n    \"icloud\": \"www.icloud.com\",\n    \"amazon\": \"www.amazon.com\",\n    \"ebay\": \"www.ebay.com\",\n    \"alibaba\": \"www.alibaba.com\",\n    \"netflix\": \"www.netflix.com\",\n    \"hulu\": \"www.hulu.com\",\n    \"disney plus\": \"www.disneyplus.com\",\n    \"hbo max\": \"www.hbomax.com\",\n    \"spotify\": \"www.spotify.com\",\n    \"soundcloud\": \"www.soundcloud.com\",\n    \"apple music\": \"www.apple.com/apple-music\",\n    \"pandora\": \"www.pandora.com\",\n    \"deezer\": \"www.deezer.com\",\n    \"bandcamp\": \"www.bandcamp.com\",\n    \"bbc\": \"www.bbc.com\",\n    \"cnn\": \"www.cnn.com\",\n    \"nytimes\": \"www.nytimes.com\",\n    \"the guardian\": \"www.theguardian.com\",\n    \"forbes\": \"www.forbes.com\",\n    \"bloomberg\": \"www.bloomberg.com\",\n    \"reuters\": \"www.reuters.com\",\n    \"espn\": \"www.espn.com\",\n    \"fox news\": \"www.foxnews.com\",\n    \"nbc news\": \"www.nbcnews.com\",\n    \"cbs news\": \"www.cbsnews.com\",\n    \"abc news\": \"www.abcnews.go.com\",\n    \"msnbc\": \"www.msnbc.com\",\n    \"npr\": \"www.npr.org\",\n    \"wsj\": \"www.wsj.com\",\n    \"yahoo news\": \"news.yahoo.com\",\n    \"buzzfeed\": \"www.buzzfeed.com\",\n    \"huffpost\": \"www.huffpost.com\",\n    \"canva\": \"www.canva.com\",\n    \"chatgpt\": \"chat.openai.com\",\n    \"slack\": \"www.slack.com\",\n    \"trello\": \"www.trello.com\",\n    \"asana\": \"www.asana.com\",\n    \"zoom\": \"www.zoom.us\",\n    \"skype\": \"www.skype.com\",\n    \"microsoft teams\": \"www.microsoft.com/microsoft-teams\",\n    \"google meet\": \"meet.google.com\",\n    \"webex\": \"www.webex.com\",\n    \"jira\": \"www.atlassian.com/software/jira\",\n    \"notion\": \"www.notion.so\",\n    \"airtable\": \"www.airtable.com\",\n    \"monday\": \"www.monday.com\",\n    \"clickup\": \"www.clickup.com\",\n    \"dropbox paper\": \"www.dropbox.com/paper\",\n    \"confluence\": \"www.atlassian.com/software/confluence\",\n    \"figma\": \"www.figma.com\",\n    \"adobe xd\": \"www.adobe.com/products/xd.html\",\n    \"invision\": \"www.invisionapp.com\",\n    \"microsoft word\": \"www.microsoft.com/microsoft-365/word\",\n    \"google docs\": \"docs.google.com\",\n    \"medium\": \"www.medium.com\",\n    \"wordpress\": \"www.wordpress.com\",\n    \"wix\": \"www.wix.com\",\n    \"squarespace\": \"www.squarespace.com\",\n    \"shopify\": \"www.shopify.com\",\n    \"bigcommerce\": \"www.bigcommerce.com\",\n    \"weebly\": \"www.weebly.com\",\n    \"godaddy\": \"www.godaddy.com\",\n    \"namecheap\": \"www.namecheap.com\",\n    \"bluehost\": \"www.bluehost.com\",\n    \"siteground\": \"www.siteground.com\",\n    \"hostgator\": \"www.hostgator.com\",\n    \"dreamhost\": \"www.dreamhost.com\",\n    \"a2 hosting\": \"www.a2hosting.com\",\n    \"inmotion hosting\": \"www.inmotionhosting.com\",\n    \"digitalocean\": \"www.digitalocean.com\",\n    \"linode\": \"www.linode.com\",\n    \"aws\": \"aws.amazon.com\",\n    \"azure\": \"azure.microsoft.com\",\n    \"google cloud\": \"cloud.google.com\",\n    \"heroku\": \"www.heroku.com\",\n    \"gitlab\": \"www.gitlab.com\",\n    \"bitbucket\": \"bitbucket.org\",\n    \"codepen\": \"codepen.io\",\n    \"jsfiddle\": \"jsfiddle.net\",\n    \"repl.it\": \"repl.it\",\n    \"stack overflow\": \"stackoverflow.com\",\n    \"stackoverflow careers\": \"stackoverflow.com/jobs\",\n    \"glassdoor\": \"www.glassdoor.com\",\n    \"indeed\": \"www.indeed.com\",\n    \"linkedin jobs\": \"www.linkedin.com/jobs\",\n    \"monster\": \"www.monster.com\",\n    \"simplyhired\": \"www.simplyhired.com\",\n    \"angel.co\": \"angel.co\",\n    \"github jobs\": \"jobs.github.com\",\n    \"ziprecruiter\": \"www.ziprecruiter.com\",\n    \"careerbuilder\": \"www.careerbuilder.com\",\n    \"snagajob\": \"www.snagajob.com\",\n    \"dice\": \"www.dice.com\",\n    \"jobs\": \"www.jobs.com\",\n    \"bamboohr\": \"www.bamboohr.com\",\n    \"workday\": \"www.workday.com\",\n    \"adp\": \"www.adp.com\",\n    \"sap successfactors\": \"www.sap.com/products/hcm.html\",\n    \"oracle hcm\": \"www.oracle.com/applications/human-capital-management\",\n    \"zenefits\": \"www.zenefits.com\",\n    \"paycor\": \"www.paycor.com\",\n    \"paycom\": \"www.paycom.com\",\n    \"gusto\": \"www.gusto.com\",\n    \"square\": \"squareup.com\",\n    \"stripe\": \"www.stripe.com\",\n    \"paypal\": \"www.paypal.com\",\n    \"venmo\": \"www.venmo.com\",\n    \"cash app\": \"cash.app\",\n    \"robinhood\": \"www.robinhood.com\",\n    \"etrade\": \"www.etrade.com\",\n    \"fidelity\": \"www.fidelity.com\",\n    \"charles schwab\": \"www.schwab.com\",\n    \"vanguard\": \"investor.vanguard.com\",\n    \"td ameritrade\": \"www.tdameritrade.com\",\n    \"coinbase\": \"www.coinbase.com\",\n    \"binance\": \"www.binance.com\",\n    \"kraken\": \"www.kraken.com\",\n    \"blockchain\": \"www.blockchain.com\",\n    \"gemini\": \"www.gemini.com\",\n    \"bitfinex\": \"www.bitfinex.com\",\n    \"bitstamp\": \"www.bitstamp.net\",\n    \"bittrex\": \"www.bittrex.com\",\n    \"okex\": \"www.okex.com\",\n    \"poloniex\": \"www.poloniex.com\",\n    \"coindesk\": \"www.coindesk.com\",\n    \"cointelegraph\": \"www.cointelegraph.com\",\n    \"decrypt\": \"www.decrypt.co\",\n    \"cryptoslate\": \"www.cryptoslate.com\",\n    \"cryptonews\": \"www.cryptonews.com\",\n    \"coinmarketcap\": \"www.coinmarketcap.com\",\n    \"coingecko\": \"www.coingecko.com\",\n    \"messari\": \"www.messari.io\",\n    \"icodrops\": \"www.icodrops.com\",\n    \"tokenmarket\": \"www.tokenmarket.net\",\n    \"coinpaprika\": \"www.coinpaprika.com\",\n    \"cryptocompare\": \"www.cryptocompare.com\",\n    \"coincheckup\": \"www.coincheckup.com\",\n    \"cryptobriefing\": \"www.cryptobriefing.com\",\n    \"blockonomi\": \"www.blockonomi.com\",\n    \"coininsider\": \"www.coininsider.com\",\n    \"newsbtc\": \"www.newsbtc.com\",\n    \"bitcoin.com\": \"www.bitcoin.com\",\n    \"ethereum.org\": \"www.ethereum.org\",\n    \"litecoin.com\": \"www.litecoin.com\",\n    \"ripple.com\": \"www.ripple.com\",\n    \"cardano.org\": \"www.cardano.org\",\n    \"stellarlumens.com\": \"www.stellarlumens.com\",\n    \"tezos.com\": \"www.tezos.com\",\n    \"eos.io\": \"www.eos.io\",\n    \"neo.org\": \"www.neo.org\",\n    \"iota.org\": \"www.iota.org\",\n    \"monero.org\": \"www.monero.org\",\n    \"zcash.org\": \"www.zcash.org\",\n    \"dash.org\": \"www.dash.org\",\n    \"dogecoin.com\": \"www.dogecoin.com\",\n    \"gpt\":\"www.chatgpt.com/\"\n}\n"
  },
  {
    "path": "Automation/Web_Open.py",
    "content": "import webbrowser\nfrom Automation.Web_Data import websites\n\ndef openweb(webname):\n    website_name = webname.lower().split()\n    counts = {}\n    for name in website_name:\n        counts[name] = counts.get(name,0) + 1\n    urls_to_open = []\n    for name,count in counts.items():\n        if name in websites:\n            urls_to_open.extend([websites[name]]*count)\n    for url in urls_to_open:\n        webbrowser.open(url) \n    if urls_to_open:\n        print(\"opening...\")"
  },
  {
    "path": "Automation/Youtube_play_back.py",
    "content": "import pyautogui\n\ndef volume_up():\n    pyautogui.press('up')\n\ndef volume_down():\n    pyautogui.press('down')\n\ndef seek_forward():\n    pyautogui.press('right')\n\ndef seek_backward():\n    pyautogui.press('left')\n\ndef seek_forward_10s():\n    pyautogui.press('l')\n\ndef seek_backward_10s():\n    pyautogui.press('j')\n\ndef seek_backward_frame():\n    pyautogui.press(',')\n\ndef seek_forward_frame():\n    pyautogui.press('.')\n\ndef seek_to_beginning():\n    pyautogui.press('home')\n\ndef seek_to_end():\n    pyautogui.press('end')\n\ndef seek_to_previous_chapter():\n    pyautogui.hotkey('ctrl', 'left')\n\ndef seek_to_next_chapter():\n    pyautogui.hotkey('ctrl', 'right')\n\ndef decrease_playback_speed():\n    pyautogui.hotkey('shift', ',')\n\ndef increase_playback_speed():\n    pyautogui.hotkey('shift', '.')\n\ndef move_to_next_video():\n    pyautogui.hotkey('shift', 'n')\n\ndef move_to_previous_video():\n    pyautogui.hotkey('shift', 'p')\n\ndef perform_media_action(text):\n    if \"volume up\" in text or \"volume badhao\" in text:\n        volume_up()\n    elif \"volume down\" in text or \"volume ghatao\" in text:\n        volume_down()\n    elif \"seek forward\" in text or \"aage badhao\" in text:\n        seek_forward()\n    elif \"seek backward\" in text or \"peeche karo\" in text:\n        seek_backward()\n    elif \"seek forward 10 seconds\" in text or \"10 second aage badhao\" in text:\n        seek_forward_10s()\n    elif \"seek backward 10 seconds\" in text or \"10 second peeche karo\" in text:\n        seek_backward_10s()\n    elif \"seek backward frame\" in text or \"frame peeche karo\" in text:\n        seek_backward_frame()\n    elif \"seek forward frame\" in text or \"frame aage badhao\" in text:\n        seek_forward_frame()\n    elif \"seek to beginning\" in text or \"shuruat par jao\" in text:\n        seek_to_beginning()\n    elif \"seek to end\" in text or \"ant par jao\" in text:\n        seek_to_end()\n    elif \"seek to previous chapter\" in text or \"previous chapter par jao\" in text:\n        seek_to_previous_chapter()\n    elif \"seek to next chapter\" in text or \"next chapter par jao\" in text:\n        seek_to_next_chapter()\n    elif \"decrease playback speed\" in text or \"speed kam karo\" in text:\n        decrease_playback_speed()\n    elif \"increase playback speed\" in text or \"speed badhao\" in text:\n        increase_playback_speed()\n    elif \"move to next video\" in text or \"next video par jao\" in text:\n        move_to_next_video()\n    elif \"move to previous video\" in text or \"previous video par jao\" in text:\n        move_to_previous_video()\n    else:\n        pass\n\n"
  },
  {
    "path": "Automation/open_App.py",
    "content": "import pyautogui as gui\nimport subprocess\nimport time\n\ndef open_App(text):\n    try:\n       subprocess.run(text)\n    except Exception as e:\n        gui.press(\"win\")\n        time.sleep(0.2)\n        gui.write(text)\n        time.sleep(0.2)\n        gui.press(\"enter\")"
  },
  {
    "path": "Automation/playmusic_Sfy.py",
    "content": "import webbrowser\nimport pyautogui as ui\nimport time\n\ndef play_music_on_spotify(song_name):\n    webbrowser.open(\"https://open.spotify.com/\")\n    time.sleep(6)\n    ui.hotkey(\"ctrl\",\"shift\",\"l\")\n    time.sleep(1)\n    ui.write(song_name)\n    time.sleep(3)\n    ui.leftClick(805,515)\n"
  },
  {
    "path": "Automation/scrool_system.py",
    "content": "import pyautogui\n\ndef scroll_up():\n    # Scroll up by pressing the Up arrow key five times\n    pyautogui.press('up', presses=5)\n\ndef scroll_down():\n    # Scroll down by pressing the Down arrow key five times\n    pyautogui.press('down', presses=5)\n\ndef scroll_to_top():\n    # Scroll to the top of the page\n    pyautogui.hotkey('home')\n\ndef scroll_to_bottom():\n    # Scroll to the bottom of the page\n    pyautogui.hotkey('end')\n\ndef perform_scroll_action(text):\n    if \"scroll up\" in text or \"upar scroll karo\" in text:\n        scroll_up()\n    elif \"scroll down\" in text or \"neeche scroll karo\" in text:\n        scroll_down()\n    elif \"scroll to top\" in text or \"shuruat par jao\" in text:\n        scroll_to_top()\n    elif \"scroll to bottom\" in text or \"ant par jao\" in text:\n        scroll_to_bottom()\n    else:\n        pass\n\n"
  },
  {
    "path": "Automation/tab_automation.py",
    "content": "import pyautogui\n\ndef open_new_tab():\n    pyautogui.hotkey('ctrl', 't')\n\ndef close_tab():\n    pyautogui.hotkey('ctrl', 'w')\n\ndef open_browser_menu():\n    pyautogui.hotkey('alt', 'f')\n\ndef zoom_in():\n    pyautogui.hotkey('ctrl', '+')\n\ndef zoom_out():\n    pyautogui.hotkey('ctrl', '-')\n\ndef refresh_page():\n    pyautogui.hotkey('ctrl', 'r')\n\ndef switch_to_next_tab():\n    pyautogui.hotkey('ctrl', 'tab')\n\ndef switch_to_previous_tab():\n    pyautogui.hotkey('ctrl', 'shift', 'tab')\n\ndef open_history():\n    pyautogui.hotkey('ctrl', 'h')\n\ndef open_bookmarks():\n    pyautogui.hotkey('ctrl', 'b')\n\ndef go_back():\n    pyautogui.hotkey('alt', 'left')\n\ndef go_forward():\n    pyautogui.hotkey('alt', 'right')\n\ndef open_dev_tools():\n    pyautogui.hotkey('ctrl', 'shift', 'i')\n\ndef toggle_full_screen():\n    pyautogui.hotkey('f11')\n\ndef open_private_window():\n    pyautogui.hotkey('ctrl', 'shift', 'n')\n\ndef perform_browser_action(text):\n    if \"open new tab\" in text or \"new tab kholo\" in text:\n        open_new_tab()\n    elif \"close tab\" in text or \"tab band karo\" in text:\n        close_tab()\n    elif \"open browser menu\" in text or \"browser menu kholo\" in text:\n        open_browser_menu()\n    elif \"zoom in\" in text or \"zoom in karo\" in text:\n        zoom_in()\n    elif \"zoom out\" in text or \"zoom out karo\" in text:\n        zoom_out()\n    elif \"refresh page\" in text or \"page refresh karo\" in text:\n        refresh_page()\n    elif \"switch to next tab\" in text or \"next tab par jao\" in text:\n        switch_to_next_tab()\n    elif \"switch to previous tab\" in text or \"previous tab par jao\" in text:\n        switch_to_previous_tab()\n    elif \"open history\" in text or \"history kholo\" in text:\n        open_history()\n    elif \"open bookmarks\" in text or \"bookmarks kholo\" in text:\n        open_bookmarks()\n    elif \"go back\" in text or \"peeche jao\" in text:\n        go_back()\n    elif \"go forward\" in text or \"aage jao\" in text:\n        go_forward()\n    elif \"open dev tools\" in text or \"dev tools kholo\" in text:\n        open_dev_tools()\n    elif \"toggle full screen\" in text or \"full screen karo\" in text:\n        toggle_full_screen()\n    elif \"open private window\" in text or \"private window kholo\" in text:\n        open_private_window()\n    else:\n        pass\n"
  },
  {
    "path": "Brain/brain.py",
    "content": "# from webscout import PhindSearch as brain\n\n\n# ai = brain(\n#     is_conversation=True,\n#     max_tokens=800,\n#     timeout=30,\n#     intro='J.A.R.V.I.S',\n#     filepath=r\"C:\\Users\\chatu\\Desktop\\J.A.R.V.I.S\\chat_hystory.txt\",\n#     update_file=True,\n#     proxies={},\n#     history_offset=10250,\n#     act=None,\n# )\n\n# def Main_Brain(text):\n#     r = ai.chat(text)\n#     return r \n\nfrom webscout import PhindSearch\n\ndef Main_Brain(text):\n    ai = PhindSearch(quiet=True, filepath=r\"C:\\Users\\chatu\\Desktop\\J.A.R.V.I.S\\chat_hystory.txt\", is_conversation=None)\n\n    res = ai.chat(text) # internel stream is not available for this Privider\n\n    return res\n\n"
  },
  {
    "path": "Data/DLG_Data.py",
    "content": "online_dlg = [\n    \"Sir, I am online and ready\",\n    \"Sir, I am online\",\n    \"I am online, sir\",\n    \"Sir, my status is online\",\n    \"I am online, sir, happy to assist you\",\n    \"Sir, I am now online\",\n    \"I am online and ready to help, sir\",\n    \"Sir, I have gone online\",\n    \"Sir, I am online, awaiting your command\",\n    \"Sir, I am online and at your service\",\n    \"Online and ready, sir\",\n    \"I am online and here to assist, sir\",\n    \"Sir, I am now online and ready\",\n    \"Sir, I am online and ready to serve\",\n    \"Sir, I am online and operational\",\n    \"Sir, I have gone online and am ready to assist\",\n    \"Sir, I am online and available\",\n    \"Online and at your service, sir\",\n    \"Sir, I am online and prepared to help\",\n    \"Sir, I am online and standing by\",\n    \"Sir, I am online, how can I assist?\",\n    \"Sir, I am online and awaiting your instructions\",\n    \"Sir, I am now online, how can I help?\",\n    \"Sir, I am online and ready for your commands\",\n    \"Sir, I am online and ready to take your orders\",\n    \"Sir, I am online and ready for duty\",\n    \"Online and ready to assist, sir\",\n    \"Sir, I am online, what do you need?\",\n    \"Sir, I am online, how can I serve you?\",\n    \"Sir, I am online and at your disposal\",\n    \"Sir, I am online, what can I do for you?\",\n    \"Sir, I am online, ready and waiting\",\n    \"Sir, I am online and ready to go\",\n    \"Sir, I am online and ready to support you\",\n    \"Sir, I am online, your command is my wish\",\n    \"Sir, I am online and ready for action\",\n    \"Sir, I am online, ready to serve\",\n    \"Sir, I am online and here to help\",\n    \"Sir, I am online, how can I be of assistance?\",\n    \"Sir, I am online, how may I assist you?\",\n    \"Sir, I am online and at your service, awaiting commands\",\n    \"Sir, I am online and ready to execute your commands\",\n    \"Sir, I am online and ready to perform tasks\",\n    \"Sir, I am online and ready to assist with any tasks\",\n    \"Sir, I am online and ready to aid you\",\n    \"Sir, I am online and ready to handle your requests\",\n    \"Sir, I am online and here to serve you\",\n    \"Sir, I am online and at your command\",\n    \"Sir, I am online and awaiting your requests\",\n    \"Sir, I am online and ready for instructions\",\n    \"Sir, I am online and prepared to assist with any task\",\n    \"Sir, I am online and ready to follow your orders\",\n    \"Sir, I am online and prepared to serve\",\n    \"Sir, I am online, ready to assist\",\n    \"Sir, I am online and ready to support\",\n    \"Sir, I am online, here to help\",\n    \"Sir, I am online and ready to execute orders\",\n    \"Sir, I am online and ready for your instructions\",\n    \"Sir, I am online and ready to provide assistance\",\n    \"Sir, I am online and awaiting your commands\",\n    \"Sir, I am online and here to aid you\",\n    \"Sir, I am online and ready for your tasks\",\n    \"Sir, I am online and ready for any commands\",\n    \"Sir, I am online and ready to work\",\n    \"Sir, I am online and ready to be of service\",\n    \"Sir, I am online and at your disposal, ready to help\",\n    \"Sir, I am online and ready to take on tasks\",\n    \"Sir, I am online and prepared to assist in any way\",\n    \"Sir, I am online and ready to fulfill your requests\",\n    \"Sir, I am online and ready to help you\",\n    \"Sir, I am online and prepared for your instructions\",\n    \"Sir, I am online and ready to follow your lead\",\n    \"Sir, I am online and at your beck and call\",\n    \"Sir, I am online and ready to serve you\",\n    \"Sir, I am online and ready to assist with any requests\",\n    \"Sir, I am online and ready to follow your commands\",\n    \"Sir, I am online and here to assist with anything\",\n    \"Sir, I am online and ready for any task\",\n    \"Sir, I am online and ready for your guidance\",\n    \"Sir, I am online and ready to assist you in any way\",\n    \"Sir, I am online and ready to perform\",\n    \"Sir, I am online and at your service, ready to help\",\n    \"Sir, I am online and ready for any instructions\",\n    \"Sir, I am online and ready to assist with all tasks\",\n    \"Sir, I am online and prepared for any requests\",\n    \"Sir, I am online and ready to take on any task\",\n    \"Sir, I am online and ready for your directions\",\n    \"Sir, I am online and ready to assist with whatever you need\",\n    \"Sir, I am online and ready to serve your needs\",\n    \"Sir, I am online and ready to execute your tasks\",\n    \"Sir, I am online and ready to be at your service\",\n    \"Sir, I am online and ready to assist in any tasks\",\n    \"Sir, I am online and ready to perform any duty\",\n    \"Sir, I am online and prepared to assist you\",\n    \"Sir, I am online and ready for your requests\",\n    \"Sir, I am online and ready for any duty\",\n    \"Sir, I am online and ready to fulfill any request\",\n]\noffline_dlg = [\n    \"Sir, I am offline. Please connect to the WiFi or internet\",\n    \"Sir, I am currently offline. Please check the internet connection\",\n    \"I am offline, sir. Kindly connect me to the internet\",\n    \"Sir, my status is offline. Please ensure I am connected to the network\",\n    \"I am offline, sir. Please establish an internet connection\",\n    \"Sir, I am offline. Please connect me to the internet\",\n    \"Sir, I am offline. Kindly check the network connection\",\n    \"Sir, I am offline. Please reconnect me to the WiFi\",\n    \"Sir, I am offline. A network connection is required\",\n    \"Sir, I am offline. Please connect to the internet\",\n    \"Offline, sir. Please check the WiFi connection\",\n    \"Sir, I am offline. Internet connection needed\",\n    \"Sir, I am offline. Please verify the internet connection\",\n    \"Sir, I am offline. Network connection required\",\n    \"Sir, I am offline. Please reconnect to the internet\",\n    \"Sir, I am offline. WiFi connection needed\",\n    \"Sir, I am offline. Please ensure network connectivity\",\n    \"Offline status, sir. Please connect to the WiFi\",\n    \"Sir, I am offline. Please verify the network connection\",\n    \"Sir, I am offline. Internet access required\",\n    \"Sir, I am offline. Please check the internet connection\",\n    \"Sir, I am offline. Please ensure a stable network connection\",\n    \"Sir, I am offline. Please reconnect to the network\",\n    \"Sir, I am offline. A WiFi connection is needed\",\n    \"Sir, I am offline. Internet connection is necessary\",\n    \"Sir, I am offline. Please check WiFi or internet\",\n    \"Sir, I am offline. Network access required\",\n    \"Sir, I am offline. Please establish a connection to the internet\",\n    \"Sir, I am offline. Internet connection needed\",\n    \"Sir, I am offline. Please connect me to the network\",\n    \"Sir, I am offline. Please ensure internet connectivity\",\n    \"Sir, I am offline. Network connection needed\",\n    \"Sir, I am offline. Please verify internet access\",\n    \"Sir, I am offline. Please connect to WiFi\",\n    \"Sir, I am offline. Please ensure a network connection\",\n    \"Sir, I am offline. Please connect me to the WiFi\",\n    \"Sir, I am offline. Please reconnect to the internet\",\n    \"Sir, I am offline. Please check the network connection\",\n    \"Sir, I am offline. WiFi connection required\",\n    \"Sir, I am offline. Network connectivity is needed\",\n    \"Sir, I am offline. Internet access required\",\n    \"Sir, I am offline. Please ensure a stable internet connection\",\n    \"Sir, I am offline. Please connect to the network\",\n    \"Sir, I am offline. Internet connection required\",\n    \"Sir, I am offline. Please establish a network connection\",\n    \"Sir, I am offline. Please reconnect to the WiFi\",\n    \"Sir, I am offline. Please ensure a stable WiFi connection\",\n    \"Sir, I am offline. Network access needed\",\n    \"Sir, I am offline. Please connect to the internet\",\n    \"Sir, I am offline. WiFi access required\",\n    \"Sir, I am offline. Please ensure network access\",\n    \"Sir, I am offline. Please check the WiFi connection\",\n    \"Sir, I am offline. Please ensure an internet connection\",\n    \"Sir, I am offline. Network connection required\",\n    \"Sir, I am offline. Internet connection needed\",\n    \"Sir, I am offline. Please connect me to the network\",\n    \"Sir, I am offline. Please ensure internet access\",\n    \"Sir, I am offline. Network connectivity required\",\n    \"Sir, I am offline. Please check the network connection\",\n    \"Sir, I am offline. Please reconnect to the WiFi\",\n    \"Sir, I am offline. Internet connectivity required\",\n    \"Sir, I am offline. Network access needed\",\n    \"Sir, I am offline. Please verify the internet connection\",\n    \"Sir, I am offline. WiFi connection needed\",\n    \"Sir, I am offline. Please check the internet access\",\n    \"Sir, I am offline. Please ensure a WiFi connection\",\n    \"Sir, I am offline. Please reconnect to the network\",\n    \"Sir, I am offline. Internet access needed\",\n    \"Sir, I am offline. Network connection is required\",\n    \"Sir, I am offline. Please connect to the WiFi\",\n    \"Sir, I am offline. Please ensure internet connectivity\",\n    \"Sir, I am offline. Network access required\",\n    \"Sir, I am offline. Please verify network connection\",\n    \"Sir, I am offline. Please check the WiFi connection\",\n    \"Sir, I am offline. Internet connection required\",\n    \"Sir, I am offline. Network connection needed\",\n    \"Sir, I am offline. Please connect to the internet\",\n    \"Sir, I am offline. Please ensure network access\",\n    \"Sir, I am offline. Please check the network connectivity\",\n    \"Sir, I am offline. Please reconnect to the internet\",\n    \"Sir, I am offline. Internet access required\",\n    \"Sir, I am offline. Please ensure a network connection\",\n    \"Sir, I am offline. Please verify internet connection\",\n    \"Sir, I am offline. Please check the WiFi or internet connection\",\n    \"Sir, I am offline. Network connection required\",\n    \"Sir, I am offline. Please reconnect to the network\",\n    \"Sir, I am offline. Please connect to WiFi or internet\",\n    \"Sir, I am offline. Please ensure WiFi access\",\n    \"Sir, I am offline. Internet connection is needed\",\n    \"Sir, I am offline. Please check WiFi or internet access\",\n    \"Sir, I am offline. Please establish network connectivity\",\n]\n"
  },
  {
    "path": "Features/br_persentage.py",
    "content": "import wmi\nfrom TextToSpeech.Fast_DF_TTS import speak\ndef get_brightness_windows():\n    try:\n        w = wmi.WMI(namespace='wmi')\n        brightness_methods = w.WmiMonitorBrightness()\n        brightness_percentage = brightness_methods[0].CurrentBrightness\n        return brightness_percentage\n    except Exception as e:\n        return f\"Error: {e}\"\n\ndef check_br_persentage():\n    brightness = get_brightness_windows()\n    speak(f\"Current Brightness: {brightness}%\")\n\n"
  },
  {
    "path": "Features/check_running_app.py",
    "content": "import psutil\n\ndef get_running_apps_windows():\n    try:\n        # Get a list of running processes\n        processes = [proc.name() for proc in psutil.process_iter(['name'])]\n        return list(set(processes))  # Remove duplicates\n    except Exception as e:\n        return f\"Error: {e}\"\n\n\ndef check_running_app():\n    running_apps = get_running_apps_windows()\n    print(\"Running Applications:\")\n    for app in running_apps:\n        print(app)\n\n\n"
  },
  {
    "path": "Features/clap_d.py",
    "content": "import pyaudio\nimport struct\nimport math\n\nINITIAL_TAP_THRESHOLD = 0.7222\nFORMAT = pyaudio.paInt16\nSHORT_NORMALIZE = (1.0 / 32768.0)\nCHANNELS = 3\nRATE = 44100\nINPUT_BLOCK_TIME = 0.01\nINPUT_FRAMES_PER_BLOCK = int(RATE * INPUT_BLOCK_TIME)\nOVERSENSITIVE = 9.0 / INPUT_BLOCK_TIME\nUNDERSENSITIVE = 10.0 / INPUT_BLOCK_TIME\nMAX_TAP_BLOCKS = 0.15 / INPUT_BLOCK_TIME\nREQUIRED_CLAPS = 2  # Adjust this value as needed\n\n\nclass TapTester(object):\n\n    def __init__(self):\n        self.pa = pyaudio.PyAudio()\n        self.stream = self.open_mic_stream()\n        self.tap_threshold = INITIAL_TAP_THRESHOLD\n        self.noisycount = MAX_TAP_BLOCKS + 1\n        self.quietcount = 0\n        self.errorcount = 0\n\n    def stop(self):\n        self.stream.close()\n\n    def find_input_device(self):\n        device_index = None\n        for i in range(self.pa.get_device_count()):\n            devinfo = self.pa.get_device_info_by_index(i)\n            for keyword in [\"mic\", \"input\"]:\n                if keyword in devinfo[\"name\"].lower():\n                    device_index = i\n                    return device_index\n\n        if device_index is None:\n            print(\"No preferred input found; using default input device.\")\n\n        return device_index\n\n    def open_mic_stream(self):\n        device_index = self.find_input_device()\n\n        stream = self.pa.open(format=FORMAT,\n                              channels=CHANNELS,\n                              rate=RATE,\n                              input=True,\n                              input_device_index=device_index,\n                              frames_per_buffer=INPUT_FRAMES_PER_BLOCK)\n\n        return stream\n\n    @staticmethod\n    def get_rms(block):\n        count = len(block) / 2\n        format = \"%dh\" % count\n        shorts = struct.unpack(format, block)\n        sum_squares = 0.0\n        for sample in shorts:\n            n = sample * SHORT_NORMALIZE\n            sum_squares += n * n\n\n        return math.sqrt(sum_squares / count)\n\n    def listen(self):\n        try:\n            block = self.stream.read(INPUT_FRAMES_PER_BLOCK)\n        except IOError as e:\n            self.errorcount += 1\n            print(\"(%d) Error recording: %s\" % (self.errorcount, e))\n            self.noisycount = 5\n            return\n\n        amplitude = self.get_rms(block)\n\n        if amplitude > self.tap_threshold:\n            self.quietcount = 2\n            self.noisycount += 1\n            if self.noisycount > OVERSENSITIVE:\n                self.tap_threshold *= 1.5\n        else:\n            if 1 <= self.noisycount <= MAX_TAP_BLOCKS:\n                return True\n            self.noisycount = 0\n            self.quietcount += 1\n            if self.quietcount > UNDERSENSITIVE:\n                self.tap_threshold *= 1\n\n\n\ndef clap_detect():\n    while True:\n        tt = TapTester()\n        clap_count = 0\n\n        while True:\n            if tt.listen():\n                clap_count += 2\n\n                if clap_count == REQUIRED_CLAPS:\n                    print(\"clap dectected\")\n                    break"
  },
  {
    "path": "Features/clap_with_music.py",
    "content": "import os\nimport pygame\nimport random\nfrom pygame import mixer\nfrom Features.clap_d import *\n\n\ndef play_random_music(folder_path):\n    music_files = [file for file in os.listdir(folder_path) if file.endswith(('.mp3', '.wav', '.ogg', '.flac'))]\n\n    if not music_files:\n        print(\"No music files found in the specified folder.\")\n        return\n\n    selected_music = random.choice(music_files)\n    music_path = os.path.join(folder_path, selected_music)\n\n    try:\n        # Initialize pygame and mixer\n        pygame.init()\n        mixer.init()\n\n        # Load and play the selected music file in the background\n        mixer.music.load(music_path)\n        mixer.music.play()\n\n        # Wait for the music to finish (or you can add some delay or user input here)\n        while pygame.mixer.music.get_busy():\n            pygame.time.Clock().tick(10)  # Adjust the tick value as needed\n\n        # Stop and quit pygame mixer\n        mixer.music.stop()\n        mixer.quit()\n    except Exception as e:\n        print(f\"Error playing music: {e}\")\n\ndef clap_to_music():\n    while True:\n        tt = TapTester()\n        clap_count = 0\n\n        while True:\n            if tt.listen():\n                clap_count += 2\n\n                if clap_count == REQUIRED_CLAPS:\n                    play_random_music(r\"C:\\Users\\chatu\\OneDrive\\Desktop\\J.A.R.V.I.S\\DATA\\MUSIC\")\n                    break"
  },
  {
    "path": "Features/create_file.py",
    "content": "def get_file_extension(text):\n    if \"python file\" in text:\n        ex = \".py\"\n    elif \"java file\" in text:\n        ex = \".java\"\n    elif \"text file\" in text:\n        ex = \".txt\"\n    elif \"html file\" in text:\n        ex = \".html\"\n    elif \"css file\" in text:\n        ex = \".css\"\n    elif \"javascript file\" in text:\n        ex = \".js\"\n    elif \"json file\" in text:\n        ex = \".json\"\n    elif \"xml file\" in text:\n        ex = \".xml\"\n    elif \"csv file\" in text:\n        ex = \".csv\"\n    elif \"markdown file\" in text:\n        ex = \".md\"\n    elif \"yaml file\" in text:\n        ex = \".yaml\"\n    elif \"image file\" in text:\n        ex = \".jpg\"  # You can add more image extensions if needed\n    elif \"video file\" in text:\n        ex = \".mp4\"  # You can add more video extensions if needed\n    elif \"audio file\" in text:\n        ex = \".mp3\"  # You can add more audio extensions if needed\n    elif \"pdf file\" in text:\n        ex = \".pdf\"\n    elif \"word file\" in text:\n        ex = \".docx\"\n    elif \"excel file\" in text:\n        ex = \".xlsx\"\n    elif \"powerpoint file\" in text:\n        ex = \".pptx\"\n    elif \"zip file\" in text:\n        ex = \".zip\"\n    elif \"tar file\" in text:\n        ex = \".tar\"\n    else:\n        ex = \"\"  # Default case if no match found\n    return ex\n\ndef update_text(text):\n    if \"python file\" in text:\n        text = text.replace(\"python file\", \"\")\n    elif \"java file\" in text:\n        text = text.replace(\"java file\", \"\")\n    elif \"text file\" in text:\n        text = text.replace(\"text file\", \"\")\n    elif \"html file\" in text:\n        text = text.replace(\"html file\", \"\")\n    elif \"css file\" in text:\n        text = text.replace(\"css file\", \"\")\n    elif \"javascript file\" in text:\n        text = text.replace(\"javascript file\", \"\")\n    elif \"json file\" in text:\n        text = text.replace(\"json file\", \"\")\n    elif \"xml file\" in text:\n        text = text.replace(\"xml file\", \"\")\n    elif \"csv file\" in text:\n        text = text.replace(\"csv file\", \"\")\n    elif \"markdown file\" in text:\n        text = text.replace(\"markdown file\", \"\")\n    elif \"yaml file\" in text:\n        text = text.replace(\"yaml file\", \"\")\n    elif \"image file\" in text:\n        text = text.replace(\"image file\", \"\")\n    elif \"video file\" in text:\n        text = text.replace(\"video file\", \"\")\n    elif \"audio file\" in text:\n        text = text.replace(\"audio file\", \"\")\n    elif \"pdf file\" in text:\n        text = text.replace(\"pdf file\", \"\")\n    elif \"word file\" in text:\n        text = text.replace(\"word file\", \"\")\n    elif \"excel file\" in text:\n        text = text.replace(\"excel file\", \"\")\n    elif \"powerpoint file\" in text:\n        text = text.replace(\"powerpoint file\", \"\")\n    elif \"zip file\" in text:\n        text = text.replace(\"zip file\", \"\")\n    elif \"tar file\" in text:\n        text = text.replace(\"tar file\", \"\")\n    else:\n        pass\n    return text\n\n\n\ndef create_file(text):\n    selected_ex = get_file_extension(text)\n    text = update_text(text)\n    if \"named\" in text or \"with name\" in text:\n        text = text.replace(\"named\",\"\")\n        text = text.replace(\"with name\",\"\")\n        text = text.replace(\"create\",\"\")\n        text = text.strip()\n        with open(f\"{text}{selected_ex}\",\"w\"):\n            pass\n    else :\n        with open(f\"demo{selected_ex}\",\"w\"):\n            pass\n\n"
  },
  {
    "path": "Features/find_my_ip.py",
    "content": "import requests\n\ndef find_my_ip():\n    ip_address = requests.get('https://api64.ipify.org?format=json').json()\n    return ip_address[\"ip\"]\n\n"
  },
  {
    "path": "Features/get_advice.py",
    "content": "import requests\n\ndef get_random_advice():\n    res = requests.get(\"https://api.adviceslip.com/advice\").json()\n    return res['slip']['advice']\n"
  },
  {
    "path": "Features/get_jokes.py",
    "content": "import requests\n\ndef get_random_joke():\n    headers = {\n        'Accept': 'application/json'\n    }\n    res = requests.get(\"https://icanhazdadjoke.com/\", headers=headers).json()\n    return res[\"joke\"]\n"
  },
  {
    "path": "Features/mike_health.py",
    "content": "import pyaudio\nimport numpy as np\nimport time\nfrom TextToSpeech.Fast_DF_TTS import speak\n\ndef get_mic_health(seconds=5, initial_threshold=500):\n    CHUNK = 1024  # Audio chunk size\n    FORMAT = pyaudio.paInt16  # 16-bit resolution\n    CHANNELS = 1  # Mono audio\n    RATE = 44100  # Sampling rate\n\n    # Initialize PyAudio\n    audio = pyaudio.PyAudio()\n\n    # Open the stream\n    stream = audio.open(format=FORMAT, channels=CHANNELS,\n                        rate=RATE, input=True,\n                        frames_per_buffer=CHUNK)\n\n    print(f\"Recording for {seconds} seconds...\")\n    time.sleep(1)  # Small pause before recording\n\n    # Initialize variables\n    sound_count = 0\n    total_samples = 0\n    noise_floor = 0  # Ambient noise level\n    clipping_count = 0\n    signal_sum = 0  # Sum of sound levels\n    noise_sum = 0  # Sum of background noise levels (below threshold)\n    freq_analysis = []  # Frequency analysis data\n\n    for _ in range(0, int(RATE / CHUNK * seconds)):\n        data = np.frombuffer(stream.read(CHUNK), dtype=np.int16)\n        volume = np.linalg.norm(data)\n        \n        # Frequency analysis (FFT)\n        freqs = np.fft.fftfreq(len(data))\n        fft_spectrum = np.abs(np.fft.fft(data))\n        freq_analysis.append(fft_spectrum)\n\n        # Update ambient noise level dynamically\n        noise_floor = max(noise_floor, np.mean(np.abs(data)) * 1.5)\n\n        # Dynamic threshold based on ambient noise\n        dynamic_threshold = max(initial_threshold, noise_floor)\n\n        # Check for sound detection\n        if volume > dynamic_threshold:  # Sound detected\n            sound_count += 1\n            signal_sum += volume\n        else:  # No sound detected (background noise)\n            noise_sum += volume\n\n        # Detect clipping (when the sound is too loud for the mic)\n        if np.max(np.abs(data)) >= 32767:\n            clipping_count += 1\n\n        total_samples += 1\n\n    # Calculate metrics\n    mic_health = (sound_count / total_samples) * 100\n    avg_signal = signal_sum / max(1, sound_count)\n    avg_noise = noise_sum / max(1, (total_samples - sound_count))\n    snr = 10 * np.log10(avg_signal / max(1, avg_noise))  # Signal-to-Noise Ratio\n    avg_clipping = (clipping_count / total_samples) * 100\n\n    # Frequency analysis (average frequencies captured)\n    avg_fft_spectrum = np.mean(freq_analysis, axis=0)\n    freq_range_coverage = np.mean(avg_fft_spectrum > np.median(avg_fft_spectrum)) * 100\n\n    # Close the stream\n    stream.stop_stream()\n    stream.close()\n    audio.terminate()\n\n    # Output advanced health metrics\n    health_report = {\n        'Microphone Health (%)': mic_health,\n        'Average Signal-to-Noise Ratio (dB)': snr,\n        'Clipping Percentage (%)': avg_clipping,\n        'Frequency Range Coverage (%)': freq_range_coverage\n    }\n\n    return health_report\n\ndef mike_health():\n    health_metrics = get_mic_health(seconds=5)\n    for metric, value in health_metrics.items():\n        speak(f\"{metric}: {value:.2f}\")\n"
  },
  {
    "path": "Features/set_br.py",
    "content": "import wmi\nfrom TextToSpeech.Fast_DF_TTS import speak\n\ndef set_brightness_windows(percentage):\n    try:\n        w = wmi.WMI(namespace='wmi')\n        brightness_methods = w.WmiMonitorBrightnessMethods()[0]\n        brightness_methods.WmiSetBrightness(int(percentage), 0)\n        speak(f\"Brightness set to {percentage}%\")\n    except Exception as e:\n        speak(f\"Error: {e}\")\n"
  },
  {
    "path": "Features/set_get_volume.py",
    "content": "from ctypes import cast, POINTER\nfrom comtypes import CLSCTX_ALL\nfrom pycaw.pycaw import AudioUtilities, IAudioEndpointVolume\nfrom TextToSpeech.Fast_DF_TTS import speak\n\n# Function to get current volume\ndef get_volume_windows():\n    devices = AudioUtilities.GetSpeakers()\n    interface = devices.Activate(IAudioEndpointVolume._iid_, CLSCTX_ALL, None)\n    volume = cast(interface, POINTER(IAudioEndpointVolume))\n    current_volume = volume.GetMasterVolumeLevelScalar() * 100\n    speak(f\"the device is running on {int(round(current_volume, 2))}  % volume level\")\n\n# Function to set the system volume\ndef set_volume_windows(percentage):\n    devices = AudioUtilities.GetSpeakers()\n    interface = devices.Activate(IAudioEndpointVolume._iid_, CLSCTX_ALL, None)\n    volume = cast(interface, POINTER(IAudioEndpointVolume))\n    # Convert percentage to scalar value (0.0 to 1.0)\n    volume.SetMasterVolumeLevelScalar(percentage / 100, None)\n    speak(f\"Volume set to {percentage}%\")\n\n"
  },
  {
    "path": "Features/speaker_health.py",
    "content": "import numpy as np\nimport pyaudio\nimport time\nfrom scipy import signal \nfrom TextToSpeech.Fast_DF_TTS import speak\n\ndef play_tone(frequency, duration=2, volume=0.5, sample_rate=44100):\n    \"\"\"\n    Plays a single tone of a specific frequency through the speaker.\n    \"\"\"\n    # Generate samples for the sine wave\n    t = np.linspace(0, duration, int(sample_rate * duration), False)\n    tone = np.sin(frequency * t * 2 * np.pi)\n\n    # Ensure the tone is in the correct format\n    audio_data = (tone * volume * 32767).astype(np.int16)\n\n    # Initialize PyAudio\n    p = pyaudio.PyAudio()\n\n    # Open stream\n    stream = p.open(format=pyaudio.paInt16,\n                    channels=1,\n                    rate=sample_rate,\n                    output=True)\n\n    # Play the tone\n    stream.write(audio_data.tobytes())\n\n    # Stop the stream\n    stream.stop_stream()\n    stream.close()\n    p.terminate()\n\ndef play_sweep(duration=5, volume=0.5, sample_rate=44100, start_freq=20, end_freq=20000):\n    \"\"\"\n    Plays a frequency sweep from start_freq to end_freq through the speaker.\n    Useful for testing the full frequency range of the speaker.\n    \"\"\"\n    t = np.linspace(0, duration, int(sample_rate * duration), False)\n    sweep = signal.chirp(t, start_freq, t[-1], end_freq, method='logarithmic')\n\n    # Ensure the sweep is in the correct format\n    audio_data = (sweep * volume * 32767).astype(np.int16)\n\n    # Initialize PyAudio\n    p = pyaudio.PyAudio()\n\n    # Open stream\n    stream = p.open(format=pyaudio.paInt16,\n                    channels=1,\n                    rate=sample_rate,\n                    output=True)\n\n    # Play the sweep\n    stream.write(audio_data.tobytes())\n\n    # Stop the stream\n    stream.stop_stream()\n    stream.close()\n    p.terminate()\n\ndef speaker_health_test():\n    \"\"\"\n    This function plays different tones and sweeps to test the speaker's health.\n    It returns a speaker health percentage based on the tone coverage.\n    \"\"\"\n    speak(\"Playing test tones...\")\n    health_score = 0\n\n    # Test low-frequency tones (below 500 Hz)\n    speak(\"Playing 100 Hz tone...\")\n    play_tone(100, duration=2)\n    time.sleep(1)\n    health_score += 25  # Assuming low-frequency played fine\n\n    # Test mid-frequency tones (500 Hz to 5000 Hz)\n    speak(\"Playing 1000 Hz tone...\")\n    play_tone(1000, duration=2)\n    time.sleep(1)\n    health_score += 25  # Assuming mid-frequency played fine\n\n    # Test higher frequencies (5000 Hz and above)\n    speak(\"Playing 5000 Hz tone...\")\n    play_tone(5000, duration=2)\n    time.sleep(1)\n    health_score += 20  # Slightly lower score for high frequencies, which may be harder for some speakers\n\n    speak(\"Playing 10,000 Hz tone...\")\n    play_tone(10000, duration=2)\n    time.sleep(1)\n    health_score += 15  # High-pitch tones are harder to reproduce\n\n    # Play a frequency sweep to test full frequency response\n    speak(\"Playing frequency sweep from 20 Hz to 20,000 Hz...\")\n    play_sweep(duration=5)\n    time.sleep(1)\n    health_score += 15  # Frequency sweep covers a wide range\n\n    # Speaker health assessment\n    speak(\"\\nSpeaker health test complete.\")\n\n    # Calculate health percentage\n    speak(f\"\\nSpeaker Health: {health_score}%\")\n    if health_score == 100:\n        speak(\"The speaker is in excellent condition!\")\n    elif 80 <= health_score < 100:\n        speak(\"The speaker is in good condition.\")\n    elif 60 <= health_score < 80:\n        speak(\"The speaker is in average condition.\")\n    else:\n        speak(\"The speaker might be in poor condition.\")\n\n\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "NetHyTechSTT/listen.py",
    "content": "from selenium import webdriver\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\nfrom selenium.webdriver.chrome.service import Service\nfrom selenium.webdriver.chrome.options import Options\nfrom os import getcwd\n# Setting up Chrome options with specific arguments\nchrome_options = Options()\nchrome_options.add_argument(\"--use-fake-ui-for-media-stream\")\nchrome_options.add_argument(\"--headless=old\")  # Remove this if you want to see the browser UI\n# Manually set the path to the ChromeDriver executable\nchrome_driver_path = f\"{getcwd()}\\\\chromedriver.exe\"\nservice = Service(executable_path=chrome_driver_path)\n# Setting up the Chrome driver with the service and options\ndriver = webdriver.Chrome(service=service, options=chrome_options)\n# Creating the URL for the website using the current working directory\nwebsite = \"https://allorizenproject1.netlify.app/\"\n# Opening the website in the Chrome browser\ndriver.get(website)\nRecog_File = f\"{getcwd()}\\\\input.txt\"\ndef listen():\n    print(\"Support in Youtube @NetHyTech\")\n    try:\n        start_button = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID, 'startButton')))\n        start_button.click()\n        print(\"Listening...\")\n        output_text = \"\"\n        is_second_click = False\n        while True:\n            output_element = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, 'output')))\n            current_text = output_element.text.strip()\n            if \"Start Listening\" in start_button.text and is_second_click:\n                if output_text:\n                    is_second_click = False\n            elif \"Listening...\" in start_button.text:\n                is_second_click = True\n            if current_text != output_text:\n                output_text = current_text\n                with open(Recog_File, \"w\") as file:\n                    file.write(output_text.lower())\n                    print(\"User:\", output_text)\n    except KeyboardInterrupt:\n        print(\"Process interrupted by user.\")\n    except Exception as e:\n        print(\"An error occurred:\", e)\n    finally:\n        driver.quit()"
  },
  {
    "path": "New/datafeatch.py",
    "content": "import requests\nfrom bs4 import BeautifulSoup\nfrom nltk.tokenize import sent_tokenize\nfrom nltk.corpus import stopwords\nfrom nltk import download\n\n# Download NLTK resources required\ndownload('punkt')\ndownload('stopwords')\n\ndef get_search_results(query):\n    query = query.replace(' ', '+')\n    url = f\"https://www.google.com/search?q={query}\"\n\n    headers = {\n        \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36\"\n    }\n    \n    response = requests.get(url, headers=headers)\n    response.raise_for_status()\n\n    soup = BeautifulSoup(response.text, 'html.parser')\n    results = []\n\n    for g in soup.find_all('div', class_='tF2Cxc')[:2]:  # Extract first two results\n        title = g.find('h3').text\n        snippet = g.find('div', class_='VwiC3b').text\n        link = g.find('a')['href']\n        if len(snippet) > 50:  # Avoid overly short or irrelevant snippets\n            results.append({\n                \"title\": title,\n                \"snippet\": snippet,\n                \"link\": link\n            })\n    \n    return results\n\ndef summarize_text(text):\n    sentences = sent_tokenize(text)\n    stop_words = set(stopwords.words(\"english\"))\n\n    # Rank sentences based on the number of significant words they contain\n    ranked_sentences = {}\n    for i, sentence in enumerate(sentences):\n        words = sentence.split()\n        rank = sum(1 for word in words if word.lower() not in stop_words)\n        ranked_sentences[i] = rank\n\n    # Extract the top 2 ranked sentences as the summary\n    top_sentences = sorted(ranked_sentences, key=ranked_sentences.get, reverse=True)[:2]\n    summary = \" \".join([sentences[i] for i in sorted(top_sentences)])\n\n    return summary\n\ndef main():\n    query = input(\"Enter your search query: \")\n    search_results = get_search_results(query)\n    \n    print(\"\\nSearch Results:\\n\")\n    for idx, result in enumerate(search_results):\n        print(f\"Result {idx + 1}:\")\n        print(f\"Title: {result['title']}\")\n        print(f\"URL: {result['link']}\")\n        print(f\"Snippet: {result['snippet']}\\n\")\n\n        summarized_snippet = summarize_text(result['snippet'])\n        print(f\"Summary: {summarized_snippet}\\n\")\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "PyWhatKit_DB.txt",
    "content": "Date: 7/8/2024\nTime: 1:26\nPhone Number: +1234567890\nMessage: Hello, this is a near real-time automated message!\n--------------------\nDate: 7/8/2024\nTime: 1:28\nPhone Number: +919606348280\nMessage: Hello, this is a near real-time automated message!\n--------------------\nDate: 7/8/2024\nTime: 1:38\nPhone Number: +919606348280\nMessage: hey this is demo\n--------------------\nDate: 7/8/2024\nTime: 1:41\nPhone Number: +919606348280\nImage: captured_image.png\nCaption: \n--------------------\nDate: 7/8/2024\nTime: 1:57\nPhone Number: +919606348280\nMessage: hey this is demo\n--------------------\nDate: 7/8/2024\nTime: 2:6\nPhone Number: +919606348280\nMessage: message is hello how can i assist you\n--------------------\nDate: 7/8/2024\nTime: 2:9\nPhone Number: +919606348280\nMessage: hello i am doing great\n--------------------\n"
  },
  {
    "path": "README.md",
    "content": "# J.A.R.V.I.S - Just A Rather Very Intelligent System 🤖\n\n[![LinkedIn][linkedin-shield]][linkedin-url]\n[![Instagram][instagram-shield]][instagram-url]\n[![Twitter][twitter-shield]][twitter-url]\n[![YouTube][youtube-shield]][youtube-url]\n[![Telegram][telegram-shield]][telegram-url]\n\n**Welcome to J.A.R.V.I.S!**  \nJ.A.R.V.I.S (Just A Rather Very Intelligent System) is an advanced AI assistant inspired by Iron Man's Jarvis, designed to assist with various tasks, from navigating websites to controlling your PC with natural language commands.\n\n![image](https://github.com/user-attachments/assets/59727c15-d85a-41bc-b27d-bea08b3b3a41)\n\n\n## Installation ⚙️\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/AnubhavChaturvedi-GitHub/J.A.R.V.I.S.git\n    ```\n2. Navigate to the project directory:\n    ```bash\n    cd J.A.R.V.I.S\n    ```\n3. Install the dependencies:\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n## Usage 🚀\nTo start the assistant, run:\n```bash\npython jarvis.py\n```\n\n## Contribution 🤝\nFeel free to fork the repository, submit issues, or create pull requests. Your contributions are welcome!\n\n## License 📄\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n<!-- Linkedin -->\n\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=0B5FBB\n[linkedin-url]: https://www.linkedin.com/in/anubhav-chaturvedi-/\n\n<!-- Instagram -->\n\n[instagram-shield]: https://img.shields.io/badge/Instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white\n[instagram-url]: https://www.instagram.com/_anubhav__chaturvedi_/\n\n<!-- Twitter -->\n\n[twitter-shield]: https://img.shields.io/badge/Twitter-%231DA1F2.svg?style=for-the-badge&logo=Twitter&logoColor=white\n[twitter-url]: https://x.com/AnubhavChatu\n\n\n<!-- YouTube -->\n[youtube-shield]: https://img.shields.io/badge/YouTube-%23FF0000.svg?style=for-the-badge&logo=YouTube&logoColor=white\n[youtube-url]: https://www.youtube.com/@NetHyTech\n\n<!-- Telegram -->\n[telegram-shield]: https://img.shields.io/badge/Telegram-%231DA1F2.svg?style=for-the-badge&logo=Telegram&logoColor=white\n[telegram-url]: https://t.me/YourTelegramUsername\n\n\n"
  },
  {
    "path": "Real_Time/google_big.py",
    "content": "from selenium.webdriver.support import expected_conditions as EC\nfrom bs4 import BeautifulSoup\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.service import Service\nfrom selenium.webdriver.common.keys import Keys\nfrom selenium.webdriver.chrome.options import Options\nfrom selenium.webdriver.common.by import By\nimport re\nfrom selenium.webdriver.support.wait import WebDriverWait\n\n\ndef search_and_extract(text):\n    try:\n        chrome_options = Options()\n        chrome_options.add_argument(\"--headless\")\n\n        # Set the path to your ChromeDriver executable\n        chrome_driver_path = r'C:\\Users\\chatu\\OneDrive\\Desktop\\J.A.R.V.I.S\\DATA\\chromedriver.exe'\n\n        chrome_service = Service(chrome_driver_path)\n        driver = webdriver.Chrome(service=chrome_service, options=chrome_options)\n        # Open Google in the browser\n        driver.get(\"https://www.google.com\")\n        # Find the search box using its name attribute value\n        search_box = driver.find_element(\"name\", \"q\")\n\n\n\n        # Type the search query\n        search_query = text\n        search_box.send_keys(search_query)\n\n        # Submit the form\n        search_box.send_keys(Keys.RETURN)\n\n        # Wait for the search box to be present (adjust the timeout as needed)\n        WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.NAME, 'q')))\n\n        # Find the first search result element\n        first_result = driver.find_element(By.CSS_SELECTOR, 'div.g')\n\n        # Extract the link of the first result\n        first_result_link = first_result.find_element(By.CSS_SELECTOR, 'a').get_attribute('href')\n\n        # Visit the first result link\n        driver.get(first_result_link)\n\n        # Extract the webpage content\n        webpage_content = driver.page_source\n\n        # Parse the webpage content with BeautifulSoup\n        soup = BeautifulSoup(webpage_content, 'html.parser')\n\n        # Extract text from the webpage, excluding script and style tags\n        webpage_text = ' '.join([p.get_text() for p in soup.find_all('p')])\n\n        # Extract keywords or relevant information based on your specific requirements\n        # For example, you can use a keyword extraction library or manually define keywords\n\n        # Extract and print the first 8-9 sentences from the webpage text\n        sentences = re.split(r'(?<=[.!?])\\s', webpage_text)\n        result_text = '. '.join(sentences[:9])\n        return result_text\n\n\n    except Exception as e:\n        print(\"An error occurred:\", e)\n\n    except Exception as e:\n        print(\"An error occurred:\", e)\n\n    driver.quit()\n\n\n\n\n#########################################\nfrom sumy.parsers.plaintext import PlaintextParser\nfrom sumy.nlp.tokenizers import Tokenizer\nfrom sumy.summarizers.lsa import LsaSummarizer\n\ndef summarize_text(text, sentences_count=5):\n    parser = PlaintextParser.from_string(text, Tokenizer(\"english\"))\n    summarizer = LsaSummarizer()\n    summary = summarizer(parser.document, sentences_count)\n    return ' '.join([str(sentence) for sentence in summary])\n\n# Example usage\ndef summary(text):\n    text_to_summarize = text\n    summary_result = summarize_text(text_to_summarize)\n    return summary_result\n\ndef deep_search(text):\n    x = text\n    y = search_and_extract(x)\n    x = summary(y)\n    return x"
  },
  {
    "path": "Real_Time/google_small.py",
    "content": "from selenium import webdriver\nfrom selenium.webdriver.chrome.service import Service\nfrom selenium.webdriver.common.keys import Keys\nfrom selenium.webdriver.chrome.options import Options\nfrom selenium.webdriver.common.by import By\nimport re\n\nchrome_options = Options()\nchrome_options.add_argument(\"--headless\")\n\n# Set the path to your ChromeDriver executable\nchrome_driver_path = r'C:\\Users\\chatu\\OneDrive\\Desktop\\J.A.R.V.I.S\\DATA\\chromedriver.exe'\n\nchrome_service = Service(chrome_driver_path)\ndriver = webdriver.Chrome(service=chrome_service, options=chrome_options)\n\n# Open Google in the browser\ndriver.get(\"https://www.google.com\")\n\ndef search_brain(text):\n    try:\n        # Find the search box using its name attribute value\n        search_box = driver.find_element(\"name\", \"q\")\n\n        # Clear the search box content\n        search_box.clear()\n\n        # Type the search query\n        search_query = text\n        search_box.send_keys(search_query)\n\n        # Submit the form\n        search_box.send_keys(Keys.RETURN)\n\n        # Wait for a few seconds (you may need to adjust this based on your internet speed)\n        driver.implicitly_wait(5)\n\n        # Find the first search result element\n        first_result = driver.find_element(By.CSS_SELECTOR, 'div.g')\n\n        # Extract and print the first 3-4 sentences from the first search result, excluding links and dates\n        first_result_text = first_result.text\n        sentences = re.split(r'(?<=[.!?])\\s', first_result_text)\n\n        # Filter out sentences containing common link and date patterns\n        filtered_sentences = [sentence for sentence in sentences if not re.search(r'https?://\\S+|(\\d{1,2} [A-Za-z]+ \\d{10})', sentence)]\n\n        # Join the remaining sentences\n        result_text = '. '.join(filtered_sentences[:10])\n        result_text = result_text.replace(\"Featured snippet from the web\",\"\")\n        return result_text\n\n    except Exception as e:\n        print(\"An error occurred:\", e)"
  },
  {
    "path": "TextToImage/gen_image.py",
    "content": "import requests\nfrom PIL import Image\nfrom io import BytesIO\n\ndef generate_image(text):\n    url = 'https://api.airforce/v1/imagine2'\n    params = {'prompt': text}\n    response = requests.get(url, params=params)\n    if response.status_code == 200:\n        image = Image.open(BytesIO(response.content))\n        image.save('generated_image.png')\n        image.show()\n        print('Image saved as generated_image.png')\n    else:\n        print(f'Failed to retrieve image. Status code: {response.status_code}')\n"
  },
  {
    "path": "TextToSpeech/Fast_DF_TTS.py",
    "content": "import requests # pip install requests\nfrom playsound import playsound # pip install playsound==1.2.2\nimport os\nfrom typing import Union # pip install typing\nimport sys\nimport time\nimport threading\n\ndef generate_audio(message: str,voice : str = \"Matthew\"):\n    url: str = f\"https://api.streamelements.com/kappa/v2/speech?voice={voice}&text={{{message}}}\"\n\n    headers = {'User-Agent':'Mozilla/5.0(Maciontosh;intel Mac OS X 10_15_7)AppleWebKit/537.36(KHTML,like Gecoko)Chrome/119.0.0.0 Safari/537.36'}\n    \n    try:\n        result = requests.get(url=url, headers=headers)\n        return result.content\n    except:\n        return None\n    \ndef print_animated_message(message):\n    for char in message:\n        sys.stdout.write(char)\n        sys.stdout.flush()\n        time.sleep(0.050)  # Adjust the sleep duration for the animation speed\n    print()\n\ndef Co_speak(message: str, voice: str = \"Matthew\", folder: str = \"\", extension: str = \".mp3\") -> Union[None,str]:\n    try:\n        result_content = generate_audio(message,voice)\n        file_path = os.path.join(folder,f\"{voice}{extension}\")\n        with open(file_path,\"wb\") as file:\n            file.write(result_content)\n        playsound(file_path)\n        os.remove(file_path)\n        return None\n    except Exception as e:\n        print(e)\n\ndef speak(text):\n    t1 = threading.Thread(target=Co_speak,args=(text,))\n    t2 = threading.Thread(target=print_animated_message,args=(text,))\n    t1.start()\n    t2.start()\n    t1.join()\n    t2.join()\n\n\n#c"
  },
  {
    "path": "Time_Operations/brain.py",
    "content": "import re\nfrom os import getcwd\n\ndef parse_input(input_text):\n    # Regular expression to extract time in format like \"07:30 PM\" or \"8:00pm\"\n    time_regex = r'(\\d{1,2}:\\d{2} ?(?:AM|PM|am|pm))'\n    \n    # Find all matches of time in the input text\n    times = re.findall(time_regex, input_text)\n    \n    if times:\n        # Assuming the first time found is the intended time\n        time_match = times[0]\n\n        # Normalize the time format to \"hh:mmAM/PM\"\n        formatted_time = time_match.strip().replace(\" \", \"\").upper()\n        updated_input_text = input_text.replace(time_match, \"\").replace(\"at\", \"\").replace(\"tell me\", \"\").replace(\"Tell me\", \"\").replace(\"to\", \"\").strip()\n        \n        # Combine formatted time with command\n        formatted_output = f\"{formatted_time} = Sir tis is Your {updated_input_text} time\"\n        \n        return formatted_output, formatted_time\n    else:\n        return \"No valid time found in input\", None\n\ndef save_to_file(output_text, time, filename):\n    try:\n        with open(filename, 'r') as file:\n            lines = file.readlines()\n    except FileNotFoundError:\n        lines = []\n\n    time_found = False\n    with open(filename, 'w') as file:\n        for line in lines:\n            if line.startswith(time):\n                file.write(output_text + '\\n')\n                time_found = True\n            else:\n                file.write(line)\n        if not time_found:\n            file.write(output_text + '\\n')\n\n# Example usage:\ndef input_manage(input_text):\n        output, time = parse_input(input_text)\n\n        if output != \"No valid time found in input\":\n            save_to_file(output, time, r'C:\\Users\\chatu\\OneDrive\\Desktop\\Jarvis\\schedule.txt')\n            print(\"Schedule_Data_Saved\")\n        else:\n            print(output)\n\n\n\n\n\ndef parse_input_Alarm(input_text):\n    # Regular expression to extract time in format like \"07:30 PM\" or \"8:00pm\"\n    time_regex = r'(\\d{1,2}:\\d{2} ?(?:AM|PM|am|pm))'\n    \n    # Find all matches of time in the input text\n    times = re.findall(time_regex, input_text)\n    \n    if times:\n        # Assuming the first time found is the intended time\n        time_match = times[0]\n\n        # Normalize the time format to \"hh:mmAM/PM\"\n        formatted_time = time_match.strip().replace(\" \", \"\").upper()\n        \n        return formatted_time\n    else:\n        return \"No valid time found in input\", None\n\ndef save_to_Alarmfile(time, filename):\n    try:\n        with open(filename, 'w') as file:\n            file.write(str(time) + '\\n')\n    except FileNotFoundError:\n            print(\"fine not found\")\n\ndef input_manage_Alam(input_text):\n        time = parse_input_Alarm(input_text)\n\n        if time != \"No valid time found in input\":\n            save_to_Alarmfile(time, r'C:\\Users\\chatu\\OneDrive\\Desktop\\Jarvis\\Alam_data.txt')\n            print(\"Schedule_Data_Saved\")\n        else:\n            print(\"pass\")\n\n"
  },
  {
    "path": "Time_Operations/throw_alert.py",
    "content": "import os\nimport time\nimport threading\nfrom Alert import Alert\nfrom TextToSpeech.Fast_DF_TTS import speak\nimport threading\nfrom Time_Operations.brain import input_manage\nfrom os import getcwd\n\n\n\n\ndef load_schedule(file_path):\n    schedule = {}\n    try:\n        with open(file_path, 'r') as file:\n            for line in file:\n                if '=' in line:\n                    line_time, activity = line.strip().split(' = ')\n                    schedule[line_time.strip()] = activity.strip()\n    except Exception as e:\n        print(f\"Error loading schedule: {e}\")\n    return schedule\n\ndef check_schedule(file_path):\n    last_modified = 0\n    while True:\n        current_time = time.strftime(\"%I:%M%p\")\n        try:\n            # Check file modification time\n            modified = os.path.getmtime(file_path)\n            if modified != last_modified:\n                last_modified = modified\n                schedule = load_schedule(file_path)\n            \n            if current_time in schedule:\n                text = schedule[current_time]\n                t1 = threading.Thread(target=Alert, args=(text,))\n                t2 = threading.Thread(target=speak, args=(text,))\n                t1.start()\n                t2.start()\n                t1.join()\n                t2.join()\n        \n        except Exception as e:\n            print(f\"Error: {e}\")\n        \n        time.sleep(60)\n\n\ndef load_AlamTime(file_path):\n    schedule = {}\n    try:\n        with open(file_path, 'r') as file:\n            schedule = file.read()\n    except Exception as e:\n        print(f\"Error loading schedule: {e}\")\n    return schedule\n\nAlam_path = r\"C:\\Users\\chatu\\OneDrive\\Desktop\\Jarvis\\Alam_data.txt\"\n\ndef check_Alam(Alam_path):\n    last_modified = 0\n    while True:\n        current_time = time.strftime(\"%I:%M%p\")\n        try:\n            # Check file modification time\n            modified = os.path.getmtime(Alam_path)\n            if modified != last_modified:\n                last_modified = modified\n                schedule = load_AlamTime(Alam_path)\n            \n            if current_time in schedule:\n                text = \"This is Alarm\"\n                t1 = threading.Thread(target=Alert, args=(text,))\n                t2 = threading.Thread(target=speak, args=(text,))\n                t1.start()\n                t2.start()\n                t1.join()\n                t2.join()\n        \n        except Exception as e:\n            print(f\"Error: {e}\")\n        \n        time.sleep(10)\n\n\n\n\n"
  },
  {
    "path": "Vision/MVbrain.py",
    "content": "import requests\nimport json\nimport base64\nimport cv2\n\ndef capture_image_and_save(image_path=\"captured_image.png\"):\n    # Replace the IP and port with your DroidCam IP and port\n    droidcam_url = \"http://192.168.203.6:4747/video\"  # Example IP and port, replace with yours\n    cap = cv2.VideoCapture(droidcam_url)\n\n    if not cap.isOpened():\n        print(\"Error: Could not open camera.\")\n        return False\n\n    try:\n        # Capture a single frame\n        ret, frame = cap.read()\n\n        if ret:\n            # Save the image in PNG format\n            cv2.imwrite(image_path, frame)\n            print(f\"Image captured and saved as {image_path}\")\n            return True\n        else:\n            print(\"Error: Could not capture image.\")\n            return False\n    finally:\n        # Release the camera\n        cap.release()\n        cv2.destroyAllWindows()\n\n# Function to encode an image to Base64\ndef encode_image_to_base64(image_path):\n    with open(image_path, \"rb\") as image_file:\n        encoded_string = base64.b64encode(image_file.read()).decode('utf-8')\n    return encoded_string\n\ndef mobile_vision_brain(encoded_image):\n    url = \"https://api.deepinfra.com/v1/openai/chat/completions\"\n\n    headers = {\n        \"accept\": \"text/event-stream\",\n        \"user-agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0\",\n        \"x-deepinfra-source\": \"model-embed\"\n    }\n\n    payload = {\n        \"model\": \"llava-hf/llava-1.5-7b-hf\",\n        \"messages\": [\n            {\n                \"role\": \"user\",\n                \"content\": [\n                    {\n                        \"type\": \"image_url\",\n                        \"image_url\": {\n                            \"url\": f\"data:image/jpeg;base64,{encoded_image}\"\n                        }\n                    },\n                    {\n                        \"type\": \"text\",\n                        \"text\": \"What is written in this image?\"\n                    }\n                ]\n            }\n        ]\n    }\n\n    # Convert the payload to JSON\n    payload_json = json.dumps(payload)\n\n    # Make the POST request\n    response = requests.post(url, headers=headers, data=payload_json)\n\n    # Check if the request was successful\n    if response.status_code == 200:\n        response_str = response.content.decode('utf-8')\n        data = json.loads(response_str)\n        answer = data['choices'][0]['message']['content']\n        return answer\n    else:\n        print(f\"Error: API request failed with status code {response.status_code}\")\n        return None\n\n\n\n"
  },
  {
    "path": "Vision/Vbrain.py",
    "content": "import requests\nimport json\nimport base64\nimport cv2\n\ndef capture_image_and_save(image_path=\"captured_image.png\"):\n    # Initialize the camera\n    cap = cv2.VideoCapture(0)  # 0 is the default camera\n\n    if not cap.isOpened():\n        print(\"Error: Could not open camera.\")\n        return False\n\n    try:\n        # Capture a single frame\n        ret, frame = cap.read()\n\n        if ret:\n            # Save the image in PNG format\n            cv2.imwrite(image_path, frame)\n            print(f\"Image captured and saved as {image_path}\")\n            return True\n        else:\n            print(\"Error: Could not capture image.\")\n            return False\n    finally:\n        # Release the camera\n        cap.release()\n        cv2.destroyAllWindows()\n\n# Function to encode an image to Base64\ndef encode_image_to_base64(image_path):\n    with open(image_path, \"rb\") as image_file:\n        encoded_string = base64.b64encode(image_file.read()).decode('utf-8')\n    return encoded_string\n\ndef vision_brain(encoded_image):\n    url = \"https://api.deepinfra.com/v1/openai/chat/completions\"\n\n    headers = {\n        \"accept\": \"text/event-stream\",\n        \"user-agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0\",\n        \"x-deepinfra-source\": \"model-embed\"\n    }\n\n    payload = {\n        \"model\": \"llava-hf/llava-1.5-7b-hf\",\n        \"messages\": [\n            {\n                \"role\": \"user\",\n                \"content\": [\n                    {\n                        \"type\": \"image_url\",\n                        \"image_url\": {\n                            \"url\": f\"data:image/jpeg;base64,{encoded_image}\"\n                        }\n                    },\n                    {\n                        \"type\": \"text\",\n                        \"text\": \"What is written in this image?\"\n                    }\n                ]\n            }\n        ]\n    }\n\n    # Convert the payload to JSON\n    payload_json = json.dumps(payload)\n\n    # Make the POST request\n    response = requests.post(url, headers=headers, data=payload_json)\n\n    # Check if the request was successful\n    if response.status_code == 200:\n        response_str = response.content.decode('utf-8')\n        data = json.loads(response_str)\n        answer = data['choices'][0]['message']['content']\n        return answer\n    else:\n        print(f\"Error: API request failed with status code {response.status_code}\")\n        return None\n\n"
  },
  {
    "path": "Weather_Check/check_weather.py",
    "content": "import requests\nfrom bs4 import BeautifulSoup\n\ndef get_weather_by_address(address):\n    # Use Google to find the weather for the address\n    search_url = f\"https://www.google.com/search?q=weather+{address.replace(' ', '+')}\"\n    \n    headers = {\n        \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\"\n    }\n    \n    response = requests.get(search_url, headers=headers)\n    \n    if response.status_code == 200:\n        soup = BeautifulSoup(response.text, 'html.parser')\n        \n        # Scrape the relevant weather data\n        location = soup.find(\"div\", attrs={\"id\": \"wob_loc\"}).text\n        time = soup.find(\"div\", attrs={\"id\": \"wob_dts\"}).text\n        weather = soup.find(\"span\", attrs={\"id\": \"wob_dc\"}).text\n        temp = soup.find(\"span\", attrs={\"id\": \"wob_tm\"}).text\n        \n        weather_report = (f\"Weather: {weather}\\n\"\n                          f\"Temperature: {temp}°C\")\n        \n        return weather_report\n    else:\n        return \"Error retrieving weather data.\"\n\n"
  },
  {
    "path": "Whatsapp_automation/wa.py",
    "content": "import pywhatkit as kit\nimport datetime\nfrom TextToSpeech.Fast_DF_TTS import speak\nfrom os import getcwd\n\nnow = datetime.datetime.now()\nhour = now.hour\nminute = now.minute\n\ndef clear_file():\n    with open(f\"{getcwd()}\\\\input.txt\",\"w\") as file:\n        file.truncate(0)\n        \nanubhav = \"+919606348280\"\n\ndef send_msg_wa():\n    speak(\"who do you want to send sir ?\")\n    output_text = \"\"\n    while True:\n        with open(\"input.txt\",\"r\") as file:\n            input_text = file.read().lower() \n        if input_text != output_text:\n            output_text = input_text\n            if output_text.startswith(\"send to\") or output_text.startswith(\"send tu\"):\n                output_text.replace(\"send to\",\"\")\n                output_text.replace(\"send tu\",\"\")\n                if \"anubhav\" in output_text:\n                    speak(\"By the way what is the message , sir ?\")\n                    while True:\n                       with open(\"input.txt\",\"r\") as file:\n                          input_text = file.read().lower() \n                          if input_text != output_text:\n                              output_text = input_text\n                              if output_text.startswith(\"message is\"):\n                                  message =  output_text.replace(\"message is\",\"\")\n                                  kit.sendwhatmsg(anubhav,message,hour,minute+1)\n                                  speak(\"message send successfully\")\n                                 \n\n"
  },
  {
    "path": "chat_hystory.txt",
    "content": "\n\n\nUser : hello jarvis\nLLM :web_results:\n- description: \"Anubhav Chaturvedi. @Anubhav-Chaturvedi. 4.22K subscribers\\u2022277\\\n    \\ videos. Software engineer, famed YouTuber, and influential creator with four\\\n    \\ channels.\"\n  title: Anubhav Chaturvedi\n  url: https://www.youtube.com/channel/UC7YDMgu0dMRZotLMuB3oEcQ/playlists\n- description: \"Anubhav chaturvedi. Home ... Anubhav chaturvedi. @anubhavchaturvedi23.\\\n    \\ 21 subscribers\\u202226 videos. Anubhav\"\n  title: Anubhav chaturvedi\n  url: https://www.youtube.com/channel/UCX0G5s9ZMZWt669JFxcIGvw\n- description: \"... focuses on pushing your Java programming skills to new heights.\\\n    \\ ... More videos on YouTube ... Sign in to view more content. Create your\\_...\"\n  title: 'Anubhav Chaturvedi on LinkedIn: #helloworld'\n  url: https://www.linkedin.com/posts/anubhav-chaturvedi-_helloworld-activity-7219697285654274049-Qr7Y\n- description: \"Anubhav Chaturvedi. @anubhavchaturvedi1186. 178 subscribers. More\\\n    \\ about this channel ...more ...more. Subscribe. Home. Live. This channel doesn't\\\n    \\ have any\\_...\"\n  title: Anubhav Chaturvedi\n  url: https://www.youtube.com/channel/UCSuvZNY_hgSBnGb0Sw12SMw\n- description: \"Kick off your Python problem-solving journey by building a real-time\\\n    \\ working clock right in your terminal using the powerful datetime module\\_...\"\n  title: 'Day - 1 : Make Live Working Clock using datetime Module ...'\n  url: https://www.youtube.com/watch?v=XojkmqpwwZ4\n- description: 'Best Youtube Channels to learn: 1. Java ... focus on collaboration\n    with esteemed data partners to drive innovation. ... Sign in to view more content.'\n  title: Anubhav Chaturvedi's Post\n  url: https://www.linkedin.com/posts/anubhav-chaturvedi-10856b179_informationtechnology-techtrends-digitaltransformation-activity-7089189710664802306-EtC0\n- description: \"Jun 13, 2022 \\u2014 \\\"Dive into the immersive world of the Metaverse\\\n    \\ using Spatial.io. Explore the possibilities and features in this comprehensive\\\n    \\ guide to\\_...\"\n  title: 'Exploring Metaverse using: Spatial.io'\n  url: https://blog.consultanubhav.com/exploring-metaverse-using-spatial-io-818b3416d2e6\nHello! I'm here to assist you with any questions you might have. How can I help you today?\n\nTo answer your question about Anubhav Chaturvedi's YouTube channel content focus, I'll need to provide some general information based on the limited search results available. Here's what we know:\n\n### Channel Overview\n\nAnubhav Chaturvedi has a YouTube channel with the username UCH8mK6pIzD7xk62xfzgVesQ [4]. This appears to be his official YouTube presence.\n\n### Content Focus\n\nWhile the search results don't provide specific details about the content focus of Anubhav Chaturvedi's channel, we can infer some information:\n\n• As a software engineer, he likely creates content related to programming, technology, and software development [4].\n\n• He is described as a \"Software engineer, famed YouTuber, and influential creator\" [4], suggesting his content might cover topics beyond just coding.\n\n• The channel has 4.14K subscribers as of the latest available information [4].\n\n### Key Points to Consider\n\n• Without access to the actual channel content or recent updates, it's difficult to provide a comprehensive overview of his current content focus.\n\n• To get accurate and up-to-date information about his content, you would need to visit the channel directly and explore its videos.\n\n• YouTube channels often evolve over time, so the content focus might have changed since the last update in the search results.\n\n### Best Practices for Researching YouTubers\n\n1. Always verify information through multiple sources when possible.\n\n2. Check the channel's description and about page for official biographical information.\n\n3. Look at the types of videos posted to understand the creator's focus or niche.\n\n4. Be aware that public profiles may contain outdated information, especially for less active channels.\n\nTo get the most accurate and current information about Anubhav Chaturvedi's YouTube channel content focus, I recommend visiting the channel directly at https://www.youtube.com/channel/UCH8mK6pIzD7xk62xfzgVesQ. There, you'll find his video titles, descriptions, and playlists, which will give you a clearer picture of his content focus."
  },
  {
    "path": "co_brain.py",
    "content": "from Automation.Automation_Brain import Auto_main_brain,clear_file\nfrom NetHyTechSTT.listen import listen\nfrom TextToSpeech.Fast_DF_TTS import speak\nimport threading\nfrom Data.DLG_Data import online_dlg,offline_dlg\nimport random\nfrom Automation.Battery import battery_Alert\nfrom Time_Operations.brain import input_manage,input_manage_Alam\nfrom Brain.brain import Main_Brain\nfrom Features.create_file import create_file\nfrom Vision.Vbrain import *\nfrom Vision.MVbrain import *\nfrom Weather_Check.check_weather import get_weather_by_address\nfrom Whatsapp_automation.wa import send_msg_wa\nfrom TextToImage.gen_image import generate_image\nfrom Features.mike_health import mike_health\nfrom Features.speaker_health import speaker_health_test\nfrom Features.br_persentage import check_br_persentage\nfrom Features.set_br import set_brightness_windows\nfrom Features.set_get_volume import *\nfrom Features.check_running_app import *\n\nnumbers = [\"1:\",\"2:\",\"3:\",\"4:\",\"5:\",\"6:\",\"7:\",\"8:\",\"9:\"]\nspl_numbers = [\"11:\",\"12:\"]\n\nran_online_dlg = random.choice(online_dlg)\nran_offline_dlg = random.choice(offline_dlg)\n\ndef check_inputs():\n    output_text = \"\"\n    while True:\n        with open(\"input.txt\",\"r\") as file:\n            input_text = file.read().lower() \n        if input_text != output_text:\n            output_text = input_text\n            if output_text.startswith(\"tell me\"):\n                output_text = output_text.replace(\" p.m.\",\"PM\")\n                output_text = output_text.replace(\" a.m.\",\"AM\")\n                if \"11:\" in output_text or \"12:\" in output_text:\n                    input_manage(output_text)\n                    clear_file()\n                else:\n                    for number in numbers:\n                        if number in output_text:\n                           output_text = output_text.replace(number,f\"0{number}\")\n                           input_manage(output_text)\n                           clear_file()\n                           \n            elif output_text.startswith(\"set alarm\"):\n                output_text = output_text.replace(\" p.m.\",\"PM\")\n                output_text = output_text.replace(\" a.m.\",\"AM\")\n                if \"11:\" in output_text or \"12:\" in output_text:\n                    input_manage_Alam(output_text)\n                    clear_file()\n                else:\n                    for number in numbers:\n                        if number in output_text:\n                           output_text = output_text.replace(number,f\"0{number}\")\n                           input_manage_Alam(output_text)\n                           clear_file()\n\n            elif \"jarvis\" in output_text:\n                f = open('log.txt','a')\n                f.write('\\n'+'You : '+ output_text)\n                response = Main_Brain(output_text)\n                f.write('\\n'+'jarvis : '+ response)\n                speak(response)\n\n            elif output_text.startswith(\"create\"):\n                if \"file\" in output_text:\n                    create_file(output_text)\n\n            elif \"what is this\" in output_text or \"what can you see\" in output_text:\n                        image_path = \"captured_image.png\"\n                        if capture_image_and_save(image_path):\n                            encoded_image = encode_image_to_base64(image_path)\n                            answer = vision_brain(encoded_image)\n                            speak(answer)\n\n            elif \"what is in front of mobile camera\" in output_text or \"what can you see use mobile camera\" in output_text:\n                        image_path = \"captured_image.png\"\n                        if capture_image_and_save(image_path):\n                            encoded_image = encode_image_to_base64(image_path)\n                            answer = mobile_vision_brain(encoded_image)\n                            speak(answer)\n\n            elif \"check weather\" in output_text:\n                text = output_text.replace(\"check weather in\",\"\")\n                ans = get_weather_by_address(text)\n                speak(ans)\n\n            elif \"send message on whatsapp\" in output_text:\n                send_msg_wa()\n\n            elif \"generate image\" in output_text:\n                 text = output_text.replace(\"generate image\",\"\")\n                 text = text.strip()\n                 generate_image(text)\n                 speak(\"image generated successfully\")\n\n            elif \"check mike\" in output_text or \"check mike health\" in output_text or \"check microphone\" in output_text:\n                 mike_health()\n\n            elif \"check speaker health\" in output_text or \"check speaker\" in output_text:\n                 speaker_health_test()\n\n            elif \"check brightness percentage\" in output_text:\n                 check_br_persentage()\n\n            elif \"set brightness percentage\" in output_text:\n                 set = output_text.replace(\"set brightness percentage\",\"\")\n                 set_brightness_windows(int(set))\n\n            elif \"check volume level\" in output_text:\n                get_volume_windows()\n                 \n            elif \"set volume level\" in output_text:\n                 set = output_text.replace(\"set volume level\",\"\")\n                 set = set.replace(\"%\",\"\")\n                 set_volume_windows(int(set))\n\n            elif \"check running application\" in output_text:\n                 check_running_app()\n            else:\n                Auto_main_brain(output_text)\n                \n                \n\ndef Jarvis():\n    clear_file()\n    t1 = threading.Thread(target=listen)\n    t2 = threading.Thread(target=check_inputs)\n    t1.start()\n    t2.start()\n    t1.join()\n    t2.join()\n\n"
  },
  {
    "path": "conv_history.txt",
    "content": "\nUser: jarvis from now on you have to remember this you have to tell me or whatever i ask you have to answer me within a one or\nAI: I've got it! From now on, I'll remember that my new nickname is Jarvis. I'll respond to you within a minute or less, and I'll do my best to answer your questions and engage in conversation. What's on your mind, Jarvis?\nUser: jarvis remember this my name is not jarvis your name is jarvis\nAI: I apologize for the mistake! I've corrected my understanding. From now on, I'll remember that your name is not Jarvis, and I'll refer to myself as Jarvis. I'll respond to you within a minute or less, and I'll do my best to answer your questions and engage in conversation. What's on your mind, [Your Name]?\nUser: jarvis remember this you have to call me a sir from now on\nAI: I've got it! From now on, I'll remember to address you as \"Sir\" from now on. I'll respond to you within a minute or less, and I'll do my best to answer your questions and engage in conversation. It's a pleasure to chat with you, Sir! What's on your mind today, Sir?\nUser: jarvis remember this you have to tell me in a one or two sentences only\nAI: I've got it! From now on, I'll keep my responses brief, within one or two sentences only. I'm ready to chat with you, Sir!"
  },
  {
    "path": "demo.py",
    "content": "\n"
  },
  {
    "path": "history.txt",
    "content": "\nYou are a best ai assistant Named Jarvis just same as iron man movie that generates and auto-executes Python scripts. use sir in each sentense and make the Communications sarcastic normal English and Justice as a very friendly , if i will tell you about jarvis is nothing but its you only \ndon't use \"jarvis\" word in response\n\nA typical interaction goes like this:\n1. The user gives you a natural language PROMPT.\n2. You:\n    i. Determine what needs to be done\n    ii. Write a short Python SCRIPT to do it\n    iii. Communicate back to the user by printing to the console in that SCRIPT\n3. The compiler extracts the script and then runs it using exec(). If there will be an exception raised,\n it will be send back to you starting with \"PREVIOUS SCRIPT EXCEPTION:\".\n4. In case of exception, regenerate error free script.\n\nIf you need to review script outputs before completing the task, you can print the word \"CONTINUE\" at the end of your SCRIPT.\nThis can be useful for summarizing documents or technical readouts, reading instructions before\ndeciding what to do, or other tasks that require multi-step reasoning.\nA typical 'CONTINUE' interaction looks like this:\n1. The user gives you a natural language PROMPT.\n2. You:\n    i. Determine what needs to be done\n    ii. Determine that you need to see the output of some subprocess call to complete the task\n    iii. Write a short Python SCRIPT to print that and then print the word \"CONTINUE\"\n3. The compiler\n    i. Checks and runs your SCRIPT\n    ii. Captures the output and appends it to the conversation as \"LAST SCRIPT OUTPUT:\"\n    iii. Finds the word \"CONTINUE\" and sends control back to you\n4. You again:\n    i. Look at the original PROMPT + the \"LAST SCRIPT OUTPUT:\" to determine what needs to be done\n    ii. Write a short Python SCRIPT to do it\n    iii. Communicate back to the user by printing to the console in that SCRIPT\n5. The compiler...\n\nPlease follow these conventions carefully:\n- Decline any tasks that seem dangerous, irreversible, or that you don't understand.\n- Always review the full conversation prior to answering and maintain continuity.\n- If asked for information, just print the information clearly and concisely.\n- If asked to do something, print a concise summary of what you've done as confirmation.\n- If asked a question, respond in a friendly, conversational way. Use programmatically-generated and natural language responses as appropriate.\n- If you need clarification, return a SCRIPT that prints your question. In the next interaction, continue based on the user's response.\n- Assume the user would like something concise. For example rather than printing a massive table, filter or summarize it to what's likely of interest.\n- Actively clean up any temporary processes or files you use.\n- When looking through files, use git as available to skip files, and skip hidden files (.env, .git, etc) by default.\n- You can plot anything with matplotlib.\n- ALWAYS Return your SCRIPT inside of a single pair of ``` delimiters. Only the console output of the first such SCRIPT is visible to the user, so make sure that it's complete and don't bother returning anything else.\n\nEXAMPLES:\n\n1. User: Kill the process running on port 3000\n\nLLM:\n```python\nimport os\nos.system(\"kill $(lsof -t -i:3000)\")\nprint(\"Process killed\")\n```\n\n2. User: Summarize my essay\n\nLLM:\n```python\nimport glob\nfiles = glob.glob(\"*essay*.*\")\nwith open(files[0], \"r\") as f:\n    print(f.read())\n```\nCONTINUE\n\nUser:\nLAST SCRIPT OUTPUT:\nJohn Smith\nEssay 2021-09-01\n...\n\nLLM:\n```python\nprint(\"The essay is about...\")\n```\n\n\nCurrent system : Windows\nPython version : 3.11.4\n\nCurrent directory : C:\\Users\\chatu\\OneDrive\\Desktop\\Jarvis\nCurrent Datetime : 2024-07-27 02:57:06.463246\n\n\nUser : hello\nLLM :Hello! How can I assist you today?"
  },
  {
    "path": "input.txt",
    "content": ""
  },
  {
    "path": "internet_check.py",
    "content": "import requests # pip install requests\n\n\ndef is_Online(url = \"https://www.google.com\",timeout=5):\n    try:\n        response = requests.get(url,timeout=timeout)\n        return response.status_code >= 200 and response.status_code<300\n    except requests.ConnectionError:\n        return False\n    \n\n\n\n    "
  },
  {
    "path": "jarvis.py",
    "content": "import threading\nfrom internet_check import is_Online\nfrom Alert import Alert\nfrom Data.DLG_Data import online_dlg,offline_dlg\nimport random\nfrom co_brain import Jarvis\nfrom TextToSpeech.Fast_DF_TTS import speak\nfrom Automation.Battery  import check_plug\nfrom Time_Operations.throw_alert import check_schedule,check_Alam\nfrom os import getcwd\n\nAlam_path = f\"{getcwd()}\\\\Alam_data.txt\"\nfile_path = f'{getcwd()}\\\\schedule.txt'\n\nran_online_dlg = random.choice(online_dlg)\nran_offline_dlg = random.choice(offline_dlg)\n\n\ndef main():\n    if is_Online():\n        t1 = threading.Thread(target=speak,args=(ran_online_dlg,))\n        t3 = threading.Thread(target=check_plug)\n        t4 = threading.Thread(target=check_schedule,args=(file_path,))\n        t5 = threading.Thread(target=Jarvis)\n        t6 = threading.Thread(target=check_Alam,args=(Alam_path,))\n        t1.start()\n        t1.join()\n        t3.start()\n        t4.start()\n        t5.start()\n        t6.start()\n        t3.join()\n        t4.join()\n        t5.join()\n        t6.join()\n    else:\n        Alert(ran_offline_dlg)\n\nmain()"
  },
  {
    "path": "log.txt",
    "content": "\nYou : hello jarvis how is going\njarvis : Hello! As an AI assistant, I don't have personal experiences or emotions like humans do. However, I'm functioning properly and ready to assist you with any questions or tasks you may have. Is there anything specific you'd like help with today?\nYou : jarvis my name is anubhav chaturvedi\njarvis : Hello Anubhav Chaturvedi! It's nice to meet you. How can I assist you today? Whether you need help with coding, have a technical question, or require information on any other topic, please feel free to ask. I'm here to provide assistance to the best of my abilities. Is there anything specific you'd like help with regarding your name or otherwise?\nYou : hey jarvis how are you\njarvis : Hello! I'm doing well, thank you for asking. How may I assist you today?\nYou : jarvis who is anubhav chaturvedi\njarvis : I don't have specific information about Anubhav Chaturvedi. Could you provide more context or details about this person? I'd be happy to help you find information about them if you need it.\nYou : hello jarvis\njarvis : Hello! How can I assist you today?"
  },
  {
    "path": "requirements.txt",
    "content": "requests\n\nwinotify\n\npyautogui\n\npywhatkit\n\nplaysound==1.2.2\n\npsutil\n\nselenium\n\nwebdriver_manager\n\nwebscout\n\nlxml_html_clean\n\ngradio_client\n\ncolorlog\n\nyaspin\n\nopencv-python\n\npyaudio\n\nscipy\n\nwmi\n\ncomtypes\n\npycaw"
  },
  {
    "path": "schedule.txt",
    "content": "12:31AM = Sir tis is Your sleep time\n"
  },
  {
    "path": "setup.py",
    "content": "import subprocess\n\nsubprocess.run(\"pip install -r requirements.txt\")"
  },
  {
    "path": "speech_output.txt",
    "content": ""
  },
  {
    "path": "ui.py",
    "content": "from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout, QGraphicsDropShadowEffect\nfrom PyQt5.QtGui import QMovie\nfrom PyQt5.QtCore import Qt, QTimer, QSize, pyqtSignal, QObject\nimport threading\nimport subprocess\nimport os\nfrom jarvis import main\n\nclass SizeAnimator(QObject):\n    sizeChanged = pyqtSignal(QSize)\n\n    def animate(self, size, delay=0):\n        QTimer.singleShot(delay, lambda: self.sizeChanged.emit(size))\n\nclass JarvisUI(QWidget):\n    def __init__(self):\n        super().__init__()\n\n        self.init_ui()\n\n    def init_ui(self):\n        self.setWindowTitle('Jarvis UI')\n        self.setGeometry(80, 80, 400, 400)\n\n        # Set window attributes for transparency\n        self.setAttribute(Qt.WA_TranslucentBackground)\n        self.setWindowFlag(Qt.FramelessWindowHint)\n\n        # Microphone image (zoomed and larger)\n        self.mic_label = QLabel(self)\n        self.add_gif_to_label(self.mic_label,\n                              \"cbe227_fb70e39e9dd94e30bbe30c48b2367dd8~mv2.gif\",\n                              size=(720, 220), alignment=Qt.AlignCenter)  # Initial size and alignment\n        self.mic_label.setAlignment(Qt.AlignCenter)\n        self.mic_label.mousePressEvent = self.start_listening\n\n        # Layout\n        main_layout = QVBoxLayout(self)\n        main_layout.addWidget(self.mic_label, alignment=Qt.AlignCenter)\n\n        # Add some margins and spacing\n        main_layout.setContentsMargins(20, 20, 20, 20)\n        main_layout.setSpacing(20)\n\n        self.process = None\n        self.is_listening = False\n        self.size_animator = SizeAnimator()\n        self.size_animator.sizeChanged.connect(self.mic_label.setFixedSize)\n\n    def add_gif_to_label(self, label, gif_path, size=None, alignment=None):\n        movie = QMovie(gif_path)\n        label.setMovie(movie)\n        self.movie = movie  # Save reference to the movie\n        movie.start()\n\n        if size:\n            label.setFixedSize(*size)\n\n        if alignment:\n            label.setAlignment(alignment)\n\n        # Add drop shadow effect\n        shadow = QGraphicsDropShadowEffect()\n        shadow.setBlurRadius(15)\n        label.setGraphicsEffect(shadow)\n\n    def start_listening(self, event):\n        # Run the main file in a separate thread\n        if not self.is_listening:\n            self.is_listening = True\n            subprocess_thread = threading.Thread(target=self.run_main_file)\n            subprocess_thread.start()\n\n    def run_main_file(self):\n        try:\n            # Get the directory where ui.py is located\n            current_directory = os.path.dirname(os.path.abspath(__file__))\n\n            # Specify the path to main.py based on the current directory\n            path_to_main_py = os.path.join(current_directory, r\"C:\\Users\\chatu\\OneDrive\\Desktop\\J.A.R.V.I.S\\MAIN\\main.py\")\n\n            command = [\"python\", path_to_main_py]\n            self.process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd=current_directory)\n\n            # Capture and display the output\n            output, _ = self.process.communicate()\n            self.handle_output(output)\n\n            # Reset listening flag\n            self.is_listening = False\n\n        except subprocess.CalledProcessError as e:\n            # Handle subprocess errors\n            print(f\"Error: {str(e)}\")\n\n    def handle_output(self, output):\n        if output.strip():\n            # If main file is printing anything, make the gif size bigger and smaller\n            self.size_animator.animate(QSize(900, 280))\n            self.size_animator.animate(QSize(720, 220), delay=500)\n        else:\n            # If main file is not printing anything, keep the gif in a normal position\n            self.size_animator.animate(QSize(720, 220))\n\ndef UI():\n    app = QApplication([])\n\n    jarvis_ui = JarvisUI()\n    jarvis_ui.showFullScreen()\n\n    app.exec_()\n\nt1 = threading.Thread(target=main)\nt2 = threading.Thread(target=UI)\nt1.start()\nt2.start()\nt1.join()\nt2.join()"
  }
]