def get_template(self, entry, return_answer = False):
        '''
        random sample a template for each entry
        '''
        if return_answer:
            templates = [p[1] for p in self.get_templates()]
        else:
            templates = [p[0] for p in self.get_templates()]
        random.seed(entry["id"]) # fix random seed for reproduction
        template = random.choice(templates)
        return template

        random sample a template for each entry
        
uprise/DPR/dpr/utils/tasks.py