import json class LearningPathGenerator: def generate(self,gaps,p): r=json.load(open(p)); return {g:r.get(g,[]) for g in gaps}