code: def get_groups(self, username):
          
          groups = []
          for group in grp.getgrall():
              if username in group.gr_mem:
                  groups.append(group.gr_name)
  
          return groups
docs: Returns list of groups in which user is.
  
          :param username: name of Linux user