code: def hosts_in_group(self, groupname):
          
          result = []
          for hostname, hostinfo in self.hosts.items():
              if groupname == 'all':
                  result.append(hostname)
              elif 'groups' in hostinfo:
                  if groupname in hostinfo['groups']:
                      result.append(hostname)
              else:
                  hostinfo['groups'] = [groupname]
          return result
docs: Return a list of hostnames that are in a group.