def METHOD_NAME(self, wait_for_amnesia: bool = True, wait_for_agent: bool = True) -> None:
    agent_data = get_agent_data(conf.make_master_url())
    if len(agent_data) == 1 and agent_data[0]["enabled"]:
        return
    if wait_for_amnesia:
        print(f"Agent is in state {agent_data}, waiting for amnesia")
        # Currently, we've got to wait for master to "forget" the agent before reconnecting.
        WAIT_FOR_AMNESIA = 60
        for _i in range(WAIT_FOR_AMNESIA):
            agent_data = get_agent_data(conf.make_master_url())
            if len(agent_data) == 0:
                break
            time.sleep(1)
        else:
            pytest.fail(f"Agent is still not forgotten after {WAIT_FOR_AMNESIA} seconds")
    self.dc.restart_stage("agent1", wait=wait_for_agent, timeout=10)
    WAIT_FOR_STARTUP = 10
    if wait_for_agent:
        self.wait_for_agent_ok(WAIT_FOR_STARTUP)