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
Assuming of course it doesn't generate infinitely. I think list(generator) would be bad if that were the case. :wink:
2017-10-17T14:30:49.000099
Meghan
pythondev_help_Meghan_2017-10-17T14:30:49.000099
1,508,250,649.000099
97,203
pythondev
help
Yeah I tried to consume to list, and that did not work. Perhaps not truly a generator object?
2017-10-17T14:30:56.000271
Amie
pythondev_help_Amie_2017-10-17T14:30:56.000271
1,508,250,656.000271
97,204
pythondev
help
look it up in the source and see what's actually being returned? ¯\_(ツ)_/¯
2017-10-17T14:31:27.000281
Frieda
pythondev_help_Frieda_2017-10-17T14:31:27.000281
1,508,250,687.000281
97,205
pythondev
help
```TypeError: 'RequestParser' object is not iterable```
2017-10-17T14:32:27.000437
Amie
pythondev_help_Amie_2017-10-17T14:32:27.000437
1,508,250,747.000437
97,206
pythondev
help
yeah, I fired that off a bit prematurely, sorry
2017-10-17T14:32:49.000039
Winnifred
pythondev_help_Winnifred_2017-10-17T14:32:49.000039
1,508,250,769.000039
97,207
pythondev
help
generators are permitted to never halt
2017-10-17T14:33:20.000290
Sirena
pythondev_help_Sirena_2017-10-17T14:33:20.000290
1,508,250,800.00029
97,208
pythondev
help
or, finish, whatever you want to call it
2017-10-17T14:33:48.000409
Sirena
pythondev_help_Sirena_2017-10-17T14:33:48.000409
1,508,250,828.000409
97,209
pythondev
help
you could print out the next() item from a generator, or do it a few times
2017-10-17T14:34:41.000028
Sirena
pythondev_help_Sirena_2017-10-17T14:34:41.000028
1,508,250,881.000028
97,210
pythondev
help
SO suggests one possible alternative: ```g1 = gen() [g1.next() for i in range(10)]```
2017-10-17T14:35:07.000491
Sirena
pythondev_help_Sirena_2017-10-17T14:35:07.000491
1,508,250,907.000491
97,211
pythondev
help
<@Amie> what made you think its a generator to begin with?
2017-10-17T14:37:21.000289
Patty
pythondev_help_Patty_2017-10-17T14:37:21.000289
1,508,251,041.000289
97,212
pythondev
help
^^
2017-10-17T14:37:30.000473
Winnifred
pythondev_help_Winnifred_2017-10-17T14:37:30.000473
1,508,251,050.000473
97,213
pythondev
help
<https://github.com/noirbizarre/flask-restplus/blob/master/flask_restplus/reqparse.py#L291>
2017-10-17T14:37:32.000060
Winnifred
pythondev_help_Winnifred_2017-10-17T14:37:32.000060
1,508,251,052.00006
97,214
pythondev
help
it doesn’t look like a generator to me
2017-10-17T14:37:41.000111
Winnifred
pythondev_help_Winnifred_2017-10-17T14:37:41.000111
1,508,251,061.000111
97,215
pythondev
help
May want to take a look at the usage here: <http://flask-restplus.readthedocs.io/en/stable/parsing.html#>
2017-10-17T14:38:08.000196
Patty
pythondev_help_Patty_2017-10-17T14:38:08.000196
1,508,251,088.000196
97,216
pythondev
help
Turns out it is not
2017-10-17T14:39:08.000198
Amie
pythondev_help_Amie_2017-10-17T14:39:08.000198
1,508,251,148.000198
97,217
pythondev
help
I am having trouble accessing the contents of RequestParser essentially
2017-10-17T14:44:49.000360
Amie
pythondev_help_Amie_2017-10-17T14:44:49.000360
1,508,251,489.00036
97,218
pythondev
help
Can you share your code?
2017-10-17T14:45:24.000008
Patty
pythondev_help_Patty_2017-10-17T14:45:24.000008
1,508,251,524.000008
97,219
pythondev
help
Sure
2017-10-17T14:47:04.000580
Amie
pythondev_help_Amie_2017-10-17T14:47:04.000580
1,508,251,624.00058
97,220
pythondev
help
``` @api.expect(post_parser) def post(self): response = ApiResponse() try: args = self.post_parser.parse_args() args.jira_ids = [] if args.jira_ids is None else args.jira_ids args.slack_channels = [] if args.slack_channels is None else args.slack_channels pod = Pod.new_entity(**args) response.result = pod.to_dict() except Exception, e: print e response.handle_exception(e) return response.to_json() ```
2017-10-17T14:47:23.000373
Amie
pythondev_help_Amie_2017-10-17T14:47:23.000373
1,508,251,643.000373
97,221
pythondev
help
For context: ```@api.route('/') class PodListAPI(Resource): post_parser = reqparse.RequestParser() post_parser.add_argument('name', type=str, required=True) post_parser.add_argument('description', type=str, required=True) post_parser.add_argument('jira_ids', type=str, action='append') post_parser.add_argument('slack_channels', type=str, action='append')```
2017-10-17T14:47:46.000243
Amie
pythondev_help_Amie_2017-10-17T14:47:46.000243
1,508,251,666.000243
97,222
pythondev
help
The exception is being caught at the line where the value of ‘args’ is assigned
2017-10-17T14:49:13.000113
Amie
pythondev_help_Amie_2017-10-17T14:49:13.000113
1,508,251,753.000113
97,223
pythondev
help
My main objective is to identify the contents of post_parser
2017-10-17T14:49:51.000167
Amie
pythondev_help_Amie_2017-10-17T14:49:51.000167
1,508,251,791.000167
97,224
pythondev
help
You are absolutely right
2017-10-17T14:50:31.000346
Amie
pythondev_help_Amie_2017-10-17T14:50:31.000346
1,508,251,831.000346
97,225
pythondev
help
yeah i was re-reading there, but it doesnt look like that reference will ahve anything
2017-10-17T14:50:46.000010
Patty
pythondev_help_Patty_2017-10-17T14:50:46.000010
1,508,251,846.00001
97,226
pythondev
help
Also, why are you defining the class under the root route of the API?
2017-10-17T14:51:00.000222
Patty
pythondev_help_Patty_2017-10-17T14:51:00.000222
1,508,251,860.000222
97,227
pythondev
help
I’m not, just the paste order :slightly_smiling_face:
2017-10-17T14:51:30.000178
Amie
pythondev_help_Amie_2017-10-17T14:51:30.000178
1,508,251,890.000178
97,228
pythondev
help
Here is updated: ```@api.route('/') class PodListAPI(Resource): post_parser = reqparse.RequestParser() post_parser.add_argument('name', type=str, required=True) post_parser.add_argument('description', type=str, required=True) post_parser.add_argument('jira_ids', type=str, action='append') post_parser.add_argument('slack_channels', type=str, action='append') def get(self): """List all Pods.""" response = ApiResponse() response.result = Pod.get_all_entity_as_dicts() print response.result ######### REMOVE return response.to_json() @api.expect(post_parser) def post(self): response = ApiResponse() try: args = post_parser.parse_args() print args args.jira_ids = [] if args.jira_ids is None else args.jira_ids args.slack_channels = [] if args.slack_channels is None else args.slack_channels pod = Pod.new_entity(**args) response.result = pod.to_dict() except Exception, e: response.handle_exception(e) return response.to_json()```
2017-10-17T14:51:43.000115
Amie
pythondev_help_Amie_2017-10-17T14:51:43.000115
1,508,251,903.000115
97,229
pythondev
help
Actually, self.post_parser would exist.
2017-10-17T14:55:06.000293
Amie
pythondev_help_Amie_2017-10-17T14:55:06.000293
1,508,252,106.000293
97,230
pythondev
help
What does the `__init__` of `PostListAPI` look like?
2017-10-17T15:00:05.000555
Patty
pythondev_help_Patty_2017-10-17T15:00:05.000555
1,508,252,405.000555
97,231
pythondev
help
or is it just inheriting from `Resource`?
2017-10-17T15:00:59.000730
Patty
pythondev_help_Patty_2017-10-17T15:00:59.000730
1,508,252,459.00073
97,232
pythondev
help
Inheriting
2017-10-17T15:05:32.000587
Amie
pythondev_help_Amie_2017-10-17T15:05:32.000587
1,508,252,732.000587
97,233
pythondev
help
post_parser is an assigned variable based on the output of a method
2017-10-17T15:07:13.000679
Amie
pythondev_help_Amie_2017-10-17T15:07:13.000679
1,508,252,833.000679
97,234
pythondev
help
<@Amie>, I think you need to pass args into your `post(self)` call.
2017-10-17T15:09:30.000082
Winnifred
pythondev_help_Winnifred_2017-10-17T15:09:30.000082
1,508,252,970.000082
97,235
pythondev
help
Actually, you’re trying to do that through the decorator.
2017-10-17T15:10:29.000657
Winnifred
pythondev_help_Winnifred_2017-10-17T15:10:29.000657
1,508,253,029.000657
97,236
pythondev
help
Did you see the example <@Patty> posted? Move your parser to the module level (outside of your `PodListAPI` resource and then within the `post` call reference your args via `args['name']`, `args['description']`, etc.
2017-10-17T15:24:13.000448
Winnifred
pythondev_help_Winnifred_2017-10-17T15:24:13.000448
1,508,253,853.000448
97,237
pythondev
help
<http://flask-restplus.readthedocs.io/en/stable/parsing.html#file-upload>
2017-10-17T15:24:17.000034
Winnifred
pythondev_help_Winnifred_2017-10-17T15:24:17.000034
1,508,253,857.000034
97,238
pythondev
help
Let’s look
2017-10-17T15:28:52.000204
Amie
pythondev_help_Amie_2017-10-17T15:28:52.000204
1,508,254,132.000204
97,239
pythondev
help
<@Winnifred> I have multiple routes in the same file, each with their own args
2017-10-17T15:30:44.000524
Amie
pythondev_help_Amie_2017-10-17T15:30:44.000524
1,508,254,244.000524
97,240
pythondev
help
I could split it out, but is it necessary?
2017-10-17T15:30:58.000059
Amie
pythondev_help_Amie_2017-10-17T15:30:58.000059
1,508,254,258.000059
97,241
pythondev
help
Is there no way to run Pytest on windows?
2017-10-17T15:31:45.000367
Noemi
pythondev_help_Noemi_2017-10-17T15:31:45.000367
1,508,254,305.000367
97,242
pythondev
help
did you install it with pip?
2017-10-17T15:36:03.000282
Meg
pythondev_help_Meg_2017-10-17T15:36:03.000282
1,508,254,563.000282
97,243
pythondev
help
Yes, tried pip and easy_install <@Meg>
2017-10-17T15:43:07.000117
Noemi
pythondev_help_Noemi_2017-10-17T15:43:07.000117
1,508,254,987.000117
97,244
pythondev
help
Probably not
2017-10-17T15:44:53.000348
Winnifred
pythondev_help_Winnifred_2017-10-17T15:44:53.000348
1,508,255,093.000348
97,245
pythondev
help
has anyone ever had to deal with converting unicode to string literals ?
2017-10-17T16:38:57.000003
Burma
pythondev_help_Burma_2017-10-17T16:38:57.000003
1,508,258,337.000003
97,246
pythondev
help
<https://nedbatchelder.com/text/unipain.html>
2017-10-17T16:40:20.000061
Meg
pythondev_help_Meg_2017-10-17T16:40:20.000061
1,508,258,420.000061
97,247
pythondev
help
there's a ```u'01sdggsgd7986966960880'``` In-front of my value
2017-10-17T16:40:34.000206
Burma
pythondev_help_Burma_2017-10-17T16:40:34.000206
1,508,258,434.000206
97,248
pythondev
help
might want to look at that
2017-10-17T16:40:37.000557
Meg
pythondev_help_Meg_2017-10-17T16:40:37.000557
1,508,258,437.000557
97,249
pythondev
help
cool
2017-10-17T16:41:04.000345
Burma
pythondev_help_Burma_2017-10-17T16:41:04.000345
1,508,258,464.000345
97,250
pythondev
help
This is my file structure ``` ├── packages │ └── psycopg2 │ ├── psycopg2/ │ └── psycopg2-2.7.3.1.dist-info/ └── team_configs └── team.py ``` and in my team.py, I have `import psycopg2` which doesn't work since the import path is wrong. But I don't know how to read from parents folder from team.py. I want to do something like `import ../packages/psycopg2`. Any suggestions?
2017-10-17T19:20:35.000219
Cordie
pythondev_help_Cordie_2017-10-17T19:20:35.000219
1,508,268,035.000219
97,251
pythondev
help
is there a reason you're manually installing/finding packages?
2017-10-17T19:23:47.000270
Frieda
pythondev_help_Frieda_2017-10-17T19:23:47.000270
1,508,268,227.00027
97,252
pythondev
help
<@Frieda> serverless.yml packages it this way.. I figured python would be easier to correct it
2017-10-17T19:26:28.000017
Cordie
pythondev_help_Cordie_2017-10-17T19:26:28.000017
1,508,268,388.000017
97,253
pythondev
help
ok
2017-10-17T19:26:51.000197
Frieda
pythondev_help_Frieda_2017-10-17T19:26:51.000197
1,508,268,411.000197
97,254
pythondev
help
I really love python except for import thingy
2017-10-17T19:26:53.000092
Cordie
pythondev_help_Cordie_2017-10-17T19:26:53.000092
1,508,268,413.000092
97,255
pythondev
help
never ever understand why it'ss so difficult
2017-10-17T19:27:05.000142
Cordie
pythondev_help_Cordie_2017-10-17T19:27:05.000142
1,508,268,425.000142
97,256
pythondev
help
it's not?
2017-10-17T19:27:13.000060
Frieda
pythondev_help_Frieda_2017-10-17T19:27:13.000060
1,508,268,433.00006
97,257
pythondev
help
python's packaging works. `serverless.yml` is the one doing it weird
2017-10-17T19:27:23.000034
Frieda
pythondev_help_Frieda_2017-10-17T19:27:23.000034
1,508,268,443.000034
97,258
pythondev
help
wait, so my problem is easily solvable?
2017-10-17T19:27:27.000234
Cordie
pythondev_help_Cordie_2017-10-17T19:27:27.000234
1,508,268,447.000234
97,259
pythondev
help
i mean, sure, maybe? you could add each directory in `packages` to the `PYTHONPATH`?
2017-10-17T19:28:07.000079
Frieda
pythondev_help_Frieda_2017-10-17T19:28:07.000079
1,508,268,487.000079
97,260
pythondev
help
ok that will be difficult. These files are going to run on AWS ec2
2017-10-17T19:28:28.000176
Cordie
pythondev_help_Cordie_2017-10-17T19:28:28.000176
1,508,268,508.000176
97,261
pythondev
help
there's a whole `os` module that can find the directories without you knowing exactly where they are. or even what exists.
2017-10-17T19:28:52.000326
Frieda
pythondev_help_Frieda_2017-10-17T19:28:52.000326
1,508,268,532.000326
97,262
pythondev
help
the packages directory for serverless is only supposed to be for deployment
2017-10-17T19:29:02.000025
Marcie
pythondev_help_Marcie_2017-10-17T19:29:02.000025
1,508,268,542.000025
97,263
pythondev
help
oo!
2017-10-17T19:29:02.000341
Cordie
pythondev_help_Cordie_2017-10-17T19:29:02.000341
1,508,268,542.000341
97,264
pythondev
help
you're supposed to still use a virtualenv for local development
2017-10-17T19:29:15.000268
Marcie
pythondev_help_Marcie_2017-10-17T19:29:15.000268
1,508,268,555.000268
97,265
pythondev
help
and a requirements.txt to keep them aligned
2017-10-17T19:29:22.000375
Marcie
pythondev_help_Marcie_2017-10-17T19:29:22.000375
1,508,268,562.000375
97,266
pythondev
help
or maybe `pipenv`
2017-10-17T19:29:32.000081
Frieda
pythondev_help_Frieda_2017-10-17T19:29:32.000081
1,508,268,572.000081
97,267
pythondev
help
ok I am not going to explain why ... exactly this happened. But the gist is that pip installed libraries don't compile well under amazon linux. So I had to docker in and do some bs to download compilable libraries. but... anyway the end result is the folder structure above. I don't want to move them under team_configs folder since than I will have to make copy of psycopg2 for every other python files too. This is just tip of the iceburg.
2017-10-17T19:31:04.000222
Cordie
pythondev_help_Cordie_2017-10-17T19:31:04.000222
1,508,268,664.000222
97,268
pythondev
help
today has been long :disappointed:
2017-10-17T19:32:10.000150
Cordie
pythondev_help_Cordie_2017-10-17T19:32:10.000150
1,508,268,730.00015
97,269
pythondev
help
did you try something like this? <https://serverless.com/blog/serverless-python-packaging/>
2017-10-17T19:33:12.000132
Frieda
pythondev_help_Frieda_2017-10-17T19:33:12.000132
1,508,268,792.000132
97,270
pythondev
help
I saw it and tried to avoid plugin if there was easy way out. I guess i will have to use it.
2017-10-17T19:35:41.000300
Cordie
pythondev_help_Cordie_2017-10-17T19:35:41.000300
1,508,268,941.0003
97,271
pythondev
help
it feels like you're making this harder on yourself than you need to
2017-10-17T19:36:11.000204
Frieda
pythondev_help_Frieda_2017-10-17T19:36:11.000204
1,508,268,971.000204
97,272
pythondev
help
for not using plugin?
2017-10-17T19:36:20.000158
Cordie
pythondev_help_Cordie_2017-10-17T19:36:20.000158
1,508,268,980.000158
97,273
pythondev
help
just this whole combination of things
2017-10-17T19:37:06.000083
Frieda
pythondev_help_Frieda_2017-10-17T19:37:06.000083
1,508,269,026.000083
97,274
pythondev
help
but, sorta, yeah. i mean, if a problem is solved...
2017-10-17T19:37:21.000254
Frieda
pythondev_help_Frieda_2017-10-17T19:37:21.000254
1,508,269,041.000254
97,275
pythondev
help
dude I know
2017-10-17T19:37:53.000312
Cordie
pythondev_help_Cordie_2017-10-17T19:37:53.000312
1,508,269,073.000312
97,276
pythondev
help
I think I'm just a bit slow
2017-10-17T19:38:01.000048
Cordie
pythondev_help_Cordie_2017-10-17T19:38:01.000048
1,508,269,081.000048
97,277
pythondev
help
thanks for helping out
2017-10-17T19:38:12.000081
Cordie
pythondev_help_Cordie_2017-10-17T19:38:12.000081
1,508,269,092.000081
97,278
pythondev
help
haha i wouldn't say you're slow at all
2017-10-17T19:38:15.000344
Frieda
pythondev_help_Frieda_2017-10-17T19:38:15.000344
1,508,269,095.000344
97,279
pythondev
help
purity only goes so far
2017-10-17T19:38:21.000301
Frieda
pythondev_help_Frieda_2017-10-17T19:38:21.000301
1,508,269,101.000301
97,280
pythondev
help
yeah
2017-10-17T19:38:29.000243
Cordie
pythondev_help_Cordie_2017-10-17T19:38:29.000243
1,508,269,109.000243
97,281
pythondev
help
anyway, good luck with it. i'd love to hear how it turns out. i've been meaning to try out serverless stuff but haven't had a reason yet
2017-10-17T19:40:33.000083
Frieda
pythondev_help_Frieda_2017-10-17T19:40:33.000083
1,508,269,233.000083
97,282
pythondev
help
Thanks. I've decided to just flatten out my directory structure since each lambda functions are modular anyway. That way all lambdas can share utils/ and packages/ etc.
2017-10-17T19:46:27.000088
Cordie
pythondev_help_Cordie_2017-10-17T19:46:27.000088
1,508,269,587.000088
97,283
pythondev
help
serverless is great dude
2017-10-17T19:46:32.000203
Cordie
pythondev_help_Cordie_2017-10-17T19:46:32.000203
1,508,269,592.000203
97,284
pythondev
help
my stack is redshift - api gateway - lambda - s3 _static_ web host
2017-10-17T19:46:51.000066
Cordie
pythondev_help_Cordie_2017-10-17T19:46:51.000066
1,508,269,611.000066
97,285
pythondev
help
nice. what are you doing on it?
2017-10-17T19:48:09.000149
Frieda
pythondev_help_Frieda_2017-10-17T19:48:09.000149
1,508,269,689.000149
97,286
pythondev
help
i am on an internship and my team needs an internal tool
2017-10-17T19:58:22.000051
Cordie
pythondev_help_Cordie_2017-10-17T19:58:22.000051
1,508,270,302.000051
97,287
pythondev
help
some dashboard graph stuff
2017-10-17T19:58:36.000215
Cordie
pythondev_help_Cordie_2017-10-17T19:58:36.000215
1,508,270,316.000215
97,288
pythondev
help
It’s similar that Sentry ?
2017-10-18T08:17:54.000162
Luetta
pythondev_help_Luetta_2017-10-18T08:17:54.000162
1,508,314,674.000162
97,289
pythondev
help
Hello, is there a better data structure than this one in order to store synonyms of keywords:
2017-10-18T09:35:30.000329
Kathern
pythondev_help_Kathern_2017-10-18T09:35:30.000329
1,508,319,330.000329
97,290
pythondev
help
``` main_tokens = { 'weather': 'meteo', 'meteo': 'meteo', 'sunny': 'meteo', 'raining': 'meteo', 'email': 'email', 'mail': 'email' } ```
2017-10-18T09:35:44.000353
Kathern
pythondev_help_Kathern_2017-10-18T09:35:44.000353
1,508,319,344.000353
97,291
pythondev
help
<@Kathern> the choice of a data structure depends on how you're going to use it
2017-10-18T09:36:55.000280
Collette
pythondev_help_Collette_2017-10-18T09:36:55.000280
1,508,319,415.00028
97,292
pythondev
help
Use triple backticks: `````````
2017-10-18T09:37:02.000346
Collette
pythondev_help_Collette_2017-10-18T09:37:02.000346
1,508,319,422.000346
97,293
pythondev
help
<https://get.slack.help/hc/en-us/articles/202288908-Format-your-messages>
2017-10-18T09:37:22.000227
Collette
pythondev_help_Collette_2017-10-18T09:37:22.000227
1,508,319,442.000227
97,294
pythondev
help
thank you <@Collette>. I want to use it for speech recognition : to find which command to run based on what the user wants
2017-10-18T09:38:27.000028
Kathern
pythondev_help_Kathern_2017-10-18T09:38:27.000028
1,508,319,507.000028
97,295
pythondev
help
Sounds like you need a power of stemming, lexical analysis and such. A simple dictionary of synonyms won't work. I'd suggest to take a look at existing implementations, like NLTK (<https://pythonprogramming.net/stemming-nltk-tutorial/>) or even maybe elasticsearch/solr
2017-10-18T09:40:42.000273
Collette
pythondev_help_Collette_2017-10-18T09:40:42.000273
1,508,319,642.000273
97,296
pythondev
help
in short, this is a non-trivial task
2017-10-18T09:41:35.000459
Meg
pythondev_help_Meg_2017-10-18T09:41:35.000459
1,508,319,695.000459
97,297
pythondev
help
ok, thank you
2017-10-18T09:51:20.000637
Kathern
pythondev_help_Kathern_2017-10-18T09:51:20.000637
1,508,320,280.000637
97,298
pythondev
help
good to remember though that stemming will probably not help for determining synonyms since a synonym often doesn't look anything like the other word or phrase
2017-10-18T10:17:50.000259
Willena
pythondev_help_Willena_2017-10-18T10:17:50.000259
1,508,321,870.000259
97,299
pythondev
help
you would still need a synonym dictionary of terms
2017-10-18T10:21:42.000718
Willena
pythondev_help_Willena_2017-10-18T10:21:42.000718
1,508,322,102.000718
97,300
pythondev
help
for example, check out section 12.6.3. Synonym Dictionary in the Postgres docs <https://www.postgresql.org/docs/9.6/static/textsearch-dictionaries.html#TEXTSEARCH-SYNONYM-DICTIONARY>
2017-10-18T10:25:40.000243
Willena
pythondev_help_Willena_2017-10-18T10:25:40.000243
1,508,322,340.000243
97,301
pythondev
help
if you’re using boto3 in a long running celery task, is it a good idea to initialize a connection on task start and have it available through the whole lifetime of the task, or initialize it on demand when required?
2017-10-18T10:36:41.000191
Meg
pythondev_help_Meg_2017-10-18T10:36:41.000191
1,508,323,001.000191
97,302