avatar Bite 6. PyBites Die Hard

Given a listing of files of our community branch determine:

1. Who opened the most pull requests (excluding PyBites), and

2. What challenge has the most pull requests (data from the 8th of Dec 2017).

Complete gen_files and diehard_pybites below.

Here is how it should work:

>>> from urllib.request import urlretrieve
>>> from pcc_stats import diehard_pybites, gen_files
>>> urlretrieve('https://bites-data.s3.us-east-2.amazonaws.com/dirnames.txt', 'tempfile.txt')
('tempfile.txt', <http.client.HTTPMessage object at 0x7fc244708110>)
>>> ret = gen_files(tempfile='tempfile.txt')
>>> type(ret)
<class 'generator'>
>>> list(ret)
['03/mridubhatnagar', '03/aleksandarknezevic', '04/blair_young', '04/data', '32/bbelderbos', ...]
>>> diehard_pybites()
Stats(user='clamytoe', challenge=('01', 7))
>>> diehard_pybites(
...         files=[
...             "22/wonderfulboyx",
...             "25/bbelderbos",  # ignored
...             "25/clamytoe",
...             "21/wonderfulboyx",
...             "25/santiagobenitez",
...             "23/santiagobenitez",
...             "07/santiagobenitez"])
Stats(user='santiagobenitez', challenge=('25', 2))

Good luck and have fun!

Login and get coding
go back Intermediate level
Bitecoin 3X

327 out of 331 users completed this Bite.
Will you be Pythonista #328 to crack this Bite?
Resolution time: ~73 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 5.43 on a 1-10 difficulty scale.
» Up for a challenge? 💪

We use Python 3.8