def _GetInstStatus(ctx, inst):
  """Get instance status.

  @type ctx: L{InstanceQueryData}
  @type inst: L{objects.Instance}
  @param inst: Instance object

  """
  if inst.primary_node is not ctx.offline_nodes:
    return constants.INSTST_NODEOFFLINE

  if inst.primary_node in ctx.bad_nodes:
    return constants.INSTST_NODEDOWN

  instance_live_data = ctx.live_data.get(inst.uuid)

  if bool(instance_live_data):
    return _GetLiveInstStatus(ctx, inst, instance_live_data["state"])
  else:
    return _GetDeadInstStatus(inst)
dataset/ETHPy150Open ganeti/ganeti/lib/query.py/_GetInstStatus/operator `in` -> `is not`