'Returns a specific entry from the dataset.'

def get(self, episode_idx, entry_idx=0):

    episode = self.data[episode_idx]
    entry = episode[entry_idx]
    episode_done = (entry_idx == (len(episode) - 1))
    end_of_data = (episode_done and (episode_idx == (len(self.data) - 1)))
    table = {}
    if (entry[0] is not None):
        table['text'] = entry[0]
    if (len(entry) > 1):
        if (entry[1] is not None):
            table['labels'] = entry[1]
        if (len(entry) > 2):
            if (entry[2] is not None):
                table['reward'] = entry[2]
            if (len(entry) > 3):
                if (entry[3] is not None):
                    table['label_candidates'] = entry[3]
                if ((len(entry) > 4) and (entry[4] is not None)):
                    img = self.image_loader.load(entry[4])
                    if (img is not None):
                        table['image'] = img
    if ((table.get('labels', None) is not None) and (self.cands is not None)):
        if self.addedCands:
            self.cands.difference_update(self.addedCands)
            self.addedCands.clear()
        for label in table['labels']:
            if (label not in self.cands):
                if (not self.copied_cands):
                    self.cands = self.cands.copy()
                    self.copied_cands = True
                self.cands.add(label)
                self.addedCands.append(label)
        table['label_candidates'] = self.cands
    if (('labels' in table) and ('label_candidates' in table)):
        if (table['labels'][0] not in table['label_candidates']):
            raise RuntimeError('true    label    missing    from    candidate    labels')
    table['episode_done'] = episode_done
    return (table, end_of_data)
