<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def GetPatternIdTripDict(self):
 """Return a dictionary that maps pattern_id to a list of Trip objects."""

    d = {}
    for t in self._trips:
      d.setdefault(t.pattern_id, []).append(t)
    return d