Adaptive Few-shot Prompting for Machine Translation with Pre-trained Language Models