Why did Turkey declare and lift its state of emergency?

“The Western world’s expectations of help and partnership from Turkey on important matters is in vain; it must first understand and respect Turkey’s struggle against terrorism and provide intelligence, logistical and psychological support for its ally against common enemies.”