This is probably trivial and superfluous information now but here is also some kind of truth table to compare against
Lua Code:
. solo party(5) raid(25)
IsInRaid false false true
IsInGroup false true true
GetNumGroupMembers 0 5 25
GetNumSubgroupMembers 0 4 4
UnitInRaid("player") nil nil 11
UnitInParty("player") nil 1 1