Esempio n. 1
0
def test_get_joke():
    assert get_joke()

    for language in languages:
        assert get_joke(language=language)

    for category in categories:
        assert get_joke(category=category)
Esempio n. 2
0
def test_get_joke():
    assert get_joke()

    languages = ['en', 'de', 'es']
    categories = ['neutral', 'adult', 'all']

    for lang in languages:
        assert get_joke(language=lang)

    for cat in categories:
        assert get_joke(category=cat)
Esempio n. 3
0
def run (message):
    '''
        Run

        Run the custom plugin specific code. A returned
        string is the message that will be sent back
        to the user.

        --
        @param  message:dict    The message sent by the user

        @return str
    '''

    # Get the message contents
    text = message['text']

    # Remove a mention. This could be the case
    # if the bot was mentioned in a chat room
    if text.startswith('@'):
        text = text.split(' ', 1)[1].strip()

    # Some bots will accept commands that started
    # with a '/'
    if text.startswith('/'):
        text = text.replace('/', '', 1).strip()

    # Try and determine what was the trigger command
    # for this plugin.
    action = text.split(' ')[0].strip()

    # Hopefully we never get here, but just in case.
    if action not in commands():
        return 'Sorry, I don\'t know what to do with: {command}'.format(
            command = action)

    # Remove the trigger command
    for command in commands():
        text = ignore_case_replace(command, '', text).strip()

    if text == 'help':
        return _show_help()

    if text in ['neutral', 'explicit', 'chuck', 'all']:
        return pyjokes.get_joke(language = 'en', category = text)

    # Default to a neutral joke
    return pyjokes.get_joke(language = 'en', category = 'all')
def get_the_joke(match):
    language  = get_group_from_match(match, 'language', 'english')
    category  = get_group_from_match(match, 'category', 'neutral')
    try:
        message = get_joke(language=lang_codes[language], category=category)
    except:
        message = 'No {} {} jokes found.'.format(language, category)

    return message
Esempio n. 5
0
 def pyjokes(self, context, args):
     args.default("category", "neutral")
     if args.getstr("category") == 'adult' and not self.getsetting('adult'):
         return 'Adult jokes are not allowed on this channel'
     else:
         try:
             return "%s" % (pyjokes.get_joke(self.getsetting('language'),
                                             args.getstr("category")))
         except pyjokes.pyjokes.CategoryNotFoundError as err:
             return err
         except pyjokes.pyjokes.LanguageNotFoundError as err:
             return err
Esempio n. 6
0
import pyjokes

print("Joke of the day")
print(pyjokes.get_joke('en', 'all'))
# print("Jokes of the Month")
# print(pyjokes.get_jokes())
Esempio n. 7
0
 def handle_intent(self, message):
     self.speak(pyjokes.get_joke(language=self.lang[:-3], category='all'))
Esempio n. 8
0
 def chuck_joke_handler(message):
     joke = pyjokes.get_joke(language='en', category='chuck')
     tb.send_message(message.chat.id, joke)
def Initialize():
    greet()
    while 1:
        query = take_command()
        if query == None:
            print("I cant Hear You")
        else:
            query = query.lower()
            if "open code" in query:
                vspath = "C:\\Users\\abc\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
                os.startfile(vspath)

            elif "open notepad" in query:
                notepath = "C:\\Windows\\system32\\notepad.exe"
                os.startfile(notepath)

            elif "open browser" in query:
                chrome_path = "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
                os.startfile(chrome_path)

            elif "play music" in query:
                songs_dr = "E:\\NEW SONG"
                songs = os.listdir(songs_dr)
                songs_lenght = songs.__len__()
                song_no = random.randint(0, songs_lenght)
                os.startfile(os.path.join(songs_dr, songs[song_no]))

            elif "wikipedia" in query:
                say("Ok let me search")
                query = query.replace('on wikipedia', '')
                result = wikipedia.summary(query, sentences=2)
                say("Accouding to wikipedia:")
                print(result)
                say(result)

            elif "tell me time" in query:
                present_time = datetime.datetime.now().strftime("%I:%M %p")
                print("FRIDAY: ", present_time)
                say("its" + present_time)

            elif "joke" in query:
                print("Ok let me think")
                say("Ok let me think")
                say(pyjokes.get_joke())

            elif "ok bye" in query:
                print("FRIDAY: Ok bye sir, Have a good day")
                say("Sure sir, Have a good day")
                exit()

            elif "open youtube" in query:
                webbrowser.open("https://www.youtube.com")

            elif "on youtube" in query:
                query = query.replace('on youtube', '')
                webbrowser.open(
                    "https://www.youtube.com/results?search_query=" + query)

            elif "open google" in query:
                webbrowser.open("https://www.google.com")

            elif "on google" in query:
                query = query.replace('on google', '')
                webbrowser.open("https://www.google.com/search?q=" + query)

            else:
                print("(*** I can't do that, what you are saying ***)")
                say("I can't do that, what you are saying.")
Esempio n. 10
0
def cmd_joke(match: Match[str]) -> Response:
    return MessageResponse(match, esc(pyjokes.get_joke()))
def jokes():
    speak(pyjokes.get_joke())
import pyjokes
import pdb

#pdb.set_trace()
print(pyjokes.get_joke('en', 'neutral'))
Esempio n. 13
0
            speak("that great sir please tell me what can i do")

        elif 'play' in query:
            whatShouldPlay = query.replace('play', '')
            speak('playing ' + whatShouldPlay)
            pywhatkit.playonyt(whatShouldPlay)

        elif 'open google' in query:
            webbrowser.open("google.com")

        elif 'open code' in query:
            codePath = "C:\\Users\\singhk3\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
            os.startfile(codePath)

        elif 'joke' in query:
            speak(pyjokes.get_joke())
            print(pyjokes.get_joke())

        elif 'the time' in query:
            strTime = datetime.datetime.now().strftime("%H:%M:%S")
            speak(f"Sir, the time is {strTime}")

        elif 'quit' in query:
            speak("Bye Sir Have A Nice Day.")
            speak("If You Want More Help Please call Me Again.")
            speak("Thanks")
            exit()

        elif 'camera' in query:
            SecurityCamera()
Esempio n. 14
0
            os.startfile('C:\\Users\\Akshat\\Downloads')

        elif 'covid' in query or 'corona' in query:
            covid()

        elif "weather today" in query:
           weather()

        elif "send whatsapp message" in query:
            whatsapp()

        elif "what's my name" in query:
            whatsmyname()

        elif 'joke' in query:
            speak(pyjokes.get_joke())

        elif 'how are you'in query or "what's up" in query:
            lis=['I am cool, what about you?','Just doing my work','Performing my duty of serving you','I am nice and full of energy']
            speak(random.choice(lis))

        elif 'send email' in query:
            try:
                speak('What should I say?')
                content = takeCommand()
                to = "your_email_address"
                sendEmail(to, content)
                speak("Email has been sent!")
            except Exception as e:
                print(e)
                speak("Sorry Boss, I am not able to send this email")
Esempio n. 15
0
def run_friday():
    command = take_command()
    print(command)
    if 'play' in command:
        song = command.replace('play', '')
        talk('playing' + song)
        pywhatkit.playonyt(song)

    elif 'open youtube' in command:
        talk("Here you go to Youtube\n")
        wb.open("https://www.youtube.com/")

    elif 'open google' in command:
        talk("Here you go to Google\n")
        flex = "https://www.google.com/"
        wb.open(flex)

    elif 'open github' in command or 'open git hub' in command:
        talk("Here you go to github\n")
        wb.open("https://github.com/")

    elif 'open gmail' in command or 'open email' in command:
        talk("Here you go to g-mail\n")
        wb.open("https://accounts.google.com/signin/v2/identifier?sacu=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin")

    elif 'information' in command:
        person = command.replace('who the heck is', '')
        info = wikipedia.summary(person, 1)
        print(info)
        talk(info)

    elif 'time' in command:
        time = datetime.datetime.now().strftime('%I:%M %p')
        print(time)
        talk('curret time is ' + time)

    elif 'how are you' in command:
        talk("iam fine, thank you sir!")
        talk("How are you, Sir")
        print("get input")

        try:
            to = take_command()
            print("got input:" + str(to))
            if "i'm fine" in to or "iam fine" in to or "i am fine" in to or "iam good" in to or "i am good" in to or "i'm good" in to:
                print("t's good to know that your fine")
                talk("It's good to know that your fine")
        except Exception as e:
            print('exception:' + str(e))
            print("i wish u will have a better time1z")
            talk("i wish u will have a better time")

    elif "who made you" in command or "who created you" in command:
        talk("I have been created by ABISHEK.")

    elif 'joke' in command:
        talk(pyjokes.get_joke())
        print(pyjokes.get_joke())

    elif 'search' in command:
        command = command.replace("search", "")
        talk("here we go to chrome browser")
        she5 = 'C:/Program Files/Google/Chrome/Application/chrome %s'
        wb.get(she5).open(
            format(f'https://www.google.com/search?q={command}'))

    elif 'send a mail' in command:
        try:
            talk("whome should i send")
            print("whome should i send")
            receiver = input()
            talk("what is the subject of ur mail?")
            subject = take_command()
            talk("what is message")
            message = take_command()
            sendEmail(receiver, subject, message)
            talk("Email has been sent !")
        except Exception as e:
            print(e)
            talk("I am not able to send this email")

    elif 'exit' in command:
        talk("Thanks for giving me your time")
        exit()
Esempio n. 16
0
except urllib2.URLError as exception:
   print('Error: Name or service not known. Please check your internet conectivity.')
result = data.read()

jsonDecoded = json.loads(result)

if not jsonDecoded['ok']:
   print("Error when communicating with Slack.\nReason: %s" % jsonDecoded['error'])
   sys.exit(1)

print(str(jsonDecoded['ok']) + ": " + jsonDecoded['self']['name'])

ws = create_connection(jsonDecoded['url'])

def send(channel, text, type = 'message', id = '1'):
   ws.send(json.dumps({'type' : type, 'channel': channel, 'text': text, 'id': id}))

while True:
   result = json.loads(ws.recv())
   try:
      if result['type'] == 'message':
         if result['text'].lower() == 'joke':
            send(result['channel'], pyjokes.get_joke())

         if result['text'].lower().split()[0] in commandList.commandModules:
            function = commandList.commandModules[result['text'].lower().split()[0]]
            send(result['channel'], function.execute(result['text']))
      time.sleep(1)
   except KeyError:
      pass
Esempio n. 17
0
async def joke(ctx):
    await ctx.send(pyjokes.get_joke())
Esempio n. 18
0
            command = r.recognize_google(audio)

            if "wake" in command:
                engine.say("Up and ready for you sir!")
                engine.runAndWait()

            if "time" in command:
                engine.say("The time is:")
                engine.runAndWait()
                engine.say(now.strftime("%H:%M:%S"))
                engine.runAndWait()

            if "joke" in command:
                engine.say("Here it is!")
                engine.runAndWait()
                engine.say(pyjokes.get_joke())
                engine.runAndWait()
                engine.say("ha ha ha")
                engine.runAndWait()

            if 'play' in command:
                song = command.replace('play', '')
                engine.say('playing ' + song)
                engine.runAndWait()
                pywhatkit.playonyt(song)

            if 'who is' in command:
                person = command.replace('who is', '')
                info = wikipedia.summary(person, 1)
                print(info)
                engine.say(info)
Esempio n. 19
0
def main():
    joke = pyjokes.get_joke()
    twitter.update_status(status=joke)
Esempio n. 20
0
def jokes():
    speech(pyjokes.get_joke())
Esempio n. 21
0
def program(ch):
    if (("run"in ch) or ("launch" in ch) or ("execute" in ch or "use" in ch ) or ("start" in ch) or ("open" in ch) ) and (("notepad" in ch) or ("editor" in ch) or ("text" in ch)): 
        print ("\nDo you want to open any specific file : ", end = ' ')
        temp = input()
        temp.lower()
        if temp == "no" or temp == "nope" or temp == "na": 
            os.system("start notepad")
        elif temp == "yes" :
            print("then Give me the name of that file :",end = ' ')
            temp = input()
            os.system("start notepad " + temp)
        else:
            os.system("start notepad " + temp)
    
    
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("chrome" in ch or "google"in ch or "browser"in ch) and ("private" in ch or "incognito" in ch)) : 
        # os.system("start chrome /incognito")
        print ("\nDo you want to open any specific webpage : ", end = ' ')
        temp = input()
        temp.lower()
        if temp == "no" or temp == "nope" or temp == "na": 
            os.system("start chrome /incognito")
        elif temp == "yes" :
            print("then Give me the link to that webpage :",end = ' ')
            temp = input()
            os.system("start chrome /incognito " + temp)
        else:
            os.system("start chrome /incognito " + temp)
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("chrome" in ch or "google"in ch or "browser"in ch)): 
        print ("\nDo you want to open any specific webpage : ", end = ' ')
        temp = input()
        temp.lower()
        if temp == "no" or temp == "nope" or temp == "na": 
            os.system("start chrome")
        elif temp == "yes" :
            print("then Give me the link to that webpage :",end = ' ')
            temp = input()
            os.system("start chrome " + temp)
        else:
            os.system("start chrome " + temp)


    elif (("run" in ch or "launch" in ch or "execute" in ch  or "use" in ch or "start" in ch or "open" in ch ) and ("wmp" in ch or "wmplayer" in ch or "media" in ch or "player" in ch)): 
        os.system("start wmplayer")
        
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("my computer" in ch or "this pc" in ch or "explorer" in ch)): 
        os.system("start explorer")
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("calc" in ch or "calculator" in ch )): 
        os.system("start calc")
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("paint" in ch or "mspaint" in ch )): 
        os.system("start mspaint")
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("cmd" in ch or "prompt" in ch or "command" in ch or "terminal" in ch)): 
        print ("\nDo you want ADMIN privelages (Yes/No) : ", end = ' ')
        temp = input()
        temp.lower()
        if "n" in temp: 
            os.system("start cmd")
        elif "y" in temp :
            os.system(r"powershell -command start-process cmd -verb runas ")
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("powershell" in ch )): 
        print ("\nDo you want ADMIN privelages (Yes/No) : ", end = ' ')
        temp = input()
        temp.lower()
        if "n" in temp: 
            os.system("start powershell")
        elif "y" in temp :
            os.system(r"powershell -command start-process powershell -verb runas ")
                    
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("taskmanager" in ch or "tast manager" in ch or "ram" in ch or "cpu" in ch)): 
        os.system("start taskmgr")
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("math" in ch or "panel" in ch )): 
        os.system("start mip")
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("quickassist" in ch or "quick" in ch or "assist" in ch or "remote" in ch)): 
        os.system("start quickassist")
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("snip" in ch or "screenshot" in ch )): 
        os.system("start snippingtool")
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("recorder" in ch or "step" in ch )): 
        os.system("start psr")
    elif("clear" in ch or "cls" in ch or "clean" in ch ):
        os.system("cls")
        print("                                U^.^U - EL                            \n")
    elif (("run" in ch or "launch" in ch or "execute" in ch or "use" in ch  or "start" in ch or "open" in ch ) and ("wordpad" in ch or "word" in ch )): 
        os.system("start wordpad")

    elif ("search" in ch or "about" in ch):
        print ("""\n
                  I'm still not smart enough to search more than 1 word,
                  so if you want to search more than 1 word then pls seperate 
                  them using an underscore: '_' instead of a space: ' ' """)
        print ("\nWhat do u want to Search about : ", end=' ')
        s = input()
        os.system("start chrome google.com/search?q=" + s)
        
    elif ("source" in ch or "teach" in ch or "update" in ch):
        os.system("start notepad EL.py")
        
    elif ("restart" in ch or "reexecute" in ch or "reload" in ch ) :
        os.system("start python EL.py")
        exit()
    elif "time" in ch:
        os.system("cd /")
        print(os.popen("time /t").read())
        pyttsx3.speak(os.popen("time /t").read())
    elif "date" in ch:
        os.system("cd /")
        print(os.popen("date /t").read())
        pyttsx3.speak("today's date is " + os.popen("date /t").read())
    elif ("joke" in ch or "funny"in ch ):
        joke = pyjokes.get_joke(language = 'en', category = 'all')
        print(joke)
        pyttsx3.speak(joke)
    elif ("exit" in ch or "close" in ch or "bye" in ch):
        print ("Gud-Byeeeeeee, hope we meeet again ")
        pyttsx3.speak("It was really nice meeting you, but i guess this is good bye, hope we meet again")
        
        exit()
    elif (not (ch and ch.strip())):
        print(end = "")
    else:
        print("pls "+ name[0] + " can u repeat!. i didn't quite get it.\n if you just wrote a name of a program then please \nalso tell what do u want me to do with it.")
        pyttsx3.speak("please "+ name[0] + " can u repeat that!. i didn't quite get it.if you just wrote a name of a program then please also tell what do u want me to do with it.")
        check()
Esempio n. 22
0
def cmds():
    while True:

        query = main.takeCommand().lower()

        if "lumos" in query:
            query.replace("lumos", "")

            if 'wikipedia' in query:
                main.speak('Searching Wikipedia...')
                query = query.replace("wikipedia", "")
                results = wikipedia.summary(query, sentences=3)
                main.speak("According to Wikipedia")
                print(results)
                main.speak(results)

            elif 'open youtube' in query:
                main.speak("Here you go to Youtube\n")
                webbrowser.get('chrome').open("youtube.com")

            elif 'open google' in query:
                main.speak("Here you go to Google\n")
                codePath = r"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
                os.startfile(codePath)

            elif 'open discord' in query:
                main.speak("Here you go to discord\n")
                codePath = r"C:\\Users\\Username\\AppData\\Local\\Discord\\Update.exe"
                os.startfile(codePath)

            elif 'open spotify' in query:
                main.speak("Here you go to spotify\n")
                codePath = r"C:\\Users\\Username\\AppData\\Roaming\\Spotify\\spotify.exe"
                os.startfile(codePath)

            elif 'open stackoverflow' in query:
                main.speak("Here you go to Stack Over flow.Happy coding")
                webbrowser.get('chrome').open("stackoverflow.com")

            elif 'how are you' in query:
                main.speak("I am fine, Thank you")
                main.speak("How are you")

            elif 'fine' in query or "good" in query:
                main.speak("It's good to know that your fine")

            elif "change my name to" in query:
                query = query.replace("change my name to", "")
                assname = query
                main.speak('okay')

            elif "change name" in query:
                main.speak("What would you like to call me")
                assname = takeCommand()
                main.speak("Thanks for naming me")

            elif "what's your name" in query or "What is your name" in query:
                main.speak("My friends call me")
                speak(assname)
                print("My friends call me", assname)

            elif 'exit' in query:
                main.speak("Thanks for giving me your time")
                exit()

            elif "who made you" in query or "who created you" in query:
                main.speak("I have been created by Astroclad.")

            elif 'joke' in query:
                main.speak(pyjokes.get_joke())

            elif 'search' in query or 'play' in query:

                query = query.replace("search", "")
                query = query.replace("play", "")
                webbrowser.open(query)

            elif "who am i" in query:
                main.speak("If you talk then definately your human.")

            elif "why you came to world" in query:
                main.speak("Thanks to Astroclad. further It's a secret")

            elif 'is love' in query:
                main.speak("It is 7th sense that destroy all other senses")

            elif "who are you" in query:
                main.speak("I am your virtual assistant created by Astroclad")

            elif 'reason for you' in query:
                main.speak("I was created as a Minor project by Astroclad")

            elif 'shutdown system' in query:
                main.speak(
                    "Hold On a Sec ! Your system is on its way to shut down")
                subprocess.call('shutdown / p /f')

            elif 'empty recycle bin' in query:
                winshell.recycle_bin().empty(confirm=False,
                                             show_progress=False,
                                             sound=True)
                main.speak("Recycle Bin Emptied")

            elif "don't listen" in query or "stop listening" in query:
                main.speak(
                    "for how much time you want to stop lumos from listening commands"
                )
                a = int(takeCommand())
                time.sleep(a)
                print(a)

            elif "where is" in query:
                query = query.replace("where is", "")
                location = query
                main.speak("User asked to Locate")
                main.speak(location)
                webbrowser.open("https://www.google.nl / maps / place/" +
                                location + "")

            elif "restart" in query:
                subprocess.call(["shutdown", "/r"])

            elif "hibernate" in query or "sleep" in query:
                main.speak("Hibernating")
                subprocess.call("shutdown / h")

            elif "log off" in query or "sign out" in query:
                main.speak(
                    "Make sure all the application are closed before sign-out")
                time.sleep(5)
                subprocess.call(["shutdown", "/l"])

            elif "write a note" in query:
                main.speak("What should i write")
                note = takeCommand()
                file = open('lumosNotes.txt', 'w')
                main.speak("Should i include date and time")
                snfm = takeCommand()
                if 'yes' in snfm or 'sure' in snfm:
                    strTime = datetime.datetime.now().strftime("% H:% M:% S")
                    file.write(strTime)
                    file.write(" :- ")
                    file.write(note)
                else:
                    file.write(note)

            elif "show note" in query:
                main.speak("Showing Notes")
                file = open("lumosNotes.txt", "r")
                print(file.read())
                main.speak(file.read(6))

            elif "wikipedia" in query:
                webbrowser.get('chrome').open("wikipedia.com")

            elif "Good Morning" in query:
                main.speak("A warm" + query)
                main.speak("How are you ")
                main.speak(assname)

            # most asked question from google Assistant
            elif "how are you" in query:
                main.speak("I'm fine, glad you asked me that")

            elif "what is" or "who is" in query:
                main.speak('thinking')
                if "lumos" in query:
                    query = query.replace("lumos", "")
                    print(query)

                client = wolframalpha.Client("UK8JT2-ATP7JRHVYR")
                res = client.query(str(query))

                try:
                    print(next(res.results).text)
                    main.speak(next(res.results).text)
                except Exception:
                    print("No results")
                    main.speak("Im sorry, i dont know that one")
def run_romeo(time=None):
    clear = lambda: os.system('cls')
    # This Function will clean any
    # command before execution of this python file
    clear()
    command = take_command()
    print(command)
    name = "romeo 1.0"
    if 'play ' in command or 'playing ' in command:
        try:
            song = command.replace('play', '')
            talk('playing ' + song)
            pywhatkit.playonyt(song)
        except Exception as e:
            print(e)
            talk(f"unable to find this {song}  in youtube")


    elif 'time' in command or 'what time is it ' in command:
        time = datetime.datetime.now().strftime('%I:%M:%p')  # I is the formate of the time and p is the am or pm
        print(time)
        talk('current time is ' + time)
    elif 'tell me about ' in command:
        try:
            person = command.replace('tell me about', '')
            info = wikipedia.summary(person, 2)
            # print(info)
            talk(f'according to wikipedia {info}')
        except Exception as e:
            print(e)
            talk(f"unable to find this  wikipedia{info} ")


    elif 'joke' in command:
        talk(' here you go')
        talk(pyjokes.get_joke())
    elif 'what is the date ' in command or 'date' in command:
        date = datetime.date.today()
        talk(date)

    elif '.com' in command or '.org' in command or '.net' in command or ' search' in command:
        try:
            web = command.replace('.com', '').replace('.org', '').replace('.net', '').replace('search', '').replace(
                'romeo', '')
            talk(web)
            print(web)
            # talk(command)
            webbrowser.open_new_tab(web)

            # webbrowser.open("youtube.com")
        except Exception as e:
            print(e)
            talk(f"unable to search {web} ")
    elif 'my audio music' in command or "start my audio music" in command:
        talk("why not sir ,Here you go with music")
        # music_dir = "G:\\Song"
        music_dir = "C:\\Users\\Public\\Music"
        songs = os.listdir(music_dir)
        print(songs)
        random = os.startfile(os.path.join(music_dir, songs[1]))

    elif 'how are you' in command:
        talk("I am fine, Thank you")
        talk("How are you, Sir")

    elif 'fine' in command or "good" in command:
        talk("It's good to know that your fine")

    elif "change my name to" in command:
        query = command.replace("change my name to", "")
        name = command

    elif "change name" in command:
        talk("What would you like to call me, Sir ")
        name = take_command()
        talk("Thanks for naming me")


    elif "who made you" in command or "who created you" in command:
        talk("it is greate to know you that I have been created by my boss.")
    elif "why you came to world" in command:
        talk("Thanks to my boss. further It's a secret ")

    elif 'open microsoft office' in command:
        talk("opening Power Point presentation")
        power = r"C:\\Program Files (x86)\\Microsoft Office\\Office15"
        os.startfile(power)
    elif 'what is love' in command or 'tell me about  love' in command:
        talk("It is 7th sense that destroy all other senses..it's a crazy things is not it my friend")

    elif "who are you" in command:
        talk(f"I am your virtual assistant {name}")


    elif "can you hear me" in command or "are you there" in command:
        talk('yes sir ,please tell me how can i help you ,do you need anything sir')

    elif 'open bluestack' in command:
        appli = r"C:\\ProgramData\\BlueStacks\\Client\\Bluestacks.exe"
        os.startfile(appli)
    elif 'empty recycle bin' in command:
        winshell.recycle_bin().empty(confirm=False, show_progress=False, sound=True)
        talk("Recycle Bin Recycled")

    elif "don't listen" in command or "stop listening" in command:
        try:
            talk("for how much time you want to stop jarvis from listening commands")
            a = int(take_command())
            time.sleep(a)
            print(a)
        except Exception:
            talk("i don't listen you ")
    elif "where is" in command or "romeo where is" in command or " romeo search where is" in command:
       try: 
            query = command.replace("where is", "").replace("romeo where is", " ").replace("romeo search where is", " ")
            location = query
            talk("User asked to Locate")
            talk(location)
            webbrowser.open("https://www.google.com/maps/place/" + location + "")
       except Exception:
           talk('not found this place')

    elif "weather" in command:

        # Google Open weather website
        # to get API of Open weather
        api_key = "api key"
        # base_url = "http://api.openweathermap.org / data / 2.5 / weather?"
        talk(" City name ")
        print("City name : ")
        city_name = take_command()
        # complete_url = base_url + "appid =" + api_key + "&q =" + city_name
        complete_url = f"https://api.openweathermap.org/data/2.5/weather?q={city_name}&appid={api_key}"
        response = requests.get(complete_url)
        x = response.json()

        if x["cod"] != "404":
            y = x["main"]
            current_temperature = y["temp"]
            current_pressure = y["pressure"]
            current_humidiy = y["humidity"]
            z = x["weather"]
            weather_description = z[0]["description"]
            print(" Temperature (in kelvin unit) = " + str(
                current_temperature) + "\n atmospheric pressure (in hPa unit) =" + str(
                current_pressure) + "\n humidity (in percentage) = " + str(
                current_humidiy) + "\n description = " + str(weather_description))
        else:
            talk(" City Not Found ")

    elif 'open code' in command:
        codePath = "/Applications/PyCharm CE.app"  # that's the code path.
        os.startfile(codePath)


    elif "calculate" in command or 'i want to know ' in command:

        try:
            # command = command.replace('calculate', '').replace('how to', '').replace('i want to know', '')
            query = command.replace('calculate', '').replace('i want to know', '')
            app_id = "Wolframalpha api id"
            # client = wolframalpha.Client(app_id)
            client = wolframalpha.Client('app_id')
            question = query
            res = client.query(question)
            answer = next(res.results).text
            print("The answer is " + answer)
            talk("The answer is " + answer)
        except Exception as e:
            print(e)
            talk('sorry sir i am not able to do this,please try again')

    elif "camera" in command or "take a photo" in command:
        try:
            ec.capture(0, "robo camera", "img.jpg")
        except Exception:
            talk('photos are not taken')

  

    elif 'email to gm' in command:
        try:

            talk('What is the subject?')

            subject = take_command()
            talk('What should I say in message?')

            message = take_command()
            content = 'Subject: {}\n\n{}'.format(subject, message)
            to = "*****@*****.**"
            sendEmail(to, content)
            talk("Email has been sent!")
        except Exception as e:
            print(e)
            talk("Sorry my friend. I am not able to send this email")



    elif 'send a mail' in command:
        try:
            talk("What should I say?")
            content = take_command()
            talk("whome should i send")
            to = input()
            sendEmail(to, content)
            talk("Email has been sent !")
        except Exception as e:
            print(e)
            talk("I am not able to send this email")
    elif "write a note" in command:
        try:
            talk("What should i write, sir")
            note = take_command()
            file = open('jarvis.txt', 'w')
            talk("Sir, Should i include date and time")
            snfm = take_command()
            if 'yes' in snfm or 'sure' in snfm:
                strTime = datetime.datetime.now().strftime("% H:% M:% S")
                file.write(strTime)
                file.write(" :- ")
                file.write(note)
            else:
                file.write(note)
        except Exception:
            talk('i am not able to write this note sir')

    # elif "what is" in command or "who is" in command:
    #
    #     # Use the same API key
    #     # that we have generated earlier
    #     client = wolframalpha.Client("API_ID")
    #     res = client.query(command)
    #
    #     try:
    #         print(next(res.results).text)
    #         talk(next(res.results).text)
    #     except StopIteration:
    #         print("No results")
    elif 'why are you answer so slow' in command or 'tell me why are you so slow' in command:
        talk('sir this is not my fault .your internet connection is so slow now')
    elif 'exit' in command:
        try:
            talk("Thanks for giving me your time")
            exit()
        except Exception as e:
            print(e)
            talk('i am not able to exit sir ..something doing wrong')

    elif 'what is the temperature in' in command:
        try:
            search=command.replace('what is the temperature in','')
            url = f'https://www.google.com/search?q={search}'
            r = requests.get(url)
            data = BeautifulSoup(r.text, 'html.parser')
            temp = data.find("div", class_='BNeawe').text
            talk(f'current {search} is {temp}')

        except Exception as e:
            print(e)
            talk('i am not able to find this place temperature ')
Esempio n. 24
0
def joke():
    """Well everybody loves jokes isn't it?"""
    print(get_joke())
Esempio n. 25
0
    def run_Bella(self):

        wishMe()
        while True:
        # if 1:
      
            self.query = self.takeCommand().lower()

            # Logic for executing tasks based on self.query
            if 'wikipedia' in self.query:
                speak('Searching Wikipedia...')
                self.query = self.query.replace("wikipedia", "")
                results = wikipedia.summary(self.query, sentences=2)
                speak("According to Wikipedia")
                print(results)
                speak(results)

            elif 'open youtube' in self.query:
                webbrowser.open("youtube.com")

            elif 'open google' in self.query:
                webbrowser.open("google.com")

            elif 'open stack overflow' in self.query:
                webbrowser.open("stackoverflow.com")   

            elif 'play' in self.query:
                song = self.query.replace('play', '')
                speak('playing ' + song)
                pywhatkit.playonyt(song)
            
            elif 'jokes' in self.query:
                speak(pyjokes.get_joke())    

            elif 'the time' in self.query:
                strTime = datetime.datetime.now().strftime("%H:%M:%S")    
                speak(f"Sir, the time is {strTime}")

            #elif 'open code' in self.query:
                #codePath = " C:\Users\dell\AppData\Local\Programs\Microsoft VS Code\code.exe"
                #os.startfile(codePath)

            elif 'open facebook' in self.query:
                webbrowser.open("https://www.facebook.com")
                speak("opening facebook") 

            elif 'open instagram' in self.query:
                webbrowser.open("https://www.instagram.com")
                speak("opening instagram")   

            elif 'open yahoo' in self.query:
                webbrowser.open("https://www.yahoo.com")
                speak("opening yahoo")
                
            elif 'open gmail' in self.query:
                webbrowser.open("https://mail.google.com")
                speak("opening google mail") 
                
            elif 'open snapdeal' in self.query:
                webbrowser.open("https://www.snapdeal.com") 
                speak("opening snapdeal")  
                
            elif 'open amazon' in self.query or 'shop online' in self.query:
                webbrowser.open("https://www.amazon.com")
                speak("opening amazon")

            elif 'open flipkart' in self.query:
                webbrowser.open("https://www.flipkart.com")
                speak("opening flipkart")  

            elif 'open ebay' in self.query:
                webbrowser.open("https://www.ebay.com")
                speak("opening ebay")     

            elif 'mail to sister' in self.query:
                try:
                    speak("What should I say?")
                    content = self.takeCommand()
                    to = "*****@*****.**"    
                    sendEmail(to, content)
                    speak("Email has been sent!")
                except Exception as e:
                    print(e)
                    speak("Sorry sir. I am not able to send this email")  

            elif 'send a mail' in self.query:
                try:
                    speak("What should I say?")
                    content = self.takeCommand()
                    speak("whome should i send")
                    to = input()    
                    sendEmail(to, content)
                    speak("Email has been sent !")
                except Exception as e:
                    print(e)
                    speak("I am not able to send this email")

            elif "change name" in self.query:
                speak("What would you like to call me, Sir ")
                assname = self.takeCommand()
                speak("Thanks for naming me")
    
            elif "what's your name" in self.query or "What is your name" in self.query:
                speak("My friends call me")
                speak(assname)
                print("My friends call me", assname)                


            elif 'good bye' in self.query:
                speak("good bye")
                exit()

            elif "shutdown" in self.query:
                speak("shutting down")
                os.system('shutdown -s') 

            elif "what\'s up" in self.query or 'how are you' in self.query:
                stMsgs = ['Just doing my thing!', 'I am fine!', 'Nice!', 'I am nice and full of energy','i am okey ! How are you']
                ans_q = random.choice(stMsgs)
                speak(ans_q)  
                ans_take_from_user_how_are_you = self.takeCommand()
                if 'fine' in ans_take_from_user_how_are_you or 'happy' in ans_take_from_user_how_are_you or 'okey' in ans_take_from_user_how_are_you:
                    speak('okey..')  
                elif 'not' in ans_take_from_user_how_are_you or 'sad' in ans_take_from_user_how_are_you or 'upset' in ans_take_from_user_how_are_you:
                    speak('oh sorry..') 

            elif 'make you' in self.query or 'created you' in self.query or 'develop you' in self.query:
                ans_m = " For your information shivam gupta Created me ! I give Lot of Thannks to Him "
                print(ans_m)
                speak(ans_m)

            elif "who are you" in self.query or "about you" in self.query or "your details" in self.query:
                about = "I am Bella an A I based computer program but i can help you lot like a your close friend ! i promise you ! Simple try me to give simple command ! like playing music or video from your directory i also play video and song from web or online ! i can also entain you i so think you Understand me ! ok Lets Start "
                print(about)
                speak(about)

            elif "hello" in self.query or "hello Bella" in self.query:
                hel = "Hello Sir ! How May i Help you.."
                print(hel)
                speak(hel)

            elif "your name" in self.query or "sweat name" in self.query:
                na_me = "Thanks for Asking my name my self ! Bella"  
                print(na_me)
                speak(na_me)

            elif "how you feel" in self.query:
                print("feeling Very sweet after meeting with you")
                speak("feeling Very sweet after meeting with you") 
            

            elif 'exit' in self.query or 'abort' in self.query or 'stop' in self.query or 'bye' in self.query or 'quit' in self.query :
                ex_exit = 'I feeling very sweet after meeting with you thankyou! for your time'
                speak(ex_exit)
                exit()   

            elif "calculate" in self.query: 
                
                app_id = "yourAppId"
                client = wolframalpha.Client(app_id)
                indx = self.query.lower().split().index('calculate') 
                self.query = self.query.split()[indx + 1:] 
                res = client.query(' '.join(self.query)) 
                answer = next(res.results).text
                print("The answer is " + answer) 
                speak("The answer is " + answer)    
            
            

            elif 'news' in self.query:
                
                try: 
                    jsonObj = urlopen('''https://newsapi.org/v2/top-headlines?country=in&apiKey=9655f3abc604484586897775536c8622''')
                    data = json.load(jsonObj)
                    i = 1
                    
                    speak('here are some top news from the times of india')
                    print('''=============== TIMES OF INDIA ============'''+ '\n')
                    
                    for item in data['articles']:
                        
                        print(str(i) + '. ' + item['title'] + '\n')
                        print(item['description'] + '\n')
                        speak(str(i) + '. ' + item['title'] + '\n')
                        i += 1
                except Exception as e:
                    
                    print(str(e))

            elif 'lock window' in self.query:
                    speak("locBella the device")
                    subprocess.call("shutdown / h")
    
            elif 'shutdown system' in self.query:
                    speak("Hold On a Sec ! Your system is on its way to shut down")
                    os.system('shutdown -s')
                    
            elif 'empty recycle bin' in self.query:
                winshell.recycle_bin().empty(confirm = False, show_progress = False, sound = True)
                speak("Recycle Bin Recycled")
    
            elif "don't listen" in self.query or "stop listening" in self.query:
                speak("for how much time you want to stop jarvis from listening commands")
                a = int(self.takeCommand())
                time.sleep(a)
                print(a)
    
            elif "where is" in self.query:
                self.query = self.query.replace("where is", "")
                location = self.query
                speak("User asked to Locate")
                speak(location)
                webbrowser.open("https://www.google.nl / maps / place/" + location + "")

            elif "restart" in self.query:
                subprocess.call(["shutdown", "/r"])
                
            elif "hibernate" in self.query or "sleep" in self.query:
                speak("Hibernating")
                subprocess.call("shutdown / h")
    
            elif "log off" in self.query or "sign out" in self.query:
                speak("Make sure all the application are closed before sign-out")
                time.sleep(5)
                subprocess.call(["shutdown", "/l"])
    
            elif "write a note" in self.query:
                speak("What should i write, sir")
                note = self.takeCommand()
                file = open('jarvis.txt', 'w')
                speak("Sir, Should i include date and time")
                snfm = self.takeCommand()
                if 'yes' in snfm or 'sure' in snfm:
                    strTime = datetime.datetime.now().strftime("% H:% M:% S")
                    file.write(strTime)
                    file.write(" :- ")
                    file.write(note)
                else:
                    file.write(note) 

            elif "show note" in self.query:
                speak("Showing Notes")
                file = open("jarvis.txt", "r") 
                print(file.read())
                speak(file.read(6))
    
                       

            elif "send message" in self.query:
                # You need to create an account on Twilio to use this service
                account_sid = 'your sid'
                auth_token = 'your token'
                client = Client(account_sid, auth_token)

                message = client.messages \
                .create(
                    body="Join Earth's mightiest heroes. Like Kevin Bacon.",
                    from_='+18707298456',
                    to='xxxxxxxxx'
                )

                print(message.sid)
                speak("message sent successfully")

            elif "what is" in self.query or "who is" in self.query:
                
                # Use the same API key 
                # that we have generated earlier
                client = wolframalpha.Client("your app id")
                res = client.query(self.query)
                
                try:
                    print (next(res.results).text)
                    speak (next(res.results).text)
                except StopIteration:
                    print ("No results") 

            elif 'open command' in self.query:
                codePath = "C:/WINDOWS/system32/cmd.exe"
                os.startfile(codePath) 

            elif 'close command' in self.query:
                os.system("taskkill /IM cmd.exe")    

            elif 'open notepad' in self.query:
                codePath = "C:\WINDOWS\system32/notepad.exe"
                os.startfile(codePath) 

            elif 'close notepad' in self.query:
                os.system("taskkill /IM notepad.exe")   

            elif 'open chrome' in self.query:
                codePath = "C:\Program Files (x86)\Google\Chrome\Application/chrome.exe"
                os.startfile(codePath)

            elif 'close chrome' in self.query:
                os.system("taskkill /IM chrome.exe")    


            elif 'take screenshot' in self.query or 'take a screenshot' in self.query:
                speak("sir,please tell me the name of this screenshot")
                name = self.takeCommand().lower()
                speak("sir,please hold the screen ,i am taBella a screenshot")
                time.sleep(3)
                img = pyautogui.screenshot()
                img.save(f"{name}.png")
                speak("i am done sir, screenshot is saved ")
            
            elif 'thank you ' in self.query or 'thanks' in self.query:
                speak("welcome sir")   

            elif "weather" in self.query:
             
                Google Open weather website
                to get API of Open weather 
                api_key = "api_key"
                base_url = "http://api.openweapip thermap.org / data / 2.5 / weather?"
                speak(" City name ")
                print("City name : ")
                city_name = self.takeCommand()
                complete_url = 'api.openweathermap.org/data/2.5/weather?q={jaipur}&appid={6eee755a887428d041cdef4103794fac}'

                response = requests.get(complete_url) 
                x = response.json() 
                
                if x["cod"] != "404": 
                    y = x["main"] 
                    current_temperature = y["temp"] 
                    current_pressure = y["pressure"] 
                    current_humidiy = y["humidity"] 
                    z = x["weather"] 
                    weather_description = z[0]["description"] 
                    print(" Temperature (in kelvin unit) = " +str(current_temperature)+"\n atmospheric pressure (in hPa unit) ="+str(current_pressure) +"\n humidity (in percentage) = " +str(current_humidiy) +"\n description = " +str(weather_description)) 
                
                else: 
                    speak(" City Not Found ")

            elif 'location' in self.query:
                speak('What is the location?')
                location = self.takeCommand()
                url = 'https://google.nl/maps/place/' + location + '/&'
                webbrowser.get('chrome').open_new_tab(url)
                speak('Here is the location ' + location)        
Esempio n. 26
0
def getjoke():
    the_joke = str(pyjokes.get_joke(language="en",category="neutral"))
    return the_joke
Esempio n. 27
0
import pyjokes

joke = pyjokes.get_joke('en', 'neutral')
print(joke)
Esempio n. 28
0
def get_joke():
    return pyjokes.get_joke()
Esempio n. 29
0
 def handle_intent(self, message):
     self.speak(pyjokes.get_joke(language=self.lang[:-3], category='all'))
Esempio n. 30
0
              screen.height // 2),
    ]
    screen.play([Scene(effects, -1)], stop_on_resize=True)
    screen.refresh()


def show_clock():
    try:
        Screen.wrapper(demo)
        sys.exit(0)
    except ResizeScreenError:
        pass


message = (
    pyjokes.get_joke()
)  #this is message ie the running text obtained from pyjokes library function


#typerwriter is the method for running the text
def typewriter(message):
    #the spaces are for format on the splash screen
    font = ['alligator', 'slant', '3-d', '3x5', '5lineoblique', 'banner3-D']
    print(pyfiglet.figlet_format("   zTm ", font=random.choice(font)).rstrip())
    print(pyfiglet.figlet_format("Community Presents -- "))
    print(pyfiglet.figlet_format("                           ASCII ART"))
    # print(pyfiglet.figlet_format("==> "))

    for char in message:
        sys.stdout.write(char)
        sys.stdout.flush()
Esempio n. 31
0
async def joke(context):
    await client.say(pyjokes.get_joke())
Esempio n. 32
0
 def joke_handler(message):
     joke = pyjokes.get_joke(language='en', category='neutral')
     tb.send_message(message.chat.id, joke)
Esempio n. 33
0
def _joke():
    return pyjokes.get_joke(
        language=request.args.get("language", "en"), category=request.args.get("category", "neutral")
    )
Esempio n. 34
0
def jokes():                                                    #function for telling jokes
    speak(pyjokes.get_joke())
Esempio n. 35
0
 async def joke(self, ctx):
     embed = discord.Embed(title="Joke", description=pyjokes.get_joke())
     await ctx.send(embed=embed)
    af = AffinityPropagation().fit(matrix_newcomer)
    cluster_centers_indices = af.cluster_centers_indices_
    labels = af.labels_
    print(labels)
    n_clusters_ = len(cluster_centers_indices)

    print('Estimated number of clusters: %d' % n_clusters_)
    # print("Homogeneity: %0.3f" % metrics.homogeneity_score(labels_true, labels))
    # print("Completeness: %0.3f" % metrics.completeness_score(labels_true, labels))
    # print("V-measure: %0.3f" % metrics.v_measure_score(labels_true, labels))
    # print("Adjusted Rand Index: %0.3f"% metrics.adjusted_rand_score(labels_true, labels))
    # print("Adjusted Mutual Information: %0.3f"% metrics.adjusted_mutual_info_score(labels_true, labels))
    # print("Silhouette Coefficient: %0.3f" % metrics.silhouette_score(X, labels, metric='sqeuclidean'))


    print(pyjokes.get_joke())


    from itertools import cycle

    plt.close('all')
    plt.figure(1)
    plt.clf()

    colors = cycle('bgrcmykbgrcmykbgrcmykbgrcmyk')
    for k, col in zip(range(n_clusters_), colors):
        class_members = labels == k
        cluster_center = X[cluster_centers_indices[k]]
        plt.plot(X[class_members, 0], X[class_members, 1], col + '.')
        plt.plot(cluster_center[0], cluster_center[1], 'o', markerfacecolor=col,
                 markeredgecolor='k', markersize=14)
Esempio n. 37
0
def process(self,quest):

    answer = database.get_answers_from_memory(quest)
    
    if answer == "get time details":
        return(f'Time is {get_time()}')

    elif answer == "check internet connection":
        if internet.check_internet_connection():
            return "internet is connected"
        else:
            return "internet is not connected"
    
    elif answer == 'tell date':
        return ("date is "+get_date())

    elif answer == '100':
        return('I am fine, Thank you How are you, Sir')

    elif answer == '101':
        return("It's good to know that you are fine")

    elif answer == '102':
        return(f"my friend call me {assistant_details.name}")

    elif answer == "103":
        return("i have been created by KP KETAN KISHAN")

    elif answer == "104":
        return (pyjokes.get_joke())

    elif answer == "105":
        return ("if you talk then definately you are human")

    elif answer == "106":
        return("Thanks to KP. Further it is secret")

    elif answer == "107":
        return ("i am you virtual assistant created on 9th september")

    elif answer == "108":
        return ("i was created as a minor project by kumar priyanshu,ketan shah,kishan guta ")

    elif answer == "109":
        return (system_task.power_point())

    elif answer == "close powerpoint":
        return (system_task.close_powerpoint())

    elif answer == "110":
        speak("say your context")
        usertext = take_input(self)
        system_task.note(usertext)
        return("taken note of that")     
 
    elif answer == "close notepad":
        k=system_task.close_notepad()
        return(k)   

    elif answer == "111":
        return ("i'm not sure about, may be you should give me some time")

    elif answer == "112":
        return ("it's hard to understand")

    elif answer == "on speak":
        return database.turn_on_speech()

    elif answer == "off speak":
        return database.turn_off_speech()

    elif answer == 'music':
        system_task.play_music()
        return "playing song"

    elif answer == 'video':
        system_task.videos()
        return ("playing video")

    elif answer == 'focus':
        return (system_task.play_focus())

    elif answer == 'photo':
        system_task.photo()
        return ("opening photo")

    elif answer == 'chrome':
        return (system_task.chrome())

    elif answer == 'close chrome':
        return (system_task.close_chrome())

    elif answer == 'sublime text':
        return (system_task.sublime_text())

    elif answer == 'close sublime text':
        return (system_task.close_sublime_text())

    elif answer == 'vs code':
        return (system_task.vs_code())

    elif answer == 'close vs code':
        return (system_task.close_vs_code())

    elif answer == 'shell':
        return (system_task.shell())

    elif answer == 'word':
        return (system_task.word())

    elif answer == 'close word':
        return (system_task.close_word())

    elif answer == 'excel':
        return (system_task.excel())

    elif answer == 'close excel':
        return (system_task.close_excel())

    elif answer == "open facebook":
        open_facebook()
        return "opening facebook"

    elif answer == "close facebook":
        close_facebook()
        return "closing facebook"

    elif answer == "open google":
        open_google()
        return "opening google"

    elif answer == "open spotify":
        open_spotify()
        return "opening spotify"

    elif answer == "open geeksforgeeks":
        open_gfg()
        return "opening geeks for geeks"

    elif answer=="open youtube":
        open_youtube()
        return("opening youtube")

    elif answer=="open wynk":
        open_wynk()
        return "opening wynk"

    elif answer=="open stackof":
        open_stackof()
        return "opening stack over flow"

    elif answer=="open git":
        open_git()
        return "opening github"

    elif answer=="comsites":
        responded=open_comsites(self)
        return (f"opening {responded}")

    elif answer=="sites":
        responded=open_sites(self)
        return (f"opening {responded}")

    elif answer=="search":
        responded=search(quest)
        return (f"showing results for {responded}")

    elif answer=="play":
        responded=play(quest)
        return (f"playing... {responded}")

    elif answer=="whatsapp":
        return(open_whatsapp(self))

    elif answer == 'change name':
        give_output("okay! what do you want to call me")
        temp = take_input(self)
        if temp == assistant_details.name:
            return "can't change. i think you're happy with my old name"
        else:
            database.update_name(temp)
            assistant_details.name=temp
            return "now you can call me "+ temp
    
    elif answer == "0":
        return "say again"

    elif answer == "turn off":
        return "signing off sir"
    else:
        try:
            res = client.query(quest)
            if res['@success']=='true':
                pod1=res['pod'][1]
                result = pod1['subpod']['plaintext']
                if (('definition' in pod1['@title'].lower()) or ('result' in  pod1['@title'].lower()) or (pod1.get('@primary','false') == 'true')):
                    if result == '(data not available)':
                        answer = internet.check_on_wikipedia(quest+" wikipedia")
                        if answer!="":
                            return answer
                        else:
                            addq=adding_query(self,quest)
                            return addq
                    else:
                        return result
                else:
                    answer = internet.check_on_wikipedia(quest+" wikipedia")
                    if answer!="":
                        return answer
                    else:
                        addq=adding_query(self,quest)
                        return addq
            else:
                answer = internet.check_on_wikipedia(quest+" wikipedia")
                if answer!="":
                    return answer
                else:
                    addq=adding_query(self,quest)
                    return addq
        except Exception as e:
            return (e)
Esempio n. 38
0
     print(result)
 elif('divide') in response :
     input = response
     (a,b,c,d) =[t(s) for t,s in zip((str,int,str,int),re.search('^(\w+) (\d+) (\w+) (\d+)$',input).groups())]
     result = float(b/d)
     print(result)
 elif('define') in response:
     query = response
     stopwords = ['define']
     querywords = query.split()
     resultwords  = [word for word in querywords if word.lower() not in stopwords]
     result = ''.join(resultwords)
     rand = (dictionary.synonym(result))
     print(rand)
 elif('tell me a joke')in response:
     rand=(pyjokes.get_joke())
     print(rand)
 elif response == ("do you have a brother"):
     print("yes")
 elif response == "thanks" or response == "thank you":
     print("mhm")
 elif response == ("what is your brothers name"):
     print("jarvis")
 elif response == ("who created you"):
     print("zpit367")
 elif response == ("what language were you coded in"):
     print("python")
 elif response == "what is your name":
     print(myname)
 elif response == "clear":
     clear()
Esempio n. 39
0
def run_hive():
    command = take_command()
    print(command)
    if 'play' in command:
        song = command.replace('play', '')
        talk('playing ' + song)
        pywhatkit.playonyt(song)
    elif 'time' in command:
        time = datetime.datetime.now().strftime('%I:%M %p')
        talk('Current time is ' + time)
    elif 'date' in command:
        now = datetime.datetime.now()
        talk("Current date and time : ")
        talk(now.strftime("%d         %m                %Y"))
        engine.setProperty("rate", 178)
    elif 'calculator' in command:
            print('Loading up the H.I.V.E Calculator...')
            talk('Loading up the HIVE Calculator...')
            print('H.I.V.E Calculator Successfully loaded!')
            talk('HIVE Calculator Successfully loaded!')
            operation = input('''
        Please type in the math operation you would like to complete:
        + for addition
        - for subtraction
        * for multiplication
        / for division
        ''')

            number_1 = int(input('Please enter the first number: '))
            number_2 = int(input('Please enter the second number: '))

            if operation == '+':
                print('{} + {} = '.format(number_1, number_2))
                print(number_1 + number_2)

            elif operation == '-':
                print('{} - {} = '.format(number_1, number_2))
                print(number_1 - number_2)

            elif operation == '*':
                print('{} * {} = '.format(number_1, number_2))
                print(number_1 * number_2)

            elif operation == '/':
                print('{} / {} = '.format(number_1, number_2))
                print(number_1 / number_2)


            else:
               run_hive()

    elif 'who is' in command:
        person = command.replace('who is', '')
        info = wikipedia.summary(person, 1, auto_suggest=False)

        print(info)
        talk(info)
    elif 'what is pi' in command:
        print(math.pi)
    elif 'joke' in command:
        talk(pyjokes.get_joke())
    elif 'open project 65' in command:
        talk('Access Denied')
    elif 'hi' in command:
        talk('Hello, i dont know you. Whats your name')
        name = input('Whats your name?: ')
        talk('Hi, ' + name + 'How are you?')
        har = input('How are you?')
        talk('You are,,,. ' + har + 'Thats Great,,, ' + name + 'Have,a great Day!')


    elif 'admin override' in command:
        talk('Insufficient Permissions, Request Denied!')
    elif 'status report' in command:
        talk('All Systems Operational Sir!')
    elif 'hive' in command:
        talk('Yes, sir?')
    elif 'shut down' in command:
        talk('Shutting all Hive Systems Down.')
        talk('Thank you for using hive! Goodbye!')
        print('Thank you for using H.I.V.E!')
        exit()

    elif 'exit' in command:
        talk('Shutting all Hive Systems Down.')
        talk('Thank you for using hive! Goodbye!')
        print('Thank you for using H.I.V.E!')
        exit()
    elif 'awesome thanks' in command:
        talk('Your, Welcome!')
    elif 'thanks' in command:
        talk('Ny Pleasure!')
    elif 'thank you' in command:
        talk('No Problem!')
    elif 'awesome' in command:
        talk('No Problem, is there anything i, can help you, with?')
    elif ' no' in command:
         talk('ok!')
    elif 'yes' in command:
        talk('Ok, what is it?')
    elif 'how are you' in command:
        talk('I am Great! ,, How are you!?')
    elif 'you still there' in command:
        talk('Yes Sir, i am ready for your command!')
    elif 'who are you' in command:
        talk('My name is Hive. It stands for Home Assistant Intergrated Virtual Environment. I am here to help you with whatever i can')
    elif 'hello' in command:
        talk('hello, how are you today?')
        har = input('How are you?: ')
        talk('You are,,,. ' + har + 'Thats Great,,, ' + 'Have,a great Day!')
    elif 'version' in command
        talk('I am currently running on Version 0.1.5 as of Monday March 22nd 7:05PM')
    else:
        print('Please say the command again.')
        input('Please Type Your Command: ')
        take_command()
Esempio n. 40
0
from sense_hat import SenseHat
from pyjokes import get_joke

sense = SenseHat()

joke = get_joke()

sense.show_message(joke)
Esempio n. 41
0
def main(params):
    return {"joke": pyjokes.get_joke()}
Esempio n. 42
0
     ans_q = random.choice(stMsgs)
     speak(ans_q)
     ans_how_are_you = takecommand()
     if 'fine' in ans_how_are_you or 'good' in ans_how_are_you or 'okay' in ans_how_are_you:
         speak("Okay sir..")
     elif 'not fine' in ans_how_are_you or 'not good' in ans_how_are_you or 'sick' in ans_how_are_you:
         speak("extremely sorry sir..")
 elif 'make you' in query or 'programmed you' in query:
     ans_op = "For your kind information Sir Shreejan Dolai has made me using python programming language on visual studio code editor on dell inspiron 3501 laptop"
     speak(ans_op)
     print(ans_op)
 elif 'open git hub' in query or 'open git' in query:
     webbrowser.open("www.github.com")
     speak("Opemimg git hub")
 elif 'tell a joke' in query or 'please tell a joke' in query:
     joke_1 = pyjokes.get_joke()
     speak(joke_1)
 elif 'I want to do addition' in query or 'add this' in query:
     ans_add = "Yes sir please write the numbers here"
     speak(ans_add)
     num_add = int(input("Enter your first number :"))
     num_add2 = int(input("Enter your second number :"))
     ans_of_add = int(num_add) + int(num_add2)
     speak("Your answer is :")
     print(ans_of_add)
 elif 'I want to do subtraction' in query or 'subtract this' in query:
     ans_minus = "Yes sir please write the numbers here"
     speak(ans_minus)
     num_minus = int(input("Enter your first number :"))
     num_minus_2 = int(input("Enter your second number here :"))
     ans_of_minus = int(num_minus) - int(num_minus_2)
def mainframe():
    """Logic for execution task based on query"""
    SR.scrollable_text_clearing()
    greet()
    query_for_future = None
    try:
        while (True):
            query = SR.takeCommand().lower(
            )  #converted the command in lower case of ease of matching

            #wikipedia search
            if there_exists(['search wikipedia for', 'from wikipedia'], query):
                SR.speak("Searching wikipedia...")
                if 'search wikipedia for' in query:
                    query = query.replace('search wikipedia for', '')
                    results = wikipedia.summary(query, sentences=2)
                    SR.speak("According to wikipedia:\n")
                    SR.speak(results)
                elif 'from wikipedia' in query:
                    query = query.replace('from wikipedia', '')
                    results = wikipedia.summary(query, sentences=2)
                    SR.speak("According to wikipedia:\n")
                    SR.speak(results)
            elif there_exists(['wikipedia'], query):
                SR.speak("Searching wikipedia....")
                query = query.replace("wikipedia", "")
                results = wikipedia.summary(query, sentences=2)
                SR.speak("According to wikipedia:\n")
                SR.speak(results)

            #jokes
            elif there_exists([
                    'tell me joke', 'tell me a joke', 'tell me some jokes',
                    'i would like to hear some jokes',
                    "i'd like to hear some jokes",
                    'can you please tell me some jokes',
                    'i want to hear a joke', 'i want to hear some jokes',
                    'please tell me some jokes',
                    'would like to hear some jokes', 'tell me more jokes'
            ], query):
                SR.speak(pyjokes.get_joke(language="en", category="all"))
                query_for_future = query
            elif there_exists([
                    'one more', 'one more please', 'tell me more',
                    'i would like to hear more of them', 'once more',
                    'once again', 'more', 'again'
            ], query) and (query_for_future is not None):
                SR.speak(pyjokes.get_joke(language="en", category="all"))

            #asking for name
            elif there_exists([
                    "what is your name", "what's your name",
                    "tell me your name", 'who are you'
            ], query):
                SR.speak("My name is Heisenberg and I'm here to serve you.")
            #How are you
            elif there_exists(['how are you'], query):
                conn = sqlite3.connect('Heisenberg.db')
                mycursor = conn.cursor()
                mycursor.execute('select sentences from howareyou')
                result = mycursor.fetchall()
                temporary_data = random.choice(result)[0]
                SR.updating_ST_No_newline(temporary_data + '😃\n')
                SR.nonPrintSpeak(temporary_data)
                conn.close()
            #what is my name
            elif there_exists([
                    'what is my name', 'tell me my name',
                    "i don't remember my name"
            ], query):
                SR.speak("Your name is " + str(getpass.getuser()))

            #calendar
            elif there_exists(['show me calendar', 'display calendar'], query):
                SR.updating_ST(calendar.calendar(2021))

            #google, youtube and location
            #playing on youtube
            elif there_exists(['open youtube and play', 'on youtube'], query):
                if 'on youtube' in query:
                    SR.speak("Opening youtube")
                    pywhatkit.playonyt(query.replace('on youtube', ''))
                else:
                    SR.speak("Opening youtube")
                    pywhatkit.playonyt(
                        query.replace('open youtube and play ', ''))
                break
            elif there_exists([
                    'play some songs on youtube',
                    'i would like to listen some music',
                    'i would like to listen some songs',
                    'play songs on youtube'
            ], query):
                SR.speak("Opening youtube")
                pywhatkit.playonyt('play random songs')
                break
            elif there_exists(['open youtube', 'access youtube'], query):
                SR.speak("Opening youtube")
                webbrowser.get(chrome_path).open("https://www.youtube.com")
                break
            elif there_exists(['open google and search', 'google and search'],
                              query):
                url = 'https://google.com/search?q=' + query[query.find('for'
                                                                        ) + 4:]
                webbrowser.get(chrome_path).open(url)
                break
            #image search
            elif there_exists(
                ['show me images of', 'images of', 'display images'], query):
                url = "https://www.google.com/search?tbm=isch&q=" + query[
                    query.find('of') + 3:]
                webbrowser.get(chrome_path).open(url)
                break
            elif there_exists([
                    'search for', 'do a little searching for',
                    'show me results for', 'show me result for',
                    'start searching for'
            ], query):
                SR.speak("Searching.....")
                if 'search for' in query:
                    SR.speak(
                        f"Showing results for {query.replace('search for','')}"
                    )
                    pywhatkit.search(query.replace('search for', ''))
                elif 'do a little searching for' in query:
                    SR.speak(
                        f"Showing results for {query.replace('do a little searching for','')}"
                    )
                    pywhatkit.search(
                        query.replace('do a little searching for', ''))
                elif 'show me results for' in query:
                    SR.speak(
                        f"Showing results for {query.replace('show me results for','')}"
                    )
                    pywhatkit(query.replace('show me results for', ''))
                elif 'start searching for' in query:
                    SR.speak(
                        f"Showing results for {query.replace('start searching for','')}"
                    )
                    pywhatkit(query.replace('start searching for', ''))
                break

            elif there_exists(['open google'], query):
                SR.speak("Opening google")
                webbrowser.get(chrome_path).open("https://www.google.com")
                break
            elif there_exists([
                    'find location of', 'show location of',
                    'find location for', 'show location for'
            ], query):
                if 'of' in query:
                    url = 'https://google.nl/maps/place/' + query[
                        query.find('of') + 3:] + '/&amp'
                    webbrowser.get(chrome_path).open(url)
                    break
                elif 'for' in query:
                    url = 'https://google.nl/maps/place/' + query[
                        query.find('for') + 4:] + '/&amp'
                    webbrowser.get(chrome_path).open(url)
                    break
            elif there_exists([
                    "what is my exact location", "What is my location",
                    "my current location", "exact current location"
            ], query):
                url = "https://www.google.com/maps/search/Where+am+I+?/"
                webbrowser.get().open(url)
                SR.speak("Showing your current location on google maps...")
                break
            elif there_exists(["where am i"], query):
                Ip_info = requests.get(
                    'https://api.ipdata.co?api-key=test').json()
                loc = Ip_info['region']
                SR.speak(f"You must be somewhere in {loc}")

            #who is searcing mode
            elif there_exists([
                    'who is', 'who the heck is', 'who the hell is',
                    'who is this'
            ], query):
                query = query.replace("wikipedia", "")
                results = wikipedia.summary(query, sentences=1)
                SR.speak("According to wikipdedia:  ")
                SR.speak(results)

            #play music
            elif there_exists([
                    'play music', 'play some music for me',
                    'like to listen some music'
            ], query):
                SR.speak("Playing musics")
                music_dir = 'D:\\Musics\\vishal'
                songs = os.listdir(music_dir)
                # print(songs)
                indx = random.randint(0, 50)
                os.startfile(os.path.join(music_dir, songs[indx]))
                break

            # top 5 news
            elif there_exists([
                    'top 5 news', 'top five news', 'listen some news',
                    'news of today'
            ], query):
                news = Annex.News(scrollable_text)
                news.show()

            #whatsapp message
            elif there_exists([
                    'open whatsapp messeaging', 'send a whatsapp message',
                    'send whatsapp message', 'please send a whatsapp message'
            ], query):
                whatsapp = Annex.WhatsApp(scrollable_text)
                whatsapp.send()
                del whatsapp
            #what is meant by
            elif there_exists(['what is meant by', 'what is mean by'], query):
                results = wikipedia.summary(query, sentences=2)
                SR.speak("According to wikipedia:\n")
                SR.speak(results)

            #taking photo
            elif there_exists([
                    'take a photo', 'take a selfie', 'take my photo',
                    'take photo', 'take selfie', 'one photo please',
                    'click a photo'
            ], query):
                takephoto = Annex.camera()
                Location = takephoto.takePhoto()
                os.startfile(Location)
                del takephoto
                SR.speak("Captured picture is stored in Camera folder.")

            #bluetooth file sharing
            elif there_exists([
                    'send some files through bluetooth',
                    'send file through bluetooth', 'bluetooth sharing',
                    'bluetooth file sharing', 'open bluetooth'
            ], query):
                SR.speak("Opening bluetooth...")
                os.startfile(r"C:\Windows\System32\fsquirt.exe")
                break

            #play game
            elif there_exists([
                    'would like to play some games', 'play some games',
                    'would like to play some game', 'want to play some games',
                    'want to play game', 'want to play games', 'play games',
                    'open games', 'play game', 'open game'
            ], query):
                SR.speak("We have 2 games right now.\n")
                SR.updating_ST_No_newline('1.')
                SR.speak("Stone Paper Scissor")
                SR.updating_ST_No_newline('2.')
                SR.speak("Snake")
                SR.speak("\nTell us your choice:")
                while (True):
                    query = SR.takeCommand().lower()
                    if ('stone' in query) or ('paper' in query):
                        SR.speak("Opening stone paper scissor...")
                        sps = Annex.StonePaperScissor()
                        sps.start(scrollable_text)
                        break
                    elif ('snake' in query):
                        SR.speak("Opening snake game...")
                        import Snake
                        Snake.start()
                        break
                    else:
                        SR.speak(
                            "It did not match the option that we have. \nPlease say it again."
                        )

            #makig note
            elif there_exists([
                    'make a note', 'take note', 'take a note', 'note it down',
                    'make note', 'remember this as note',
                    'open notepad and write'
            ], query):
                SR.speak("What would you like to write down?")
                data = SR.takeCommand()
                n = Annex.note()
                n.Note(data)
                SR.speak("I have a made a note of that.")
                break

            #flipping coin
            elif there_exists(["toss a coin", "flip a coin", "toss"], query):
                moves = ["head", "tails"]
                cmove = random.choice(moves)
                playsound.playsound('quarter spin flac.mp3')
                SR.speak("It's " + cmove)

            #time and date
            elif there_exists(['the time'], query):
                strTime = datetime.datetime.now().strftime("%H:%M:%S")
                SR.speak(f"Sir, the time is {strTime}")
            elif there_exists(['the date'], query):
                strDay = datetime.date.today().strftime("%B %d, %Y")
                SR.speak(f"Today is {strDay}")
            elif there_exists([
                    'what day it is', 'what day is today',
                    'which day is today', "today's day name please"
            ], query):
                SR.speak(f"Today is {datetime.datetime.now().strftime('%A')}")

            #opening software applications
            elif there_exists(['open chrome'], query):
                SR.speak("Opening chrome")
                os.startfile(
                    r'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'
                )
                break
            elif there_exists([
                    'open notepad plus plus', 'open notepad++',
                    'open notepad ++'
            ], query):
                SR.speak('Opening notepad++')
                os.startfile(r'C:\Program Files\Notepad++\notepad++.exe')
                break
            elif there_exists(['open notepad', 'start notepad'], query):
                SR.speak('Opening notepad')
                os.startfile(r'C:\Windows\notepad.exe')
                break
            elif there_exists([
                    'open ms paint', 'open mspaint', 'open microsoft paint',
                    'start microsoft paint', 'start ms paint'
            ], query):
                SR.speak("Opening Microsoft paint....")
                os.startfile('C:\Windows\System32\mspaint.exe')
                break
            elif there_exists([
                    'show me performance of my system',
                    'open performance monitor', 'performance monitor',
                    'performance of my computer',
                    'performance of this computer'
            ], query):
                os.startfile("C:\Windows\System32\perfmon.exe")
                break
            elif there_exists(
                ['open snipping tool', 'snipping tool', 'start snipping tool'],
                    query):
                SR.speak("Opening snipping tool....")
                os.startfile("C:\Windows\System32\SnippingTool.exe")
                break
            elif there_exists(
                ['open code', 'open visual studio ', 'open vs code'], query):
                SR.speak("Opeining vs code")
                codepath = r"C:\Users\Vishal\AppData\Local\Programs\Microsoft VS Code\Code.exe"
                os.startfile(codepath)
                break
            elif there_exists([
                    'open file manager', 'file manager', 'open my computer',
                    'my computer', 'open file explorer', 'file explorer',
                    'open this pc', 'this pc'
            ], query):
                SR.speak("Opening File Explorer")
                os.startfile("C:\Windows\explorer.exe")
                break
            elif there_exists(['powershell'], query):
                SR.speak("Opening powershell")
                os.startfile(
                    r'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'
                )
                break
            elif there_exists([
                    'cmd',
                    'command prompt',
                    'command prom',
                    'commandpromt',
            ], query):
                SR.speak("Opening command prompt")
                os.startfile(r'C:\Windows\System32\cmd.exe')
                break
            elif there_exists(['open whatsapp'], query):
                SR.speak("Opening whatsApp")
                os.startfile(
                    r'C:\Users\Vishal\AppData\Local\WhatsApp\WhatsApp.exe')
                break
            elif there_exists([
                    'open settings', 'open control panel',
                    'open this computer setting Window',
                    'open computer setting Window', 'open computer settings',
                    'open setting', 'show me settings',
                    'open my computer settings'
            ], query):
                SR.speak("Opening settings...")
                os.startfile('C:\Windows\System32\control.exe')
                break
            elif there_exists([
                    'open your setting', 'open your settings',
                    'open settiing window', 'show me setting window',
                    'open voice assistant settings'
            ], query):
                SR.speak("Opening my Setting window..")
                sett_wind = Annex.SettingWindow()
                sett_wind.settingWindow(root)
                break
            elif there_exists(['open vlc', 'vlc media player', 'vlc player'],
                              query):
                SR.speak("Opening VLC media player")
                os.startfile(r"C:\Program Files\VideoLAN\VLC\vlc.exe")
                break

            #password generator
            elif there_exists([
                    'suggest me a password', 'password suggestion',
                    'i want a password'
            ], query):
                m3 = Annex.PasswordGenerator()
                m3.givePSWD(scrollable_text)
                del m3
            #screeshot
            elif there_exists([
                    'take screenshot', 'take a screenshot',
                    'screenshot please', 'capture my screen'
            ], query):
                SR.speak("Taking screenshot")
                SS = Annex.screenshot()
                SS.takeSS()
                SR.speak('Captured screenshot is saved in Screenshots folder.')
                del SS

            #voice recorder
            elif there_exists(
                ['record my voice', 'start voice recorder', 'voice recorder'],
                    query):
                VR = Annex.VoiceRecorer()
                VR.Record(scrollable_text)
                del VR

            #text to speech conversion
            elif there_exists(['text to speech', 'convert my notes to voice'],
                              query):
                SR.speak("Opening Text to Speech mode")
                TS = Annex.TextSpeech()
                del TS

            #weather report
            elif there_exists(['weather report', 'temperature'], query):
                Weather = Annex.Weather()
                Weather.show(scrollable_text)

            #shutting down system
            elif there_exists([
                    'exit', 'quit', 'shutdown', 'shut up', 'goodbye',
                    'shut down'
            ], query):
                SR.speak("shutting down")
                sys.exit()

            elif there_exists(['none'], query):
                pass
            elif there_exists([
                    'stop the flow', 'stop the execution', 'halt',
                    'halt the process', 'stop the process', 'stop listening',
                    'stop the listening'
            ], query):
                SR.speak("Listening halted.")
                break
            #it will give online results for the query
            elif there_exists([
                    'search something for me', 'to do a little search',
                    'search mode', 'i want to search something'
            ], query):
                SR.speak('What you want me to search for?')
                query = SR.takeCommand()
                SR.speak(f"Showing results for {query}")
                try:
                    res = app.query(query)
                    SR.speak(next(res.results).text)
                except:
                    print(
                        "Sorry, but there is a little problem while fetching the result."
                    )

            #what is the capital
            elif there_exists(
                ['what is the capital of', 'capital of', 'capital city of'],
                    query):
                try:
                    res = app.query(query)
                    SR.speak(next(res.results).text)
                except:
                    print(
                        "Sorry, but there is a little problem while fetching the result."
                    )

            elif there_exists(['temperature'], query):
                try:
                    res = app.query(query)
                    SR.speak(next(res.results).text)
                except:
                    print("Internet Connection Error")
            elif there_exists([
                    '+', '-', '*', 'x', '/', 'plus', 'add', 'minus',
                    'subtract', 'divide', 'multiply', 'divided', 'multiplied'
            ], query):
                try:
                    res = app.query(query)
                    SR.speak(next(res.results).text)
                except:
                    print("Internet Connection Error")

            else:
                SR.speak(
                    "Sorry it did not match with any commands that i'm registered with. Please say it again."
                )
    except Exception as e:
        pass