This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
from flask import Flask, request | |
from pymessenger import Bot | |
app = Flask(__name__) | |
PAGE_ACCESS_TOKEN = "XXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
bot = Bot(PAGE_ACCESS_TOKEN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wit import Wit | |
access_token = "server_access_token_here" | |
client = Wit(access_token = access_token) | |
message_text = "i live in Australia" | |
resp = client.message(message_text) | |
print(resp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
API_ENDPOINT = "https://translate.google.com/translate_tts" | |
headers = {'User-Agent': "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"} | |
text = "good morning" | |
params = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tqdm import tqdm | |
import requests | |
chunk_size = 1024 | |
url = "http://www.nervenet.org/pdf/python3handson.pdf" | |
r = requests.get(url, stream = True) | |
total_size = int(r.headers['content-length']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
API_ENDPOINT = "https://www.wikidata.org/w/api.php" | |
query = "covfefe" | |
params = { | |
'action': 'wbsearchentities', | |
'format': 'json', | |
'language': 'en', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
url = "http://www.hindustantimes.com/rss/topnews/rssfeed.xml" | |
resp = requests.get(url) | |
soup = BeautifulSoup(resp.content, features="xml") | |
items = soup.findAll('item') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# loading data | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) | |
# number of features | |
num_features = 784 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import path | |
import numpy as np | |
from PIL import Image | |
import wikipedia | |
from wordcloud import WordCloud, STOPWORDS | |
# get path to script's directory | |
currdir = path.dirname(__file__) | |
def get_wiki(query): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import cv2 | |
import numpy as np | |
url = "http://192.168.43.1:8080/shot.jpg" | |
while True: | |
img_resp = requests.get(url) |
OlderNewer