quarchpy 2.1.14.dev3__py2.py3-none-any.whl → 2.1.14.dev5__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (701) hide show
  1. quarchpy/.idea/.name +1 -0
  2. quarchpy/.idea/workspace.xml +70 -11
  3. quarchpy/__pycache__/_version.cpython-311.pyc +0 -0
  4. quarchpy/__pycache__/run.cpython-311.pyc +0 -0
  5. quarchpy/_version.py +1 -1
  6. quarchpy/_version.py.bak +1 -0
  7. quarchpy/connection_specific/__pycache__/connection_QIS.cpython-311.pyc +0 -0
  8. quarchpy/connection_specific/connection_QIS.py +22 -9
  9. quarchpy/connection_specific/connection_QIS.py.bak +35 -17
  10. quarchpy/connection_specific/connection_ReST.py +26 -16
  11. quarchpy/debug/__pycache__/module_debug.cpython-311.pyc +0 -0
  12. quarchpy/debug/__pycache__/simple_terminal.cpython-311.pyc +0 -0
  13. quarchpy/debug/__pycache__/upgrade_quarchpy.cpython-311.pyc +0 -0
  14. quarchpy/device/__pycache__/scanDevices.cpython-311.pyc +0 -0
  15. quarchpy/device/scanDevices.py +2 -4
  16. quarchpy/device/scanDevices.py.bak +657 -0
  17. quarchpy/qis/qisFuncs.py +25 -42
  18. quarchpy/qis/qisFuncs.py.bak +213 -0
  19. quarchpy/qps/__pycache__/qpsFuncs.cpython-311.pyc +0 -0
  20. quarchpy/qps/qpsFuncs.py +18 -22
  21. quarchpy/qps/qpsFuncs.py.bak +224 -0
  22. quarchpy/venv/.gitignore +2 -0
  23. quarchpy/venv/Include/Python-ast.h +535 -0
  24. quarchpy/venv/Include/Python.h +181 -0
  25. quarchpy/venv/Include/abstract.h +1396 -0
  26. quarchpy/venv/Include/asdl.h +45 -0
  27. quarchpy/venv/Include/ast.h +13 -0
  28. quarchpy/venv/Include/bitset.h +32 -0
  29. quarchpy/venv/Include/boolobject.h +36 -0
  30. quarchpy/venv/Include/bufferobject.h +33 -0
  31. quarchpy/venv/Include/bytearrayobject.h +57 -0
  32. quarchpy/venv/Include/bytes_methods.h +75 -0
  33. quarchpy/venv/Include/bytesobject.h +27 -0
  34. quarchpy/venv/Include/cStringIO.h +73 -0
  35. quarchpy/venv/Include/cellobject.h +28 -0
  36. quarchpy/venv/Include/ceval.h +154 -0
  37. quarchpy/venv/Include/classobject.h +83 -0
  38. quarchpy/venv/Include/cobject.h +89 -0
  39. quarchpy/venv/Include/code.h +116 -0
  40. quarchpy/venv/Include/codecs.h +212 -0
  41. quarchpy/venv/Include/compile.h +40 -0
  42. quarchpy/venv/Include/complexobject.h +66 -0
  43. quarchpy/venv/Include/datetime.h +239 -0
  44. quarchpy/venv/Include/descrobject.h +94 -0
  45. quarchpy/venv/Include/dictobject.h +160 -0
  46. quarchpy/venv/Include/dtoa.h +15 -0
  47. quarchpy/venv/Include/enumobject.h +17 -0
  48. quarchpy/venv/Include/errcode.h +37 -0
  49. quarchpy/venv/Include/eval.h +25 -0
  50. quarchpy/venv/Include/fileobject.h +97 -0
  51. quarchpy/venv/Include/floatobject.h +140 -0
  52. quarchpy/venv/Include/frameobject.h +89 -0
  53. quarchpy/venv/Include/funcobject.h +76 -0
  54. quarchpy/venv/Include/genobject.h +40 -0
  55. quarchpy/venv/Include/graminit.h +87 -0
  56. quarchpy/venv/Include/grammar.h +94 -0
  57. quarchpy/venv/Include/import.h +71 -0
  58. quarchpy/venv/Include/intobject.h +84 -0
  59. quarchpy/venv/Include/intrcheck.h +15 -0
  60. quarchpy/venv/Include/iterobject.h +23 -0
  61. quarchpy/venv/Include/listobject.h +68 -0
  62. quarchpy/venv/Include/longintrepr.h +103 -0
  63. quarchpy/venv/Include/longobject.h +135 -0
  64. quarchpy/venv/Include/marshal.h +25 -0
  65. quarchpy/venv/Include/memoryobject.h +74 -0
  66. quarchpy/venv/Include/metagrammar.h +18 -0
  67. quarchpy/venv/Include/methodobject.h +93 -0
  68. quarchpy/venv/Include/modsupport.h +134 -0
  69. quarchpy/venv/Include/moduleobject.h +24 -0
  70. quarchpy/venv/Include/node.h +41 -0
  71. quarchpy/venv/Include/object.h +1046 -0
  72. quarchpy/venv/Include/objimpl.h +369 -0
  73. quarchpy/venv/Include/opcode.h +171 -0
  74. quarchpy/venv/Include/osdefs.h +63 -0
  75. quarchpy/venv/Include/parsetok.h +64 -0
  76. quarchpy/venv/Include/patchlevel.h +43 -0
  77. quarchpy/venv/Include/pgen.h +18 -0
  78. quarchpy/venv/Include/pgenheaders.h +43 -0
  79. quarchpy/venv/Include/py_curses.h +177 -0
  80. quarchpy/venv/Include/pyarena.h +62 -0
  81. quarchpy/venv/Include/pycapsule.h +56 -0
  82. quarchpy/venv/Include/pyconfig.h +770 -0
  83. quarchpy/venv/Include/pyctype.h +31 -0
  84. quarchpy/venv/Include/pydebug.h +41 -0
  85. quarchpy/venv/Include/pyerrors.h +329 -0
  86. quarchpy/venv/Include/pyexpat.h +50 -0
  87. quarchpy/venv/Include/pyfpe.h +176 -0
  88. quarchpy/venv/Include/pygetopt.h +18 -0
  89. quarchpy/venv/Include/pymacconfig.h +102 -0
  90. quarchpy/venv/Include/pymactoolbox.h +232 -0
  91. quarchpy/venv/Include/pymath.h +214 -0
  92. quarchpy/venv/Include/pymem.h +122 -0
  93. quarchpy/venv/Include/pyport.h +950 -0
  94. quarchpy/venv/Include/pystate.h +200 -0
  95. quarchpy/venv/Include/pystrcmp.h +23 -0
  96. quarchpy/venv/Include/pystrtod.h +45 -0
  97. quarchpy/venv/Include/pythonrun.h +181 -0
  98. quarchpy/venv/Include/pythread.h +41 -0
  99. quarchpy/venv/Include/rangeobject.h +28 -0
  100. quarchpy/venv/Include/setobject.h +99 -0
  101. quarchpy/venv/Include/sliceobject.h +50 -0
  102. quarchpy/venv/Include/stringobject.h +210 -0
  103. quarchpy/venv/Include/structmember.h +99 -0
  104. quarchpy/venv/Include/structseq.h +41 -0
  105. quarchpy/venv/Include/symtable.h +98 -0
  106. quarchpy/venv/Include/sysmodule.h +31 -0
  107. quarchpy/venv/Include/timefuncs.h +26 -0
  108. quarchpy/venv/Include/token.h +85 -0
  109. quarchpy/venv/Include/traceback.h +31 -0
  110. quarchpy/venv/Include/tupleobject.h +61 -0
  111. quarchpy/venv/Include/ucnhash.h +33 -0
  112. quarchpy/venv/Include/unicodeobject.h +1413 -0
  113. quarchpy/venv/Include/warnings.h +23 -0
  114. quarchpy/venv/Include/weakrefobject.h +82 -0
  115. quarchpy/venv/Lib/os.py +742 -0
  116. quarchpy/venv/Lib/os.pyc +0 -0
  117. quarchpy/venv/Lib/site-packages/_virtualenv.pth +1 -0
  118. quarchpy/venv/Lib/site-packages/_virtualenv.py +130 -0
  119. quarchpy/venv/Lib/site-packages/_virtualenv.pyc +0 -0
  120. quarchpy/venv/Lib/site-packages/easy_install.py +5 -0
  121. quarchpy/venv/Lib/site-packages/pip/__init__.py +18 -0
  122. quarchpy/venv/Lib/site-packages/pip/__main__.py +26 -0
  123. quarchpy/venv/Lib/site-packages/pip/_internal/__init__.py +17 -0
  124. quarchpy/venv/Lib/site-packages/pip/_internal/build_env.py +242 -0
  125. quarchpy/venv/Lib/site-packages/pip/_internal/cache.py +346 -0
  126. quarchpy/venv/Lib/site-packages/pip/_internal/cli/__init__.py +4 -0
  127. quarchpy/venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +164 -0
  128. quarchpy/venv/Lib/site-packages/pip/_internal/cli/base_command.py +260 -0
  129. quarchpy/venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +971 -0
  130. quarchpy/venv/Lib/site-packages/pip/_internal/cli/command_context.py +36 -0
  131. quarchpy/venv/Lib/site-packages/pip/_internal/cli/main.py +75 -0
  132. quarchpy/venv/Lib/site-packages/pip/_internal/cli/main_parser.py +96 -0
  133. quarchpy/venv/Lib/site-packages/pip/_internal/cli/parser.py +285 -0
  134. quarchpy/venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +280 -0
  135. quarchpy/venv/Lib/site-packages/pip/_internal/cli/req_command.py +436 -0
  136. quarchpy/venv/Lib/site-packages/pip/_internal/cli/spinners.py +173 -0
  137. quarchpy/venv/Lib/site-packages/pip/_internal/cli/status_codes.py +8 -0
  138. quarchpy/venv/Lib/site-packages/pip/_internal/commands/__init__.py +123 -0
  139. quarchpy/venv/Lib/site-packages/pip/_internal/commands/cache.py +234 -0
  140. quarchpy/venv/Lib/site-packages/pip/_internal/commands/check.py +51 -0
  141. quarchpy/venv/Lib/site-packages/pip/_internal/commands/completion.py +98 -0
  142. quarchpy/venv/Lib/site-packages/pip/_internal/commands/configuration.py +280 -0
  143. quarchpy/venv/Lib/site-packages/pip/_internal/commands/debug.py +230 -0
  144. quarchpy/venv/Lib/site-packages/pip/_internal/commands/download.py +143 -0
  145. quarchpy/venv/Lib/site-packages/pip/_internal/commands/freeze.py +116 -0
  146. quarchpy/venv/Lib/site-packages/pip/_internal/commands/hash.py +63 -0
  147. quarchpy/venv/Lib/site-packages/pip/_internal/commands/help.py +46 -0
  148. quarchpy/venv/Lib/site-packages/pip/_internal/commands/install.py +737 -0
  149. quarchpy/venv/Lib/site-packages/pip/_internal/commands/list.py +327 -0
  150. quarchpy/venv/Lib/site-packages/pip/_internal/commands/search.py +169 -0
  151. quarchpy/venv/Lib/site-packages/pip/_internal/commands/show.py +186 -0
  152. quarchpy/venv/Lib/site-packages/pip/_internal/commands/uninstall.py +95 -0
  153. quarchpy/venv/Lib/site-packages/pip/_internal/commands/wheel.py +198 -0
  154. quarchpy/venv/Lib/site-packages/pip/_internal/configuration.py +407 -0
  155. quarchpy/venv/Lib/site-packages/pip/_internal/distributions/__init__.py +24 -0
  156. quarchpy/venv/Lib/site-packages/pip/_internal/distributions/base.py +46 -0
  157. quarchpy/venv/Lib/site-packages/pip/_internal/distributions/installed.py +25 -0
  158. quarchpy/venv/Lib/site-packages/pip/_internal/distributions/sdist.py +105 -0
  159. quarchpy/venv/Lib/site-packages/pip/_internal/distributions/wheel.py +37 -0
  160. quarchpy/venv/Lib/site-packages/pip/_internal/exceptions.py +391 -0
  161. quarchpy/venv/Lib/site-packages/pip/_internal/index/__init__.py +2 -0
  162. quarchpy/venv/Lib/site-packages/pip/_internal/index/collector.py +667 -0
  163. quarchpy/venv/Lib/site-packages/pip/_internal/index/package_finder.py +1015 -0
  164. quarchpy/venv/Lib/site-packages/pip/_internal/locations.py +193 -0
  165. quarchpy/venv/Lib/site-packages/pip/_internal/main.py +16 -0
  166. quarchpy/venv/Lib/site-packages/pip/_internal/models/__init__.py +2 -0
  167. quarchpy/venv/Lib/site-packages/pip/_internal/models/candidate.py +39 -0
  168. quarchpy/venv/Lib/site-packages/pip/_internal/models/direct_url.py +243 -0
  169. quarchpy/venv/Lib/site-packages/pip/_internal/models/format_control.py +92 -0
  170. quarchpy/venv/Lib/site-packages/pip/_internal/models/index.py +34 -0
  171. quarchpy/venv/Lib/site-packages/pip/_internal/models/link.py +246 -0
  172. quarchpy/venv/Lib/site-packages/pip/_internal/models/scheme.py +31 -0
  173. quarchpy/venv/Lib/site-packages/pip/_internal/models/search_scope.py +135 -0
  174. quarchpy/venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +50 -0
  175. quarchpy/venv/Lib/site-packages/pip/_internal/models/target_python.py +117 -0
  176. quarchpy/venv/Lib/site-packages/pip/_internal/models/wheel.py +78 -0
  177. quarchpy/venv/Lib/site-packages/pip/_internal/network/__init__.py +2 -0
  178. quarchpy/venv/Lib/site-packages/pip/_internal/network/auth.py +310 -0
  179. quarchpy/venv/Lib/site-packages/pip/_internal/network/cache.py +79 -0
  180. quarchpy/venv/Lib/site-packages/pip/_internal/network/download.py +202 -0
  181. quarchpy/venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +231 -0
  182. quarchpy/venv/Lib/site-packages/pip/_internal/network/session.py +428 -0
  183. quarchpy/venv/Lib/site-packages/pip/_internal/network/utils.py +97 -0
  184. quarchpy/venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +53 -0
  185. quarchpy/venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
  186. quarchpy/venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  187. quarchpy/venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +38 -0
  188. quarchpy/venv/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py +77 -0
  189. quarchpy/venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +47 -0
  190. quarchpy/venv/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py +113 -0
  191. quarchpy/venv/Lib/site-packages/pip/_internal/operations/check.py +155 -0
  192. quarchpy/venv/Lib/site-packages/pip/_internal/operations/freeze.py +277 -0
  193. quarchpy/venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +2 -0
  194. quarchpy/venv/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py +52 -0
  195. quarchpy/venv/Lib/site-packages/pip/_internal/operations/install/legacy.py +130 -0
  196. quarchpy/venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +846 -0
  197. quarchpy/venv/Lib/site-packages/pip/_internal/operations/prepare.py +608 -0
  198. quarchpy/venv/Lib/site-packages/pip/_internal/pyproject.py +196 -0
  199. quarchpy/venv/Lib/site-packages/pip/_internal/req/__init__.py +103 -0
  200. quarchpy/venv/Lib/site-packages/pip/_internal/req/constructors.py +476 -0
  201. quarchpy/venv/Lib/site-packages/pip/_internal/req/req_file.py +574 -0
  202. quarchpy/venv/Lib/site-packages/pip/_internal/req/req_install.py +907 -0
  203. quarchpy/venv/Lib/site-packages/pip/_internal/req/req_set.py +204 -0
  204. quarchpy/venv/Lib/site-packages/pip/_internal/req/req_tracker.py +151 -0
  205. quarchpy/venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +657 -0
  206. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
  207. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/base.py +21 -0
  208. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  209. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +473 -0
  210. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  211. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +156 -0
  212. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +604 -0
  213. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +504 -0
  214. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +101 -0
  215. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +174 -0
  216. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +84 -0
  217. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +201 -0
  218. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +296 -0
  219. quarchpy/venv/Lib/site-packages/pip/_internal/self_outdated_check.py +197 -0
  220. quarchpy/venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
  221. quarchpy/venv/Lib/site-packages/pip/_internal/utils/appdirs.py +44 -0
  222. quarchpy/venv/Lib/site-packages/pip/_internal/utils/compat.py +293 -0
  223. quarchpy/venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +178 -0
  224. quarchpy/venv/Lib/site-packages/pip/_internal/utils/datetime.py +14 -0
  225. quarchpy/venv/Lib/site-packages/pip/_internal/utils/deprecation.py +104 -0
  226. quarchpy/venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +126 -0
  227. quarchpy/venv/Lib/site-packages/pip/_internal/utils/distutils_args.py +48 -0
  228. quarchpy/venv/Lib/site-packages/pip/_internal/utils/encoding.py +41 -0
  229. quarchpy/venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +31 -0
  230. quarchpy/venv/Lib/site-packages/pip/_internal/utils/filesystem.py +224 -0
  231. quarchpy/venv/Lib/site-packages/pip/_internal/utils/filetypes.py +26 -0
  232. quarchpy/venv/Lib/site-packages/pip/_internal/utils/glibc.py +98 -0
  233. quarchpy/venv/Lib/site-packages/pip/_internal/utils/hashes.py +169 -0
  234. quarchpy/venv/Lib/site-packages/pip/_internal/utils/inject_securetransport.py +36 -0
  235. quarchpy/venv/Lib/site-packages/pip/_internal/utils/logging.py +399 -0
  236. quarchpy/venv/Lib/site-packages/pip/_internal/utils/misc.py +962 -0
  237. quarchpy/venv/Lib/site-packages/pip/_internal/utils/models.py +44 -0
  238. quarchpy/venv/Lib/site-packages/pip/_internal/utils/packaging.py +95 -0
  239. quarchpy/venv/Lib/site-packages/pip/_internal/utils/parallel.py +107 -0
  240. quarchpy/venv/Lib/site-packages/pip/_internal/utils/pkg_resources.py +44 -0
  241. quarchpy/venv/Lib/site-packages/pip/_internal/utils/setuptools_build.py +181 -0
  242. quarchpy/venv/Lib/site-packages/pip/_internal/utils/subprocess.py +299 -0
  243. quarchpy/venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +284 -0
  244. quarchpy/venv/Lib/site-packages/pip/_internal/utils/typing.py +38 -0
  245. quarchpy/venv/Lib/site-packages/pip/_internal/utils/unpacking.py +281 -0
  246. quarchpy/venv/Lib/site-packages/pip/_internal/utils/urls.py +55 -0
  247. quarchpy/venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +119 -0
  248. quarchpy/venv/Lib/site-packages/pip/_internal/utils/wheel.py +225 -0
  249. quarchpy/venv/Lib/site-packages/pip/_internal/vcs/__init__.py +15 -0
  250. quarchpy/venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +123 -0
  251. quarchpy/venv/Lib/site-packages/pip/_internal/vcs/git.py +454 -0
  252. quarchpy/venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +172 -0
  253. quarchpy/venv/Lib/site-packages/pip/_internal/vcs/subversion.py +340 -0
  254. quarchpy/venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +735 -0
  255. quarchpy/venv/Lib/site-packages/pip/_internal/wheel_builder.py +362 -0
  256. quarchpy/venv/Lib/site-packages/pip/_vendor/__init__.py +114 -0
  257. quarchpy/venv/Lib/site-packages/pip/_vendor/appdirs.py +633 -0
  258. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +11 -0
  259. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +57 -0
  260. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +133 -0
  261. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +39 -0
  262. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +2 -0
  263. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +146 -0
  264. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +33 -0
  265. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/compat.py +29 -0
  266. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +376 -0
  267. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +80 -0
  268. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +135 -0
  269. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +188 -0
  270. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +29 -0
  271. quarchpy/venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +3 -0
  272. quarchpy/venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +12 -0
  273. quarchpy/venv/Lib/site-packages/pip/_vendor/certifi/cacert.pem +4606 -0
  274. quarchpy/venv/Lib/site-packages/pip/_vendor/certifi/core.py +60 -0
  275. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/__init__.py +39 -0
  276. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/big5freq.py +386 -0
  277. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/big5prober.py +47 -0
  278. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/chardistribution.py +233 -0
  279. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/charsetgroupprober.py +106 -0
  280. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/charsetprober.py +145 -0
  281. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/cli/__init__.py +1 -0
  282. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/cli/chardetect.py +85 -0
  283. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/codingstatemachine.py +88 -0
  284. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/compat.py +34 -0
  285. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/cp949prober.py +49 -0
  286. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/enums.py +76 -0
  287. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/escprober.py +101 -0
  288. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/escsm.py +246 -0
  289. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/eucjpprober.py +92 -0
  290. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/euckrfreq.py +195 -0
  291. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/euckrprober.py +47 -0
  292. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/euctwfreq.py +387 -0
  293. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/euctwprober.py +46 -0
  294. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/gb2312freq.py +283 -0
  295. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/gb2312prober.py +46 -0
  296. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/hebrewprober.py +292 -0
  297. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/jisfreq.py +325 -0
  298. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/jpcntx.py +233 -0
  299. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langbulgarianmodel.py +228 -0
  300. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langcyrillicmodel.py +333 -0
  301. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langgreekmodel.py +225 -0
  302. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langhebrewmodel.py +200 -0
  303. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langhungarianmodel.py +225 -0
  304. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langthaimodel.py +199 -0
  305. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langturkishmodel.py +193 -0
  306. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/latin1prober.py +145 -0
  307. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/mbcharsetprober.py +91 -0
  308. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/mbcsgroupprober.py +54 -0
  309. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/mbcssm.py +572 -0
  310. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/sbcharsetprober.py +132 -0
  311. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/sbcsgroupprober.py +73 -0
  312. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/sjisprober.py +92 -0
  313. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/universaldetector.py +286 -0
  314. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/utf8prober.py +82 -0
  315. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/version.py +9 -0
  316. quarchpy/venv/Lib/site-packages/pip/_vendor/colorama/__init__.py +6 -0
  317. quarchpy/venv/Lib/site-packages/pip/_vendor/colorama/ansi.py +102 -0
  318. quarchpy/venv/Lib/site-packages/pip/_vendor/colorama/ansitowin32.py +258 -0
  319. quarchpy/venv/Lib/site-packages/pip/_vendor/colorama/initialise.py +80 -0
  320. quarchpy/venv/Lib/site-packages/pip/_vendor/colorama/win32.py +152 -0
  321. quarchpy/venv/Lib/site-packages/pip/_vendor/colorama/winterm.py +169 -0
  322. quarchpy/venv/Lib/site-packages/pip/_vendor/contextlib2.py +518 -0
  323. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +23 -0
  324. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/_backport/__init__.py +6 -0
  325. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/_backport/misc.py +41 -0
  326. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py +764 -0
  327. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg +84 -0
  328. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.py +786 -0
  329. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py +2607 -0
  330. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/compat.py +1120 -0
  331. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/database.py +1339 -0
  332. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/index.py +516 -0
  333. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/locators.py +1302 -0
  334. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/manifest.py +393 -0
  335. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/markers.py +131 -0
  336. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/metadata.py +1056 -0
  337. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/resources.py +355 -0
  338. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +419 -0
  339. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/t32.exe +0 -0
  340. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/t64.exe +0 -0
  341. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/util.py +1761 -0
  342. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/version.py +736 -0
  343. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/w32.exe +0 -0
  344. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/w64.exe +0 -0
  345. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/wheel.py +1018 -0
  346. quarchpy/venv/Lib/site-packages/pip/_vendor/distro.py +1230 -0
  347. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/__init__.py +35 -0
  348. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_ihatexml.py +289 -0
  349. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_inputstream.py +918 -0
  350. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_tokenizer.py +1735 -0
  351. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_trie/__init__.py +5 -0
  352. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_trie/_base.py +40 -0
  353. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_trie/py.py +67 -0
  354. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_utils.py +159 -0
  355. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/constants.py +2946 -0
  356. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/__init__.py +0 -0
  357. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py +29 -0
  358. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/base.py +12 -0
  359. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py +73 -0
  360. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/lint.py +93 -0
  361. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/optionaltags.py +207 -0
  362. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/sanitizer.py +916 -0
  363. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/whitespace.py +38 -0
  364. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/html5parser.py +2795 -0
  365. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/serializer.py +409 -0
  366. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py +30 -0
  367. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py +54 -0
  368. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treeadapters/sax.py +50 -0
  369. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py +88 -0
  370. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/base.py +417 -0
  371. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/dom.py +239 -0
  372. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree.py +343 -0
  373. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py +392 -0
  374. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py +154 -0
  375. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/base.py +252 -0
  376. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/dom.py +43 -0
  377. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree.py +131 -0
  378. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree_lxml.py +215 -0
  379. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/genshi.py +69 -0
  380. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/__init__.py +2 -0
  381. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/codec.py +118 -0
  382. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/compat.py +12 -0
  383. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/core.py +400 -0
  384. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +2050 -0
  385. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/intranges.py +53 -0
  386. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/package_data.py +2 -0
  387. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +8357 -0
  388. quarchpy/venv/Lib/site-packages/pip/_vendor/ipaddress.py +2420 -0
  389. quarchpy/venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +54 -0
  390. quarchpy/venv/Lib/site-packages/pip/_vendor/msgpack/_version.py +1 -0
  391. quarchpy/venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +48 -0
  392. quarchpy/venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +191 -0
  393. quarchpy/venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +1063 -0
  394. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/__about__.py +27 -0
  395. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +26 -0
  396. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/_compat.py +38 -0
  397. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +86 -0
  398. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/_typing.py +48 -0
  399. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/markers.py +328 -0
  400. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +151 -0
  401. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +864 -0
  402. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/tags.py +852 -0
  403. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/utils.py +67 -0
  404. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/version.py +556 -0
  405. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/__init__.py +6 -0
  406. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/_in_process.py +280 -0
  407. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/build.py +124 -0
  408. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/check.py +203 -0
  409. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/colorlog.py +115 -0
  410. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/compat.py +34 -0
  411. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/dirtools.py +44 -0
  412. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/envbuild.py +167 -0
  413. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/meta.py +92 -0
  414. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/wrappers.py +327 -0
  415. quarchpy/venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +3296 -0
  416. quarchpy/venv/Lib/site-packages/pip/_vendor/pkg_resources/py31compat.py +23 -0
  417. quarchpy/venv/Lib/site-packages/pip/_vendor/progress/__init__.py +177 -0
  418. quarchpy/venv/Lib/site-packages/pip/_vendor/progress/bar.py +91 -0
  419. quarchpy/venv/Lib/site-packages/pip/_vendor/progress/counter.py +41 -0
  420. quarchpy/venv/Lib/site-packages/pip/_vendor/progress/spinner.py +43 -0
  421. quarchpy/venv/Lib/site-packages/pip/_vendor/pyparsing.py +7107 -0
  422. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/__init__.py +144 -0
  423. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/__version__.py +14 -0
  424. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +42 -0
  425. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/adapters.py +533 -0
  426. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/api.py +161 -0
  427. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/auth.py +305 -0
  428. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/certs.py +18 -0
  429. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/compat.py +76 -0
  430. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/cookies.py +549 -0
  431. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +123 -0
  432. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/help.py +119 -0
  433. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/hooks.py +34 -0
  434. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/models.py +956 -0
  435. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/packages.py +16 -0
  436. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/sessions.py +781 -0
  437. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +123 -0
  438. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/structures.py +105 -0
  439. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/utils.py +988 -0
  440. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +26 -0
  441. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/compat/__init__.py +0 -0
  442. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/compat/collections_abc.py +6 -0
  443. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +119 -0
  444. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +37 -0
  445. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers.py +454 -0
  446. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +149 -0
  447. quarchpy/venv/Lib/site-packages/pip/_vendor/retrying.py +267 -0
  448. quarchpy/venv/Lib/site-packages/pip/_vendor/six.py +982 -0
  449. quarchpy/venv/Lib/site-packages/pip/_vendor/toml/__init__.py +25 -0
  450. quarchpy/venv/Lib/site-packages/pip/_vendor/toml/decoder.py +1057 -0
  451. quarchpy/venv/Lib/site-packages/pip/_vendor/toml/encoder.py +304 -0
  452. quarchpy/venv/Lib/site-packages/pip/_vendor/toml/ordered.py +15 -0
  453. quarchpy/venv/Lib/site-packages/pip/_vendor/toml/tz.py +24 -0
  454. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +85 -0
  455. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +337 -0
  456. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +2 -0
  457. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +535 -0
  458. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +1067 -0
  459. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  460. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +36 -0
  461. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  462. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +519 -0
  463. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +396 -0
  464. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +314 -0
  465. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +121 -0
  466. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +509 -0
  467. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +920 -0
  468. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +216 -0
  469. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +313 -0
  470. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +274 -0
  471. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +98 -0
  472. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +5 -0
  473. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  474. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +51 -0
  475. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +1021 -0
  476. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__init__.py +22 -0
  477. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py +160 -0
  478. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +536 -0
  479. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/request.py +170 -0
  480. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/response.py +821 -0
  481. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +49 -0
  482. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +150 -0
  483. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +56 -0
  484. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +22 -0
  485. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +143 -0
  486. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +107 -0
  487. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +601 -0
  488. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +474 -0
  489. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +221 -0
  490. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +268 -0
  491. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +430 -0
  492. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +153 -0
  493. quarchpy/venv/Lib/site-packages/pip/_vendor/vendor.txt +24 -0
  494. quarchpy/venv/Lib/site-packages/pip/_vendor/webencodings/__init__.py +342 -0
  495. quarchpy/venv/Lib/site-packages/pip/_vendor/webencodings/labels.py +231 -0
  496. quarchpy/venv/Lib/site-packages/pip/_vendor/webencodings/mklabels.py +59 -0
  497. quarchpy/venv/Lib/site-packages/pip/_vendor/webencodings/tests.py +153 -0
  498. quarchpy/venv/Lib/site-packages/pip/_vendor/webencodings/x_user_defined.py +325 -0
  499. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/INSTALLER +1 -0
  500. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/LICENSE.txt +20 -0
  501. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/METADATA +94 -0
  502. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/RECORD +812 -0
  503. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/WHEEL +6 -0
  504. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/entry_points.txt +5 -0
  505. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/top_level.txt +1 -0
  506. quarchpy/venv/Lib/site-packages/pip-20.3.4.virtualenv +0 -0
  507. quarchpy/venv/Lib/site-packages/pkg_resources/__init__.py +3296 -0
  508. quarchpy/venv/Lib/site-packages/pkg_resources/__init__.pyc +0 -0
  509. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/__init__.py +0 -0
  510. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/__init__.pyc +0 -0
  511. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/appdirs.py +608 -0
  512. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/appdirs.pyc +0 -0
  513. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/__about__.py +21 -0
  514. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/__about__.pyc +0 -0
  515. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/__init__.py +14 -0
  516. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/__init__.pyc +0 -0
  517. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/_compat.py +30 -0
  518. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/_compat.pyc +0 -0
  519. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/_structures.py +68 -0
  520. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/_structures.pyc +0 -0
  521. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/markers.py +301 -0
  522. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/markers.pyc +0 -0
  523. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/requirements.py +127 -0
  524. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/requirements.pyc +0 -0
  525. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.py +774 -0
  526. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.pyc +0 -0
  527. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/utils.py +14 -0
  528. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/version.py +393 -0
  529. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/version.pyc +0 -0
  530. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/pyparsing.py +5742 -0
  531. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/pyparsing.pyc +0 -0
  532. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/six.py +868 -0
  533. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/six.pyc +0 -0
  534. quarchpy/venv/Lib/site-packages/pkg_resources/extern/__init__.py +73 -0
  535. quarchpy/venv/Lib/site-packages/pkg_resources/extern/__init__.pyc +0 -0
  536. quarchpy/venv/Lib/site-packages/pkg_resources/py31compat.py +23 -0
  537. quarchpy/venv/Lib/site-packages/pkg_resources/py31compat.pyc +0 -0
  538. quarchpy/venv/Lib/site-packages/setuptools/__init__.py +245 -0
  539. quarchpy/venv/Lib/site-packages/setuptools/_deprecation_warning.py +7 -0
  540. quarchpy/venv/Lib/site-packages/setuptools/_imp.py +73 -0
  541. quarchpy/venv/Lib/site-packages/setuptools/_vendor/__init__.py +0 -0
  542. quarchpy/venv/Lib/site-packages/setuptools/_vendor/ordered_set.py +488 -0
  543. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/__about__.py +27 -0
  544. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/__init__.py +26 -0
  545. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/_compat.py +31 -0
  546. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/_structures.py +68 -0
  547. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/markers.py +296 -0
  548. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/requirements.py +138 -0
  549. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/specifiers.py +749 -0
  550. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/tags.py +404 -0
  551. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/utils.py +57 -0
  552. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/version.py +420 -0
  553. quarchpy/venv/Lib/site-packages/setuptools/_vendor/pyparsing.py +5742 -0
  554. quarchpy/venv/Lib/site-packages/setuptools/_vendor/six.py +868 -0
  555. quarchpy/venv/Lib/site-packages/setuptools/archive_util.py +173 -0
  556. quarchpy/venv/Lib/site-packages/setuptools/build_meta.py +264 -0
  557. quarchpy/venv/Lib/site-packages/setuptools/cli-32.exe +0 -0
  558. quarchpy/venv/Lib/site-packages/setuptools/cli-64.exe +0 -0
  559. quarchpy/venv/Lib/site-packages/setuptools/cli.exe +0 -0
  560. quarchpy/venv/Lib/site-packages/setuptools/command/__init__.py +17 -0
  561. quarchpy/venv/Lib/site-packages/setuptools/command/alias.py +80 -0
  562. quarchpy/venv/Lib/site-packages/setuptools/command/bdist_egg.py +502 -0
  563. quarchpy/venv/Lib/site-packages/setuptools/command/bdist_rpm.py +43 -0
  564. quarchpy/venv/Lib/site-packages/setuptools/command/bdist_wininst.py +21 -0
  565. quarchpy/venv/Lib/site-packages/setuptools/command/build_clib.py +98 -0
  566. quarchpy/venv/Lib/site-packages/setuptools/command/build_ext.py +327 -0
  567. quarchpy/venv/Lib/site-packages/setuptools/command/build_py.py +270 -0
  568. quarchpy/venv/Lib/site-packages/setuptools/command/develop.py +221 -0
  569. quarchpy/venv/Lib/site-packages/setuptools/command/dist_info.py +36 -0
  570. quarchpy/venv/Lib/site-packages/setuptools/command/easy_install.py +2347 -0
  571. quarchpy/venv/Lib/site-packages/setuptools/command/egg_info.py +717 -0
  572. quarchpy/venv/Lib/site-packages/setuptools/command/install.py +125 -0
  573. quarchpy/venv/Lib/site-packages/setuptools/command/install_egg_info.py +62 -0
  574. quarchpy/venv/Lib/site-packages/setuptools/command/install_lib.py +121 -0
  575. quarchpy/venv/Lib/site-packages/setuptools/command/install_scripts.py +65 -0
  576. quarchpy/venv/Lib/site-packages/setuptools/command/launcher manifest.xml +15 -0
  577. quarchpy/venv/Lib/site-packages/setuptools/command/py36compat.py +136 -0
  578. quarchpy/venv/Lib/site-packages/setuptools/command/register.py +18 -0
  579. quarchpy/venv/Lib/site-packages/setuptools/command/rotate.py +66 -0
  580. quarchpy/venv/Lib/site-packages/setuptools/command/saveopts.py +22 -0
  581. quarchpy/venv/Lib/site-packages/setuptools/command/sdist.py +252 -0
  582. quarchpy/venv/Lib/site-packages/setuptools/command/setopt.py +149 -0
  583. quarchpy/venv/Lib/site-packages/setuptools/command/test.py +279 -0
  584. quarchpy/venv/Lib/site-packages/setuptools/command/upload.py +17 -0
  585. quarchpy/venv/Lib/site-packages/setuptools/command/upload_docs.py +206 -0
  586. quarchpy/venv/Lib/site-packages/setuptools/config.py +659 -0
  587. quarchpy/venv/Lib/site-packages/setuptools/dep_util.py +23 -0
  588. quarchpy/venv/Lib/site-packages/setuptools/depends.py +176 -0
  589. quarchpy/venv/Lib/site-packages/setuptools/dist.py +1274 -0
  590. quarchpy/venv/Lib/site-packages/setuptools/errors.py +16 -0
  591. quarchpy/venv/Lib/site-packages/setuptools/extension.py +57 -0
  592. quarchpy/venv/Lib/site-packages/setuptools/extern/__init__.py +73 -0
  593. quarchpy/venv/Lib/site-packages/setuptools/glob.py +174 -0
  594. quarchpy/venv/Lib/site-packages/setuptools/gui-32.exe +0 -0
  595. quarchpy/venv/Lib/site-packages/setuptools/gui-64.exe +0 -0
  596. quarchpy/venv/Lib/site-packages/setuptools/gui.exe +0 -0
  597. quarchpy/venv/Lib/site-packages/setuptools/installer.py +150 -0
  598. quarchpy/venv/Lib/site-packages/setuptools/launch.py +35 -0
  599. quarchpy/venv/Lib/site-packages/setuptools/lib2to3_ex.py +62 -0
  600. quarchpy/venv/Lib/site-packages/setuptools/monkey.py +179 -0
  601. quarchpy/venv/Lib/site-packages/setuptools/msvc.py +1679 -0
  602. quarchpy/venv/Lib/site-packages/setuptools/namespaces.py +107 -0
  603. quarchpy/venv/Lib/site-packages/setuptools/package_index.py +1136 -0
  604. quarchpy/venv/Lib/site-packages/setuptools/py27compat.py +60 -0
  605. quarchpy/venv/Lib/site-packages/setuptools/py31compat.py +32 -0
  606. quarchpy/venv/Lib/site-packages/setuptools/py33compat.py +59 -0
  607. quarchpy/venv/Lib/site-packages/setuptools/py34compat.py +13 -0
  608. quarchpy/venv/Lib/site-packages/setuptools/sandbox.py +491 -0
  609. quarchpy/venv/Lib/site-packages/setuptools/script (dev).tmpl +6 -0
  610. quarchpy/venv/Lib/site-packages/setuptools/script.tmpl +3 -0
  611. quarchpy/venv/Lib/site-packages/setuptools/site-patch.py +74 -0
  612. quarchpy/venv/Lib/site-packages/setuptools/ssl_support.py +260 -0
  613. quarchpy/venv/Lib/site-packages/setuptools/unicode_utils.py +44 -0
  614. quarchpy/venv/Lib/site-packages/setuptools/version.py +6 -0
  615. quarchpy/venv/Lib/site-packages/setuptools/wheel.py +220 -0
  616. quarchpy/venv/Lib/site-packages/setuptools/windows_support.py +29 -0
  617. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/INSTALLER +1 -0
  618. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/LICENSE +19 -0
  619. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/METADATA +86 -0
  620. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/RECORD +207 -0
  621. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/WHEEL +6 -0
  622. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/dependency_links.txt +2 -0
  623. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/entry_points.txt +69 -0
  624. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/top_level.txt +3 -0
  625. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/zip-safe +1 -0
  626. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.virtualenv +0 -0
  627. quarchpy/venv/Lib/site-packages/wheel/__init__.py +1 -0
  628. quarchpy/venv/Lib/site-packages/wheel/__main__.py +19 -0
  629. quarchpy/venv/Lib/site-packages/wheel/bdist_wheel.py +492 -0
  630. quarchpy/venv/Lib/site-packages/wheel/cli/__init__.py +88 -0
  631. quarchpy/venv/Lib/site-packages/wheel/cli/convert.py +269 -0
  632. quarchpy/venv/Lib/site-packages/wheel/cli/pack.py +82 -0
  633. quarchpy/venv/Lib/site-packages/wheel/cli/unpack.py +25 -0
  634. quarchpy/venv/Lib/site-packages/wheel/macosx_libfile.py +428 -0
  635. quarchpy/venv/Lib/site-packages/wheel/metadata.py +133 -0
  636. quarchpy/venv/Lib/site-packages/wheel/pkginfo.py +43 -0
  637. quarchpy/venv/Lib/site-packages/wheel/util.py +46 -0
  638. quarchpy/venv/Lib/site-packages/wheel/vendored/__init__.py +0 -0
  639. quarchpy/venv/Lib/site-packages/wheel/vendored/packaging/__init__.py +0 -0
  640. quarchpy/venv/Lib/site-packages/wheel/vendored/packaging/_typing.py +48 -0
  641. quarchpy/venv/Lib/site-packages/wheel/vendored/packaging/tags.py +866 -0
  642. quarchpy/venv/Lib/site-packages/wheel/wheelfile.py +181 -0
  643. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/INSTALLER +1 -0
  644. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/LICENSE.txt +22 -0
  645. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/METADATA +69 -0
  646. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/RECORD +49 -0
  647. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/WHEEL +6 -0
  648. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/entry_points.txt +6 -0
  649. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/top_level.txt +1 -0
  650. quarchpy/venv/Lib/site-packages/wheel-0.37.1.virtualenv +0 -0
  651. quarchpy/venv/Lib/site.py +190 -0
  652. quarchpy/venv/Lib/site.pyc +0 -0
  653. quarchpy/venv/Scripts/activate +83 -0
  654. quarchpy/venv/Scripts/activate.bat +39 -0
  655. quarchpy/venv/Scripts/activate.fish +100 -0
  656. quarchpy/venv/Scripts/activate.nu +41 -0
  657. quarchpy/venv/Scripts/activate.ps1 +60 -0
  658. quarchpy/venv/Scripts/activate_this.py +32 -0
  659. quarchpy/venv/Scripts/deactivate.bat +19 -0
  660. quarchpy/venv/Scripts/deactivate.nu +11 -0
  661. quarchpy/venv/Scripts/easy_install-2.7.exe +0 -0
  662. quarchpy/venv/Scripts/easy_install.exe +0 -0
  663. quarchpy/venv/Scripts/easy_install2.7.exe +0 -0
  664. quarchpy/venv/Scripts/easy_install2.exe +0 -0
  665. quarchpy/venv/Scripts/pip-2.7.exe +0 -0
  666. quarchpy/venv/Scripts/pip.exe +0 -0
  667. quarchpy/venv/Scripts/pip2.7.exe +0 -0
  668. quarchpy/venv/Scripts/pip2.exe +0 -0
  669. quarchpy/venv/Scripts/pydoc.bat +1 -0
  670. quarchpy/venv/Scripts/python.exe +0 -0
  671. quarchpy/venv/Scripts/python27.dll +0 -0
  672. quarchpy/venv/Scripts/pythonw.exe +0 -0
  673. quarchpy/venv/Scripts/wheel-2.7.exe +0 -0
  674. quarchpy/venv/Scripts/wheel.exe +0 -0
  675. quarchpy/venv/Scripts/wheel2.7.exe +0 -0
  676. quarchpy/venv/Scripts/wheel2.exe +0 -0
  677. quarchpy/venv/libs/_bsddb.lib +0 -0
  678. quarchpy/venv/libs/_ctypes.lib +0 -0
  679. quarchpy/venv/libs/_ctypes_test.lib +0 -0
  680. quarchpy/venv/libs/_elementtree.lib +0 -0
  681. quarchpy/venv/libs/_hashlib.lib +0 -0
  682. quarchpy/venv/libs/_msi.lib +0 -0
  683. quarchpy/venv/libs/_multiprocessing.lib +0 -0
  684. quarchpy/venv/libs/_socket.lib +0 -0
  685. quarchpy/venv/libs/_sqlite3.lib +0 -0
  686. quarchpy/venv/libs/_ssl.lib +0 -0
  687. quarchpy/venv/libs/_testcapi.lib +0 -0
  688. quarchpy/venv/libs/_tkinter.lib +0 -0
  689. quarchpy/venv/libs/bz2.lib +0 -0
  690. quarchpy/venv/libs/libpython27.a +0 -0
  691. quarchpy/venv/libs/pyexpat.lib +0 -0
  692. quarchpy/venv/libs/python27.lib +0 -0
  693. quarchpy/venv/libs/select.lib +0 -0
  694. quarchpy/venv/libs/unicodedata.lib +0 -0
  695. quarchpy/venv/libs/winsound.lib +0 -0
  696. quarchpy/venv/pyvenv.cfg +8 -0
  697. {quarchpy-2.1.14.dev3.dist-info → quarchpy-2.1.14.dev5.dist-info}/METADATA +1 -1
  698. quarchpy-2.1.14.dev5.dist-info/RECORD +1219 -0
  699. quarchpy-2.1.14.dev3.dist-info/RECORD +0 -535
  700. {quarchpy-2.1.14.dev3.dist-info → quarchpy-2.1.14.dev5.dist-info}/WHEEL +0 -0
  701. {quarchpy-2.1.14.dev3.dist-info → quarchpy-2.1.14.dev5.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,956 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ """
4
+ requests.models
5
+ ~~~~~~~~~~~~~~~
6
+
7
+ This module contains the primary objects that power Requests.
8
+ """
9
+
10
+ import datetime
11
+ import sys
12
+
13
+ # Import encoding now, to avoid implicit import later.
14
+ # Implicit import within threads may cause LookupError when standard library is in a ZIP,
15
+ # such as in Embedded Python. See https://github.com/psf/requests/issues/3578.
16
+ import encodings.idna
17
+
18
+ from pip._vendor.urllib3.fields import RequestField
19
+ from pip._vendor.urllib3.filepost import encode_multipart_formdata
20
+ from pip._vendor.urllib3.util import parse_url
21
+ from pip._vendor.urllib3.exceptions import (
22
+ DecodeError, ReadTimeoutError, ProtocolError, LocationParseError)
23
+
24
+ from io import UnsupportedOperation
25
+ from .hooks import default_hooks
26
+ from .structures import CaseInsensitiveDict
27
+
28
+ from .auth import HTTPBasicAuth
29
+ from .cookies import cookiejar_from_dict, get_cookie_header, _copy_cookie_jar
30
+ from .exceptions import (
31
+ HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError,
32
+ ContentDecodingError, ConnectionError, StreamConsumedError)
33
+ from ._internal_utils import to_native_string, unicode_is_ascii
34
+ from .utils import (
35
+ guess_filename, get_auth_from_url, requote_uri,
36
+ stream_decode_response_unicode, to_key_val_list, parse_header_links,
37
+ iter_slices, guess_json_utf, super_len, check_header_validity)
38
+ from .compat import (
39
+ Callable, Mapping,
40
+ cookielib, urlunparse, urlsplit, urlencode, str, bytes,
41
+ is_py2, chardet, builtin_str, basestring)
42
+ from .compat import json as complexjson
43
+ from .status_codes import codes
44
+
45
+ #: The set of HTTP status codes that indicate an automatically
46
+ #: processable redirect.
47
+ REDIRECT_STATI = (
48
+ codes.moved, # 301
49
+ codes.found, # 302
50
+ codes.other, # 303
51
+ codes.temporary_redirect, # 307
52
+ codes.permanent_redirect, # 308
53
+ )
54
+
55
+ DEFAULT_REDIRECT_LIMIT = 30
56
+ CONTENT_CHUNK_SIZE = 10 * 1024
57
+ ITER_CHUNK_SIZE = 512
58
+
59
+
60
+ class RequestEncodingMixin(object):
61
+ @property
62
+ def path_url(self):
63
+ """Build the path URL to use."""
64
+
65
+ url = []
66
+
67
+ p = urlsplit(self.url)
68
+
69
+ path = p.path
70
+ if not path:
71
+ path = '/'
72
+
73
+ url.append(path)
74
+
75
+ query = p.query
76
+ if query:
77
+ url.append('?')
78
+ url.append(query)
79
+
80
+ return ''.join(url)
81
+
82
+ @staticmethod
83
+ def _encode_params(data):
84
+ """Encode parameters in a piece of data.
85
+
86
+ Will successfully encode parameters when passed as a dict or a list of
87
+ 2-tuples. Order is retained if data is a list of 2-tuples but arbitrary
88
+ if parameters are supplied as a dict.
89
+ """
90
+
91
+ if isinstance(data, (str, bytes)):
92
+ return data
93
+ elif hasattr(data, 'read'):
94
+ return data
95
+ elif hasattr(data, '__iter__'):
96
+ result = []
97
+ for k, vs in to_key_val_list(data):
98
+ if isinstance(vs, basestring) or not hasattr(vs, '__iter__'):
99
+ vs = [vs]
100
+ for v in vs:
101
+ if v is not None:
102
+ result.append(
103
+ (k.encode('utf-8') if isinstance(k, str) else k,
104
+ v.encode('utf-8') if isinstance(v, str) else v))
105
+ return urlencode(result, doseq=True)
106
+ else:
107
+ return data
108
+
109
+ @staticmethod
110
+ def _encode_files(files, data):
111
+ """Build the body for a multipart/form-data request.
112
+
113
+ Will successfully encode files when passed as a dict or a list of
114
+ tuples. Order is retained if data is a list of tuples but arbitrary
115
+ if parameters are supplied as a dict.
116
+ The tuples may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype)
117
+ or 4-tuples (filename, fileobj, contentype, custom_headers).
118
+ """
119
+ if (not files):
120
+ raise ValueError("Files must be provided.")
121
+ elif isinstance(data, basestring):
122
+ raise ValueError("Data must not be a string.")
123
+
124
+ new_fields = []
125
+ fields = to_key_val_list(data or {})
126
+ files = to_key_val_list(files or {})
127
+
128
+ for field, val in fields:
129
+ if isinstance(val, basestring) or not hasattr(val, '__iter__'):
130
+ val = [val]
131
+ for v in val:
132
+ if v is not None:
133
+ # Don't call str() on bytestrings: in Py3 it all goes wrong.
134
+ if not isinstance(v, bytes):
135
+ v = str(v)
136
+
137
+ new_fields.append(
138
+ (field.decode('utf-8') if isinstance(field, bytes) else field,
139
+ v.encode('utf-8') if isinstance(v, str) else v))
140
+
141
+ for (k, v) in files:
142
+ # support for explicit filename
143
+ ft = None
144
+ fh = None
145
+ if isinstance(v, (tuple, list)):
146
+ if len(v) == 2:
147
+ fn, fp = v
148
+ elif len(v) == 3:
149
+ fn, fp, ft = v
150
+ else:
151
+ fn, fp, ft, fh = v
152
+ else:
153
+ fn = guess_filename(v) or k
154
+ fp = v
155
+
156
+ if isinstance(fp, (str, bytes, bytearray)):
157
+ fdata = fp
158
+ elif hasattr(fp, 'read'):
159
+ fdata = fp.read()
160
+ elif fp is None:
161
+ continue
162
+ else:
163
+ fdata = fp
164
+
165
+ rf = RequestField(name=k, data=fdata, filename=fn, headers=fh)
166
+ rf.make_multipart(content_type=ft)
167
+ new_fields.append(rf)
168
+
169
+ body, content_type = encode_multipart_formdata(new_fields)
170
+
171
+ return body, content_type
172
+
173
+
174
+ class RequestHooksMixin(object):
175
+ def register_hook(self, event, hook):
176
+ """Properly register a hook."""
177
+
178
+ if event not in self.hooks:
179
+ raise ValueError('Unsupported event specified, with event name "%s"' % (event))
180
+
181
+ if isinstance(hook, Callable):
182
+ self.hooks[event].append(hook)
183
+ elif hasattr(hook, '__iter__'):
184
+ self.hooks[event].extend(h for h in hook if isinstance(h, Callable))
185
+
186
+ def deregister_hook(self, event, hook):
187
+ """Deregister a previously registered hook.
188
+ Returns True if the hook existed, False if not.
189
+ """
190
+
191
+ try:
192
+ self.hooks[event].remove(hook)
193
+ return True
194
+ except ValueError:
195
+ return False
196
+
197
+
198
+ class Request(RequestHooksMixin):
199
+ """A user-created :class:`Request <Request>` object.
200
+
201
+ Used to prepare a :class:`PreparedRequest <PreparedRequest>`, which is sent to the server.
202
+
203
+ :param method: HTTP method to use.
204
+ :param url: URL to send.
205
+ :param headers: dictionary of headers to send.
206
+ :param files: dictionary of {filename: fileobject} files to multipart upload.
207
+ :param data: the body to attach to the request. If a dictionary or
208
+ list of tuples ``[(key, value)]`` is provided, form-encoding will
209
+ take place.
210
+ :param json: json for the body to attach to the request (if files or data is not specified).
211
+ :param params: URL parameters to append to the URL. If a dictionary or
212
+ list of tuples ``[(key, value)]`` is provided, form-encoding will
213
+ take place.
214
+ :param auth: Auth handler or (user, pass) tuple.
215
+ :param cookies: dictionary or CookieJar of cookies to attach to this request.
216
+ :param hooks: dictionary of callback hooks, for internal usage.
217
+
218
+ Usage::
219
+
220
+ >>> import requests
221
+ >>> req = requests.Request('GET', 'https://httpbin.org/get')
222
+ >>> req.prepare()
223
+ <PreparedRequest [GET]>
224
+ """
225
+
226
+ def __init__(self,
227
+ method=None, url=None, headers=None, files=None, data=None,
228
+ params=None, auth=None, cookies=None, hooks=None, json=None):
229
+
230
+ # Default empty dicts for dict params.
231
+ data = [] if data is None else data
232
+ files = [] if files is None else files
233
+ headers = {} if headers is None else headers
234
+ params = {} if params is None else params
235
+ hooks = {} if hooks is None else hooks
236
+
237
+ self.hooks = default_hooks()
238
+ for (k, v) in list(hooks.items()):
239
+ self.register_hook(event=k, hook=v)
240
+
241
+ self.method = method
242
+ self.url = url
243
+ self.headers = headers
244
+ self.files = files
245
+ self.data = data
246
+ self.json = json
247
+ self.params = params
248
+ self.auth = auth
249
+ self.cookies = cookies
250
+
251
+ def __repr__(self):
252
+ return '<Request [%s]>' % (self.method)
253
+
254
+ def prepare(self):
255
+ """Constructs a :class:`PreparedRequest <PreparedRequest>` for transmission and returns it."""
256
+ p = PreparedRequest()
257
+ p.prepare(
258
+ method=self.method,
259
+ url=self.url,
260
+ headers=self.headers,
261
+ files=self.files,
262
+ data=self.data,
263
+ json=self.json,
264
+ params=self.params,
265
+ auth=self.auth,
266
+ cookies=self.cookies,
267
+ hooks=self.hooks,
268
+ )
269
+ return p
270
+
271
+
272
+ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
273
+ """The fully mutable :class:`PreparedRequest <PreparedRequest>` object,
274
+ containing the exact bytes that will be sent to the server.
275
+
276
+ Instances are generated from a :class:`Request <Request>` object, and
277
+ should not be instantiated manually; doing so may produce undesirable
278
+ effects.
279
+
280
+ Usage::
281
+
282
+ >>> import requests
283
+ >>> req = requests.Request('GET', 'https://httpbin.org/get')
284
+ >>> r = req.prepare()
285
+ >>> r
286
+ <PreparedRequest [GET]>
287
+
288
+ >>> s = requests.Session()
289
+ >>> s.send(r)
290
+ <Response [200]>
291
+ """
292
+
293
+ def __init__(self):
294
+ #: HTTP verb to send to the server.
295
+ self.method = None
296
+ #: HTTP URL to send the request to.
297
+ self.url = None
298
+ #: dictionary of HTTP headers.
299
+ self.headers = None
300
+ # The `CookieJar` used to create the Cookie header will be stored here
301
+ # after prepare_cookies is called
302
+ self._cookies = None
303
+ #: request body to send to the server.
304
+ self.body = None
305
+ #: dictionary of callback hooks, for internal usage.
306
+ self.hooks = default_hooks()
307
+ #: integer denoting starting position of a readable file-like body.
308
+ self._body_position = None
309
+
310
+ def prepare(self,
311
+ method=None, url=None, headers=None, files=None, data=None,
312
+ params=None, auth=None, cookies=None, hooks=None, json=None):
313
+ """Prepares the entire request with the given parameters."""
314
+
315
+ self.prepare_method(method)
316
+ self.prepare_url(url, params)
317
+ self.prepare_headers(headers)
318
+ self.prepare_cookies(cookies)
319
+ self.prepare_body(data, files, json)
320
+ self.prepare_auth(auth, url)
321
+
322
+ # Note that prepare_auth must be last to enable authentication schemes
323
+ # such as OAuth to work on a fully prepared request.
324
+
325
+ # This MUST go after prepare_auth. Authenticators could add a hook
326
+ self.prepare_hooks(hooks)
327
+
328
+ def __repr__(self):
329
+ return '<PreparedRequest [%s]>' % (self.method)
330
+
331
+ def copy(self):
332
+ p = PreparedRequest()
333
+ p.method = self.method
334
+ p.url = self.url
335
+ p.headers = self.headers.copy() if self.headers is not None else None
336
+ p._cookies = _copy_cookie_jar(self._cookies)
337
+ p.body = self.body
338
+ p.hooks = self.hooks
339
+ p._body_position = self._body_position
340
+ return p
341
+
342
+ def prepare_method(self, method):
343
+ """Prepares the given HTTP method."""
344
+ self.method = method
345
+ if self.method is not None:
346
+ self.method = to_native_string(self.method.upper())
347
+
348
+ @staticmethod
349
+ def _get_idna_encoded_host(host):
350
+ from pip._vendor import idna
351
+
352
+ try:
353
+ host = idna.encode(host, uts46=True).decode('utf-8')
354
+ except idna.IDNAError:
355
+ raise UnicodeError
356
+ return host
357
+
358
+ def prepare_url(self, url, params):
359
+ """Prepares the given HTTP URL."""
360
+ #: Accept objects that have string representations.
361
+ #: We're unable to blindly call unicode/str functions
362
+ #: as this will include the bytestring indicator (b'')
363
+ #: on python 3.x.
364
+ #: https://github.com/psf/requests/pull/2238
365
+ if isinstance(url, bytes):
366
+ url = url.decode('utf8')
367
+ else:
368
+ url = unicode(url) if is_py2 else str(url)
369
+
370
+ # Remove leading whitespaces from url
371
+ url = url.lstrip()
372
+
373
+ # Don't do any URL preparation for non-HTTP schemes like `mailto`,
374
+ # `data` etc to work around exceptions from `url_parse`, which
375
+ # handles RFC 3986 only.
376
+ if ':' in url and not url.lower().startswith('http'):
377
+ self.url = url
378
+ return
379
+
380
+ # Support for unicode domain names and paths.
381
+ try:
382
+ scheme, auth, host, port, path, query, fragment = parse_url(url)
383
+ except LocationParseError as e:
384
+ raise InvalidURL(*e.args)
385
+
386
+ if not scheme:
387
+ error = ("Invalid URL {0!r}: No schema supplied. Perhaps you meant http://{0}?")
388
+ error = error.format(to_native_string(url, 'utf8'))
389
+
390
+ raise MissingSchema(error)
391
+
392
+ if not host:
393
+ raise InvalidURL("Invalid URL %r: No host supplied" % url)
394
+
395
+ # In general, we want to try IDNA encoding the hostname if the string contains
396
+ # non-ASCII characters. This allows users to automatically get the correct IDNA
397
+ # behaviour. For strings containing only ASCII characters, we need to also verify
398
+ # it doesn't start with a wildcard (*), before allowing the unencoded hostname.
399
+ if not unicode_is_ascii(host):
400
+ try:
401
+ host = self._get_idna_encoded_host(host)
402
+ except UnicodeError:
403
+ raise InvalidURL('URL has an invalid label.')
404
+ elif host.startswith(u'*'):
405
+ raise InvalidURL('URL has an invalid label.')
406
+
407
+ # Carefully reconstruct the network location
408
+ netloc = auth or ''
409
+ if netloc:
410
+ netloc += '@'
411
+ netloc += host
412
+ if port:
413
+ netloc += ':' + str(port)
414
+
415
+ # Bare domains aren't valid URLs.
416
+ if not path:
417
+ path = '/'
418
+
419
+ if is_py2:
420
+ if isinstance(scheme, str):
421
+ scheme = scheme.encode('utf-8')
422
+ if isinstance(netloc, str):
423
+ netloc = netloc.encode('utf-8')
424
+ if isinstance(path, str):
425
+ path = path.encode('utf-8')
426
+ if isinstance(query, str):
427
+ query = query.encode('utf-8')
428
+ if isinstance(fragment, str):
429
+ fragment = fragment.encode('utf-8')
430
+
431
+ if isinstance(params, (str, bytes)):
432
+ params = to_native_string(params)
433
+
434
+ enc_params = self._encode_params(params)
435
+ if enc_params:
436
+ if query:
437
+ query = '%s&%s' % (query, enc_params)
438
+ else:
439
+ query = enc_params
440
+
441
+ url = requote_uri(urlunparse([scheme, netloc, path, None, query, fragment]))
442
+ self.url = url
443
+
444
+ def prepare_headers(self, headers):
445
+ """Prepares the given HTTP headers."""
446
+
447
+ self.headers = CaseInsensitiveDict()
448
+ if headers:
449
+ for header in headers.items():
450
+ # Raise exception on invalid header value.
451
+ check_header_validity(header)
452
+ name, value = header
453
+ self.headers[to_native_string(name)] = value
454
+
455
+ def prepare_body(self, data, files, json=None):
456
+ """Prepares the given HTTP body data."""
457
+
458
+ # Check if file, fo, generator, iterator.
459
+ # If not, run through normal process.
460
+
461
+ # Nottin' on you.
462
+ body = None
463
+ content_type = None
464
+
465
+ if not data and json is not None:
466
+ # urllib3 requires a bytes-like body. Python 2's json.dumps
467
+ # provides this natively, but Python 3 gives a Unicode string.
468
+ content_type = 'application/json'
469
+ body = complexjson.dumps(json)
470
+ if not isinstance(body, bytes):
471
+ body = body.encode('utf-8')
472
+
473
+ is_stream = all([
474
+ hasattr(data, '__iter__'),
475
+ not isinstance(data, (basestring, list, tuple, Mapping))
476
+ ])
477
+
478
+ if is_stream:
479
+ try:
480
+ length = super_len(data)
481
+ except (TypeError, AttributeError, UnsupportedOperation):
482
+ length = None
483
+
484
+ body = data
485
+
486
+ if getattr(body, 'tell', None) is not None:
487
+ # Record the current file position before reading.
488
+ # This will allow us to rewind a file in the event
489
+ # of a redirect.
490
+ try:
491
+ self._body_position = body.tell()
492
+ except (IOError, OSError):
493
+ # This differentiates from None, allowing us to catch
494
+ # a failed `tell()` later when trying to rewind the body
495
+ self._body_position = object()
496
+
497
+ if files:
498
+ raise NotImplementedError('Streamed bodies and files are mutually exclusive.')
499
+
500
+ if length:
501
+ self.headers['Content-Length'] = builtin_str(length)
502
+ else:
503
+ self.headers['Transfer-Encoding'] = 'chunked'
504
+ else:
505
+ # Multi-part file uploads.
506
+ if files:
507
+ (body, content_type) = self._encode_files(files, data)
508
+ else:
509
+ if data:
510
+ body = self._encode_params(data)
511
+ if isinstance(data, basestring) or hasattr(data, 'read'):
512
+ content_type = None
513
+ else:
514
+ content_type = 'application/x-www-form-urlencoded'
515
+
516
+ self.prepare_content_length(body)
517
+
518
+ # Add content-type if it wasn't explicitly provided.
519
+ if content_type and ('content-type' not in self.headers):
520
+ self.headers['Content-Type'] = content_type
521
+
522
+ self.body = body
523
+
524
+ def prepare_content_length(self, body):
525
+ """Prepare Content-Length header based on request method and body"""
526
+ if body is not None:
527
+ length = super_len(body)
528
+ if length:
529
+ # If length exists, set it. Otherwise, we fallback
530
+ # to Transfer-Encoding: chunked.
531
+ self.headers['Content-Length'] = builtin_str(length)
532
+ elif self.method not in ('GET', 'HEAD') and self.headers.get('Content-Length') is None:
533
+ # Set Content-Length to 0 for methods that can have a body
534
+ # but don't provide one. (i.e. not GET or HEAD)
535
+ self.headers['Content-Length'] = '0'
536
+
537
+ def prepare_auth(self, auth, url=''):
538
+ """Prepares the given HTTP auth data."""
539
+
540
+ # If no Auth is explicitly provided, extract it from the URL first.
541
+ if auth is None:
542
+ url_auth = get_auth_from_url(self.url)
543
+ auth = url_auth if any(url_auth) else None
544
+
545
+ if auth:
546
+ if isinstance(auth, tuple) and len(auth) == 2:
547
+ # special-case basic HTTP auth
548
+ auth = HTTPBasicAuth(*auth)
549
+
550
+ # Allow auth to make its changes.
551
+ r = auth(self)
552
+
553
+ # Update self to reflect the auth changes.
554
+ self.__dict__.update(r.__dict__)
555
+
556
+ # Recompute Content-Length
557
+ self.prepare_content_length(self.body)
558
+
559
+ def prepare_cookies(self, cookies):
560
+ """Prepares the given HTTP cookie data.
561
+
562
+ This function eventually generates a ``Cookie`` header from the
563
+ given cookies using cookielib. Due to cookielib's design, the header
564
+ will not be regenerated if it already exists, meaning this function
565
+ can only be called once for the life of the
566
+ :class:`PreparedRequest <PreparedRequest>` object. Any subsequent calls
567
+ to ``prepare_cookies`` will have no actual effect, unless the "Cookie"
568
+ header is removed beforehand.
569
+ """
570
+ if isinstance(cookies, cookielib.CookieJar):
571
+ self._cookies = cookies
572
+ else:
573
+ self._cookies = cookiejar_from_dict(cookies)
574
+
575
+ cookie_header = get_cookie_header(self._cookies, self)
576
+ if cookie_header is not None:
577
+ self.headers['Cookie'] = cookie_header
578
+
579
+ def prepare_hooks(self, hooks):
580
+ """Prepares the given hooks."""
581
+ # hooks can be passed as None to the prepare method and to this
582
+ # method. To prevent iterating over None, simply use an empty list
583
+ # if hooks is False-y
584
+ hooks = hooks or []
585
+ for event in hooks:
586
+ self.register_hook(event, hooks[event])
587
+
588
+
589
+ class Response(object):
590
+ """The :class:`Response <Response>` object, which contains a
591
+ server's response to an HTTP request.
592
+ """
593
+
594
+ __attrs__ = [
595
+ '_content', 'status_code', 'headers', 'url', 'history',
596
+ 'encoding', 'reason', 'cookies', 'elapsed', 'request'
597
+ ]
598
+
599
+ def __init__(self):
600
+ self._content = False
601
+ self._content_consumed = False
602
+ self._next = None
603
+
604
+ #: Integer Code of responded HTTP Status, e.g. 404 or 200.
605
+ self.status_code = None
606
+
607
+ #: Case-insensitive Dictionary of Response Headers.
608
+ #: For example, ``headers['content-encoding']`` will return the
609
+ #: value of a ``'Content-Encoding'`` response header.
610
+ self.headers = CaseInsensitiveDict()
611
+
612
+ #: File-like object representation of response (for advanced usage).
613
+ #: Use of ``raw`` requires that ``stream=True`` be set on the request.
614
+ #: This requirement does not apply for use internally to Requests.
615
+ self.raw = None
616
+
617
+ #: Final URL location of Response.
618
+ self.url = None
619
+
620
+ #: Encoding to decode with when accessing r.text.
621
+ self.encoding = None
622
+
623
+ #: A list of :class:`Response <Response>` objects from
624
+ #: the history of the Request. Any redirect responses will end
625
+ #: up here. The list is sorted from the oldest to the most recent request.
626
+ self.history = []
627
+
628
+ #: Textual reason of responded HTTP Status, e.g. "Not Found" or "OK".
629
+ self.reason = None
630
+
631
+ #: A CookieJar of Cookies the server sent back.
632
+ self.cookies = cookiejar_from_dict({})
633
+
634
+ #: The amount of time elapsed between sending the request
635
+ #: and the arrival of the response (as a timedelta).
636
+ #: This property specifically measures the time taken between sending
637
+ #: the first byte of the request and finishing parsing the headers. It
638
+ #: is therefore unaffected by consuming the response content or the
639
+ #: value of the ``stream`` keyword argument.
640
+ self.elapsed = datetime.timedelta(0)
641
+
642
+ #: The :class:`PreparedRequest <PreparedRequest>` object to which this
643
+ #: is a response.
644
+ self.request = None
645
+
646
+ def __enter__(self):
647
+ return self
648
+
649
+ def __exit__(self, *args):
650
+ self.close()
651
+
652
+ def __getstate__(self):
653
+ # Consume everything; accessing the content attribute makes
654
+ # sure the content has been fully read.
655
+ if not self._content_consumed:
656
+ self.content
657
+
658
+ return {attr: getattr(self, attr, None) for attr in self.__attrs__}
659
+
660
+ def __setstate__(self, state):
661
+ for name, value in state.items():
662
+ setattr(self, name, value)
663
+
664
+ # pickled objects do not have .raw
665
+ setattr(self, '_content_consumed', True)
666
+ setattr(self, 'raw', None)
667
+
668
+ def __repr__(self):
669
+ return '<Response [%s]>' % (self.status_code)
670
+
671
+ def __bool__(self):
672
+ """Returns True if :attr:`status_code` is less than 400.
673
+
674
+ This attribute checks if the status code of the response is between
675
+ 400 and 600 to see if there was a client error or a server error. If
676
+ the status code, is between 200 and 400, this will return True. This
677
+ is **not** a check to see if the response code is ``200 OK``.
678
+ """
679
+ return self.ok
680
+
681
+ def __nonzero__(self):
682
+ """Returns True if :attr:`status_code` is less than 400.
683
+
684
+ This attribute checks if the status code of the response is between
685
+ 400 and 600 to see if there was a client error or a server error. If
686
+ the status code, is between 200 and 400, this will return True. This
687
+ is **not** a check to see if the response code is ``200 OK``.
688
+ """
689
+ return self.ok
690
+
691
+ def __iter__(self):
692
+ """Allows you to use a response as an iterator."""
693
+ return self.iter_content(128)
694
+
695
+ @property
696
+ def ok(self):
697
+ """Returns True if :attr:`status_code` is less than 400, False if not.
698
+
699
+ This attribute checks if the status code of the response is between
700
+ 400 and 600 to see if there was a client error or a server error. If
701
+ the status code is between 200 and 400, this will return True. This
702
+ is **not** a check to see if the response code is ``200 OK``.
703
+ """
704
+ try:
705
+ self.raise_for_status()
706
+ except HTTPError:
707
+ return False
708
+ return True
709
+
710
+ @property
711
+ def is_redirect(self):
712
+ """True if this Response is a well-formed HTTP redirect that could have
713
+ been processed automatically (by :meth:`Session.resolve_redirects`).
714
+ """
715
+ return ('location' in self.headers and self.status_code in REDIRECT_STATI)
716
+
717
+ @property
718
+ def is_permanent_redirect(self):
719
+ """True if this Response one of the permanent versions of redirect."""
720
+ return ('location' in self.headers and self.status_code in (codes.moved_permanently, codes.permanent_redirect))
721
+
722
+ @property
723
+ def next(self):
724
+ """Returns a PreparedRequest for the next request in a redirect chain, if there is one."""
725
+ return self._next
726
+
727
+ @property
728
+ def apparent_encoding(self):
729
+ """The apparent encoding, provided by the chardet library."""
730
+ return chardet.detect(self.content)['encoding']
731
+
732
+ def iter_content(self, chunk_size=1, decode_unicode=False):
733
+ """Iterates over the response data. When stream=True is set on the
734
+ request, this avoids reading the content at once into memory for
735
+ large responses. The chunk size is the number of bytes it should
736
+ read into memory. This is not necessarily the length of each item
737
+ returned as decoding can take place.
738
+
739
+ chunk_size must be of type int or None. A value of None will
740
+ function differently depending on the value of `stream`.
741
+ stream=True will read data as it arrives in whatever size the
742
+ chunks are received. If stream=False, data is returned as
743
+ a single chunk.
744
+
745
+ If decode_unicode is True, content will be decoded using the best
746
+ available encoding based on the response.
747
+ """
748
+
749
+ def generate():
750
+ # Special case for urllib3.
751
+ if hasattr(self.raw, 'stream'):
752
+ try:
753
+ for chunk in self.raw.stream(chunk_size, decode_content=True):
754
+ yield chunk
755
+ except ProtocolError as e:
756
+ raise ChunkedEncodingError(e)
757
+ except DecodeError as e:
758
+ raise ContentDecodingError(e)
759
+ except ReadTimeoutError as e:
760
+ raise ConnectionError(e)
761
+ else:
762
+ # Standard file-like object.
763
+ while True:
764
+ chunk = self.raw.read(chunk_size)
765
+ if not chunk:
766
+ break
767
+ yield chunk
768
+
769
+ self._content_consumed = True
770
+
771
+ if self._content_consumed and isinstance(self._content, bool):
772
+ raise StreamConsumedError()
773
+ elif chunk_size is not None and not isinstance(chunk_size, int):
774
+ raise TypeError("chunk_size must be an int, it is instead a %s." % type(chunk_size))
775
+ # simulate reading small chunks of the content
776
+ reused_chunks = iter_slices(self._content, chunk_size)
777
+
778
+ stream_chunks = generate()
779
+
780
+ chunks = reused_chunks if self._content_consumed else stream_chunks
781
+
782
+ if decode_unicode:
783
+ chunks = stream_decode_response_unicode(chunks, self)
784
+
785
+ return chunks
786
+
787
+ def iter_lines(self, chunk_size=ITER_CHUNK_SIZE, decode_unicode=False, delimiter=None):
788
+ """Iterates over the response data, one line at a time. When
789
+ stream=True is set on the request, this avoids reading the
790
+ content at once into memory for large responses.
791
+
792
+ .. note:: This method is not reentrant safe.
793
+ """
794
+
795
+ pending = None
796
+
797
+ for chunk in self.iter_content(chunk_size=chunk_size, decode_unicode=decode_unicode):
798
+
799
+ if pending is not None:
800
+ chunk = pending + chunk
801
+
802
+ if delimiter:
803
+ lines = chunk.split(delimiter)
804
+ else:
805
+ lines = chunk.splitlines()
806
+
807
+ if lines and lines[-1] and chunk and lines[-1][-1] == chunk[-1]:
808
+ pending = lines.pop()
809
+ else:
810
+ pending = None
811
+
812
+ for line in lines:
813
+ yield line
814
+
815
+ if pending is not None:
816
+ yield pending
817
+
818
+ @property
819
+ def content(self):
820
+ """Content of the response, in bytes."""
821
+
822
+ if self._content is False:
823
+ # Read the contents.
824
+ if self._content_consumed:
825
+ raise RuntimeError(
826
+ 'The content for this response was already consumed')
827
+
828
+ if self.status_code == 0 or self.raw is None:
829
+ self._content = None
830
+ else:
831
+ self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
832
+
833
+ self._content_consumed = True
834
+ # don't need to release the connection; that's been handled by urllib3
835
+ # since we exhausted the data.
836
+ return self._content
837
+
838
+ @property
839
+ def text(self):
840
+ """Content of the response, in unicode.
841
+
842
+ If Response.encoding is None, encoding will be guessed using
843
+ ``chardet``.
844
+
845
+ The encoding of the response content is determined based solely on HTTP
846
+ headers, following RFC 2616 to the letter. If you can take advantage of
847
+ non-HTTP knowledge to make a better guess at the encoding, you should
848
+ set ``r.encoding`` appropriately before accessing this property.
849
+ """
850
+
851
+ # Try charset from content-type
852
+ content = None
853
+ encoding = self.encoding
854
+
855
+ if not self.content:
856
+ return str('')
857
+
858
+ # Fallback to auto-detected encoding.
859
+ if self.encoding is None:
860
+ encoding = self.apparent_encoding
861
+
862
+ # Decode unicode from given encoding.
863
+ try:
864
+ content = str(self.content, encoding, errors='replace')
865
+ except (LookupError, TypeError):
866
+ # A LookupError is raised if the encoding was not found which could
867
+ # indicate a misspelling or similar mistake.
868
+ #
869
+ # A TypeError can be raised if encoding is None
870
+ #
871
+ # So we try blindly encoding.
872
+ content = str(self.content, errors='replace')
873
+
874
+ return content
875
+
876
+ def json(self, **kwargs):
877
+ r"""Returns the json-encoded content of a response, if any.
878
+
879
+ :param \*\*kwargs: Optional arguments that ``json.loads`` takes.
880
+ :raises ValueError: If the response body does not contain valid json.
881
+ """
882
+
883
+ if not self.encoding and self.content and len(self.content) > 3:
884
+ # No encoding set. JSON RFC 4627 section 3 states we should expect
885
+ # UTF-8, -16 or -32. Detect which one to use; If the detection or
886
+ # decoding fails, fall back to `self.text` (using chardet to make
887
+ # a best guess).
888
+ encoding = guess_json_utf(self.content)
889
+ if encoding is not None:
890
+ try:
891
+ return complexjson.loads(
892
+ self.content.decode(encoding), **kwargs
893
+ )
894
+ except UnicodeDecodeError:
895
+ # Wrong UTF codec detected; usually because it's not UTF-8
896
+ # but some other 8-bit codec. This is an RFC violation,
897
+ # and the server didn't bother to tell us what codec *was*
898
+ # used.
899
+ pass
900
+ return complexjson.loads(self.text, **kwargs)
901
+
902
+ @property
903
+ def links(self):
904
+ """Returns the parsed header links of the response, if any."""
905
+
906
+ header = self.headers.get('link')
907
+
908
+ # l = MultiDict()
909
+ l = {}
910
+
911
+ if header:
912
+ links = parse_header_links(header)
913
+
914
+ for link in links:
915
+ key = link.get('rel') or link.get('url')
916
+ l[key] = link
917
+
918
+ return l
919
+
920
+ def raise_for_status(self):
921
+ """Raises :class:`HTTPError`, if one occurred."""
922
+
923
+ http_error_msg = ''
924
+ if isinstance(self.reason, bytes):
925
+ # We attempt to decode utf-8 first because some servers
926
+ # choose to localize their reason strings. If the string
927
+ # isn't utf-8, we fall back to iso-8859-1 for all other
928
+ # encodings. (See PR #3538)
929
+ try:
930
+ reason = self.reason.decode('utf-8')
931
+ except UnicodeDecodeError:
932
+ reason = self.reason.decode('iso-8859-1')
933
+ else:
934
+ reason = self.reason
935
+
936
+ if 400 <= self.status_code < 500:
937
+ http_error_msg = u'%s Client Error: %s for url: %s' % (self.status_code, reason, self.url)
938
+
939
+ elif 500 <= self.status_code < 600:
940
+ http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url)
941
+
942
+ if http_error_msg:
943
+ raise HTTPError(http_error_msg, response=self)
944
+
945
+ def close(self):
946
+ """Releases the connection back to the pool. Once this method has been
947
+ called the underlying ``raw`` object must not be accessed again.
948
+
949
+ *Note: Should not normally need to be called explicitly.*
950
+ """
951
+ if not self._content_consumed:
952
+ self.raw.close()
953
+
954
+ release_conn = getattr(self.raw, 'release_conn', None)
955
+ if release_conn is not None:
956
+ release_conn()