def give_quote(type): global quote if type == "normal": quote = Quote.print() if type == "anime": quote = Quote.print_anime_quote() return quote
def quotes(query: Optional[str] = None): if query == "series": return {"quote": Quote.print_series_quote()} if query == "anime": return {"quote": Quote.print_anime_quote()} if query == "programming": return {"quote": Quote.print_programming_quote()} return {"quote": Quote.print()}
def open_zoho__attendence_page(self, entry_type, is_late=False): try: self.test_internet(silent=True) self.web_driver_load() if (entry_type == 'Check-in') and (not is_late): quote = Quote.print() self.notification("normal",\ "Good Morning! Have a good day ahead!", \ quote ) if (entry_type == 'Check-out') and (not is_late): quote = Quote.print() self.notification("normal",\ "Hey there!! it is time to take rest", \ quote ) self.driver.get(AutoZohoAttendence.__URL__) web_obj = self.driver.find_element_by_xpath( '/html/body/div[2]/div[2]/div/div/div[2]/div/button[3]/div/div[3]' ) val = web_obj.text _status, _ = val.split("\n") if _status == entry_type: web_obj.click() self.notification("normal",\ "Today's {} Done".format(entry_type), \ "Thank me later..you have missed your {}! I have done for you".format(entry_type) ) time.sleep(10) elif (entry_type == 'Check-in') and (_status == 'Check-out'): self.notification("normal",\ "Good work!!", \ "Already Check-in done!!") time.sleep(10) elif (entry_type == 'Check-out') and (_status == 'Check-in'): self.notification("normal",\ "Good work!!", \ "Already Check-out done!!") time.sleep(10) else: pass except NoSuchElementException: self.notification("critical",\ "Zoho Attendence Login Failed!", "Session has Expired Need to Login in Zoho Attendence page in you firefox Profile!") except Exception as e: self.notification("critical", \ "Attendence Failed", \ "This profile was last used with a newer version of this application. Please create a new Firefox profile") finally: self.web_driver_quit()
def index(): if request.method == "GET": return render_template("index.html", data=Quote.print()) else: dataset = pd.read_csv(request.files['dataset'], index_col=0) dataset['prediksi'] = model.predict(dataset) return dataset.to_html()
def wishme(): speak("welcome back Ashish!") time_() date_() #Greetings hour = datetime.datetime.now().hour if hour >= 6 and hour < 12: speak("Good Morning Sir!") elif hour >= 12 and hour < 18: speak("Good Afternoon") elif hour >= 18 and hour < 24: speak("Good Evening Sir!") else: speak("Good Night") speak("Jarvis at your service,how can i help you") speak("Here is something interesting") speak(Quote.print())
async def quoter(_, message): quote = Quote.print() await message.reply_text(quote)
def test_random_quote(self): """ Test random quote generation """ quote = Quote().print() self.assertTrue(type(quote) == str)
def test_random_programming_quote(self): """ Test random programming quote generation """ quote = Quote().print_programming_quote() self.assertTrue(type(quote) == str)
async def quote(self, ctx): ''' Random quote. w.quote ''' await ctx.send(Quote.print())
# interacts with Twitter's login page and logs in driver.find_element_by_xpath(email_xpath).send_keys(email) # time.sleep(1) driver.find_element_by_xpath(password_xpath).send_keys(password) # time.sleep(1) driver.find_element_by_xpath(login_xpath).click() # specifying more xpaths tweet_xpath = '//*[@id="react-root"]/div/div/div[2]/header/div/div/div/div[1]/div[3]/a' message_xpath = '//*[@id="layers"]/div[2]/div/div/div/div/div/div[2]/div[2]/div/div[3]/div/div/div/div[1]/div/div/div/div/div[2]/div[1]/div/div/div/div/div/div/div/div/div/div[1]/div/div/div/div[2]/div' post_tweet_xpath = '//*[@id="layers"]/div[2]/div/div/div/div/div/div[2]/div[2]/div/div[3]/div/div/div/div[1]/div/div/div/div/div[2]/div[4]/div/div/div[2]/div[4]/div/span/span' qt_ant = ' ' for x in range(15): # posts a tweet qt = Quote.print() if qt != qt_ant: driver.find_element_by_xpath(tweet_xpath).click() # time.sleep(2) driver.find_element_by_xpath(message_xpath).send_keys(qt) # time.sleep(2) driver.find_element_by_xpath(post_tweet_xpath).click() time.sleep(1) qt_ant = qt
def index(request): sr = Quote.print_anime_quote() context = {"sr": sr} return render(request, 'index.html', context)
def error(request): sr = Quote.print_anime_quote() context = {"sr": sr} return render(request, 'error.html', context)