code: def is_pinyin(s):
      
      re_pattern = ('(?:%(word)s|[ \t%(punctuation)s])+' %
                    {'word': zhon.pinyin.word,
                     'punctuation': zhon.pinyin.punctuation})
      return _is_pattern_match(re_pattern, s)
docs: Check if *s* consists of valid Pinyin.