add python design pattern code