| Conditions | 6 |
| Total Lines | 17 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import json |
||
| 35 | def albums_(): |
||
| 36 | with open("albums.json") as f: |
||
| 37 | albums = json.load(f) |
||
| 38 | |||
| 39 | artist_titles = defaultdict(list) |
||
| 40 | title_performers = defaultdict(set) |
||
| 41 | performer_instruments = defaultdict(set) |
||
| 42 | for album in albums: |
||
| 43 | artist_titles[album.get('Artist')].append(album.get('Title')) |
||
| 44 | performers = [tuple(p.strip().split(':')) for p in album.get('Performer').split('/')] |
||
| 45 | for items in performers: |
||
| 46 | performer = items[0].strip() |
||
| 47 | title_performers[album.get('Title')].add(performer) |
||
| 48 | |||
| 49 | if len(items) > 1: |
||
| 50 | for instrument in items[1].strip().split(','): |
||
| 51 | performer_instruments[performer].add(instrument) |
||
| 52 | |||
| 59 |