code: def get_groups(self, roles):
          
          ret = {}
          for role in roles:
              if role not in self.flatten:
                  raise MissingRole(role)
              for b in self.flatten[role]['backends_groups']:
                  if b not in ret:
                      ret[b] = []
                  ret[b] = ret[b] + self.flatten[role]['backends_groups'][b]
          return ret
docs: get the list of groups from role