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 | So I think you need to change your mysql connection string to be looking at the port, not a local socket | 2017-07-10T16:12:39.037444 | Beula | pythondev_help_Beula_2017-07-10T16:12:39.037444 | 1,499,703,159.037444 | 84,503 |
pythondev | help | okay I’ll try.
```
docker run --name=test-app -p 8000:8000 -it -v $PWD:/app --link -p 3306 -h localhost my-db --env-file=.env myapp:dev
```
this one;)? sorry, I :disappointed:confused | 2017-07-10T16:13:54.076097 | Bella | pythondev_help_Bella_2017-07-10T16:13:54.076097 | 1,499,703,234.076097 | 84,504 |
pythondev | help | that looks invalid, `--link` requires an argument | 2017-07-10T16:14:57.109369 | Beula | pythondev_help_Beula_2017-07-10T16:14:57.109369 | 1,499,703,297.109369 | 84,505 |
pythondev | help | I am saying, just use what you originally posted, but in your app code where you connect to the database, use the hostname `my-db` | 2017-07-10T16:15:21.122177 | Beula | pythondev_help_Beula_2017-07-10T16:15:21.122177 | 1,499,703,321.122177 | 84,506 |
pythondev | help | What lib are you using to talk to your DB? | 2017-07-10T16:17:50.201199 | Beula | pythondev_help_Beula_2017-07-10T16:17:50.201199 | 1,499,703,470.201199 | 84,507 |
pythondev | help | mysql-python | 2017-07-10T16:19:51.263498 | Bella | pythondev_help_Bella_2017-07-10T16:19:51.263498 | 1,499,703,591.263498 | 84,508 |
pythondev | help | and uri for now
```
SQLALCHEMY_DATABASE_URI = '<mysql://root:t123@localhost/dstore>'
``` | 2017-07-10T16:20:38.288223 | Bella | pythondev_help_Bella_2017-07-10T16:20:38.288223 | 1,499,703,638.288223 | 84,509 |
pythondev | help | So presuming you are using `--link my-db`, you should be able to change `localhost` to `my-db` for the host | 2017-07-10T16:21:25.313133 | Beula | pythondev_help_Beula_2017-07-10T16:21:25.313133 | 1,499,703,685.313133 | 84,510 |
pythondev | help | One moment, I’ll try. | 2017-07-10T16:23:12.370567 | Bella | pythondev_help_Bella_2017-07-10T16:23:12.370567 | 1,499,703,792.370567 | 84,511 |
pythondev | help | <@Beula> unrelated question, but can you theoretically share the socket between containers? or is this too ridiculous? | 2017-07-10T16:28:57.553754 | Suellen | pythondev_help_Suellen_2017-07-10T16:28:57.553754 | 1,499,704,137.553754 | 84,512 |
pythondev | help | <@Beula> Thanks! it’s working!!! beer from me:beers: | 2017-07-10T16:30:17.596907 | Bella | pythondev_help_Bella_2017-07-10T16:30:17.596907 | 1,499,704,217.596907 | 84,513 |
pythondev | help | I am sure there is a way, since a container can declare volumes it provides. I would think that's possible | 2017-07-10T16:30:20.598836 | Beula | pythondev_help_Beula_2017-07-10T16:30:20.598836 | 1,499,704,220.598836 | 84,514 |
pythondev | help | But I just use the ports, since it's just simpler | 2017-07-10T16:30:34.606466 | Beula | pythondev_help_Beula_2017-07-10T16:30:34.606466 | 1,499,704,234.606466 | 84,515 |
pythondev | help | I spend all day for this:disappointed: | 2017-07-10T16:30:41.610563 | Bella | pythondev_help_Bella_2017-07-10T16:30:41.610563 | 1,499,704,241.610563 | 84,516 |
pythondev | help | I'm just thinking network might be slower, especially abstracted away by docker... | 2017-07-10T16:31:08.624940 | Suellen | pythondev_help_Suellen_2017-07-10T16:31:08.624940 | 1,499,704,268.62494 | 84,517 |
pythondev | help | app was running, But when I checked in browser, I can’t open the app.
app running on 50 port, I think I need to add `EXPOSE 50` to the Dockerfile?
<@Beula> | 2017-07-10T16:32:32.670273 | Bella | pythondev_help_Bella_2017-07-10T16:32:32.670273 | 1,499,704,352.670273 | 84,518 |
pythondev | help | <@Beula> :taco: | 2017-07-10T16:33:19.695100 | Signe | pythondev_help_Signe_2017-07-10T16:33:19.695100 | 1,499,704,399.6951 | 84,519 |
pythondev | help | <@Bella> not enough info on "cant open the app" | 2017-07-10T16:34:24.730102 | Signe | pythondev_help_Signe_2017-07-10T16:34:24.730102 | 1,499,704,464.730102 | 84,520 |
pythondev | help | just port forwarding should expose | 2017-07-10T16:34:33.735454 | Signe | pythondev_help_Signe_2017-07-10T16:34:33.735454 | 1,499,704,473.735454 | 84,521 |
pythondev | help | but your docker run port forwards port 8000 not port 50 | 2017-07-10T16:35:08.753853 | Signe | pythondev_help_Signe_2017-07-10T16:35:08.753853 | 1,499,704,508.753853 | 84,522 |
pythondev | help | so that might be your issue | 2017-07-10T16:35:12.755774 | Signe | pythondev_help_Signe_2017-07-10T16:35:12.755774 | 1,499,704,512.755774 | 84,523 |
pythondev | help | no, 8000 didn’t work too, I’ll try rebuild image, and will add `EXPOSE` | 2017-07-10T16:36:45.804977 | Bella | pythondev_help_Bella_2017-07-10T16:36:45.804977 | 1,499,704,605.804977 | 84,524 |
pythondev | help | <@Signe> thanks for help | 2017-07-10T16:36:54.809362 | Bella | pythondev_help_Bella_2017-07-10T16:36:54.809362 | 1,499,704,614.809362 | 84,525 |
pythondev | help | ! | 2017-07-10T16:36:55.809811 | Bella | pythondev_help_Bella_2017-07-10T16:36:55.809811 | 1,499,704,615.809811 | 84,526 |
pythondev | help | The taco bot should be renamed to 'tacos y cervezas' or for a more relaxed/friendly label, 'tacos y chelas' or 'tacos y unas frías' | 2017-07-10T17:22:22.171592 | Deedee | pythondev_help_Deedee_2017-07-10T17:22:22.171592 | 1,499,707,342.171592 | 84,527 |
pythondev | help | <@Bella> FYI: <https://github.com/pyslackers/community/blob/master/introduction.md#taco-bot-taco> | 2017-07-10T17:24:32.229327 | Deedee | pythondev_help_Deedee_2017-07-10T17:24:32.229327 | 1,499,707,472.229327 | 84,528 |
pythondev | help | Question about os.stats().st_atime | 2017-07-10T18:06:27.247744 | Staci | pythondev_help_Staci_2017-07-10T18:06:27.247744 | 1,499,709,987.247744 | 84,529 |
pythondev | help | It's a timestamp representing the last time a file was accessed | 2017-07-10T18:06:45.253941 | Staci | pythondev_help_Staci_2017-07-10T18:06:45.253941 | 1,499,710,005.253941 | 84,530 |
pythondev | help | but its returning a negative number | 2017-07-10T18:07:12.263016 | Staci | pythondev_help_Staci_2017-07-10T18:07:12.263016 | 1,499,710,032.263016 | 84,531 |
pythondev | help | -11644473600 | 2017-07-10T18:07:31.269789 | Staci | pythondev_help_Staci_2017-07-10T18:07:31.269789 | 1,499,710,051.269789 | 84,532 |
pythondev | help | which if I use the absolute value represents a Dec 31, 2338 | 2017-07-10T18:08:03.280733 | Staci | pythondev_help_Staci_2017-07-10T18:08:03.280733 | 1,499,710,083.280733 | 84,533 |
pythondev | help | Does this mean the file has never been accessed? | 2017-07-10T18:08:17.285818 | Staci | pythondev_help_Staci_2017-07-10T18:08:17.285818 | 1,499,710,097.285818 | 84,534 |
pythondev | help | Does `stat <file>` in your shell report the same thing? | 2017-07-10T18:11:03.342587 | Beula | pythondev_help_Beula_2017-07-10T18:11:03.342587 | 1,499,710,263.342587 | 84,535 |
pythondev | help | um, let me check. | 2017-07-10T18:15:27.432070 | Staci | pythondev_help_Staci_2017-07-10T18:15:27.432070 | 1,499,710,527.43207 | 84,536 |
pythondev | help | <@Staci> shouldnt atime be an unsigned number? | 2017-07-10T18:26:19.651600 | Carrol | pythondev_help_Carrol_2017-07-10T18:26:19.651600 | 1,499,711,179.6516 | 84,537 |
pythondev | help | Sorry, took me a minute | 2017-07-10T18:28:36.696177 | Staci | pythondev_help_Staci_2017-07-10T18:28:36.696177 | 1,499,711,316.696177 | 84,538 |
pythondev | help | This is on a network shared drive | 2017-07-10T18:29:08.706380 | Staci | pythondev_help_Staci_2017-07-10T18:29:08.706380 | 1,499,711,348.70638 | 84,539 |
pythondev | help | 12/31/1600 | 2017-07-10T18:29:58.721898 | Staci | pythondev_help_Staci_2017-07-10T18:29:58.721898 | 1,499,711,398.721898 | 84,540 |
pythondev | help | for all the tiles | 2017-07-10T18:30:02.723036 | Staci | pythondev_help_Staci_2017-07-10T18:30:02.723036 | 1,499,711,402.723036 | 84,541 |
pythondev | help | files* | 2017-07-10T18:30:04.723819 | Staci | pythondev_help_Staci_2017-07-10T18:30:04.723819 | 1,499,711,404.723819 | 84,542 |
pythondev | help | Weird | 2017-07-10T18:30:56.741017 | Staci | pythondev_help_Staci_2017-07-10T18:30:56.741017 | 1,499,711,456.741017 | 84,543 |
pythondev | help | it seems that you haven't accessed your files in a while :wink: | 2017-07-10T18:32:02.761465 | Carrol | pythondev_help_Carrol_2017-07-10T18:32:02.761465 | 1,499,711,522.761465 | 84,544 |
pythondev | help | haha I'm just wondering how they managed to access them back in 1600 with no computers | 2017-07-10T18:32:32.771155 | Staci | pythondev_help_Staci_2017-07-10T18:32:32.771155 | 1,499,711,552.771155 | 84,545 |
pythondev | help | That’s Windows for ya | 2017-07-10T18:33:02.780569 | Patty | pythondev_help_Patty_2017-07-10T18:33:02.780569 | 1,499,711,582.780569 | 84,546 |
pythondev | help | (well, Active Directory) | 2017-07-10T18:33:06.782121 | Patty | pythondev_help_Patty_2017-07-10T18:33:06.782121 | 1,499,711,586.782121 | 84,547 |
pythondev | help | I wonder if it has anything to do with noatime family of mount flags. they are often used with ssds | 2017-07-10T18:33:07.782319 | Carrol | pythondev_help_Carrol_2017-07-10T18:33:07.782319 | 1,499,711,587.782319 | 84,548 |
pythondev | help | with AD, times are represented as tickts from midnight, Jan 1 1600 in active directory, powershell cant handle it | 2017-07-10T18:34:01.799888 | Patty | pythondev_help_Patty_2017-07-10T18:34:01.799888 | 1,499,711,641.799888 | 84,549 |
pythondev | help | it means it wasnt accessed | 2017-07-10T18:34:05.801161 | Patty | pythondev_help_Patty_2017-07-10T18:34:05.801161 | 1,499,711,645.801161 | 84,550 |
pythondev | help | Well I just opened the file | 2017-07-10T18:34:28.808514 | Staci | pythondev_help_Staci_2017-07-10T18:34:28.808514 | 1,499,711,668.808514 | 84,551 |
pythondev | help | Powershell and AD have different epochs as well | 2017-07-10T18:34:33.810038 | Patty | pythondev_help_Patty_2017-07-10T18:34:33.810038 | 1,499,711,673.810038 | 84,552 |
pythondev | help | 0001 vs 1600 | 2017-07-10T18:34:42.812755 | Patty | pythondev_help_Patty_2017-07-10T18:34:42.812755 | 1,499,711,682.812755 | 84,553 |
pythondev | help | I think the network shared drive is doing something weird with the last accessed date | 2017-07-10T18:35:08.821188 | Staci | pythondev_help_Staci_2017-07-10T18:35:08.821188 | 1,499,711,708.821188 | 84,554 |
pythondev | help | I bet it doesn't update it to save drive's lifespan | 2017-07-10T18:35:36.829870 | Carrol | pythondev_help_Carrol_2017-07-10T18:35:36.829870 | 1,499,711,736.82987 | 84,555 |
pythondev | help | yeah since it’s probably managed through AD | 2017-07-10T18:35:38.830296 | Patty | pythondev_help_Patty_2017-07-10T18:35:38.830296 | 1,499,711,738.830296 | 84,556 |
pythondev | help | basically, it’s a combination of python, Windows, PowerShell, and Active Directory in a storm of a mess | 2017-07-10T18:36:52.852584 | Patty | pythondev_help_Patty_2017-07-10T18:36:52.852584 | 1,499,711,812.852584 | 84,557 |
pythondev | help | :sweat: | 2017-07-10T18:38:22.879896 | Staci | pythondev_help_Staci_2017-07-10T18:38:22.879896 | 1,499,711,902.879896 | 84,558 |
pythondev | help | AD permissions may also be preventing you (or the script) from seeing the last modified time | 2017-07-10T18:38:25.880714 | Patty | pythondev_help_Patty_2017-07-10T18:38:25.880714 | 1,499,711,905.880714 | 84,559 |
pythondev | help | That last accessed date was going to come in handy | 2017-07-10T18:40:58.927108 | Staci | pythondev_help_Staci_2017-07-10T18:40:58.927108 | 1,499,712,058.927108 | 84,560 |
pythondev | help | But it's all fucked | 2017-07-10T18:41:08.929919 | Staci | pythondev_help_Staci_2017-07-10T18:41:08.929919 | 1,499,712,068.929919 | 84,561 |
pythondev | help | There are like 100,000 files I'm trying to work with, and find out which ones need to be uploaded to a new server and which ones are trash | 2017-07-10T18:41:39.939400 | Staci | pythondev_help_Staci_2017-07-10T18:41:39.939400 | 1,499,712,099.9394 | 84,562 |
pythondev | help | have you tried disabling the archive bit on any of the files? | 2017-07-10T18:42:25.952956 | Patty | pythondev_help_Patty_2017-07-10T18:42:25.952956 | 1,499,712,145.952956 | 84,563 |
pythondev | help | its the checkbox marked “Archive” that comes up when looking at the info | 2017-07-10T18:42:37.956759 | Patty | pythondev_help_Patty_2017-07-10T18:42:37.956759 | 1,499,712,157.956759 | 84,564 |
pythondev | help | I noticed it, I haven't attempted anything yet | 2017-07-10T18:44:12.985306 | Staci | pythondev_help_Staci_2017-07-10T18:44:12.985306 | 1,499,712,252.985306 | 84,565 |
pythondev | help | What does that do? | 2017-07-10T18:44:53.998153 | Staci | pythondev_help_Staci_2017-07-10T18:44:53.998153 | 1,499,712,293.998153 | 84,566 |
pythondev | help | ah wait, is the network drive running on a windows server? | 2017-07-10T18:44:55.998745 | Patty | pythondev_help_Patty_2017-07-10T18:44:55.998745 | 1,499,712,295.998745 | 84,567 |
pythondev | help | its a bit that gets marked when the file is archived - which has some weird definitions | 2017-07-10T18:45:09.003157 | Patty | pythondev_help_Patty_2017-07-10T18:45:09.003157 | 1,499,712,309.003157 | 84,568 |
pythondev | help | I'd have to check our admin, I'm not sure what system we're using. I think it's hosted by another company | 2017-07-10T18:45:54.016394 | Staci | pythondev_help_Staci_2017-07-10T18:45:54.016394 | 1,499,712,354.016394 | 84,569 |
pythondev | help | sorry running out the door but if this isnt turned on on the share, you wont get back access times: <https://gallery.technet.microsoft.com/How-to-enable-File-and-af674be4> | 2017-07-10T18:48:08.056589 | Patty | pythondev_help_Patty_2017-07-10T18:48:08.056589 | 1,499,712,488.056589 | 84,570 |
pythondev | help | Thanks for the info <@Patty>
This is probably a silly question, but do you by chance know if this was enabled if it would retro date everything accessed previously? This is probably a pipe dream, but maybe the data is stored locally on everyone's own PCs? | 2017-07-10T19:08:51.421995 | Staci | pythondev_help_Staci_2017-07-10T19:08:51.421995 | 1,499,713,731.421995 | 84,571 |
pythondev | help | Anyone ever worked with Stripe to create a UK managed account? | 2017-07-10T19:20:56.620387 | Temika | pythondev_help_Temika_2017-07-10T19:20:56.620387 | 1,499,714,456.620387 | 84,572 |
pythondev | help | <@Staci> if auditing is the issue and it wasn’t on then you probably wont. Unless someone replaced a file with their local version then maybe | 2017-07-10T19:22:35.646462 | Patty | pythondev_help_Patty_2017-07-10T19:22:35.646462 | 1,499,714,555.646462 | 84,573 |
pythondev | help | Have you tried `os.path.getmtime(path)`? | 2017-07-10T19:28:19.737266 | Patty | pythondev_help_Patty_2017-07-10T19:28:19.737266 | 1,499,714,899.737266 | 84,574 |
pythondev | help | I haven't. I'll test it | 2017-07-10T19:33:15.816095 | Staci | pythondev_help_Staci_2017-07-10T19:33:15.816095 | 1,499,715,195.816095 | 84,575 |
pythondev | help | Same thing, pretty sure both methods are retrieving the same attribute | 2017-07-10T19:35:45.855009 | Staci | pythondev_help_Staci_2017-07-10T19:35:45.855009 | 1,499,715,345.855009 | 84,576 |
pythondev | help | Anyone on tonight? Or maybe tag me if you see this in the morning?
How would I get the index of a namedtuple field through code without looking at the definition? This is so I can write a code that will use this named tuple by field name rather than index so if the indexes change later down the line with code changes it won't break, and for easier reading?
```
Query = namedtuple('Query', 'dt record_type query client')
def _counts_generic(queries: list, index_to_count=0, include: list=None,
exclude: list=None) -> dict:
if include is None:
include = []
if exclude is None:
exclude = []
counter = Counter()
for entry in queries:
if _query_filter(entry.client, include, exclude):
counter[entry[index_to_count]] += 1
return counter
def counts_client(queries: list, include: list=None, exclude: list=None) \
-> dict:
return _counts_generic(queries, 3, include, exclude)```
With the counts_client function, I am sending a hardcoded index right now, but I would like to send Query.client. As expected, using Query.client doesn't work here and raises a TypeError for tuple indices must be integers or slices, not property. | 2017-07-10T22:42:33.195357 | Meghan | pythondev_help_Meghan_2017-07-10T22:42:33.195357 | 1,499,726,553.195357 | 84,577 |
pythondev | help | 1st, this:
```
if include is None:
include = []
if exclude is None:
exclude = []
```
to:
```
if not include:
include = []
if not exclude:
exclude = []
``` | 2017-07-10T23:00:19.383704 | Deedee | pythondev_help_Deedee_2017-07-10T23:00:19.383704 | 1,499,727,619.383704 | 84,578 |
pythondev | help | Oh, good catch. Oops. PyCharm should have told me that one. | 2017-07-10T23:01:11.393985 | Meghan | pythondev_help_Meghan_2017-07-10T23:01:11.393985 | 1,499,727,671.393985 | 84,579 |
pythondev | help | ```
counter = Counter()
for entry in queries:
if _query_filter(entry.client, include, exclude):
counter[entry[index_to_count]] += 1
return counter
``` | 2017-07-10T23:01:18.395334 | Deedee | pythondev_help_Deedee_2017-07-10T23:01:18.395334 | 1,499,727,678.395334 | 84,580 |
pythondev | help | walk me through this | 2017-07-10T23:01:30.397486 | Deedee | pythondev_help_Deedee_2017-07-10T23:01:30.397486 | 1,499,727,690.397486 | 84,581 |
pythondev | help | Counter is the Counter from collections. Queries is a list of the Query namedtuple. _query_filter is essentially grep and returns a boolean as to whether to include that entry in the counter or not.
index_to_count is the index of the named tuple. That is where I would much prefer to say Query.query rather than entry[index_to_count] | 2017-07-10T23:04:05.424818 | Meghan | pythondev_help_Meghan_2017-07-10T23:04:05.424818 | 1,499,727,845.424818 | 84,582 |
pythondev | help | Or, Query.client, I think it was in that example. | 2017-07-10T23:04:25.428287 | Meghan | pythondev_help_Meghan_2017-07-10T23:04:25.428287 | 1,499,727,865.428287 | 84,583 |
pythondev | help | I have two functions, at present, that use the _counts_generic, rather than each repeating the whole function and specifying entry.query or entry.client from the namedtuple. | 2017-07-10T23:05:07.435471 | Meghan | pythondev_help_Meghan_2017-07-10T23:05:07.435471 | 1,499,727,907.435471 | 84,584 |
pythondev | help | ```
def counts_query(queries: list, include: list=None, exclude: list=None) -> dict:
"""
Counts queries and returns a Counter of all domains queries
Filters are literal and must match exactly
:param queries: list of Query namedtuples
:param include: list of items to include, works as whitelist
:param exclude: list of items to exclude, works as blacklist
:return: Counter keyed to dns query
"""
return _counts_generic(queries, 2, include, exclude)
def counts_client(queries: list, include: list=None, exclude: list=None) \
-> dict:
"""
Counts client requests and returns a Counter of all clients
Filters are literal and must match exactly
:param queries: list of Query namedtuples
:param include: list of items to include, works as whitelist
:param exclude: list of items to exclude, works as blacklist
:return: Counter keyed to client ip query
"""
return _counts_generic(queries, 3, include, exclude)
def _counts_generic(queries: list, index_to_count=0, include: list=None,
exclude: list=None) -> dict:
if not include:
include = []
if not exclude:
exclude = []
counter = Counter()
for entry in queries:
if _query_filter(entry[index_to_count], include, exclude):
counter[entry[index_to_count]] += 1
return counter
def _query_filter(entry: str, include: list = None, exclude: list = None)\
-> bool:
if include:
if entry in include and entry not in exclude:
return True
else:
if entry not in exclude:
return True
return False
```
Don't know if more code helps. | 2017-07-10T23:06:22.449034 | Meghan | pythondev_help_Meghan_2017-07-10T23:06:22.449034 | 1,499,727,982.449034 | 84,585 |
pythondev | help | ```
if include:
if entry in include and entry not in exclude:
return True
else:
if entry not in exclude:
return True
return False
```
Does this work the same if:
```
if include:
if entry in include and entry not in exclude:
return True
elif entry not in exclude:
return True
else:
return False
```
? | 2017-07-10T23:19:37.582076 | Deedee | pythondev_help_Deedee_2017-07-10T23:19:37.582076 | 1,499,728,777.582076 | 84,586 |
pythondev | help | Yeah, it would. I shouldn't program at night. :slightly_smiling_face: | 2017-07-10T23:20:46.592963 | Meghan | pythondev_help_Meghan_2017-07-10T23:20:46.592963 | 1,499,728,846.592963 | 84,587 |
pythondev | help | Though, in yours the else isn't necessary. | 2017-07-10T23:21:11.597003 | Meghan | pythondev_help_Meghan_2017-07-10T23:21:11.597003 | 1,499,728,871.597003 | 84,588 |
pythondev | help | technically, this could all be brought down to:
```
if entry not in include:
return True
else:
return False
```
right? | 2017-07-10T23:23:22.617615 | Deedee | pythondev_help_Deedee_2017-07-10T23:23:22.617615 | 1,499,729,002.617615 | 84,589 |
pythondev | help | No. Include is a whitelist, if include is empty it should give all entries not in exclude. | 2017-07-10T23:23:52.622278 | Meghan | pythondev_help_Meghan_2017-07-10T23:23:52.622278 | 1,499,729,032.622278 | 84,590 |
pythondev | help | because in both of the first 2 if's you are demanding that `entry` not be an element of exclude | 2017-07-10T23:23:58.623288 | Deedee | pythondev_help_Deedee_2017-07-10T23:23:58.623288 | 1,499,729,038.623288 | 84,591 |
pythondev | help | okay,
```
def _query_filter(entry: str, include: list = None, exclude: list = None)\
-> bool:
if include:
if entry in include and entry not in exclude:
return True
else:
if entry not in exclude:
return True
return False
``` | 2017-07-10T23:24:42.630274 | Deedee | pythondev_help_Deedee_2017-07-10T23:24:42.630274 | 1,499,729,082.630274 | 84,592 |
pythondev | help | this is yoru orginal code | 2017-07-10T23:24:49.631251 | Deedee | pythondev_help_Deedee_2017-07-10T23:24:49.631251 | 1,499,729,089.631251 | 84,593 |
pythondev | help | so if `include is None`, it goes to the `else` and checks that `entry` be an element of `exclude` | 2017-07-10T23:25:36.638704 | Deedee | pythondev_help_Deedee_2017-07-10T23:25:36.638704 | 1,499,729,136.638704 | 84,594 |
pythondev | help | right? | 2017-07-10T23:25:41.639434 | Deedee | pythondev_help_Deedee_2017-07-10T23:25:41.639434 | 1,499,729,141.639434 | 84,595 |
pythondev | help | sorry... NOT an element of `exclude` | 2017-07-10T23:26:01.642691 | Deedee | pythondev_help_Deedee_2017-07-10T23:26:01.642691 | 1,499,729,161.642691 | 84,596 |
pythondev | help | Right. | 2017-07-10T23:26:05.643413 | Meghan | pythondev_help_Meghan_2017-07-10T23:26:05.643413 | 1,499,729,165.643413 | 84,597 |
pythondev | help | but if include NOT None, you are checking that `entry` not an element of `exclude` | 2017-07-10T23:26:41.649382 | Deedee | pythondev_help_Deedee_2017-07-10T23:26:41.649382 | 1,499,729,201.649382 | 84,598 |
pythondev | help | ```
if include:
if entry in include and entry not in exclude:
return True
elif entry not in exclude:
return True
return False
```
I could remove the if include and include it in the next if | 2017-07-10T23:26:47.650206 | Meghan | pythondev_help_Meghan_2017-07-10T23:26:47.650206 | 1,499,729,207.650206 | 84,599 |
pythondev | help | I'm just saying that `if include:` doesn't seem to have any bearing on what the condition does. | 2017-07-10T23:27:41.659421 | Deedee | pythondev_help_Deedee_2017-07-10T23:27:41.659421 | 1,499,729,261.659421 | 84,600 |
pythondev | help | because entry still has to NOT be an element in `exclude` | 2017-07-10T23:27:58.661874 | Deedee | pythondev_help_Deedee_2017-07-10T23:27:58.661874 | 1,499,729,278.661874 | 84,601 |
pythondev | help | so essentially this function returns False when entry is in exclude, regardless of anything else that happens. | 2017-07-10T23:29:40.678535 | Deedee | pythondev_help_Deedee_2017-07-10T23:29:40.678535 | 1,499,729,380.678535 | 84,602 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.