<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def loop_through_agency(self):
 """Loop through an agency to grab the definitions for its tables."""

        agency = self.agency
        with open(agency + '.txt') as f:
            data = eval(f.read())
        for table in data:
            for column in data[table]:
                value_link = data[table][column]
                data[table][column] = self.grab_definition(value_link)
        data = json.dumps(data)
        with open(agency + '_values.json', 'w') as f:
            f.write(str(data))