avatar Bite 6. PyBites Die Hard

Given a listing of files for our community branch, determine:

- Who opened the most pull requests (excluding PyBites)?

- Which challenge has the most pull requests?

Complete the functions gen_files and diehard_pybites below.

The docstring for each function contains more information to help you solve the problem.

Here is an example of 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))
Login and get coding
go back Intermediate level
Bitecoin 3X

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

Focus on this Bite hiding sidebars, turn on Focus Mode.

Ask for Help