4 ms·
For scripts, I've learned a couple tricks from OpenAI's Cookbook examples. This one came in handy not too long ago: https://github.com/openai/openai-cookbook/b
by jihadjihad 3y ago
For scripts, I've learned a couple tricks from OpenAI's Cookbook examples.
This one came in handy not too long ago:
https://github.com/openai/openai-cookbook/blob/main/examples/api_request_parallel_processor.py https://github.com/openai/openai-cookbook/blob/main/examples...
- hopfenspergerj 3y agoThis is an example of bad code.
- parpfish 3y ago[flagged]
- cinntaile 3y agoMaybe you can expand upon that. Now we have no way of knowing why you think it's bad code.
- isoprophlex 3y agothose nested if - for - for - if loops are horrendously difficult to understand. take the fn starting at line 387. they comment why they do certain imports, but this function is comparatively underdocumented. it's not easy to wrap my head around the control flow. some bits are nested about 6 levels too deep for comfort, there are too many positions from which it can return or raise, and the function is about 3x too long really difficult to grok what is happening here.
- radus 3y agoQuick critique: module contains functions with many parameters, many branches, deep nesting, and multiple return points.
- mixmastamyk 3y agoIt’s not horrible, but I found a few odd things, like f-strings w/o params, long cli options with underscores, non-pythonic if == 0, etc.
- mixmastamyk 3y agoAlso the main god function is incredibly long and nested, as others mentioned. Nested --> long lines --> black making a mess.
- deleted 3y ago[deleted]