workspace
stringclasses
1 value
channel
stringclasses
1 value
sentences
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
sentence_id
stringlengths
44
53
timestamp
float64
1.5B
1.56B
__index_level_0__
int64
0
106k
pythondev
help
in practice, there is no "user.is_admin" for them
2017-09-01T05:35:08.000302
Denna
pythondev_help_Denna_2017-09-01T05:35:08.000302
1,504,244,108.000302
91,703
pythondev
help
i mean, the real input is, "is_admin", and i change it with "self.request.user.is_admin" like thing
2017-09-01T05:35:35.000362
Denna
pythondev_help_Denna_2017-09-01T05:35:35.000362
1,504,244,135.000362
91,704
pythondev
help
If you truly do have an arbitrary list of completely unrelated conditions then I fear that there is very little that can be done to improve your situation
2017-09-01T05:36:07.000107
Gabriele
pythondev_help_Gabriele_2017-09-01T05:36:07.000107
1,504,244,167.000107
91,705
pythondev
help
fair enough
2017-09-01T05:36:24.000100
Denna
pythondev_help_Denna_2017-09-01T05:36:24.000100
1,504,244,184.0001
91,706
pythondev
help
thanks btw
2017-09-01T05:36:36.000042
Denna
pythondev_help_Denna_2017-09-01T05:36:36.000042
1,504,244,196.000042
91,707
pythondev
help
If you can simplify the conditions in some way - e.g. to make them all into conjunctions (everything must be true) - then you can make it more data-driven
2017-09-01T05:37:04.000259
Gabriele
pythondev_help_Gabriele_2017-09-01T05:37:04.000259
1,504,244,224.000259
91,708
pythondev
help
hm, in this case we're sorting `seq` first so we're not getting the first value of `seq` as much as "exactly one value from seq", but it doesn't matter for me at the moment
2017-09-01T05:37:15.000372
Lanita
pythondev_help_Lanita_2017-09-01T05:37:15.000372
1,504,244,235.000372
91,709
pythondev
help
I'm really not sure how to change it right now
2017-09-01T05:37:51.000221
Suellen
pythondev_help_Suellen_2017-09-01T05:37:51.000221
1,504,244,271.000221
91,710
pythondev
help
Hello everyone, i have a question about class initialization so i have a class that i am importing into a main .py file. Lets call it imp_mod. i have the init defined so that when i call imp_mod.ClassName() it runs the init. but it also seems to be running the rest of the methods inside of the class. Why would it be doing that?
2017-09-01T10:28:34.000720
Pura
pythondev_help_Pura_2017-09-01T10:28:34.000720
1,504,261,714.00072
91,711
pythondev
help
so you have something like ``` class ImpMod: def __init__(self): # some code here ```
2017-09-01T10:30:17.000432
Meg
pythondev_help_Meg_2017-09-01T10:30:17.000432
1,504,261,817.000432
91,712
pythondev
help
and you’re calling it via `imp_mode.ImpMod()`?
2017-09-01T10:30:43.000024
Meg
pythondev_help_Meg_2017-09-01T10:30:43.000024
1,504,261,843.000024
91,713
pythondev
help
yes
2017-09-01T10:31:15.000627
Pura
pythondev_help_Pura_2017-09-01T10:31:15.000627
1,504,261,875.000627
91,714
pythondev
help
what do you have defined in the `__init__`?
2017-09-01T10:33:38.000248
Meg
pythondev_help_Meg_2017-09-01T10:33:38.000248
1,504,262,018.000248
91,715
pythondev
help
underneath that i have a function that runs the self.desktop_driver called def search(self) and it runs a loop. When i call imp_mod.ImpBot() it seems like it is running that search function that isnt being called in init
2017-09-01T10:37:45.000332
Pura
pythondev_help_Pura_2017-09-01T10:37:45.000332
1,504,262,265.000332
91,716
pythondev
help
You don't seem _sure_ though. Have you tried putting a print statement in that search function to confirm, one way or the other?
2017-09-01T10:39:55.000078
Gabriele
pythondev_help_Gabriele_2017-09-01T10:39:55.000078
1,504,262,395.000078
91,717
pythondev
help
i just did as a sanity check, and my print statement inside search does appear
2017-09-01T10:40:44.000222
Pura
pythondev_help_Pura_2017-09-01T10:40:44.000222
1,504,262,444.000222
91,718
pythondev
help
might it be because in the main function i am assigning it to a variable?
2017-09-01T10:41:43.000060
Pura
pythondev_help_Pura_2017-09-01T10:41:43.000060
1,504,262,503.00006
91,719
pythondev
help
would you mind adding the entire `ImpBot class`?
2017-09-01T10:41:51.000073
Meg
pythondev_help_Meg_2017-09-01T10:41:51.000073
1,504,262,511.000073
91,720
pythondev
help
You'll have to show the code
2017-09-01T10:41:52.000197
Gabriele
pythondev_help_Gabriele_2017-09-01T10:41:52.000197
1,504,262,512.000197
91,721
pythondev
help
bot = imp_mod.ImpBot()
2017-09-01T10:42:00.000014
Pura
pythondev_help_Pura_2017-09-01T10:42:00.000014
1,504,262,520.000014
91,722
pythondev
help
sure
2017-09-01T10:42:00.000649
Pura
pythondev_help_Pura_2017-09-01T10:42:00.000649
1,504,262,520.000649
91,723
pythondev
help
does it also happen when you do ``` from imp_mod import ImpBot bot = ImpBot() ```
2017-09-01T10:43:43.000364
Meg
pythondev_help_Meg_2017-09-01T10:43:43.000364
1,504,262,623.000364
91,724
pythondev
help
ill see
2017-09-01T10:44:45.000587
Pura
pythondev_help_Pura_2017-09-01T10:44:45.000587
1,504,262,685.000587
91,725
pythondev
help
yes it still does it
2017-09-01T10:45:28.000224
Pura
pythondev_help_Pura_2017-09-01T10:45:28.000224
1,504,262,728.000224
91,726
pythondev
help
what is `search_terms`
2017-09-01T10:45:57.000204
Meg
pythondev_help_Meg_2017-09-01T10:45:57.000204
1,504,262,757.000204
91,727
pythondev
help
and where are you declaring it
2017-09-01T10:46:01.000753
Meg
pythondev_help_Meg_2017-09-01T10:46:01.000753
1,504,262,761.000753
91,728
pythondev
help
search terms is an array of strings that lives outside of the class but in the same file
2017-09-01T10:46:39.000394
Pura
pythondev_help_Pura_2017-09-01T10:46:39.000394
1,504,262,799.000394
91,729
pythondev
help
Most likely it's the stuff outside the class that is causing this problem
2017-09-01T10:46:58.000294
Gabriele
pythondev_help_Gabriele_2017-09-01T10:46:58.000294
1,504,262,818.000294
91,730
pythondev
help
ok
2017-09-01T10:47:03.000571
Pura
pythondev_help_Pura_2017-09-01T10:47:03.000571
1,504,262,823.000571
91,731
pythondev
help
perhaps something is making an instance and calling .search()?
2017-09-01T10:47:15.000784
Gabriele
pythondev_help_Gabriele_2017-09-01T10:47:15.000784
1,504,262,835.000784
91,732
pythondev
help
so...i have a tkinter button
2017-09-01T10:47:37.000663
Pura
pythondev_help_Pura_2017-09-01T10:47:37.000663
1,504,262,857.000663
91,733
pythondev
help
ill put that file in
2017-09-01T10:47:45.000083
Pura
pythondev_help_Pura_2017-09-01T10:47:45.000083
1,504,262,865.000083
91,734
pythondev
help
h/o
2017-09-01T10:47:46.000345
Pura
pythondev_help_Pura_2017-09-01T10:47:46.000345
1,504,262,866.000345
91,735
pythondev
help
the command arg is set to call the search
2017-09-01T10:48:05.000307
Pura
pythondev_help_Pura_2017-09-01T10:48:05.000307
1,504,262,885.000307
91,736
pythondev
help
so that may be it, but idk why it is running it before the Tkinter menu even appears
2017-09-01T10:48:29.000438
Pura
pythondev_help_Pura_2017-09-01T10:48:29.000438
1,504,262,909.000438
91,737
pythondev
help
perhaps it's set up wrong. sometimes people put in the `()` in the UI code when they shouldn't
2017-09-01T10:48:54.000478
Gabriele
pythondev_help_Gabriele_2017-09-01T10:48:54.000478
1,504,262,934.000478
91,738
pythondev
help
ohhhh
2017-09-01T10:49:52.000210
Pura
pythondev_help_Pura_2017-09-01T10:49:52.000210
1,504,262,992.00021
91,739
pythondev
help
so im doing .search()
2017-09-01T10:49:57.000077
Pura
pythondev_help_Pura_2017-09-01T10:49:57.000077
1,504,262,997.000077
91,740
pythondev
help
exactly
2017-09-01T10:50:00.000498
Gabriele
pythondev_help_Gabriele_2017-09-01T10:50:00.000498
1,504,263,000.000498
91,741
pythondev
help
when it should just be .search
2017-09-01T10:50:02.000695
Pura
pythondev_help_Pura_2017-09-01T10:50:02.000695
1,504,263,002.000695
91,742
pythondev
help
ohhhhhh
2017-09-01T10:50:06.000379
Pura
pythondev_help_Pura_2017-09-01T10:50:06.000379
1,504,263,006.000379
91,743
pythondev
help
WORKS
2017-09-01T10:50:32.000157
Pura
pythondev_help_Pura_2017-09-01T10:50:32.000157
1,504,263,032.000157
91,744
pythondev
help
thank you, i didnt know that that would make a difference
2017-09-01T10:50:40.000403
Pura
pythondev_help_Pura_2017-09-01T10:50:40.000403
1,504,263,040.000403
91,745
pythondev
help
glad we could help
2017-09-01T10:50:46.000390
Gabriele
pythondev_help_Gabriele_2017-09-01T10:50:46.000390
1,504,263,046.00039
91,746
pythondev
help
<@Gabriele> <@Meg> :+1:
2017-09-01T10:51:31.000321
Pura
pythondev_help_Pura_2017-09-01T10:51:31.000321
1,504,263,091.000321
91,747
pythondev
help
so that is a general python rule then? that if it has the () at the end it will run it regardless?
2017-09-01T10:51:50.000305
Pura
pythondev_help_Pura_2017-09-01T10:51:50.000305
1,504,263,110.000305
91,748
pythondev
help
depends, really
2017-09-01T10:52:02.000647
Meg
pythondev_help_Meg_2017-09-01T10:52:02.000647
1,504,263,122.000647
91,749
pythondev
help
is it being passed as an argument to a method that is expecting a function or method?
2017-09-01T10:52:26.000625
Meg
pythondev_help_Meg_2017-09-01T10:52:26.000625
1,504,263,146.000625
91,750
pythondev
help
or is it to be executed at that point?
2017-09-01T10:52:36.000224
Meg
pythondev_help_Meg_2017-09-01T10:52:36.000224
1,504,263,156.000224
91,751
pythondev
help
the `()` means 'call this function immediately'
2017-09-01T10:52:49.000430
Gabriele
pythondev_help_Gabriele_2017-09-01T10:52:49.000430
1,504,263,169.00043
91,752
pythondev
help
so you're assigning the result of that function call to `command`
2017-09-01T10:53:02.000621
Gabriele
pythondev_help_Gabriele_2017-09-01T10:53:02.000621
1,504,263,182.000621
91,753
pythondev
help
ahhhh
2017-09-01T10:53:11.000266
Pura
pythondev_help_Pura_2017-09-01T10:53:11.000266
1,504,263,191.000266
91,754
pythondev
help
when you really want to assign the _function itself_ to `command`
2017-09-01T10:53:13.000103
Gabriele
pythondev_help_Gabriele_2017-09-01T10:53:13.000103
1,504,263,193.000103
91,755
pythondev
help
right, makes sense to me
2017-09-01T10:53:27.000108
Pura
pythondev_help_Pura_2017-09-01T10:53:27.000108
1,504,263,207.000108
91,756
pythondev
help
it shouldnt be called instantly, since it is a button and should only be called when pressed
2017-09-01T10:53:50.000075
Pura
pythondev_help_Pura_2017-09-01T10:53:50.000075
1,504,263,230.000075
91,757
pythondev
help
so no ()
2017-09-01T10:53:55.000108
Pura
pythondev_help_Pura_2017-09-01T10:53:55.000108
1,504,263,235.000108
91,758
pythondev
help
got it!
2017-09-01T10:53:58.000730
Pura
pythondev_help_Pura_2017-09-01T10:53:58.000730
1,504,263,238.00073
91,759
pythondev
help
however, there are places where you do need the function to be called right away
2017-09-01T10:55:42.000203
Meg
pythondev_help_Meg_2017-09-01T10:55:42.000203
1,504,263,342.000203
91,760
pythondev
help
for example, django url definitions with class based views
2017-09-01T10:55:55.000121
Meg
pythondev_help_Meg_2017-09-01T10:55:55.000121
1,504,263,355.000121
91,761
pythondev
help
you have to use the `.as_view()` call when mapping a view class to a URL, or it won’t work
2017-09-01T10:56:16.000087
Meg
pythondev_help_Meg_2017-09-01T10:56:16.000087
1,504,263,376.000087
91,762
pythondev
help
yeah, sometimes you have to call a function which returns the function you want to assign. functions returning functions. :slightly_smiling_face:
2017-09-01T10:56:46.000056
Gabriele
pythondev_help_Gabriele_2017-09-01T10:56:46.000056
1,504,263,406.000056
91,763
pythondev
help
functionception
2017-09-01T10:56:57.000106
Meg
pythondev_help_Meg_2017-09-01T10:56:57.000106
1,504,263,417.000106
91,764
pythondev
help
<@Gabriele> just found out that, the keyword is "rule engine"
2017-09-01T11:31:44.000327
Denna
pythondev_help_Denna_2017-09-01T11:31:44.000327
1,504,265,504.000327
91,765
pythondev
help
i'm looking for pyke now
2017-09-01T11:32:00.000138
Denna
pythondev_help_Denna_2017-09-01T11:32:00.000138
1,504,265,520.000138
91,766
pythondev
help
Has anyone here built a Python .pex distributable file -- need help in doing so
2017-09-01T13:13:54.000377
Bok
pythondev_help_Bok_2017-09-01T13:13:54.000377
1,504,271,634.000377
91,767
pythondev
help
hey guys need ur help understanding why my function does not work…
2017-09-01T13:53:56.000354
Margareta
pythondev_help_Margareta_2017-09-01T13:53:56.000354
1,504,274,036.000354
91,768
pythondev
help
<@Margareta>, verify that `created_time` is generating some values that are &gt; 10 days ago.
2017-09-01T14:04:56.000074
Winnifred
pythondev_help_Winnifred_2017-09-01T14:04:56.000074
1,504,274,696.000074
91,769
pythondev
help
w.r.t `current`
2017-09-01T14:05:18.000533
Winnifred
pythondev_help_Winnifred_2017-09-01T14:05:18.000533
1,504,274,718.000533
91,770
pythondev
help
Maybe that 'platform' doesn't deserve you. :slightly_smiling_face: We, here, are a `community`, not a platform.
2017-09-01T14:06:25.000172
Deedee
pythondev_help_Deedee_2017-09-01T14:06:25.000172
1,504,274,785.000172
91,771
pythondev
help
<@Margareta>, it also could be that you’re passing `path` into `os.path.isfile` instead of `full_path`.
2017-09-01T14:07:06.000095
Winnifred
pythondev_help_Winnifred_2017-09-01T14:07:06.000095
1,504,274,826.000095
91,772
pythondev
help
<@Winnifred> bingo that was the issue i didnt catch that!
2017-09-01T14:10:57.000157
Margareta
pythondev_help_Margareta_2017-09-01T14:10:57.000157
1,504,275,057.000157
91,773
pythondev
help
thanks <@Winnifred> !!!!
2017-09-01T14:11:13.000352
Margareta
pythondev_help_Margareta_2017-09-01T14:11:13.000352
1,504,275,073.000352
91,774
pythondev
help
w00t!
2017-09-01T14:11:55.000404
Winnifred
pythondev_help_Winnifred_2017-09-01T14:11:55.000404
1,504,275,115.000404
91,775
pythondev
help
<@Winnifred> :taco:
2017-09-01T15:56:07.000164
Suellen
pythondev_help_Suellen_2017-09-01T15:56:07.000164
1,504,281,367.000164
91,776
pythondev
help
TY for keeping tacos alive, <@Suellen>
2017-09-01T16:15:18.000393
Winnifred
pythondev_help_Winnifred_2017-09-01T16:15:18.000393
1,504,282,518.000393
91,777
pythondev
help
<@Suellen> :taco: :wink:
2017-09-01T16:19:11.000185
Beula
pythondev_help_Beula_2017-09-01T16:19:11.000185
1,504,282,751.000185
91,778
pythondev
help
we're playing "hot taco" :slightly_smiling_face:
2017-09-01T16:30:58.000098
Suellen
pythondev_help_Suellen_2017-09-01T16:30:58.000098
1,504,283,458.000098
91,779
pythondev
help
Anyone know how to get x days before now using isoformat? This is what I have, ''' from datetime import datetime, timedelta print datetime.now().isoformat() - timedelta(days=2) '''
2017-09-01T18:47:22.000100
Eladia
pythondev_help_Eladia_2017-09-01T18:47:22.000100
1,504,291,642.0001
91,780
pythondev
help
` ``` `
2017-09-01T18:49:18.000108
Suellen
pythondev_help_Suellen_2017-09-01T18:49:18.000108
1,504,291,758.000108
91,781
pythondev
help
it's backticks
2017-09-01T18:49:22.000092
Suellen
pythondev_help_Suellen_2017-09-01T18:49:22.000092
1,504,291,762.000092
91,782
pythondev
help
ok, so, `.isoformat()` returns a string, and you can't subtract anything from a string
2017-09-01T18:49:52.000070
Suellen
pythondev_help_Suellen_2017-09-01T18:49:52.000070
1,504,291,792.00007
91,783
pythondev
help
what you should do is perform all date-related operations before formatting, and then use isoformat
2017-09-01T18:50:10.000063
Suellen
pythondev_help_Suellen_2017-09-01T18:50:10.000063
1,504,291,810.000063
91,784
pythondev
help
for example you need a date 2 days before today:
2017-09-01T18:50:23.000050
Suellen
pythondev_help_Suellen_2017-09-01T18:50:23.000050
1,504,291,823.00005
91,785
pythondev
help
``` &gt;&gt;&gt; past_date = datetime.now() - timedelta(days=2) &gt;&gt;&gt; past_date.isoformat() '2017-08-31T01:50:45.124580' ```
2017-09-01T18:50:54.000062
Suellen
pythondev_help_Suellen_2017-09-01T18:50:54.000062
1,504,291,854.000062
91,786
pythondev
help
in one expression: ``` &gt;&gt;&gt; print((datetime.now() - timedelta(days=2)).isoformat()) 2017-08-31T01:51:22.652891 ```
2017-09-01T18:51:34.000134
Suellen
pythondev_help_Suellen_2017-09-01T18:51:34.000134
1,504,291,894.000134
91,787
pythondev
help
is anyone familiar with Behave Testing ?
2017-09-01T19:37:01.000075
Salome
pythondev_help_Salome_2017-09-01T19:37:01.000075
1,504,294,621.000075
91,788
pythondev
help
Hey guys. I screwed up some stuff when hacking and slashing some name changes of classes and file names. How can I go back to my last commit/push ?
2017-09-02T06:03:46.000013
Gisela
pythondev_help_Gisela_2017-09-02T06:03:46.000013
1,504,332,226.000013
91,789
pythondev
help
I haven't added anything or commited since last night and I wanna to back to that point.
2017-09-02T06:04:17.000033
Gisela
pythondev_help_Gisela_2017-09-02T06:04:17.000033
1,504,332,257.000033
91,790
pythondev
help
Delete everything and clone the repo?
2017-09-02T06:04:51.000002
Gisela
pythondev_help_Gisela_2017-09-02T06:04:51.000002
1,504,332,291.000002
91,791
pythondev
help
Hi, does anyone have any experience in using aiohttp 2.0+ vs. sanic as a HTTP server?
2017-09-02T06:05:20.000046
Adalberto
pythondev_help_Adalberto_2017-09-02T06:05:20.000046
1,504,332,320.000046
91,792
pythondev
help
<@Gisela> if you haven't commited: `git reset &amp;&amp; git checkout`
2017-09-02T06:06:16.000050
Suellen
pythondev_help_Suellen_2017-09-02T06:06:16.000050
1,504,332,376.00005
91,793
pythondev
help
Thanks! checkout was what I was missing!
2017-09-02T06:06:32.000055
Gisela
pythondev_help_Gisela_2017-09-02T06:06:32.000055
1,504,332,392.000055
91,794
pythondev
help
<@Adalberto> I use aiohttp and it get the job done. didn't try sanic
2017-09-02T06:07:20.000040
Ciera
pythondev_help_Ciera_2017-09-02T06:07:20.000040
1,504,332,440.00004
91,795
pythondev
help
sanic is a microframework, and as such it's easier to work with
2017-09-02T06:07:49.000017
Suellen
pythondev_help_Suellen_2017-09-02T06:07:49.000017
1,504,332,469.000017
91,796
pythondev
help
<@Ciera> do you use it for a full webserver or only for slower endpoints? Are you using it with an ORM?
2017-09-02T06:09:08.000035
Adalberto
pythondev_help_Adalberto_2017-09-02T06:09:08.000035
1,504,332,548.000035
91,797
pythondev
help
we use it for all our API. Without any ORM pure sql
2017-09-02T06:09:52.000071
Ciera
pythondev_help_Ciera_2017-09-02T06:09:52.000071
1,504,332,592.000071
91,798
pythondev
help
OK, and just a very basic async question: what happens if I try to use a blocking ORM like Sqlalchemy ORM in an async app? As normal db requests are so fast, would it be a problem that it blocks?
2017-09-02T06:22:18.000024
Adalberto
pythondev_help_Adalberto_2017-09-02T06:22:18.000024
1,504,333,338.000024
91,799
pythondev
help
Well it's best to use a non blocking one obviously. There is some work on making sqlalchemy work with asyncio
2017-09-02T06:28:07.000044
Ciera
pythondev_help_Ciera_2017-09-02T06:28:07.000044
1,504,333,687.000044
91,800
pythondev
help
for example this <https://github.com/CanopyTax/asyncpgsa> by <@Signe> but it's only for sqlalchemy core
2017-09-02T06:28:24.000057
Ciera
pythondev_help_Ciera_2017-09-02T06:28:24.000057
1,504,333,704.000057
91,801
pythondev
help
wait, what parts of ORM are inherently blocking?
2017-09-02T06:29:32.000060
Suellen
pythondev_help_Suellen_2017-09-02T06:29:32.000060
1,504,333,772.00006
91,802