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
Chances are the debugger is not clear enough, rather than that piece of code being incorrect?
2017-12-20T11:21:20.000216
Ashlea
pythondev_help_Ashlea_2017-12-20T11:21:20.000216
1,513,768,880.000216
105,303
pythondev
help
Ok the problem is the function `getFirstRec` is not returning anything but you are splitting the return values which has an implicit iteration
2017-12-20T11:22:47.000262
Antionette
pythondev_help_Antionette_2017-12-20T11:22:47.000262
1,513,768,967.000262
105,304
pythondev
help
So none of your if/elif statements are evaluating to true for some reason
2017-12-20T11:23:39.000158
Antionette
pythondev_help_Antionette_2017-12-20T11:23:39.000158
1,513,769,019.000158
105,305
pythondev
help
So we're missing a return statement then.
2017-12-20T11:23:58.000847
Ashlea
pythondev_help_Ashlea_2017-12-20T11:23:58.000847
1,513,769,038.000847
105,306
pythondev
help
well with that part you said was commented out
2017-12-20T11:24:18.000687
Antionette
pythondev_help_Antionette_2017-12-20T11:24:18.000687
1,513,769,058.000687
105,307
pythondev
help
that else should always get run
2017-12-20T11:24:26.000629
Antionette
pythondev_help_Antionette_2017-12-20T11:24:26.000629
1,513,769,066.000629
105,308
pythondev
help
are you sure the error was the same in that casE?
2017-12-20T11:24:32.000592
Antionette
pythondev_help_Antionette_2017-12-20T11:24:32.000592
1,513,769,072.000592
105,309
pythondev
help
I changed that part based on <@Ciera>’s comment.
2017-12-20T11:24:37.000338
Ashlea
pythondev_help_Ashlea_2017-12-20T11:24:37.000338
1,513,769,077.000338
105,310
pythondev
help
``` if len(node): for child in node: found, content = self.getFirstRec( target, child, isregex, isdeepsearch) if found: return True, content return False, '' else: return False, '' ```
2017-12-20T11:24:57.000340
Ashlea
pythondev_help_Ashlea_2017-12-20T11:24:57.000340
1,513,769,097.00034
105,311
pythondev
help
It's no longer commented out, but the error remains the same.
2017-12-20T11:25:33.000259
Ashlea
pythondev_help_Ashlea_2017-12-20T11:25:33.000259
1,513,769,133.000259
105,312
pythondev
help
what if you comment it out and just have `return False, ''`
2017-12-20T11:26:27.000644
Antionette
pythondev_help_Antionette_2017-12-20T11:26:27.000644
1,513,769,187.000644
105,313
pythondev
help
Oh it must be me being rusty. Have been away from coding for some time. Started recently again. What <@Ciera> pointed out, I fixed that, but I must've been running the test while you and I were talking without saving the changes. It no longer throws that error now.
2017-12-20T11:30:08.000231
Ashlea
pythondev_help_Ashlea_2017-12-20T11:30:08.000231
1,513,769,408.000231
105,314
pythondev
help
Comparing my code now with the snippet I posted, the only change is that else block that was missing.
2017-12-20T11:31:58.000161
Ashlea
pythondev_help_Ashlea_2017-12-20T11:31:58.000161
1,513,769,518.000161
105,315
pythondev
help
So the function indeed must've been returning nothing, since none of the if statements equated to True.
2017-12-20T11:32:40.000492
Ashlea
pythondev_help_Ashlea_2017-12-20T11:32:40.000492
1,513,769,560.000492
105,316
pythondev
help
I'm new to Python, combine that with some rustiness and this happens. <@Ciera> <@Antionette> Thanks a lot for the help guys.
2017-12-20T11:34:01.000507
Ashlea
pythondev_help_Ashlea_2017-12-20T11:34:01.000507
1,513,769,641.000507
105,317
pythondev
help
:+1:
2017-12-20T11:37:51.000184
Antionette
pythondev_help_Antionette_2017-12-20T11:37:51.000184
1,513,769,871.000184
105,318
pythondev
help
glad to see it's fixed <@Ashlea>. Just the time to get home :smile:
2017-12-20T11:52:15.000522
Ciera
pythondev_help_Ciera_2017-12-20T11:52:15.000522
1,513,770,735.000522
105,319
pythondev
help
<@Antionette> :taco:
2017-12-20T11:52:21.000392
Ciera
pythondev_help_Ciera_2017-12-20T11:52:21.000392
1,513,770,741.000392
105,320
pythondev
help
hey guys
2017-12-20T12:48:28.000003
Clarice
pythondev_help_Clarice_2017-12-20T12:48:28.000003
1,513,774,108.000003
105,321
pythondev
help
I am writing an upsert statement for SQLAlchemy - PostgreSQL
2017-12-20T12:48:54.000435
Clarice
pythondev_help_Clarice_2017-12-20T12:48:54.000435
1,513,774,134.000435
105,322
pythondev
help
oh man i am so new to python... `never_update=('created_at',)` is that comma wierd or?
2017-12-20T12:50:49.000354
Ozie
pythondev_help_Ozie_2017-12-20T12:50:49.000354
1,513,774,249.000354
105,323
pythondev
help
that makes it a tuple
2017-12-20T12:51:05.000512
Frieda
pythondev_help_Frieda_2017-12-20T12:51:05.000512
1,513,774,265.000512
105,324
pythondev
help
neato
2017-12-20T12:51:10.000061
Ozie
pythondev_help_Ozie_2017-12-20T12:51:10.000061
1,513,774,270.000061
105,325
pythondev
help
but you don't want `records=[]`
2017-12-20T12:51:11.000439
Frieda
pythondev_help_Frieda_2017-12-20T12:51:11.000439
1,513,774,271.000439
105,326
pythondev
help
don't use mutable types as default arguments
2017-12-20T12:51:22.000649
Frieda
pythondev_help_Frieda_2017-12-20T12:51:22.000649
1,513,774,282.000649
105,327
pythondev
help
<@Frieda> yup, spot on
2017-12-20T12:51:39.000141
Clarice
pythondev_help_Clarice_2017-12-20T12:51:39.000141
1,513,774,299.000141
105,328
pythondev
help
<@Frieda> mentioned a file: <https://pythondev.slack.com/files/U700PV23F/F8HC4UWQ7/-.py|-.py>.
2017-12-20T12:53:56.000437
Frieda
pythondev_help_Frieda_2017-12-20T12:53:56.000437
1,513,774,436.000437
105,329
pythondev
help
there's actually a lot of python underneath that <https://wiki.python.org/moin/TupleSyntax>
2017-12-20T12:56:07.000093
Seema
pythondev_help_Seema_2017-12-20T12:56:07.000093
1,513,774,567.000093
105,330
pythondev
help
like some things are optional, that commas create tuples, and tuple assignment
2017-12-20T12:56:54.000054
Seema
pythondev_help_Seema_2017-12-20T12:56:54.000054
1,513,774,614.000054
105,331
pythondev
help
nice
2017-12-20T12:59:12.000201
Ozie
pythondev_help_Ozie_2017-12-20T12:59:12.000201
1,513,774,752.000201
105,332
pythondev
help
looks more or less OK, but it's hard to say
2017-12-20T13:09:53.000416
Suellen
pythondev_help_Suellen_2017-12-20T13:09:53.000416
1,513,775,393.000416
105,333
pythondev
help
if it's a classic upsert postgres as that builtin
2017-12-20T13:09:56.000438
Ciera
pythondev_help_Ciera_2017-12-20T13:09:56.000438
1,513,775,396.000438
105,334
pythondev
help
better test it :smiling_imp:
2017-12-20T13:10:08.000076
Suellen
pythondev_help_Suellen_2017-12-20T13:10:08.000076
1,513,775,408.000076
105,335
pythondev
help
Can someone verify that my raw post request is equivalent to the python post?
2017-12-20T13:14:27.000266
Glinda
pythondev_help_Glinda_2017-12-20T13:14:27.000266
1,513,775,667.000266
105,336
pythondev
help
```import requests ''' POST /Service.asmx/GetDiagnosticFile HTTP/1.1 Host: 127.0.0.1 Content-Type: application/x-www-form-urlencoded Content-Length: length filename=string ''' filename = 'diagFile12442342343.txt' head = { 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': f'{len(filename...
2017-12-20T13:14:29.000358
Glinda
pythondev_help_Glinda_2017-12-20T13:14:29.000358
1,513,775,669.000358
105,337
pythondev
help
you probably don't need to set Content-Length by yourself
2017-12-20T13:19:26.000360
Suellen
pythondev_help_Suellen_2017-12-20T13:19:26.000360
1,513,775,966.00036
105,338
pythondev
help
hm.. and you need `data=payload` instead of `params=payload`
2017-12-20T13:20:30.000115
Suellen
pythondev_help_Suellen_2017-12-20T13:20:30.000115
1,513,776,030.000115
105,339
pythondev
help
as `params` is applied to an URL as urlencoded parameters, like this: `GetDiagnosticFile?filename=string`
2017-12-20T13:20:56.000328
Suellen
pythondev_help_Suellen_2017-12-20T13:20:56.000328
1,513,776,056.000328
105,340
pythondev
help
not as POST body
2017-12-20T13:21:09.000303
Suellen
pythondev_help_Suellen_2017-12-20T13:21:09.000303
1,513,776,069.000303
105,341
pythondev
help
I agree with <@Suellen> - don't set Content-Length by yourself (it's not the character count)
2017-12-20T13:21:28.000308
Mirian
pythondev_help_Mirian_2017-12-20T13:21:28.000308
1,513,776,088.000308
105,342
pythondev
help
Either way, the request I tried posting
2017-12-20T13:27:42.000548
Glinda
pythondev_help_Glinda_2017-12-20T13:27:42.000548
1,513,776,462.000548
105,343
pythondev
help
should have returned any response?
2017-12-20T13:27:50.000061
Glinda
pythondev_help_Glinda_2017-12-20T13:27:50.000061
1,513,776,470.000061
105,344
pythondev
help
It was just hanging forever until I added timeout.
2017-12-20T13:27:58.000269
Glinda
pythondev_help_Glinda_2017-12-20T13:27:58.000269
1,513,776,478.000269
105,345
pythondev
help
likely, yes
2017-12-20T13:28:38.000520
Suellen
pythondev_help_Suellen_2017-12-20T13:28:38.000520
1,513,776,518.00052
105,346
pythondev
help
but it's best to test with a correct request
2017-12-20T13:28:48.000382
Suellen
pythondev_help_Suellen_2017-12-20T13:28:48.000382
1,513,776,528.000382
105,347
pythondev
help
Can I use a process pool to run a function on a list lists that modifies values and returns the updated list of lists?
2017-12-20T13:30:45.000314
Myong
pythondev_help_Myong_2017-12-20T13:30:45.000314
1,513,776,645.000314
105,348
pythondev
help
Okay, now I'm getting a 503 :disappointed:
2017-12-20T13:31:05.000229
Glinda
pythondev_help_Glinda_2017-12-20T13:31:05.000229
1,513,776,665.000229
105,349
pythondev
help
<@Myong>, I'd guess you would have to think about how you map out the work there.
2017-12-20T13:31:58.000731
Winnifred
pythondev_help_Winnifred_2017-12-20T13:31:58.000731
1,513,776,718.000731
105,350
pythondev
help
<@Glinda> better than nothing :))
2017-12-20T13:32:16.000451
Suellen
pythondev_help_Suellen_2017-12-20T13:32:16.000451
1,513,776,736.000451
105,351
pythondev
help
Hmm
2017-12-20T13:33:15.000061
Glinda
pythondev_help_Glinda_2017-12-20T13:33:15.000061
1,513,776,795.000061
105,352
pythondev
help
what's the response body?
2017-12-20T13:34:15.000622
Suellen
pythondev_help_Suellen_2017-12-20T13:34:15.000622
1,513,776,855.000622
105,353
pythondev
help
maybe there's a hint
2017-12-20T13:34:21.000298
Suellen
pythondev_help_Suellen_2017-12-20T13:34:21.000298
1,513,776,861.000298
105,354
pythondev
help
``` &lt;body&gt;\r\n&lt;div align="center"&gt;\r\n&lt;div id="pagecontainer"&gt;&lt;img src="http://www.mailcontrol.com/images/block.png" class="icon" &gt;\r\n&lt;h1&gt;The page cannot be displayed&lt;/h1&gt;\r\n&lt;div class="row"&gt;\r\n&lt;tab le&gt;\r\n&lt;tr&gt;&lt;td class="label"&gt;Reason:&lt;/td&gt;&lt;td cla...
2017-12-20T13:35:55.000430
Glinda
pythondev_help_Glinda_2017-12-20T13:35:55.000430
1,513,776,955.00043
105,355
pythondev
help
Invalid internal server?
2017-12-20T13:36:00.000004
Glinda
pythondev_help_Glinda_2017-12-20T13:36:00.000004
1,513,776,960.000004
105,356
pythondev
help
:o
2017-12-20T13:37:44.000207
Suellen
pythondev_help_Suellen_2017-12-20T13:37:44.000207
1,513,777,064.000207
105,357
pythondev
help
I'm guessing something like this may work... Split the list into n equal parts where n = num of workers Then submit each list to be worked on
2017-12-20T13:38:41.000381
Myong
pythondev_help_Myong_2017-12-20T13:38:41.000381
1,513,777,121.000381
105,358
pythondev
help
^^ same thing I was thinking
2017-12-20T13:38:55.000193
Winnifred
pythondev_help_Winnifred_2017-12-20T13:38:55.000193
1,513,777,135.000193
105,359
pythondev
help
can you operate on each list in the "master" list?
2017-12-20T13:39:43.000222
Winnifred
pythondev_help_Winnifred_2017-12-20T13:39:43.000222
1,513,777,183.000222
105,360
pythondev
help
What do you mean
2017-12-20T13:39:55.000008
Myong
pythondev_help_Myong_2017-12-20T13:39:55.000008
1,513,777,195.000008
105,361
pythondev
help
I can access and take values then modify them and return a different list
2017-12-20T13:40:23.000683
Myong
pythondev_help_Myong_2017-12-20T13:40:23.000683
1,513,777,223.000683
105,362
pythondev
help
then `del()` the old one to save memory
2017-12-20T13:40:33.000075
Myong
pythondev_help_Myong_2017-12-20T13:40:33.000075
1,513,777,233.000075
105,363
pythondev
help
is your structure like `[ [ ],[ ],[ ] ]` ?
2017-12-20T13:41:01.000437
Winnifred
pythondev_help_Winnifred_2017-12-20T13:41:01.000437
1,513,777,261.000437
105,364
pythondev
help
Yeah
2017-12-20T13:41:55.000201
Myong
pythondev_help_Myong_2017-12-20T13:41:55.000201
1,513,777,315.000201
105,365
pythondev
help
BUT
2017-12-20T13:42:00.000220
Myong
pythondev_help_Myong_2017-12-20T13:42:00.000220
1,513,777,320.00022
105,366
pythondev
help
if so, each process/thread can work on each list and modify them in place (I think).
2017-12-20T13:42:04.000132
Winnifred
pythondev_help_Winnifred_2017-12-20T13:42:04.000132
1,513,777,324.000132
105,367
pythondev
help
Technically it's not in that format
2017-12-20T13:42:45.000399
Myong
pythondev_help_Myong_2017-12-20T13:42:45.000399
1,513,777,365.000399
105,368
pythondev
help
when I get it
2017-12-20T13:42:47.000711
Myong
pythondev_help_Myong_2017-12-20T13:42:47.000711
1,513,777,367.000711
105,369
pythondev
help
Cause atm I basically run requests that pull a .csv from online and save into a list of lists where each internal list is a row in the .csv, however I do this ~9 times so I have a list of 9 lists with thousands of other lists within
2017-12-20T13:43:46.000427
Myong
pythondev_help_Myong_2017-12-20T13:43:46.000427
1,513,777,426.000427
105,370
pythondev
help
So it's sort of setup already, however I don't want to just send those lists in cause one might be 5k items and another might be 500
2017-12-20T13:44:15.000417
Myong
pythondev_help_Myong_2017-12-20T13:44:15.000417
1,513,777,455.000417
105,371
pythondev
help
I flatten the masterlist from `[ [ [ ], [ ] ], [ [ ], [ ] ] ]` -&gt; `[ [ ], [ ], [ ], [ ] ]`
2017-12-20T13:45:14.000660
Myong
pythondev_help_Myong_2017-12-20T13:45:14.000660
1,513,777,514.00066
105,372
pythondev
help
But at that points its one main list of thousands of entries, and I need to split it up evenly so I may just do something like
2017-12-20T13:46:06.000758
Myong
pythondev_help_Myong_2017-12-20T13:46:06.000758
1,513,777,566.000758
105,373
pythondev
help
pool knows which process so submit to
2017-12-20T13:46:56.000726
Suellen
pythondev_help_Suellen_2017-12-20T13:46:56.000726
1,513,777,616.000726
105,374
pythondev
help
You want to distribute work evenly?
2017-12-20T13:48:12.000271
Winnifred
pythondev_help_Winnifred_2017-12-20T13:48:12.000271
1,513,777,692.000271
105,375
pythondev
help
`[master_list[len(master_list) / num_workers * n : (len(master_list) / num_workers * n+1) - 1] for i in range(num_workers-1))]`
2017-12-20T13:48:14.000729
Myong
pythondev_help_Myong_2017-12-20T13:48:14.000729
1,513,777,694.000729
105,376
pythondev
help
If the syntax works that should be okay but there may be some quirks
2017-12-20T13:50:41.000099
Myong
pythondev_help_Myong_2017-12-20T13:50:41.000099
1,513,777,841.000099
105,377
pythondev
help
I will do some quick test
2017-12-20T13:50:56.000435
Myong
pythondev_help_Myong_2017-12-20T13:50:56.000435
1,513,777,856.000435
105,378
pythondev
help
I would go about it the same way. To get stuff done, I’d try without distributing work and then optimize like you’re doing.
2017-12-20T13:51:32.000746
Winnifred
pythondev_help_Winnifred_2017-12-20T13:51:32.000746
1,513,777,892.000746
105,379
pythondev
help
Good point
2017-12-20T13:52:03.000027
Myong
pythondev_help_Myong_2017-12-20T13:52:03.000027
1,513,777,923.000027
105,380
pythondev
help
I'd do ``` with ProcessPoolExecutor() as pool: futures = [pool.submit(worker, sublist) for sublist in yourlist] # Deal with completed futures, probably by using # concurrent.futures.as_completed ```
2017-12-20T13:52:14.000276
Collette
pythondev_help_Collette_2017-12-20T13:52:14.000276
1,513,777,934.000276
105,381
pythondev
help
Even if more sublists than workers for now?
2017-12-20T13:52:59.000101
Myong
pythondev_help_Myong_2017-12-20T13:52:59.000101
1,513,777,979.000101
105,382
pythondev
help
The executor maintains a job queue, why would you invent one outside of the pool by chunking the input?
2017-12-20T13:53:03.000353
Collette
pythondev_help_Collette_2017-12-20T13:53:03.000353
1,513,777,983.000353
105,383
pythondev
help
Sure
2017-12-20T13:53:11.000208
Collette
pythondev_help_Collette_2017-12-20T13:53:11.000208
1,513,777,991.000208
105,384
pythondev
help
Yeah you have a good point
2017-12-20T13:53:19.000046
Myong
pythondev_help_Myong_2017-12-20T13:53:19.000046
1,513,777,999.000046
105,385
pythondev
help
I have an idea for a project I want to start, but every time I get a computer in front of me I don't know what to do.
2017-12-20T13:54:22.000345
Marlon
pythondev_help_Marlon_2017-12-20T13:54:22.000345
1,513,778,062.000345
105,386
pythondev
help
Any tips for jumping this mental barrier?
2017-12-20T13:54:40.000135
Marlon
pythondev_help_Marlon_2017-12-20T13:54:40.000135
1,513,778,080.000135
105,387
pythondev
help
start small and iterate over it
2017-12-20T13:55:08.000771
Ciera
pythondev_help_Ciera_2017-12-20T13:55:08.000771
1,513,778,108.000771
105,388
pythondev
help
``` for i in small.start(): ```
2017-12-20T13:56:48.000375
Suellen
pythondev_help_Suellen_2017-12-20T13:56:48.000375
1,513,778,208.000375
105,389
pythondev
help
Hah. I'm not even sure how to start with the design
2017-12-20T13:58:05.000110
Marlon
pythondev_help_Marlon_2017-12-20T13:58:05.000110
1,513,778,285.00011
105,390
pythondev
help
I guess that doesn't matter. Cli.py can be refacotrd
2017-12-20T13:58:38.000018
Marlon
pythondev_help_Marlon_2017-12-20T13:58:38.000018
1,513,778,318.000018
105,391
pythondev
help
I hope `small.start` is a generator <@Suellen>
2017-12-20T13:58:49.000009
Ciera
pythondev_help_Ciera_2017-12-20T13:58:49.000009
1,513,778,329.000009
105,392
pythondev
help
of course it is
2017-12-20T13:59:00.000369
Suellen
pythondev_help_Suellen_2017-12-20T13:59:00.000369
1,513,778,340.000369
105,393
pythondev
help
we can make our own rules!
2017-12-20T13:59:12.000250
Suellen
pythondev_help_Suellen_2017-12-20T13:59:12.000250
1,513,778,352.00025
105,394
pythondev
help
Now that I think about it, I'm kind of recreating cookiecutter
2017-12-20T14:00:03.000087
Marlon
pythondev_help_Marlon_2017-12-20T14:00:03.000087
1,513,778,403.000087
105,395
pythondev
help
I want to have a template file, pass in a yaml file and template the vars from the yaml into a templated doc
2017-12-20T14:00:55.000086
Marlon
pythondev_help_Marlon_2017-12-20T14:00:55.000086
1,513,778,455.000086
105,396
pythondev
help
<@Collette> I can either submit a list of items to be processed which can be a bit long OR I can submit a single job at a time via `executor.submit()`. Which would be more beneficial? Many smaller jobs OR few very large jobs in comparison
2017-12-20T14:21:15.000049
Myong
pythondev_help_Myong_2017-12-20T14:21:15.000049
1,513,779,675.000049
105,397
pythondev
help
bigger chunks -&gt; less overhead
2017-12-20T14:31:31.000695
Suellen
pythondev_help_Suellen_2017-12-20T14:31:31.000695
1,513,780,291.000695
105,398
pythondev
help
we want speed though :racing_car:
2017-12-20T14:32:45.000358
Winnifred
pythondev_help_Winnifred_2017-12-20T14:32:45.000358
1,513,780,365.000358
105,399
pythondev
help
:parrot_fast:
2017-12-20T14:33:27.000327
Myong
pythondev_help_Myong_2017-12-20T14:33:27.000327
1,513,780,407.000327
105,400
pythondev
help
It's not gonna be more than ~200MB of data ever really
2017-12-20T14:34:46.000500
Myong
pythondev_help_Myong_2017-12-20T14:34:46.000500
1,513,780,486.0005
105,401
pythondev
help
In this case
2017-12-20T14:34:52.000433
Myong
pythondev_help_Myong_2017-12-20T14:34:52.000433
1,513,780,492.000433
105,402