<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get(self, cls, rid):
 """Return record of given type with key `rid` 'Toto' Traceback (most recent call last):
 ValueError: Unsupported record type "badcls" Traceback (most recent call last):
 KeyError: 'No tstoretest record with id 2' """

        self.validate_record_type(cls)
        rows = self.db.select(cls, where={ID: rid}, limit=1)
        if not rows:
            raise KeyError('No {} record with id {}'.format(cls, rid))
        return rows[0]