extract code from global scala doc
Merge pull request #1280 from XuefengWu/extract-doccode-scala-global

extract code from global scala doc