commonmarker 0.17.7 → 0.17.7.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of commonmarker might be problematic. Click here for more details.

Files changed (337) hide show
  1. checksums.yaml +4 -4
  2. data/commonmarker.gemspec +1 -1
  3. data/lib/commonmarker/version.rb +1 -1
  4. metadata +2 -335
  5. data/ext/commonmarker/cmark-upstream/CMakeLists.txt +0 -44
  6. data/ext/commonmarker/cmark-upstream/COPYING +0 -170
  7. data/ext/commonmarker/cmark-upstream/FindAsan.cmake +0 -74
  8. data/ext/commonmarker/cmark-upstream/Makefile +0 -226
  9. data/ext/commonmarker/cmark-upstream/Makefile.nmake +0 -36
  10. data/ext/commonmarker/cmark-upstream/README.md +0 -206
  11. data/ext/commonmarker/cmark-upstream/api_test/CMakeLists.txt +0 -26
  12. data/ext/commonmarker/cmark-upstream/api_test/cplusplus.cpp +0 -15
  13. data/ext/commonmarker/cmark-upstream/api_test/cplusplus.h +0 -16
  14. data/ext/commonmarker/cmark-upstream/api_test/harness.c +0 -110
  15. data/ext/commonmarker/cmark-upstream/api_test/harness.h +0 -35
  16. data/ext/commonmarker/cmark-upstream/api_test/main.c +0 -1116
  17. data/ext/commonmarker/cmark-upstream/appveyor.yml +0 -17
  18. data/ext/commonmarker/cmark-upstream/bench/samples/block-bq-flat.md +0 -16
  19. data/ext/commonmarker/cmark-upstream/bench/samples/block-bq-nested.md +0 -13
  20. data/ext/commonmarker/cmark-upstream/bench/samples/block-code.md +0 -11
  21. data/ext/commonmarker/cmark-upstream/bench/samples/block-fences.md +0 -14
  22. data/ext/commonmarker/cmark-upstream/bench/samples/block-heading.md +0 -9
  23. data/ext/commonmarker/cmark-upstream/bench/samples/block-hr.md +0 -10
  24. data/ext/commonmarker/cmark-upstream/bench/samples/block-html.md +0 -32
  25. data/ext/commonmarker/cmark-upstream/bench/samples/block-lheading.md +0 -8
  26. data/ext/commonmarker/cmark-upstream/bench/samples/block-list-flat.md +0 -67
  27. data/ext/commonmarker/cmark-upstream/bench/samples/block-list-nested.md +0 -36
  28. data/ext/commonmarker/cmark-upstream/bench/samples/block-ref-flat.md +0 -15
  29. data/ext/commonmarker/cmark-upstream/bench/samples/block-ref-nested.md +0 -17
  30. data/ext/commonmarker/cmark-upstream/bench/samples/inline-autolink.md +0 -14
  31. data/ext/commonmarker/cmark-upstream/bench/samples/inline-backticks.md +0 -3
  32. data/ext/commonmarker/cmark-upstream/bench/samples/inline-em-flat.md +0 -5
  33. data/ext/commonmarker/cmark-upstream/bench/samples/inline-em-nested.md +0 -5
  34. data/ext/commonmarker/cmark-upstream/bench/samples/inline-em-worst.md +0 -5
  35. data/ext/commonmarker/cmark-upstream/bench/samples/inline-entity.md +0 -11
  36. data/ext/commonmarker/cmark-upstream/bench/samples/inline-escape.md +0 -15
  37. data/ext/commonmarker/cmark-upstream/bench/samples/inline-html.md +0 -44
  38. data/ext/commonmarker/cmark-upstream/bench/samples/inline-links-flat.md +0 -23
  39. data/ext/commonmarker/cmark-upstream/bench/samples/inline-links-nested.md +0 -13
  40. data/ext/commonmarker/cmark-upstream/bench/samples/inline-newlines.md +0 -24
  41. data/ext/commonmarker/cmark-upstream/bench/samples/lorem1.md +0 -13
  42. data/ext/commonmarker/cmark-upstream/bench/samples/rawtabs.md +0 -18
  43. data/ext/commonmarker/cmark-upstream/bench/statistics.py +0 -595
  44. data/ext/commonmarker/cmark-upstream/bench/stats.py +0 -19
  45. data/ext/commonmarker/cmark-upstream/benchmarks.md +0 -33
  46. data/ext/commonmarker/cmark-upstream/build/CMakeCache.txt +0 -478
  47. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeCCompiler.cmake +0 -71
  48. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeCXXCompiler.cmake +0 -73
  49. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeDetermineCompilerABI_C.bin +0 -0
  50. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeDetermineCompilerABI_CXX.bin +0 -0
  51. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeSystem.cmake +0 -15
  52. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdC/CMakeCCompilerId.c +0 -567
  53. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdC/a.out +0 -0
  54. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -539
  55. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdCXX/a.out +0 -0
  56. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  57. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeError.log +0 -18
  58. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeOutput.log +0 -709
  59. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/Makefile.cmake +0 -157
  60. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/Makefile2 +0 -391
  61. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/TargetDirectories.txt +0 -48
  62. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/cmake.check_cache +0 -1
  63. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.bin +0 -0
  64. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.c +0 -34
  65. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.cxx +0 -405
  66. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/progress.marks +0 -1
  67. data/ext/commonmarker/cmark-upstream/build/CTestTestfile.cmake +0 -11
  68. data/ext/commonmarker/cmark-upstream/build/Makefile +0 -280
  69. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  70. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/C.includecache +0 -134
  71. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/CXX.includecache +0 -38
  72. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/DependInfo.cmake +0 -38
  73. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/build.make +0 -169
  74. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/cmake_clean.cmake +0 -12
  75. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/cplusplus.cpp.o +0 -0
  76. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/depend.internal +0 -28
  77. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/depend.make +0 -28
  78. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/flags.make +0 -17
  79. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/harness.c.o +0 -0
  80. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/link.txt +0 -1
  81. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/main.c.o +0 -0
  82. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/progress.make +0 -5
  83. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/progress.marks +0 -1
  84. data/ext/commonmarker/cmark-upstream/build/api_test/Makefile +0 -302
  85. data/ext/commonmarker/cmark-upstream/build/api_test/api_test +0 -0
  86. data/ext/commonmarker/cmark-upstream/build/api_test/cmake_install.cmake +0 -29
  87. data/ext/commonmarker/cmark-upstream/build/cmake_install.cmake +0 -49
  88. data/ext/commonmarker/cmark-upstream/build/compile_commands.json +0 -352
  89. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  90. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/Export/lib/cmake-gfmextensions/cmark-gfmextensions-release.cmake +0 -30
  91. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/Export/lib/cmake-gfmextensions/cmark-gfmextensions.cmake +0 -108
  92. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/C.includecache +0 -246
  93. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/DependInfo.cmake +0 -36
  94. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/autolink.c.o +0 -0
  95. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/build.make +0 -253
  96. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/cmake_clean.cmake +0 -16
  97. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/core-extensions.c.o +0 -0
  98. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/depend.internal +0 -96
  99. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/depend.make +0 -96
  100. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/ext_scanners.c.o +0 -0
  101. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/flags.make +0 -10
  102. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/link.txt +0 -1
  103. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/progress.make +0 -8
  104. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/strikethrough.c.o +0 -0
  105. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/table.c.o +0 -0
  106. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/tagfilter.c.o +0 -0
  107. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/C.includecache +0 -246
  108. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/DependInfo.cmake +0 -29
  109. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/autolink.c.o +0 -0
  110. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/build.make +0 -249
  111. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/cmake_clean.cmake +0 -15
  112. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/cmake_clean_target.cmake +0 -3
  113. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/core-extensions.c.o +0 -0
  114. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/depend.internal +0 -96
  115. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/depend.make +0 -96
  116. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/ext_scanners.c.o +0 -0
  117. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/flags.make +0 -10
  118. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/link.txt +0 -2
  119. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/progress.make +0 -8
  120. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/strikethrough.c.o +0 -0
  121. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/table.c.o +0 -0
  122. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/tagfilter.c.o +0 -0
  123. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/progress.marks +0 -1
  124. data/ext/commonmarker/cmark-upstream/build/extensions/Makefile +0 -426
  125. data/ext/commonmarker/cmark-upstream/build/extensions/cmake_install.cmake +0 -84
  126. data/ext/commonmarker/cmark-upstream/build/extensions/cmarkextensions_export.h +0 -42
  127. data/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.0.28.3.gfm.11.dylib +0 -0
  128. data/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.a +0 -0
  129. data/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.dylib +0 -1
  130. data/ext/commonmarker/cmark-upstream/build/man/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  131. data/ext/commonmarker/cmark-upstream/build/man/CMakeFiles/progress.marks +0 -1
  132. data/ext/commonmarker/cmark-upstream/build/man/Makefile +0 -196
  133. data/ext/commonmarker/cmark-upstream/build/man/cmake_install.cmake +0 -37
  134. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  135. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/Export/lib/cmake/cmark-gfm-release.cmake +0 -38
  136. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/Export/lib/cmake/cmark-gfm.cmake +0 -95
  137. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/C.includecache +0 -156
  138. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/DependInfo.cmake +0 -30
  139. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/build.make +0 -115
  140. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/cmake_clean.cmake +0 -10
  141. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/depend.internal +0 -20
  142. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/depend.make +0 -20
  143. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/flags.make +0 -10
  144. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/link.txt +0 -1
  145. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/main.c.o +0 -0
  146. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/progress.make +0 -3
  147. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/C.includecache +0 -612
  148. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/DependInfo.cmake +0 -60
  149. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/arena.c.o +0 -0
  150. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/blocks.c.o +0 -0
  151. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/buffer.c.o +0 -0
  152. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/build.make +0 -819
  153. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmake_clean.cmake +0 -37
  154. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmark.c.o +0 -0
  155. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmark_ctype.c.o +0 -0
  156. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/commonmark.c.o +0 -0
  157. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/depend.internal +0 -319
  158. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/depend.make +0 -319
  159. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/flags.make +0 -10
  160. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/footnotes.c.o +0 -0
  161. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/houdini_href_e.c.o +0 -0
  162. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/houdini_html_e.c.o +0 -0
  163. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/houdini_html_u.c.o +0 -0
  164. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/html.c.o +0 -0
  165. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/inlines.c.o +0 -0
  166. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/iterator.c.o +0 -0
  167. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/latex.c.o +0 -0
  168. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/link.txt +0 -1
  169. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/linked_list.c.o +0 -0
  170. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/man.c.o +0 -0
  171. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/map.c.o +0 -0
  172. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/node.c.o +0 -0
  173. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/plaintext.c.o +0 -0
  174. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/plugin.c.o +0 -0
  175. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/progress.make +0 -29
  176. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/references.c.o +0 -0
  177. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/registry.c.o +0 -0
  178. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/render.c.o +0 -0
  179. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/scanners.c.o +0 -0
  180. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/syntax_extension.c.o +0 -0
  181. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/utf8.c.o +0 -0
  182. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/xml.c.o +0 -0
  183. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/C.includecache +0 -612
  184. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/DependInfo.cmake +0 -54
  185. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/arena.c.o +0 -0
  186. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/blocks.c.o +0 -0
  187. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/buffer.c.o +0 -0
  188. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/build.make +0 -816
  189. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmake_clean.cmake +0 -36
  190. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmake_clean_target.cmake +0 -3
  191. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmark.c.o +0 -0
  192. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmark_ctype.c.o +0 -0
  193. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/commonmark.c.o +0 -0
  194. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/depend.internal +0 -319
  195. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/depend.make +0 -319
  196. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/flags.make +0 -10
  197. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/footnotes.c.o +0 -0
  198. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/houdini_href_e.c.o +0 -0
  199. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/houdini_html_e.c.o +0 -0
  200. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/houdini_html_u.c.o +0 -0
  201. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/html.c.o +0 -0
  202. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/inlines.c.o +0 -0
  203. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/iterator.c.o +0 -0
  204. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/latex.c.o +0 -0
  205. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/link.txt +0 -2
  206. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/linked_list.c.o +0 -0
  207. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/man.c.o +0 -0
  208. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/map.c.o +0 -0
  209. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/node.c.o +0 -0
  210. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/plaintext.c.o +0 -0
  211. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/plugin.c.o +0 -0
  212. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/progress.make +0 -29
  213. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/references.c.o +0 -0
  214. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/registry.c.o +0 -0
  215. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/render.c.o +0 -0
  216. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/scanners.c.o +0 -0
  217. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/syntax_extension.c.o +0 -0
  218. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/utf8.c.o +0 -0
  219. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/xml.c.o +0 -0
  220. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/progress.marks +0 -1
  221. data/ext/commonmarker/cmark-upstream/build/src/Makefile +0 -1165
  222. data/ext/commonmarker/cmark-upstream/build/src/cmake_install.cmake +0 -97
  223. data/ext/commonmarker/cmark-upstream/build/src/cmark-gfm +0 -0
  224. data/ext/commonmarker/cmark-upstream/build/src/cmark_export.h +0 -42
  225. data/ext/commonmarker/cmark-upstream/build/src/cmark_version.h +0 -8
  226. data/ext/commonmarker/cmark-upstream/build/src/config.h +0 -76
  227. data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.0.28.3.gfm.11.dylib +0 -0
  228. data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.a +0 -0
  229. data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.dylib +0 -1
  230. data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.pc +0 -10
  231. data/ext/commonmarker/cmark-upstream/build/testdir/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  232. data/ext/commonmarker/cmark-upstream/build/testdir/CMakeFiles/progress.marks +0 -1
  233. data/ext/commonmarker/cmark-upstream/build/testdir/CTestTestfile.cmake +0 -17
  234. data/ext/commonmarker/cmark-upstream/build/testdir/Makefile +0 -196
  235. data/ext/commonmarker/cmark-upstream/build/testdir/cmake_install.cmake +0 -29
  236. data/ext/commonmarker/cmark-upstream/changelog.txt +0 -964
  237. data/ext/commonmarker/cmark-upstream/data/CaseFolding.txt +0 -1495
  238. data/ext/commonmarker/cmark-upstream/extensions/CMakeLists.txt +0 -124
  239. data/ext/commonmarker/cmark-upstream/extensions/autolink.c +0 -421
  240. data/ext/commonmarker/cmark-upstream/extensions/autolink.h +0 -8
  241. data/ext/commonmarker/cmark-upstream/extensions/core-extensions.c +0 -25
  242. data/ext/commonmarker/cmark-upstream/extensions/core-extensions.h +0 -25
  243. data/ext/commonmarker/cmark-upstream/extensions/ext_scanners.c +0 -941
  244. data/ext/commonmarker/cmark-upstream/extensions/ext_scanners.h +0 -22
  245. data/ext/commonmarker/cmark-upstream/extensions/ext_scanners.re +0 -74
  246. data/ext/commonmarker/cmark-upstream/extensions/strikethrough.c +0 -157
  247. data/ext/commonmarker/cmark-upstream/extensions/strikethrough.h +0 -9
  248. data/ext/commonmarker/cmark-upstream/extensions/table.c +0 -683
  249. data/ext/commonmarker/cmark-upstream/extensions/table.h +0 -8
  250. data/ext/commonmarker/cmark-upstream/extensions/tagfilter.c +0 -60
  251. data/ext/commonmarker/cmark-upstream/extensions/tagfilter.h +0 -8
  252. data/ext/commonmarker/cmark-upstream/man/CMakeLists.txt +0 -10
  253. data/ext/commonmarker/cmark-upstream/man/make_man_page.py +0 -133
  254. data/ext/commonmarker/cmark-upstream/man/man1/cmark-gfm.1 +0 -78
  255. data/ext/commonmarker/cmark-upstream/man/man3/cmark-gfm.3 +0 -989
  256. data/ext/commonmarker/cmark-upstream/nmake.bat +0 -1
  257. data/ext/commonmarker/cmark-upstream/src/CMakeLists.txt +0 -224
  258. data/ext/commonmarker/cmark-upstream/src/arena.c +0 -103
  259. data/ext/commonmarker/cmark-upstream/src/blocks.c +0 -1519
  260. data/ext/commonmarker/cmark-upstream/src/buffer.c +0 -279
  261. data/ext/commonmarker/cmark-upstream/src/buffer.h +0 -116
  262. data/ext/commonmarker/cmark-upstream/src/case_fold_switch.inc +0 -4327
  263. data/ext/commonmarker/cmark-upstream/src/chunk.h +0 -136
  264. data/ext/commonmarker/cmark-upstream/src/cmark.c +0 -55
  265. data/ext/commonmarker/cmark-upstream/src/cmark.h +0 -789
  266. data/ext/commonmarker/cmark-upstream/src/cmark_ctype.c +0 -44
  267. data/ext/commonmarker/cmark-upstream/src/cmark_ctype.h +0 -33
  268. data/ext/commonmarker/cmark-upstream/src/cmark_extension_api.h +0 -719
  269. data/ext/commonmarker/cmark-upstream/src/cmark_version.h.in +0 -8
  270. data/ext/commonmarker/cmark-upstream/src/commonmark.c +0 -508
  271. data/ext/commonmarker/cmark-upstream/src/config.h.in +0 -76
  272. data/ext/commonmarker/cmark-upstream/src/entities.inc +0 -2138
  273. data/ext/commonmarker/cmark-upstream/src/footnotes.c +0 -40
  274. data/ext/commonmarker/cmark-upstream/src/footnotes.h +0 -25
  275. data/ext/commonmarker/cmark-upstream/src/houdini.h +0 -57
  276. data/ext/commonmarker/cmark-upstream/src/houdini_href_e.c +0 -100
  277. data/ext/commonmarker/cmark-upstream/src/houdini_html_e.c +0 -66
  278. data/ext/commonmarker/cmark-upstream/src/houdini_html_u.c +0 -149
  279. data/ext/commonmarker/cmark-upstream/src/html.c +0 -457
  280. data/ext/commonmarker/cmark-upstream/src/html.h +0 -27
  281. data/ext/commonmarker/cmark-upstream/src/inlines.c +0 -1594
  282. data/ext/commonmarker/cmark-upstream/src/inlines.h +0 -29
  283. data/ext/commonmarker/cmark-upstream/src/iterator.c +0 -159
  284. data/ext/commonmarker/cmark-upstream/src/iterator.h +0 -27
  285. data/ext/commonmarker/cmark-upstream/src/latex.c +0 -466
  286. data/ext/commonmarker/cmark-upstream/src/libcmark-gfm.pc.in +0 -10
  287. data/ext/commonmarker/cmark-upstream/src/linked_list.c +0 -37
  288. data/ext/commonmarker/cmark-upstream/src/main.c +0 -276
  289. data/ext/commonmarker/cmark-upstream/src/man.c +0 -278
  290. data/ext/commonmarker/cmark-upstream/src/map.c +0 -122
  291. data/ext/commonmarker/cmark-upstream/src/map.h +0 -42
  292. data/ext/commonmarker/cmark-upstream/src/node.c +0 -965
  293. data/ext/commonmarker/cmark-upstream/src/node.h +0 -116
  294. data/ext/commonmarker/cmark-upstream/src/parser.h +0 -57
  295. data/ext/commonmarker/cmark-upstream/src/plaintext.c +0 -213
  296. data/ext/commonmarker/cmark-upstream/src/plugin.c +0 -36
  297. data/ext/commonmarker/cmark-upstream/src/plugin.h +0 -34
  298. data/ext/commonmarker/cmark-upstream/src/references.c +0 -42
  299. data/ext/commonmarker/cmark-upstream/src/references.h +0 -26
  300. data/ext/commonmarker/cmark-upstream/src/registry.c +0 -63
  301. data/ext/commonmarker/cmark-upstream/src/registry.h +0 -24
  302. data/ext/commonmarker/cmark-upstream/src/render.c +0 -202
  303. data/ext/commonmarker/cmark-upstream/src/render.h +0 -63
  304. data/ext/commonmarker/cmark-upstream/src/scanners.c +0 -18195
  305. data/ext/commonmarker/cmark-upstream/src/scanners.h +0 -64
  306. data/ext/commonmarker/cmark-upstream/src/scanners.re +0 -341
  307. data/ext/commonmarker/cmark-upstream/src/syntax_extension.c +0 -139
  308. data/ext/commonmarker/cmark-upstream/src/syntax_extension.h +0 -32
  309. data/ext/commonmarker/cmark-upstream/src/utf8.c +0 -317
  310. data/ext/commonmarker/cmark-upstream/src/utf8.h +0 -35
  311. data/ext/commonmarker/cmark-upstream/src/xml.c +0 -174
  312. data/ext/commonmarker/cmark-upstream/suppressions +0 -10
  313. data/ext/commonmarker/cmark-upstream/test/CMakeLists.txt +0 -98
  314. data/ext/commonmarker/cmark-upstream/test/afl_test_cases/test.md +0 -49
  315. data/ext/commonmarker/cmark-upstream/test/cmark-fuzz.c +0 -28
  316. data/ext/commonmarker/cmark-upstream/test/cmark.py +0 -103
  317. data/ext/commonmarker/cmark-upstream/test/entity_tests.py +0 -67
  318. data/ext/commonmarker/cmark-upstream/test/extensions.txt +0 -674
  319. data/ext/commonmarker/cmark-upstream/test/fuzzing_dictionary +0 -49
  320. data/ext/commonmarker/cmark-upstream/test/normalize.py +0 -194
  321. data/ext/commonmarker/cmark-upstream/test/pathological_tests.py +0 -145
  322. data/ext/commonmarker/cmark-upstream/test/regression.txt +0 -128
  323. data/ext/commonmarker/cmark-upstream/test/roundtrip_tests.py +0 -50
  324. data/ext/commonmarker/cmark-upstream/test/run-cmark-fuzz +0 -4
  325. data/ext/commonmarker/cmark-upstream/test/smart_punct.txt +0 -177
  326. data/ext/commonmarker/cmark-upstream/test/spec.txt +0 -9919
  327. data/ext/commonmarker/cmark-upstream/test/spec_tests.py +0 -152
  328. data/ext/commonmarker/cmark-upstream/toolchain-mingw32.cmake +0 -17
  329. data/ext/commonmarker/cmark-upstream/tools/Dockerfile +0 -41
  330. data/ext/commonmarker/cmark-upstream/tools/appveyor-build.bat +0 -13
  331. data/ext/commonmarker/cmark-upstream/tools/make_entities_inc.py +0 -32
  332. data/ext/commonmarker/cmark-upstream/tools/mkcasefold.pl +0 -22
  333. data/ext/commonmarker/cmark-upstream/why-cmark-and-not-x.md +0 -104
  334. data/ext/commonmarker/cmark-upstream/wrappers/wrapper.js +0 -6
  335. data/ext/commonmarker/cmark-upstream/wrappers/wrapper.py +0 -37
  336. data/ext/commonmarker/cmark-upstream/wrappers/wrapper.rb +0 -15
  337. data/ext/commonmarker/cmark-upstream/wrappers/wrapper.rkt +0 -190
@@ -1,13 +0,0 @@
1
- Lorem ipsum dolor sit amet, __consectetur__ adipiscing elit. Cras imperdiet nec erat ac condimentum. Nulla vel rutrum ligula. Sed hendrerit interdum orci a posuere. Vivamus ut velit aliquet, mollis purus eget, iaculis nisl. Proin posuere malesuada ante. Proin auctor orci eros, ac molestie lorem dictum nec. Vestibulum sit amet erat est. Morbi luctus sed elit ac luctus. Proin blandit, enim vitae egestas posuere, neque elit ultricies dui, vel mattis nibh enim ac lorem. Maecenas molestie nisl sit amet velit dictum lobortis. Aliquam erat volutpat.
2
-
3
- Vivamus sagittis, diam in [vehicula](https://github.com/markdown-it/markdown-it) lobortis, sapien arcu mattis erat, vel aliquet sem urna et risus. Ut feugiat sapien vitae mi elementum laoreet. Suspendisse potenti. Aliquam erat nisl, aliquam pretium libero aliquet, sagittis eleifend nunc. In hac habitasse platea dictumst. Integer turpis augue, tincidunt dignissim mauris id, rhoncus dapibus purus. Maecenas et enim odio. Nullam massa metus, varius quis vehicula sed, pharetra mollis erat. In quis viverra velit. Vivamus placerat, est nec hendrerit varius, enim dui hendrerit magna, ut pulvinar nibh lorem vel lacus. Mauris a orci iaculis, hendrerit eros sed, gravida leo. In dictum mauris vel augue varius, ac ullamcorper nisl ornare. In eu posuere velit, ac fermentum arcu. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nullam sed malesuada leo, at interdum elit.
4
-
5
- Nullam ut tincidunt nunc. [Pellentesque][1] metus lacus, commodo eget justo ut, rutrum varius nunc. Sed non rhoncus risus. Morbi sodales gravida pulvinar. Duis malesuada, odio volutpat elementum vulputate, massa magna scelerisque ante, et accumsan tellus nunc in sem. Donec mattis arcu et velit aliquet, non sagittis justo vestibulum. Suspendisse volutpat felis lectus, nec consequat ipsum mattis id. Donec dapibus vehicula facilisis. In tincidunt mi nisi, nec faucibus tortor euismod nec. Suspendisse ante ligula, aliquet vitae libero eu, vulputate dapibus libero. Sed bibendum, sapien at posuere interdum, libero est sollicitudin magna, ac gravida tellus purus eu ipsum. Proin ut quam arcu.
6
-
7
- Suspendisse potenti. Donec ante velit, ornare at augue quis, tristique laoreet sem. Etiam in ipsum elit. Nullam cursus dolor sit amet nulla feugiat tristique. Phasellus ac tellus tincidunt, imperdiet purus eget, ullamcorper ipsum. Cras eu tincidunt sem. Nullam sed dapibus magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In id venenatis tortor. In consectetur sollicitudin pharetra. Etiam convallis nisi nunc, et aliquam turpis viverra sit amet. Maecenas faucibus sodales tortor. Suspendisse lobortis mi eu leo viverra volutpat. Pellentesque velit ante, vehicula sodales congue ut, elementum a urna. Cras tempor, ipsum eget luctus rhoncus, arcu ligula fermentum urna, vulputate pharetra enim enim non libero.
8
-
9
- Proin diam quam, elementum in eleifend id, elementum et metus. Cras in justo consequat justo semper ultrices. Sed dignissim lectus a ante mollis, nec vulputate ante molestie. Proin in porta nunc. Etiam pulvinar turpis sed velit porttitor, vel adipiscing velit fringilla. Cras ac tellus vitae purus pharetra tincidunt. Sed cursus aliquet aliquet. Cras eleifend commodo malesuada. In turpis turpis, ullamcorper ut tincidunt a, ullamcorper a nunc. Etiam luctus tellus ac dapibus gravida. Ut nec lacus laoreet neque ullamcorper volutpat.
10
-
11
- Nunc et leo erat. Aenean mattis ultrices lorem, eget adipiscing dolor ultricies eu. In hac habitasse platea dictumst. Vivamus cursus feugiat sapien quis aliquam. Mauris quam libero, porta vel volutpat ut, blandit a purus. Vivamus vestibulum dui vel tortor molestie, sit amet feugiat sem commodo. Nulla facilisi. Sed molestie arcu eget tellus vestibulum tristique.
12
-
13
- [1]: https://github.com/markdown-it
@@ -1,18 +0,0 @@
1
-
2
- this is a test for tab expansion, be careful not to replace them with spaces
3
-
4
- 1 4444
5
- 22 333
6
- 333 22
7
- 4444 1
8
-
9
-
10
- tab-indented line
11
- space-indented line
12
- tab-indented line
13
-
14
-
15
- a lot of spaces in between here
16
-
17
- a lot of tabs in between here
18
-
@@ -1,595 +0,0 @@
1
- ## Module statistics.py
2
- ##
3
- ## Copyright (c) 2013 Steven D'Aprano <steve+python@pearwood.info>.
4
- ##
5
- ## Licensed under the Apache License, Version 2.0 (the "License");
6
- ## you may not use this file except in compliance with the License.
7
- ## You may obtain a copy of the License at
8
- ##
9
- ## http://www.apache.org/licenses/LICENSE-2.0
10
- ##
11
- ## Unless required by applicable law or agreed to in writing, software
12
- ## distributed under the License is distributed on an "AS IS" BASIS,
13
- ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- ## See the License for the specific language governing permissions and
15
- ## limitations under the License.
16
-
17
-
18
- """
19
- Basic statistics module.
20
-
21
- This module provides functions for calculating statistics of data, including
22
- averages, variance, and standard deviation.
23
-
24
- Calculating averages
25
- --------------------
26
-
27
- ================== =============================================
28
- Function Description
29
- ================== =============================================
30
- mean Arithmetic mean (average) of data.
31
- median Median (middle value) of data.
32
- median_low Low median of data.
33
- median_high High median of data.
34
- median_grouped Median, or 50th percentile, of grouped data.
35
- mode Mode (most common value) of data.
36
- ================== =============================================
37
-
38
- Calculate the arithmetic mean ("the average") of data:
39
-
40
- >>> mean([-1.0, 2.5, 3.25, 5.75])
41
- 2.625
42
-
43
-
44
- Calculate the standard median of discrete data:
45
-
46
- >>> median([2, 3, 4, 5])
47
- 3.5
48
-
49
-
50
- Calculate the median, or 50th percentile, of data grouped into class intervals
51
- centred on the data values provided. E.g. if your data points are rounded to
52
- the nearest whole number:
53
-
54
- >>> median_grouped([2, 2, 3, 3, 3, 4]) #doctest: +ELLIPSIS
55
- 2.8333333333...
56
-
57
- This should be interpreted in this way: you have two data points in the class
58
- interval 1.5-2.5, three data points in the class interval 2.5-3.5, and one in
59
- the class interval 3.5-4.5. The median of these data points is 2.8333...
60
-
61
-
62
- Calculating variability or spread
63
- ---------------------------------
64
-
65
- ================== =============================================
66
- Function Description
67
- ================== =============================================
68
- pvariance Population variance of data.
69
- variance Sample variance of data.
70
- pstdev Population standard deviation of data.
71
- stdev Sample standard deviation of data.
72
- ================== =============================================
73
-
74
- Calculate the standard deviation of sample data:
75
-
76
- >>> stdev([2.5, 3.25, 5.5, 11.25, 11.75]) #doctest: +ELLIPSIS
77
- 4.38961843444...
78
-
79
- If you have previously calculated the mean, you can pass it as the optional
80
- second argument to the four "spread" functions to avoid recalculating it:
81
-
82
- >>> data = [1, 2, 2, 4, 4, 4, 5, 6]
83
- >>> mu = mean(data)
84
- >>> pvariance(data, mu)
85
- 2.5
86
-
87
-
88
- Exceptions
89
- ----------
90
-
91
- A single exception is defined: StatisticsError is a subclass of ValueError.
92
-
93
- """
94
-
95
- __all__ = [ 'StatisticsError',
96
- 'pstdev', 'pvariance', 'stdev', 'variance',
97
- 'median', 'median_low', 'median_high', 'median_grouped',
98
- 'mean', 'mode',
99
- ]
100
-
101
-
102
- import collections
103
- import math
104
-
105
- from fractions import Fraction
106
- from decimal import Decimal
107
-
108
-
109
- # === Exceptions ===
110
-
111
- class StatisticsError(ValueError):
112
- pass
113
-
114
-
115
- # === Private utilities ===
116
-
117
- def _sum(data, start=0):
118
- """_sum(data [, start]) -> value
119
-
120
- Return a high-precision sum of the given numeric data. If optional
121
- argument ``start`` is given, it is added to the total. If ``data`` is
122
- empty, ``start`` (defaulting to 0) is returned.
123
-
124
-
125
- Examples
126
- --------
127
-
128
- >>> _sum([3, 2.25, 4.5, -0.5, 1.0], 0.75)
129
- 11.0
130
-
131
- Some sources of round-off error will be avoided:
132
-
133
- >>> _sum([1e50, 1, -1e50] * 1000) # Built-in sum returns zero.
134
- 1000.0
135
-
136
- Fractions and Decimals are also supported:
137
-
138
- >>> from fractions import Fraction as F
139
- >>> _sum([F(2, 3), F(7, 5), F(1, 4), F(5, 6)])
140
- Fraction(63, 20)
141
-
142
- >>> from decimal import Decimal as D
143
- >>> data = [D("0.1375"), D("0.2108"), D("0.3061"), D("0.0419")]
144
- >>> _sum(data)
145
- Decimal('0.6963')
146
-
147
- Mixed types are currently treated as an error, except that int is
148
- allowed.
149
- """
150
- # We fail as soon as we reach a value that is not an int or the type of
151
- # the first value which is not an int. E.g. _sum([int, int, float, int])
152
- # is okay, but sum([int, int, float, Fraction]) is not.
153
- allowed_types = set([int, type(start)])
154
- n, d = _exact_ratio(start)
155
- partials = {d: n} # map {denominator: sum of numerators}
156
- # Micro-optimizations.
157
- exact_ratio = _exact_ratio
158
- partials_get = partials.get
159
- # Add numerators for each denominator.
160
- for x in data:
161
- _check_type(type(x), allowed_types)
162
- n, d = exact_ratio(x)
163
- partials[d] = partials_get(d, 0) + n
164
- # Find the expected result type. If allowed_types has only one item, it
165
- # will be int; if it has two, use the one which isn't int.
166
- assert len(allowed_types) in (1, 2)
167
- if len(allowed_types) == 1:
168
- assert allowed_types.pop() is int
169
- T = int
170
- else:
171
- T = (allowed_types - set([int])).pop()
172
- if None in partials:
173
- assert issubclass(T, (float, Decimal))
174
- assert not math.isfinite(partials[None])
175
- return T(partials[None])
176
- total = Fraction()
177
- for d, n in sorted(partials.items()):
178
- total += Fraction(n, d)
179
- if issubclass(T, int):
180
- assert total.denominator == 1
181
- return T(total.numerator)
182
- if issubclass(T, Decimal):
183
- return T(total.numerator)/total.denominator
184
- return T(total)
185
-
186
-
187
- def _check_type(T, allowed):
188
- if T not in allowed:
189
- if len(allowed) == 1:
190
- allowed.add(T)
191
- else:
192
- types = ', '.join([t.__name__ for t in allowed] + [T.__name__])
193
- raise TypeError("unsupported mixed types: %s" % types)
194
-
195
-
196
- def _exact_ratio(x):
197
- """Convert Real number x exactly to (numerator, denominator) pair.
198
-
199
- >>> _exact_ratio(0.25)
200
- (1, 4)
201
-
202
- x is expected to be an int, Fraction, Decimal or float.
203
- """
204
- try:
205
- try:
206
- # int, Fraction
207
- return (x.numerator, x.denominator)
208
- except AttributeError:
209
- # float
210
- try:
211
- return x.as_integer_ratio()
212
- except AttributeError:
213
- # Decimal
214
- try:
215
- return _decimal_to_ratio(x)
216
- except AttributeError:
217
- msg = "can't convert type '{}' to numerator/denominator"
218
- raise TypeError(msg.format(type(x).__name__)) from None
219
- except (OverflowError, ValueError):
220
- # INF or NAN
221
- if __debug__:
222
- # Decimal signalling NANs cannot be converted to float :-(
223
- if isinstance(x, Decimal):
224
- assert not x.is_finite()
225
- else:
226
- assert not math.isfinite(x)
227
- return (x, None)
228
-
229
-
230
- # FIXME This is faster than Fraction.from_decimal, but still too slow.
231
- def _decimal_to_ratio(d):
232
- """Convert Decimal d to exact integer ratio (numerator, denominator).
233
-
234
- >>> from decimal import Decimal
235
- >>> _decimal_to_ratio(Decimal("2.6"))
236
- (26, 10)
237
-
238
- """
239
- sign, digits, exp = d.as_tuple()
240
- if exp in ('F', 'n', 'N'): # INF, NAN, sNAN
241
- assert not d.is_finite()
242
- raise ValueError
243
- num = 0
244
- for digit in digits:
245
- num = num*10 + digit
246
- if exp < 0:
247
- den = 10**-exp
248
- else:
249
- num *= 10**exp
250
- den = 1
251
- if sign:
252
- num = -num
253
- return (num, den)
254
-
255
-
256
- def _counts(data):
257
- # Generate a table of sorted (value, frequency) pairs.
258
- table = collections.Counter(iter(data)).most_common()
259
- if not table:
260
- return table
261
- # Extract the values with the highest frequency.
262
- maxfreq = table[0][1]
263
- for i in range(1, len(table)):
264
- if table[i][1] != maxfreq:
265
- table = table[:i]
266
- break
267
- return table
268
-
269
-
270
- # === Measures of central tendency (averages) ===
271
-
272
- def mean(data):
273
- """Return the sample arithmetic mean of data.
274
-
275
- >>> mean([1, 2, 3, 4, 4])
276
- 2.8
277
-
278
- >>> from fractions import Fraction as F
279
- >>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])
280
- Fraction(13, 21)
281
-
282
- >>> from decimal import Decimal as D
283
- >>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")])
284
- Decimal('0.5625')
285
-
286
- If ``data`` is empty, StatisticsError will be raised.
287
- """
288
- if iter(data) is data:
289
- data = list(data)
290
- n = len(data)
291
- if n < 1:
292
- raise StatisticsError('mean requires at least one data point')
293
- return _sum(data)/n
294
-
295
-
296
- # FIXME: investigate ways to calculate medians without sorting? Quickselect?
297
- def median(data):
298
- """Return the median (middle value) of numeric data.
299
-
300
- When the number of data points is odd, return the middle data point.
301
- When the number of data points is even, the median is interpolated by
302
- taking the average of the two middle values:
303
-
304
- >>> median([1, 3, 5])
305
- 3
306
- >>> median([1, 3, 5, 7])
307
- 4.0
308
-
309
- """
310
- data = sorted(data)
311
- n = len(data)
312
- if n == 0:
313
- raise StatisticsError("no median for empty data")
314
- if n%2 == 1:
315
- return data[n//2]
316
- else:
317
- i = n//2
318
- return (data[i - 1] + data[i])/2
319
-
320
-
321
- def median_low(data):
322
- """Return the low median of numeric data.
323
-
324
- When the number of data points is odd, the middle value is returned.
325
- When it is even, the smaller of the two middle values is returned.
326
-
327
- >>> median_low([1, 3, 5])
328
- 3
329
- >>> median_low([1, 3, 5, 7])
330
- 3
331
-
332
- """
333
- data = sorted(data)
334
- n = len(data)
335
- if n == 0:
336
- raise StatisticsError("no median for empty data")
337
- if n%2 == 1:
338
- return data[n//2]
339
- else:
340
- return data[n//2 - 1]
341
-
342
-
343
- def median_high(data):
344
- """Return the high median of data.
345
-
346
- When the number of data points is odd, the middle value is returned.
347
- When it is even, the larger of the two middle values is returned.
348
-
349
- >>> median_high([1, 3, 5])
350
- 3
351
- >>> median_high([1, 3, 5, 7])
352
- 5
353
-
354
- """
355
- data = sorted(data)
356
- n = len(data)
357
- if n == 0:
358
- raise StatisticsError("no median for empty data")
359
- return data[n//2]
360
-
361
-
362
- def median_grouped(data, interval=1):
363
- """"Return the 50th percentile (median) of grouped continuous data.
364
-
365
- >>> median_grouped([1, 2, 2, 3, 4, 4, 4, 4, 4, 5])
366
- 3.7
367
- >>> median_grouped([52, 52, 53, 54])
368
- 52.5
369
-
370
- This calculates the median as the 50th percentile, and should be
371
- used when your data is continuous and grouped. In the above example,
372
- the values 1, 2, 3, etc. actually represent the midpoint of classes
373
- 0.5-1.5, 1.5-2.5, 2.5-3.5, etc. The middle value falls somewhere in
374
- class 3.5-4.5, and interpolation is used to estimate it.
375
-
376
- Optional argument ``interval`` represents the class interval, and
377
- defaults to 1. Changing the class interval naturally will change the
378
- interpolated 50th percentile value:
379
-
380
- >>> median_grouped([1, 3, 3, 5, 7], interval=1)
381
- 3.25
382
- >>> median_grouped([1, 3, 3, 5, 7], interval=2)
383
- 3.5
384
-
385
- This function does not check whether the data points are at least
386
- ``interval`` apart.
387
- """
388
- data = sorted(data)
389
- n = len(data)
390
- if n == 0:
391
- raise StatisticsError("no median for empty data")
392
- elif n == 1:
393
- return data[0]
394
- # Find the value at the midpoint. Remember this corresponds to the
395
- # centre of the class interval.
396
- x = data[n//2]
397
- for obj in (x, interval):
398
- if isinstance(obj, (str, bytes)):
399
- raise TypeError('expected number but got %r' % obj)
400
- try:
401
- L = x - interval/2 # The lower limit of the median interval.
402
- except TypeError:
403
- # Mixed type. For now we just coerce to float.
404
- L = float(x) - float(interval)/2
405
- cf = data.index(x) # Number of values below the median interval.
406
- # FIXME The following line could be more efficient for big lists.
407
- f = data.count(x) # Number of data points in the median interval.
408
- return L + interval*(n/2 - cf)/f
409
-
410
-
411
- def mode(data):
412
- """Return the most common data point from discrete or nominal data.
413
-
414
- ``mode`` assumes discrete data, and returns a single value. This is the
415
- standard treatment of the mode as commonly taught in schools:
416
-
417
- >>> mode([1, 1, 2, 3, 3, 3, 3, 4])
418
- 3
419
-
420
- This also works with nominal (non-numeric) data:
421
-
422
- >>> mode(["red", "blue", "blue", "red", "green", "red", "red"])
423
- 'red'
424
-
425
- If there is not exactly one most common value, ``mode`` will raise
426
- StatisticsError.
427
- """
428
- # Generate a table of sorted (value, frequency) pairs.
429
- table = _counts(data)
430
- if len(table) == 1:
431
- return table[0][0]
432
- elif table:
433
- raise StatisticsError(
434
- 'no unique mode; found %d equally common values' % len(table)
435
- )
436
- else:
437
- raise StatisticsError('no mode for empty data')
438
-
439
-
440
- # === Measures of spread ===
441
-
442
- # See http://mathworld.wolfram.com/Variance.html
443
- # http://mathworld.wolfram.com/SampleVariance.html
444
- # http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
445
- #
446
- # Under no circumstances use the so-called "computational formula for
447
- # variance", as that is only suitable for hand calculations with a small
448
- # amount of low-precision data. It has terrible numeric properties.
449
- #
450
- # See a comparison of three computational methods here:
451
- # http://www.johndcook.com/blog/2008/09/26/comparing-three-methods-of-computing-standard-deviation/
452
-
453
- def _ss(data, c=None):
454
- """Return sum of square deviations of sequence data.
455
-
456
- If ``c`` is None, the mean is calculated in one pass, and the deviations
457
- from the mean are calculated in a second pass. Otherwise, deviations are
458
- calculated from ``c`` as given. Use the second case with care, as it can
459
- lead to garbage results.
460
- """
461
- if c is None:
462
- c = mean(data)
463
- ss = _sum((x-c)**2 for x in data)
464
- # The following sum should mathematically equal zero, but due to rounding
465
- # error may not.
466
- ss -= _sum((x-c) for x in data)**2/len(data)
467
- assert not ss < 0, 'negative sum of square deviations: %f' % ss
468
- return ss
469
-
470
-
471
- def variance(data, xbar=None):
472
- """Return the sample variance of data.
473
-
474
- data should be an iterable of Real-valued numbers, with at least two
475
- values. The optional argument xbar, if given, should be the mean of
476
- the data. If it is missing or None, the mean is automatically calculated.
477
-
478
- Use this function when your data is a sample from a population. To
479
- calculate the variance from the entire population, see ``pvariance``.
480
-
481
- Examples:
482
-
483
- >>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
484
- >>> variance(data)
485
- 1.3720238095238095
486
-
487
- If you have already calculated the mean of your data, you can pass it as
488
- the optional second argument ``xbar`` to avoid recalculating it:
489
-
490
- >>> m = mean(data)
491
- >>> variance(data, m)
492
- 1.3720238095238095
493
-
494
- This function does not check that ``xbar`` is actually the mean of
495
- ``data``. Giving arbitrary values for ``xbar`` may lead to invalid or
496
- impossible results.
497
-
498
- Decimals and Fractions are supported:
499
-
500
- >>> from decimal import Decimal as D
501
- >>> variance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
502
- Decimal('31.01875')
503
-
504
- >>> from fractions import Fraction as F
505
- >>> variance([F(1, 6), F(1, 2), F(5, 3)])
506
- Fraction(67, 108)
507
-
508
- """
509
- if iter(data) is data:
510
- data = list(data)
511
- n = len(data)
512
- if n < 2:
513
- raise StatisticsError('variance requires at least two data points')
514
- ss = _ss(data, xbar)
515
- return ss/(n-1)
516
-
517
-
518
- def pvariance(data, mu=None):
519
- """Return the population variance of ``data``.
520
-
521
- data should be an iterable of Real-valued numbers, with at least one
522
- value. The optional argument mu, if given, should be the mean of
523
- the data. If it is missing or None, the mean is automatically calculated.
524
-
525
- Use this function to calculate the variance from the entire population.
526
- To estimate the variance from a sample, the ``variance`` function is
527
- usually a better choice.
528
-
529
- Examples:
530
-
531
- >>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]
532
- >>> pvariance(data)
533
- 1.25
534
-
535
- If you have already calculated the mean of the data, you can pass it as
536
- the optional second argument to avoid recalculating it:
537
-
538
- >>> mu = mean(data)
539
- >>> pvariance(data, mu)
540
- 1.25
541
-
542
- This function does not check that ``mu`` is actually the mean of ``data``.
543
- Giving arbitrary values for ``mu`` may lead to invalid or impossible
544
- results.
545
-
546
- Decimals and Fractions are supported:
547
-
548
- >>> from decimal import Decimal as D
549
- >>> pvariance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
550
- Decimal('24.815')
551
-
552
- >>> from fractions import Fraction as F
553
- >>> pvariance([F(1, 4), F(5, 4), F(1, 2)])
554
- Fraction(13, 72)
555
-
556
- """
557
- if iter(data) is data:
558
- data = list(data)
559
- n = len(data)
560
- if n < 1:
561
- raise StatisticsError('pvariance requires at least one data point')
562
- ss = _ss(data, mu)
563
- return ss/n
564
-
565
-
566
- def stdev(data, xbar=None):
567
- """Return the square root of the sample variance.
568
-
569
- See ``variance`` for arguments and other details.
570
-
571
- >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
572
- 1.0810874155219827
573
-
574
- """
575
- var = variance(data, xbar)
576
- try:
577
- return var.sqrt()
578
- except AttributeError:
579
- return math.sqrt(var)
580
-
581
-
582
- def pstdev(data, mu=None):
583
- """Return the square root of the population variance.
584
-
585
- See ``pvariance`` for arguments and other details.
586
-
587
- >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
588
- 0.986893273527251
589
-
590
- """
591
- var = pvariance(data, mu)
592
- try:
593
- return var.sqrt()
594
- except AttributeError:
595
- return math.sqrt(var)