Update patterns.py