Codesrepl
Codesrepl
"""
try:
except:
if hours > 40 :
else :
print(pay)
print(big)
"""
#def addtwo(a,b):
# return a + b
#q = addtwo(9,5)
#print(q)
"""
largest = 0
if i > largest :
largest = i
print(largest)
"""
s = "Monty Python"
print(s[2:5])
"""
zap = greeet.find('ob')
print(zap)
nstr = greeet.lstrip()
print(nstr)
q)
"""
"""
print(f"{stce.startswith('Please')}")
"""
"""
atpos = data.find('@')
print(atpos)
print(sppos)
print(data[atpos+1:sppos])
"""
"""
try:
handle = open(fname)
except:
quit()
"""
"""
count = 0
for i in handle:
count = count + 1
print(count)
"""
#inp = handle.read()
#print(len(inp))
#print(inp[-2])
"""
line = line.rstrip()
if line.startswith("From:"):
print(line)
"""
x = [5, 6, 7, 8, 9, 10]
print(sum(x))
stuff = abc.split()
print(stuff)
line = 'first;second;third'
thing = line.split(';')
print(thing)
"""
counts = dict()
counts[name] = counts.get(name, 0) + 1
print(counts)
count = dict()
words = line.split()
count[word] = count.get(word, 0) + 1
print(max(count.items()))
print(aaa, bbb)
"""
fhandle = open(name)
"""
lines = lines.rstrip()
if re.search("^From:", lines):
print(lines)
"""
counts = dict()
words = line.split()
counts[word] = counts.get(word, 0) + 1
maxv = max(counts.values())
print(maxk, maxv)
lst = list()
lst.append((v,k))
print(v,k)
d = dict()
d['csev'] = 2
d['cwen'] = 4
sd = sorted(d.items())
print(sd)
print(k,v)
ld = list()
ld.append((v,k))
print(ld)
ld = sorted(ld, reverse=True)
print(ld)
words = data.split()
email = words[1]
print(email.split('@')[1])
import re
import socket
"""
try:
except:
if hours > 40 :
else :
print(pay)
print(big)
"""
#def addtwo(a,b):
# return a + b
#q = addtwo(9,5)
#print(q)
"""
largest = 0
if i > largest :
largest = i
print(largest)
"""
s = "Monty Python"
print(s[2:5])
"""
zap = greeet.find('ob')
print(zap)
nstr = greeet.lstrip()
print(nstr)
q)
"""
"""
print(f"{stce.startswith('Please')}")
"""
"""
atpos = data.find('@')
print(atpos)
print(sppos)
print(data[atpos+1:sppos])
"""
"""
try:
handle = open(fname)
except:
quit()
"""
"""
count = 0
for i in handle:
count = count + 1
print(count)
"""
#inp = handle.read()
#print(len(inp))
#print(inp[-2])
"""
line = line.rstrip()
if line.startswith("From:"):
print(line)
"""
x = [5, 6, 7, 8, 9, 10]
print(sum(x))
stuff = abc.split()
print(stuff)
line = 'first;second;third'
thing = line.split(';')
print(thing)
"""
counts = dict()
counts[name] = counts.get(name, 0) + 1
print(counts)
count = dict()
words = line.split()
count[word] = count.get(word, 0) + 1
print(max(count.items()))
print(aaa, bbb)
"""
fhandle = open(name)
"""
lines = lines.rstrip()
if re.search("^From:", lines):
print(lines)
"""
counts = dict()
words = line.split()
counts[word] = counts.get(word, 0) + 1
maxv = max(counts.values())
print(maxk, maxv)
lst = list()
lst.append((v,k))
print(v,k)
d = dict()
d['csev'] = 2
d['cwen'] = 4
print(k, v)
d = {"a" : 10, "b": 1, "c": 22}
sd = sorted(d.items())
print(sd)
print(k,v)
ld = list()
ld.append((v,k))
print(ld)
ld = sorted(ld, reverse=True)
print(ld)
words = data.split()
email = words[1]
print(email.split('@')[1])
counts = dict()
fhand= urllib.request.urlopen('http://www.dr-chuck.com/page1.htm')
"""
words = line.decode().split()
counts[word] = counts.get(word , 0) + 1
print(counts)
"""
print(line.decode().strip())
import openai
import feedparser
import tweepy
import random
import time
feed_urls = [
"https://www.chelseafc.com/en/rss.xml",
"https://weaintgotnohistory.sbnation.com/rss/current",
"https://talkchelsea.net/feed/",
openai.api_key = "YOUR_API_KEY_HERE"
consumer_key = "YOUR_CONSUMER_KEY_HERE"
consumer_secret = "YOUR_CONSUMER_SECRET_HERE"
access_token = "YOUR_ACCESS_TOKEN_HERE"
access_token_secret = "YOUR_ACCESS_TOKEN_SECRET_HERE"
# GPT-3 model ID and prompt
model_id = "davinci"
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
# Shuffle the feed URLs to randomize the order in which they are processed
random.shuffle(feed_urls)
feed = feedparser.parse(feed_url)
full_text = entry.get("content")[0].get("value")
response = openai.Completion.create(
engine=model_id,
prompt=f"{prompt}\n{full_text}",
max_tokens=60,
n=1,
stop=None,
temperature=0.5,
summary = response.choices[0].text.strip()
api.update_status(tweet_content)
# Print confirmation
time.sleep(5)