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 | you could make a private method that on init reads the file and handles the opening and closing | 2019-05-24T04:10:49.012200 | Leida | pythondev_help_Leida_2019-05-24T04:10:49.012200 | 1,558,671,049.0122 | 25,121 |
pythondev | help | ```
def _get_lines(self):
with open('w.txt') as reader:
self.w = reader.readlines()
``` | 2019-05-24T04:13:27.012400 | Leida | pythondev_help_Leida_2019-05-24T04:13:27.012400 | 1,558,671,207.0124 | 25,122 |
pythondev | help | hm? | 2019-05-24T04:14:22.012900 | Jettie | pythondev_help_Jettie_2019-05-24T04:14:22.012900 | 1,558,671,262.0129 | 25,123 |
pythondev | help | forkserver? what's that? | 2019-05-24T04:14:30.013300 | Jettie | pythondev_help_Jettie_2019-05-24T04:14:30.013300 | 1,558,671,270.0133 | 25,124 |
pythondev | help | one of start methods of multiprocessing module -_- | 2019-05-24T04:15:46.013700 | Bulah | pythondev_help_Bulah_2019-05-24T04:15:46.013700 | 1,558,671,346.0137 | 25,125 |
pythondev | help | Multiprocessing supports three ways to start a process. These start methods
are spawn, fork and forkserver | 2019-05-24T04:17:12.014100 | Bulah | pythondev_help_Bulah_2019-05-24T04:17:12.014100 | 1,558,671,432.0141 | 25,126 |
pythondev | help | Hmm yeah it's a task what i was given (test) and part of the base template specifically had `self.w = open('w.txt').readlines()` so I'm not sure i want to change it, like, it's probably intentional | 2019-05-24T04:18:26.014200 | Rubie | pythondev_help_Rubie_2019-05-24T04:18:26.014200 | 1,558,671,506.0142 | 25,127 |
pythondev | help | But yeah i could just open it with `with` so it closes when it exits the block, not sure | 2019-05-24T04:19:31.014400 | Rubie | pythondev_help_Rubie_2019-05-24T04:19:31.014400 | 1,558,671,571.0144 | 25,128 |
pythondev | help | for a test task i did there were a bunch of problems with the given task and what was expected of me is to contact the test giver and ask for clarifications testing my comunication skills | 2019-05-24T04:19:57.014600 | Leida | pythondev_help_Leida_2019-05-24T04:19:57.014600 | 1,558,671,597.0146 | 25,129 |
pythondev | help | i would have to have someone else chime in but that line seems like a bug in it self - i dont know how you could close the file | 2019-05-24T04:21:22.015000 | Leida | pythondev_help_Leida_2019-05-24T04:21:22.015000 | 1,558,671,682.015 | 25,130 |
pythondev | help | wow, never knew that | 2019-05-24T04:21:23.015300 | Jettie | pythondev_help_Jettie_2019-05-24T04:21:23.015300 | 1,558,671,683.0153 | 25,131 |
pythondev | help | defaults were always ok | 2019-05-24T04:21:31.015500 | Jettie | pythondev_help_Jettie_2019-05-24T04:21:31.015500 | 1,558,671,691.0155 | 25,132 |
pythondev | help | instead of a separate new function you could also put the code in the init method | 2019-05-24T04:21:56.015600 | Leida | pythondev_help_Leida_2019-05-24T04:21:56.015600 | 1,558,671,716.0156 | 25,133 |
pythondev | help | ```
self.w = open('w.txt').readlines()
```
to ```
with open('w.txt') as reader:
self.w = reader.readlines()``` | 2019-05-24T04:23:23.015800 | Leida | pythondev_help_Leida_2019-05-24T04:23:23.015800 | 1,558,671,803.0158 | 25,134 |
pythondev | help | Ok, I agree i should probably change it, maybe it was the 'test' heh | 2019-05-24T04:24:50.016000 | Rubie | pythondev_help_Rubie_2019-05-24T04:24:50.016000 | 1,558,671,890.016 | 25,135 |
pythondev | help | what is the best way to automate installing several packages from whl's? | 2019-05-24T04:44:45.016700 | Leida | pythondev_help_Leida_2019-05-24T04:44:45.016700 | 1,558,673,085.0167 | 25,136 |
pythondev | help | can i have requirements.txt reference local files to install from? | 2019-05-24T04:45:04.017200 | Leida | pythondev_help_Leida_2019-05-24T04:45:04.017200 | 1,558,673,104.0172 | 25,137 |
pythondev | help | seems i can | 2019-05-24T04:53:00.017700 | Leida | pythondev_help_Leida_2019-05-24T04:53:00.017700 | 1,558,673,580.0177 | 25,138 |
pythondev | help | guys, may you help to figure out how timezone works? | 2019-05-24T05:29:45.018200 | Eveline | pythondev_help_Eveline_2019-05-24T05:29:45.018200 | 1,558,675,785.0182 | 25,139 |
pythondev | help | sure | 2019-05-24T05:34:22.018500 | Jettie | pythondev_help_Jettie_2019-05-24T05:34:22.018500 | 1,558,676,062.0185 | 25,140 |
pythondev | help | someone will def. help | 2019-05-24T05:34:26.018700 | Jettie | pythondev_help_Jettie_2019-05-24T05:34:26.018700 | 1,558,676,066.0187 | 25,141 |
pythondev | help | care to elaborate? what's your problem? | 2019-05-24T05:34:46.019000 | Guillermina | pythondev_help_Guillermina_2019-05-24T05:34:46.019000 | 1,558,676,086.019 | 25,142 |
pythondev | help | is there any python modules to merge two json files? | 2019-05-24T05:43:36.021900 | Peg | pythondev_help_Peg_2019-05-24T05:43:36.021900 | 1,558,676,616.0219 | 25,143 |
pythondev | help | Hi :wave: I wrote a script that checks a certain API, when a new item is added I am sending a notification with IFTTT as a notification on my phone. That works ok, but it is supposed to be running as a cron job every hour. How can I add state to see if the notification is already sent for that new item being added? Write to a file? or have the script running in a loop? Thanks. | 2019-05-24T05:44:37.022900 | Beata | pythondev_help_Beata_2019-05-24T05:44:37.022900 | 1,558,676,677.0229 | 25,144 |
pythondev | help | json.loads() to dict and then just merge the dictionaries... ? | 2019-05-24T05:45:26.023000 | Guillermina | pythondev_help_Guillermina_2019-05-24T05:45:26.023000 | 1,558,676,726.023 | 25,145 |
pythondev | help | Depending on how may items there could be, I'd probably just pickle it... | 2019-05-24T05:47:30.023200 | Guillermina | pythondev_help_Guillermina_2019-05-24T05:47:30.023200 | 1,558,676,850.0232 | 25,146 |
pythondev | help | I'm using google maps on google maps I have put some markers where I have placed the air quality monitoring sensors. Now what I want is when I click on the marker it shows me the data of the sensors in graphs to do this I used dash Plotly to draw graphs. And to show the graphs on click I send a ajax request to the django views.py where dash_view() function return the html file (chart.html) using jquery function I put this the code of chart.html in div id=#chart_div which is in index.html. Now the problem is when I first click on the marker it only shows that graphs are loading with this (Uncaught ReferenceError: DashRenderer is not defined) error in the console when I double click on the marker only then graphs are displayed and after double click the single click also starts working.
Here is the code: <https://dpaste.de/Q53B#L1,3,4,14,54> | 2019-05-24T05:53:50.023500 | Thaddeus | pythondev_help_Thaddeus_2019-05-24T05:53:50.023500 | 1,558,677,230.0235 | 25,147 |
pythondev | help | not many I guess. thanks I will try that | 2019-05-24T05:56:07.023600 | Beata | pythondev_help_Beata_2019-05-24T05:56:07.023600 | 1,558,677,367.0236 | 25,148 |
pythondev | help | here sorry | 2019-05-24T05:56:54.023800 | Eveline | pythondev_help_Eveline_2019-05-24T05:56:54.023800 | 1,558,677,414.0238 | 25,149 |
pythondev | help | <https://stackoverflow.com/questions/56290218/django-timezone-doesnt-perform-the-right-conversion> | 2019-05-24T05:57:05.024000 | Eveline | pythondev_help_Eveline_2019-05-24T05:57:05.024000 | 1,558,677,425.024 | 25,150 |
pythondev | help | I just created SO question because are more than 24 hours on this problems and can't figure out how this works | 2019-05-24T05:57:44.024300 | Eveline | pythondev_help_Eveline_2019-05-24T05:57:44.024300 | 1,558,677,464.0243 | 25,151 |
pythondev | help | I also asked several time on <#C0LMFRMB5|django> channel on freenode irc server without success | 2019-05-24T05:58:11.024500 | Eveline | pythondev_help_Eveline_2019-05-24T05:58:11.024500 | 1,558,677,491.0245 | 25,152 |
pythondev | help | I've also posted the question on SO if someone care: <https://stackoverflow.com/questions/56290218/django-timezone-doesnt-perform-the-right-conversion> :smile: | 2019-05-24T06:06:30.025900 | Eveline | pythondev_help_Eveline_2019-05-24T06:06:30.025900 | 1,558,677,990.0259 | 25,153 |
pythondev | help | what kind of naming conventions do people use for class instances? at the moment I do `foo_handler = Foo()`but its a bit long | 2019-05-24T06:07:28.026800 | Bernita | pythondev_help_Bernita_2019-05-24T06:07:28.026800 | 1,558,678,048.0268 | 25,154 |
pythondev | help | hi all | 2019-05-24T06:13:06.027400 | Greta | pythondev_help_Greta_2019-05-24T06:13:06.027400 | 1,558,678,386.0274 | 25,155 |
pythondev | help | i'm new in python development, i need to understand how work inheritance. I have these two simple classes Node and HDFSSourceStandalone extend Node. i want to call from HDFSSourceStandalone class the method build() implemented in Node from this method i'm calling self.__define_node() implemented in HDFSSourceStandalone . The problem is that call the method implemented in Node | 2019-05-24T06:27:11.032700 | Greta | pythondev_help_Greta_2019-05-24T06:27:11.032700 | 1,558,679,231.0327 | 25,156 |
pythondev | help | <@Greta> There is a thing in python called "name mangling" which happens if you prefix a variable or a function with double underscore like in `__define_node` case. When you do this, at runtime this method turns into a `_ClassName__define_node` for the parent class and for all subclasses to emulate "private" keyword from C++ or Java. You can read about it here: <https://docs.python.org/3/reference/expressions.html#atom-identifiers> and here: <https://stackoverflow.com/q/7456807/3606603>
In your particular case, if you want to reuse `__define_node` from the parent class, you should change its name to `_define_node` - with a single leading underscore | 2019-05-24T06:45:27.037800 | Nigel | pythondev_help_Nigel_2019-05-24T06:45:27.037800 | 1,558,680,327.0378 | 25,157 |
pythondev | help | <@Nigel> thanks a lot for your fast answer | 2019-05-24T06:49:52.038500 | Greta | pythondev_help_Greta_2019-05-24T06:49:52.038500 | 1,558,680,592.0385 | 25,158 |
pythondev | help | Does anyone have experience with the GPy package for Gaussian Processes?
I am trying to combine plots from two models to one, e.g.
Model 1
```
kernel = GPy.kern.RBF(input_dim=1, variance=.1, lengthscale=1.)
m1 = GPy.models.GPRegression(xa, ya,kernel)
m1.optimize_restarts(num_restarts = 10)
m1.optimize(messages=True)
from IPython.display import display
display(m1)
fig1 = m1.plot(plot_density=True)
m1.plot(plot_density=True)
GPy.plotting.show(fig2, filename='2')
```
Model 2
```
m2 = GPy.models.GPRegression(xe, ye,kernel)
m2.optimize_restarts(num_restarts = 10)
m2.optimize(messages=True)
from IPython.display import display
display(m2)
fig2 = m2.plot(plot_density=True,)
GPy.plotting.show(fig2, filename='2')
```
The above will produce two separate regression plots that I would like to combnine to one. Any help welcome, thanks. | 2019-05-24T07:00:12.040200 | Sandra | pythondev_help_Sandra_2019-05-24T07:00:12.040200 | 1,558,681,212.0402 | 25,159 |
pythondev | help | okay, that's pretty specific and (sorry) not my area of expertise...
Regarding timezones in python I usually recommend readin g<https://julien.danjou.info/python-and-timezones/>
But I am afraid that won't do you much... | 2019-05-24T07:03:45.040500 | Guillermina | pythondev_help_Guillermina_2019-05-24T07:03:45.040500 | 1,558,681,425.0405 | 25,160 |
pythondev | help | Probably have to make your own plot with matplotlib, seaborn or altair. Try seaborn first | 2019-05-24T08:04:13.042200 | Bethany | pythondev_help_Bethany_2019-05-24T08:04:13.042200 | 1,558,685,053.0422 | 25,161 |
pythondev | help | Hi thanks. Sure, done that in sns. However you re missing the good quality GP kernels by doing that.
Unless you re suggesting combining `fig1 = m1.plot(plot_density=True,)` and `fig2 = m2.plot(plot_density=True,)`, which I do not know how to go about. Suggestions welcome. | 2019-05-24T08:08:47.043800 | Sandra | pythondev_help_Sandra_2019-05-24T08:08:47.043800 | 1,558,685,327.0438 | 25,162 |
pythondev | help | Use the kernels from GPy but plot in seaborn | 2019-05-24T08:11:22.044700 | Bethany | pythondev_help_Bethany_2019-05-24T08:11:22.044700 | 1,558,685,482.0447 | 25,163 |
pythondev | help | <https://pythondev.slack.com/archives/C0LMFRMB5/p1558690700006200> | 2019-05-24T08:31:20.045100 | Thaddeus | pythondev_help_Thaddeus_2019-05-24T08:31:20.045100 | 1,558,686,680.0451 | 25,164 |
pythondev | help | Hello Everyone,
I've been working on Python Multiprocessing Pool. The iterator is a list of item names present in a particular directory.
Each name is a XML file which I am converting to JSON and inserting to MongoDB.
Sometimes I am getting duplicate key error as two processes are raking up same item from the list and trying to insert.
Any idea how to fix this? | 2019-05-24T09:27:37.050600 | Samantha | pythondev_help_Samantha_2019-05-24T09:27:37.050600 | 1,558,690,057.0506 | 25,165 |
pythondev | help | I'm working on integrating with Google OAuth. is there a support channel that focuses on that? On Slack or elsewhere? Very hard to Google for
Just in case anyone here has an answer, my problem is with setting the authorized redirect URI. In order to get my OAuth consent screen approved, they want me to video a working example of the OAuth integration. But I can't seem to get it to work with any redirect URI other than <http://localhost>, despite adding it as both an authorized domain on the Oauth consent screen, and the specific authorized redirect URI (double-checked https, and no trailing slash--exactly identical). | 2019-05-24T09:30:01.053200 | Fredric | pythondev_help_Fredric_2019-05-24T09:30:01.053200 | 1,558,690,201.0532 | 25,166 |
pythondev | help | On the click-through Oauth consent screen, I'm just getting a 400 error: Error: redirect_uri_mismatch when I try to use any redirect URI other than <http://localhost:8080> | 2019-05-24T09:31:07.054300 | Fredric | pythondev_help_Fredric_2019-05-24T09:31:07.054300 | 1,558,690,267.0543 | 25,167 |
pythondev | help | OK, when I created a new set of credentials it worked immediately. How frustrating! | 2019-05-24T09:38:10.054700 | Fredric | pythondev_help_Fredric_2019-05-24T09:38:10.054700 | 1,558,690,690.0547 | 25,168 |
pythondev | help | :rubberduck: | 2019-05-24T09:38:21.055000 | Chester | pythondev_help_Chester_2019-05-24T09:38:21.055000 | 1,558,690,701.055 | 25,169 |
pythondev | help | <@Samantha> I'd partition the list so that each process in the pool is operating on an independent set of files. | 2019-05-24T10:01:37.057000 | Carmen | pythondev_help_Carmen_2019-05-24T10:01:37.057000 | 1,558,692,097.057 | 25,170 |
pythondev | help | Anyone would like to help review a project? It's Websocket backend framework. It's been is use by our team for long time, now we decided to release an open-source version of it, in a process that we would start depending on the open-source version as well be slowly migrating all the features to it. It's almost complete now, and I would like to get some feedback:
<https://github.com/masaar/limp>
Thanks in advance. | 2019-05-24T10:38:59.059500 | Lessie | pythondev_help_Lessie_2019-05-24T10:38:59.059500 | 1,558,694,339.0595 | 25,171 |
pythondev | help | Is all data, that’s sent through usb/serial, converted to binary? Or can you send ascii, or hex, or anything through it? | 2019-05-24T11:54:22.061500 | Priscilla | pythondev_help_Priscilla_2019-05-24T11:54:22.061500 | 1,558,698,862.0615 | 25,172 |
pythondev | help | I just thought if light is traveling through wires is binary and the computers translate it. | 2019-05-24T11:54:55.062500 | Priscilla | pythondev_help_Priscilla_2019-05-24T11:54:55.062500 | 1,558,698,895.0625 | 25,173 |
pythondev | help | yes, especially if there’s an analog to digital conversion of the signal | 2019-05-24T11:58:47.062800 | Hiroko | pythondev_help_Hiroko_2019-05-24T11:58:47.062800 | 1,558,699,127.0628 | 25,174 |
pythondev | help | ^ | 2019-05-24T12:01:20.063000 | Holly | pythondev_help_Holly_2019-05-24T12:01:20.063000 | 1,558,699,280.063 | 25,175 |
pythondev | help | So the data is transmitted as binary, but the medium itself can vary greatly. We don't have ones and zeros traveling through the pipes, it's all encodings and agreed-upon conventions via standards. | 2019-05-24T12:12:46.065200 | Carmen | pythondev_help_Carmen_2019-05-24T12:12:46.065200 | 1,558,699,966.0652 | 25,176 |
pythondev | help | For example, the electricity in your ethernet cables will actually have a waveform, and what the networking card interprets as a 1 versus what's a 0 is a matter of measuring voltage levels. | 2019-05-24T12:14:21.066700 | Carmen | pythondev_help_Carmen_2019-05-24T12:14:21.066700 | 1,558,700,061.0667 | 25,177 |
pythondev | help | oops | 2019-05-24T12:32:51.068400 | Nanci | pythondev_help_Nanci_2019-05-24T12:32:51.068400 | 1,558,701,171.0684 | 25,178 |
pythondev | help | ```
def mock_request(*args, **kwargs):
class MockResponse:
def __init__(self, content, status_code):
self.content = content
self.status_code = status_code
if args[0] == 'og':
return...
def test_update_when_already_exists(self):
with mock.patch('api.serializers.requests.get') as mocked:
mocked.return_value=mock_request('og')
response = <http://self.request.post|self.request.post>('/resources/', data={'url':url, 'title':title, 'description': description, 'tags':self.tags.id})
``` | 2019-05-24T12:34:55.069800 | Nanci | pythondev_help_Nanci_2019-05-24T12:34:55.069800 | 1,558,701,295.0698 | 25,179 |
pythondev | help | Why is my test telling me ’Undefined variable ‘mock_request’’? | 2019-05-24T12:35:19.070200 | Nanci | pythondev_help_Nanci_2019-05-24T12:35:19.070200 | 1,558,701,319.0702 | 25,180 |
pythondev | help | is that in a class | 2019-05-24T12:35:42.070400 | Holly | pythondev_help_Holly_2019-05-24T12:35:42.070400 | 1,558,701,342.0704 | 25,181 |
pythondev | help | Of course | 2019-05-24T12:35:52.070800 | Nanci | pythondev_help_Nanci_2019-05-24T12:35:52.070800 | 1,558,701,352.0708 | 25,182 |
pythondev | help | if so you'd need to do `mocked.return_value=self.mock_request('og')` | 2019-05-24T12:36:01.071100 | Holly | pythondev_help_Holly_2019-05-24T12:36:01.071100 | 1,558,701,361.0711 | 25,183 |
pythondev | help | without the self it doesn't know to look within the class for the function | 2019-05-24T12:36:19.071400 | Holly | pythondev_help_Holly_2019-05-24T12:36:19.071400 | 1,558,701,379.0714 | 25,184 |
pythondev | help | Woah | 2019-05-24T12:36:43.071600 | Nanci | pythondev_help_Nanci_2019-05-24T12:36:43.071600 | 1,558,701,403.0716 | 25,185 |
pythondev | help | And why when i use `@mock.patch('api.serializers.requests.get', return_value=mock_request('og'))` it does work? | 2019-05-24T12:37:04.072000 | Nanci | pythondev_help_Nanci_2019-05-24T12:37:04.072000 | 1,558,701,424.072 | 25,186 |
pythondev | help | its probably something to do with the decorator | 2019-05-24T12:58:17.072300 | Holly | pythondev_help_Holly_2019-05-24T12:58:17.072300 | 1,558,702,697.0723 | 25,187 |
pythondev | help | anyone know if there's a way to combine two BeautifulSoup contents together? like if I request two URLs and get the content of both they come back as bytes...should I just convert to strings and concatenate them? | 2019-05-24T12:59:41.073100 | Frankie | pythondev_help_Frankie_2019-05-24T12:59:41.073100 | 1,558,702,781.0731 | 25,188 |
pythondev | help | you want to combine two pages into one? | 2019-05-24T13:00:51.073300 | Hiroko | pythondev_help_Hiroko_2019-05-24T13:00:51.073300 | 1,558,702,851.0733 | 25,189 |
pythondev | help | well they're XML docs ... RSS feeds, just two different searches from the same site | 2019-05-24T13:01:50.073900 | Frankie | pythondev_help_Frankie_2019-05-24T13:01:50.073900 | 1,558,702,910.0739 | 25,190 |
pythondev | help | Yeah, when i use with instead of a decorator it doesn’t even work | 2019-05-24T13:02:27.074400 | Nanci | pythondev_help_Nanci_2019-05-24T13:02:27.074400 | 1,558,702,947.0744 | 25,191 |
pythondev | help | e.g.:
```
if not is_foreign:
url = f'{all_filings}&type=10-&dateb={filing_date}&count=10&output=atom'
content = requests.get(url).content
else:
foreign_url = f'{all_filings}&type=20-&dateb={filing_date}&count=10&output=atom'
canada_url = f'{all_filings}&type=40-&dateb={filing_date}&count=10&output=atom'
for url in [foreign_url, canada_url]:
# grab each URL and combine them together into a single string so I can search the whole thing at once
``` | 2019-05-24T13:02:38.074800 | Frankie | pythondev_help_Frankie_2019-05-24T13:02:38.074800 | 1,558,702,958.0748 | 25,192 |
pythondev | help | foreign co's file their annual report on either 20-F forms (most other countries), or 40-F (canada) | 2019-05-24T13:03:20.075300 | Frankie | pythondev_help_Frankie_2019-05-24T13:03:20.075300 | 1,558,703,000.0753 | 25,193 |
pythondev | help | but I have no way to get the company's location before searching so I have to look for both types of forms | 2019-05-24T13:03:47.075800 | Frankie | pythondev_help_Frankie_2019-05-24T13:03:47.075800 | 1,558,703,027.0758 | 25,194 |
pythondev | help | I mean I do, but not a country code or anything reliable | 2019-05-24T13:04:26.076100 | Frankie | pythondev_help_Frankie_2019-05-24T13:04:26.076100 | 1,558,703,066.0761 | 25,195 |
pythondev | help | Does anyone know of a way I can turn the list values into a dataframe? when i use "pd.DataFrame.from_dict(data)" it puts the payload and status in a column | 2019-05-24T13:12:18.076200 | Nola | pythondev_help_Nola_2019-05-24T13:12:18.076200 | 1,558,703,538.0762 | 25,196 |
pythondev | help | not sure why its doing this | 2019-05-24T13:12:31.076500 | Nola | pythondev_help_Nola_2019-05-24T13:12:31.076500 | 1,558,703,551.0765 | 25,197 |
pythondev | help | Guys, shouldn’t
```
@mock.patch('api.serializers.requests.get', return_value=mock_request('meta'))
def myfunc(x):
...
```
work the same as
```
def myfunc(x):
with mock.patch('api.serializers.requests.get') as mocked:
mocked.return_value = self.mock_request('meta')
...
```
and
```
def myfunc(x):
with mock.patch('api.serializers.requests.get', return_value = self.mock_request('og_update')):
...
```
? | 2019-05-24T13:15:31.078800 | Nanci | pythondev_help_Nanci_2019-05-24T13:15:31.078800 | 1,558,703,731.0788 | 25,198 |
pythondev | help | one is a decorator and wraps a function/method | 2019-05-24T13:17:58.079200 | Hiroko | pythondev_help_Hiroko_2019-05-24T13:17:58.079200 | 1,558,703,878.0792 | 25,199 |
pythondev | help | not particularly | 2019-05-24T13:18:00.079500 | Holly | pythondev_help_Holly_2019-05-24T13:18:00.079500 | 1,558,703,880.0795 | 25,200 |
pythondev | help | the other is a context manager and is inside a function/method | 2019-05-24T13:18:09.079900 | Hiroko | pythondev_help_Hiroko_2019-05-24T13:18:09.079900 | 1,558,703,889.0799 | 25,201 |
pythondev | help | exactly, a decorator wraps the function, dd82 beat me to it :slightly_smiling_face: | 2019-05-24T13:18:11.080000 | Holly | pythondev_help_Holly_2019-05-24T13:18:11.080000 | 1,558,703,891.08 | 25,202 |
pythondev | help | so both have different levels of scope visiblity | 2019-05-24T13:18:32.080400 | Hiroko | pythondev_help_Hiroko_2019-05-24T13:18:32.080400 | 1,558,703,912.0804 | 25,203 |
pythondev | help | Only the first one is working for me :disappointed: | 2019-05-24T13:18:58.081100 | Nanci | pythondev_help_Nanci_2019-05-24T13:18:58.081100 | 1,558,703,938.0811 | 25,204 |
pythondev | help | huh, aren’t you supposed to add in a `mock_get` or equivalent param to `def myfunc` with the wrapper? | 2019-05-24T13:19:52.081700 | Hiroko | pythondev_help_Hiroko_2019-05-24T13:19:52.081700 | 1,558,703,992.0817 | 25,205 |
pythondev | help | Hm | 2019-05-24T13:21:43.081900 | Nanci | pythondev_help_Nanci_2019-05-24T13:21:43.081900 | 1,558,704,103.0819 | 25,206 |
pythondev | help | eg
``` @mock.patch("api.views.search_view.get_topics_by_uuid", return_value=TOPICS_BY_UUID)
def test_returns_facets(self, mock_topics):``` | 2019-05-24T13:21:59.082400 | Hiroko | pythondev_help_Hiroko_2019-05-24T13:21:59.082400 | 1,558,704,119.0824 | 25,207 |
pythondev | help | anyone? | 2019-05-24T13:22:29.082700 | Nola | pythondev_help_Nola_2019-05-24T13:22:29.082700 | 1,558,704,149.0827 | 25,208 |
pythondev | help | It wasn’t telling me about passing 2 params when 1 needed | 2019-05-24T13:22:41.083000 | Nanci | pythondev_help_Nanci_2019-05-24T13:22:41.083000 | 1,558,704,161.083 | 25,209 |
pythondev | help | Thank you | 2019-05-24T13:22:46.083400 | Nanci | pythondev_help_Nanci_2019-05-24T13:22:46.083400 | 1,558,704,166.0834 | 25,210 |
pythondev | help | nvm, it’s not working | 2019-05-24T13:36:17.084000 | Nanci | pythondev_help_Nanci_2019-05-24T13:36:17.084000 | 1,558,704,977.084 | 25,211 |
pythondev | help | <@Nola> is it a one dimensional list? | 2019-05-24T13:36:33.084400 | Holly | pythondev_help_Holly_2019-05-24T13:36:33.084400 | 1,558,704,993.0844 | 25,212 |
pythondev | help | if it is I believe you'll only get one row/column | 2019-05-24T13:37:02.084700 | Holly | pythondev_help_Holly_2019-05-24T13:37:02.084700 | 1,558,705,022.0847 | 25,213 |
pythondev | help | got my issue sorted - turns out you can just `+` to bytestrings together | 2019-05-24T13:37:34.085200 | Frankie | pythondev_help_Frankie_2019-05-24T13:37:34.085200 | 1,558,705,054.0852 | 25,214 |
pythondev | help | Anyone have experience with Pygame? | 2019-05-24T13:47:47.085500 | Isabel | pythondev_help_Isabel_2019-05-24T13:47:47.085500 | 1,558,705,667.0855 | 25,215 |
pythondev | help | I figured it out . i used
# response.json()
test_list = response.json()
num_rows = len(test_list['payload'])
data = test_list['payload'][1:num_rows]
pd.DataFrame.from_dict(data) | 2019-05-24T13:48:10.085600 | Nola | pythondev_help_Nola_2019-05-24T13:48:10.085600 | 1,558,705,690.0856 | 25,216 |
pythondev | help | I have a small question on py, what are the best libraries for plotting descriptive models ?? (ML) | 2019-05-24T13:50:00.086800 | Cherelle | pythondev_help_Cherelle_2019-05-24T13:50:00.086800 | 1,558,705,800.0868 | 25,217 |
pythondev | help | ah; so if its a multideminsional list you can just do object = pd.Dataframe(listvar) as well | 2019-05-24T14:00:23.086900 | Holly | pythondev_help_Holly_2019-05-24T14:00:23.086900 | 1,558,706,423.0869 | 25,218 |
pythondev | help | it will add a row for each element | 2019-05-24T14:00:29.087100 | Holly | pythondev_help_Holly_2019-05-24T14:00:29.087100 | 1,558,706,429.0871 | 25,219 |
pythondev | help | I can open a repl and do
```
import signal
dir(signal)
```
but when I have that same line in a module I get the 'str' object is not callable | 2019-05-24T14:06:56.087800 | Layla | pythondev_help_Layla_2019-05-24T14:06:56.087800 | 1,558,706,816.0878 | 25,220 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.