#code-help-voice-text
5 messages Β· Page 3 of 1
With more board configurations than there are atoms in the universe, the ancient Chinese game of Go has long been considered a grand challenge for artificial intelligence.
On March 9, 2016, the worlds of Go and artificial intelligence collided in South Korea for an extraordinary best-of-five-game competition, coined The DeepMind Challenge Matc...
python manage.py migrate --run-syncdb

hii
Where did you post that @abstract oak ?
Sorry @abstract oak would you rather I send messages here or in #help-pear ?
Could you add this to the beginning of your code, and tell us what the output is? ```py
import os
print(os.getcwd())
Ctrl-C
Not Cmd
Oh, I can give you temporary screen-sharing permissions.
Would that help?
!stream 337812638551638016
β @abstract oak can now stream until <t:1629658233:f>.
exit() or quit()
A way around this would be to explicitly make the file paths relative to the module.
The key thing is that when you give a relative path to open, the path is relative to the current working directory, rather than the module.
db = Postgres("postgres://vxwqrigmjcuyby.compute1.amazonaws.com:5432/drvmnv5cb9bof")
ssh_server = sshtunnel.SSHTunnelForwarder(
(config.ssh_server, 22),
ssh_pkey=config.ssh_private_key,
ssh_username=config.ssh_username,
remote_bind_address=('127.0.0.1', 5432),
local_bind_address=('0.0.0.0', 4444))
ssh -nNT -L 0.0.0.0:9000:127.0.0.1:5432 root@app.cool.co
telsql
i have a doubt in nginx and flask. Anybody can help me?
helo
Hey @viscid valve!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
β’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
β’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
@fiery bay do you need help?
YEs
can you tell where do you need help
alright
def fsum(tsum,num,memo={}):
if tsum in memo:
return memo[tsum]
if tsum==0:
return 1
if tsum<0:
return 0
for n in num:
rem= tsum-n
remr= fsum(rem,num,memo)
if tsum not in memo:
memo[tsum]+= remr
memo[tsum]=None
return memo[tsum]
Yeah
Yes
I'm using the top down approach
Base case works fine.
I'm having problem in memoizing the code
memomizing?
*memoizing yeah
whats that?
In dynamic rogramming
*programming
The 2 methods to solve a dp problem
Yeah
Alr8
def fsum(tsum,num,memo={}):
sm=0
if tsum==0:
return 1
if tsum<0:
return 0
for n in num:
rem= tsum-n
remr= fsum(rem,num,memo)
sm+=remr
return s
Like, this works fine but the problem arises in memoization.
tsum is total sum
In the first example, tsum is 3
I'm sorry
2 is tsum, yeah and [1,2] is num
Expected behaviour would be that I get the number of ways to get tsum
But I'm getting a KeyError meaning that somehow, numbers arent getting stored in the dictionary.
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-50-6bc45dd79565> in <module>
----> 1 fsum(3,[1,2])
<ipython-input-49-5f540bed21d3> in fsum(tsum, num, memo)
8 for n in num:
9 rem= tsum-n
---> 10 remr= fsum(rem,num,memo)
11 if tsum not in memo:
12 memo[tsum]+= remr
<ipython-input-49-5f540bed21d3> in fsum(tsum, num, memo)
8 for n in num:
9 rem= tsum-n
---> 10 remr= fsum(rem,num,memo)
11 if tsum not in memo:
12 memo[tsum]+= remr
<ipython-input-49-5f540bed21d3> in fsum(tsum, num, memo)
10 remr= fsum(rem,num,memo)
11 if tsum not in memo:
---> 12 memo[tsum]+= remr
13
14 memo[tsum]=None
KeyError: 1
def fsum(tsum,num,memo={}):
if tsum in memo:
return memo[tsum]
if tsum==0:
return 1
if tsum<0:
return 0
for n in num:
rem= tsum-n
remr= fsum(rem,num,memo)
if tsum not in memo:
memo[tsum]+= remr
# maybe the problem is here you are assigning the key a None value
memo[tsum]=None
return memo[tsum]
Removing the 2nd last line?
def fsum(tsum,num,memo={}):
if tsum in memo:
return memo[tsum]
if tsum==0:
return 1
if tsum<0:
return 0
for n in num:
rem= tsum-n
remr= fsum(rem,num,memo)
if tsum not in memo:
try:
memo[tsum]+= remr
except KeyError:
memo[tsum] = remr
# maybe the problem is here you are assigning the key a None value
memo[tsum]=None
return memo[tsum]
num is the list of numbers
example?
[1,2] from the question
Like we use [1,2] and then find the number of ways we get 3 by summing digits from [1,2]
I mean sort of yeah,
Like theres 3 ways we can get 3 by summing 1 and 2
I could explain you the code but I'm unfortunately supressed ;_;
Yeah, sure
No, I was trying to explain my code.
Like, I reduce numbers in num from tsum such that if a succession follows upto 0, that means that sequence is a valid way of making 3 using 1's and 2's. Here, tsum==0 and tsum<0 are base cases.
from itertools import combinations
res = 0
num_of_stairs = 4
potential_options = []
for _ in range(num_of_stairs):
potential_options.append(1)
potential_options.append(2)
all_combs = []
for r in range(num_of_stairs+1):
r_combs = combinations(potential_options, r)
for comb in r_combs:
if comb not in all_combs:
all_combs.append(comb)
for comb in all_combs:
if sum(comb) == num_of_stairs:
res += 1
print(res)
!e
from itertools import combinations as comb
a = [1,2,3,4,5]
print("when r is 2", list(comb(a,2)))
print("when r is 3", list(comb(a,3)))
@tender hill :white_check_mark: Your eval job has completed with return code 0.
001 | when r is 2 [(1, 2), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5)]
002 | when r is 3 [(1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 3, 4), (1, 3, 5), (1, 4, 5), (2, 3, 4), (2, 3, 5), (2, 4, 5), (3, 4, 5)]
Oh, so r is the amount of elements in the tuple, gotcha
yea
alright bye! :)
gg, bye
@clear agate I cant speak
Yea, he provided a solution using a diff approach
Meaning itll take longer in bigger numbers?
Yeah, it is taking longer.
Mhm
In mathematics, a permutation of a set is, loosely speaking, an arrangement of its members into a sequence or linear order, or if the set is already ordered, a rearrangement of its elements. The word "permutation" also refers to the act or process of changing the linear order of an ordered set.Permutations differ from combinations, which are sel...
Hey @main solar!
It looks like you tried to attach file type(s) that we do not allow (.pdf). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.
Feel free to ask in #community-meta if you think this is a mistake.
@cosmic bloom you need help? I see youre in code/help 0
Hello
@hazy walrus what are you working on?
having issues with jet brains?
I am really close to being voice verified.
HUUUU 
hey @main solar do you have a mic?
yes
can you hear me?
no
can u hear me
[[f,r], [f1,r1]]```
would anyone be willing to hop in a call with me? I am trying to figure out pulling info from an api and i am very new to python
import gibbs
seqs = sequence.readFastaFile(both_seqs, sym.DNA_Alphabet)
W = 8 # the width of the motif sought
g = gibbs.GibbsMotif(both_seqs, W)
q = g.discover(niter = 1000)
print('Consensus: ', end='')
for pos in q:
print(pos.getmax(), end='')
print()
p = g.getBackground()
print('Background distribution:', p)
a = gibbs.getAlignment(seqs, q, p)
k = 0
for seq in seqs:
#print("%s \t%s" % (seq.name, seq[a[k]:a[k]+W]))
print("sequence.Sequence(\'%s\', name=\'%s\')," % (seq[a[k]:a[k]+W], seq.name))
k += 1```
class GibbsMotif():
"""
A class for discovering linear motifs in sequence data.
Uses Gibb's sampling (Lawrence et al., Science 262:208-214 1993).
Also see http://bayesweb.wadsworth.org/gibbs/content.html which has info
on "site sampling", "motif sampling", "recursive sampling" and "centroid
sampling". The first is implemented (roughly) below.
"""
def __init__(self, seqs, length, alignment = None):
""" Construct a "discovery" session by providing the sequences that will be used.
seqs: sequences in which the motif is sought
length: length of sought pattern (W)
alignment: positions in each sequence for the initial alignment (use only if the alignment
has been determined from a previous run).
"""
self.seqs = seqs
self.length = length # length of motif 1..W
seqs = self.seqs
self.alphabet = None
k = 0
for s in seqs:
if self.alphabet != None and self.alphabet != s.alphabet:
raise RuntimeError("Sequences invalid: different alphabets")
self.alphabet = s.alphabet
if alignment:
if alignment[k] < 0 or alignment[k] >= len(s):
raise RuntimeError("Initial alignment invalid: does not match sequence " + s.name)
k += 1```
``py
import sequence
def reverse_complement(sequence):
# This function finds the reverse complement of any DNA sequences that call it.
complement = {'A': 'T', 'C': 'G', 'G': 'C', 'T': 'A'}
reverse_sequence = []
#For loop that goes over every sequence in a file containing sequences, and calls the Reverse complement funtion.
for item in sequence[::-1]:
reverse_sequence.append(complement[item])
return reverse_sequence
rv_comp = []
# empty list that will hold all of the reverse complement sequences.
#For loop that iterates over every sequence and finds the reverse complement.
for seq in seqs:
rverse_comp = reverse_complement(seq)
rv_comp.append(rverse_comp)
print("Forward")
print(seq)
print()
print("Reverse")
print("".join(rverse_comp))
print()
both_seqs = Sequence(seq, rv_comp)```
@main solar :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 31, in <module>
003 | NameError: name 'sequence' is not defined
@main solar :white_check_mark: Your eval job has completed with return code 0.
[['A', 'G', 'C', 'T'], ['A', 'G', 'C', 'T']]
both_seqs = list(rv_comp += seqs)
both_seqs = Sequence(rv_comp, sym.DNA_alphabet)```
#both_seqs = Sequence(rv_comp, sym.DNA_alphabet)
#both_seqs = Sequence(seq, rv_comp)
import sequence
def reverse_complement(sequence):
# This function finds the reverse complement of any DNA sequences that call it.
complement = {'A': 'T', 'C': 'G', 'G': 'C', 'T': 'A'}
reverse_sequence = []
#For loop that goes over every sequence in a file containing sequences, and calls the Reverse complement funtion.
for item in sequence[::-1]:
reverse_sequence.append(complement[item])
return reverse_sequence
rv_comp = []
# empty list that will hold all of the reverse complement sequences.
#For loop that iterates over every sequence and finds the reverse complement.
for seq in seqs:
rverse_comp = reverse_complement(seq)
rv_comp.append(rverse_comp)
print("Forward")
print(seq)
print()
print("Reverse")
print("".join(rverse_comp))
print()```
<gibbs.GibbsMotif object at 0x000001AB7E49DE80>
<gibbs.GibbsMotif object at 0x000001AB7E3E1DC0>
@main solar one last bit of help if you don't mind?
if you're busy no worries
nevermind I solved it!!
yaaaa
var canvas;
var backgroundImage, bgImg, car1_img, car2_img, track;
var database, gameState;
var form, player, playerCount;
var allPlayers, car1, car2;
var cars = [];
function preload() {
backgroundImage = loadImage("assets/background.png");
car1_img = loadImage("assets/car1.png");
car2_img = loadImage("assets/car2.png");
track = loadImage("assets/track.jpg");
}
function setup() {
canvas = createCanvas(windowWidth, windowHeight);
database = firebase.database();
game = new Game();
game.getState();
game.start();
}
function draw() {
background(backgroundImage);
if (playerCount === 2) {
game.update(1);
}
if (gameState === 1) {
game.play();
}
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}

Hi, so is anyone willing to help me with my problem?
This is the command...
it is supposed to start home.py
which exists but instead, when I run it in an enterpreter, this shows up...
Anyone know how to resolve this issue?
Could I just use this?
file_object = open(βhome.pyβ)

!e
def greeting_decorator(function):
def returned_function():
print("I'm from the decorator!")
function()
print("We're now out of the original function and back in the decorator")
return returned_function
@greeting_decorator
def say_hi():
print("Hello! This is from the say_hi function")
say_hi()
@faint hinge :white_check_mark: Your eval job has completed with return code 0.
001 | I'm from the decorator!
002 | Hello! This is from the say_hi function
003 | We're now out of the original function and back in the decorator
!e
def greeting_decorator(function):
def returned_function():
print("I'm from the decorator!")
function()
print("We're now out of the original function and back in the decorator")
return returned_function
def say_hi():
print("Hello! This is from the say_hi function")
say_hi = greeting_decorator(say_hi)
say_hi()
@faint hinge :white_check_mark: Your eval job has completed with return code 0.
001 | I'm from the decorator!
002 | Hello! This is from the say_hi function
003 | We're now out of the original function and back in the decorator
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
py3 filename.py
I'm on mac os btw
you don't have requirements.txt and Procfile
requirements.txt conatains libs you have used
C:\Users\User\AppData\Local\Programs\Python\Python39\python.exe: can't open file 'C:\Users\User\VIKRAM_PRASAD_TP057977.py': [Errno 2] No such file or directory
okay, how do I find that file though
lol it's probably a really basic question
but I don't really check my files all that often, since I have all my files and projects stored in pycharm
umm are you in the file directory of your code
yeah
what libs you have used in your code
@pulsar basin
uhh let me check
I'll just list them out for you
webbrowser, discord, asyncpraw, os, base64, time, random, logging, httpx
aiohttp, asyncio
and that's it
alright
now what you do is
python3 -m pip freeze
is that what I should do, or is that what @spice thunder should do?
you should
cd Users/User/PycharmProjects/"VIKRAM PRASAD_TP057977"
should I cp that?
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
paste it here
and after that do this python filename.py
Hey @pulsar basin!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
β’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
β’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
Hey @pulsar basin!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
β’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
β’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
!paste it here
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
Hey @pulsar basin!
It looks like you tried to attach file type(s) that we do not allow (.html). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.
Feel free to ask in #community-meta if you think this is a mistake.
discord==1.7.3
discord.py==1.7.3
asyncpraw==7.4.0
asyncprawcore==2.3.0
worker: python main.py
is that the end of the logs?
!stream 867430190888386581 30M
β @pulsar basin can now stream until <t:1630011957:f>.
NP π
yea i can
@pulsar basin
can you show the build logs
yea
turn the pencil on
turn it on-off
no
just check if it comes online
@bot.event
async def on_ready():
print("The bot is ready!")
add this code in your file
Thanks
Hi, I need help with some coding that I'm having trouble with
gatt
@amber epoch
π
How am I supposed to pronounce your name?
I canβt talk yet
π
Hi, is the 2nd part of an AND condition executed if the 1st part returns true?
got some problems with functions and order of execution in a class anyone help
Hi I need some help troubleshooting my code
does anybody knows about multi stage building in docker?
my neighbours are playing music with large volume
@neon heron
i cant speak rn
there is noise
i dont think i can help you with this :/
i am not good at terminal stuff
@white surge do you need help?
sudo add-apt-repository ppa:appimagelauncher-team/stable
sudo apt update
sudo apt install appimagelauncher
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
anyone know a good places to learn Manichean learning?
print("Welcome to My Program!")
name = input("Please Type your Name here: ")
print(f"Greetings {name}")
age = int(input("Please Enter your age")
for age in range(ages):
print("You have met the required Age.")
else:
print("You are no elegilbe")
what do you want to do here?
like whats the
objective
of the program
@cloud oyster
oh ok
Hey I have created a program for generating certificate where I have used 2 fonts for the text. Now I want to run this program on cloud - on repl, but it's not allowing the font files, can someone help me?
Have you uploaded the font files to repl?
yes
What's the error it's tossing to you?
Take your time
@faint hinge
Mkay, one sec
in here I have uploaded the fonts and given the location of that fonts
So it's with how you're trying to access the file. replit's file system is a bit different
This should help
Glad it helped!
also got an other error
I actually used smtplib to send a mail using python
but I'm getting this error
move the it into the fun
what are you building my friend @main solar
@main solar you got "randomcolors" function that does not have the code in it... move it as you have been told again into the func
That's something being weird with your browser or api key or something funky.
Not sure on that
ok can you please tell me how to send a mail using python on repl
cause when I use smtp, I'm getting this error
<@&831776746206265384> need to drop a line to ya.
Hello, how can we help you?
Could you send the details to @feral cipher please?
sure thing
Thanks π
You are most welcome. I might not be the best rule follower but thats just another level of hell na.
@knotty holly done and done. Good evening sudo su.
hi friends can you all teach me how to learn python ?
Hi guys!
Itβs like a while that I have started learning Python.
I have started with Coursera and itβs really useful but I donβt know how I can get my hands on more practices .
I mean there I have like one assignment each week but I want to do more and become really good at this.
Do you have any suggestions?
Suspicious emails: unclaimed insurance bonds, diamond-encrusted safe deposit boxes, close friends marooned in a foreign country. They pop up in our inboxes .
Suspicious emails: unclaimed insurance bonds, diamond-encrusted safe deposit boxes, close friends marooned in a foreign country. They pop up in our inboxes .
SEASON 2 OF SCAMALOT KICK...
Alchemic blend of attention-seeking + zero integrity has led me to Cameo where you can hire me for birthday greetings, videos, most things I think
https://www.cameo.com/jamesveitch
Buy SK hynix Gold S31 SSD on Amazon: https://geni.us/x6HG
Thanks to SK hynix for sponsoring this video!
Discuss on the forum: https://linustechtips.com/main/topic/1154562-how-many-chrome-tabs-can-you-open-with-2tb-ram/
Linus Tech Tips merchandise at http://www.LTTStore.com/
Our Test Benches on Amazon: https://www.amazon.com/shop/linustechtips...
Thanks to Daniel Myslivets for helping me to gather information for this video.
Hello, my friends! Let's hit 10000 likes? Check out my website! https://malwat.ch
Today I am going to show you how I activated Windows XP by phone. It was a disaster. Almost 20 years since the release, more than 7 since its end of life, OEM versions of Windows XP ca...
@bot.command()
async def afk(ctx, reason=None):
current_nick = ctx.author.nick
await ctx.send(f"{ctx.author.mention} is afk: {reason} ")
await ctx.author.edit(nick=f"[AFK] {ctx.author.name}")
counter = 0
while counter <= int(mins):
counter += 1
await asyncio.sleep(60)
if counter == int(mins):
await ctx.author.edit(nick=current_nick)
await ctx.send(f"{ctx.author.mention} is no longer AFK")
break
if len(nick) > 6 and nick.lower().startswith('[afk] '):
nick = nick[6:]
@bot.command()
async def afk(ctx, reason=None):
current_nick = ctx.author.nick
await ctx.send(f"{ctx.author.mention} is afk: {reason} ")
await ctx.author.edit(nick=f"[AFK] {ctx.author.name}")
def check_s(author):
def inner_check(message):
return message.author == author
return inner_check
while True:
try:
_ = bot.wait_for('message', check=check_s, timeout=1)
except Exception as e:
pass
else:
await ctx.author.edit(nick=current_nick)
await ctx.send(f"{ctx.author.mention} is no longer")
break
@feral socket do you need help?
can i get simple coding
@client.event async def on_ready(): print('Connected to Discord Api') r = requests.head("https://api.github.com") if r.ok: print ('Connected to github api') else: print ('Uhh Github Api Is not connecting!')
@fading phoenix
i need
a course
online
Hey man
i need help with this:
Make a program that
- Kets two players to enter their details, which are then checked to ensure that they are
Registered players.
-
Lets both players to roll two 6-sided dice.
-
Calculates and outputs the points for each round and each playerβs total score.
-
Lets the players play 5 rounds.
-
If both players have the same score after 5 rounds, allows each player to roll 1 die each until
someone wins.
-
Outputs who has won at the end of the 5 rounds.
-
Stores the winnerβs score, and their name, in an external file.
-
Displays the score and player name of the top 5 winning scores from the external file.
The rules are:
β’ The points rolled on each playerβs dice are added to their score.
β’ If the total is an even number, an additional 10 points are added to their score.
β’ If the total is an odd number, 5 points are subtracted from their score.
β’ If they roll a double, they get to roll one extra die and get the number of points rolled added to
their score.
β’ The score of a player cannot go below 0 at any point.
β’ The person with the highest score at the end of the 5 rounds wins.
β’ If both players have the same score at the end of the 5 rounds, they each roll 1 die and
whoever gets the highest score wins (this repeats until someone wins).
Only authorized players are allowed to play the game.
Where appropriate, input from the user should be validated.
I think I missed that when I was on
@lilac mist
Do you require assistance? π
I'll be around if you need anything. π
i would like to get some help pls
[2, 1]
[3, 1]
[4, 1]
[5, 1]
[6, 1]
[7, 1]
[8, 1]
[9, 1]
[10, 1]
[11, 2]
[12, 2]
[13, 2]
[14, 2]
[15, 2]
[16, 2]
[17, 2]
[18, 2]
[19, 2]
[20, 2]
[21, 3]```
you need help @frank glacier ?
yes, i dont know anything about python and i have to do a homework

hi
I made a web scrapy
were in #voice-chat-text-0
I made a web scrapy once and it told me the fattest cat on a particular adoption website
so there is a lot of ways I have tried this
(WARNING THIS IS A RANDOM PIC FROM A BIG WEBSITE THAT THESE LINKS ARE MOST ARE NOT SAFE SO DO NOT RUN JUST LOOK)
@cosmic ginkgo same
where is a good website where I can share some of the code.
hello
hi
hey
Can someone help me with selenium im trying to get a text from a page without just getting //*[@id="PageContent"]/section/div/div/div/div/div/div[3]/button
hi
Hello
@white basalt
u have get voice verify
average = total /3
so no space between the slash and the 3?
It still comes back with an error
The tutorial wants me to use the 4th item in each list
ok
i know the indexing starts at 0
total = (row_1[4] + row_2[4] + row_3[4])
first u print the total then u have idea
wouldn't it be more efficient to just add the ratings together?
Now that they're turned into variables?
for average
average = total / 5
hello
for i in range(10):
name = input("bale onoma :")
print(megaliteroonoma)
i want to see the longest name
can someone help me?
Can you elaborate with an example
maximum=0
for i in range(10):
name = input("bale onoma :")
temp=len(name)
if temp>maximum:
maximum=temp
ans=name
print(ans)
β```
@junior sentinel something like this?
yes
thank you so match
Welcome
i too thank u for a match
Have a nice day
too many f bomb
s
you just have to uncollapse the voice category. you currently have it collapsed
a maniac laughs
How to?
Uncollaps it?
you also can't join?
Yeah
i think there is a limit for memebers to join
iddk
This sht fcked up
Thxx
Hey @hybrid slate!
It looks like you tried to attach file type(s) that we do not allow (.htm). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.
Feel free to ask in #community-meta if you think this is a mistake.
@silk timber What do you need help with?
I was just hanging out there to get away from discussion while I worked on a little code
But I'm also available if anyone needs any help, brb...
im in need of some basical intro to python help. Is there anyone who could hop in a voice chat with me?
can anyone help me with my tkinter music player in vc
its not working how i want and been stuck for a couple days now
Is anyone available to help with a python panda library issue?
someones echo sounds like a demon
I am new coding and I just want to learn hhow to code so I am prepared for next yr coding
hello
Sure, what's up
I am new to coding and I am in your vc
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
I have tried but I had no clue where to go
so many people have told me to use that but I have no clue where to go
ok
No problem!
why cant i talk in the VC?
!voice
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
yo
i got some problem with my code
anyone wanna help
it about argparse, OOP and stuff like that
i wanna make a custom action
i just joind
nice
ok
yes
akg
he left
ty
lerning
pygame
i use thonny
ive kinda made this
cant close it
i have no idea what is main
line 8
i have no idea i just watched totouralil
oh
i have stop button at the top of the screen
pygame weerd
# import the pygame module, so you can use it
import pygame
# define a main function
def main():
# initialize the pygame module
pygame.init()
# load and set the logo
logo = pygame.image.load("logo32x32.png")
pygame.display.set_icon(logo)
pygame.display.set_caption("minimal program")
# create a surface on screen that has the size of 240 x 180
screen = pygame.display.set_mode((240,180))
# define a variable to control the main loop
running = True
# main loop
while running:
# event handling, gets all event from the event queue
for event in pygame.event.get():
# only do something if the event is of type QUIT
if event.type == pygame.QUIT:
# change the value to False, to exit the main loop
running = False
# run the main function only if this module is executed as the main script
# (if you import this as a module then nothing is executed)
if __name__=="__main__":
# call the main function
main()
def say_hello():
print("Hello")
say_hello()
say_hello()
!e
def say_hello():
print("Hello")
say_hello()
say_hello()
@modern dust :white_check_mark: Your eval job has completed with return code 0.
001 | Hello
002 | Hello
!e
def say_hello(num_of_times):
for _ in range(num_of_times):
print("Hello")
say_hello(5)
!e
def say_hello(num_of_times):
for _ in range(num_of_times):
print("Hello")
say_hello(5)
@modern dust :white_check_mark: Your eval job has completed with return code 0.
001 | Hello
002 | Hello
003 | Hello
004 | Hello
005 | Hello
ok
this is img
same dir
memes
i cant close it
ut o
yellow means frees
yea
im useing thoony
nn
!e
!eval [code]
Can also use: e
*Run Python code and get the results.
This command supports multiple lines of code, including code wrapped inside a formatted code
block. Code can be re-evaluated by editing the original message within 10 seconds and
clicking the reaction that subsequently appears.
We've done our best to make this sandboxed, but do let us know if you manage to find an
issue with it!*
!e [print ("hi")]
@limber raven :white_check_mark: Your eval job has completed with return code 0.
hi
do u want to frend me
ok
thats purple
the backround
win 98
the tabs
i have unity
i dont have c inturpreter
yea
c#
yea
ik
ive seen it
or writer
oh
code is hard
basic is kinda hard
i have a rasperry pi to code on the go
what that
oh
my pc trash
i can bareley run roblox
10fps
yes
java is like c ive herd
oh
holy c
c# and c is holy c
something like that
ms basic
c64
10 print hi
no space between 10 and print
i need 2 more days
so uh
hi catt
how do i know how many messages i sent
cant i just
yeah lol
what happens?
damn
well
I already got that requirement
!e [print ("hello world")]
@limber raven :white_check_mark: Your eval job has completed with return code 0.
hello world
only the 50 messages one
look at what i have created....
Monopoly.
A army.
I bought them for 0.03$
how
u like trariea
yes
i do to
to leval 10
hi solim
If i manage to sell only 1 for 1$ (the lowest price)
then I make back profit
so I only need 1 helpless guy who wants a duck
Spiffing brit
oh oop
Is it possible for me to log into a website that uses google and scrape the data just using post/get requests and that sorta thing? I do not want to open a browser tab
Guys i had doubt regarding a python problem that i was solving online. Is this the right place to ask?
ok
@tender hill can you help me with a python problem?
hi
guys, how to delete the main repository on github?
m
hello
guys
how can i equal my variable to something else when they are undefined
like this code
x = n || ""
hoi
hello
hello
hi
Program to accept a string and count and display the number of words which are starting with a vowel
can someone help ?
Can cythonize protect source code from reverse engineering
ok thk
hello, can you help me: The code has bugs. Can you find them, correct them and pass the tests?
HELP BUGS
def fix_me(my_list):
if len(my_list) % 2: # imperative code
new_list = []
for item in my_list:
for element in item:
new_list = new_list.append(element)
else: # functional code
new_list = [element for element in my_list for element in item]
return new_list.sort(reverse=True, key=lambda x: -x)
Arguments: [[3, 4], [2, 6]]
Departure:
Error Message: free variable 'item' referenced before assignment in enclosing scope, Error Type: NameError, Stack Trace: ['File "/var/task/879430_9203_fix_me.py", line 15, in lambda_handler \ n return fix_me ([[3 , 4], [2, 6]]) \ n ',' File "/var/task/879430_9203_fix_me.py", line 11, in fix_me \ n new_list = [element for element in my_list for element in item] \ n ',' File "/var/task/879430_9203_fix_me.py", line 11, in <listcomp> \ n new_list = [element for element in my_list for element in item] \ n ']
Expected output:
[6, 4, 3, 2]
@dark copper from stpl001 import run
coursera andrew ng
Kaggle is the worldβs largest data science community with powerful tools and resources to help you achieve your data science goals.
i am gonna start this after pyweek :)
awesome!
@stoic kelp https://www.microsoft.com/en-us/research/uploads/prod/2006/01/Bishop-Pattern-Recognition-and-Machine-Learning-2006.pdf
If I were 23 again, that's my reccomendation. Go as far as you can into that textbook.
Highlighted Topics
02:52 [Talk: Stacked Capsule Autoencoders by Geoffrey Hinton]
36:04 [Talk: Self-Supervised Learning by Yann LeCun]
1:09:37 [Talk: Deep Learning for System 2 Processing by Yoshua Bengio]
1:41:06 [Panel Discussion]
Auto-chaptering powered by VideoKen (https://videoken.com/)
For indexed video, https://conftube.com/video/vim...
Join the channel membership:
https://www.youtube.com/c/AIPursuit/join
Subscribe to the channel:
https://www.youtube.com/c/AIPursuit?sub_confirmation=1
Support and Donation:
Paypal β’ https://paypal.me/tayhengee
Patreon β’ https://www.patreon.com/hengee
BTC β’ bc1q2r7eymlf20576alvcmryn28tgrvxqw5r30cmpu
ETH β’ 0x58c4bD4244686F3b4e636EfeBD159258A5513...
AI Loss Landscape Visualization talk given by Javier Ideami at the Synthetic Intelligence Forum of Toronto on July 22, 2020.
In the first part of this talk, Javier explains the context, the why and the how of the visualizations of the Loss Landscape project. In the second part of the talk, Javier presents some of the visualizations of the projec...
Visualize the morphology of the loss landscapes of deep learning optimization processes in very high resolution and quality.
So basically I need a key generator for my code so when someone purchases my product theyll download it open it up and they be prompted with a screen that says Enter - License key -
I'll have a discord bot that can generate these keys and remove them
Can anyone help me with this problem
?
r u guys talking.. ?
import turtle
import os
inte = turtle.Screen()
inte.title('blalal')
inte.bgcolor('black')
inte.setup(width = 800, height = 600)
inte.tracer
#square
square = turtle.Turtle()
square.shape('square')
square.color('purple')
square.speed(0)
square.shapesize(stretch_wid= 1, stretch_len = 1)
square.penup()
square.goto(-350,0)
#controls
def square_down():
y = square.ycor
y += 20
square.set(y)
def square_up():
y = square.ycor
y -= 20
square.set(y)
#keyboard controls
inte.listen()
inte.onkeypress(square_down, "s")
inte.onkeypress(square_down, "w")
Main game loop
while True:
inte.update()
what did i do wrong here?
cant figure out
hi everyone , can someone tell me , how can i split this with keep wihtespaces
my
str
be
like
And i want split it like this -> ['my','str','\n','be','like']
Needing help if anyone is available
How do I download the module Bigfloat? I tryed but it gave a long error. https://paste.pythondiscord.com/ofikajitob.sql
what class is this for
Can someone help me understand why I'm not able to print/return this (I'm completely new to Python/coding in general)
is it supposed to be scan0bject?
<@&831776746206265384> can i get screen permission
Could someone help me understand this thing?
In Jupyter or Co-lab
we can write the code in[4] like this for known just only type of num1. That so easy and not effect to each code.
In this case we know the type of num1 is int
Question 1 : This action what we call this?
Last lession i didn't make sure to call it debugging?
Question 2 : In pyCharm we can't do this (run just some code that isn't affect to each code)
But if we need to run, they will run from 1st line to the end like this picture
and if we code just
type(num1)
they'll not print anything back but need to code
print(type(num1))
If we have a lot of code before and don't need it run but we need to know the value of num1
How to make it easier like Jupyter notebook?
Traceback (most recent call last):
File "C:\Users\anime\AppData\Local\Citra\nightly-mingw\scripting\citrarng.py", line 2, in <module>
from PySide6.QtWidgets import QApplication
ModuleNotFoundError: No module named 'PySide6'
You need to install the module first you can do that using "pip install PySide6"
from PySide6.QtWidgets import QApplication
# First create BedFile for genomic ranges of 1kb upstream promoter region of each transcript
marker_overlaps = []
# ---------------------- Write your code here
marker_overlaps_bed = bed.BedFile(marker_overlaps)
try:
for o in marker_overlaps_bed:
print(o.name, o.chrom, o.chromStart, o.chromEnd)
except Exception as e:
print(e)```
!e py a = set("ABCDEF") b = set("DEFGHI") c = a.intersection(b) print(c)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
{'F', 'D', 'E'}
Fun for the whole family!
@sly merlin hop in
esc_atac = bed.BedFile('GSM2579550_ESC_ATAC_peak.bed')
hCO_atac = bed.BedFile('GSM2579552_hCO_day72_ATAC_peak.bed')```
'PAX6', 'NEUROG2', 'TBR1', 'BCL11B', 'SLC32A1', 'GAD1', 'GAD2',
'GFAP', 'GLUD1', 'SLC17A7', 'SLC17A6']
# First create BedFile for genomic ranges of 1kb upstream promoter region of each transcript
marker_overlaps = ['PAX6', 'NEUROG2', 'TBR1', 'BCL11B', 'SLC32A1', 'GAD1', 'GAD2',
'GFAP', 'GLUD1', 'SLC17A7', 'SLC17A6']
# ---------------------- Write your code here
marker_overlaps_bed = bed.BedFile(marker_overlaps)
try:
for o in marker_overlaps_bed:
print(o.name, o.chrom, o.chromStart, o.chromEnd)
except Exception as e:
print(e)```
# First create BedFile for genomic ranges of 1kb upstream promoter region of each transcript
marker_overlaps = ['PAX6', 'NEUROG2', 'TBR1', 'BCL11B', 'SLC32A1', 'GAD1', 'GAD2',
'GFAP', 'GLUD1', 'SLC17A7', 'SLC17A6']
# ---------------------- Write your code here
marker_overlaps_bed = bed.BedFile(marker_overlaps)
try:
for o in marker_overlaps_bed:
print(o)
#print(o.name, o.chrom, o.chromStart, o.chromEnd)
#except Exception as e:
#print(e)```
#print(e)
^
SyntaxError: unexpected EOF while parsing
7
8
----> 9 marker_overlaps_bed = bed.BedFile(marker_overlaps)
10 try:
11 for o in marker_overlaps_bed:
~\Desktop\Practical0\binfpy-master\bed.py in __init__(self, entries, format)
234 for entry in entries:
235 # check if the chromosome has been seen before
--> 236 tree = self.chroms.get(entry.chrom)
237 if not tree:
238 tree = ival.IntervalTree()
AttributeError: 'str' object has no attribute 'chrom'```
srry i didn't get the ping
was taking a break
no worries
!stream 808399722108813333
β @swift leaf can now stream until <t:1632164168:f>.
py -m pip install pyside6
Lol LX wtf is this abouuuusee

lol fomo
Hi can someone help me understand this
arr = [1, 2, 3, 4, 5, 6]
for i in range(1, 6):
arr[i - 1] = arr[i]
for i in range(0, 6):
print(arr[i], end = " ")
I guess the answer would be 23456
sup
yeah
can someone help me understand something about the code
i'm still new to python
any of the helpers here to assist me ?
What's your question?
it's more of someone explain it better to me okay
phone = input ("phone:")
numbers= {
"1": "one",
"2": "two",
"3":"three",
"4": "four"
}
output = ""
for ch in phone:
output +=numbers.get(ch)
print (output)
why did we add the output and made it an empty string at first
and why did we made the output += to numbers
bty i'm watching this guy
Oh okay right
@deep nest We do this so that we can concatenate (smoosh strings together) right away
Effectively we're doing output = output + numbers.get(ch)
If we didn't define output as an empty string ahead of time, it'd error out
Any time!
can u tell me of good tips or sources to better understand python
i'm new and i should mention that i'm not a native speaker
!resources We actually have a ton of resources on our website. For new folks, we typically suggest "Automate the Boring Stuff" and "A Byte of Python". Sadly we don't really have any resources in languages other than English. We've also got listings for different courses if that's more your thing, as well as other YouTube channels that have excellent tutorials
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
hola @quaint maple
Sharing my screen if you want to see @celest ice
You can now because some left
@mossy magnet "Allow multiple anagram games to be used at once"
Polish anagram command for multiple channels
* Updated docstrings
* Allowed command to be used in multiple channels
* Create a class for anagram game instances
* Lay groundwork for threads
@mossy magnet this is what I typed
i need ideas
import matplotlib
import numpy as np
from random import randint
import matplotlib.pyplot as plt # use abbreviation
import random
import math
# Define different functions for each operation
def xsquared(x):
return x ** 2
def xsquared_half(x):
return x ** (x + 0.5)
def sinus(x):
return math.sin(x)
def trigon(x):
return math.tan(math.cos(math.sin(x)))
def sinus_x_squared(x): ###?
math.sin(x ** 2)
# Definition of monte carlo operation
def montecarlo(func, x1, y1, x2, y2):
# Define the rectangle for integration
# rectangle = (x2 - x1) * (y2 - y1)
coordinates_list = []
list_random_x_value = []
list_random_y_value = []
# Generate random points in the rectangle
for i in range(0, 100):
random_x_value = random.uniform(x1, x2)
random_y_value = random.uniform(y1, y2)
list_random_x_value.append(random_x_value)
list_random_y_value.append(random_y_value)
# coordinates = [random_x_value, random_y_value]
# coordinates_list.append(coordinates)
# print(coordinates_list)
list_x_values_graph = []
list_y_values_graph = []
#Formula for creating the function and defining the x and y values of the function
for values in np.arange(x1, x2, 0.01):
list_x_values_graph.append(values)
y_values = func(values)
list_y_values_graph.append(y_values)
# plot every value and every value has a different x coordinate
# find the corresponding x value in the list with the y value
plt.plot(list_x_values_graph, list_y_values_graph, "r-", list_random_x_value, list_random_y_value, "go")
plt.show()
montecarlo(sinus, 0, -6, 3.14, 6)```
Hokay, so
To fill color above the curve, we can take the following steps βStepsInitialize the variable n. Initialize xΒ and yΒ data points using numpy.Create a figure a ...
Hey @cloud skiff!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
β’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
β’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
Hey @cloud skiff!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
β’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
β’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
Can anyone please help me getting the href of first google search results ?
using selenium
Yea sure
The href of google search results is like really easy I can explain you real quick
if anyone has some free time, i could use some assistance
@faint hinge hey man. you know me, WorldWake
wanna do the voice?
@faint hinge I need a bit of Help. I need somebody to help me !voiceverify and i've only been here for like 30 minutes -- instead of 3 days
can anyone help me with my tkinter music player? im stuck as im not very experienced
!voice
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
dm the bot
i guess
hell world
@pallid pivot there is a channel missing
You should run the command in #voice-verification
You cannot see the channel once you ar verified
it's a little confusing bc users that are already voice verified like we are won't see the link to the voice verification channel. but users that aren't will see the channel and the link in the embed will work
python doesn't know where to import it from
do something like : from .... import cv2
hi
i did not know that
now it makes sense
means = {key: np.mean(value) for key, value in your_dictionary.items()}
def get_min(x):
return min(your_dict[x]) if len(x) == 0 else math.inf
min_num = min(your_dict, key = get_min)
@somber cobalt do you need help
ok
idk why
well what is your problem
you havent done !voiceverify in the right channel and/or dont meet the requirements
i'm trying to import an image to my code (on vscode)
ok
when u have an image in the same folder as your code, you just have to type the name right
yes
what module are you using
from tkinter import *
from tkinter.constants import ACTIVE
vscode wont autocomplete strings
i dont think so
np
hey @rugged dock
Yea?
I donβt use tkinter so I canβt help you there
I want to print the elements of an array in a single line without brackets and commas. whats the best way? anyone?
hi
im a french kid of 13 and i coding python about 6 month do you have some tuto for be better ?
@clear gulch u need help?
Yeah
with what
To put it simply im building a embed command that sets color of banner by key word !BTO. But I want to allow the user to customize the description by typing in discord and not code. Im aware of discord.Client.wait_for just having trouble implementing it
i dont make discord bots but send this in #discord-bots to get help from people who do
Gotcha. I did that and they responded with the discord.Client.wait_for fix. Just stuck with the issue of implementing it
oh
Yeah haha
then open a help channel
I only just joined. How do I do that?
@Opal
Opal
@amber epoch
e! ```{import re
import long_responses as long
def get_response (user_input).
def message_probability(user_message, recognised_words, single_response)
message_certainty = 0
has_required_words = True
for word in user_message:
if word in recognised_words:
message_certainty = 1
percentage = float(message_certainty) / flowt(len(recognised_words))
split_response = re.split(r"\s+|[,;?!.-]\s*", user_input.lower()) response = check_all_messages(split_messages)
return response
if has_required_words or single_
return int(percentage+100)
else:
return 0
def check_all_messages(message):
highest_prob_list = {}
def response(bot_response,list_of_words, Single_response=false, required_words[]):
nonlocal highest_prob_list
highest_prob_list [bot_response] = message_probability(message, list_of_words, single_response, required_words)
#Response--------------------------------------------------
response("Hello!"["Hello", "hi", "sup","yoo", "hey","heyo"], signle_response= True)
response("I/'m doing fine,and you?",["how", "are", "doing"], required word=["how"])
best_match = max(highest_prob_list, key=highest_prob_list.get)
print(highest_prob_list)
return best_match
#Testing the response system
while True:
print "Bot: "+ get response(input("You: ")```
How to fix this code
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
!e ```
print("Hello, world")
```
I hope I could share you my screen
It would be much easier
@amber epoch
Oh
I get it
e! ```{import re
import long_responses as long
def get_response (user_input).
def message_probability(user_message, recognised_words, single_response)
message_certainty = 0
has_required_words = True
for word in user_message:
if word in recognised_words:
message_certainty = 1
percentage = float(message_certainty) / flowt(len(recognised_words))
split_response = re.split(r"\s+|[,;?!.-]\s*", user_input.lower()) response = check_all_messages(split_messages)
return response
if has_required_words or single_
return int(percentage+100)
else:
return 0
def check_all_messages(message):
highest_prob_list = {}
def response(bot_response,list_of_words, Single_response=false, required_words[]):
nonlocal highest_prob_list
highest_prob_list [bot_response] = message_probability(message, list_of_words, single_response, required_words)
#Response--------------------------------------------------
response("Hello!"["Hello", "hi", "sup","yoo", "hey","heyo"], signle_response= True)
response("I/'m doing fine,and you?",["how", "are", "doing"], required word=["how"])
best_match = max(highest_prob_list, key=highest_prob_list.get)
print(highest_prob_list)
return best_match
#Testing the response system
while True:
print "Bot: "+ get response(input("You: ")```
!e ```
print("Hello, world")
```
Why not wokr
Opal
Can you pls give an try with my code
!e py print("Hello, world.")
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
Hello, world.
Let me try
e! ```{import re
import long_responses as long
def get_response (user_input).
def message_probability(user_message, recognised_words, single_response)
message_certainty = 0
has_required_words = True
for word in user_message:
if word in recognised_words:
message_certainty = 1
percentage = float(message_certainty) / flowt(len(recognised_words))
split_response = re.split(r"\s+|[,;?!.-]\s*", user_input.lower()) response = check_all_messages(split_messages)
return response
if has_required_words or single_
return int(percentage+100)
else:
return 0
def check_all_messages(message):
highest_prob_list = {}
def response(bot_response,list_of_words, Single_response=false, required_words[]):
nonlocal highest_prob_list
highest_prob_list [bot_response] = message_probability(message, list_of_words, single_response, required_words)
#Response--------------------------------------------------
response("Hello!"["Hello", "hi", "sup","yoo", "hey","heyo"], signle_response= True)
response("I/'m doing fine,and you?",["how", "are", "doing"], required word=["how"])
best_match = max(highest_prob_list, key=highest_prob_list.get)
print(highest_prob_list)
return best_match
#Testing the response system
while True:
print "Bot: "+ get response(input("You: ")```
What I am doing worng
Why your audio is so low
I am new
I am building a; chat bot as you can see
@amber epoch
I want to verified soon
{import re
import long_responses as long
def get_response (user_input).
def message_probability(user_message, recognised_words, single_response)
message_certainty = 0
has_required_words = True
for word in user_message:
if word in recognised_words:
message_certainty = 1
percentage = float(message_certainty) / flowt(len(recognised_words))
split_response = re.split(r"\s+|[,;?!.-]\s*", user_input.lower()) response = check_all_messages(split_messages)
return response
if has_required_words or single_
return int(percentage+100)
else:
return 0
def check_all_messages(message):
highest_prob_list = {}
def response(bot_response,list_of_words, Single_response=false, required_words[]):
nonlocal highest_prob_list
highest_prob_list [bot_response] = message_probability(message, list_of_words, single_response, required_words)
#Response--------------------------------------------------
response("Hello!"["Hello", "hi", "sup","yoo", "hey","heyo"], signle_response= True)
response("I/'m doing fine,and you?",["how", "are", "doing"], required word=["how"])
best_match = max(highest_prob_list, key=highest_prob_list.get)
print(highest_prob_list)
return best_match
#Testing the response system
while True:
print "Bot: "+ get response(input("You: ")```
Let me try
def func():
...```
{import re
import long_responses as long
def get_response (user_input).
def message_probability(user_message, recognised_words, single_response)
message_certainty = 0
has_required_words = True
for word in user_message:
if word in recognised_words:
message_certainty = 1
percentage = float(message_certainty) / flowt(len(recognised_words))
split_response = re.split(r"\s+|[,;?!.-]\s*", user_input.lower()) response = check_all_messages(split_messages)
return response
if has_required_words or single_
return int(percentage+100)
else:
return 0
def check_all_messages(message):
highest_prob_list = {}
def response(bot_response,list_of_words, Single_response=false, required_words[]):
nonlocal highest_prob_list
highest_prob_list [bot_response] = message_probability(message, list_of_words, single_response, required_words)
#Response--------------------------------------------------
response("Hello!"["Hello", "hi", "sup","yoo", "hey","heyo"], signle_response= True)
response("I/'m doing fine,and you?",["how", "are", "doing"], required word=["how"])
best_match = max(highest_prob_list, key=highest_prob_list.get)
print(highest_prob_list)
return best_match
#Testing the response system
while True:
print "Bot: "+ get response(input("You: ")```
!e```py
{import re
import long_responses as long
def get_response (user_input).
def message_probability(user_message, recognised_words, single_response)
message_certainty = 0
has_required_words = True
for word in user_message:
if word in recognised_words:
message_certainty = 1
percentage = float(message_certainty) / flowt(len(recognised_words))
split_response = re.split(r"\s+|[,;?!.-]\s*", user_input.lower()) response = check_all_messages(split_messages)
return response
if has_required_words or single_
return int(percentage+100)
else:
return 0
def check_all_messages(message):
highest_prob_list = {}
def response(bot_response,list_of_words, Single_response=false, required_words[]):
nonlocal highest_prob_list
highest_prob_list [bot_response] = message_probability(message, list_of_words, single_response, required_words)
#Response--------------------------------------------------
response("Hello!"["Hello", "hi", "sup","yoo", "hey","heyo"], signle_response= True)
response("I/'m doing fine,and you?",["how", "are", "doing"], required word=["how"])
best_match = max(highest_prob_list, key=highest_prob_list.get)
print(highest_prob_list)
return best_match
#Testing the response system
while True:
print "Bot: "+ get response(input("You: ")```
{import re
import long_responses as long
def get_response (user_input).
def message_probability(user_message, recognised_words, single_response)
message_certainty = 0
has_required_words = True
for word in user_message:
if word in recognised_words:
message_certainty = 1
percentage = float(message_certainty) / flowt(len(recognised_words))
split_response = re.split(r"\s+|[,;?!.-]\s*", user_input.lower()) response = check_all_messages(split_messages)
return response
if has_required_words or single_
return int(percentage+100)
else:
return 0
def check_all_messages(message):
highest_prob_list = {}
def response(bot_response,list_of_words, Single_response=false, required_words[]):
nonlocal highest_prob_list
highest_prob_list [bot_response] = message_probability(message, list_of_words, single_response, required_words)
#Response--------------------------------------------------
response("Hello!"["Hello", "hi", "sup","yoo", "hey","heyo"], signle_response= True)
response("I/'m doing fine,and you?",["how", "are", "doing"], required word=["how"])
best_match = max(highest_prob_list, key=highest_prob_list.get)
print(highest_prob_list)
return best_match
#Testing the response system
while True:
print "Bot: "+ get response(input("You: ")```
Why not work
I Got to go
Cya later
Sorry for wasting your Precious time!
We'll get you sorted out. π
It might be you?
If I get voice verified I will be happy
Others seem to hear me fine.
I kept my volume is maxed
Nevermind
But still facing tons of problems
Epic
I want show you my code badly
But there no source
@main solar Refrain from attempting to ping @everyone or @here. It's very inconsiderate.
sorry bymistake
PATH
grep "JAVA_HOME" *
import datetime
import pandas as pd
from binance.client import Client
daysneeded = 150
binance_api_key = 'key'
binance_api_secret = 'key'
client = Client(api_key=binance_api_key, api_secret=binance_api_secret)
global epoch
symbols = ['ETHUSDT', 'BTCUSDT', 'XRPUSDT']
org_columns = ['open',
'high', 'low', 'close', 'volume', 'close_time', 'quote_av',
'trades', 'tb_base_av', 'tb_quote_av', 'ignore']
fromdate = str(datetime.datetime.now() - datetime.timedelta(days=daysneeded))
todate = str(datetime.datetime.now())
fromdate = fromdate.split()
fromdate = fromdate[0].split("-")
fromdate = (fromdate[2]+','+fromdate[1]+','+fromdate[0])
todate = todate.split()
todate = todate[0].split("-")
todate = (todate[2]+','+todate[1]+','+todate[0])
for i in range(len(symbols)):
try:
klines = client.get_historical_klines(
(symbols[i]), Client.KLINE_INTERVAL_1DAY, fromdate, todate )
klines_len = len(klines)
if klines_len == 0:
print('Failed to download data for ', (symbols[i]))
new_columns = [item + '_' + (symbols[i]) for item in org_columns]
new_columns.insert(0, 'timestamp')
DF = pd.DataFrame(klines,
columns=new_columns)
DF['timestamp'] = pd.to_datetime(DF['timestamp'], unit='ms')
DF.set_index('timestamp', inplace=True)
print(len(DF))
DF.to_csv(symbols[i])
print('Downloaded data for ', (symbols[i]))
except:
print('*** Invaled symbol:', (symbols[i]), '! ***')
could somehone help me with .write()
basically creating a new file and writing in it, whiting the python program
@cedar torrent Im sorta new but i think you do a open() function then a .write() with the same variable
file1 = open("myfile.txt", "w") # write mode
file1.write("Tomorrow \n")
Writing to file
with open("myfile.txt", "w") as file1:
# Writing data to a file
file1.write("Hello \n")
file1.writelines(L)
How to fix this
are you doing math here
DF.to_csv(r'C:\\Users\\Johnd\Desktop\\test!!!!\\data\\', symbols[i])
!d pandas.DataFrame.to_csv
DataFrame.to_csv(path_or_buf=None, sep=',', na_rep='', float_format=None, columns=None, header=True, index=True, index_label=None, mode='w', encoding=None, compression='infer', ...)```
Write object to a comma-separated values (csv) file.
You don't have a filename in this path
Oh maybe.
What is symbols[i]?
num1 = int(input("Enter a number : "))
bale = input("bale prajh +,-,*,/")
num2 = int(input("Enter second number : "))
apotelesma = 0
if bale = ("+") :
apotelesma = num1 + num2
elif bale = ("-") :
apotelesma = num1 - num2
elif bale = ("*")
apotelesma = num1 * num2
else :
apotelesma = num1 / num2
what did i do wrong
def cov_naive(X):
"""Compute the sample covariance for a dataset by iterating over the dataset.
Args:
X: `ndarray` of shape (N, D) representing the dataset. N
is the size of the dataset and D is the dimensionality of the dataset.
Returns:
ndarray: ndarray with shape (D, D), the sample covariance of the dataset `X`.
"""
# YOUR CODE HERE
### Uncomment and edit the code below
N, D = X.shape
# ### Edit the code below to compute the covariance matrix by iterating over the dataset.
covariance = np.zeros((D, D))
# ### Update covariance
# ###
# return covariance
``` Can someone help me to write covariance of a matrix algo by changing above code
pls guys how can i do voice verification
In the Python REPL, it'll give you the status code, but if you run it through a script it won't print anything
@main solar Are the headers being passed to get?
@novel trench i love your profile picture
headers = {"User-Agent":"TTECA/0.1/LizzieTheWitch"}
I meant
requests.get("<url-here>", headers={"User-Agent":"TTECA/0.1/LizzieTheWitch"})
Just setting headers like that won't do anything
no
Guys, Who will help with the problem, you need to solve it mathematically and tell it analytically. I will show the condition?
i am doing my project in repl
so when i import google trans it auto installs the version 2.4.0
but i need 3.1.0a0
now when i do pip install googletrans == 3.1.0a0
it works well
but after a while when it refreshes it self the import causes a auto installation of version 2.4.0
so import googletrans gets unrecognized
and the whole code stops working
?
any helps?
Hi
hello
hi i need help learning python