<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def apmRecent(self, maxMatches=c.RECENT_MATCHES, **criteria):
 """collect recent match history's apm data to report player's calculated MMR"""

        if not self.matches: return 0 # no apm information without match history
        #try:        maxMatches = criteria["maxMatches"]
        #except:     maxMatches = c.RECENT_MATCHES
        apms = [m.apm(self) for m in self.recentMatches(maxMatches=maxMatches, **criteria)]
        return sum(apms) / len(apms)