Update pattern.recognition.py

updated.