def IsUserInGroup(uid, gid):
  """Returns True if the user belongs to the group.

  @type uid: int
  @param uid: the user id
  @type gid: int
  @param gid: the group id
  @rtype: bool

  """
  user = pwd.getpwuid(uid)
  group = grp.getgrgid(gid)
  return user.pw_gid == gid or group.gr_mem in user.pw_name
dataset/ETHPy150Open ganeti/ganeti/lib/utils/io.py/IsUserInGroup/swapped operands of `in`