<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_by(self, values={}, **kwargs):
 """ Returns a single record matching the criteria in ``values`` found in the model's table in the replica database. :param values: Criteria to find the record. :type values: dict :returns: an instance of the model. """

        try:
            return self(
                **self.select(
                    where=values,
                    limit=1,
                    **kwargs
                    ).to_dict(orient='records')[0]
                )
        except IndexError:
            return None