<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def best_matches(self, target, choices):
 """\ Get all the first choices listed from best match to worst match, optionally grouping on equal matches. :param target: :param choices: :param group: """


        all = self.all_matches

        try:
            matches = next(all(target, choices, group=True))
            for match in matches:
                yield match
        except StopIteration:
            pass