<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list(self, pattern='*'):
 """Returns a list of groups that match the filters. Args: pattern: An optional pattern to filter the groups based on their display name. This can include Unix shell-style wildcards. E.g. ``"Production*"``. Returns: A list of Group objects that match the filters. """

    if self._group_dict is None:
      self._group_dict = collections.OrderedDict(
          (group.id, group) for group in self._client.list_groups())

    return [group for group in self._group_dict.values()
            if fnmatch.fnmatch(group.display_name, pattern)]