From 489e943c01c7cf3e62c8c1e4989319da3278e77d Mon Sep 17 00:00:00 2001 From: Phil Chen <92065453+phil-scale@users.noreply.github.com> Date: Fri, 3 Mar 2023 11:17:39 -0800 Subject: [PATCH] New documentation site (#81) * Use mkdocs and write docs for launch * updates * add site_url * add overview of concepts * fix * some more fixes * Update CLI help string to 118 instead of 78 chars wide * test python code in docs and docstrings * update team tags to infra * update literal to typing_extensions * add some reqs * fix * add sleep to callbacks * updates * update deps * address comments * fix pylint --- .circleci/config.yml | 4 +- .../_sphinx_javascript_frameworks_compat.js | 134 - docs/_static/basic.css | 930 -- docs/_static/css/custom.css | 5 - docs/_static/debug.css | 69 - docs/_static/doctools.js | 264 - docs/_static/documentation_options.js | 14 - docs/_static/graphviz.css | 19 - docs/_static/jquery-3.5.1.js | 10872 --------------- docs/_static/jquery-3.6.0.js | 10881 ---------------- docs/_static/jquery.js | 2 - docs/_static/language_data.js | 199 - docs/_static/pygments.css | 252 - docs/_static/scripts/furo-extensions.js | 0 docs/_static/scripts/furo.js | 3 - docs/_static/scripts/furo.js.LICENSE.txt | 7 - docs/_static/scripts/furo.js.map | 1 - docs/_static/searchtools.js | 531 - docs/_static/skeleton.css | 296 - docs/_static/styles/furo-extensions.css | 2 - docs/_static/styles/furo-extensions.css.map | 1 - docs/_static/styles/furo.css | 2 - docs/_static/styles/furo.css.map | 1 - docs/_static/underscore-1.13.1.js | 2042 --- docs/_static/underscore.js | 6 - docs/api/client.md | 3 + docs/api/endpoint_predictions.md | 5 + docs/api/hooks.md | 2 + docs/api/launch/cli/bin/index.html | 308 - docs/api/launch/cli/bundles/index.html | 356 - docs/api/launch/cli/client/index.html | 254 - docs/api/launch/cli/endpoints/index.html | 356 - docs/api/launch/cli/index.html | 450 - docs/api/launch/client/index.html | 927 -- .../batching/implementation/index.html | 294 - docs/api/launch/clientlib/batching/index.html | 254 - .../batching/named_arrays/index.html | 304 - .../batching/single_array/index.html | 304 - .../clientlib/batching/types/index.html | 333 - docs/api/launch/clientlib/core/index.html | 330 - .../launch/clientlib/demonstration/index.html | 254 - .../launch/clientlib/deployment/index.html | 301 - docs/api/launch/clientlib/exe/index.html | 254 - .../clientlib/exe/run_service/index.html | 254 - .../launch/clientlib/full_service/index.html | 371 - docs/api/launch/clientlib/http/index.html | 254 - docs/api/launch/clientlib/index.html | 515 - docs/api/launch/clientlib/loader/index.html | 357 - docs/api/launch/clientlib/model/index.html | 310 - .../model_service/implementation/index.html | 294 - .../launch/clientlib/model_service/index.html | 254 - .../model_service/named_arrays/index.html | 304 - .../model_service/single_array/index.html | 304 - .../clientlib/model_service/types/index.html | 328 - .../object_conf_from_std_ml_serve/index.html | 358 - docs/api/launch/clientlib/pipeline/index.html | 254 - docs/api/launch/clientlib/service/index.html | 335 - docs/api/launch/clientlib/triton/index.html | 304 - docs/api/launch/clientlib/types/index.html | 276 - docs/api/launch/clientlib/utils/index.html | 291 - docs/api/launch/connection/index.html | 333 - docs/api/launch/constants/index.html | 254 - docs/api/launch/errors/index.html | 296 - docs/api/launch/find_packages/index.html | 325 - docs/api/launch/hooks/index.html | 784 -- docs/api/launch/index.html | 1399 -- docs/api/launch/logger/index.html | 254 - docs/api/launch/make_batch_file/index.html | 254 - docs/api/launch/model_bundle/index.html | 353 - docs/api/launch/model_endpoint/index.html | 746 -- .../api/launch/pipeline/deployment/index.html | 300 - docs/api/launch/pipeline/index.html | 413 - docs/api/launch/pipeline/runtime/index.html | 317 - docs/api/launch/pipeline/service/index.html | 335 - docs/api/launch/pipeline/utils/index.html | 331 - docs/api/launch/request_validation/index.html | 273 - docs/api/launch/retry_strategy/index.html | 254 - docs/api/launch/utils/index.html | 305 - docs/api/model_bundles.md | 3 + docs/api/model_endpoints.md | 8 + docs/cli.md | 12 + docs/cli_help.txt | 21 + docs/concepts/batch_jobs.md | 40 + docs/concepts/callbacks.md | 69 + docs/concepts/endpoint_predictions.md | 32 + docs/concepts/model_bundles.md | 244 + docs/concepts/model_endpoints.md | 127 + docs/concepts/overview.md | 14 + docs/genindex.html | 1627 --- docs/guides/deploying_your_code.html | 273 - docs/guides/getting_started.html | 371 - docs/guides/index.html | 298 - docs/guides/integrations.html | 305 - docs/guides/registering_your_code.html | 273 - docs/guides/troubleshooting.html | 297 - docs/index.html | 359 - docs/index.md | 125 + docs/objects.inv | Bin 3364 -> 0 bytes docs/plugins.py | 58 + docs/py-modindex.html | 562 - docs/search.html | 261 - docs/searchindex.js | 1 - launch/__init__.py | 2 + launch/cli/bin.py | 20 +- launch/cli/config.py | 2 +- launch/client.py | 143 +- launch/hooks.py | 11 +- launch/model_endpoint.py | 13 +- mkdocs.yml | 88 + poetry.lock | 1003 +- pyproject.toml | 11 +- tests/conftest.py | 17 + tests/test_docs.py | 136 + 113 files changed, 1653 insertions(+), 49888 deletions(-) delete mode 100644 docs/_static/_sphinx_javascript_frameworks_compat.js delete mode 100644 docs/_static/basic.css delete mode 100644 docs/_static/css/custom.css delete mode 100644 docs/_static/debug.css delete mode 100644 docs/_static/doctools.js delete mode 100644 docs/_static/documentation_options.js delete mode 100644 docs/_static/graphviz.css delete mode 100644 docs/_static/jquery-3.5.1.js delete mode 100644 docs/_static/jquery-3.6.0.js delete mode 100644 docs/_static/jquery.js delete mode 100644 docs/_static/language_data.js delete mode 100644 docs/_static/pygments.css delete mode 100644 docs/_static/scripts/furo-extensions.js delete mode 100644 docs/_static/scripts/furo.js delete mode 100644 docs/_static/scripts/furo.js.LICENSE.txt delete mode 100644 docs/_static/scripts/furo.js.map delete mode 100644 docs/_static/searchtools.js delete mode 100644 docs/_static/skeleton.css delete mode 100644 docs/_static/styles/furo-extensions.css delete mode 100644 docs/_static/styles/furo-extensions.css.map delete mode 100644 docs/_static/styles/furo.css delete mode 100644 docs/_static/styles/furo.css.map delete mode 100644 docs/_static/underscore-1.13.1.js delete mode 100644 docs/_static/underscore.js create mode 100644 docs/api/client.md create mode 100644 docs/api/endpoint_predictions.md create mode 100644 docs/api/hooks.md delete mode 100644 docs/api/launch/cli/bin/index.html delete mode 100644 docs/api/launch/cli/bundles/index.html delete mode 100644 docs/api/launch/cli/client/index.html delete mode 100644 docs/api/launch/cli/endpoints/index.html delete mode 100644 docs/api/launch/cli/index.html delete mode 100644 docs/api/launch/client/index.html delete mode 100644 docs/api/launch/clientlib/batching/implementation/index.html delete mode 100644 docs/api/launch/clientlib/batching/index.html delete mode 100644 docs/api/launch/clientlib/batching/named_arrays/index.html delete mode 100644 docs/api/launch/clientlib/batching/single_array/index.html delete mode 100644 docs/api/launch/clientlib/batching/types/index.html delete mode 100644 docs/api/launch/clientlib/core/index.html delete mode 100644 docs/api/launch/clientlib/demonstration/index.html delete mode 100644 docs/api/launch/clientlib/deployment/index.html delete mode 100644 docs/api/launch/clientlib/exe/index.html delete mode 100644 docs/api/launch/clientlib/exe/run_service/index.html delete mode 100644 docs/api/launch/clientlib/full_service/index.html delete mode 100644 docs/api/launch/clientlib/http/index.html delete mode 100644 docs/api/launch/clientlib/index.html delete mode 100644 docs/api/launch/clientlib/loader/index.html delete mode 100644 docs/api/launch/clientlib/model/index.html delete mode 100644 docs/api/launch/clientlib/model_service/implementation/index.html delete mode 100644 docs/api/launch/clientlib/model_service/index.html delete mode 100644 docs/api/launch/clientlib/model_service/named_arrays/index.html delete mode 100644 docs/api/launch/clientlib/model_service/single_array/index.html delete mode 100644 docs/api/launch/clientlib/model_service/types/index.html delete mode 100644 docs/api/launch/clientlib/object_conf_from_std_ml_serve/index.html delete mode 100644 docs/api/launch/clientlib/pipeline/index.html delete mode 100644 docs/api/launch/clientlib/service/index.html delete mode 100644 docs/api/launch/clientlib/triton/index.html delete mode 100644 docs/api/launch/clientlib/types/index.html delete mode 100644 docs/api/launch/clientlib/utils/index.html delete mode 100644 docs/api/launch/connection/index.html delete mode 100644 docs/api/launch/constants/index.html delete mode 100644 docs/api/launch/errors/index.html delete mode 100644 docs/api/launch/find_packages/index.html delete mode 100644 docs/api/launch/hooks/index.html delete mode 100644 docs/api/launch/index.html delete mode 100644 docs/api/launch/logger/index.html delete mode 100644 docs/api/launch/make_batch_file/index.html delete mode 100644 docs/api/launch/model_bundle/index.html delete mode 100644 docs/api/launch/model_endpoint/index.html delete mode 100644 docs/api/launch/pipeline/deployment/index.html delete mode 100644 docs/api/launch/pipeline/index.html delete mode 100644 docs/api/launch/pipeline/runtime/index.html delete mode 100644 docs/api/launch/pipeline/service/index.html delete mode 100644 docs/api/launch/pipeline/utils/index.html delete mode 100644 docs/api/launch/request_validation/index.html delete mode 100644 docs/api/launch/retry_strategy/index.html delete mode 100644 docs/api/launch/utils/index.html create mode 100644 docs/api/model_bundles.md create mode 100644 docs/api/model_endpoints.md create mode 100644 docs/cli.md create mode 100644 docs/cli_help.txt create mode 100644 docs/concepts/batch_jobs.md create mode 100644 docs/concepts/callbacks.md create mode 100644 docs/concepts/endpoint_predictions.md create mode 100644 docs/concepts/model_bundles.md create mode 100644 docs/concepts/model_endpoints.md create mode 100644 docs/concepts/overview.md delete mode 100644 docs/genindex.html delete mode 100644 docs/guides/deploying_your_code.html delete mode 100644 docs/guides/getting_started.html delete mode 100644 docs/guides/index.html delete mode 100644 docs/guides/integrations.html delete mode 100644 docs/guides/registering_your_code.html delete mode 100644 docs/guides/troubleshooting.html delete mode 100644 docs/index.html create mode 100644 docs/index.md delete mode 100644 docs/objects.inv create mode 100644 docs/plugins.py delete mode 100644 docs/py-modindex.html delete mode 100644 docs/search.html delete mode 100644 docs/searchindex.js create mode 100644 mkdocs.yml create mode 100644 tests/conftest.py create mode 100644 tests/test_docs.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 09394fca..01f6f3df 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,11 +46,11 @@ jobs: - run: name: Pylint Lint Check # Uses .pylintrc for configuration command: | - poetry run pylint launch --ignore=api_client + poetry run pylint launch --ignore=api_client,openapi_client - run: name: MyPy typing check command: | - poetry run mypy --ignore-missing-imports launch --exclude launch/api_client + poetry run mypy --ignore-missing-imports launch --exclude launch/api_client --exclude launch/openapi_client - run: name: Isort Import Formatting Check # Only validation, without re-formatting command: | diff --git a/docs/_static/_sphinx_javascript_frameworks_compat.js b/docs/_static/_sphinx_javascript_frameworks_compat.js deleted file mode 100644 index 8549469d..00000000 --- a/docs/_static/_sphinx_javascript_frameworks_compat.js +++ /dev/null @@ -1,134 +0,0 @@ -/* - * _sphinx_javascript_frameworks_compat.js - * ~~~~~~~~~~ - * - * Compatability shim for jQuery and underscores.js. - * - * WILL BE REMOVED IN Sphinx 6.0 - * xref RemovedInSphinx60Warning - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - - -/** - * small helper function to urldecode strings - * - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL - */ -jQuery.urldecode = function(x) { - if (!x) { - return x - } - return decodeURIComponent(x.replace(/\+/g, ' ')); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s === 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node, addItems) { - if (node.nodeType === 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && - !jQuery(node.parentNode).hasClass(className) && - !jQuery(node.parentNode).hasClass("nohighlight")) { - var span; - var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.className = className; - } - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - if (isInSVG) { - var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - var bbox = node.parentElement.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute('class', className); - addItems.push({ - "parent": node.parentNode, - "target": rect}); - } - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this, addItems); - }); - } - } - var addItems = []; - var result = this.each(function() { - highlight(this, addItems); - }); - for (var i = 0; i < addItems.length; ++i) { - jQuery(addItems[i].parent).before(addItems[i].target); - } - return result; -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} diff --git a/docs/_static/basic.css b/docs/_static/basic.css deleted file mode 100644 index 08896771..00000000 --- a/docs/_static/basic.css +++ /dev/null @@ -1,930 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -div.section::after { - display: block; - content: ''; - clear: left; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox form.search { - overflow: hidden; -} - -div.sphinxsidebar #searchbox input[type="text"] { - float: left; - width: 80%; - padding: 0.25em; - box-sizing: border-box; -} - -div.sphinxsidebar #searchbox input[type="submit"] { - float: left; - width: 20%; - border-left: none; - padding: 0.25em; - box-sizing: border-box; -} - - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li p.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; - margin-left: auto; - margin-right: auto; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable ul { - margin-top: 0; - margin-bottom: 0; - list-style-type: none; -} - -table.indextable > tbody > tr > td > ul { - padding-left: 0em; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- domain module index --------------------------------------------------- */ - -table.modindextable td { - padding: 2px; - border-collapse: collapse; -} - -/* -- general body styles --------------------------------------------------- */ - -div.body { - min-width: 360px; - max-width: 800px; -} - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, figure.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, figure.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, figure.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -img.align-default, figure.align-default, .figure.align-default { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-default { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar, -aside.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px; - background-color: #ffe; - width: 40%; - float: right; - clear: right; - overflow-x: auto; -} - -p.sidebar-title { - font-weight: bold; -} -nav.contents, -aside.topic, - -div.admonition, div.topic, blockquote { - clear: left; -} - -/* -- topics ---------------------------------------------------------------- */ -nav.contents, -aside.topic, - -div.topic { - border: 1px solid #ccc; - padding: 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- content of sidebars/topics/admonitions -------------------------------- */ - -div.sidebar > :last-child, -aside.sidebar > :last-child, -nav.contents > :last-child, -aside.topic > :last-child, - -div.topic > :last-child, -div.admonition > :last-child { - margin-bottom: 0; -} - -div.sidebar::after, -aside.sidebar::after, -nav.contents::after, -aside.topic::after, - -div.topic::after, -div.admonition::after, -blockquote::after { - display: block; - content: ''; - clear: both; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - margin-top: 10px; - margin-bottom: 10px; - border: 0; - border-collapse: collapse; -} - -table.align-center { - margin-left: auto; - margin-right: auto; -} - -table.align-default { - margin-left: auto; - margin-right: auto; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -th > :first-child, -td > :first-child { - margin-top: 0px; -} - -th > :last-child, -td > :last-child { - margin-bottom: 0px; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure, figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption, figcaption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number, -figcaption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text, -figcaption span.caption-text { -} - -/* -- field list styles ----------------------------------------------------- */ - -table.field-list td, table.field-list th { - border: 0 !important; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.field-name { - -moz-hyphens: manual; - -ms-hyphens: manual; - -webkit-hyphens: manual; - hyphens: manual; -} - -/* -- hlist styles ---------------------------------------------------------- */ - -table.hlist { - margin: 1em 0; -} - -table.hlist td { - vertical-align: top; -} - -/* -- object description styles --------------------------------------------- */ - -.sig { - font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; -} - -.sig-name, code.descname { - background-color: transparent; - font-weight: bold; -} - -.sig-name { - font-size: 1.1em; -} - -code.descname { - font-size: 1.2em; -} - -.sig-prename, code.descclassname { - background-color: transparent; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.sig-param.n { - font-style: italic; -} - -/* C++ specific styling */ - -.sig-inline.c-texpr, -.sig-inline.cpp-texpr { - font-family: unset; -} - -.sig.c .k, .sig.c .kt, -.sig.cpp .k, .sig.cpp .kt { - color: #0033B3; -} - -.sig.c .m, -.sig.cpp .m { - color: #1750EB; -} - -.sig.c .s, .sig.c .sc, -.sig.cpp .s, .sig.cpp .sc { - color: #067D17; -} - - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -:not(li) > ol > li:first-child > :first-child, -:not(li) > ul > li:first-child > :first-child { - margin-top: 0px; -} - -:not(li) > ol > li:last-child > :last-child, -:not(li) > ul > li:last-child > :last-child { - margin-bottom: 0px; -} - -ol.simple ol p, -ol.simple ul p, -ul.simple ol p, -ul.simple ul p { - margin-top: 0; -} - -ol.simple > li:not(:first-child) > p, -ul.simple > li:not(:first-child) > p { - margin-top: 0; -} - -ol.simple p, -ul.simple p { - margin-bottom: 0; -} - -/* Docutils 0.17 and older (footnotes & citations) */ -dl.footnote > dt, -dl.citation > dt { - float: left; - margin-right: 0.5em; -} - -dl.footnote > dd, -dl.citation > dd { - margin-bottom: 0em; -} - -dl.footnote > dd:after, -dl.citation > dd:after { - content: ""; - clear: both; -} - -/* Docutils 0.18+ (footnotes & citations) */ -aside.footnote > span, -div.citation > span { - float: left; -} -aside.footnote > span:last-of-type, -div.citation > span:last-of-type { - padding-right: 0.5em; -} -aside.footnote > p { - margin-left: 2em; -} -div.citation > p { - margin-left: 4em; -} -aside.footnote > p:last-of-type, -div.citation > p:last-of-type { - margin-bottom: 0em; -} -aside.footnote > p:last-of-type:after, -div.citation > p:last-of-type:after { - content: ""; - clear: both; -} - -/* Footnotes & citations ends */ - -dl.field-list { - display: grid; - grid-template-columns: fit-content(30%) auto; -} - -dl.field-list > dt { - font-weight: bold; - word-break: break-word; - padding-left: 0.5em; - padding-right: 5px; -} - -dl.field-list > dt:after { - content: ":"; -} - -dl.field-list > dd { - padding-left: 0.5em; - margin-top: 0em; - margin-left: 0em; - margin-bottom: 0em; -} - -dl { - margin-bottom: 15px; -} - -dd > :first-child { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dl > dd:last-child, -dl > dd:last-child > :last-child { - margin-bottom: 0; -} - -dt:target, span.highlighted { - background-color: #fbe54e; -} - -rect.highlighted { - fill: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -.classifier:before { - font-style: normal; - margin: 0 0.5em; - content: ":"; - display: inline-block; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -pre, div[class*="highlight-"] { - clear: both; -} - -span.pre { - -moz-hyphens: none; - -ms-hyphens: none; - -webkit-hyphens: none; - hyphens: none; - white-space: nowrap; -} - -div[class*="highlight-"] { - margin: 1em 0; -} - -td.linenos pre { - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - display: block; -} - -table.highlighttable tbody { - display: block; -} - -table.highlighttable tr { - display: flex; -} - -table.highlighttable td { - margin: 0; - padding: 0; -} - -table.highlighttable td.linenos { - padding-right: 0.5em; -} - -table.highlighttable td.code { - flex: 1; - overflow: hidden; -} - -.highlight .hll { - display: block; -} - -div.highlight pre, -table.highlighttable pre { - margin: 0; -} - -div.code-block-caption + div { - margin-top: 0; -} - -div.code-block-caption { - margin-top: 1em; - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -table.highlighttable td.linenos, -span.linenos, -div.highlight span.gp { /* gp: Generic.Prompt */ - user-select: none; - -webkit-user-select: text; /* Safari fallback only */ - -webkit-user-select: none; /* Chrome/Safari */ - -moz-user-select: none; /* Firefox */ - -ms-user-select: none; /* IE10+ */ -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - margin: 1em 0; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -span.eqno a.headerlink { - position: absolute; - z-index: 1; -} - -div.math:hover a.headerlink { - visibility: visible; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css deleted file mode 100644 index 1c0083c6..00000000 --- a/docs/_static/css/custom.css +++ /dev/null @@ -1,5 +0,0 @@ -@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;700&display=swap'); - -body { - font-family: 'IBM Plex Sans', sans-serif; -} diff --git a/docs/_static/debug.css b/docs/_static/debug.css deleted file mode 100644 index 74d4aec3..00000000 --- a/docs/_static/debug.css +++ /dev/null @@ -1,69 +0,0 @@ -/* - This CSS file should be overridden by the theme authors. It's - meant for debugging and developing the skeleton that this theme provides. -*/ -body { - font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, - "Apple Color Emoji", "Segoe UI Emoji"; - background: lavender; -} -.sb-announcement { - background: rgb(131, 131, 131); -} -.sb-announcement__inner { - background: black; - color: white; -} -.sb-header { - background: lightskyblue; -} -.sb-header__inner { - background: royalblue; - color: white; -} -.sb-header-secondary { - background: lightcyan; -} -.sb-header-secondary__inner { - background: cornflowerblue; - color: white; -} -.sb-sidebar-primary { - background: lightgreen; -} -.sb-main { - background: blanchedalmond; -} -.sb-main__inner { - background: antiquewhite; -} -.sb-header-article { - background: lightsteelblue; -} -.sb-article-container { - background: snow; -} -.sb-article-main { - background: white; -} -.sb-footer-article { - background: lightpink; -} -.sb-sidebar-secondary { - background: lightgoldenrodyellow; -} -.sb-footer-content { - background: plum; -} -.sb-footer-content__inner { - background: palevioletred; -} -.sb-footer { - background: pink; -} -.sb-footer__inner { - background: salmon; -} -.sb-article { - background: white; -} diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js deleted file mode 100644 index c3db08d1..00000000 --- a/docs/_static/doctools.js +++ /dev/null @@ -1,264 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Base JavaScript utilities for all Sphinx HTML documentation. - * - * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ -"use strict"; - -const _ready = (callback) => { - if (document.readyState !== "loading") { - callback(); - } else { - document.addEventListener("DOMContentLoaded", callback); - } -}; - -/** - * highlight a given string on a node by wrapping it in - * span elements with the given class name. - */ -const _highlight = (node, addItems, text, className) => { - if (node.nodeType === Node.TEXT_NODE) { - const val = node.nodeValue; - const parent = node.parentNode; - const pos = val.toLowerCase().indexOf(text); - if ( - pos >= 0 && - !parent.classList.contains(className) && - !parent.classList.contains("nohighlight") - ) { - let span; - - const closestNode = parent.closest("body, svg, foreignObject"); - const isInSVG = closestNode && closestNode.matches("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.classList.add(className); - } - - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - parent.insertBefore( - span, - parent.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling - ) - ); - node.nodeValue = val.substr(0, pos); - - if (isInSVG) { - const rect = document.createElementNS( - "http://www.w3.org/2000/svg", - "rect" - ); - const bbox = parent.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute("class", className); - addItems.push({ parent: parent, target: rect }); - } - } - } else if (node.matches && !node.matches("button, select, textarea")) { - node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); - } -}; -const _highlightText = (thisNode, text, className) => { - let addItems = []; - _highlight(thisNode, addItems, text, className); - addItems.forEach((obj) => - obj.parent.insertAdjacentElement("beforebegin", obj.target) - ); -}; - -/** - * Small JavaScript module for the documentation. - */ -const Documentation = { - init: () => { - Documentation.highlightSearchWords(); - Documentation.initDomainIndexTable(); - Documentation.initOnKeyListeners(); - }, - - /** - * i18n support - */ - TRANSLATIONS: {}, - PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), - LOCALE: "unknown", - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext: (string) => { - const translated = Documentation.TRANSLATIONS[string]; - switch (typeof translated) { - case "undefined": - return string; // no translation - case "string": - return translated; // translation exists - default: - return translated[0]; // (singular, plural) translation tuple exists - } - }, - - ngettext: (singular, plural, n) => { - const translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated !== "undefined") - return translated[Documentation.PLURAL_EXPR(n)]; - return n === 1 ? singular : plural; - }, - - addTranslations: (catalog) => { - Object.assign(Documentation.TRANSLATIONS, catalog.messages); - Documentation.PLURAL_EXPR = new Function( - "n", - `return (${catalog.plural_expr})` - ); - Documentation.LOCALE = catalog.locale; - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords: () => { - const highlight = - new URLSearchParams(window.location.search).get("highlight") || ""; - const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); - if (terms.length === 0) return; // nothing to do - - // There should never be more than one element matching "div.body" - const divBody = document.querySelectorAll("div.body"); - const body = divBody.length ? divBody[0] : document.querySelector("body"); - window.setTimeout(() => { - terms.forEach((term) => _highlightText(body, term, "highlighted")); - }, 10); - - const searchBox = document.getElementById("searchbox"); - if (searchBox === null) return; - searchBox.appendChild( - document - .createRange() - .createContextualFragment( - '" - ) - ); - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords: () => { - document - .querySelectorAll("#searchbox .highlight-link") - .forEach((el) => el.remove()); - document - .querySelectorAll("span.highlighted") - .forEach((el) => el.classList.remove("highlighted")); - const url = new URL(window.location); - url.searchParams.delete("highlight"); - window.history.replaceState({}, "", url); - }, - - /** - * helper function to focus on search bar - */ - focusSearchBar: () => { - document.querySelectorAll("input[name=q]")[0]?.focus(); - }, - - /** - * Initialise the domain index toggle buttons - */ - initDomainIndexTable: () => { - const toggler = (el) => { - const idNumber = el.id.substr(7); - const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); - if (el.src.substr(-9) === "minus.png") { - el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; - toggledRows.forEach((el) => (el.style.display = "none")); - } else { - el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; - toggledRows.forEach((el) => (el.style.display = "")); - } - }; - - const togglerElements = document.querySelectorAll("img.toggler"); - togglerElements.forEach((el) => - el.addEventListener("click", (event) => toggler(event.currentTarget)) - ); - togglerElements.forEach((el) => (el.style.display = "")); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); - }, - - initOnKeyListeners: () => { - // only install a listener if it is really needed - if ( - !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && - !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS - ) - return; - - const blacklistedElements = new Set([ - "TEXTAREA", - "INPUT", - "SELECT", - "BUTTON", - ]); - document.addEventListener("keydown", (event) => { - if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements - if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys - - if (!event.shiftKey) { - switch (event.key) { - case "ArrowLeft": - if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; - - const prevLink = document.querySelector('link[rel="prev"]'); - if (prevLink && prevLink.href) { - window.location.href = prevLink.href; - event.preventDefault(); - } - break; - case "ArrowRight": - if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; - - const nextLink = document.querySelector('link[rel="next"]'); - if (nextLink && nextLink.href) { - window.location.href = nextLink.href; - event.preventDefault(); - } - break; - case "Escape": - if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; - Documentation.hideSearchWords(); - event.preventDefault(); - } - } - - // some keyboard layouts may need Shift to get / - switch (event.key) { - case "/": - if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; - Documentation.focusSearchBar(); - event.preventDefault(); - } - }); - }, -}; - -// quick alias for translations -const _ = Documentation.gettext; - -_ready(Documentation.init); diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js deleted file mode 100644 index 8b3b96c4..00000000 --- a/docs/_static/documentation_options.js +++ /dev/null @@ -1,14 +0,0 @@ -var DOCUMENTATION_OPTIONS = { - URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: 'v0.3.3', - LANGUAGE: 'en', - COLLAPSE_INDEX: false, - BUILDER: 'html', - FILE_SUFFIX: '.html', - LINK_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt', - NAVIGATION_WITH_KEYS: false, - SHOW_SEARCH_SUMMARY: true, - ENABLE_SEARCH_SHORTCUTS: false, -}; \ No newline at end of file diff --git a/docs/_static/graphviz.css b/docs/_static/graphviz.css deleted file mode 100644 index 19e7afd3..00000000 --- a/docs/_static/graphviz.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * graphviz.css - * ~~~~~~~~~~~~ - * - * Sphinx stylesheet -- graphviz extension. - * - * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -img.graphviz { - border: 0; - max-width: 100%; -} - -object.graphviz { - max-width: 100%; -} diff --git a/docs/_static/jquery-3.5.1.js b/docs/_static/jquery-3.5.1.js deleted file mode 100644 index 50937333..00000000 --- a/docs/_static/jquery-3.5.1.js +++ /dev/null @@ -1,10872 +0,0 @@ -/*! - * jQuery JavaScript Library v3.5.1 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2020-05-04T22:49Z - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var flat = arr.flat ? function( array ) { - return arr.flat.call( array ); -} : function( array ) { - return arr.concat.apply( [], array ); -}; - - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - -var isFunction = function isFunction( obj ) { - - // Support: Chrome <=57, Firefox <=52 - // In some browsers, typeof returns "function" for HTML elements - // (i.e., `typeof document.createElement( "object" ) === "function"`). - // We don't want to classify *any* DOM node as a function. - return typeof obj === "function" && typeof obj.nodeType !== "number"; - }; - - -var isWindow = function isWindow( obj ) { - return obj != null && obj === obj.window; - }; - - -var document = window.document; - - - - var preservedScriptAttributes = { - type: true, - src: true, - nonce: true, - noModule: true - }; - - function DOMEval( code, node, doc ) { - doc = doc || document; - - var i, val, - script = doc.createElement( "script" ); - - script.text = code; - if ( node ) { - for ( i in preservedScriptAttributes ) { - - // Support: Firefox 64+, Edge 18+ - // Some browsers don't support the "nonce" property on scripts. - // On the other hand, just using `getAttribute` is not enough as - // the `nonce` attribute is reset to an empty string whenever it - // becomes browsing-context connected. - // See https://github.com/whatwg/html/issues/2369 - // See https://html.spec.whatwg.org/#nonce-attributes - // The `node.getAttribute` check was added for the sake of - // `jQuery.globalEval` so that it can fake a nonce-containing node - // via an object. - val = node[ i ] || node.getAttribute && node.getAttribute( i ); - if ( val ) { - script.setAttribute( i, val ); - } - } - } - doc.head.appendChild( script ).parentNode.removeChild( script ); - } - - -function toType( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; -} -/* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.5.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - even: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return ( i + 1 ) % 2; - } ) ); - }, - - odd: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return i % 2; - } ) ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - copy = options[ name ]; - - // Prevent Object.prototype pollution - // Prevent never-ending loop - if ( name === "__proto__" || target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - src = target[ name ]; - - // Ensure proper type for the source value - if ( copyIsArray && !Array.isArray( src ) ) { - clone = []; - } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { - clone = {}; - } else { - clone = src; - } - copyIsArray = false; - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - // Evaluates a script in a provided context; falls back to the global one - // if not specified. - globalEval: function( code, options, doc ) { - DOMEval( code, { nonce: options && options.nonce }, doc ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return flat( ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), -function( _i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -} ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = toType( obj ); - - if ( isFunction( obj ) || isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.5 - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://js.foundation/ - * - * Date: 2020-03-14 - */ -( function( window ) { -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - nonnativeSelectorCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ( {} ).hasOwnProperty, - arr = [], - pop = arr.pop, - pushNative = arr.push, - push = arr.push, - slice = arr.slice, - - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[ i ] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + - "ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram - identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + - "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - - // "Attribute values must be CSS identifiers [capture 5] - // or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + - whitespace + "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + - whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + - "*" ), - rdescend = new RegExp( whitespace + "|>" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + - whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + - whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + - "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + - "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rhtml = /HTML$/i, - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), - funescape = function( escape, nonHex ) { - var high = "0x" + escape.slice( 1 ) - 0x10000; - - return nonHex ? - - // Strip the backslash prefix from a non-hex escape sequence - nonHex : - - // Replace a hexadecimal escape sequence with the encoded Unicode code point - // Support: IE <=11+ - // For values outside the Basic Multilingual Plane (BMP), manually construct a - // surrogate pair - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + - ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - inDisabledFieldset = addCombinator( - function( elem ) { - return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - ( arr = slice.call( preferredDoc.childNodes ) ), - preferredDoc.childNodes - ); - - // Support: Android<4.0 - // Detect silently failing push.apply - // eslint-disable-next-line no-unused-expressions - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - pushNative.apply( target, slice.call( els ) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - - // Can't trust NodeList.length - while ( ( target[ j++ ] = els[ i++ ] ) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - setDocument( context ); - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { - - // ID selector - if ( ( m = match[ 1 ] ) ) { - - // Document context - if ( nodeType === 9 ) { - if ( ( elem = context.getElementById( m ) ) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && ( elem = newContext.getElementById( m ) ) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[ 2 ] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !nonnativeSelectorCache[ selector + " " ] && - ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && - - // Support: IE 8 only - // Exclude object elements - ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { - - newSelector = selector; - newContext = context; - - // qSA considers elements outside a scoping root when evaluating child or - // descendant combinators, which is not what we want. - // In such cases, we work around the behavior by prefixing every selector in the - // list with an ID selector referencing the scope context. - // The technique has to be used as well when a leading combinator is used - // as such selectors are not recognized by querySelectorAll. - // Thanks to Andrew Dupont for this technique. - if ( nodeType === 1 && - ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - - // We can use :scope instead of the ID hack if the browser - // supports it & if we're not changing the context. - if ( newContext !== context || !support.scope ) { - - // Capture the context ID, setting it first if necessary - if ( ( nid = context.getAttribute( "id" ) ) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", ( nid = expando ) ); - } - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + - toSelector( groups[ i ] ); - } - newSelector = groups.join( "," ); - } - - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - nonnativeSelectorCache( selector, true ); - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return ( cache[ key + " " ] = value ); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement( "fieldset" ); - - try { - return !!fn( el ); - } catch ( e ) { - return false; - } finally { - - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split( "|" ), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[ i ] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( ( cur = cur.nextSibling ) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return ( name === "input" || name === "button" ) && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - inDisabledFieldset( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction( function( argument ) { - argument = +argument; - return markFunction( function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ ( j = matchIndexes[ i ] ) ] ) { - seed[ j ] = !( matches[ j ] = seed[ j ] ); - } - } - } ); - } ); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - var namespace = elem.namespaceURI, - docElem = ( elem.ownerDocument || elem ).documentElement; - - // Support: IE <=8 - // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes - // https://bugs.jquery.com/ticket/4833 - return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9 - 11+, Edge 12 - 18+ - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( preferredDoc != document && - ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, - // Safari 4 - 5 only, Opera <=11.6 - 12.x only - // IE/Edge & older browsers don't support the :scope pseudo-class. - // Support: Safari 6.0 only - // Safari 6.0 supports :scope but it's an alias of :root there. - support.scope = assert( function( el ) { - docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); - return typeof el.querySelectorAll !== "undefined" && - !el.querySelectorAll( ":scope fieldset div" ).length; - } ); - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert( function( el ) { - el.className = "i"; - return !el.getAttribute( "className" ); - } ); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert( function( el ) { - el.appendChild( document.createComment( "" ) ); - return !el.getElementsByTagName( "*" ).length; - } ); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert( function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - } ); - - // ID filter and find - if ( support.getById ) { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute( "id" ) === attrId; - }; - }; - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode( "id" ); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( ( elem = elems[ i++ ] ) ) { - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find[ "TAG" ] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { - - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert( function( el ) { - - var input; - - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "" + - ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll( "[selected]" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push( "~=" ); - } - - // Support: IE 11+, Edge 15 - 18+ - // IE 11/Edge don't find elements on a `[name='']` query in some cases. - // Adding a temporary attribute to the document before the selection works - // around the issue. - // Interestingly, IE 10 & older don't seem to have the issue. - input = document.createElement( "input" ); - input.setAttribute( "name", "" ); - el.appendChild( input ); - if ( !el.querySelectorAll( "[name='']" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + - whitespace + "*(?:''|\"\")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll( ":checked" ).length ) { - rbuggyQSA.push( ":checked" ); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push( ".#.+[+~]" ); - } - - // Support: Firefox <=3.6 - 5 only - // Old Firefox doesn't throw on a badly-escaped identifier. - el.querySelectorAll( "\\\f" ); - rbuggyQSA.push( "[\\r\\n\\f]" ); - } ); - - assert( function( el ) { - el.innerHTML = "" + - ""; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement( "input" ); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll( "[name=d]" ).length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: Opera 10 - 11 only - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll( "*,:x" ); - rbuggyQSA.push( ",.*:" ); - } ); - } - - if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector ) ) ) ) { - - assert( function( el ) { - - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - } ); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - ) ); - } : - function( a, b ) { - if ( b ) { - while ( ( b = b.parentNode ) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { - - // Choose the first element that is related to our preferred document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( a == document || a.ownerDocument == preferredDoc && - contains( preferredDoc, a ) ) { - return -1; - } - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( b == document || b.ownerDocument == preferredDoc && - contains( preferredDoc, b ) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - return a == document ? -1 : - b == document ? 1 : - /* eslint-enable eqeqeq */ - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( ( cur = cur.parentNode ) ) { - ap.unshift( cur ); - } - cur = b; - while ( ( cur = cur.parentNode ) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[ i ] === bp[ i ] ) { - i++; - } - - return i ? - - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[ i ], bp[ i ] ) : - - // Otherwise nodes in our document sort first - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - ap[ i ] == preferredDoc ? -1 : - bp[ i ] == preferredDoc ? 1 : - /* eslint-enable eqeqeq */ - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - setDocument( elem ); - - if ( support.matchesSelector && documentIsHTML && - !nonnativeSelectorCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch ( e ) { - nonnativeSelectorCache( expr, true ); - } - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( context.ownerDocument || context ) != document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( elem.ownerDocument || elem ) != document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; -}; - -Sizzle.escape = function( sel ) { - return ( sel + "" ).replace( rcssescape, fcssescape ); -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - - // If no nodeType, this is expected to be an array - while ( ( node = elem[ i++ ] ) ) { - - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[ 1 ] = match[ 1 ].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[ 3 ] = ( match[ 3 ] || match[ 4 ] || - match[ 5 ] || "" ).replace( runescape, funescape ); - - if ( match[ 2 ] === "~=" ) { - match[ 3 ] = " " + match[ 3 ] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[ 1 ] = match[ 1 ].toLowerCase(); - - if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { - - // nth-* requires argument - if ( !match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[ 4 ] = +( match[ 4 ] ? - match[ 5 ] + ( match[ 6 ] || 1 ) : - 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); - match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); - - // other types prohibit arguments - } else if ( match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[ 6 ] && match[ 2 ]; - - if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[ 3 ] ) { - match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - - // Get excess from tokenize (recursively) - ( excess = tokenize( unquoted, true ) ) && - - // advance to the next closing parenthesis - ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { - - // excess is a negative index - match[ 0 ] = match[ 0 ].slice( 0, excess ); - match[ 2 ] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { - return true; - } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - ( pattern = new RegExp( "(^|" + whitespace + - ")" + className + "(" + whitespace + "|$)" ) ) && classCache( - className, function( elem ) { - return pattern.test( - typeof elem.className === "string" && elem.className || - typeof elem.getAttribute !== "undefined" && - elem.getAttribute( "class" ) || - "" - ); - } ); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - /* eslint-disable max-len */ - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - /* eslint-enable max-len */ - - }; - }, - - "CHILD": function( type, what, _argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, _context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( ( node = node[ dir ] ) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( ( node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - - // Use previously-cached element index if available - if ( useCache ) { - - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - - // Use the same loop as above to seek `elem` from the start - while ( ( node = ++nodeIndex && node && node[ dir ] || - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - if ( ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || - ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction( function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[ i ] ); - seed[ idx ] = !( matches[ idx ] = matched[ i ] ); - } - } ) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - - // Potentially complex pseudos - "not": markFunction( function( selector ) { - - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction( function( seed, matches, _context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( ( elem = unmatched[ i ] ) ) { - seed[ i ] = !( matches[ i ] = elem ); - } - } - } ) : - function( elem, _context, xml ) { - input[ 0 ] = elem; - matcher( input, null, xml, results ); - - // Don't keep the element (issue #299) - input[ 0 ] = null; - return !results.pop(); - }; - } ), - - "has": markFunction( function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - } ), - - "contains": markFunction( function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; - }; - } ), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - - // lang value must be a valid identifier - if ( !ridentifier.test( lang || "" ) ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( ( elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); - return false; - }; - } ), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && - ( !document.hasFocus || document.hasFocus() ) && - !!( elem.type || elem.href || ~elem.tabIndex ); - }, - - // Boolean properties - "enabled": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( true ), - - "checked": function( elem ) { - - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return ( nodeName === "input" && !!elem.checked ) || - ( nodeName === "option" && !!elem.selected ); - }, - - "selected": function( elem ) { - - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - // eslint-disable-next-line no-unused-expressions - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos[ "empty" ]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( ( attr = elem.getAttribute( "type" ) ) == null || - attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo( function() { - return [ 0 ]; - } ), - - "last": createPositionalPseudo( function( _matchIndexes, length ) { - return [ length - 1 ]; - } ), - - "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - } ), - - "even": createPositionalPseudo( function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "odd": createPositionalPseudo( function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? - argument + length : - argument > length ? - length : - argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ) - } -}; - -Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || ( match = rcomma.exec( soFar ) ) ) { - if ( match ) { - - // Don't consume trailing commas as valid - soFar = soFar.slice( match[ 0 ].length ) || soFar; - } - groups.push( ( tokens = [] ) ); - } - - matched = false; - - // Combinators - if ( ( match = rcombinators.exec( soFar ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - - // Cast descendant combinators to space - type: match[ 0 ].replace( rtrim, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || - ( match = preFilters[ type ]( match ) ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[ i ].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - return false; - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || ( elem[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || - ( outerCache[ elem.uniqueID ] = {} ); - - if ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( ( oldCache = uniqueCache[ key ] ) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return ( newCache[ 2 ] = oldCache[ 2 ] ); - } else { - - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { - return true; - } - } - } - } - } - return false; - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[ i ]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[ 0 ]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[ i ], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( ( elem = unmatched[ i ] ) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction( function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( - selector || "*", - context.nodeType ? [ context ] : context, - [] - ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( ( elem = temp[ i ] ) ) { - matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) ) { - - // Restore matcherIn since elem is not yet a final match - temp.push( ( matcherIn[ i ] = elem ) ); - } - } - postFinder( null, ( matcherOut = [] ), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) && - ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { - - seed[ temp ] = !( results[ temp ] = elem ); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - } ); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[ 0 ].type ], - implicitRelative = leadingRelative || Expr.relative[ " " ], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - ( checkContext = context ).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { - matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; - } else { - matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[ j ].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens - .slice( 0, i - 1 ) - .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), - - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), - len = elems.length; - - if ( outermost ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - outermostContext = context == document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( !context && elem.ownerDocument != document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( ( matcher = elementMatchers[ j++ ] ) ) { - if ( matcher( elem, context || document, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - - // They will have gone through all possible matchers - if ( ( elem = !matcher && elem ) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( ( matcher = setMatchers[ j++ ] ) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !( unmatched[ i ] || setMatched[ i ] ) ) { - setMatched[ i ] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[ i ] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( - selector, - matcherFromGroupMatchers( elementMatchers, setMatchers ) - ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( ( selector = compiled.selector || selector ) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[ 0 ] = match[ 0 ].slice( 0 ); - if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { - - context = ( Expr.find[ "ID" ]( token.matches[ 0 ] - .replace( runescape, funescape ), context ) || [] )[ 0 ]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[ i ]; - - // Abort if we hit a combinator - if ( Expr.relative[ ( type = token.type ) ] ) { - break; - } - if ( ( find = Expr.find[ type ] ) ) { - - // Search, expanding context for leading sibling combinators - if ( ( seed = find( - token.matches[ 0 ].replace( runescape, funescape ), - rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || - context - ) ) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert( function( el ) { - - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; -} ); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert( function( el ) { - el.innerHTML = ""; - return el.firstChild.getAttribute( "href" ) === "#"; -} ) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - } ); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert( function( el ) { - el.innerHTML = ""; - el.firstChild.setAttribute( "value", "" ); - return el.firstChild.getAttribute( "value" ) === ""; -} ) ) { - addHandle( "value", function( elem, _name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - } ); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert( function( el ) { - return el.getAttribute( "disabled" ) == null; -} ) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; - } - } ); -} - -return Sizzle; - -} )( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; - -// Deprecated -jQuery.expr[ ":" ] = jQuery.expr.pseudos; -jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; -jQuery.escapeSelector = Sizzle.escape; - - - - -var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - - - -function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - -}; -var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Filtered directly for both simple and complex selectors - return jQuery.filter( qualifier, elements, not ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, _i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, _i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, _i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - if ( elem.contentDocument != null && - - // Support: IE 11+ - // elements with no `data` attribute has an object - // `contentDocument` with a `null` prototype. - getProto( elem.contentDocument ) ) { - - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -} ); -var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = locked || options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && toType( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -function Identity( v ) { - return v; -} -function Thrower( ex ) { - throw ex; -} - -function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } -} - -jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( _i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // rejected_handlers.disable - // fulfilled_handlers.disable - tuples[ 3 - i ][ 3 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock, - - // progress_handlers.lock - tuples[ 0 ][ 3 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the master Deferred - master = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - master.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( master.state() === "pending" || - isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return master.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); - } - - return master.promise(); - } -} ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. -var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - -jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } -}; - - - - -jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); -}; - - - - -// The deferred used on DOM ready -var readyList = jQuery.Deferred(); - -jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; -}; - -jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } -} ); - -jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method -function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); -} - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - -} else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); -} - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( toType( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, _key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; -}; - - -// Matches dashed string for camelizing -var rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g; - -// Used by camelCase as callback to replace() -function fcamelCase( _all, letter ) { - return letter.toUpperCase(); -} - -// Convert dashed to camelCase; used by the css and data modules -// Support: IE <=9 - 11, Edge 12 - 15 -// Microsoft forgot to hump their vendor prefix (#9572) -function camelCase( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); -} -var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - - - -function Data() { - this.expando = jQuery.expando + Data.uid++; -} - -Data.uid = 1; - -Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( camelCase ); - } else { - key = camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } -}; -var dataPriv = new Data(); - -var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - -function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; -} - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); -var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - -var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var documentElement = document.documentElement; - - - - var isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ); - }, - composed = { composed: true }; - - // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only - // Check attachment across shadow DOM boundaries when possible (gh-3504) - // Support: iOS 10.0-10.2 only - // Early iOS 10 versions support `attachShadow` but not `getRootNode`, - // leading to errors. We need to check for `getRootNode`. - if ( documentElement.getRootNode ) { - isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ) || - elem.getRootNode( composed ) === elem.ownerDocument; - }; - } -var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - isAttached( elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, scale, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = elem.nodeType && - ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Support: Firefox <=54 - // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) - initial = initial / 2; - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - while ( maxIterations-- ) { - - // Evaluate and update our best guess (doubling guesses that zero out). - // Finish if the scale equals or crosses 1 (making the old*new product non-positive). - jQuery.style( elem, prop, initialInUnit + unit ); - if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { - maxIterations = 0; - } - initialInUnit = initialInUnit / scale; - - } - - initialInUnit = initialInUnit * 2; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; -} - - -var defaultDisplayMap = {}; - -function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; -} - -function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; -} - -jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } -} ); -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); - -var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); - - - -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // Support: IE <=9 only - // IE <=9 replaces "; - support.option = !!div.lastChild; -} )(); - - -// We have to close these tags to support XHTML (#13200) -var wrapMap = { - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting or other required elements. - thead: [ 1, "", "
" ], - col: [ 2, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - _default: [ 0, "", "" ] -}; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// Support: IE <=9 only -if ( !support.option ) { - wrapMap.optgroup = wrapMap.option = [ 1, "" ]; -} - - -function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/; - -function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, attached, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( toType( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - attached = isAttached( elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( attached ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; -} - - -var - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -// Support: IE <=9 - 11+ -// focus() and blur() are asynchronous, except when they are no-op. -// So expect focus to be synchronous when the element is already active, -// and blur to be synchronous when the element is not already active. -// (focus and blur are always synchronous in other supported browsers, -// this just defines when we can count on it). -function expectSync( elem, type ) { - return ( elem === safeActiveElement() ) === ( type === "focus" ); -} - -// Support: IE <=9 only -// Accessing document.activeElement can throw unexpectedly -// https://bugs.jquery.com/ticket/13393 -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Only attach events to objects that accept data - if ( !acceptData( elem ) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = Object.create( null ); - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( nativeEvent ), - - handlers = ( - dataPriv.get( this, "events" ) || Object.create( null ) - )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // If the event is namespaced, then each handler is only invoked if it is - // specially universal or its namespaces are a superset of the event's. - if ( !event.rnamespace || handleObj.namespace === false || - event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - click: { - - // Utilize native event to ensure correct state for checkable inputs - setup: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Claim the first handler - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - // dataPriv.set( el, "click", ... ) - leverageNative( el, "click", returnTrue ); - } - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Force setup before triggering a click - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - leverageNative( el, "click" ); - } - - // Return non-false to allow normal event-path propagation - return true; - }, - - // For cross-browser consistency, suppress native .click() on links - // Also prevent it if we're currently inside a leveraged native-event stack - _default: function( event ) { - var target = event.target; - return rcheckableType.test( target.type ) && - target.click && nodeName( target, "input" ) && - dataPriv.get( target, "click" ) || - nodeName( target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } -}; - -// Ensure the presence of an event listener that handles manually-triggered -// synthetic events by interrupting progress until reinvoked in response to -// *native* events that it fires directly, ensuring that state changes have -// already occurred before other listeners are invoked. -function leverageNative( el, type, expectSync ) { - - // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add - if ( !expectSync ) { - if ( dataPriv.get( el, type ) === undefined ) { - jQuery.event.add( el, type, returnTrue ); - } - return; - } - - // Register the controller as a special universal handler for all event namespaces - dataPriv.set( el, type, false ); - jQuery.event.add( el, type, { - namespace: false, - handler: function( event ) { - var notAsync, result, - saved = dataPriv.get( this, type ); - - if ( ( event.isTrigger & 1 ) && this[ type ] ) { - - // Interrupt processing of the outer synthetic .trigger()ed event - // Saved data should be false in such cases, but might be a leftover capture object - // from an async native handler (gh-4350) - if ( !saved.length ) { - - // Store arguments for use when handling the inner native event - // There will always be at least one argument (an event object), so this array - // will not be confused with a leftover capture object. - saved = slice.call( arguments ); - dataPriv.set( this, type, saved ); - - // Trigger the native event and capture its result - // Support: IE <=9 - 11+ - // focus() and blur() are asynchronous - notAsync = expectSync( this, type ); - this[ type ](); - result = dataPriv.get( this, type ); - if ( saved !== result || notAsync ) { - dataPriv.set( this, type, false ); - } else { - result = {}; - } - if ( saved !== result ) { - - // Cancel the outer synthetic event - event.stopImmediatePropagation(); - event.preventDefault(); - return result.value; - } - - // If this is an inner synthetic event for an event with a bubbling surrogate - // (focus or blur), assume that the surrogate already propagated from triggering the - // native event and prevent that from happening again here. - // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the - // bubbling surrogate propagates *after* the non-bubbling base), but that seems - // less bad than duplication. - } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { - event.stopPropagation(); - } - - // If this is a native event triggered above, everything is now in order - // Fire an inner synthetic event with the original arguments - } else if ( saved.length ) { - - // ...and capture the result - dataPriv.set( this, type, { - value: jQuery.event.trigger( - - // Support: IE <=9 - 11+ - // Extend with the prototype to reset the above stopImmediatePropagation() - jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), - saved.slice( 1 ), - this - ) - } ); - - // Abort handling of the native event - event.stopImmediatePropagation(); - } - } - } ); -} - -jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } -}; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || Date.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Includes all common event props including KeyEvent and MouseEvent specific props -jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - code: true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - - which: function( event ) { - var button = event.button; - - // Add which for key events - if ( event.which == null && rkeyEvent.test( event.type ) ) { - return event.charCode != null ? event.charCode : event.keyCode; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { - if ( button & 1 ) { - return 1; - } - - if ( button & 2 ) { - return 3; - } - - if ( button & 4 ) { - return 2; - } - - return 0; - } - - return event.which; - } -}, jQuery.event.addProp ); - -jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { - jQuery.event.special[ type ] = { - - // Utilize native event if possible so blur/focus sequence is correct - setup: function() { - - // Claim the first handler - // dataPriv.set( this, "focus", ... ) - // dataPriv.set( this, "blur", ... ) - leverageNative( this, type, expectSync ); - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function() { - - // Force setup before trigger - leverageNative( this, type ); - - // Return non-false to allow normal event-path propagation - return true; - }, - - delegateType: delegateType - }; -} ); - -// Create mouseenter/leave events using mouseover/out and event-time checks -// so that event delegation works in jQuery. -// Do the same for pointerenter/pointerleave and pointerover/pointerout -// -// Support: Safari 7 only -// Safari sends mouseenter too often; see: -// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 -// for the description of the bug (it existed in older Chrome versions as well). -jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } -} ); - - -var - - // Support: IE <=10 - 11, Edge 12 - 13 only - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g; - -// Prefer a tbody over its parent table for containing new rows -function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( elem ).children( "tbody" )[ 0 ] || elem; - } - - return elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { - elem.type = elem.type.slice( 5 ); - } else { - elem.removeAttribute( "type" ); - } - - return elem; -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.get( src ); - events = pdataOld.events; - - if ( events ) { - dataPriv.remove( dest, "handle events" ); - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } -} - -// Fix IE bugs, see support tests -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = flat( args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - valueIsFunction = isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( valueIsFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( valueIsFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl && !node.noModule ) { - jQuery._evalUrl( node.src, { - nonce: node.nonce || node.getAttribute( "nonce" ) - }, doc ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); - } - } - } - } - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && isAttached( node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html; - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = isAttached( elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } -} ); - -jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); -var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - -var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - -var swap = function( elem, options, callback ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.call( elem ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - -var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); - - - -( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - container.style.cssText = "position:absolute;left:-11111px;width:60px;" + - "margin-top:1px;padding:0;border:0"; - div.style.cssText = - "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + - "margin:auto;border:1px;padding:1px;" + - "width:60%;top:1%"; - documentElement.appendChild( container ).appendChild( div ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; - - // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 - // Some styles come back with percentage values, even though they shouldn't - div.style.right = "60%"; - pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; - - // Support: IE 9 - 11 only - // Detect misreporting of content dimensions for box-sizing:border-box elements - boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; - - // Support: IE 9 only - // Detect overflow:scroll screwiness (gh-3699) - // Support: Chrome <=64 - // Don't get tricked when zoom affects offsetWidth (gh-4029) - div.style.position = "absolute"; - scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - function roundPixelMeasures( measure ) { - return Math.round( parseFloat( measure ) ); - } - - var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, - reliableTrDimensionsVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - jQuery.extend( support, { - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelBoxStyles: function() { - computeStyleTests(); - return pixelBoxStylesVal; - }, - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - }, - scrollboxSize: function() { - computeStyleTests(); - return scrollboxSizeVal; - }, - - // Support: IE 9 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Behavior in IE 9 is more subtle than in newer versions & it passes - // some versions of this test; make sure not to make it pass there! - reliableTrDimensions: function() { - var table, tr, trChild, trStyle; - if ( reliableTrDimensionsVal == null ) { - table = document.createElement( "table" ); - tr = document.createElement( "tr" ); - trChild = document.createElement( "div" ); - - table.style.cssText = "position:absolute;left:-11111px"; - tr.style.height = "1px"; - trChild.style.height = "9px"; - - documentElement - .appendChild( table ) - .appendChild( tr ) - .appendChild( trChild ); - - trStyle = window.getComputedStyle( tr ); - reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; - - documentElement.removeChild( table ); - } - return reliableTrDimensionsVal; - } - } ); -} )(); - - -function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !isAttached( elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; -} - - -function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; -} - - -var cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style, - vendorProps = {}; - -// Return a vendor-prefixed property or undefined -function vendorPropName( name ) { - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } -} - -// Return a potentially-mapped jQuery.cssProps or vendor prefixed property -function finalPropName( name ) { - var final = jQuery.cssProps[ name ] || vendorProps[ name ]; - - if ( final ) { - return final; - } - if ( name in emptyStyle ) { - return name; - } - return vendorProps[ name ] = vendorPropName( name ) || name; -} - - -var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }; - -function setPositiveNumber( _elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; -} - -function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { - var i = dimension === "width" ? 1 : 0, - extra = 0, - delta = 0; - - // Adjustment may not be necessary - if ( box === ( isBorderBox ? "border" : "content" ) ) { - return 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin - if ( box === "margin" ) { - delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); - } - - // If we get here with a content-box, we're seeking "padding" or "border" or "margin" - if ( !isBorderBox ) { - - // Add padding - delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // For "border" or "margin", add border - if ( box !== "padding" ) { - delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - - // But still keep track of it otherwise - } else { - extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - - // If we get here with a border-box (content + padding + border), we're seeking "content" or - // "padding" or "margin" - } else { - - // For "content", subtract padding - if ( box === "content" ) { - delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // For "content" or "padding", subtract border - if ( box !== "margin" ) { - delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - // Account for positive content-box scroll gutter when requested by providing computedVal - if ( !isBorderBox && computedVal >= 0 ) { - - // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border - // Assuming integer scroll gutter, subtract the rest and round down - delta += Math.max( 0, Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - computedVal - - delta - - extra - - 0.5 - - // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter - // Use an explicit zero to avoid NaN (gh-3964) - ) ) || 0; - } - - return delta; -} - -function getWidthOrHeight( elem, dimension, extra ) { - - // Start with computed style - var styles = getStyles( elem ), - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). - // Fake content-box until we know it's needed to know the true value. - boxSizingNeeded = !support.boxSizingReliable() || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - valueIsBorderBox = isBorderBox, - - val = curCSS( elem, dimension, styles ), - offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); - - // Support: Firefox <=54 - // Return a confounding non-pixel value or feign ignorance, as appropriate. - if ( rnumnonpx.test( val ) ) { - if ( !extra ) { - return val; - } - val = "auto"; - } - - - // Support: IE 9 - 11 only - // Use offsetWidth/offsetHeight for when box sizing is unreliable. - // In those cases, the computed value can be trusted to be border-box. - if ( ( !support.boxSizingReliable() && isBorderBox || - - // Support: IE 10 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Interestingly, in some cases IE 9 doesn't suffer from this issue. - !support.reliableTrDimensions() && nodeName( elem, "tr" ) || - - // Fall back to offsetWidth/offsetHeight when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - val === "auto" || - - // Support: Android <=4.1 - 4.3 only - // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) - !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && - - // Make sure the element is visible & connected - elem.getClientRects().length ) { - - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Where available, offsetWidth/offsetHeight approximate border box dimensions. - // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the - // retrieved value as a content box dimension. - valueIsBorderBox = offsetProp in elem; - if ( valueIsBorderBox ) { - val = elem[ offsetProp ]; - } - } - - // Normalize "" and auto - val = parseFloat( val ) || 0; - - // Adjust for the element's box model - return ( val + - boxModelAdjustment( - elem, - dimension, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles, - - // Provide the current computed size to request scroll gutter calculation (gh-3589) - val - ) - ) + "px"; -} - -jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "gridArea": true, - "gridColumn": true, - "gridColumnEnd": true, - "gridColumnStart": true, - "gridRow": true, - "gridRowEnd": true, - "gridRowStart": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: {}, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append - // "px" to a few hardcoded values. - if ( type === "number" && !isCustomProp ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } -} ); - -jQuery.each( [ "height", "width" ], function( _i, dimension ) { - jQuery.cssHooks[ dimension ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, dimension, extra ); - } ) : - getWidthOrHeight( elem, dimension, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = getStyles( elem ), - - // Only read styles.position if the test has a chance to fail - // to avoid forcing a reflow. - scrollboxSizeBuggy = !support.scrollboxSize() && - styles.position === "absolute", - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) - boxSizingNeeded = scrollboxSizeBuggy || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - subtract = extra ? - boxModelAdjustment( - elem, - dimension, - extra, - isBorderBox, - styles - ) : - 0; - - // Account for unreliable border-box dimensions by comparing offset* to computed and - // faking a content-box to get border and padding (gh-3699) - if ( isBorderBox && scrollboxSizeBuggy ) { - subtract -= Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - parseFloat( styles[ dimension ] ) - - boxModelAdjustment( elem, dimension, "border", false, styles ) - - 0.5 - ); - } - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ dimension ] = value; - value = jQuery.css( elem, dimension ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; -} ); - -jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } -); - -// These hooks are used by animate to expand properties -jQuery.each( { - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( prefix !== "margin" ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -} ); - -jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } -} ); - - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && ( - jQuery.cssHooks[ tween.prop ] || - tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" -}; - -jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point -jQuery.fx.step = {}; - - - - -var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - -function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } -} - -// Animations created synchronously will run synchronously -function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = Date.now() ); -} - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } -} - -function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 15 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY and Edge just mirrors - // the overflowX value there. - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - result.stop.bind( result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } -} ); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } -} ); - -jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -} ); - -// Generate shortcuts for custom animations -jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -} ); - -jQuery.timers = []; -jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = Date.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); -}; - -jQuery.fx.interval = 13; -jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); -}; - -jQuery.fx.stop = function() { - inProgress = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 -}; - - -// Based off of the plugin by Clint Helfers, with permission. -// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ -jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); -}; - - -( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; -} )(); - - -var boolHook, - attrHandle = jQuery.expr.attrHandle; - -jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } -} ); - -jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } -} ); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } -}; - -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; -} ); - - - - -var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - -jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } -} ); - -jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } -} ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -// eslint rule "no-unused-expressions" is disabled for this code -// since it considers such accessions noop -if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; -} - -jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -} ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - -function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; -} - -function classesToArray( value ) { - if ( Array.isArray( value ) ) { - return value; - } - if ( typeof value === "string" ) { - return value.match( rnothtmlwhite ) || []; - } - return []; -} - -jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isValidValue = type === "string" || Array.isArray( value ); - - if ( typeof stateVal === "boolean" && isValidValue ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( isValidValue ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = classesToArray( value ); - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } -} ); - - - - -var rreturn = /\r/g; - -jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, valueIsFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - valueIsFunction = isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( valueIsFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } -} ); - -jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } -} ); - -// Radios and checkboxes getter/setter -jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } -} ); - - - - -// Return jQuery for attributes-only inclusion - - -support.focusin = "onfocusin" in window; - - -var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - stopPropagationCallback = function( e ) { - e.stopPropagation(); - }; - -jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = lastElement = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - lastElement = cur; - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( - dataPriv.get( cur, "events" ) || Object.create( null ) - )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - - if ( event.isPropagationStopped() ) { - lastElement.addEventListener( type, stopPropagationCallback ); - } - - elem[ type ](); - - if ( event.isPropagationStopped() ) { - lastElement.removeEventListener( type, stopPropagationCallback ); - } - - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - -} ); - -jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -} ); - - -// Support: Firefox <=44 -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 -// focus(in | out) events fire after focus & blur events, -// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order -// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 -if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - - // Handle: regular nodes (via `this.ownerDocument`), window - // (via `this.document`) & document (via `this`). - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); -} -var location = window.location; - -var nonce = { guid: Date.now() }; - -var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) { - xml = undefined; - } - - if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; -}; - - -var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && toType( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } -} - -// Serialize an array of form elements or a set of -// key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - if ( a == null ) { - return ""; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); -}; - -jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ) - .filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ) - .map( function( _i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } -} ); - - -var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; -} - -/* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -/* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ -function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; -} - -jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() + " " ] = - ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) - .concat( match[ 2 ] ); - } - } - match = responseHeaders[ key.toLowerCase() + " " ]; - } - return match == null ? null : match.join( ", " ); - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 15 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available and should be processed, append data to url - if ( s.data && ( s.processData || typeof s.data === "string" ) ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + - uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Use a noop converter for missing script - if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { - s.converters[ "text script" ] = function() {}; - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } -} ); - -jQuery.each( [ "get", "post" ], function( _i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; -} ); - -jQuery.ajaxPrefilter( function( s ) { - var i; - for ( i in s.headers ) { - if ( i.toLowerCase() === "content-type" ) { - s.contentType = s.headers[ i ] || ""; - } - } -} ); - - -jQuery._evalUrl = function( url, options, doc ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - - // Only evaluate the response if it is successful (gh-4126) - // dataFilter is not invoked for failure responses, so using it instead - // of the default converter is kludgy but it works. - converters: { - "text script": function() {} - }, - dataFilter: function( response ) { - jQuery.globalEval( response, options, doc ); - } - } ); -}; - - -jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var htmlIsFunction = isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } -} ); - - -jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); -}; -jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); -}; - - - - -jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} -}; - -var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); -support.ajax = xhrSupported = !!xhrSupported; - -jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.ontimeout = - xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) -jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } -} ); - -// Install script dataType -jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -} ); - -// Handle cache's special case and crossDomain -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } -} ); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain or forced-by-attrs requests - if ( s.crossDomain || s.scriptAttrs ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( " - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.cli.bin#

-
-

Module Contents#

-
-

Functions#

-
- - - - - - -

entry_point(ctx, **kwargs)

This is the command line interface (CLI) package for Scale Launch.

-
-
-
-launch.cli.bin.entry_point(ctx, **kwargs)#
-

This is the command line interface (CLI) package for Scale Launch.

-
██╗      █████╗ ██╗   ██╗███╗   ██╗ ██████╗██╗  ██╗
-██║     ██╔══██╗██║   ██║████╗  ██║██╔════╝██║  ██║
-██║     ███████║██║   ██║██╔██╗ ██║██║     ███████║
-██║     ██╔══██║██║   ██║██║╚██╗██║██║     ██╔══██║
-███████╗██║  ██║╚██████╔╝██║ ╚████║╚██████╗██║  ██║
-╚══════╝╚═╝  ╚═╝ ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚═╝  ╚═╝
-
-
-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/cli/bundles/index.html b/docs/api/launch/cli/bundles/index.html deleted file mode 100644 index 2cc4527f..00000000 --- a/docs/api/launch/cli/bundles/index.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - - - launch.cli.bundles - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.cli.bundles#

-
-

Module Contents#

-
-

Functions#

-
- - - - - - - - - - - - - - - -

bundles(ctx)

Bundles is a wrapper around model bundles in Scale Launch

delete_bundle(ctx, bundle_name)

Deletes a model bundle.

get_bundle(ctx, bundle_name)

Print bundle info

list_bundles(ctx)

List all of your Bundles

-
-
-
-launch.cli.bundles.bundles(ctx)#
-

Bundles is a wrapper around model bundles in Scale Launch

-
-
Parameters:
-

ctx (click.Context) –

-
-
-
- -
-
-launch.cli.bundles.delete_bundle(ctx, bundle_name)#
-

Deletes a model bundle.

-
-
Parameters:
-
    -
  • ctx (click.Context) –

  • -
  • bundle_name (str) –

  • -
-
-
-
- -
-
-launch.cli.bundles.get_bundle(ctx, bundle_name)#
-

Print bundle info

-
-
Parameters:
-
    -
  • ctx (click.Context) –

  • -
  • bundle_name (str) –

  • -
-
-
-
- -
-
-launch.cli.bundles.list_bundles(ctx)#
-

List all of your Bundles

-
-
Parameters:
-

ctx (click.Context) –

-
-
-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/cli/client/index.html b/docs/api/launch/cli/client/index.html deleted file mode 100644 index ddd92928..00000000 --- a/docs/api/launch/cli/client/index.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - launch.cli.client - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/cli/endpoints/index.html b/docs/api/launch/cli/endpoints/index.html deleted file mode 100644 index 543b87ff..00000000 --- a/docs/api/launch/cli/endpoints/index.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - - - launch.cli.endpoints - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.cli.endpoints#

-
-

Module Contents#

-
-

Functions#

-
- - - - - - - - - - - - - - - -

delete_endpoint(ctx, endpoint_name)

Delete a model endpoint

endpoints(ctx)

Endpoints is a wrapper around model endpoints in Scale Launch

list_endpoints(ctx)

List all of your Endpoints

read_endpoint_creation_logs(ctx, endpoint_name)

Reads the creation logs for an endpoint

-
-
-
-launch.cli.endpoints.delete_endpoint(ctx, endpoint_name)#
-

Delete a model endpoint

-
-
Parameters:
-
    -
  • ctx (click.Context) –

  • -
  • endpoint_name (str) –

  • -
-
-
-
- -
-
-launch.cli.endpoints.endpoints(ctx)#
-

Endpoints is a wrapper around model endpoints in Scale Launch

-
-
Parameters:
-

ctx (click.Context) –

-
-
-
- -
-
-launch.cli.endpoints.list_endpoints(ctx)#
-

List all of your Endpoints

-
-
Parameters:
-

ctx (click.Context) –

-
-
-
- -
-
-launch.cli.endpoints.read_endpoint_creation_logs(ctx, endpoint_name)#
-

Reads the creation logs for an endpoint

-
-
Parameters:
-
    -
  • ctx (click.Context) –

  • -
  • endpoint_name (str) –

  • -
-
-
-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/cli/index.html b/docs/api/launch/cli/index.html deleted file mode 100644 index 561c9261..00000000 --- a/docs/api/launch/cli/index.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - - launch.cli - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.cli#

-
-

This is the command line interface (CLI) package for Scale Launch.

-
██╗      █████╗ ██╗   ██╗███╗   ██╗ ██████╗██╗  ██╗
-██║     ██╔══██╗██║   ██║████╗  ██║██╔════╝██║  ██║
-██║     ███████║██║   ██║██╔██╗ ██║██║     ███████║
-██║     ██╔══██║██║   ██║██║╚██╗██║██║     ██╔══██║
-███████╗██║  ██║╚██████╔╝██║ ╚████║╚██████╗██║  ██║
-╚══════╝╚═╝  ╚═╝ ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚═╝  ╚═╝
-
-
-
scale-launch [OPTIONS] COMMAND [ARGS]...
-
-
-

Options

-
-
--s, --self-hosted#
-

Use this flag if Scale Launch is self hosted

-
- -
-
--e, --gateway-endpoint <gateway_endpoint>#
-

Redefine Scale Launch gateway endpoint. Mandatory parameter when using self-hosted Scale Launch.

-
- -
-
--a, --api-key <api_key>#
-

Required Scale Launch API key

-
- -

Environment variables

-
-
-LAUNCH_GATEWAY_ENDPOINT
-
-

Provide a default for -e

-
-
- -
-
-LAUNCH_API_KEY
-
-

Provide a default for -a

-
-
- -
-

bundles#

-

Bundles is a wrapper around model bundles in Scale Launch

-
scale-launch bundles [OPTIONS] COMMAND [ARGS]...
-
-
-
-

delete#

-

Deletes a model bundle.

-
scale-launch bundles delete [OPTIONS] BUNDLE_NAME
-
-
-

Arguments

-
-
-BUNDLE_NAME#
-

Required argument

-
- -
-
-

get#

-

Print bundle info

-
scale-launch bundles get [OPTIONS] BUNDLE_NAME
-
-
-

Arguments

-
-
-BUNDLE_NAME#
-

Required argument

-
- -
-
-

list#

-

List all of your Bundles

-
scale-launch bundles list [OPTIONS]
-
-
-
-
-
-

endpoints#

-

Endpoints is a wrapper around model endpoints in Scale Launch

-
scale-launch endpoints [OPTIONS] COMMAND [ARGS]...
-
-
-
-

creation-logs#

-

Reads the creation logs for an endpoint

-
scale-launch endpoints creation-logs [OPTIONS] ENDPOINT_NAME
-
-
-

Arguments

-
-
-ENDPOINT_NAME#
-

Required argument

-
- -
-
-

delete#

-

Delete a model endpoint

-
scale-launch endpoints delete [OPTIONS] ENDPOINT_NAME
-
-
-

Arguments

-
-
-ENDPOINT_NAME#
-

Required argument

-
- -
-
-

list#

-

List all of your Endpoints

-
scale-launch endpoints list [OPTIONS]
-
-
-
-
-
-
- -
-
- -
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/client/index.html b/docs/api/launch/client/index.html deleted file mode 100644 index bf003fe1..00000000 --- a/docs/api/launch/client/index.html +++ /dev/null @@ -1,927 +0,0 @@ - - - - - - - - - launch.client - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.client#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - -

LaunchClient

Scale Launch Python Client.

-
-
-
-class launch.client.LaunchClient(api_key, endpoint=None, self_hosted=False)#
-

Scale Launch Python Client.

-

Initializes a Scale Launch Client.

-
-
Parameters:
-
    -
  • api_key (str) – Your Scale API key

  • -
  • endpoint (Optional[str]) – The Scale Launch Endpoint (this should not need to be changed)

  • -
  • self_hosted (bool) – True iff you are connecting to a self-hosted Scale Launch

  • -
-
-
-
-
-async_request(endpoint_name, url=None, args=None, return_pickled=True)#
-

Not recommended to use this, instead we recommend to use functions provided by AsyncEndpoint. -Makes a request to the Async Model Endpoint at endpoint_id, and immediately returns a key that can be used to retrieve -the result of inference at a later time.

-
-
Parameters:
-
    -
  • endpoint_name (str) – The name of the endpoint to make the request to

  • -
  • url (Optional[str]) –

    A url that points to a file containing model input. -Must be accessible by Scale Launch, hence it needs to either be public or a signedURL. -Note: the contents of the file located at url are opened as a sequence of bytes and passed -to the predict function. If you instead want to pass the url itself as an input to the predict function, -see args.

    -

    Exactly one of url and args must be specified.

    -

  • -
  • args (Optional[Dict]) –

    A dictionary of arguments to the ModelBundle’s predict function. -Must be json-serializable, i.e. composed of str, int, float, etc. -If your predict function has signature predict(foo, bar), then args should be a dictionary with -keys "foo" and "bar".

    -

    Exactly one of url and args must be specified.

    -

  • -
  • return_pickled (bool) – Whether the python object returned is pickled, or directly written to the file returned.

  • -
-
-
Returns:
-

An id/key that can be used to fetch inference results at a later time. -Example output:

-
-

abcabcab-cabc-abca-0123456789ab

-
-

-
-
Return type:
-

str

-
-
-
- -
-
-batch_async_request(model_bundle, urls=None, inputs=None, batch_url_file_location=None, serialization_format='json', batch_task_options=None, labels=None)#
-

Sends a batch inference request using a given bundle. Returns a key that can be used to retrieve -the results of inference at a later time.

-

Must have exactly one of urls or inputs passed in.

-
-
Parameters:
-
    -
  • model_bundle (Union[launch.model_bundle.ModelBundle, str]) – The bundle or the name of a the bundle to use for inference.

  • -
  • urls (List[str]) – A list of urls, each pointing to a file containing model input. -Must be accessible by Scale Launch, hence urls need to either be public or signedURLs.

  • -
  • inputs (Optional[List[Dict[str, Any]]]) – A list of model inputs, if exists, we will upload the inputs and pass it in to Launch.

  • -
  • batch_url_file_location (Optional[str]) – In self-hosted mode, the input to the batch job will be uploaded -to this location if provided. Otherwise, one will be determined from bundle_location_fn()

  • -
  • serialization_format (str) – Serialization format of output, either ‘pickle’ or ‘json’. -‘pickle’ corresponds to pickling results + returning

  • -
  • batch_task_options (Optional[Dict[str, Any]]) – A Dict of optional endpoint/batch task settings, i.e. certain endpoint settings -like cpus, memory, gpus, gpu_type, max_workers, as well as under-the-hood batch -job settings, like pyspark_partition_size, pyspark_max_executors.

  • -
  • labels (Optional[Dict[str, str]]) –

  • -
-
-
Returns:
-

An id/key that can be used to fetch inference results at a later time

-
-
-
- -
-
-clone_model_bundle_with_changes(existing_bundle, new_bundle_name, app_config=None)#
-

Clones an existing model bundle with changes to its app config. (More fields coming soon)

-
-
Parameters:
-
    -
  • existing_bundle (Union[launch.model_bundle.ModelBundle, str]) – The existing bundle or its name.

  • -
  • new_bundle_name (str) – The new bundle’s name.

  • -
  • app_config (Optional[Dict]) – The new bundle’s app config, if not passed in, the new bundle’s app_config will be set to None

  • -
-
-
Returns:
-

A ModelBundle object

-
-
Return type:
-

launch.model_bundle.ModelBundle

-
-
-
- -
-
-create_model_bundle(model_bundle_name, env_params, *, load_predict_fn=None, predict_fn_or_cls=None, requirements=None, model=None, load_model_fn=None, bundle_url=None, app_config=None, globals_copy=None)#
-

Uploads and registers a model bundle to Scale Launch.

-

A model bundle consists of exactly one of the following:

-
    -
  • predict_fn_or_cls

  • -
  • load_predict_fn + model

  • -
  • load_predict_fn + load_model_fn

  • -
-

Pre/post-processing code can be included inside load_predict_fn/model or in predict_fn_or_cls call.

-
-
Parameters:
-
    -
  • model_bundle_name (str) – The name of the model bundle you want to create. The name must be unique across all -bundles that you own.

  • -
  • predict_fn_or_cls (Optional[Callable[[Any], Any]]) – Function or a Callable class that runs end-to-end (pre/post processing and model inference) on the call. -i.e. predict_fn_or_cls(REQUEST) -> RESPONSE.

  • -
  • model (Optional[LaunchModel_T]) –

    Typically a trained Neural Network, e.g. a Pytorch module.

    -

    Exactly one of model and load_model_fn must be provided.

    -

  • -
  • load_model_fn (Optional[Callable[[], LaunchModel_T]]) –

    A function that, when run, loads a model. This function is essentially a deferred -wrapper around the model argument.

    -

    Exactly one of model and load_model_fn must be provided.

    -

  • -
  • load_predict_fn (Optional[Callable[[LaunchModel_T], Callable[[Any], Any]]]) –

    Function that, when called with a model, returns a function that carries out inference.

    -

    If model is specified, then this is equivalent -to:

    -
    -

    load_predict_fn(model, app_config=optional_app_config]) -> predict_fn

    -
    -

    Otherwise, if load_model_fn is specified, then this is equivalent -to:

    -
    -

    load_predict_fn(load_model_fn(), app_config=optional_app_config]) -> predict_fn

    -
    -
    -
    In both cases, predict_fn is then the inference function, i.e.:

    predict_fn(REQUEST) -> RESPONSE

    -
    -
    -

  • -
  • requirements (Optional[List[str]]) –

    A list of python package requirements, where each list element is of the form -<package_name>==<package_version>, e.g.

    -

    ["tensorflow==2.3.0", "tensorflow-hub==0.11.0"]

    -

    If you do not pass in a value for requirements, then you must pass in globals() for the -globals_copy argument.

    -

  • -
  • app_config (Optional[Union[Dict[str, Any], str]]) – Either a Dictionary that represents a YAML file contents or a local path to a YAML file.

  • -
  • env_params (Dict[str, str]) –

    A dictionary that dictates environment information e.g. -the use of pytorch or tensorflow, which base image tag to use, etc. -Specifically, the dictionary should contain the following keys:

    -
      -
    • framework_type: either tensorflow or pytorch.

    • -
    • -
      PyTorch fields:
      -
      {
      -    "framework_type": "pytorch",
      -    "pytorch_image_tag": "1.10.0-cuda11.3-cudnn8-runtime"
      -}
      -
      -
      -
      -
      -
    • -
    • -
      Tensorflow fields:
        -
      • tensorflow_version: Version of tensorflow, e.g. "2.3.0".

      • -
      -
      -
      -
    • -
    -

  • -
  • globals_copy (Optional[Dict[str, Any]]) – Dictionary of the global symbol table. Normally provided by globals() built-in function.

  • -
  • bundle_url (Optional[str]) – (Only used in self-hosted mode.) The desired location of bundle. -Overrides any value given by self.bundle_location_fn

  • -
-
-
Return type:
-

launch.model_bundle.ModelBundle

-
-
-
- -
-
-create_model_bundle_from_dirs(model_bundle_name, base_paths, requirements_path, env_params, load_predict_fn_module_path, load_model_fn_module_path, app_config=None)#
-

Packages up code from one or more local filesystem folders and uploads them as a bundle to Scale Launch. -In this mode, a bundle is just local code instead of a serialized object.

-

For example, if you have a directory structure like so, and your current working directory is also my_root:

-
my_root/
-    my_module1/
-        __init__.py
-        ...files and directories
-        my_inference_file.py
-    my_module2/
-        __init__.py
-        ...files and directories
-
-
-

then calling create_model_bundle_from_dirs with base_paths=["my_module1", "my_module2"] essentially -creates a zip file without the root directory, e.g.:

-
my_module1/
-    __init__.py
-    ...files and directories
-    my_inference_file.py
-my_module2/
-    __init__.py
-    ...files and directories
-
-
-

and these contents will be unzipped relative to the server side application root. Bear these points in mind when -referencing Python module paths for this bundle. For instance, if my_inference_file.py has def f(...) -as the desired inference loading function, then the load_predict_fn_module_path argument should be -my_module1.my_inference_file.f.

-
-
Parameters:
-
    -
  • model_bundle_name (str) – The name of the model bundle you want to create. The name must be unique across all -bundles that you own.

  • -
  • base_paths (List[str]) – The paths on the local filesystem where the bundle code lives.

  • -
  • requirements_path (str) – A path on the local filesystem where a requirements.txt file lives.

  • -
  • env_params (Dict[str, str]) –

    A dictionary that dictates environment information e.g. -the use of pytorch or tensorflow, which base image tag to use, etc. -Specifically, the dictionary should contain the following keys:

    -
      -
    • framework_type: either tensorflow or pytorch.

    • -
    • -
      PyTorch fields:
      -
      {
      -    "framework_type": "pytorch",
      -    "pytorch_image_tag": "1.10.0-cuda11.3-cudnn8-runtime"
      -}
      -
      -
      -
      -
      -
    • -
    -

  • -
  • load_predict_fn_module_path (str) – A python module path for a function that, when called with the output of -load_model_fn_module_path, returns a function that carries out inference.

  • -
  • load_model_fn_module_path (str) – A python module path for a function that returns a model. The output feeds into -the function located at load_predict_fn_module_path.

  • -
  • app_config (Optional[Union[Dict[str, Any], str]]) – Either a Dictionary that represents a YAML file contents or a local path to a YAML file.

  • -
-
-
Return type:
-

launch.model_bundle.ModelBundle

-
-
-
- -
-
-create_model_endpoint(endpoint_name, model_bundle, cpus=3, memory='8Gi', storage=None, gpus=0, min_workers=1, max_workers=1, per_worker=10, gpu_type=None, endpoint_type='sync', post_inference_hooks=None, update_if_exists=False, labels=None)#
-

Creates and registers a model endpoint in Scale Launch. The returned object is an instance of type Endpoint, -which is a base class of either SyncEndpoint or AsyncEndpoint. This is the object -to which you sent inference requests.

-
-
Parameters:
-
    -
  • endpoint_name (str) – The name of the model endpoint you want to create. The name must be unique across -all endpoints that you own.

  • -
  • model_bundle (Union[launch.model_bundle.ModelBundle, str]) – The ModelBundle that the endpoint should serve.

  • -
  • cpus (int) – Number of cpus each worker should get, e.g. 1, 2, etc. This must be greater than or equal to 1.

  • -
  • memory (str) – Amount of memory each worker should get, e.g. “4Gi”, “512Mi”, etc. This must be a positive -amount of memory.

  • -
  • storage (Optional[str]) – Amount of local ephemeral storage each worker should get, e.g. “4Gi”, “512Mi”, etc. This must -be a positive amount of storage.

  • -
  • gpus (int) – Number of gpus each worker should get, e.g. 0, 1, etc.

  • -
  • min_workers (int) – The minimum number of workers. Must be greater than or equal to 0. This should be determined -by computing the minimum throughput of your workload and dividing it by the throughput of a single -worker. This field must be at least 1 for synchronous endpoints.

  • -
  • max_workers (int) – The maximum number of workers. Must be greater than or equal to 0, and as well as -greater than or equal to min_workers. This should be determined by computing the maximum throughput -of your workload and dividing it by the throughput of a single worker.

  • -
  • per_worker (int) –

    The maximum number of concurrent requests that an individual worker can service. Launch -automatically scales the number of workers for the endpoint so that each worker is processing -per_worker requests, subject to the limits defined by min_workers and max_workers.

    -
      -
    • If the average number of concurrent requests per worker is lower than per_worker, then the number -of workers will be reduced.

    • -
    • Otherwise, if the average number of concurrent requests per worker is higher -than per_worker, then the number of workers will be increased to meet the elevated traffic.

    • -
    -

    Here is our recommendation for computing per_worker:

    -
      -
    1. Compute min_workers and max_workers per your minimum and maximum throughput requirements.

    2. -
    -

    2. Determine a value for the maximum number of concurrent requests in the workload. Divide this number -by max_workers. Doing this ensures that the number of workers will “climb” to max_workers.

    -

  • -
  • gpu_type (Optional[str]) –

    If specifying a non-zero number of gpus, this controls the type of gpu requested. Here are the -supported values:

    -
      -
    • nvidia-tesla-t4

    • -
    • nvidia-ampere-a10

    • -
    -

  • -
  • endpoint_type (str) – Either "sync" or "async".

  • -
  • post_inference_hooks (Optional[List[launch.hooks.PostInferenceHooks]]) – List of hooks to trigger after inference tasks are served.

  • -
  • update_if_exists (bool) – If True, will attempt to update the endpoint if it exists. Otherwise, will -unconditionally try to create a new endpoint. Note that endpoint names for a given user must be unique, -so attempting to call this function with update_if_exists=False for an existing endpoint will raise -an error.

  • -
  • labels (Optional[Dict[str, str]]) – An optional dictionary of key/value pairs to associate with this endpoint.

  • -
-
-
Returns:
-

A Endpoint object that can be used to make requests to the endpoint.

-
-
Return type:
-

Optional[launch.model_endpoint.Endpoint]

-
-
-
- -
-
-delete_model_bundle(model_bundle)#
-

Deletes the model bundle.

-
-
Parameters:
-

model_bundle (Union[launch.model_bundle.ModelBundle, str]) – A ModelBundle object or the name of a model bundle.

-
-
-
- -
-
-delete_model_endpoint(model_endpoint)#
-

Deletes a model endpoint.

-
-
Parameters:
-

model_endpoint (Union[launch.model_endpoint.ModelEndpoint, str]) – A ModelEndpoint object.

-
-
-
- -
-
-edit_model_endpoint(model_endpoint, model_bundle=None, cpus=None, memory=None, storage=None, gpus=None, min_workers=None, max_workers=None, per_worker=None, gpu_type=None, post_inference_hooks=None)#
-

Edits an existing model endpoint. Here are the fields that cannot be edited on an existing endpoint:

-
    -
  • The endpoint’s name.

  • -
  • The endpoint’s type (i.e. you cannot go from a SyncEnpdoint to an AsyncEndpoint or vice versa.

  • -
-
-
Parameters:
-
    -
  • model_endpoint (Union[launch.model_endpoint.ModelEndpoint, str]) – The model endpoint (or its name) you want to edit. The name must be unique across -all endpoints that you own.

  • -
  • model_bundle (Optional[Union[launch.model_bundle.ModelBundle, str]]) – The ModelBundle that the endpoint should serve.

  • -
  • cpus (Optional[float]) – Number of cpus each worker should get, e.g. 1, 2, etc. This must be greater than or equal to 1.

  • -
  • memory (Optional[str]) – Amount of memory each worker should get, e.g. “4Gi”, “512Mi”, etc. This must be a positive -amount of memory.

  • -
  • storage (Optional[str]) – Amount of local ephemeral storage each worker should get, e.g. “4Gi”, “512Mi”, etc. This must -be a positive amount of storage.

  • -
  • gpus (Optional[int]) – Number of gpus each worker should get, e.g. 0, 1, etc.

  • -
  • min_workers (Optional[int]) – The minimum number of workers. Must be greater than or equal to 0.

  • -
  • max_workers (Optional[int]) – The maximum number of workers. Must be greater than or equal to 0, and as well as -greater than or equal to min_workers.

  • -
  • per_worker (Optional[int]) –

    The maximum number of concurrent requests that an individual worker can service. Launch -automatically scales the number of workers for the endpoint so that each worker is processing -per_worker requests:

    -
      -
    • If the average number of concurrent requests per worker is lower than per_worker, then the number -of workers will be reduced.

    • -
    • Otherwise, if the average number of concurrent requests per worker is higher -than per_worker, then the number of workers will be increased to meet the elevated traffic.

    • -
    -

  • -
  • gpu_type (Optional[str]) –

    If specifying a non-zero number of gpus, this controls the type of gpu requested. Here are the -supported values:

    -
      -
    • nvidia-tesla-t4

    • -
    • nvidia-ampere-a10

    • -
    -

  • -
  • endpoint_type – Either "sync" or "async".

  • -
  • post_inference_hooks (Optional[List[launch.hooks.PostInferenceHooks]]) – List of hooks to trigger after inference tasks are served.

  • -
-
-
Return type:
-

None

-
-
-
- -
-
-get_async_response(async_task_id)#
-

Not recommended to use this, instead we recommend to use functions provided by AsyncEndpoint. -Gets inference results from a previously created task.

-
-
Parameters:
-

async_task_id (str) – The id/key returned from a previous invocation of async_request.

-
-
Returns:
-

A dictionary that contains task status and optionally a result url or result if the task has completed. -Result url or result will be returned if the task has succeeded. Will return a result url iff -return_pickled was set to True on task creation.

-

The dictionary’s keys are as follows:

-
    -
  • state: 'PENDING' or 'SUCCESS' or 'FAILURE'

  • -
  • result_url: a url pointing to inference results. This url is accessible for 12 hours after the request has been made.

  • -
  • result: the value returned by the endpoint’s predict function, serialized as json

  • -
-

Example output:

-
{
-    'state': 'SUCCESS',
-    'result_url': 'https://foo.s3.us-west-2.amazonaws.com/bar/baz/qux?xyzzy'
-}
-
-
-

-
-
Return type:
-

Dict[str, Any]

-
-
-
- -
-
-get_batch_async_response(batch_async_task_id)#
-

Gets inference results from a previously created batch job.

-
-
Parameters:
-

batch_async_task_id (str) – An id representing the batch task job. This id is the in the response from -calling batch_async_request.

-
-
Returns:
-

    -
  • status: The status of the job.

  • -
  • result: The url where the result is stored.

  • -
  • duration: A string representation of how long the job took to finish.

  • -
-

-
-
Return type:
-

A dictionary that contains the following fields

-
-
-
- -
-
-get_model_bundle(model_bundle)#
-

Returns a model bundle specified by bundle_name that the user owns.

-
-
Parameters:
-

model_bundle (Union[launch.model_bundle.ModelBundle, str]) – The bundle or its name.

-
-
Returns:
-

A ModelBundle object

-
-
Return type:
-

launch.model_bundle.ModelBundle

-
-
-
- -
-
-get_model_endpoint(endpoint_name)#
-

Gets a model endpoint associated with a name.

-
-
Parameters:
-

endpoint_name (str) – The name of the endpoint to retrieve.

-
-
Return type:
-

Optional[Union[launch.model_endpoint.AsyncEndpoint, launch.model_endpoint.SyncEndpoint]]

-
-
-
- -
-
-list_model_bundles()#
-

Returns a list of model bundles that the user owns.

-
-
Returns:
-

A list of ModelBundle objects

-
-
Return type:
-

List[launch.model_bundle.ModelBundle]

-
-
-
- -
-
-list_model_endpoints()#
-

Lists all model endpoints that the user owns.

-
-
Returns:
-

A list of ModelEndpoint objects.

-
-
Return type:
-

List[launch.model_endpoint.Endpoint]

-
-
-
- -
-
-read_endpoint_creation_logs(model_endpoint)#
-

Retrieves the logs for the creation of the endpoint.

-
-
Parameters:
-

model_endpoint (Union[launch.model_endpoint.ModelEndpoint, str]) – The endpoint or its name.

-
-
-
- -
-
-register_batch_csv_location_fn(batch_csv_location_fn)#
-

For self-hosted mode only. Registers a function that gives a location for batch CSV inputs. Should give different -locations each time. This function is called as batch_csv_location_fn(), and should return a batch_csv_url that -upload_batch_csv_fn can take.

-

Strictly, batch_csv_location_fn() does not need to return a str. The only requirement is that if batch_csv_location_fn -returns a value of type T, then upload_batch_csv_fn() takes in an object of type T as its second argument -(i.e. batch_csv_url).

-
-
Parameters:
-

batch_csv_location_fn (Callable[[], str]) – Function that generates batch_csv_urls for upload_batch_csv_fn.

-
-
-
- -
-
-register_bundle_location_fn(bundle_location_fn)#
-

For self-hosted mode only. Registers a function that gives a location for a model bundle. Should give different -locations each time. This function is called as bundle_location_fn(), and should return a bundle_url -that register_upload_bundle_fn can take.

-

Strictly, bundle_location_fn() does not need to return a str. The only requirement is that if -bundle_location_fn returns a value of type T, then upload_bundle_fn() takes in an object of type T -as its second argument (i.e. bundle_url).

-
-
Parameters:
-

bundle_location_fn (Callable[[], str]) – Function that generates bundle_urls for upload_bundle_fn.

-
-
-
- -
-
-register_endpoint_auth_decorator(endpoint_auth_decorator_fn)#
-

For self-hosted mode only. Registers a function that modifies the endpoint creation payload to include -required fields for self-hosting.

-
- -
-
-register_upload_batch_csv_fn(upload_batch_csv_fn)#
-

For self-hosted mode only. Registers a function that handles batch text upload. This function is called as

-
-

upload_batch_csv_fn(csv_text, csv_url)

-
-

This function should directly write the contents of csv_text as a text string into csv_url.

-
-
Parameters:
-

upload_batch_csv_fn (Callable[[str, str], None]) – Function that takes in a csv text (string type), and uploads that bundle to an appropriate -location. Only needed for self-hosted mode.

-
-
-
- -
-
-register_upload_bundle_fn(upload_bundle_fn)#
-

For self-hosted mode only. Registers a function that handles model bundle upload. This function is called as

-
-

upload_bundle_fn(serialized_bundle, bundle_url)

-
-

This function should directly write the contents of serialized_bundle as a -binary string into bundle_url.

-

See register_bundle_location_fn for more notes on the signature of upload_bundle_fn

-
-
Parameters:
-

upload_bundle_fn (Callable[[str, str], None]) – Function that takes in a serialized bundle (bytes type), and uploads that bundle to an appropriate -location. Only needed for self-hosted mode.

-
-
-
- -
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/batching/implementation/index.html b/docs/api/launch/clientlib/batching/implementation/index.html deleted file mode 100644 index 56833957..00000000 --- a/docs/api/launch/clientlib/batching/implementation/index.html +++ /dev/null @@ -1,294 +0,0 @@ - - - - - - - - - launch.clientlib.batching.implementation - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/batching/index.html b/docs/api/launch/clientlib/batching/index.html deleted file mode 100644 index 745a9e2d..00000000 --- a/docs/api/launch/clientlib/batching/index.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - launch.clientlib.batching - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/batching/named_arrays/index.html b/docs/api/launch/clientlib/batching/named_arrays/index.html deleted file mode 100644 index 33b0661e..00000000 --- a/docs/api/launch/clientlib/batching/named_arrays/index.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - launch.clientlib.batching.named_arrays - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/batching/single_array/index.html b/docs/api/launch/clientlib/batching/single_array/index.html deleted file mode 100644 index 494a7532..00000000 --- a/docs/api/launch/clientlib/batching/single_array/index.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - launch.clientlib.batching.single_array - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/batching/types/index.html b/docs/api/launch/clientlib/batching/types/index.html deleted file mode 100644 index 1ce5dacb..00000000 --- a/docs/api/launch/clientlib/batching/types/index.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - - - - launch.clientlib.batching.types - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.clientlib.batching.types#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - - - - -

BatchableService

A service that operates on batches of requests.

Batcher

Abstract base class for generic types.

-
-
-
-class launch.clientlib.batching.types.BatchableService#
-

A service that operates on batches of requests.

-

The objective is to provide optimized throughput for model inference services. -Many models predictions are embarrassingly parallel. Thus they can operate efficeintly -on a batch of inputs, producing a batch of outputs.

-

This interface’s objective is to provide a call_batch function that uses -a Batcher and a Model

-

NOTE: This is the “batteries included” service.

-
- -
-
-class launch.clientlib.batching.types.Batcher#
-

Abstract base class for generic types.

-

A generic type is typically declared by inheriting from -this class parameterized with one or more type variables. -For example, a generic mapping type might be defined as:

-
class Mapping(Generic[KT, VT]):
-    def __getitem__(self, key: KT) -> VT:
-        ...
-    # Etc.
-
-
-

This class can then be used as follows:

-
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
-    try:
-        return mapping[key]
-    except KeyError:
-        return default
-
-
-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/core/index.html b/docs/api/launch/clientlib/core/index.html deleted file mode 100644 index e777c72c..00000000 --- a/docs/api/launch/clientlib/core/index.html +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - launch.clientlib.core - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.clientlib.core#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - - - - - - - -

Deployment

Runtime

Helper class that provides a standard way to create an ABC using

Service

Core user-defined logic abstraction.

-
-
-
-class launch.clientlib.core.Runtime#
-

Helper class that provides a standard way to create an ABC using -inheritance.

-
-
-abstract start()#
-

Starts infinite loop: service accepts and responds to requests.

-
-
Return type:
-

None

-
-
-
- -
- -
-
-class launch.clientlib.core.Service#
-

Core user-defined logic abstraction.

-

Users must implement a Service to their sepecifications! The Service class is -where a Launch user can define all of their custom code.

-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/demonstration/index.html b/docs/api/launch/clientlib/demonstration/index.html deleted file mode 100644 index 20090dd7..00000000 --- a/docs/api/launch/clientlib/demonstration/index.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - launch.clientlib.demonstration - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/deployment/index.html b/docs/api/launch/clientlib/deployment/index.html deleted file mode 100644 index 6a1a5395..00000000 --- a/docs/api/launch/clientlib/deployment/index.html +++ /dev/null @@ -1,301 +0,0 @@ - - - - - - - - - launch.clientlib.deployment - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.clientlib.deployment#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - -

DeployedService

Helper class that provides a standard way to create an ABC using

-
-
-
-class launch.clientlib.deployment.DeployedService#
-

Helper class that provides a standard way to create an ABC using -inheritance.

-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/exe/index.html b/docs/api/launch/clientlib/exe/index.html deleted file mode 100644 index 9251f9a3..00000000 --- a/docs/api/launch/clientlib/exe/index.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - launch.clientlib.exe - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/exe/run_service/index.html b/docs/api/launch/clientlib/exe/run_service/index.html deleted file mode 100644 index 3fb2b650..00000000 --- a/docs/api/launch/clientlib/exe/run_service/index.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - launch.clientlib.exe.run_service - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/full_service/index.html b/docs/api/launch/clientlib/full_service/index.html deleted file mode 100644 index b5246727..00000000 --- a/docs/api/launch/clientlib/full_service/index.html +++ /dev/null @@ -1,371 +0,0 @@ - - - - - - - - - launch.clientlib.full_service - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.clientlib.full_service#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - - - - - - - -

RequestHandler

Abstract base class for generic types.

ResponseHandler

Abstract base class for generic types.

RunnableService

Abstract base class for generic types.

-
-
-
-class launch.clientlib.full_service.RequestHandler#
-

Abstract base class for generic types.

-

A generic type is typically declared by inheriting from -this class parameterized with one or more type variables. -For example, a generic mapping type might be defined as:

-
class Mapping(Generic[KT, VT]):
-    def __getitem__(self, key: KT) -> VT:
-        ...
-    # Etc.
-
-
-

This class can then be used as follows:

-
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
-    try:
-        return mapping[key]
-    except KeyError:
-        return default
-
-
-
- -
-
-class launch.clientlib.full_service.ResponseHandler#
-

Abstract base class for generic types.

-

A generic type is typically declared by inheriting from -this class parameterized with one or more type variables. -For example, a generic mapping type might be defined as:

-
class Mapping(Generic[KT, VT]):
-    def __getitem__(self, key: KT) -> VT:
-        ...
-    # Etc.
-
-
-

This class can then be used as follows:

-
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
-    try:
-        return mapping[key]
-    except KeyError:
-        return default
-
-
-
- -
-
-class launch.clientlib.full_service.RunnableService#
-

Abstract base class for generic types.

-

A generic type is typically declared by inheriting from -this class parameterized with one or more type variables. -For example, a generic mapping type might be defined as:

-
class Mapping(Generic[KT, VT]):
-    def __getitem__(self, key: KT) -> VT:
-        ...
-    # Etc.
-
-
-

This class can then be used as follows:

-
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
-    try:
-        return mapping[key]
-    except KeyError:
-        return default
-
-
-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/http/index.html b/docs/api/launch/clientlib/http/index.html deleted file mode 100644 index 353e521a..00000000 --- a/docs/api/launch/clientlib/http/index.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - launch.clientlib.http - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/index.html b/docs/api/launch/clientlib/index.html deleted file mode 100644 index 1f8a835c..00000000 --- a/docs/api/launch/clientlib/index.html +++ /dev/null @@ -1,515 +0,0 @@ - - - - - - - - - launch.clientlib - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.clientlib#

-
-

Package Contents#

-
-

Classes#

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

DeployedService

Helper class that provides a standard way to create an ABC using

DeploymentOptions

The configuration options that determine where the service is deployed and how it acts in the cluster.

FullService

The thing that we technically run: service + payload serializers.

JsonHandler

Responsible for converting protocol-formatted data (D) into a service's input type (I).

JsonService

This is what all std-ml-srv services are, effectively.

ReferencedDeployment

Helper class that provides a standard way to create an ABC using

RequestHandler

Responsible for converting protocol-formatted data (D) into a service's input type (I).

ResponseHandler

Responsible for converting a service's output (O) into the protocol's data format (D).

Runtime

Helper class that provides a standard way to create an ABC using

Service

Core user-defined logic abstraction.

SpecsTritonModel

A model that also describes the shapes of its input and output tensors.

Status

Generic enumeration.

ToProtobufText

Helper class that provides a standard way to create an ABC using

TritonModel

A kind of service that only executes a model's forward pass for inference.

TritonModelConfig

Helper class that provides a standard way to create an ABC using

TritonTensor

Helper class that provides a standard way to create an ABC using

-
-
-
-class launch.clientlib.DeployedService#
-

Helper class that provides a standard way to create an ABC using -inheritance.

-
- -
-
-class launch.clientlib.DeploymentOptions#
-

The configuration options that determine where the service is deployed and how it acts in the cluster.

-
- -
-
-class launch.clientlib.FullService#
-

The thing that we technically run: service + payload serializers.

-

Its the service logic + knowing how to encode & decode things into the transit data format. -Default implementation is to use JSON formatted strings.

-
- -
-
-class launch.clientlib.JsonHandler#
-

Responsible for converting protocol-formatted data (D) into a service’s input type (I).

-
- -
-
-class launch.clientlib.JsonService(service)#
-

This is what all std-ml-srv services are, effectively.

-
    -
  • all services accept and return JSON-formatable values

  • -
  • all protocols encode the data a JSON-formatted strings

  • -
-
-
Parameters:
-

service (launch_api.core.Service[launch_api.types.I, launch_api.types.O]) –

-
-
-
- -
-
-class launch.clientlib.ReferencedDeployment#
-

Helper class that provides a standard way to create an ABC using -inheritance.

-
-
-abstract call(serialized_request)#
-

Perform an inference request against the deployed service(s).

-

Handles all routing. Returns a future, which represents the result of the computation to be completed. -Call .get() to block on result. Note that if the request is going to a syncronous deployment, then -there will exist a background thread that is responsible for receiving the request. It will persist -until the caller invokes .get().

-

If the call fails, then the result will be an exception. -If .status() is not complete, then all `call`s will fail.

-
- -
- -
-
-class launch.clientlib.RequestHandler#
-

Responsible for converting protocol-formatted data (D) into a service’s input type (I).

-
- -
-
-class launch.clientlib.ResponseHandler#
-

Responsible for converting a service’s output (O) into the protocol’s data format (D).

-
- -
-
-class launch.clientlib.Runtime#
-

Helper class that provides a standard way to create an ABC using -inheritance.

-
-
-abstract start()#
-

Starts infinite loop: service accepts and responds to requests.

-
-
Return type:
-

None

-
-
-
- -
- -
-
-class launch.clientlib.Service#
-

Core user-defined logic abstraction.

-

Users must implement a Service to their sepecifications! The Service class is -where a Launch user can define all of their custom code.

-
- -
-
-class launch.clientlib.SpecsTritonModel#
-

A model that also describes the shapes of its input and output tensors.

-
- -
-
-class launch.clientlib.Status#
-

Generic enumeration.

-

Derive from this class to define new enumerations.

-
-
-name()#
-

The name of the Enum member.

-
- -
-
-value()#
-

The value of the Enum member.

-
- -
- -
-
-class launch.clientlib.ToProtobufText#
-

Helper class that provides a standard way to create an ABC using -inheritance.

-
- -
-
-class launch.clientlib.TritonModel#
-

A kind of service that only executes a model’s forward pass for inference.

-
- -
-
-class launch.clientlib.TritonModelConfig#
-

Helper class that provides a standard way to create an ABC using -inheritance.

-
- -
-
-class launch.clientlib.TritonTensor#
-

Helper class that provides a standard way to create an ABC using -inheritance.

-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/loader/index.html b/docs/api/launch/clientlib/loader/index.html deleted file mode 100644 index 93d9f051..00000000 --- a/docs/api/launch/clientlib/loader/index.html +++ /dev/null @@ -1,357 +0,0 @@ - - - - - - - - - launch.clientlib.loader - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.clientlib.loader#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - - - - -

Loader

Abstract base class for generic types.

ServiceLoader

Abstract base class for generic types.

-
-
-
-

Attributes#

-
- - - - - - -

S

-
-
-
-class launch.clientlib.loader.Loader#
-

Abstract base class for generic types.

-

A generic type is typically declared by inheriting from -this class parameterized with one or more type variables. -For example, a generic mapping type might be defined as:

-
class Mapping(Generic[KT, VT]):
-    def __getitem__(self, key: KT) -> VT:
-        ...
-    # Etc.
-
-
-

This class can then be used as follows:

-
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
-    try:
-        return mapping[key]
-    except KeyError:
-        return default
-
-
-
- -
-
-class launch.clientlib.loader.ServiceLoader#
-

Abstract base class for generic types.

-

A generic type is typically declared by inheriting from -this class parameterized with one or more type variables. -For example, a generic mapping type might be defined as:

-
class Mapping(Generic[KT, VT]):
-    def __getitem__(self, key: KT) -> VT:
-        ...
-    # Etc.
-
-
-

This class can then be used as follows:

-
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
-    try:
-        return mapping[key]
-    except KeyError:
-        return default
-
-
-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/model/index.html b/docs/api/launch/clientlib/model/index.html deleted file mode 100644 index 41c81fdc..00000000 --- a/docs/api/launch/clientlib/model/index.html +++ /dev/null @@ -1,310 +0,0 @@ - - - - - - - - - launch.clientlib.model - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.clientlib.model#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - - - - -

SpecsTritonModel

A model that also describes the shapes of its input and output tensors.

TritonModel

A kind of service that only executes a model's forward pass for inference.

-
-
-
-class launch.clientlib.model.SpecsTritonModel#
-

A model that also describes the shapes of its input and output tensors.

-
- -
-
-class launch.clientlib.model.TritonModel#
-

A kind of service that only executes a model’s forward pass for inference.

-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/model_service/implementation/index.html b/docs/api/launch/clientlib/model_service/implementation/index.html deleted file mode 100644 index a2b61664..00000000 --- a/docs/api/launch/clientlib/model_service/implementation/index.html +++ /dev/null @@ -1,294 +0,0 @@ - - - - - - - - - launch.clientlib.model_service.implementation - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/model_service/index.html b/docs/api/launch/clientlib/model_service/index.html deleted file mode 100644 index 37063dd0..00000000 --- a/docs/api/launch/clientlib/model_service/index.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - launch.clientlib.model_service - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/model_service/named_arrays/index.html b/docs/api/launch/clientlib/model_service/named_arrays/index.html deleted file mode 100644 index 19c70397..00000000 --- a/docs/api/launch/clientlib/model_service/named_arrays/index.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - launch.clientlib.model_service.named_arrays - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/model_service/single_array/index.html b/docs/api/launch/clientlib/model_service/single_array/index.html deleted file mode 100644 index 3e0585d4..00000000 --- a/docs/api/launch/clientlib/model_service/single_array/index.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - launch.clientlib.model_service.single_array - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/model_service/types/index.html b/docs/api/launch/clientlib/model_service/types/index.html deleted file mode 100644 index 1120b550..00000000 --- a/docs/api/launch/clientlib/model_service/types/index.html +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - - - - launch.clientlib.model_service.types - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.clientlib.model_service.types#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - - - - -

InferenceService

A service that operates on single requests.

Processor

Abstract base class for generic types.

-
-
-
-class launch.clientlib.model_service.types.InferenceService#
-

A service that operates on single requests.

-

NOTE: This is the “batteries included” service.

-
- -
-
-class launch.clientlib.model_service.types.Processor#
-

Abstract base class for generic types.

-

A generic type is typically declared by inheriting from -this class parameterized with one or more type variables. -For example, a generic mapping type might be defined as:

-
class Mapping(Generic[KT, VT]):
-    def __getitem__(self, key: KT) -> VT:
-        ...
-    # Etc.
-
-
-

This class can then be used as follows:

-
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
-    try:
-        return mapping[key]
-    except KeyError:
-        return default
-
-
-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/object_conf_from_std_ml_serve/index.html b/docs/api/launch/clientlib/object_conf_from_std_ml_serve/index.html deleted file mode 100644 index aac16982..00000000 --- a/docs/api/launch/clientlib/object_conf_from_std_ml_serve/index.html +++ /dev/null @@ -1,358 +0,0 @@ - - - - - - - - - launch.clientlib.object_conf_from_std_ml_serve - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.clientlib.object_conf_from_std_ml_serve#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - -

ObjectConf

Abstract base class for generic types.

-
-
-
-class launch.clientlib.object_conf_from_std_ml_serve.ObjectConf#
-

Abstract base class for generic types.

-

A generic type is typically declared by inheriting from -this class parameterized with one or more type variables. -For example, a generic mapping type might be defined as:

-
class Mapping(Generic[KT, VT]):
-    def __getitem__(self, key: KT) -> VT:
-        ...
-    # Etc.
-
-
-

This class can then be used as follows:

-
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
-    try:
-        return mapping[key]
-    except KeyError:
-        return default
-
-
-
-
-args :Optional[Mapping[str, Any]]#
-

The keyword arguments to apply to construct an instance of class_name. -If None, then class_name is created with no parameters.

-
- -
-
-class_name :str#
-

The fully-qualified name of a class within the Python environment. -This value must be the name of the parameterized generic type T.

-
- -
-
-pass_args_whole :bool = False#
-

Controls constructor parameter passing behavior.

-

If true, then passes the args dictionary directly into the class_name’s __init__. -Otherwise, pass the key-value pairs as keyword arguments. -Defaults to false.

-
- -
-
-construct()#
-

Dynamically loads an instance of class_name using args. -Raises an exception on loading failure.

-
-
Return type:
-

T

-
-
-
- -
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/pipeline/index.html b/docs/api/launch/clientlib/pipeline/index.html deleted file mode 100644 index b18eab67..00000000 --- a/docs/api/launch/clientlib/pipeline/index.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - launch.clientlib.pipeline - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/service/index.html b/docs/api/launch/clientlib/service/index.html deleted file mode 100644 index 756f9309..00000000 --- a/docs/api/launch/clientlib/service/index.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - - - - - launch.clientlib.service - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.clientlib.service#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - - - - - - - -

FullService

The thing that we technically run: service + payload serializers.

RequestHandler

Responsible for converting protocol-formatted data (D) into a service's input type (I).

ResponseHandler

Responsible for converting a service's output (O) into the protocol's data format (D).

-
-
-
-

Attributes#

-
- - - - - - -

D

-
-
-
-class launch.clientlib.service.FullService#
-

The thing that we technically run: service + payload serializers.

-

Its the service logic + knowing how to encode & decode things into the transit data format. -Default implementation is to use JSON formatted strings.

-
- -
-
-class launch.clientlib.service.RequestHandler#
-

Responsible for converting protocol-formatted data (D) into a service’s input type (I).

-
- -
-
-class launch.clientlib.service.ResponseHandler#
-

Responsible for converting a service’s output (O) into the protocol’s data format (D).

-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/triton/index.html b/docs/api/launch/clientlib/triton/index.html deleted file mode 100644 index ea91ab66..00000000 --- a/docs/api/launch/clientlib/triton/index.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - launch.clientlib.triton - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.clientlib.triton#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - -

TritonModelServer

-
-
-
-

Functions#

-
- - - - - - -

make_pytorch_triton_configuration(...[, ...])

-
-
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/types/index.html b/docs/api/launch/clientlib/types/index.html deleted file mode 100644 index e43c6169..00000000 --- a/docs/api/launch/clientlib/types/index.html +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - - launch.clientlib.types - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/clientlib/utils/index.html b/docs/api/launch/clientlib/utils/index.html deleted file mode 100644 index f3bbf085..00000000 --- a/docs/api/launch/clientlib/utils/index.html +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - - - - launch.clientlib.utils - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/connection/index.html b/docs/api/launch/connection/index.html deleted file mode 100644 index c803e6ec..00000000 --- a/docs/api/launch/connection/index.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - - - - launch.connection - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.connection#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - -

Connection

Wrapper of HTTP requests to the Launch endpoint.

-
-
-
-class launch.connection.Connection(api_key, endpoint=None)#
-

Wrapper of HTTP requests to the Launch endpoint.

-
-
Parameters:
-
    -
  • api_key (str) –

  • -
  • endpoint (str) –

  • -
-
-
-
-
-make_request(payload, route, requests_command=requests.post)#
-

Makes a request to Launch endpoint and logs a warning if not -successful.

-
-
Parameters:
-
    -
  • payload (dict) – given payload

  • -
  • route (str) – route for the request

  • -
  • requests_command – requests.post, requests.get, requests.delete

  • -
-
-
Returns:
-

response JSON

-
-
Return type:
-

dict

-
-
-
- -
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/constants/index.html b/docs/api/launch/constants/index.html deleted file mode 100644 index d2fa1390..00000000 --- a/docs/api/launch/constants/index.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - launch.constants - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/errors/index.html b/docs/api/launch/errors/index.html deleted file mode 100644 index 5aa83827..00000000 --- a/docs/api/launch/errors/index.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - - - - launch.errors - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.errors#

-
-

Module Contents#

-
-
-exception launch.errors.APIError(endpoint, command, requests_response=None, aiohttp_response=None)#
-

Common base class for all non-exit exceptions.

-

Initialize self. See help(type(self)) for accurate signature.

-
-
-with_traceback()#
-

Exception.with_traceback(tb) – -set self.__traceback__ to tb and return self.

-
- -
- -
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/find_packages/index.html b/docs/api/launch/find_packages/index.html deleted file mode 100644 index 0d4591b9..00000000 --- a/docs/api/launch/find_packages/index.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - - - - launch.find_packages - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.find_packages#

-
-

Module Contents#

-
-

Functions#

-
- - - - - - - - - - - - -

find_packages_from_imports(globals_copy)

Call this from a python notebook to get the current notebook's packages.

find_packages_from_path(path)

Call this on another python file.

get_imports(globals_copy)

Get a list of imported modules from globals_copy.

-
-
-
-launch.find_packages.find_packages_from_imports(globals_copy)#
-

Call this from a python notebook to get the current notebook’s packages.

-
- -
-
-launch.find_packages.find_packages_from_path(path)#
-

Call this on another python file.

-
-
Parameters:
-

path (str) –

-
-
-
- -
-
-launch.find_packages.get_imports(globals_copy)#
-

Get a list of imported modules from globals_copy.

-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/hooks/index.html b/docs/api/launch/hooks/index.html deleted file mode 100644 index 6c8be935..00000000 --- a/docs/api/launch/hooks/index.html +++ /dev/null @@ -1,784 +0,0 @@ - - - - - - - - - launch.hooks - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.hooks#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - -

PostInferenceHooks

str(object='') -> str

-
-
-
-class launch.hooks.PostInferenceHooks#
-

str(object=’’) -> str -str(bytes_or_buffer[, encoding[, errors]]) -> str

-

Create a new string object from the given object. If encoding or -errors is specified, then the object must expose a data buffer -that will be decoded using the given encoding and error handler. -Otherwise, returns the result of object.__str__() (if defined) -or repr(object). -encoding defaults to sys.getdefaultencoding(). -errors defaults to ‘strict’.

-

Initialize self. See help(type(self)) for accurate signature.

-
-
-capitalize()#
-

Return a capitalized version of the string.

-

More specifically, make the first character have upper case and the rest lower -case.

-
- -
-
-casefold()#
-

Return a version of the string suitable for caseless comparisons.

-
- -
-
-center()#
-

Return a centered string of length width.

-

Padding is done using the specified fill character (default is a space).

-
- -
-
-count()#
-

S.count(sub[, start[, end]]) -> int

-

Return the number of non-overlapping occurrences of substring sub in -string S[start:end]. Optional arguments start and end are -interpreted as in slice notation.

-
- -
-
-encode()#
-

Encode the string using the codec registered for encoding.

-
-
encoding

The encoding in which to encode the string.

-
-
errors

The error handling scheme to use for encoding errors. -The default is ‘strict’ meaning that encoding errors raise a -UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and -‘xmlcharrefreplace’ as well as any other name registered with -codecs.register_error that can handle UnicodeEncodeErrors.

-
-
-
- -
-
-endswith()#
-

S.endswith(suffix[, start[, end]]) -> bool

-

Return True if S ends with the specified suffix, False otherwise. -With optional start, test S beginning at that position. -With optional end, stop comparing S at that position. -suffix can also be a tuple of strings to try.

-
- -
-
-expandtabs()#
-

Return a copy where all tab characters are expanded using spaces.

-

If tabsize is not given, a tab size of 8 characters is assumed.

-
- -
-
-find()#
-

S.find(sub[, start[, end]]) -> int

-

Return the lowest index in S where substring sub is found, -such that sub is contained within S[start:end]. Optional -arguments start and end are interpreted as in slice notation.

-

Return -1 on failure.

-
- -
-
-format()#
-

S.format(*args, **kwargs) -> str

-

Return a formatted version of S, using substitutions from args and kwargs. -The substitutions are identified by braces (‘{’ and ‘}’).

-
- -
-
-format_map()#
-

S.format_map(mapping) -> str

-

Return a formatted version of S, using substitutions from mapping. -The substitutions are identified by braces (‘{’ and ‘}’).

-
- -
-
-index()#
-

S.index(sub[, start[, end]]) -> int

-

Return the lowest index in S where substring sub is found, -such that sub is contained within S[start:end]. Optional -arguments start and end are interpreted as in slice notation.

-

Raises ValueError when the substring is not found.

-
- -
-
-isalnum()#
-

Return True if the string is an alpha-numeric string, False otherwise.

-

A string is alpha-numeric if all characters in the string are alpha-numeric and -there is at least one character in the string.

-
- -
-
-isalpha()#
-

Return True if the string is an alphabetic string, False otherwise.

-

A string is alphabetic if all characters in the string are alphabetic and there -is at least one character in the string.

-
- -
-
-isascii()#
-

Return True if all characters in the string are ASCII, False otherwise.

-

ASCII characters have code points in the range U+0000-U+007F. -Empty string is ASCII too.

-
- -
-
-isdecimal()#
-

Return True if the string is a decimal string, False otherwise.

-

A string is a decimal string if all characters in the string are decimal and -there is at least one character in the string.

-
- -
-
-isdigit()#
-

Return True if the string is a digit string, False otherwise.

-

A string is a digit string if all characters in the string are digits and there -is at least one character in the string.

-
- -
-
-isidentifier()#
-

Return True if the string is a valid Python identifier, False otherwise.

-

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, -such as “def” or “class”.

-
- -
-
-islower()#
-

Return True if the string is a lowercase string, False otherwise.

-

A string is lowercase if all cased characters in the string are lowercase and -there is at least one cased character in the string.

-
- -
-
-isnumeric()#
-

Return True if the string is a numeric string, False otherwise.

-

A string is numeric if all characters in the string are numeric and there is at -least one character in the string.

-
- -
-
-isprintable()#
-

Return True if the string is printable, False otherwise.

-

A string is printable if all of its characters are considered printable in -repr() or if it is empty.

-
- -
-
-isspace()#
-

Return True if the string is a whitespace string, False otherwise.

-

A string is whitespace if all characters in the string are whitespace and there -is at least one character in the string.

-
- -
-
-istitle()#
-

Return True if the string is a title-cased string, False otherwise.

-

In a title-cased string, upper- and title-case characters may only -follow uncased characters and lowercase characters only cased ones.

-
- -
-
-isupper()#
-

Return True if the string is an uppercase string, False otherwise.

-

A string is uppercase if all cased characters in the string are uppercase and -there is at least one cased character in the string.

-
- -
-
-join()#
-

Concatenate any number of strings.

-

The string whose method is called is inserted in between each given string. -The result is returned as a new string.

-

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

-
- -
-
-ljust()#
-

Return a left-justified string of length width.

-

Padding is done using the specified fill character (default is a space).

-
- -
-
-lower()#
-

Return a copy of the string converted to lowercase.

-
- -
-
-lstrip()#
-

Return a copy of the string with leading whitespace removed.

-

If chars is given and not None, remove characters in chars instead.

-
- -
-
-name()#
-

The name of the Enum member.

-
- -
-
-partition()#
-

Partition the string into three parts using the given separator.

-

This will search for the separator in the string. If the separator is found, -returns a 3-tuple containing the part before the separator, the separator -itself, and the part after it.

-

If the separator is not found, returns a 3-tuple containing the original string -and two empty strings.

-
- -
-
-removeprefix()#
-

Return a str with the given prefix string removed if present.

-

If the string starts with the prefix string, return string[len(prefix):]. -Otherwise, return a copy of the original string.

-
- -
-
-removesuffix()#
-

Return a str with the given suffix string removed if present.

-

If the string ends with the suffix string and that suffix is not empty, -return string[:-len(suffix)]. Otherwise, return a copy of the original -string.

-
- -
-
-replace()#
-

Return a copy with all occurrences of substring old replaced by new.

-
-
-
count

Maximum number of occurrences to replace. --1 (the default value) means replace all occurrences.

-
-
-
-

If the optional argument count is given, only the first count occurrences are -replaced.

-
- -
-
-rfind()#
-

S.rfind(sub[, start[, end]]) -> int

-

Return the highest index in S where substring sub is found, -such that sub is contained within S[start:end]. Optional -arguments start and end are interpreted as in slice notation.

-

Return -1 on failure.

-
- -
-
-rindex()#
-

S.rindex(sub[, start[, end]]) -> int

-

Return the highest index in S where substring sub is found, -such that sub is contained within S[start:end]. Optional -arguments start and end are interpreted as in slice notation.

-

Raises ValueError when the substring is not found.

-
- -
-
-rjust()#
-

Return a right-justified string of length width.

-

Padding is done using the specified fill character (default is a space).

-
- -
-
-rpartition()#
-

Partition the string into three parts using the given separator.

-

This will search for the separator in the string, starting at the end. If -the separator is found, returns a 3-tuple containing the part before the -separator, the separator itself, and the part after it.

-

If the separator is not found, returns a 3-tuple containing two empty strings -and the original string.

-
- -
-
-rsplit()#
-

Return a list of the words in the string, using sep as the delimiter string.

-
-
-
sep

The delimiter according which to split the string. -None (the default value) means split according to any whitespace, -and discard empty strings from the result.

-
-
maxsplit

Maximum number of splits to do. --1 (the default value) means no limit.

-
-
-
-

Splits are done starting at the end of the string and working to the front.

-
- -
-
-rstrip()#
-

Return a copy of the string with trailing whitespace removed.

-

If chars is given and not None, remove characters in chars instead.

-
- -
-
-split()#
-

Return a list of the words in the string, using sep as the delimiter string.

-
-
sep

The delimiter according which to split the string. -None (the default value) means split according to any whitespace, -and discard empty strings from the result.

-
-
maxsplit

Maximum number of splits to do. --1 (the default value) means no limit.

-
-
-
- -
-
-splitlines()#
-

Return a list of the lines in the string, breaking at line boundaries.

-

Line breaks are not included in the resulting list unless keepends is given and -true.

-
- -
-
-startswith()#
-

S.startswith(prefix[, start[, end]]) -> bool

-

Return True if S starts with the specified prefix, False otherwise. -With optional start, test S beginning at that position. -With optional end, stop comparing S at that position. -prefix can also be a tuple of strings to try.

-
- -
-
-strip()#
-

Return a copy of the string with leading and trailing whitespace removed.

-

If chars is given and not None, remove characters in chars instead.

-
- -
-
-swapcase()#
-

Convert uppercase characters to lowercase and lowercase characters to uppercase.

-
- -
-
-title()#
-

Return a version of the string where each word is titlecased.

-

More specifically, words start with uppercased characters and all remaining -cased characters have lower case.

-
- -
-
-translate()#
-

Replace each character in the string using the given translation table.

-
-
-
table

Translation table, which must be a mapping of Unicode ordinals to -Unicode ordinals, strings, or None.

-
-
-
-

The table must implement lookup/indexing via __getitem__, for instance a -dictionary or list. If this operation raises LookupError, the character is -left untouched. Characters mapped to None are deleted.

-
- -
-
-upper()#
-

Return a copy of the string converted to uppercase.

-
- -
-
-value()#
-

The value of the Enum member.

-
- -
-
-zfill()#
-

Pad a numeric string with zeros on the left, to fill a field of the given width.

-

The string is never truncated.

-
- -
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/index.html b/docs/api/launch/index.html deleted file mode 100644 index f87283d7..00000000 --- a/docs/api/launch/index.html +++ /dev/null @@ -1,1399 +0,0 @@ - - - - - - - - - launch - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch#

-

Scale Launch provides ML engineers with a simple Python interface for turning a local code snippet into a -production service that automatically scales according to traffic.

-
-

Subpackages#

-
- -
-
-
-

Submodules#

- -
-
-

Package Contents#

-
-

Classes#

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

AsyncEndpoint

An asynchronous model endpoint.

AsyncEndpointBatchResponse

(deprecated)

Connection

Wrapper of HTTP requests to the Launch endpoint.

EndpointRequest

Represents a single request to either a SyncEndpoint or AsyncEndpoint.

EndpointResponse

Represents a response received from a Endpoint.

EndpointResponseFuture

Represents a future response from an Endpoint. Specifically, when the EndpointResponseFuture is ready,

LaunchClient

Scale Launch Python Client.

ModelBundle

Represents a ModelBundle.

SyncEndpoint

A synchronous model endpoint.

-
-
-
-class launch.AsyncEndpoint(model_endpoint, client)#
-

An asynchronous model endpoint.

-
-
Parameters:
-
    -
  • model_endpoint (ModelEndpoint) – ModelEndpoint object.

  • -
  • client – A LaunchClient object

  • -
-
-
-
-
-predict(request)#
-

Runs an asynchronous prediction request.

-
-
Parameters:
-

request (EndpointRequest) – The EndpointRequest object that contains the payload.

-
-
Returns:
-

An EndpointResponseFuture such the user can use to query the status of the request. -Example:

-
my_endpoint = AsyncEndpoint(...)
-f: EndpointResponseFuture = my_endpoint.predict(EndpointRequest(...))
-result = f.get()  # blocks on completion
-
-
-

-
-
Return type:
-

EndpointResponseFuture

-
-
-
- -
-
-predict_batch(requests)#
-

(deprecated) -Runs inference on the data items specified by urls. Returns a AsyncEndpointResponse.

-
-
Parameters:
-

requests (Sequence[EndpointRequest]) – List of EndpointRequests. Request_ids must all be distinct.

-
-
Returns:
-

an AsyncEndpointResponse keeping track of the inference requests made

-
-
Return type:
-

AsyncEndpointBatchResponse

-
-
-
- -
-
-resource_settings()#
-

Gets the resource settings of the Endpoint.

-
-
Return type:
-

Optional[dict]

-
-
-
- -
-
-status()#
-

Gets the status of the Endpoint.

-
-
Return type:
-

Optional[str]

-
-
-
- -
-
-worker_settings()#
-

Gets the worker settings of the Endpoint.

-
-
Return type:
-

Optional[dict]

-
-
-
- -
- -
-
-class launch.AsyncEndpointBatchResponse(client, endpoint_name, request_ids)#
-

(deprecated)

-

Currently represents a list of async inference requests to a specific endpoint. Keeps track of the requests made, -and gives a way to poll for their status.

-

Invariant: set keys for self.request_ids and self.responses are equal

-

idk about this abstraction tbh, could use a redesign maybe?

-

Also batch inference sort of removes the need for much of the complication in here

-
-
Parameters:
-
    -
  • endpoint_name (str) –

  • -
  • request_ids (Dict[str, str]) –

  • -
-
-
-
-
-get_responses()#
-

Returns a dictionary, where each key is the request_id for an EndpointRequest passed in, and the corresponding -object at that key is the corresponding EndpointResponse.

-
-
Return type:
-

Dict[str, Optional[EndpointResponse]]

-
-
-
- -
-
-is_done(poll=True)#
-

Checks the client local state to see if all requests are done.

-
-
Parameters:
-
    -
  • poll – If True, then this will first check the state for a subset

  • -
  • server. (of the remaining incomplete tasks on the Launch) –

  • -
-
-
Return type:
-

bool

-
-
-
- -
-
-poll_endpoints()#
-

Runs one round of polling the endpoint for async task results.

-
- -
- -
-
-class launch.Connection(api_key, endpoint=None)#
-

Wrapper of HTTP requests to the Launch endpoint.

-
-
Parameters:
-
    -
  • api_key (str) –

  • -
  • endpoint (str) –

  • -
-
-
-
-
-make_request(payload, route, requests_command=requests.post)#
-

Makes a request to Launch endpoint and logs a warning if not -successful.

-
-
Parameters:
-
    -
  • payload (dict) – given payload

  • -
  • route (str) – route for the request

  • -
  • requests_command – requests.post, requests.get, requests.delete

  • -
-
-
Returns:
-

response JSON

-
-
Return type:
-

dict

-
-
-
- -
- -
-
-class launch.EndpointRequest(url=None, args=None, return_pickled=True, request_id=None)#
-

Represents a single request to either a SyncEndpoint or AsyncEndpoint.

-
-
Parameters:
-
    -
  • url (Optional[str]) –

    A url to some file that can be read in to a ModelBundle’s predict function. Can be an image, raw text, etc. -Note: the contents of the file located at url are opened as a sequence of bytes and passed -to the predict function. If you instead want to pass the url itself as an input to the predict function, -see args.

    -

    Exactly one of url and args must be specified.

    -

  • -
  • args (Optional[Dict]) –

    A Dictionary with arguments to a ModelBundle’s predict function. If the predict function has signature -predict_fn(foo, bar), then the keys in the dictionary should be "foo" and "bar". -Values must be native Python objects.

    -

    Exactly one of url and args must be specified.

    -

  • -
  • return_pickled (Optional[bool]) – Whether the output should be a pickled python object, or directly returned serialized json.

  • -
  • request_id (Optional[str]) – (deprecated) A user-specifiable id for requests. -Should be unique among EndpointRequests made in the same batch call. -If one isn’t provided the client will generate its own.

  • -
-
-
-
- -
-
-class launch.EndpointResponse(client, status, result_url=None, result=None, traceback=None)#
-

Represents a response received from a Endpoint.

-
-
Parameters:
-
    -
  • client – An instance of LaunchClient.

  • -
  • status (str) – A string representing the status of the request, i.e. SUCCESS, FAILURE, or PENDING

  • -
  • result_url (Optional[str]) –

    A string that is a url containing the pickled python object from the Endpoint’s predict function.

    -

    Exactly one of result_url or result will be populated, -depending on the value of return_pickled in the request.

    -

  • -
  • result (Optional[str]) –

    A string that is the serialized return value (in json form) of the Endpoint’s predict function. -Specifically, one can json.loads() the value of result to get the original python object back.

    -

    Exactly one of result_url or result will be populated, -depending on the value of return_pickled in the request.

    -

  • -
  • traceback (Optional[str]) – The stack trace if the inference endpoint raised an error. Can be used for debugging

  • -
-
-
-
- -
-
-class launch.EndpointResponseFuture(client, endpoint_name, async_task_id)#
-

Represents a future response from an Endpoint. Specifically, when the EndpointResponseFuture is ready, -then its get method will return an actual instance of EndpointResponse.

-

This object should not be directly instantiated by the user.

-
-
Parameters:
-
    -
  • client – An instance of LaunchClient.

  • -
  • endpoint_name (str) – The name of the endpoint.

  • -
  • async_task_id (str) – An async task id.

  • -
-
-
-
-
-get()#
-

Retrieves the EndpointResponse for the prediction request after it completes. This method blocks.

-
-
Return type:
-

EndpointResponse

-
-
-
- -
- -
-
-class launch.LaunchClient(api_key, endpoint=None, self_hosted=False)#
-

Scale Launch Python Client.

-

Initializes a Scale Launch Client.

-
-
Parameters:
-
    -
  • api_key (str) – Your Scale API key

  • -
  • endpoint (Optional[str]) – The Scale Launch Endpoint (this should not need to be changed)

  • -
  • self_hosted (bool) – True iff you are connecting to a self-hosted Scale Launch

  • -
-
-
-
-
-async_request(endpoint_name, url=None, args=None, return_pickled=True)#
-

Not recommended to use this, instead we recommend to use functions provided by AsyncEndpoint. -Makes a request to the Async Model Endpoint at endpoint_id, and immediately returns a key that can be used to retrieve -the result of inference at a later time.

-
-
Parameters:
-
    -
  • endpoint_name (str) – The name of the endpoint to make the request to

  • -
  • url (Optional[str]) –

    A url that points to a file containing model input. -Must be accessible by Scale Launch, hence it needs to either be public or a signedURL. -Note: the contents of the file located at url are opened as a sequence of bytes and passed -to the predict function. If you instead want to pass the url itself as an input to the predict function, -see args.

    -

    Exactly one of url and args must be specified.

    -

  • -
  • args (Optional[Dict]) –

    A dictionary of arguments to the ModelBundle’s predict function. -Must be json-serializable, i.e. composed of str, int, float, etc. -If your predict function has signature predict(foo, bar), then args should be a dictionary with -keys "foo" and "bar".

    -

    Exactly one of url and args must be specified.

    -

  • -
  • return_pickled (bool) – Whether the python object returned is pickled, or directly written to the file returned.

  • -
-
-
Returns:
-

An id/key that can be used to fetch inference results at a later time. -Example output:

-
-

abcabcab-cabc-abca-0123456789ab

-
-

-
-
Return type:
-

str

-
-
-
- -
-
-batch_async_request(model_bundle, urls=None, inputs=None, batch_url_file_location=None, serialization_format='json', batch_task_options=None, labels=None)#
-

Sends a batch inference request using a given bundle. Returns a key that can be used to retrieve -the results of inference at a later time.

-

Must have exactly one of urls or inputs passed in.

-
-
Parameters:
-
    -
  • model_bundle (Union[launch.model_bundle.ModelBundle, str]) – The bundle or the name of a the bundle to use for inference.

  • -
  • urls (List[str]) – A list of urls, each pointing to a file containing model input. -Must be accessible by Scale Launch, hence urls need to either be public or signedURLs.

  • -
  • inputs (Optional[List[Dict[str, Any]]]) – A list of model inputs, if exists, we will upload the inputs and pass it in to Launch.

  • -
  • batch_url_file_location (Optional[str]) – In self-hosted mode, the input to the batch job will be uploaded -to this location if provided. Otherwise, one will be determined from bundle_location_fn()

  • -
  • serialization_format (str) – Serialization format of output, either ‘pickle’ or ‘json’. -‘pickle’ corresponds to pickling results + returning

  • -
  • batch_task_options (Optional[Dict[str, Any]]) – A Dict of optional endpoint/batch task settings, i.e. certain endpoint settings -like cpus, memory, gpus, gpu_type, max_workers, as well as under-the-hood batch -job settings, like pyspark_partition_size, pyspark_max_executors.

  • -
  • labels (Optional[Dict[str, str]]) –

  • -
-
-
Returns:
-

An id/key that can be used to fetch inference results at a later time

-
-
-
- -
-
-clone_model_bundle_with_changes(existing_bundle, new_bundle_name, app_config=None)#
-

Clones an existing model bundle with changes to its app config. (More fields coming soon)

-
-
Parameters:
-
    -
  • existing_bundle (Union[launch.model_bundle.ModelBundle, str]) – The existing bundle or its name.

  • -
  • new_bundle_name (str) – The new bundle’s name.

  • -
  • app_config (Optional[Dict]) – The new bundle’s app config, if not passed in, the new bundle’s app_config will be set to None

  • -
-
-
Returns:
-

A ModelBundle object

-
-
Return type:
-

launch.model_bundle.ModelBundle

-
-
-
- -
-
-create_model_bundle(model_bundle_name, env_params, *, load_predict_fn=None, predict_fn_or_cls=None, requirements=None, model=None, load_model_fn=None, bundle_url=None, app_config=None, globals_copy=None)#
-

Uploads and registers a model bundle to Scale Launch.

-

A model bundle consists of exactly one of the following:

-
    -
  • predict_fn_or_cls

  • -
  • load_predict_fn + model

  • -
  • load_predict_fn + load_model_fn

  • -
-

Pre/post-processing code can be included inside load_predict_fn/model or in predict_fn_or_cls call.

-
-
Parameters:
-
    -
  • model_bundle_name (str) – The name of the model bundle you want to create. The name must be unique across all -bundles that you own.

  • -
  • predict_fn_or_cls (Optional[Callable[[Any], Any]]) – Function or a Callable class that runs end-to-end (pre/post processing and model inference) on the call. -i.e. predict_fn_or_cls(REQUEST) -> RESPONSE.

  • -
  • model (Optional[LaunchModel_T]) –

    Typically a trained Neural Network, e.g. a Pytorch module.

    -

    Exactly one of model and load_model_fn must be provided.

    -

  • -
  • load_model_fn (Optional[Callable[[], LaunchModel_T]]) –

    A function that, when run, loads a model. This function is essentially a deferred -wrapper around the model argument.

    -

    Exactly one of model and load_model_fn must be provided.

    -

  • -
  • load_predict_fn (Optional[Callable[[LaunchModel_T], Callable[[Any], Any]]]) –

    Function that, when called with a model, returns a function that carries out inference.

    -

    If model is specified, then this is equivalent -to:

    -
    -

    load_predict_fn(model, app_config=optional_app_config]) -> predict_fn

    -
    -

    Otherwise, if load_model_fn is specified, then this is equivalent -to:

    -
    -

    load_predict_fn(load_model_fn(), app_config=optional_app_config]) -> predict_fn

    -
    -
    -
    In both cases, predict_fn is then the inference function, i.e.:

    predict_fn(REQUEST) -> RESPONSE

    -
    -
    -

  • -
  • requirements (Optional[List[str]]) –

    A list of python package requirements, where each list element is of the form -<package_name>==<package_version>, e.g.

    -

    ["tensorflow==2.3.0", "tensorflow-hub==0.11.0"]

    -

    If you do not pass in a value for requirements, then you must pass in globals() for the -globals_copy argument.

    -

  • -
  • app_config (Optional[Union[Dict[str, Any], str]]) – Either a Dictionary that represents a YAML file contents or a local path to a YAML file.

  • -
  • env_params (Dict[str, str]) –

    A dictionary that dictates environment information e.g. -the use of pytorch or tensorflow, which base image tag to use, etc. -Specifically, the dictionary should contain the following keys:

    -
      -
    • framework_type: either tensorflow or pytorch.

    • -
    • -
      PyTorch fields:
      -
      {
      -    "framework_type": "pytorch",
      -    "pytorch_image_tag": "1.10.0-cuda11.3-cudnn8-runtime"
      -}
      -
      -
      -
      -
      -
    • -
    • -
      Tensorflow fields:
        -
      • tensorflow_version: Version of tensorflow, e.g. "2.3.0".

      • -
      -
      -
      -
    • -
    -

  • -
  • globals_copy (Optional[Dict[str, Any]]) – Dictionary of the global symbol table. Normally provided by globals() built-in function.

  • -
  • bundle_url (Optional[str]) – (Only used in self-hosted mode.) The desired location of bundle. -Overrides any value given by self.bundle_location_fn

  • -
-
-
Return type:
-

launch.model_bundle.ModelBundle

-
-
-
- -
-
-create_model_bundle_from_dirs(model_bundle_name, base_paths, requirements_path, env_params, load_predict_fn_module_path, load_model_fn_module_path, app_config=None)#
-

Packages up code from one or more local filesystem folders and uploads them as a bundle to Scale Launch. -In this mode, a bundle is just local code instead of a serialized object.

-

For example, if you have a directory structure like so, and your current working directory is also my_root:

-
my_root/
-    my_module1/
-        __init__.py
-        ...files and directories
-        my_inference_file.py
-    my_module2/
-        __init__.py
-        ...files and directories
-
-
-

then calling create_model_bundle_from_dirs with base_paths=["my_module1", "my_module2"] essentially -creates a zip file without the root directory, e.g.:

-
my_module1/
-    __init__.py
-    ...files and directories
-    my_inference_file.py
-my_module2/
-    __init__.py
-    ...files and directories
-
-
-

and these contents will be unzipped relative to the server side application root. Bear these points in mind when -referencing Python module paths for this bundle. For instance, if my_inference_file.py has def f(...) -as the desired inference loading function, then the load_predict_fn_module_path argument should be -my_module1.my_inference_file.f.

-
-
Parameters:
-
    -
  • model_bundle_name (str) – The name of the model bundle you want to create. The name must be unique across all -bundles that you own.

  • -
  • base_paths (List[str]) – The paths on the local filesystem where the bundle code lives.

  • -
  • requirements_path (str) – A path on the local filesystem where a requirements.txt file lives.

  • -
  • env_params (Dict[str, str]) –

    A dictionary that dictates environment information e.g. -the use of pytorch or tensorflow, which base image tag to use, etc. -Specifically, the dictionary should contain the following keys:

    -
      -
    • framework_type: either tensorflow or pytorch.

    • -
    • -
      PyTorch fields:
      -
      {
      -    "framework_type": "pytorch",
      -    "pytorch_image_tag": "1.10.0-cuda11.3-cudnn8-runtime"
      -}
      -
      -
      -
      -
      -
    • -
    -

  • -
  • load_predict_fn_module_path (str) – A python module path for a function that, when called with the output of -load_model_fn_module_path, returns a function that carries out inference.

  • -
  • load_model_fn_module_path (str) – A python module path for a function that returns a model. The output feeds into -the function located at load_predict_fn_module_path.

  • -
  • app_config (Optional[Union[Dict[str, Any], str]]) – Either a Dictionary that represents a YAML file contents or a local path to a YAML file.

  • -
-
-
Return type:
-

launch.model_bundle.ModelBundle

-
-
-
- -
-
-create_model_endpoint(endpoint_name, model_bundle, cpus=3, memory='8Gi', storage=None, gpus=0, min_workers=1, max_workers=1, per_worker=10, gpu_type=None, endpoint_type='sync', post_inference_hooks=None, update_if_exists=False, labels=None)#
-

Creates and registers a model endpoint in Scale Launch. The returned object is an instance of type Endpoint, -which is a base class of either SyncEndpoint or AsyncEndpoint. This is the object -to which you sent inference requests.

-
-
Parameters:
-
    -
  • endpoint_name (str) – The name of the model endpoint you want to create. The name must be unique across -all endpoints that you own.

  • -
  • model_bundle (Union[launch.model_bundle.ModelBundle, str]) – The ModelBundle that the endpoint should serve.

  • -
  • cpus (int) – Number of cpus each worker should get, e.g. 1, 2, etc. This must be greater than or equal to 1.

  • -
  • memory (str) – Amount of memory each worker should get, e.g. “4Gi”, “512Mi”, etc. This must be a positive -amount of memory.

  • -
  • storage (Optional[str]) – Amount of local ephemeral storage each worker should get, e.g. “4Gi”, “512Mi”, etc. This must -be a positive amount of storage.

  • -
  • gpus (int) – Number of gpus each worker should get, e.g. 0, 1, etc.

  • -
  • min_workers (int) – The minimum number of workers. Must be greater than or equal to 0. This should be determined -by computing the minimum throughput of your workload and dividing it by the throughput of a single -worker. This field must be at least 1 for synchronous endpoints.

  • -
  • max_workers (int) – The maximum number of workers. Must be greater than or equal to 0, and as well as -greater than or equal to min_workers. This should be determined by computing the maximum throughput -of your workload and dividing it by the throughput of a single worker.

  • -
  • per_worker (int) –

    The maximum number of concurrent requests that an individual worker can service. Launch -automatically scales the number of workers for the endpoint so that each worker is processing -per_worker requests, subject to the limits defined by min_workers and max_workers.

    -
      -
    • If the average number of concurrent requests per worker is lower than per_worker, then the number -of workers will be reduced.

    • -
    • Otherwise, if the average number of concurrent requests per worker is higher -than per_worker, then the number of workers will be increased to meet the elevated traffic.

    • -
    -

    Here is our recommendation for computing per_worker:

    -
      -
    1. Compute min_workers and max_workers per your minimum and maximum throughput requirements.

    2. -
    -

    2. Determine a value for the maximum number of concurrent requests in the workload. Divide this number -by max_workers. Doing this ensures that the number of workers will “climb” to max_workers.

    -

  • -
  • gpu_type (Optional[str]) –

    If specifying a non-zero number of gpus, this controls the type of gpu requested. Here are the -supported values:

    -
      -
    • nvidia-tesla-t4

    • -
    • nvidia-ampere-a10

    • -
    -

  • -
  • endpoint_type (str) – Either "sync" or "async".

  • -
  • post_inference_hooks (Optional[List[launch.hooks.PostInferenceHooks]]) – List of hooks to trigger after inference tasks are served.

  • -
  • update_if_exists (bool) – If True, will attempt to update the endpoint if it exists. Otherwise, will -unconditionally try to create a new endpoint. Note that endpoint names for a given user must be unique, -so attempting to call this function with update_if_exists=False for an existing endpoint will raise -an error.

  • -
  • labels (Optional[Dict[str, str]]) – An optional dictionary of key/value pairs to associate with this endpoint.

  • -
-
-
Returns:
-

A Endpoint object that can be used to make requests to the endpoint.

-
-
Return type:
-

Optional[launch.model_endpoint.Endpoint]

-
-
-
- -
-
-delete_model_bundle(model_bundle)#
-

Deletes the model bundle.

-
-
Parameters:
-

model_bundle (Union[launch.model_bundle.ModelBundle, str]) – A ModelBundle object or the name of a model bundle.

-
-
-
- -
-
-delete_model_endpoint(model_endpoint)#
-

Deletes a model endpoint.

-
-
Parameters:
-

model_endpoint (Union[launch.model_endpoint.ModelEndpoint, str]) – A ModelEndpoint object.

-
-
-
- -
-
-edit_model_endpoint(model_endpoint, model_bundle=None, cpus=None, memory=None, storage=None, gpus=None, min_workers=None, max_workers=None, per_worker=None, gpu_type=None, post_inference_hooks=None)#
-

Edits an existing model endpoint. Here are the fields that cannot be edited on an existing endpoint:

-
    -
  • The endpoint’s name.

  • -
  • The endpoint’s type (i.e. you cannot go from a SyncEnpdoint to an AsyncEndpoint or vice versa.

  • -
-
-
Parameters:
-
    -
  • model_endpoint (Union[launch.model_endpoint.ModelEndpoint, str]) – The model endpoint (or its name) you want to edit. The name must be unique across -all endpoints that you own.

  • -
  • model_bundle (Optional[Union[launch.model_bundle.ModelBundle, str]]) – The ModelBundle that the endpoint should serve.

  • -
  • cpus (Optional[float]) – Number of cpus each worker should get, e.g. 1, 2, etc. This must be greater than or equal to 1.

  • -
  • memory (Optional[str]) – Amount of memory each worker should get, e.g. “4Gi”, “512Mi”, etc. This must be a positive -amount of memory.

  • -
  • storage (Optional[str]) – Amount of local ephemeral storage each worker should get, e.g. “4Gi”, “512Mi”, etc. This must -be a positive amount of storage.

  • -
  • gpus (Optional[int]) – Number of gpus each worker should get, e.g. 0, 1, etc.

  • -
  • min_workers (Optional[int]) – The minimum number of workers. Must be greater than or equal to 0.

  • -
  • max_workers (Optional[int]) – The maximum number of workers. Must be greater than or equal to 0, and as well as -greater than or equal to min_workers.

  • -
  • per_worker (Optional[int]) –

    The maximum number of concurrent requests that an individual worker can service. Launch -automatically scales the number of workers for the endpoint so that each worker is processing -per_worker requests:

    -
      -
    • If the average number of concurrent requests per worker is lower than per_worker, then the number -of workers will be reduced.

    • -
    • Otherwise, if the average number of concurrent requests per worker is higher -than per_worker, then the number of workers will be increased to meet the elevated traffic.

    • -
    -

  • -
  • gpu_type (Optional[str]) –

    If specifying a non-zero number of gpus, this controls the type of gpu requested. Here are the -supported values:

    -
      -
    • nvidia-tesla-t4

    • -
    • nvidia-ampere-a10

    • -
    -

  • -
  • endpoint_type – Either "sync" or "async".

  • -
  • post_inference_hooks (Optional[List[launch.hooks.PostInferenceHooks]]) – List of hooks to trigger after inference tasks are served.

  • -
-
-
Return type:
-

None

-
-
-
- -
-
-get_async_response(async_task_id)#
-

Not recommended to use this, instead we recommend to use functions provided by AsyncEndpoint. -Gets inference results from a previously created task.

-
-
Parameters:
-

async_task_id (str) – The id/key returned from a previous invocation of async_request.

-
-
Returns:
-

A dictionary that contains task status and optionally a result url or result if the task has completed. -Result url or result will be returned if the task has succeeded. Will return a result url iff -return_pickled was set to True on task creation.

-

The dictionary’s keys are as follows:

-
    -
  • state: 'PENDING' or 'SUCCESS' or 'FAILURE'

  • -
  • result_url: a url pointing to inference results. This url is accessible for 12 hours after the request has been made.

  • -
  • result: the value returned by the endpoint’s predict function, serialized as json

  • -
-

Example output:

-
{
-    'state': 'SUCCESS',
-    'result_url': 'https://foo.s3.us-west-2.amazonaws.com/bar/baz/qux?xyzzy'
-}
-
-
-

-
-
Return type:
-

Dict[str, Any]

-
-
-
- -
-
-get_batch_async_response(batch_async_task_id)#
-

Gets inference results from a previously created batch job.

-
-
Parameters:
-

batch_async_task_id (str) – An id representing the batch task job. This id is the in the response from -calling batch_async_request.

-
-
Returns:
-

    -
  • status: The status of the job.

  • -
  • result: The url where the result is stored.

  • -
  • duration: A string representation of how long the job took to finish.

  • -
-

-
-
Return type:
-

A dictionary that contains the following fields

-
-
-
- -
-
-get_model_bundle(model_bundle)#
-

Returns a model bundle specified by bundle_name that the user owns.

-
-
Parameters:
-

model_bundle (Union[launch.model_bundle.ModelBundle, str]) – The bundle or its name.

-
-
Returns:
-

A ModelBundle object

-
-
Return type:
-

launch.model_bundle.ModelBundle

-
-
-
- -
-
-get_model_endpoint(endpoint_name)#
-

Gets a model endpoint associated with a name.

-
-
Parameters:
-

endpoint_name (str) – The name of the endpoint to retrieve.

-
-
Return type:
-

Optional[Union[launch.model_endpoint.AsyncEndpoint, launch.model_endpoint.SyncEndpoint]]

-
-
-
- -
-
-list_model_bundles()#
-

Returns a list of model bundles that the user owns.

-
-
Returns:
-

A list of ModelBundle objects

-
-
Return type:
-

List[launch.model_bundle.ModelBundle]

-
-
-
- -
-
-list_model_endpoints()#
-

Lists all model endpoints that the user owns.

-
-
Returns:
-

A list of ModelEndpoint objects.

-
-
Return type:
-

List[launch.model_endpoint.Endpoint]

-
-
-
- -
-
-read_endpoint_creation_logs(model_endpoint)#
-

Retrieves the logs for the creation of the endpoint.

-
-
Parameters:
-

model_endpoint (Union[launch.model_endpoint.ModelEndpoint, str]) – The endpoint or its name.

-
-
-
- -
-
-register_batch_csv_location_fn(batch_csv_location_fn)#
-

For self-hosted mode only. Registers a function that gives a location for batch CSV inputs. Should give different -locations each time. This function is called as batch_csv_location_fn(), and should return a batch_csv_url that -upload_batch_csv_fn can take.

-

Strictly, batch_csv_location_fn() does not need to return a str. The only requirement is that if batch_csv_location_fn -returns a value of type T, then upload_batch_csv_fn() takes in an object of type T as its second argument -(i.e. batch_csv_url).

-
-
Parameters:
-

batch_csv_location_fn (Callable[[], str]) – Function that generates batch_csv_urls for upload_batch_csv_fn.

-
-
-
- -
-
-register_bundle_location_fn(bundle_location_fn)#
-

For self-hosted mode only. Registers a function that gives a location for a model bundle. Should give different -locations each time. This function is called as bundle_location_fn(), and should return a bundle_url -that register_upload_bundle_fn can take.

-

Strictly, bundle_location_fn() does not need to return a str. The only requirement is that if -bundle_location_fn returns a value of type T, then upload_bundle_fn() takes in an object of type T -as its second argument (i.e. bundle_url).

-
-
Parameters:
-

bundle_location_fn (Callable[[], str]) – Function that generates bundle_urls for upload_bundle_fn.

-
-
-
- -
-
-register_endpoint_auth_decorator(endpoint_auth_decorator_fn)#
-

For self-hosted mode only. Registers a function that modifies the endpoint creation payload to include -required fields for self-hosting.

-
- -
-
-register_upload_batch_csv_fn(upload_batch_csv_fn)#
-

For self-hosted mode only. Registers a function that handles batch text upload. This function is called as

-
-

upload_batch_csv_fn(csv_text, csv_url)

-
-

This function should directly write the contents of csv_text as a text string into csv_url.

-
-
Parameters:
-

upload_batch_csv_fn (Callable[[str, str], None]) – Function that takes in a csv text (string type), and uploads that bundle to an appropriate -location. Only needed for self-hosted mode.

-
-
-
- -
-
-register_upload_bundle_fn(upload_bundle_fn)#
-

For self-hosted mode only. Registers a function that handles model bundle upload. This function is called as

-
-

upload_bundle_fn(serialized_bundle, bundle_url)

-
-

This function should directly write the contents of serialized_bundle as a -binary string into bundle_url.

-

See register_bundle_location_fn for more notes on the signature of upload_bundle_fn

-
-
Parameters:
-

upload_bundle_fn (Callable[[str, str], None]) – Function that takes in a serialized bundle (bytes type), and uploads that bundle to an appropriate -location. Only needed for self-hosted mode.

-
-
-
- -
- -
-
-class launch.ModelBundle#
-

Represents a ModelBundle.

-
-
-bundle_id :Optional[str]#
-

A globally unique identifier for the bundle. This is not to be used in the API.

-
- -
-
-env_params :Optional[Dict[str, str]]#
-

A dictionary that dictates environment information. See LaunchClient.create_model_bundle -for more information.

-
- -
-
-location :Optional[str]#
-

An opaque location for the bundle.

-
- -
-
-metadata :Optional[Dict[Any, Any]]#
-

Arbitrary metadata for the bundle.

-
- -
-
-name :str#
-

The name of the bundle. Must be unique across all bundles that the user owns.

-
- -
-
-packaging_type :Optional[str]#
-

The packaging type for the bundle. Can be cloudpickle or zip.

-
- -
-
-requirements :Optional[List[str]]#
-

A list of Python package requirements for the bundle. See LaunchClient.create_model_bundle -for more information.

-
- -
- -
-
-class launch.SyncEndpoint(model_endpoint, client)#
-

A synchronous model endpoint.

-
-
Parameters:
-
    -
  • model_endpoint (ModelEndpoint) – ModelEndpoint object.

  • -
  • client – A LaunchClient object

  • -
-
-
-
-
-predict(request)#
-

Runs a synchronous prediction request.

-
-
Parameters:
-

request (EndpointRequest) – The EndpointRequest object that contains the payload.

-
-
Return type:
-

EndpointResponse

-
-
-
- -
-
-resource_settings()#
-

Gets the resource settings of the Endpoint.

-
-
Return type:
-

Optional[dict]

-
-
-
- -
-
-status()#
-

Gets the status of the Endpoint.

-
-
Return type:
-

Optional[str]

-
-
-
- -
-
-worker_settings()#
-

Gets the worker settings of the Endpoint.

-
-
Return type:
-

Optional[dict]

-
-
-
- -
- -
-
-
- -
-
- -
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/logger/index.html b/docs/api/launch/logger/index.html deleted file mode 100644 index 0564c636..00000000 --- a/docs/api/launch/logger/index.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - launch.logger - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/make_batch_file/index.html b/docs/api/launch/make_batch_file/index.html deleted file mode 100644 index 643dabac..00000000 --- a/docs/api/launch/make_batch_file/index.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - launch.make_batch_file - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/model_bundle/index.html b/docs/api/launch/model_bundle/index.html deleted file mode 100644 index 63993152..00000000 --- a/docs/api/launch/model_bundle/index.html +++ /dev/null @@ -1,353 +0,0 @@ - - - - - - - - - launch.model_bundle - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.model_bundle#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - -

ModelBundle

Represents a ModelBundle.

-
-
-
-class launch.model_bundle.ModelBundle#
-

Represents a ModelBundle.

-
-
-bundle_id :Optional[str]#
-

A globally unique identifier for the bundle. This is not to be used in the API.

-
- -
-
-env_params :Optional[Dict[str, str]]#
-

A dictionary that dictates environment information. See LaunchClient.create_model_bundle -for more information.

-
- -
-
-location :Optional[str]#
-

An opaque location for the bundle.

-
- -
-
-metadata :Optional[Dict[Any, Any]]#
-

Arbitrary metadata for the bundle.

-
- -
-
-name :str#
-

The name of the bundle. Must be unique across all bundles that the user owns.

-
- -
-
-packaging_type :Optional[str]#
-

The packaging type for the bundle. Can be cloudpickle or zip.

-
- -
-
-requirements :Optional[List[str]]#
-

A list of Python package requirements for the bundle. See LaunchClient.create_model_bundle -for more information.

-
- -
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/model_endpoint/index.html b/docs/api/launch/model_endpoint/index.html deleted file mode 100644 index 4e44c671..00000000 --- a/docs/api/launch/model_endpoint/index.html +++ /dev/null @@ -1,746 +0,0 @@ - - - - - - - - - launch.model_endpoint - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.model_endpoint#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

AsyncEndpoint

An asynchronous model endpoint.

AsyncEndpointBatchResponse

(deprecated)

Endpoint

An abstract class that represent any kind of endpoints in Scale Launch

EndpointRequest

Represents a single request to either a SyncEndpoint or AsyncEndpoint.

EndpointResponse

Represents a response received from a Endpoint.

EndpointResponseFuture

Represents a future response from an Endpoint. Specifically, when the EndpointResponseFuture is ready,

ModelEndpoint

Represents an Endpoint from the database.

SyncEndpoint

A synchronous model endpoint.

-
-
-
-class launch.model_endpoint.AsyncEndpoint(model_endpoint, client)#
-

An asynchronous model endpoint.

-
-
Parameters:
-
    -
  • model_endpoint (ModelEndpoint) – ModelEndpoint object.

  • -
  • client – A LaunchClient object

  • -
-
-
-
-
-predict(request)#
-

Runs an asynchronous prediction request.

-
-
Parameters:
-

request (EndpointRequest) – The EndpointRequest object that contains the payload.

-
-
Returns:
-

An EndpointResponseFuture such the user can use to query the status of the request. -Example:

-
my_endpoint = AsyncEndpoint(...)
-f: EndpointResponseFuture = my_endpoint.predict(EndpointRequest(...))
-result = f.get()  # blocks on completion
-
-
-

-
-
Return type:
-

EndpointResponseFuture

-
-
-
- -
-
-predict_batch(requests)#
-

(deprecated) -Runs inference on the data items specified by urls. Returns a AsyncEndpointResponse.

-
-
Parameters:
-

requests (Sequence[EndpointRequest]) – List of EndpointRequests. Request_ids must all be distinct.

-
-
Returns:
-

an AsyncEndpointResponse keeping track of the inference requests made

-
-
Return type:
-

AsyncEndpointBatchResponse

-
-
-
- -
-
-resource_settings()#
-

Gets the resource settings of the Endpoint.

-
-
Return type:
-

Optional[dict]

-
-
-
- -
-
-status()#
-

Gets the status of the Endpoint.

-
-
Return type:
-

Optional[str]

-
-
-
- -
-
-worker_settings()#
-

Gets the worker settings of the Endpoint.

-
-
Return type:
-

Optional[dict]

-
-
-
- -
- -
-
-class launch.model_endpoint.AsyncEndpointBatchResponse(client, endpoint_name, request_ids)#
-

(deprecated)

-

Currently represents a list of async inference requests to a specific endpoint. Keeps track of the requests made, -and gives a way to poll for their status.

-

Invariant: set keys for self.request_ids and self.responses are equal

-

idk about this abstraction tbh, could use a redesign maybe?

-

Also batch inference sort of removes the need for much of the complication in here

-
-
Parameters:
-
    -
  • endpoint_name (str) –

  • -
  • request_ids (Dict[str, str]) –

  • -
-
-
-
-
-get_responses()#
-

Returns a dictionary, where each key is the request_id for an EndpointRequest passed in, and the corresponding -object at that key is the corresponding EndpointResponse.

-
-
Return type:
-

Dict[str, Optional[EndpointResponse]]

-
-
-
- -
-
-is_done(poll=True)#
-

Checks the client local state to see if all requests are done.

-
-
Parameters:
-
    -
  • poll – If True, then this will first check the state for a subset

  • -
  • server. (of the remaining incomplete tasks on the Launch) –

  • -
-
-
Return type:
-

bool

-
-
-
- -
-
-poll_endpoints()#
-

Runs one round of polling the endpoint for async task results.

-
- -
- -
-
-class launch.model_endpoint.Endpoint(model_endpoint, client)#
-

An abstract class that represent any kind of endpoints in Scale Launch

-
-
Parameters:
-

model_endpoint (ModelEndpoint) –

-
-
-
-
-resource_settings()#
-

Gets the resource settings of the Endpoint.

-
-
Return type:
-

Optional[dict]

-
-
-
- -
-
-status()#
-

Gets the status of the Endpoint.

-
-
Return type:
-

Optional[str]

-
-
-
- -
-
-worker_settings()#
-

Gets the worker settings of the Endpoint.

-
-
Return type:
-

Optional[dict]

-
-
-
- -
- -
-
-class launch.model_endpoint.EndpointRequest(url=None, args=None, return_pickled=True, request_id=None)#
-

Represents a single request to either a SyncEndpoint or AsyncEndpoint.

-
-
Parameters:
-
    -
  • url (Optional[str]) –

    A url to some file that can be read in to a ModelBundle’s predict function. Can be an image, raw text, etc. -Note: the contents of the file located at url are opened as a sequence of bytes and passed -to the predict function. If you instead want to pass the url itself as an input to the predict function, -see args.

    -

    Exactly one of url and args must be specified.

    -

  • -
  • args (Optional[Dict]) –

    A Dictionary with arguments to a ModelBundle’s predict function. If the predict function has signature -predict_fn(foo, bar), then the keys in the dictionary should be "foo" and "bar". -Values must be native Python objects.

    -

    Exactly one of url and args must be specified.

    -

  • -
  • return_pickled (Optional[bool]) – Whether the output should be a pickled python object, or directly returned serialized json.

  • -
  • request_id (Optional[str]) – (deprecated) A user-specifiable id for requests. -Should be unique among EndpointRequests made in the same batch call. -If one isn’t provided the client will generate its own.

  • -
-
-
-
- -
-
-class launch.model_endpoint.EndpointResponse(client, status, result_url=None, result=None, traceback=None)#
-

Represents a response received from a Endpoint.

-
-
Parameters:
-
    -
  • client – An instance of LaunchClient.

  • -
  • status (str) – A string representing the status of the request, i.e. SUCCESS, FAILURE, or PENDING

  • -
  • result_url (Optional[str]) –

    A string that is a url containing the pickled python object from the Endpoint’s predict function.

    -

    Exactly one of result_url or result will be populated, -depending on the value of return_pickled in the request.

    -

  • -
  • result (Optional[str]) –

    A string that is the serialized return value (in json form) of the Endpoint’s predict function. -Specifically, one can json.loads() the value of result to get the original python object back.

    -

    Exactly one of result_url or result will be populated, -depending on the value of return_pickled in the request.

    -

  • -
  • traceback (Optional[str]) – The stack trace if the inference endpoint raised an error. Can be used for debugging

  • -
-
-
-
- -
-
-class launch.model_endpoint.EndpointResponseFuture(client, endpoint_name, async_task_id)#
-

Represents a future response from an Endpoint. Specifically, when the EndpointResponseFuture is ready, -then its get method will return an actual instance of EndpointResponse.

-

This object should not be directly instantiated by the user.

-
-
Parameters:
-
    -
  • client – An instance of LaunchClient.

  • -
  • endpoint_name (str) – The name of the endpoint.

  • -
  • async_task_id (str) – An async task id.

  • -
-
-
-
-
-get()#
-

Retrieves the EndpointResponse for the prediction request after it completes. This method blocks.

-
-
Return type:
-

EndpointResponse

-
-
-
- -
- -
-
-class launch.model_endpoint.ModelEndpoint#
-

Represents an Endpoint from the database.

-
-
-bundle_name :Optional[str]#
-

The name of the bundle for the endpoint. The owner of the bundle must be the same as the owner for the endpoint.

-
- -
-
-configs :Optional[dict]#
-

Config for the endpoint.

-
- -
-
-destination :Optional[str]#
-

Queue identifier for endpoint, use only for debugging.

-
- -
-
-endpoint_type :Optional[str]#
-

The type of the endpoint. Must be 'async' or 'sync'.

-
- -
-
-metadata :Optional[dict]#
-

Metadata for the endpoint.

-
- -
-
-name :str#
-

The name of the endpoint. Must be unique across all endpoints owned by the user.

-
- -
-
-resource_settings :Optional[dict]#
-

Resource settings for the endpoint.

-
- -
-
-status :Optional[str]#
-

The status of the endpoint.

-
- -
-
-worker_settings :Optional[dict]#
-

Worker settings for the endpoint.

-
- -
- -
-
-class launch.model_endpoint.SyncEndpoint(model_endpoint, client)#
-

A synchronous model endpoint.

-
-
Parameters:
-
    -
  • model_endpoint (ModelEndpoint) – ModelEndpoint object.

  • -
  • client – A LaunchClient object

  • -
-
-
-
-
-predict(request)#
-

Runs a synchronous prediction request.

-
-
Parameters:
-

request (EndpointRequest) – The EndpointRequest object that contains the payload.

-
-
Return type:
-

EndpointResponse

-
-
-
- -
-
-resource_settings()#
-

Gets the resource settings of the Endpoint.

-
-
Return type:
-

Optional[dict]

-
-
-
- -
-
-status()#
-

Gets the status of the Endpoint.

-
-
Return type:
-

Optional[str]

-
-
-
- -
-
-worker_settings()#
-

Gets the worker settings of the Endpoint.

-
-
Return type:
-

Optional[dict]

-
-
-
- -
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/pipeline/deployment/index.html b/docs/api/launch/pipeline/deployment/index.html deleted file mode 100644 index 21184d28..00000000 --- a/docs/api/launch/pipeline/deployment/index.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - - - launch.pipeline.deployment - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.pipeline.deployment#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - -

Deployment

Base deployment class

-
-
-
-class launch.pipeline.deployment.Deployment#
-

Base deployment class

-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/pipeline/index.html b/docs/api/launch/pipeline/index.html deleted file mode 100644 index 26a53d7a..00000000 --- a/docs/api/launch/pipeline/index.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - - - - - - launch.pipeline - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.pipeline#

-
-

Package Contents#

-
-

Classes#

-
- - - - - - - - - - - - - - - -

Deployment

Base deployment class

Runtime

Generic enumeration.

SequentialPipelineDescription

The description of a sequential pipeline.

SingleServiceDescription

The description of a service.

-
-
-
-

Functions#

-
- - - - - - - - - -

make_sequential_pipeline(items)

Create a structure that describes a sequential pipeline.

make_service(service, runtime, deployment, **kwargs)

Create a structure that describes a single service.

-
-
-
-class launch.pipeline.Deployment#
-

Base deployment class

-
- -
-
-class launch.pipeline.Runtime#
-

Generic enumeration.

-

Derive from this class to define new enumerations.

-
-
-name()#
-

The name of the Enum member.

-
- -
-
-value()#
-

The value of the Enum member.

-
- -
- -
-
-class launch.pipeline.SequentialPipelineDescription(items)#
-

The description of a sequential pipeline.

-
-
Parameters:
-

items (List[SingleServiceDescription]) –

-
-
-
- -
-
-class launch.pipeline.SingleServiceDescription(service, runtime, deployment, **kwargs)#
-

The description of a service.

-
-
Parameters:
-
-
-
-
- -
-
-launch.pipeline.make_sequential_pipeline(items)#
-

Create a structure that describes a sequential pipeline.

-
-
Parameters:
-

items (List[launch.pipeline.service.SingleServiceDescription]) –

-
-
Return type:
-

launch.pipeline.service.SequentialPipelineDescription

-
-
-
- -
-
-launch.pipeline.make_service(service, runtime, deployment, **kwargs)#
-

Create a structure that describes a single service.

-
-
Parameters:
-
-
-
Return type:
-

launch.pipeline.service.SingleServiceDescription

-
-
-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/pipeline/runtime/index.html b/docs/api/launch/pipeline/runtime/index.html deleted file mode 100644 index cad49c40..00000000 --- a/docs/api/launch/pipeline/runtime/index.html +++ /dev/null @@ -1,317 +0,0 @@ - - - - - - - - - launch.pipeline.runtime - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.pipeline.runtime#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - -

Runtime

Generic enumeration.

-
-
-
-class launch.pipeline.runtime.Runtime#
-

Generic enumeration.

-

Derive from this class to define new enumerations.

-
-
-name()#
-

The name of the Enum member.

-
- -
-
-value()#
-

The value of the Enum member.

-
- -
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/pipeline/service/index.html b/docs/api/launch/pipeline/service/index.html deleted file mode 100644 index 684d09dd..00000000 --- a/docs/api/launch/pipeline/service/index.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - - - - - launch.pipeline.service - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.pipeline.service#

-
-

Module Contents#

-
-

Classes#

-
- - - - - - - - - - - - -

SequentialPipelineDescription

The description of a sequential pipeline.

ServiceDescription

Base ServiceDescription.

SingleServiceDescription

The description of a service.

-
-
-
-class launch.pipeline.service.SequentialPipelineDescription(items)#
-

The description of a sequential pipeline.

-
-
Parameters:
-

items (List[SingleServiceDescription]) –

-
-
-
- -
-
-class launch.pipeline.service.ServiceDescription#
-

Base ServiceDescription.

-
- -
-
-class launch.pipeline.service.SingleServiceDescription(service, runtime, deployment, **kwargs)#
-

The description of a service.

-
-
Parameters:
-
-
-
-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/pipeline/utils/index.html b/docs/api/launch/pipeline/utils/index.html deleted file mode 100644 index 773225f0..00000000 --- a/docs/api/launch/pipeline/utils/index.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - - - - - launch.pipeline.utils - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.pipeline.utils#

-
-

Module Contents#

-
-

Functions#

-
- - - - - - - - - -

make_sequential_pipeline(items)

Create a structure that describes a sequential pipeline.

make_service(service, runtime, deployment, **kwargs)

Create a structure that describes a single service.

-
-
-
-launch.pipeline.utils.make_sequential_pipeline(items)#
-

Create a structure that describes a sequential pipeline.

-
-
Parameters:
-

items (List[launch.pipeline.service.SingleServiceDescription]) –

-
-
Return type:
-

launch.pipeline.service.SequentialPipelineDescription

-
-
-
- -
-
-launch.pipeline.utils.make_service(service, runtime, deployment, **kwargs)#
-

Create a structure that describes a single service.

-
-
Parameters:
-
-
-
Return type:
-

launch.pipeline.service.SingleServiceDescription

-
-
-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/request_validation/index.html b/docs/api/launch/request_validation/index.html deleted file mode 100644 index 4d69ff45..00000000 --- a/docs/api/launch/request_validation/index.html +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - - - - launch.request_validation - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
- -
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/retry_strategy/index.html b/docs/api/launch/retry_strategy/index.html deleted file mode 100644 index df6cd43a..00000000 --- a/docs/api/launch/retry_strategy/index.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - launch.retry_strategy - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
- -
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/launch/utils/index.html b/docs/api/launch/utils/index.html deleted file mode 100644 index bae7e835..00000000 --- a/docs/api/launch/utils/index.html +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - - - - launch.utils - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

launch.utils#

-
-

Module Contents#

-
-

Functions#

-
- - - - - - -

trim_kwargs(kwargs_dict)

Returns a copy of kwargs_dict with None values removed

-
-
-
-launch.utils.trim_kwargs(kwargs_dict)#
-

Returns a copy of kwargs_dict with None values removed

-
-
Parameters:
-

kwargs_dict (Dict[Any, Any]) –

-
-
-
- -
-
-
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/api/model_bundles.md b/docs/api/model_bundles.md new file mode 100644 index 00000000..2137635c --- /dev/null +++ b/docs/api/model_bundles.md @@ -0,0 +1,3 @@ +# Model Bundles + +::: launch.model_bundle.ModelBundle diff --git a/docs/api/model_endpoints.md b/docs/api/model_endpoints.md new file mode 100644 index 00000000..2111963a --- /dev/null +++ b/docs/api/model_endpoints.md @@ -0,0 +1,8 @@ +# Model Endpoints + +All classes here are returned by the +[`get_model_endpoint`](/api/client/#launch.client.LaunchClient.get_model_endpoint) +method and provide a `predict` function. + +::: launch.model_endpoint.AsyncEndpoint +::: launch.model_endpoint.SyncEndpoint diff --git a/docs/cli.md b/docs/cli.md new file mode 100644 index 00000000..9de776d9 --- /dev/null +++ b/docs/cli.md @@ -0,0 +1,12 @@ +*Launch* comes with a CLI for listing bundles / endpoints, editing endpoints, +and sending tasks to endpoints. + +The CLI can be used as `scale-launch ...`. + +## Help + +Run `scale-launch --help` for more options. + +```{title="scale-launch --help"} +{! docs/cli_help.txt !} +``` diff --git a/docs/cli_help.txt b/docs/cli_help.txt new file mode 100644 index 00000000..b68edb05 --- /dev/null +++ b/docs/cli_help.txt @@ -0,0 +1,21 @@ + + This is the command line interface (CLI) package for Scale Launch. + + ██╗ █████╗ ██╗ ██╗███╗ ██╗ ██████╗██╗ ██╗ + ██║ ██╔══██╗██║ ██║████╗ ██║██╔════╝██║ ██║ + ██║ ███████║██║ ██║██╔██╗ ██║██║ ███████║ + ██║ ██╔══██║██║ ██║██║╚██╗██║██║ ██╔══██║ + ███████╗██║ ██║╚██████╔╝██║ ╚████║╚██████╗██║ ██║ + ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝ + +Usage: scale-launch [OPTIONS] COMMAND [ARGS]... + +Options: + --help Show this message and exit. + +Commands: + batch-jobs Batch Jobs is a wrapper around batch jobs in Scale Launch + bundles Bundles is a wrapper around model bundles in Scale Launch + config Config is a wrapper around getting and setting your API key and other configuration options + endpoints Endpoints is a wrapper around model endpoints in Scale Launch + tasks Tasks is a wrapper around sending requests to endpoints diff --git a/docs/concepts/batch_jobs.md b/docs/concepts/batch_jobs.md new file mode 100644 index 00000000..b42e60ed --- /dev/null +++ b/docs/concepts/batch_jobs.md @@ -0,0 +1,40 @@ +# Batch Jobs + +For predicting over a larger set of tasks (> 50) at once, it is recommended to +use batch jobs. Batch jobs are a way to send a large number of tasks to a model +bundle. The tasks are processed in parallel, and the results are returned as a +list of predictions. + +Batch jobs are created using the +[`batch_async_request`](/api/client/#launch.client.LaunchClient.batch_async_request) +method of the +[`LaunchClient`](/api/client/#launch.client.LaunchClient). + +```py title="Creating and Following a Batch Job" +import os +import time +from launch import LaunchClient + +client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) +batch_job = client.batch_async_request( + model_bundle="test-bundle", + inputs=[ + {"x": 2, "y": "hello"}, + {"x": 3, "y": "world"}, + ], + labels={ + "team": "MY_TEAM", + "product": "MY_PRODUCT", + } +) + +status = "PENDING" +res = None +while status != "SUCCESS" and status != "FAILURE" and status != "CANCELLED": + time.sleep(30) + res = client.get_batch_async_response(batch_job["job_id"]) + status = res["status"] + print(f"the batch job is {status}") + +print(res) +``` diff --git a/docs/concepts/callbacks.md b/docs/concepts/callbacks.md new file mode 100644 index 00000000..440d6f91 --- /dev/null +++ b/docs/concepts/callbacks.md @@ -0,0 +1,69 @@ +# Callbacks + +Async model endpoints can be configured to send callbacks to a user-defined +callback URL. Callbacks are sent as HTTP POST requests with a JSON body. The +following code snippet shows how to create an async model endpoint with a +callback URL. + +To configure an async endpoint to send callbacks, set the `post_inference_hooks` +field to include +[`launch.PostInferenceHooks.CALLBACK`](/api/hooks/#launch.hooks.PostInferenceHooks). +A callback URL also needs to be specified, and it can be configured as a default +using the `default_callback_url` argument to +[`launch.LaunchClient.create_model_endpoint`](/api/client/#launch.LaunchClient.create_model_endpoint) +or as a per-task override using the `callback_url` field of +[`launch.EndpointRequest`](/api/model_endpoints/#launch.model_predictions.EndpointRequest). + +!!! Note + Callbacks will not be sent if the endpoint does not have any post-inference + hooks specified, even if a `default_callback_url` is provided to the endpoint + creation method or if the prediction request has a `callback_url` override. + + +```py title="Creating an Async Model Endpoint with a Callback URL" hl_lines="16-17 32" +import os +import time +from launch import EndpointRequest, LaunchClient, PostInferenceHooks + +client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) +endpoint = client.create_model_endpoint( + endpoint_name="demo-endpoint-callback", + model_bundle="test-bundle", + cpus=1, + min_workers=1, + endpoint_type="async", + update_if_exists=True, + labels={ + "team": "MY_TEAM", + "product": "MY_PRODUCT", + }, + post_inference_hooks=[PostInferenceHooks.CALLBACK], + default_callback_url="https://example.com", +) + +while endpoint.status() != "READY": + time.sleep(10) + +future_default = endpoint.predict(request=EndpointRequest(args={"x": 2, "y": "hello"})) +""" +A callback is sent to https://example.com with the following JSON body: +{ + "task_id": "THE_TASK_ID", + "result": 7 +} +""" + +future_custom_callback_url = endpoint.predict( + request=EndpointRequest( + args={"x": 3, "y": "hello"}, callback_url="https://example.com/custom" + ), +) + +""" +A callback is sent to https://example.com/custom with the following JSON body: +{ + "task_id": "THE_TASK_ID", + "result": 8 +} +""" +``` diff --git a/docs/concepts/endpoint_predictions.md b/docs/concepts/endpoint_predictions.md new file mode 100644 index 00000000..8baebde9 --- /dev/null +++ b/docs/concepts/endpoint_predictions.md @@ -0,0 +1,32 @@ +# Endpoint Predictions + +Once endpoints have been created, users can send tasks to them to make +predictions. The following code snippet shows how to send tasks to endpoints. + + +=== "Sending a Task to an Async Endpoint" + ```py + import os + from launch import EndpointRequest, LaunchClient + + client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) + endpoint = client.get_model_endpoint("demo-endpoint-async") + future = endpoint.predict(request=EndpointRequest(args={"x": 2, "y": "hello"})) + response = future.get() + print(response) + ``` + +=== "Sending a Task to a Sync Endpoint" + ```py + import os + from launch import EndpointRequest, LaunchClient + + client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) + endpoint = client.get_model_endpoint("demo-endpoint-sync") + response = endpoint.predict(request=EndpointRequest(args={"x": 2, "y": "hello"})) + print(response) + ``` + +::: launch.model_endpoint.EndpointRequest +::: launch.model_endpoint.EndpointResponseFuture +::: launch.model_endpoint.EndpointResponse diff --git a/docs/concepts/model_bundles.md b/docs/concepts/model_bundles.md new file mode 100644 index 00000000..8c868817 --- /dev/null +++ b/docs/concepts/model_bundles.md @@ -0,0 +1,244 @@ +# Model Bundles + +Model Bundles are deployable models that can be used to make predictions. They +are created by packaging a model up into a deployable format. + +## Creating Model Bundles + +There are two methods for creating model bundles: +[`create_model_bundle`](/api/client/#launch.client.LaunchClient.create_model_bundle) +and +[`create_model_bundle_from_dirs`](/api/client/#launch.client.LaunchClient.create_model_bundle_from_dirs). +The former directly pickles a user-specified `load_predict_fn`, a function which +loads the model and returns a `predict_fn`, a function which takes in a request. +The latter takes in directories containing a `load_predict_fn` and the +module path to the `load_predict_fn`. + +=== "Creating a Model Bundle Directly" + ```py + import os + from pydantic import BaseModel + from launch import LaunchClient + + + class MyRequestSchema(BaseModel): + x: int + y: str + + class MyResponseSchema(BaseModel): + __root__: int + + + def my_load_predict_fn(model): + def returns_model_of_x_plus_len_of_y(x: int, y: str) -> int: + """MyRequestSchema -> MyResponseSchema""" + assert isinstance(x, int) and isinstance(y, str) + return model(x) + len(y) + + return returns_model_of_x_plus_len_of_y + + + def my_model(x): + return x * 2 + + ENV_PARAMS = { + "framework_type": "pytorch", + "pytorch_image_tag": "1.7.1-cuda11.0-cudnn8-runtime", + } + + BUNDLE_PARAMS = { + "model_bundle_name": "test-bundle", + "model": my_model, + "load_predict_fn": my_load_predict_fn, + "env_params": ENV_PARAMS, + "requirements": ["pytest==7.2.1", "numpy"], # list your requirements here + "request_schema": MyRequestSchema, + "response_schema": MyResponseSchema, + } + + client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) + client.create_model_bundle(**BUNDLE_PARAMS) + ``` + +=== "Creating a Model Bundle from Directories" + ```py + import os + import tempfile + from pydantic import BaseModel + from launch import LaunchClient + + directory = tempfile.mkdtemp() + model_filename = os.path.join(directory, "model.py") + with open(model_filename, "w") as f: + f.write(""" + def my_load_model_fn(): + def my_model(x): + return x * 2 + + return my_model + """) + + predict_filename = os.path.join(directory, "predict.py") + with open(predict_filename, "w") as f: + f.write(""" + def my_load_predict_fn(model): + def returns_model_of_x_plus_len_of_y(x: int, y: str) -> int: + assert isinstance(x, int) and isinstance(y, str) + return model(x) + len(y) + + return returns_model_of_x_plus_len_of_y + """) + + requirements_filename = os.path.join(directory, "requirements.txt") + with open(predict_filename, "w") as f: + f.write(""" + pytest==7.2.1 + numpy + """ + ) + + """ + The directory structure should now look like + + directory/ + model.py + predict.py + requirements.txt + """ + + + class MyRequestSchema(BaseModel): + x: int + y: str + + class MyResponseSchema(BaseModel): + __root__: int + + ENV_PARAMS = { + "framework_type": "pytorch", + "pytorch_image_tag": "1.7.1-cuda11.0-cudnn8-runtime", + } + + BUNDLE_PARAMS = { + "model_bundle_name": "test-bundle", + "base_paths": [directory], + "requirements_path": "requirements.txt", + "env_params": ENV_PARAMS, + "load_predict_fn": "predict.my_load_predict_fn", + "load_model_fn_module_path": "model.my_load_model_fn", + "request_schema": MyRequestSchema, + "response_schema": MyResponseSchema, + } + + client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) + client.create_model_bundle_from_dirs(**BUNDLE_PARAMS) + + # Clean up files from demo + os.remove(model_filename) + os.remove(predict_filename) + os.rmdir(directory) + ``` + +## Configuring Model Bundles + +The `app_config` field of a model bundle is a dictionary that can be used to +configure the model bundle. If specified, the `app_config` is passed to the +`load_predict_fn` when the model bundle is deployed, alongside the `model`. This +can allow for more code reuse between multiple bundles that perform similar +tasks. + +```py title="Creating Model Bundles with app_config" +import os +from launch import LaunchClient +from pydantic import BaseModel +from typing import List, Union +from typing_extensions import Literal + + +class MyRequestSchemaSingle(BaseModel): + kind: Literal['single'] + x: int + y: str + +class MyRequestSchemaBatched(BaseModel): + kind: Literal['batched'] + x: List[int] + y: List[str] + +class MyRequestSchema(BaseModel): + __root__: Union[MyRequestSchemaSingle, MyRequestSchemaBatched] + +class MyResponseSchema(BaseModel): + __root__: Union[int, List[int]] + + +def my_load_predict_fn(app_config, model): + def returns_model_of_x_plus_len_of_y(x: Union[int, List[int]], y: Union[str, List[str]]) -> Union[int, List[int]]: + """MyRequestSchema -> MyResponseSchema""" + if app_config["mode"] == "single": + assert isinstance(x, int) and isinstance(y, str) + return model(x) + len(y) + + result = [] + for x_i, y_i in zip(x, y): + result.append(model(x_i) + len(y_i)) + return result + + return returns_model_of_x_plus_len_of_y + + +def my_load_model_fn(app_config): + def my_model_single(x: int): + return x * 2 + + def my_model_batched(x: List[int]): + return [my_model_single(x_i) for x_i in x] + + if app_config["mode"] == "single": + return my_model_single + + return my_model_batched + + +ENV_PARAMS = { + "framework_type": "pytorch", + "pytorch_image_tag": "1.7.1-cuda11.0-cudnn8-runtime", +} + +BUNDLE_PARAMS_SINGLE = { + "model_bundle_name": "test-bundle-single", + "load_predict_fn": my_load_predict_fn, + "load_model_fn": my_load_model_fn, + "env_params": ENV_PARAMS, + "requirements": ["pytest==7.2.1", "numpy"], + "request_schema": MyRequestSchema, + "response_schema": MyResponseSchema, + "app_config": {"mode": "single"}, +} +BUNDLE_PARAMS_BATCHED = { + "model_bundle_name": "test-bundle-batched", + "load_predict_fn": my_load_predict_fn, + "load_model_fn": my_load_model_fn, + "env_params": ENV_PARAMS, + "requirements": ["pytest==7.2.1", "numpy"], + "request_schema": MyRequestSchema, + "response_schema": MyResponseSchema, + "app_config": {"mode": "batched"}, +} + +client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) +bundle_single = client.create_model_bundle(**BUNDLE_PARAMS_SINGLE) +bundle_batch = client.create_model_bundle(**BUNDLE_PARAMS_BATCHED) +``` + +## Updating Model Bundles + +Model Bundles are immutable, meaning they cannot be edited once created. +However, it is possible to clone an existing model bundle with a new `app_config` +using +[`clone_model_bundle_with_changes`](/api/client/#launch.client.LaunchClient.clone_model_bundle_with_changes). + +## Listing Model Bundles + +To list all the model bundles you own, use +[`list_model_bundles`](/api/client/#launch.client.LaunchClient.list_model_bundles). diff --git a/docs/concepts/model_endpoints.md b/docs/concepts/model_endpoints.md new file mode 100644 index 00000000..9a34bfaa --- /dev/null +++ b/docs/concepts/model_endpoints.md @@ -0,0 +1,127 @@ +# Model Endpoints + +Model Endpoints are deployments of models that can receive requests and return +predictions containing the results of the model's inference. Each model endpoint +is associated with a model bundle, which contains the model's code. An endpoint +specifies deployment parameters, such as the minimum and maximum number of +workers, as well as the requested resources for each worker, such as the number +of CPUs, amount of memory, GPU count, and type of GPU. + +Endpoints can be asynchronous or synchronous. Asynchronous endpoints return +a future immediately after receiving a request, and the future can be used to +retrieve the prediction once it is ready. Synchronous endpoints return the +prediction directly after receiving a request. + +!!! info + # Choosing the right inference mode + + Here are some tips for how to choose between SyncEndpoint, AsyncEndpoint, and BatchJob for deploying your ModelBundle: + + A SyncEndpoint is good if: + + * You have strict latency requirements (e.g. on the order of seconds or less). + * You are willing to have resources continually allocated. + + An AsyncEndpoint is good if: + + * You want to save on compute costs. + * Your inference code takes a long time to run. + * Your latency requirements are on the order of minutes. + + A BatchJob is good if: + + * You know there is a large batch of inputs ahead of time. + * You want to optimize for throughput instead of latency. + +## Creating Async Model Endpoints + +Async model endpoints are the most cost-efficient way to perform inference on +tasks that are less latency-sensitive. + +```py title="Creating an Async Model Endpoint" +import os +from launch import LaunchClient + +client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) +endpoint = client.create_model_endpoint( + endpoint_name="demo-endpoint-async", + model_bundle="test-bundle", + cpus=1, + min_workers=0, + endpoint_type="async", + update_if_exists=True, + labels={ + "team": "MY_TEAM", + "product": "MY_PRODUCT", + }, +) +``` + +## Creating Sync Model Endpoints + +Sync model endpoints are useful for latency-sensitive tasks, such as real-time +inference. Sync endpoints are more expensive than async endpoints. +!!! Note + Sync model endpoints require at least 1 `min_worker`. + +```py title="Creating a Sync Model Endpoint" +import os +from launch import LaunchClient + +client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) +endpoint = client.create_model_endpoint( + endpoint_name="demo-endpoint-sync", + model_bundle="test-bundle", + cpus=1, + min_workers=1, + endpoint_type="sync", + update_if_exists=True, + labels={ + "team": "MY_TEAM", + "product": "MY_PRODUCT", + }, +) +``` + +## Managing Model Endpoints + +Model endpoints can be listed, updated, and deleted using the Launch API. + +```py title="Listing Model Endpoints" +import os +from launch import LaunchClient + +client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) +endpoints = client.list_model_endpoints() +``` + +```py title="Updating a Model Endpoint" +import os +from launch import LaunchClient + +client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) +client.edit_model_endpoint( + model_endpoint="demo-endpoint", + max_workers=2, +) +``` + +```py title="Deleting a Model Endpoint" +import os +from launch import LaunchClient + +client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) +endpoint = client.create_model_endpoint( + endpoint_name="demo-endpoint-tmp", + model_bundle="test-bundle", + cpus=1, + min_workers=0, + endpoint_type="async", + update_if_exists=True, + labels={ + "team": "MY_TEAM", + "product": "MY_PRODUCT", + }, +) +client.delete_model_endpoint(model_endpoint="demo-endpoint-tmp") +``` diff --git a/docs/concepts/overview.md b/docs/concepts/overview.md new file mode 100644 index 00000000..d52f5b6d --- /dev/null +++ b/docs/concepts/overview.md @@ -0,0 +1,14 @@ +# Overview + +Creating deployments on Launch generally involves three steps: + +1. Create and upload a [`ModelBundle`](../model_bundles). Pass your trained model + as well as pre-/post-processing code to the Scale Launch Python client, and + we’ll create a model bundle based on the code and store it in our Bundle Store. + +2. Create a [`ModelEndpoint`](../model_endpoints). Pass a ModelBundle as well as + infrastructure settings such as the desired number of GPUs to our client. + This provisions resources on Scale’s cluster dedicated to your ModelEndpoint. + +3. Make requests to the ModelEndpoint. You can make requests through the Python + client, or make HTTP requests directly to Scale. diff --git a/docs/genindex.html b/docs/genindex.html deleted file mode 100644 index a9ae456c..00000000 --- a/docs/genindex.html +++ /dev/null @@ -1,1627 +0,0 @@ - - - - - - - Index - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
-
- -
- -
-
- -
-

Index

-
Symbols | A | B | C | D | E | F | G | I | J | L | M | N | O | P | R | S | T | U | V | W | Z
-
-
-

Symbols

- - - -
-
- -
-

A

- - - -
-
- -
-

B

- - - -
-
- -
-

C

- - - -
-
- -
-

D

- - - -
-
- -
-

E

- - - -
-
- -
-

F

- - - -
-
- -
-

G

- - - -
-
- -
-

I

- - - -
-
- -
-

J

- - - -
-
- -
-

L

- - - -
    -
  • - launch - -
  • -
  • - launch.cli - -
  • -
  • - launch.cli.bin - -
  • -
  • - launch.cli.bundles - -
  • -
  • - launch.cli.client - -
  • -
  • - launch.cli.endpoints - -
  • -
  • - launch.client - -
  • -
  • - launch.clientlib - -
  • -
  • - launch.clientlib.batching - -
  • -
  • - launch.clientlib.batching.implementation - -
  • -
  • - launch.clientlib.batching.named_arrays - -
  • -
  • - launch.clientlib.batching.single_array - -
  • -
  • - launch.clientlib.batching.types - -
  • -
  • - launch.clientlib.core - -
  • -
  • - launch.clientlib.demonstration - -
  • -
  • - launch.clientlib.deployment - -
  • -
  • - launch.clientlib.exe - -
  • -
  • - launch.clientlib.exe.run_service - -
  • -
  • - launch.clientlib.full_service - -
  • -
  • - launch.clientlib.http - -
  • -
  • - launch.clientlib.loader - -
  • -
  • - launch.clientlib.model - -
  • -
  • - launch.clientlib.model_service - -
  • -
  • - launch.clientlib.model_service.implementation - -
  • -
  • - launch.clientlib.model_service.named_arrays - -
  • -
  • - launch.clientlib.model_service.single_array - -
  • -
  • - launch.clientlib.model_service.types - -
  • -
  • - launch.clientlib.object_conf_from_std_ml_serve - -
  • -
  • - launch.clientlib.pipeline - -
  • -
-
- -
-

M

- - -
-
- -
-

N

- - - -
-
- -
-

O

- - -
-
- -
-

P

- - - -
-
- -
-

R

- - - -
-
- -
-

S

- - - -
-
- -
-

T

- - - -
-
- -
-

U

- - -
-
- -
-

V

- - -
-
- -
-

W

- - -
-
- -
-

Z

- - -
-
- - -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/guides/deploying_your_code.html b/docs/guides/deploying_your_code.html deleted file mode 100644 index 548794c8..00000000 --- a/docs/guides/deploying_your_code.html +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - - - - Deploying your code - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

Deploying your code#

-

Endpoints guide

-
- -
-
- -
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/guides/getting_started.html b/docs/guides/getting_started.html deleted file mode 100644 index c1eac138..00000000 --- a/docs/guides/getting_started.html +++ /dev/null @@ -1,371 +0,0 @@ - - - - - - - - - Introduction to Scale Launch - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

Introduction to Scale Launch#

-

Launch has three core concepts:

-
    -
  • ModelBundle

  • -
  • ModelEndpoint

  • -
  • BatchJob

  • -
-

ModelBundle represents your model & code, and is what you’re deploying; -ModelEndpoint and BatchJob represent the means of how to deploy it.

-
-

ModelBundle#

-

A ModelBundle consists of a trained model as well as the surrounding preprocessing and postprocessing code. -Specifically, a ModelBundle consists of two Python objects, a load_predict_fn, and either a model or load_model_fn; such that

-
-

load_predict_fn(model)

-
-

or

-
-

load_predict_fn(load_model_fn())

-
-

returns a function predict_fn that takes in one argument representing model input, -and outputs one argument representing model output.

-

Typically, a model would be a Pytorch nn.Module or Tensorflow model, but can also be any arbitrary Python code.

-../_images/model_bundle.png -
-
-

ModelEndpoint#

-

A ModelEndpoint is a deployment of a ModelBundle that serves inference requests. -To create a ModelEndpoint, the user must specify various infrastructure-level details, -such as the min & max workers; and the amount of CPU, memory, and GPU resources per worker. A ModelEndpoint -automatically scales the number of workers based on the amount of traffic.

-../_images/model_endpoint.png -

There are two types of ModelEndpoint:

-

A SyncEndpoint takes in requests and immediately returns the response in a blocking manner. -A SyncEndpoint must always have at least 1 worker.

-

An AsyncEndpoint takes in requests and returns an asynchronous response token. The user can later query to monitor -the status of the request. Asynchronous endpoints can scale up from zero, -which make them a cost effective choice for services that are not latency sensitive.

-
-
-

BatchJob#

-

A BatchJob takes in a ModelBundle and a list of inputs -to predict on. Once a batch job completes, it cannot be restarted or accept additional requests. -Launch maintains metadata about batch jobs for users to query, even after batch jobs are complete.

-
-
-

Choosing the right inference mode#

-

Here are some tips for how to choose between SyncEndpoint, AsyncEndpoint, and BatchJob for deploying your -ModelBundle:

-

A SyncEndpoint is good if:

-
    -
  • You have strict latency requirements (e.g. on the order of seconds or less).

  • -
  • You are willing to have resources continually allocated.

  • -
-

An AsyncEndpoint is good if:

-
    -
  • You want to save on compute costs.

  • -
  • Your inference code takes a long time to run.

  • -
  • Your latency requirements are on the order of minutes.

  • -
-

A BatchJob is good if:

-
    -
  • You know there is a large batch of inputs ahead of time.

  • -
  • You want to optimize for throughput instead of latency.

  • -
-
-
-

Overview of deployment steps#

-

1. Create and upload a ModelBundle. Pass your trained model as well as pre-/post-processing code to -the Scale Launch Python client, and we’ll create a model bundle based on the code and store it in our Bundle Store.

-

2. Create a ModelEndpoint. Pass a ModelBundle as well as infrastructure settings such as #GPUs to our client. -This provisions resources on Scale’s cluster dedicated to your ModelEndpoint.

-

3. Make requests to the ModelEndpoint. You can make requests through the Python client, or make HTTP requests directly -to Scale.

-

See the Guides section for more detailed instructions.

-../_images/request_lifecycle.png -
-
- -
-
- -
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/guides/index.html b/docs/guides/index.html deleted file mode 100644 index 23ea9b41..00000000 --- a/docs/guides/index.html +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - - - - How-to guides - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- - -
- - - - - - - \ No newline at end of file diff --git a/docs/guides/integrations.html b/docs/guides/integrations.html deleted file mode 100644 index 5ae93a41..00000000 --- a/docs/guides/integrations.html +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - - - - Integrations - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

Integrations#

-
-

Integration with Scale Train#

-

TODO

-
-
-

Integration with Scale Insight#

-

TODO

-
-
-

Integration with Scale Nucleus#

-

TODO - link to Nucleus docs

-
-
- -
-
- -
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/guides/registering_your_code.html b/docs/guides/registering_your_code.html deleted file mode 100644 index 8bab19e4..00000000 --- a/docs/guides/registering_your_code.html +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - - - - Registering your code - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

Registering your code#

-

Bundles guide

-
- -
-
- -
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/guides/troubleshooting.html b/docs/guides/troubleshooting.html deleted file mode 100644 index e2941e75..00000000 --- a/docs/guides/troubleshooting.html +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - Troubleshooting - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

Troubleshooting#

-
-

Bundles#

-

Test

-
-
-

Endpoints#

-

Test

-
-
-

Batch jobs#

-

Test

-
-
- -
-
- -
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index aa964096..00000000 --- a/docs/index.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - - - - - - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
- -
- -
- -
-
-
-

Welcome to the Launch API Reference!#

-

Scale Launch provides ML engineers a simple Python interface for turning a local code snippet into a production service.

-
-

Installation#

-

To use Scale Launch, first install it using pip:

-
(venv) $ pip install git+https://github.com/scaleapi/launch-python-client.git
-
-
-

Note that launch-python-client is a private library and can only be installed directly from the repository.

-
-
-

Sections#

- -
-
-

Index#

- -
-
- -
-
- -
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..5caa8eeb --- /dev/null +++ b/docs/index.md @@ -0,0 +1,125 @@ +# Scale Launch + +[![CI](https://circleci.com/gh/scaleapi/launch-python-client.svg?style=svg&circle-token=eda1331496e2d7cbda8fb1787c610f02e8f9667a)](https://circleci.com/gh/scaleapi/launch-python-client) +[![pypi](https://img.shields.io/pypi/v/scale-launch.svg)](https://pypi.python.org/pypi/scale-launch) + +Simple, scalable, and high performance ML service deployment in python. + +## Example + +```py title="Launch Usage" +import os +import time +from launch import LaunchClient +from launch import EndpointRequest +from pydantic import BaseModel +from rich import print + + +class MyRequestSchema(BaseModel): + x: int + y: str + +class MyResponseSchema(BaseModel): + __root__: int + + +def my_load_predict_fn(model): + def returns_model_of_x_plus_len_of_y(x: int, y: str) -> int: + """MyRequestSchema -> MyResponseSchema""" + assert isinstance(x, int) and isinstance(y, str) + return model(x) + len(y) + + return returns_model_of_x_plus_len_of_y + + +def my_model(x): + return x * 2 + +ENV_PARAMS = { + "framework_type": "pytorch", + "pytorch_image_tag": "1.7.1-cuda11.0-cudnn8-runtime", +} + +BUNDLE_PARAMS = { + "model_bundle_name": "test-bundle", + "model": my_model, + "load_predict_fn": my_load_predict_fn, + "env_params": ENV_PARAMS, + "requirements": ["pytest==7.2.1", "numpy"], # list your requirements here + "request_schema": MyRequestSchema, + "response_schema": MyResponseSchema, +} + +ENDPOINT_PARAMS = { + "endpoint_name": "demo-endpoint", + "model_bundle": "test-bundle", + "cpus": 1, + "min_workers": 0, + "endpoint_type": "async", + "update_if_exists": True, + "labels": { + "team": "MY_TEAM", + "product": "launch", + } +} + +def predict_on_endpoint(request: MyRequestSchema) -> MyResponseSchema: + # Wait for the endpoint to be ready first before submitting a task + endpoint = client.get_model_endpoint(endpoint_name="demo-endpoint") + while endpoint.status() != "READY": + time.sleep(10) + + endpoint_request = EndpointRequest(args=request.dict(), return_pickled=False) + + future = endpoint.predict(request=endpoint_request) + raw_response = future.get() + + response = MyResponseSchema.parse_raw(raw_response.result) + return response + + +client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY")) + +client.create_model_bundle(**BUNDLE_PARAMS) +endpoint = client.create_model_endpoint(**ENDPOINT_PARAMS) + +request = MyRequestSchema(x=5, y="hello") +response = predict_on_endpoint(request) +print(response) +""" +MyResponseSchema(__root__=10) +""" +``` + +What's going on here: + +* First we use [`pydantic`](https://github.com/pydantic/pydantic) to define our request and response + schemas, `MyRequestSchema` and `MyResponseSchema`. These schemas are used to generate the API + documentation for our models. +* Next we define the the `model` and the `load_predict_fn`, which tells Launch + how to load our model and how to make predictions with it. In this case, + we're just returning a function that adds the length of the string `y` to + `model(x)`, where `model` doubles the integer `x`. +* We then define the model bundle by specifying the `load_predict_fn`, the `request_schema`, and the + `response_schema`. We also specify the `env_params`, which tell Launch environment settings like + the base image to use. In this case, we're using a PyTorch image. +* Next, we create the model endpoint, which is the API that we'll use to make predictions. We + specify the `model_bundle` that we created above, and we specify the `endpoint_type`, which tells + Launch whether to use a synchronous or asynchronous endpoint. In this case, we're using an + asynchronous endpoint, which means that we can make predictions and return immediately with a + `future` object. We can then use the `future` object to get the prediction result later. +* Finally, we make a prediction by calling `predict_on_endpoint` with a `MyRequestSchema` object. + This function first waits for the endpoint to be ready, then it submits a prediction request to + the endpoint. It then waits for the prediction result and returns it. + +Notice that we specified `min_workers=0`, meaning that the endpoint will scale down to 0 workers +when it's not being used. + +## Installation + +To use Scale Launch, first install it using `pip`: + +```commandline title="Installation" +pip install -U scale-launch +``` diff --git a/docs/objects.inv b/docs/objects.inv deleted file mode 100644 index ea02f687ebc16b1600c11fb298b1f23cd01c8be9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3364 zcmV+<4cqb~AX9K?X>NERX>N99Zgg*Qc_4OWa&u{KZXhxWBOp+6Z)#;@bUGkRVRdd} zXbK}BR%LQ?X>V>iAPOTORA^-&a%F8{X>Md?av*PJAarPHb0B7EY-J#6b0A}HZE$jB zb8}^6Aa!$TZf78RY-wUH3V7PRolBFWI1nKLk4uqOjN;!hDYM^L^YL$4 zp3>LoEHCVz?d9FS@D8;Xqxa&PC!g}PEV5kIgoF_x@H+#*bZ1m@nr2BuxKMd6(#44Q zK;-SqECg{Xii#&R7F5bCKZ!LkA&IP35nc-ZOnHdPe5ft+gNm}q1zrBIMwsYCWz27X z1gl(>i8w8C8jM#KjK%bJ$+Mb&7I{t+nH9O0&F;5F7xGM%k^Wav;n~EyZ}a1RGq?ix zdlx+M>CJytvf?2Sb%XJ}KOis!J zkL9&ohpOF%jMEFfjTK&?{n7>3e)W25A8?hlU%N=!2U{a0EHkZr)g}A-R~3j3S#G;u zT?R2!pOgF=_Yd}{E;fDVor5?<4dygcmD(bJYPAK2OiQ)qR0HnjSKZx$5YWbh2}*3{ z_CQ}f>6b62htigCKa;VWVSx38Jb2w>8M;{JudG!tqDPeu1#Ojwo1m{3?NOQ z_Ba5G;yKNZfi01}sU8bvZ}!6Fv%d~}F&%>KURtkHaV?^}=^o4Ob?o3Z_gIp9v*8Q$ zMQESp`XYf%9w&S$?~R5p?AM^3%Y1M6f<^xVjU`(ED`dbM0?Rc#w+EIBd2AM}7jbPJ z02Ekuu)7$l0L05s#iEZ?)$2;rJ>|c$gj#)#3D&}^*S_D&x@Cyf#J?)WLe=iyqR2m! z`U&tLtWfp(L64NvJfZ2`ew#p}gfM1rdN6e3=!G(6_X;T(ugYb1p`keS1_qbwtrn`a z>`R)6C!Wb7Z}y$m1N#k{0GNI+Zl$qW*e}AW0JNv#kr%Q!RL3X!y1r|LH2#3~XOSPX zQy}6K%|)@kFEz7bmY>`+PFE5-^>pQ<>{7C3yR_d-h6;^t^wzB#Y8n&H$yIo$4sY|; z6zV@}{%`K~&>Y_8ty%AA`+UKs{4$lOIhR2Wj6w%Hvnp5)Fk^VCC|8rZ4OW+enyD@e zo|mRzClNYB!NJhS2O_5QqNaDrf&F__9BSZnnaj&YIJ-7j?b5t%mTx3{!iGr{9Y0`rT`T3&Qg}{$5NMqK8|`R z+uFm1lO{4w)Z(vwGbCghUs?*FGg)tkn%fGAzBgCv)v40};M%OJMnw3@cDClt z>(kgIcAP?b`&u<_bd>;B25(fOvNluw@Zy(q!QR4HWmZy_<$#XVm4x;g@O0-n(RE{w z&&D^@6Lcn~sW(|7r(a*LB?=%3%l5n$9lSYj0Z zWb8v-DM&Bs%7U`8nejlbD~CWZ0eeQb^)ld02J5Bli4NBDfq4*C3qdl;g%yG2nG3Ax z$U+xb4VI&BiRcDH!Q1qn4Li4(h><=XIqbXCSqXrvur8wmd1;HyFMw>s}TVwy&KR#Ut$T z_R&Ww5}uWo!(m`{bI|;DhA|x09qQGSppjl0wnqzchIsY(W-CtgCXa`WUVk_VYLpwf zKQ6kC#_x^ZYTsKqpmA@dpi=@8O zngJA#6Nw^Qa!MO?mc$azlVT!E)=CR|mb3`Za$_QUDn$!imvj;9@;V}2YF7(bi$jK7 zOlFSpo6o;BB!Puh2$uc=Lvw8)Kq3#1`T#0`d~<8S zHgaYvaMEXK4X`0y0&?X7a7s<{24H=lHCh;~57T$Y`(v*(0|=VUz_)tP`k+O*1w3m5 zo=4635YVD51fKN-Ppjt43CJ&q-?M`5Syq#504GDifP!LztwJPkTVh7eo>a~7qGM?t^H9%pKRnj%uMF31(>&zl<1(-Wz9c)k@) ze@(>znca>ICsz&k&kncZ(V1A}I=pJYnh&~S{fSv*J=tec(H{ZCniGb|@e<6cpm|@0 zweRE*ryfe zwc~wY1lXN5C|Ngiv2kx0Id*Q1YKBc-tlcX{`i)ov++?fPL?@cxZ|*m4yHDF29_oLh zQ}?x-efIcTR6K6t!3VU9F)u*OX@2ujB8J}!n8M=ifM4+!v30E`3s1>%KwIlPsz5b|{Yv}({t&(J*FnY59 diff --git a/docs/plugins.py b/docs/plugins.py new file mode 100644 index 00000000..aa67a03e --- /dev/null +++ b/docs/plugins.py @@ -0,0 +1,58 @@ +import logging +import os +import re + +from mkdocs.config import Config +from mkdocs.structure.files import Files +from mkdocs.structure.pages import Page + +logger = logging.getLogger("mkdocs.plugin") + + +def on_pre_build(config: Config): + """ + Not doing anything here anymore. + """ + pass + + +def on_files(files: Files, config: Config) -> Files: + return remove_files(files) + + +def remove_files(files: Files) -> Files: + to_remove = [] + for file in files: + if file.src_path in {"plugins.py", "cli_help.txt"}: + to_remove.append(file) + elif file.src_path.startswith("__pycache__/"): + to_remove.append(file) + + logger.debug("removing files: %s", [f.src_path for f in to_remove]) + for f in to_remove: + files.remove(f) + + return files + + +def on_page_markdown(markdown: str, page: Page, config: Config, files: Files) -> str: + return reinstate_code_titles(markdown) + + +def reinstate_code_titles(markdown: str) -> str: + """ + Fix titles in code blocks, see https://youtrack.jetbrains.com/issue/PY-53246. + """ + return re.sub(r"^(```py)\s*\ntitle=", r"\1 title=", markdown, flags=re.M) + + +def add_version(markdown: str, page: Page) -> str: + if page.abs_url == "/": + version_ref = os.getenv("GITHUB_REF") + if version_ref: + version = re.sub("^refs/tags/", "", version_ref.lower()) + version_str = f"Documentation for version: **{version}**" + else: + version_str = "Documentation for development version" + markdown = re.sub(r"{{ *version *}}", version_str, markdown) + return markdown diff --git a/docs/py-modindex.html b/docs/py-modindex.html deleted file mode 100644 index e9cedc4a..00000000 --- a/docs/py-modindex.html +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - - Python Module Index - Launch API Reference - - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
-
- -
- -
-
- -
-

Python Module Index

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
l
- launch -
    - launch.cli -
    - launch.cli.bin -
    - launch.cli.bundles -
    - launch.cli.client -
    - launch.cli.endpoints -
    - launch.client -
    - launch.clientlib -
    - launch.clientlib.batching -
    - launch.clientlib.batching.implementation -
    - launch.clientlib.batching.named_arrays -
    - launch.clientlib.batching.single_array -
    - launch.clientlib.batching.types -
    - launch.clientlib.core -
    - launch.clientlib.demonstration -
    - launch.clientlib.deployment -
    - launch.clientlib.exe -
    - launch.clientlib.exe.run_service -
    - launch.clientlib.full_service -
    - launch.clientlib.http -
    - launch.clientlib.loader -
    - launch.clientlib.model -
    - launch.clientlib.model_service -
    - launch.clientlib.model_service.implementation -
    - launch.clientlib.model_service.named_arrays -
    - launch.clientlib.model_service.single_array -
    - launch.clientlib.model_service.types -
    - launch.clientlib.object_conf_from_std_ml_serve -
    - launch.clientlib.pipeline -
    - launch.clientlib.service -
    - launch.clientlib.triton -
    - launch.clientlib.types -
    - launch.clientlib.utils -
    - launch.connection -
    - launch.constants -
    - launch.errors -
    - launch.find_packages -
    - launch.hooks -
    - launch.logger -
    - launch.make_batch_file -
    - launch.model_bundle -
    - launch.model_endpoint -
    - launch.pipeline -
    - launch.pipeline.deployment -
    - launch.pipeline.runtime -
    - launch.pipeline.service -
    - launch.pipeline.utils -
    - launch.request_validation -
    - launch.retry_strategy -
    - launch.utils -
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/search.html b/docs/search.html deleted file mode 100644 index b33101d8..00000000 --- a/docs/search.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - Search - Launch API Reference - - - - - - - - - - - - - - - - - Contents - - - - - - Menu - - - - - - - - Expand - - - - - - Light mode - - - - - - - - - - - - - - Dark mode - - - - - - - Auto light/dark mode - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - Back to top - -
-
- -
- -
-
- - - -
- -
-
-
- - -
-
- - Made with Sphinx and @pradyunsg's - - Furo - -
-
-
- -
-
-
- -
-
- -
-
- - - - - - - - - - \ No newline at end of file diff --git a/docs/searchindex.js b/docs/searchindex.js deleted file mode 100644 index 65aac04f..00000000 --- a/docs/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({"docnames": ["api/launch/cli/bin/index", "api/launch/cli/bundles/index", "api/launch/cli/client/index", "api/launch/cli/endpoints/index", "api/launch/cli/index", "api/launch/client/index", "api/launch/clientlib/batching/implementation/index", "api/launch/clientlib/batching/index", "api/launch/clientlib/batching/named_arrays/index", "api/launch/clientlib/batching/single_array/index", "api/launch/clientlib/batching/types/index", "api/launch/clientlib/core/index", "api/launch/clientlib/demonstration/index", "api/launch/clientlib/deployment/index", "api/launch/clientlib/exe/index", "api/launch/clientlib/exe/run_service/index", "api/launch/clientlib/full_service/index", "api/launch/clientlib/http/index", "api/launch/clientlib/index", "api/launch/clientlib/loader/index", "api/launch/clientlib/model/index", "api/launch/clientlib/model_service/implementation/index", "api/launch/clientlib/model_service/index", "api/launch/clientlib/model_service/named_arrays/index", "api/launch/clientlib/model_service/single_array/index", "api/launch/clientlib/model_service/types/index", "api/launch/clientlib/object_conf_from_std_ml_serve/index", "api/launch/clientlib/pipeline/index", "api/launch/clientlib/service/index", "api/launch/clientlib/triton/index", "api/launch/clientlib/types/index", "api/launch/clientlib/utils/index", "api/launch/connection/index", "api/launch/constants/index", "api/launch/errors/index", "api/launch/find_packages/index", "api/launch/hooks/index", "api/launch/index", "api/launch/logger/index", "api/launch/make_batch_file/index", "api/launch/model_bundle/index", "api/launch/model_endpoint/index", "api/launch/pipeline/deployment/index", "api/launch/pipeline/index", "api/launch/pipeline/runtime/index", "api/launch/pipeline/service/index", "api/launch/pipeline/utils/index", "api/launch/request_validation/index", "api/launch/retry_strategy/index", "api/launch/utils/index", "guides/deploying_your_code", "guides/getting_started", "guides/index", "guides/integrations", "guides/registering_your_code", "guides/troubleshooting", "index"], "filenames": ["api/launch/cli/bin/index.rst", "api/launch/cli/bundles/index.rst", "api/launch/cli/client/index.rst", "api/launch/cli/endpoints/index.rst", "api/launch/cli/index.rst", "api/launch/client/index.rst", "api/launch/clientlib/batching/implementation/index.rst", "api/launch/clientlib/batching/index.rst", "api/launch/clientlib/batching/named_arrays/index.rst", "api/launch/clientlib/batching/single_array/index.rst", "api/launch/clientlib/batching/types/index.rst", "api/launch/clientlib/core/index.rst", "api/launch/clientlib/demonstration/index.rst", "api/launch/clientlib/deployment/index.rst", "api/launch/clientlib/exe/index.rst", "api/launch/clientlib/exe/run_service/index.rst", "api/launch/clientlib/full_service/index.rst", "api/launch/clientlib/http/index.rst", "api/launch/clientlib/index.rst", "api/launch/clientlib/loader/index.rst", "api/launch/clientlib/model/index.rst", "api/launch/clientlib/model_service/implementation/index.rst", "api/launch/clientlib/model_service/index.rst", "api/launch/clientlib/model_service/named_arrays/index.rst", "api/launch/clientlib/model_service/single_array/index.rst", "api/launch/clientlib/model_service/types/index.rst", "api/launch/clientlib/object_conf_from_std_ml_serve/index.rst", "api/launch/clientlib/pipeline/index.rst", "api/launch/clientlib/service/index.rst", "api/launch/clientlib/triton/index.rst", "api/launch/clientlib/types/index.rst", "api/launch/clientlib/utils/index.rst", "api/launch/connection/index.rst", "api/launch/constants/index.rst", "api/launch/errors/index.rst", "api/launch/find_packages/index.rst", "api/launch/hooks/index.rst", "api/launch/index.rst", "api/launch/logger/index.rst", "api/launch/make_batch_file/index.rst", "api/launch/model_bundle/index.rst", "api/launch/model_endpoint/index.rst", "api/launch/pipeline/deployment/index.rst", "api/launch/pipeline/index.rst", "api/launch/pipeline/runtime/index.rst", "api/launch/pipeline/service/index.rst", "api/launch/pipeline/utils/index.rst", "api/launch/request_validation/index.rst", "api/launch/retry_strategy/index.rst", "api/launch/utils/index.rst", "guides/deploying_your_code.rst", "guides/getting_started.rst", "guides/index.rst", "guides/integrations.rst", "guides/registering_your_code.rst", "guides/troubleshooting.rst", "index.rst"], "titles": ["launch.cli.bin", "launch.cli.bundles", "launch.cli.client", "launch.cli.endpoints", "launch.cli", "launch.client", "launch.clientlib.batching.implementation", "launch.clientlib.batching", "launch.clientlib.batching.named_arrays", "launch.clientlib.batching.single_array", "launch.clientlib.batching.types", "launch.clientlib.core", "launch.clientlib.demonstration", "launch.clientlib.deployment", "launch.clientlib.exe", "launch.clientlib.exe.run_service", "launch.clientlib.full_service", "launch.clientlib.http", "launch.clientlib", "launch.clientlib.loader", "launch.clientlib.model", "launch.clientlib.model_service.implementation", "launch.clientlib.model_service", "launch.clientlib.model_service.named_arrays", "launch.clientlib.model_service.single_array", "launch.clientlib.model_service.types", "launch.clientlib.object_conf_from_std_ml_serve", "launch.clientlib.pipeline", "launch.clientlib.service", "launch.clientlib.triton", "launch.clientlib.types", "launch.clientlib.utils", "launch.connection", "launch.constants", "launch.errors", "launch.find_packages", "launch.hooks", "launch", "launch.logger", "launch.make_batch_file", "launch.model_bundle", "launch.model_endpoint", "launch.pipeline.deployment", "launch.pipeline", "launch.pipeline.runtime", "launch.pipeline.service", "launch.pipeline.utils", "launch.request_validation", "launch.retry_strategy", "launch.utils", "Deploying your code", "Introduction to Scale Launch", "How-to guides", "Integrations", "Registering your code", "Troubleshooting", "Welcome to the Launch API Reference!"], "terms": {"entry_point": 0, "ctx": [0, 1, 3], "kwarg": [0, 36, 43, 45, 46], "thi": [0, 4, 5, 10, 16, 18, 19, 25, 26, 35, 36, 37, 40, 41, 43, 44, 51, 56], "command": [0, 4, 34, 56], "line": [0, 4, 36, 56], "interfac": [0, 4, 10, 37, 56], "packag": [0, 4, 5, 35, 40, 56], "scale": [0, 1, 3, 4, 5, 37, 41, 52, 56], "wrapper": [1, 3, 4, 5, 32, 37], "around": [1, 3, 4, 5, 37], "model": [1, 3, 4, 5, 10, 18, 37, 41, 51], "paramet": [1, 3, 4, 5, 18, 26, 32, 35, 37, 41, 43, 45, 46, 49], "click": [1, 3], "context": [1, 3], "delete_bundl": 1, "bundle_nam": [1, 4, 5, 37, 41], "delet": [1, 3, 5, 32, 36, 37], "str": [1, 3, 5, 26, 32, 35, 36, 37, 40, 41, 43, 45, 46], "get_bundl": 1, "print": [1, 4], "info": [1, 4], "list_bundl": 1, "list": [1, 3, 5, 35, 36, 37, 40, 41, 43, 45, 46, 51], "all": [1, 3, 4, 5, 11, 18, 34, 36, 37, 40, 41], "your": [1, 3, 4, 5, 37, 51, 52, 56], "delete_endpoint": 3, "endpoint_nam": [3, 4, 5, 37, 41], "list_endpoint": 3, "read_endpoint_creation_log": [3, 5, 37], "read": [3, 4, 37, 41], "creation": [3, 5, 37], "log": [3, 5, 32, 37], "an": [3, 4, 5, 11, 13, 18, 26, 36, 37, 40, 41, 51], "option": [4, 5, 18, 26, 36, 37, 40, 41], "arg": [4, 5, 26, 36, 37, 41], "s": [4, 5, 10, 18, 20, 26, 28, 35, 36, 37, 41, 51], "self": [4, 5, 10, 16, 19, 25, 26, 34, 36, 37, 41], "host": [4, 5, 37], "us": [4, 5, 10, 11, 13, 16, 18, 19, 25, 26, 28, 36, 37, 40, 41, 56], "flag": 4, "e": [4, 5, 37, 41, 51], "gatewai": 4, "gateway_endpoint": 4, "redefin": 4, "mandatori": 4, "when": [4, 5, 36, 37, 41], "api": [4, 5, 37, 40], "kei": [4, 5, 10, 16, 19, 25, 26, 37, 41], "api_kei": [4, 5, 32, 37], "requir": [4, 5, 37, 40, 51], "environ": [4, 5, 26, 37, 40], "variabl": [4, 10, 16, 19, 25, 26], "launch_gateway_endpoint": 4, "provid": [4, 5, 10, 11, 13, 18, 37, 41, 56], "default": [4, 10, 16, 18, 19, 25, 26, 28, 36], "launch_api_kei": 4, "argument": [4, 5, 26, 36, 37, 41, 51], "launchclient": [5, 37, 40, 41, 56], "endpoint": [5, 32, 34, 37, 41, 50, 51, 52, 56], "none": [5, 11, 18, 26, 32, 34, 36, 37, 41, 49], "self_host": [5, 37], "fals": [5, 26, 36, 37], "python": [5, 26, 35, 36, 37, 40, 41, 51, 56], "initi": [5, 34, 36, 37], "The": [5, 10, 11, 18, 26, 28, 36, 37, 40, 41, 43, 44, 45, 51], "should": [5, 37, 41], "need": [5, 37, 41], "chang": [5, 37], "bool": [5, 26, 36, 37, 41], "true": [5, 26, 36, 37, 41], "iff": [5, 37], "you": [5, 37, 41, 51], "ar": [5, 10, 18, 36, 37, 41, 51], "connect": [5, 37, 56], "async_request": [5, 37], "url": [5, 37, 41], "return_pickl": [5, 37, 41], "Not": [5, 37], "recommend": [5, 37], "instead": [5, 36, 37, 41, 51], "we": [5, 18, 28, 37, 51], "function": [5, 10, 37, 41, 47, 51], "asyncendpoint": [5, 37, 41, 51, 56], "make": [5, 32, 36, 37, 51], "request": [5, 10, 11, 18, 25, 32, 37, 41, 51], "async": [5, 37, 41], "endpoint_id": [5, 37], "immedi": [5, 37, 51], "return": [5, 10, 11, 16, 18, 19, 25, 26, 32, 34, 36, 37, 41, 43, 46, 49, 51], "can": [5, 10, 11, 16, 18, 19, 25, 26, 36, 37, 40, 41, 51, 56], "retriev": [5, 37, 41], "result": [5, 18, 36, 37, 41], "infer": [5, 10, 18, 20, 37, 41, 52, 56], "later": [5, 37, 51], "time": [5, 37, 51], "name": [5, 18, 26, 36, 37, 40, 41, 43, 44], "A": [5, 10, 16, 18, 19, 20, 25, 26, 36, 37, 40, 41, 51], "point": [5, 36, 37], "file": [5, 35, 37, 41], "contain": [5, 36, 37, 41, 47], "input": [5, 10, 18, 20, 28, 37, 41, 51], "must": [5, 11, 18, 26, 36, 37, 40, 41, 51], "access": [5, 37], "henc": [5, 37], "either": [5, 37, 41, 51], "public": [5, 37], "signedurl": [5, 37], "note": [5, 10, 18, 25, 37, 41, 56], "locat": [5, 37, 40, 41], "open": [5, 37, 41], "sequenc": [5, 37, 41], "byte": [5, 37, 41], "pass": [5, 18, 20, 26, 37, 41, 51], "predict": [5, 10, 37, 41, 51], "If": [5, 18, 26, 36, 37, 41], "want": [5, 37, 41, 51], "itself": [5, 36, 37, 41], "see": [5, 34, 36, 37, 40, 41, 51], "exactli": [5, 37, 41], "one": [5, 10, 16, 19, 25, 26, 36, 37, 41, 51], "specifi": [5, 36, 37, 41, 51], "dict": [5, 32, 37, 40, 41, 43, 45, 46, 49], "dictionari": [5, 26, 36, 37, 40, 41], "modelbundl": [5, 37, 40, 41, 52, 56], "json": [5, 18, 28, 32, 37, 41], "serializ": [5, 37], "i": [5, 18, 28, 37, 41], "compos": [5, 37], "int": [5, 36, 37], "float": [5, 37], "etc": [5, 10, 16, 19, 25, 26, 37, 41], "ha": [5, 37, 41, 51], "signatur": [5, 34, 36, 37, 41], "foo": [5, 37, 41], "bar": [5, 37, 41], "whether": [5, 36, 37, 41], "object": [5, 10, 36, 37, 41, 51], "pickl": [5, 37, 41], "directli": [5, 26, 37, 41, 51, 56], "written": [5, 37], "id": [5, 37, 41], "fetch": [5, 37], "exampl": [5, 10, 16, 19, 25, 26, 36, 37, 41], "output": [5, 10, 18, 20, 28, 37, 41, 51], "abcabcab": [5, 37], "cabc": [5, 37], "abca": [5, 37], "0123456789ab": [5, 37], "type": [5, 11, 16, 18, 19, 26, 28, 32, 34, 36, 37, 40, 41, 43, 46, 51], "batch_async_request": [5, 37], "model_bundl": [5, 37], "batch_url_file_loc": [5, 37], "serialization_format": [5, 37], "batch_task_opt": [5, 37], "label": [5, 37], "send": [5, 37], "batch": [5, 37, 41, 51, 52, 56], "given": [5, 32, 36, 37], "bundl": [5, 37, 40, 41, 51, 52, 54, 56], "have": [5, 36, 37, 51], "union": [5, 37], "each": [5, 36, 37, 41], "ani": [5, 26, 36, 37, 40, 41, 43, 45, 46, 49, 51], "exist": [5, 18, 37], "upload": [5, 37, 51], "In": [5, 36, 37], "mode": [5, 37, 52, 56], "job": [5, 37, 51, 52, 56], "otherwis": [5, 26, 36, 37], "determin": [5, 18, 37], "from": [5, 10, 16, 18, 19, 25, 26, 35, 36, 37, 41, 43, 44, 51, 56], "bundle_location_fn": [5, 37], "serial": [5, 18, 28, 37, 41], "format": [5, 18, 28, 36, 37], "correspond": [5, 37, 41], "task": [5, 37, 41], "set": [5, 34, 37, 41, 51], "certain": [5, 37], "like": [5, 37], "cpu": [5, 37, 51], "memori": [5, 37, 51], "gpu": [5, 37, 51], "gpu_typ": [5, 37], "max_work": [5, 37], "well": [5, 36, 37, 51], "under": [5, 37], "hood": [5, 37], "pyspark_partition_s": [5, 37], "pyspark_max_executor": [5, 37], "clone_model_bundle_with_chang": [5, 37], "existing_bundl": [5, 37], "new_bundle_nam": [5, 37], "app_config": [5, 37], "clone": [5, 37], "its": [5, 18, 20, 36, 37, 41], "app": [5, 37], "config": [5, 37, 41], "more": [5, 10, 16, 19, 25, 26, 36, 37, 40, 51], "field": [5, 36, 37], "come": [5, 37], "soon": [5, 37], "new": [5, 18, 36, 37, 43, 44], "create_model_bundl": [5, 37, 40], "model_bundle_nam": [5, 37], "env_param": [5, 37, 40], "load_predict_fn": [5, 37, 51], "predict_fn_or_cl": [5, 37], "load_model_fn": [5, 37, 51], "bundle_url": [5, 37], "globals_copi": [5, 35, 37], "regist": [5, 36, 37, 52, 56], "consist": [5, 37, 51], "follow": [5, 10, 16, 19, 25, 26, 36, 37], "pre": [5, 37, 51], "post": [5, 32, 37, 51], "process": [5, 37, 51], "code": [5, 11, 18, 36, 37, 51, 52, 56], "includ": [5, 10, 25, 36, 37], "insid": [5, 37], "call": [5, 18, 35, 36, 37, 41], "creat": [5, 11, 13, 18, 26, 36, 37, 43, 46, 51], "uniqu": [5, 37, 40, 41], "across": [5, 37, 40, 41], "own": [5, 37, 40, 41], "callabl": [5, 37, 43, 45, 46], "run": [5, 18, 28, 37, 41, 51], "end": [5, 36, 37], "respons": [5, 18, 28, 32, 37, 41, 51], "launchmodel_t": [5, 37], "typic": [5, 10, 16, 19, 25, 26, 37, 51], "train": [5, 37, 51, 52, 56], "neural": [5, 37], "network": [5, 37], "g": [5, 37, 51], "pytorch": [5, 37, 51], "load": [5, 26, 37, 41], "essenti": [5, 37], "defer": [5, 37], "carri": [5, 37], "out": [5, 37], "equival": [5, 37], "optional_app_config": [5, 37], "predict_fn": [5, 37, 41, 51], "both": [5, 37], "case": [5, 36, 37], "where": [5, 11, 18, 36, 37, 41], "element": [5, 37], "form": [5, 37, 41], "package_nam": [5, 37], "package_vers": [5, 37], "tensorflow": [5, 37, 51], "2": [5, 37, 51], "3": [5, 36, 37, 51], "0": [5, 37], "hub": [5, 37], "11": [5, 37], "do": [5, 36, 37], "valu": [5, 18, 26, 36, 37, 41, 43, 44, 49], "global": [5, 37, 40], "repres": [5, 18, 37, 40, 41, 51], "yaml": [5, 37], "local": [5, 37, 41, 56], "path": [5, 35, 37], "dictat": [5, 37, 40], "inform": [5, 37, 40], "which": [5, 18, 36, 37, 51], "base": [5, 10, 16, 19, 25, 26, 34, 37, 42, 43, 45, 51], "imag": [5, 37, 41], "tag": [5, 37], "specif": [5, 36, 37, 41, 51], "framework_typ": [5, 37], "pytorch_image_tag": [5, 37], "docker": [5, 37], "found": [5, 36, 37], "http": [5, 32, 37, 51, 56], "com": [5, 37, 56], "r": [5, 37], "1": [5, 36, 37, 51], "10": [5, 37], "cuda11": [5, 37], "cudnn8": [5, 37], "runtim": [5, 11, 18, 37, 43, 45, 46], "tensorflow_vers": [5, 37], "version": [5, 36, 37], "symbol": [5, 37], "tabl": [5, 36, 37], "normal": [5, 37], "built": [5, 37], "onli": [5, 18, 20, 36, 37, 41, 56], "desir": [5, 37], "overrid": [5, 37], "create_model_bundle_from_dir": [5, 37], "base_path": [5, 37], "requirements_path": [5, 37], "load_predict_fn_module_path": [5, 37], "load_model_fn_module_path": [5, 37], "up": [5, 37, 51], "filesystem": [5, 37], "folder": [5, 37], "them": [5, 37, 51], "just": [5, 37], "For": [5, 10, 16, 19, 25, 26, 37], "directori": [5, 37], "structur": [5, 37, 43, 46], "so": [5, 37], "current": [5, 35, 37, 41], "work": [5, 36, 37], "also": [5, 18, 20, 36, 37, 41, 51], "my_root": [5, 37], "my_module1": [5, 37], "__init__": [5, 26, 37], "py": [5, 37], "my_inference_fil": [5, 37], "my_module2": [5, 37], "zip": [5, 37, 40], "without": [5, 37], "root": [5, 37], "unzip": [5, 37], "rel": [5, 37], "server": [5, 37, 41], "side": [5, 37, 47], "applic": [5, 37], "bear": [5, 37], "mind": [5, 37], "referenc": [5, 37], "instanc": [5, 26, 36, 37, 41], "def": [5, 10, 16, 19, 25, 26, 36, 37], "f": [5, 37, 41], "live": [5, 37], "txt": [5, 37], "feed": [5, 37], "create_model_endpoint": [5, 37], "8gi": [5, 37], "storag": [5, 37], "min_work": [5, 37], "per_work": [5, 37], "endpoint_typ": [5, 37, 41], "sync": [5, 37, 41], "post_inference_hook": [5, 37], "update_if_exist": [5, 37], "syncendpoint": [5, 37, 41, 51, 56], "sent": [5, 37], "serv": [5, 37, 51], "number": [5, 36, 37, 51], "worker": [5, 37, 41, 51], "get": [5, 18, 32, 35, 37, 41], "greater": [5, 37], "than": [5, 37], "equal": [5, 37, 41], "amount": [5, 37, 51], "4gi": [5, 37], "512mi": [5, 37], "posit": [5, 36, 37], "ephemer": [5, 37], "minimum": [5, 37], "comput": [5, 18, 37, 51], "throughput": [5, 10, 37, 51], "workload": [5, 37], "divid": [5, 37], "singl": [5, 25, 37, 41, 43, 46], "least": [5, 36, 37, 51], "synchron": [5, 37, 41], "maximum": [5, 36, 37], "concurr": [5, 37], "individu": [5, 37], "servic": [5, 10, 11, 18, 20, 25, 37, 43, 46, 51, 56], "automat": [5, 37, 51], "subject": [5, 37], "limit": [5, 36, 37], "defin": [5, 10, 11, 16, 18, 19, 25, 26, 36, 37, 43, 44], "averag": [5, 37], "per": [5, 37, 51], "lower": [5, 36, 37], "reduc": [5, 37], "higher": [5, 37], "increas": [5, 37], "meet": [5, 37], "elev": [5, 37], "traffic": [5, 37, 51], "here": [5, 37, 41, 51], "our": [5, 37, 51], "ensur": [5, 37], "climb": [5, 37], "non": [5, 34, 36, 37], "zero": [5, 36, 37, 51], "control": [5, 26, 37], "support": [5, 37], "nvidia": [5, 37], "tesla": [5, 37], "t4": [5, 37], "amper": [5, 37], "a10": [5, 37], "hook": [5, 37], "postinferencehook": [5, 36, 37], "trigger": [5, 37], "after": [5, 36, 37, 41, 51], "attempt": [5, 37], "updat": [5, 37], "uncondition": [5, 37], "try": [5, 10, 16, 19, 25, 26, 36, 37], "user": [5, 11, 18, 37, 40, 41, 51], "rais": [5, 26, 36, 37, 41], "error": [5, 36, 37, 41], "pair": [5, 26, 37], "associ": [5, 37], "model_endpoint": [5, 37], "delete_model_bundl": [5, 37], "delete_model_endpoint": [5, 37], "modelendpoint": [5, 37, 41, 52, 56], "edit_model_endpoint": [5, 37], "edit": [5, 37], "cannot": [5, 37, 51], "go": [5, 18, 37], "syncenpdoint": [5, 37], "vice": [5, 37], "versa": [5, 37], "get_async_respons": [5, 37], "async_task_id": [5, 37, 41], "previous": [5, 37], "previou": [5, 37], "invoc": [5, 37], "statu": [5, 18, 37, 41, 51], "complet": [5, 18, 37, 41, 51], "succeed": [5, 37], "Will": [5, 37], "wa": [5, 37], "state": [5, 37, 41], "pend": [5, 37, 41], "success": [5, 32, 37, 41], "failur": [5, 26, 36, 37, 41], "result_url": [5, 37, 41], "12": [5, 37], "hour": [5, 37], "been": [5, 37], "made": [5, 37, 41], "s3": [5, 37], "west": [5, 37], "amazonaw": [5, 37], "baz": [5, 37], "qux": [5, 37], "xyzzi": [5, 37], "get_batch_async_respons": [5, 37], "batch_async_task_id": [5, 37], "store": [5, 37, 51], "durat": [5, 37], "string": [5, 18, 28, 36, 37, 41], "represent": [5, 37], "how": [5, 18, 28, 37, 51, 56], "long": [5, 37, 51], "took": [5, 37], "finish": [5, 37], "get_model_bundl": [5, 37], "get_model_endpoint": [5, 37], "list_model_bundl": [5, 37], "list_model_endpoint": [5, 37], "register_batch_csv_location_fn": [5, 37], "batch_csv_location_fn": [5, 37], "give": [5, 37, 41], "csv": [5, 37], "differ": [5, 37], "batch_csv_url": [5, 37], "upload_batch_csv_fn": [5, 37], "take": [5, 37, 51], "strictli": [5, 37], "doe": [5, 37], "t": [5, 26, 37, 41], "second": [5, 37, 51], "gener": [5, 10, 16, 18, 19, 25, 26, 37, 41, 43, 44], "register_bundle_location_fn": [5, 37], "register_upload_bundle_fn": [5, 37], "upload_bundle_fn": [5, 37], "register_endpoint_auth_decor": [5, 37], "endpoint_auth_decorator_fn": [5, 37], "modifi": [5, 37], "payload": [5, 18, 28, 32, 37, 41], "register_upload_batch_csv_fn": [5, 37], "handl": [5, 18, 36, 37], "text": [5, 37, 41], "csv_text": [5, 37], "csv_url": [5, 37], "write": [5, 37], "appropri": [5, 37], "serialized_bundl": [5, 37], "binari": [5, 37], "batchableservic": 10, "oper": [10, 25, 36], "optim": [10, 51], "mani": 10, "embarrassingli": 10, "parallel": 10, "thu": 10, "thei": 10, "efficeintli": 10, "produc": 10, "call_batch": 10, "batcher": 10, "batteri": [10, 25], "abstract": [10, 11, 16, 18, 19, 25, 26, 37, 41], "declar": [10, 16, 19, 25, 26], "inherit": [10, 11, 13, 16, 18, 19, 25, 26], "parameter": [10, 16, 19, 25, 26], "map": [10, 16, 19, 25, 26, 36], "might": [10, 16, 19, 25, 26], "kt": [10, 16, 19, 25, 26], "vt": [10, 16, 19, 25, 26], "__getitem__": [10, 16, 19, 25, 26, 36], "lookup_nam": [10, 16, 19, 25, 26], "except": [10, 16, 18, 19, 25, 26, 34], "keyerror": [10, 16, 19, 25, 26], "helper": [11, 13, 18], "standard": [11, 13, 18], "wai": [11, 13, 18, 37, 41], "abc": [11, 13, 18], "start": [11, 18, 36], "infinit": [11, 18], "loop": [11, 18], "accept": [11, 18, 51], "respond": [11, 18], "logic": [11, 18, 28], "implement": [11, 18, 28, 36], "sepecif": [11, 18], "custom": [11, 18], "deployedservic": [13, 18], "requesthandl": [16, 18, 28], "responsehandl": [16, 18, 28], "runnableservic": 16, "deploymentopt": 18, "configur": 18, "deploi": [18, 51, 52, 56], "act": 18, "cluster": [18, 51], "fullservic": [18, 28], "thing": [18, 28], "technic": [18, 28], "Its": [18, 28], "know": [18, 28, 51], "encod": [18, 28, 36], "decod": [18, 28, 36], "transit": [18, 28], "data": [18, 28, 36, 37, 41], "jsonhandl": 18, "convert": [18, 28, 36], "protocol": [18, 28], "d": [18, 28], "jsonservic": 18, "what": [18, 51], "std": 18, "ml": [18, 37, 56], "srv": 18, "effect": [18, 51], "launch_api": 18, "core": [18, 51], "o": [18, 28], "referenceddeploy": 18, "serialized_request": 18, "perform": 18, "against": 18, "rout": [18, 32, 37], "futur": [18, 37, 41], "block": [18, 37, 41, 51], "syncron": 18, "deploy": [18, 43, 45, 46, 52, 56], "background": 18, "thread": 18, "receiv": [18, 37, 41], "It": 18, "persist": 18, "until": 18, "caller": 18, "invok": 18, "fail": 18, "specstritonmodel": [18, 20], "describ": [18, 20, 43, 46], "shape": [18, 20], "tensor": [18, 20], "enumer": [18, 43, 44], "deriv": [18, 43, 44], "enum": [18, 36, 43, 44], "member": [18, 36, 43, 44], "toprotobuftext": 18, "tritonmodel": [18, 20], "kind": [18, 20, 41], "execut": [18, 20], "forward": [18, 20], "tritonmodelconfig": 18, "tritontensor": 18, "serviceload": 19, "inferenceservic": 25, "processor": 25, "objectconf": 26, "keyword": [26, 36], "appli": 26, "construct": 26, "class_nam": 26, "fulli": 26, "qualifi": 26, "within": [26, 36], "pass_args_whol": 26, "constructor": 26, "behavior": 26, "dynam": 26, "make_request": [32, 37], "requests_command": [32, 37], "warn": [32, 37], "apierror": 34, "requests_respons": 34, "aiohttp_respons": 34, "common": 34, "class": [34, 56], "exit": 34, "help": [34, 36], "accur": [34, 36], "with_traceback": 34, "tb": 34, "__traceback__": 34, "find_packages_from_import": 35, "notebook": 35, "find_packages_from_path": 35, "anoth": 35, "get_import": 35, "import": 35, "bytes_or_buff": 36, "expos": 36, "buffer": 36, "handler": 36, "__str__": 36, "repr": 36, "sy": 36, "getdefaultencod": 36, "strict": [36, 51], "capit": 36, "first": [36, 37, 41, 56], "charact": 36, "upper": 36, "rest": 36, "casefold": 36, "suitabl": 36, "caseless": 36, "comparison": 36, "center": 36, "length": 36, "width": 36, "pad": 36, "done": [36, 37, 41], "fill": 36, "space": 36, "count": 36, "sub": 36, "overlap": 36, "occurr": 36, "substr": 36, "interpret": 36, "slice": 36, "notat": 36, "codec": 36, "scheme": 36, "mean": [36, 51], "unicodeencodeerror": 36, "other": 36, "possibl": 36, "ignor": 36, "replac": 36, "xmlcharrefreplac": 36, "register_error": 36, "endswith": 36, "suffix": 36, "With": 36, "test": [36, 55], "begin": 36, "stop": 36, "compar": 36, "tupl": 36, "expandtab": 36, "copi": [36, 49], "tab": 36, "expand": 36, "tabsiz": 36, "size": 36, "8": 36, "assum": 36, "find": 36, "lowest": 36, "index": 36, "substitut": 36, "identifi": [36, 37, 40, 41], "brace": 36, "format_map": 36, "valueerror": 36, "isalnum": 36, "alpha": 36, "numer": 36, "isalpha": 36, "alphabet": 36, "isascii": 36, "ascii": 36, "rang": 36, "u": 36, "0000": 36, "007f": 36, "empti": 36, "too": 36, "isdecim": 36, "decim": 36, "isdigit": 36, "digit": 36, "isidentifi": 36, "valid": [36, 47], "iskeyword": 36, "reserv": 36, "islow": 36, "lowercas": 36, "isnumer": 36, "isprint": 36, "printabl": 36, "consid": 36, "isspac": 36, "whitespac": 36, "istitl": 36, "titl": 36, "mai": 36, "uncas": 36, "ones": 36, "isupp": 36, "uppercas": 36, "join": 36, "concaten": 36, "whose": 36, "method": [36, 37, 41], "insert": 36, "between": [36, 51], "ab": 36, "pq": 36, "rs": 36, "ljust": 36, "left": 36, "justifi": 36, "lstrip": 36, "lead": 36, "remov": [36, 37, 41, 49], "char": 36, "partit": 36, "three": [36, 51], "part": 36, "separ": 36, "search": 36, "befor": 36, "origin": [36, 37, 41], "two": [36, 51], "removeprefix": 36, "prefix": 36, "present": 36, "len": 36, "removesuffix": 36, "old": 36, "rfind": 36, "highest": 36, "rindex": 36, "rjust": 36, "right": [36, 52, 56], "rpartit": 36, "rsplit": 36, "word": 36, "sep": 36, "delimit": 36, "accord": [36, 37], "split": 36, "discard": 36, "maxsplit": 36, "front": 36, "rstrip": 36, "trail": 36, "splitlin": 36, "break": 36, "boundari": 36, "unless": 36, "keepend": 36, "startswith": 36, "strip": 36, "swapcas": 36, "titlecas": 36, "remain": [36, 37, 41], "translat": 36, "unicod": 36, "ordin": 36, "lookup": 36, "via": 36, "lookuperror": 36, "untouch": 36, "zfill": 36, "never": 36, "truncat": 36, "engin": [37, 56], "simpl": [37, 56], "turn": [37, 56], "snippet": [37, 56], "product": [37, 56], "cli": [37, 56], "request_valid": [37, 56], "client": [37, 41, 47, 51, 56], "asynchron": [37, 41, 51], "endpointrequest": [37, 41, 56], "endpointresponsefutur": [37, 41, 56], "queri": [37, 41, 51], "my_endpoint": [37, 41], "predict_batch": [37, 41], "deprec": [37, 41], "item": [37, 41, 43, 45, 46], "asyncendpointrespons": [37, 41], "request_id": [37, 41], "distinct": [37, 41], "keep": [37, 41], "track": [37, 41], "asyncendpointbatchrespons": [37, 41, 56], "resource_set": [37, 41], "resourc": [37, 41, 51], "worker_set": [37, 41], "poll": [37, 41], "invari": [37, 41], "idk": [37, 41], "about": [37, 41, 51], "tbh": [37, 41], "could": [37, 41], "redesign": [37, 41], "mayb": [37, 41], "sort": [37, 41], "much": [37, 41], "complic": [37, 41], "get_respons": [37, 41], "endpointrespons": [37, 41, 56], "is_don": [37, 41], "check": [37, 41], "subset": [37, 41], "incomplet": [37, 41], "poll_endpoint": [37, 41], "round": [37, 41], "some": [37, 41, 51], "raw": [37, 41], "nativ": [37, 41], "among": [37, 41], "same": [37, 41], "isn": [37, 41], "traceback": [37, 41], "popul": [37, 41], "depend": [37, 41], "back": [37, 41], "stack": [37, 41], "trace": [37, 41], "debug": [37, 41], "readi": [37, 41], "actual": [37, 41], "instanti": [37, 41], "modul": [37, 51], "bundle_id": [37, 40], "opaqu": [37, 40], "metadata": [37, 40, 41, 51], "arbitrari": [37, 40, 51], "packaging_typ": [37, 40], "cloudpickl": [37, 40], "databas": 41, "owner": 41, "destin": 41, "queue": 41, "sequentialpipelinedescript": [43, 45, 46], "descript": [43, 45], "sequenti": [43, 45, 46], "singleservicedescript": [43, 45, 46], "make_sequential_pipelin": [43, 46], "make_servic": [43, 46], "servicedescript": 45, "trim_kwarg": 49, "kwargs_dict": 49, "guid": [50, 51, 54, 56], "concept": 51, "re": 51, "surround": 51, "preprocess": 51, "postprocess": 51, "would": 51, "nn": 51, "To": [51, 56], "variou": 51, "infrastructur": 51, "level": 51, "detail": 51, "min": 51, "max": 51, "There": 51, "manner": 51, "alwai": 51, "token": 51, "monitor": 51, "cost": 51, "choic": 51, "latenc": 51, "sensit": 51, "onc": 51, "restart": 51, "addit": 51, "maintain": 51, "even": 51, "tip": 51, "good": 51, "order": 51, "less": 51, "willing": 51, "continu": 51, "alloc": 51, "save": 51, "minut": 51, "larg": 51, "ahead": 51, "ll": 51, "provis": 51, "dedic": 51, "through": 51, "section": 51, "instruct": 51, "introduct": [52, 56], "launch": 52, "batchjob": [52, 56], "choos": [52, 56], "overview": [52, 56], "step": [52, 56], "integr": [52, 56], "insight": [52, 56], "nucleu": [52, 56], "troubleshoot": [52, 56], "todo": 53, "link": 53, "doc": 53, "pip": 56, "venv": 56, "git": 56, "github": 56, "scaleapi": 56, "privat": 56, "librari": 56, "repositori": 56, "subpackag": 56, "submodul": 56, "content": 56}, "objects": {"": [[37, 0, 0, "-", "launch"]], "launch": [[37, 1, 1, "", "AsyncEndpoint"], [37, 1, 1, "", "AsyncEndpointBatchResponse"], [37, 1, 1, "", "Connection"], [37, 1, 1, "", "EndpointRequest"], [37, 1, 1, "", "EndpointResponse"], [37, 1, 1, "", "EndpointResponseFuture"], [37, 1, 1, "", "LaunchClient"], [37, 1, 1, "", "ModelBundle"], [37, 1, 1, "", "SyncEndpoint"], [4, 0, 0, "-", "cli"], [5, 0, 0, "-", "client"], [18, 0, 0, "-", "clientlib"], [32, 0, 0, "-", "connection"], [33, 0, 0, "-", "constants"], [34, 0, 0, "-", "errors"], [35, 0, 0, "-", "find_packages"], [36, 0, 0, "-", "hooks"], [38, 0, 0, "-", "logger"], [39, 0, 0, "-", "make_batch_file"], [40, 0, 0, "-", "model_bundle"], [41, 0, 0, "-", "model_endpoint"], [43, 0, 0, "-", "pipeline"], [47, 0, 0, "-", "request_validation"], [48, 0, 0, "-", "retry_strategy"], [49, 0, 0, "-", "utils"]], "launch.AsyncEndpoint": [[37, 2, 1, "", "predict"], [37, 2, 1, "", "predict_batch"], [37, 2, 1, "", "resource_settings"], [37, 2, 1, "", "status"], [37, 2, 1, "", "worker_settings"]], "launch.AsyncEndpointBatchResponse": [[37, 2, 1, "", "get_responses"], [37, 2, 1, "", "is_done"], [37, 2, 1, "", "poll_endpoints"]], "launch.Connection": [[37, 2, 1, "", "make_request"]], "launch.EndpointResponseFuture": [[37, 2, 1, "", "get"]], "launch.LaunchClient": [[37, 2, 1, "", "async_request"], [37, 2, 1, "", "batch_async_request"], [37, 2, 1, "", "clone_model_bundle_with_changes"], [37, 2, 1, "", "create_model_bundle"], [37, 2, 1, "", "create_model_bundle_from_dirs"], [37, 2, 1, "", "create_model_endpoint"], [37, 2, 1, "", "delete_model_bundle"], [37, 2, 1, "", "delete_model_endpoint"], [37, 2, 1, "", "edit_model_endpoint"], [37, 2, 1, "", "get_async_response"], [37, 2, 1, "", "get_batch_async_response"], [37, 2, 1, "", "get_model_bundle"], [37, 2, 1, "", "get_model_endpoint"], [37, 2, 1, "", "list_model_bundles"], [37, 2, 1, "", "list_model_endpoints"], [37, 2, 1, "", "read_endpoint_creation_logs"], [37, 2, 1, "", "register_batch_csv_location_fn"], [37, 2, 1, "", "register_bundle_location_fn"], [37, 2, 1, "", "register_endpoint_auth_decorator"], [37, 2, 1, "", "register_upload_batch_csv_fn"], [37, 2, 1, "", "register_upload_bundle_fn"]], "launch.ModelBundle": [[37, 3, 1, "", "bundle_id"], [37, 3, 1, "", "env_params"], [37, 3, 1, "", "location"], [37, 3, 1, "", "metadata"], [37, 3, 1, "", "name"], [37, 3, 1, "", "packaging_type"], [37, 3, 1, "", "requirements"]], "launch.SyncEndpoint": [[37, 2, 1, "", "predict"], [37, 2, 1, "", "resource_settings"], [37, 2, 1, "", "status"], [37, 2, 1, "", "worker_settings"]], "launch.cli": [[0, 0, 0, "-", "bin"], [1, 0, 0, "-", "bundles"], [2, 0, 0, "-", "client"], [3, 0, 0, "-", "endpoints"]], "launch.cli.bin": [[0, 4, 1, "", "entry_point"]], "launch.cli.bundles": [[1, 4, 1, "", "bundles"], [1, 4, 1, "", "delete_bundle"], [1, 4, 1, "", "get_bundle"], [1, 4, 1, "", "list_bundles"]], "launch.cli.endpoints": [[3, 4, 1, "", "delete_endpoint"], [3, 4, 1, "", "endpoints"], [3, 4, 1, "", "list_endpoints"], [3, 4, 1, "", "read_endpoint_creation_logs"]], "launch.client": [[5, 1, 1, "", "LaunchClient"]], "launch.client.LaunchClient": [[5, 2, 1, "", "async_request"], [5, 2, 1, "", "batch_async_request"], [5, 2, 1, "", "clone_model_bundle_with_changes"], [5, 2, 1, "", "create_model_bundle"], [5, 2, 1, "", "create_model_bundle_from_dirs"], [5, 2, 1, "", "create_model_endpoint"], [5, 2, 1, "", "delete_model_bundle"], [5, 2, 1, "", "delete_model_endpoint"], [5, 2, 1, "", "edit_model_endpoint"], [5, 2, 1, "", "get_async_response"], [5, 2, 1, "", "get_batch_async_response"], [5, 2, 1, "", "get_model_bundle"], [5, 2, 1, "", "get_model_endpoint"], [5, 2, 1, "", "list_model_bundles"], [5, 2, 1, "", "list_model_endpoints"], [5, 2, 1, "", "read_endpoint_creation_logs"], [5, 2, 1, "", "register_batch_csv_location_fn"], [5, 2, 1, "", "register_bundle_location_fn"], [5, 2, 1, "", "register_endpoint_auth_decorator"], [5, 2, 1, "", "register_upload_batch_csv_fn"], [5, 2, 1, "", "register_upload_bundle_fn"]], "launch.clientlib": [[18, 1, 1, "", "DeployedService"], [18, 1, 1, "", "DeploymentOptions"], [18, 1, 1, "", "FullService"], [18, 1, 1, "", "JsonHandler"], [18, 1, 1, "", "JsonService"], [18, 1, 1, "", "ReferencedDeployment"], [18, 1, 1, "", "RequestHandler"], [18, 1, 1, "", "ResponseHandler"], [18, 1, 1, "", "Runtime"], [18, 1, 1, "", "Service"], [18, 1, 1, "", "SpecsTritonModel"], [18, 1, 1, "", "Status"], [18, 1, 1, "", "ToProtobufText"], [18, 1, 1, "", "TritonModel"], [18, 1, 1, "", "TritonModelConfig"], [18, 1, 1, "", "TritonTensor"], [7, 0, 0, "-", "batching"], [11, 0, 0, "-", "core"], [12, 0, 0, "-", "demonstration"], [13, 0, 0, "-", "deployment"], [14, 0, 0, "-", "exe"], [16, 0, 0, "-", "full_service"], [17, 0, 0, "-", "http"], [19, 0, 0, "-", "loader"], [20, 0, 0, "-", "model"], [22, 0, 0, "-", "model_service"], [26, 0, 0, "-", "object_conf_from_std_ml_serve"], [27, 0, 0, "-", "pipeline"], [28, 0, 0, "-", "service"], [29, 0, 0, "-", "triton"], [30, 0, 0, "-", "types"], [31, 0, 0, "-", "utils"]], "launch.clientlib.ReferencedDeployment": [[18, 2, 1, "", "call"]], "launch.clientlib.Runtime": [[18, 2, 1, "", "start"]], "launch.clientlib.Status": [[18, 2, 1, "", "name"], [18, 2, 1, "", "value"]], "launch.clientlib.batching": [[6, 0, 0, "-", "implementation"], [8, 0, 0, "-", "named_arrays"], [9, 0, 0, "-", "single_array"], [10, 0, 0, "-", "types"]], "launch.clientlib.batching.types": [[10, 1, 1, "", "BatchableService"], [10, 1, 1, "", "Batcher"]], "launch.clientlib.core": [[11, 1, 1, "", "Runtime"], [11, 1, 1, "", "Service"]], "launch.clientlib.core.Runtime": [[11, 2, 1, "", "start"]], "launch.clientlib.deployment": [[13, 1, 1, "", "DeployedService"]], "launch.clientlib.exe": [[15, 0, 0, "-", "run_service"]], "launch.clientlib.full_service": [[16, 1, 1, "", "RequestHandler"], [16, 1, 1, "", "ResponseHandler"], [16, 1, 1, "", "RunnableService"]], "launch.clientlib.loader": [[19, 1, 1, "", "Loader"], [19, 1, 1, "", "ServiceLoader"]], "launch.clientlib.model": [[20, 1, 1, "", "SpecsTritonModel"], [20, 1, 1, "", "TritonModel"]], "launch.clientlib.model_service": [[21, 0, 0, "-", "implementation"], [23, 0, 0, "-", "named_arrays"], [24, 0, 0, "-", "single_array"], [25, 0, 0, "-", "types"]], "launch.clientlib.model_service.types": [[25, 1, 1, "", "InferenceService"], [25, 1, 1, "", "Processor"]], "launch.clientlib.object_conf_from_std_ml_serve": [[26, 1, 1, "", "ObjectConf"]], "launch.clientlib.object_conf_from_std_ml_serve.ObjectConf": [[26, 3, 1, "", "args"], [26, 3, 1, "", "class_name"], [26, 2, 1, "", "construct"], [26, 3, 1, "", "pass_args_whole"]], "launch.clientlib.service": [[28, 1, 1, "", "FullService"], [28, 1, 1, "", "RequestHandler"], [28, 1, 1, "", "ResponseHandler"]], "launch.connection": [[32, 1, 1, "", "Connection"]], "launch.connection.Connection": [[32, 2, 1, "", "make_request"]], "launch.errors": [[34, 5, 1, "", "APIError"]], "launch.errors.APIError": [[34, 2, 1, "", "with_traceback"]], "launch.find_packages": [[35, 4, 1, "", "find_packages_from_imports"], [35, 4, 1, "", "find_packages_from_path"], [35, 4, 1, "", "get_imports"]], "launch.hooks": [[36, 1, 1, "", "PostInferenceHooks"]], "launch.hooks.PostInferenceHooks": [[36, 2, 1, "", "capitalize"], [36, 2, 1, "", "casefold"], [36, 2, 1, "", "center"], [36, 2, 1, "", "count"], [36, 2, 1, "", "encode"], [36, 2, 1, "", "endswith"], [36, 2, 1, "", "expandtabs"], [36, 2, 1, "", "find"], [36, 2, 1, "", "format"], [36, 2, 1, "", "format_map"], [36, 2, 1, "", "index"], [36, 2, 1, "", "isalnum"], [36, 2, 1, "", "isalpha"], [36, 2, 1, "", "isascii"], [36, 2, 1, "", "isdecimal"], [36, 2, 1, "", "isdigit"], [36, 2, 1, "", "isidentifier"], [36, 2, 1, "", "islower"], [36, 2, 1, "", "isnumeric"], [36, 2, 1, "", "isprintable"], [36, 2, 1, "", "isspace"], [36, 2, 1, "", "istitle"], [36, 2, 1, "", "isupper"], [36, 2, 1, "", "join"], [36, 2, 1, "", "ljust"], [36, 2, 1, "", "lower"], [36, 2, 1, "", "lstrip"], [36, 2, 1, "", "name"], [36, 2, 1, "", "partition"], [36, 2, 1, "", "removeprefix"], [36, 2, 1, "", "removesuffix"], [36, 2, 1, "", "replace"], [36, 2, 1, "", "rfind"], [36, 2, 1, "", "rindex"], [36, 2, 1, "", "rjust"], [36, 2, 1, "", "rpartition"], [36, 2, 1, "", "rsplit"], [36, 2, 1, "", "rstrip"], [36, 2, 1, "", "split"], [36, 2, 1, "", "splitlines"], [36, 2, 1, "", "startswith"], [36, 2, 1, "", "strip"], [36, 2, 1, "", "swapcase"], [36, 2, 1, "", "title"], [36, 2, 1, "", "translate"], [36, 2, 1, "", "upper"], [36, 2, 1, "", "value"], [36, 2, 1, "", "zfill"]], "launch.model_bundle": [[40, 1, 1, "", "ModelBundle"]], "launch.model_bundle.ModelBundle": [[40, 3, 1, "", "bundle_id"], [40, 3, 1, "", "env_params"], [40, 3, 1, "", "location"], [40, 3, 1, "", "metadata"], [40, 3, 1, "", "name"], [40, 3, 1, "", "packaging_type"], [40, 3, 1, "", "requirements"]], "launch.model_endpoint": [[41, 1, 1, "", "AsyncEndpoint"], [41, 1, 1, "", "AsyncEndpointBatchResponse"], [41, 1, 1, "", "Endpoint"], [41, 1, 1, "", "EndpointRequest"], [41, 1, 1, "", "EndpointResponse"], [41, 1, 1, "", "EndpointResponseFuture"], [41, 1, 1, "", "ModelEndpoint"], [41, 1, 1, "", "SyncEndpoint"]], "launch.model_endpoint.AsyncEndpoint": [[41, 2, 1, "", "predict"], [41, 2, 1, "", "predict_batch"], [41, 2, 1, "", "resource_settings"], [41, 2, 1, "", "status"], [41, 2, 1, "", "worker_settings"]], "launch.model_endpoint.AsyncEndpointBatchResponse": [[41, 2, 1, "", "get_responses"], [41, 2, 1, "", "is_done"], [41, 2, 1, "", "poll_endpoints"]], "launch.model_endpoint.Endpoint": [[41, 2, 1, "", "resource_settings"], [41, 2, 1, "", "status"], [41, 2, 1, "", "worker_settings"]], "launch.model_endpoint.EndpointResponseFuture": [[41, 2, 1, "", "get"]], "launch.model_endpoint.ModelEndpoint": [[41, 3, 1, "", "bundle_name"], [41, 3, 1, "", "configs"], [41, 3, 1, "", "destination"], [41, 3, 1, "", "endpoint_type"], [41, 3, 1, "", "metadata"], [41, 3, 1, "", "name"], [41, 3, 1, "", "resource_settings"], [41, 3, 1, "", "status"], [41, 3, 1, "", "worker_settings"]], "launch.model_endpoint.SyncEndpoint": [[41, 2, 1, "", "predict"], [41, 2, 1, "", "resource_settings"], [41, 2, 1, "", "status"], [41, 2, 1, "", "worker_settings"]], "launch.pipeline": [[43, 1, 1, "", "Deployment"], [43, 1, 1, "", "Runtime"], [43, 1, 1, "", "SequentialPipelineDescription"], [43, 1, 1, "", "SingleServiceDescription"], [42, 0, 0, "-", "deployment"], [43, 4, 1, "", "make_sequential_pipeline"], [43, 4, 1, "", "make_service"], [44, 0, 0, "-", "runtime"], [45, 0, 0, "-", "service"], [46, 0, 0, "-", "utils"]], "launch.pipeline.Runtime": [[43, 2, 1, "", "name"], [43, 2, 1, "", "value"]], "launch.pipeline.deployment": [[42, 1, 1, "", "Deployment"]], "launch.pipeline.runtime": [[44, 1, 1, "", "Runtime"]], "launch.pipeline.runtime.Runtime": [[44, 2, 1, "", "name"], [44, 2, 1, "", "value"]], "launch.pipeline.service": [[45, 1, 1, "", "SequentialPipelineDescription"], [45, 1, 1, "", "ServiceDescription"], [45, 1, 1, "", "SingleServiceDescription"]], "launch.pipeline.utils": [[46, 4, 1, "", "make_sequential_pipeline"], [46, 4, 1, "", "make_service"]], "launch.utils": [[49, 4, 1, "", "trim_kwargs"]], "scale-launch-bundles-delete": [[4, 6, 1, "cmdoption-scale-launch-bundles-delete-arg-BUNDLE_NAME", "BUNDLE_NAME"]], "scale-launch-bundles-get": [[4, 6, 1, "cmdoption-scale-launch-bundles-get-arg-BUNDLE_NAME", "BUNDLE_NAME"]], "scale-launch-endpoints-creation-logs": [[4, 6, 1, "cmdoption-scale-launch-endpoints-creation-logs-arg-ENDPOINT_NAME", "ENDPOINT_NAME"]], "scale-launch-endpoints-delete": [[4, 6, 1, "cmdoption-scale-launch-endpoints-delete-arg-ENDPOINT_NAME", "ENDPOINT_NAME"]], "scale-launch": [[4, 6, 1, "cmdoption-scale-launch-a", "--api-key"], [4, 6, 1, "cmdoption-scale-launch-e", "--gateway-endpoint"], [4, 6, 1, "cmdoption-scale-launch-s", "--self-hosted"], [4, 6, 1, "cmdoption-scale-launch-a", "-a"], [4, 6, 1, "cmdoption-scale-launch-e", "-e"], [4, 6, 1, "cmdoption-scale-launch-s", "-s"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:attribute", "4": "py:function", "5": "py:exception", "6": "std:cmdoption"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "attribute", "Python attribute"], "4": ["py", "function", "Python function"], "5": ["py", "exception", "Python exception"], "6": ["std", "cmdoption", "program option"]}, "titleterms": {"launch": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 56], "cli": [0, 1, 2, 3, 4], "bin": 0, "modul": [0, 1, 3, 5, 6, 8, 9, 10, 11, 13, 16, 19, 20, 21, 23, 24, 25, 26, 28, 29, 30, 31, 32, 34, 35, 36, 40, 41, 42, 44, 45, 46, 49], "content": [0, 1, 3, 5, 6, 8, 9, 10, 11, 13, 16, 18, 19, 20, 21, 23, 24, 25, 26, 28, 29, 30, 31, 32, 34, 35, 36, 37, 40, 41, 42, 43, 44, 45, 46, 49], "function": [0, 1, 3, 29, 31, 35, 43, 46, 49], "bundl": [1, 4, 55], "client": [2, 5], "endpoint": [3, 4, 55], "delet": 4, "get": 4, "list": 4, "creation": 4, "log": 4, "class": [5, 6, 8, 9, 10, 11, 13, 16, 18, 19, 20, 21, 23, 24, 25, 26, 28, 29, 32, 36, 37, 40, 41, 42, 43, 44, 45], "clientlib": [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31], "batch": [6, 7, 8, 9, 10, 55], "implement": [6, 21], "named_arrai": [8, 23], "attribut": [8, 9, 19, 23, 24, 28], "single_arrai": [9, 24], "type": [10, 25, 30], "core": 11, "demonstr": 12, "deploy": [13, 42, 51], "ex": [14, 15], "run_servic": 15, "full_servic": 16, "http": 17, "packag": [18, 37, 43], "loader": 19, "model": 20, "model_servic": [21, 22, 23, 24, 25], "object_conf_from_std_ml_serv": 26, "pipelin": [27, 42, 43, 44, 45, 46], "servic": [28, 45], "triton": 29, "util": [31, 46, 49], "connect": 32, "constant": 33, "error": 34, "find_packag": 35, "hook": 36, "subpackag": 37, "submodul": 37, "logger": 38, "make_batch_fil": 39, "model_bundl": 40, "model_endpoint": 41, "runtim": 44, "request_valid": 47, "retry_strategi": 48, "deploi": 50, "your": [50, 54], "code": [50, 54], "introduct": 51, "scale": [51, 53], "modelbundl": 51, "modelendpoint": 51, "batchjob": 51, "choos": 51, "right": 51, "infer": 51, "mode": 51, "overview": 51, "step": 51, "how": 52, "guid": 52, "integr": 53, "train": 53, "insight": 53, "nucleu": 53, "regist": 54, "troubleshoot": 55, "job": 55, "welcom": 56, "api": 56, "refer": 56, "instal": 56, "section": 56, "index": 56}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx": 56}}) \ No newline at end of file diff --git a/launch/__init__.py b/launch/__init__.py index 33b4bc6d..d204b724 100644 --- a/launch/__init__.py +++ b/launch/__init__.py @@ -12,6 +12,7 @@ from .client import LaunchClient from .connection import Connection +from .hooks import PostInferenceHooks from .model_bundle import ModelBundle from .model_endpoint import ( AsyncEndpoint, @@ -32,5 +33,6 @@ "EndpointResponseFuture", "LaunchClient", "ModelBundle", + "PostInferenceHooks", "SyncEndpoint", ] diff --git a/launch/cli/bin.py b/launch/cli/bin.py index 1d91244b..26b5ce41 100644 --- a/launch/cli/bin.py +++ b/launch/cli/bin.py @@ -7,14 +7,13 @@ from launch.cli.tasks import tasks -@click.group("cli") -@click.pass_context -def entry_point(ctx, **kwargs): - """ +class RichGroup(click.Group): + def format_help(self, ctx, formatter): + formatter.width = 118 + formatter.write( + """ This is the command line interface (CLI) package for Scale Launch. - .. code-block:: text - ██╗ █████╗ ██╗ ██╗███╗ ██╗ ██████╗██╗ ██╗ ██║ ██╔══██╗██║ ██║████╗ ██║██╔════╝██║ ██║ ██║ ███████║██║ ██║██╔██╗ ██║██║ ███████║ @@ -22,7 +21,14 @@ def entry_point(ctx, **kwargs): ███████╗██║ ██║╚██████╔╝██║ ╚████║╚██████╗██║ ██║ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝ - """ +""" + ) + super().format_help(ctx, formatter) + + +@click.group("cli", cls=RichGroup) +@click.pass_context +def entry_point(ctx, **kwargs): ctx.obj = ContextObject().load() if ctx.obj.api_key is None: ctx.invoke(set_config) diff --git a/launch/cli/config.py b/launch/cli/config.py index 3b4a781f..67ec2707 100644 --- a/launch/cli/config.py +++ b/launch/cli/config.py @@ -43,7 +43,7 @@ def save(self): @click.pass_context def config(ctx: click.Context): """ - Config is a wrapper around getting and setting your Scale Launch configuration + Config is a wrapper around getting and setting your API key and other configuration options """ diff --git a/launch/client.py b/launch/client.py index b6492315..252f302c 100644 --- a/launch/client.py +++ b/launch/client.py @@ -172,8 +172,9 @@ def register_upload_bundle_fn(self, upload_bundle_fn: Callable[[str, str], None] See ``register_bundle_location_fn`` for more notes on the signature of ``upload_bundle_fn`` - Parameters: upload_bundle_fn: Function that takes in a serialized bundle (bytes type), - and uploads that bundle to an appropriate location. Only needed for self-hosted mode. + Parameters: + upload_bundle_fn: Function that takes in a serialized bundle (bytes type), + and uploads that bundle to an appropriate location. Only needed for self-hosted mode. """ self.upload_bundle_fn = upload_bundle_fn @@ -187,8 +188,9 @@ def register_upload_batch_csv_fn(self, upload_batch_csv_fn: Callable[[str, str], This function should directly write the contents of ``csv_text`` as a text string into ``csv_url``. - Parameters: upload_batch_csv_fn: Function that takes in a csv text (string type), - and uploads that bundle to an appropriate location. Only needed for self-hosted mode. + Parameters: + upload_batch_csv_fn: Function that takes in a csv text (string type), + and uploads that bundle to an appropriate location. Only needed for self-hosted mode. """ self.upload_batch_csv_fn = upload_batch_csv_fn @@ -290,13 +292,14 @@ def create_model_bundle_from_dirs( then the `load_predict_fn_module_path` argument should be `my_module1.my_inference_file.f`. - Parameters: model_bundle_name: The name of the model bundle you want to create. The name - must be unique across all bundles that you own. + Parameters: + model_bundle_name: The name of the model bundle you want to create. The name + must be unique across all bundles that you own. base_paths: The paths on the local filesystem where the bundle code lives. requirements_path: A path on the local filesystem where a ``requirements.txt`` file - lives. + lives. env_params: A dictionary that dictates environment information e.g. the use of pytorch or tensorflow, which base image tag to use, etc. @@ -315,14 +318,14 @@ def create_model_bundle_from_dirs( } load_predict_fn_module_path: A python module path for a function that, when called - with the output of load_model_fn_module_path, returns a function that carries out - inference. + with the output of load_model_fn_module_path, returns a function that carries out + inference. load_model_fn_module_path: A python module path for a function that returns a model. - The output feeds into the function located at load_predict_fn_module_path. + The output feeds into the function located at load_predict_fn_module_path. app_config: Either a Dictionary that represents a YAML file contents or a local path - to a YAML file. + to a YAML file. request_schema: A pydantic model that represents the request schema for the model bundle. This is used to validate the request body for the model bundle's endpoint. @@ -426,24 +429,25 @@ def create_model_bundle( # pylint: disable=too-many-statements Pre/post-processing code can be included inside load_predict_fn/model or in predict_fn_or_cls call. - Parameters: model_bundle_name: The name of the model bundle you want to create. The name - must be unique across all bundles that you own. + Parameters: + model_bundle_name: The name of the model bundle you want to create. The name + must be unique across all bundles that you own. - predict_fn_or_cls: ``Function`` or a ``Callable`` class that runs end-to-end ( - pre/post processing and model inference) on the call. i.e. ``predict_fn_or_cls( - REQUEST) -> RESPONSE``. + predict_fn_or_cls: `Function` or a ``Callable`` class that runs end-to-end + (pre/post processing and model inference) on the call. i.e. + ``predict_fn_or_cls(REQUEST) -> RESPONSE``. model: Typically a trained Neural Network, e.g. a Pytorch module. Exactly one of ``model`` and ``load_model_fn`` must be provided. load_model_fn: A function that, when run, loads a model. This function is essentially - a deferred wrapper around the ``model`` argument. + a deferred wrapper around the ``model`` argument. Exactly one of ``model`` and ``load_model_fn`` must be provided. load_predict_fn: Function that, when called with a model, returns a function that - carries out inference. + carries out inference. If ``model`` is specified, then this is equivalent to: @@ -457,7 +461,7 @@ def create_model_bundle( # pylint: disable=too-many-statements requirements: A list of python package requirements, where each list element is of - the form ``==``, e.g. + the form ``==``, e.g. ``["tensorflow==2.3.0", "tensorflow-hub==0.11.0"]`` @@ -465,7 +469,7 @@ def create_model_bundle( # pylint: disable=too-many-statements ``globals()`` for the ``globals_copy`` argument. app_config: Either a Dictionary that represents a YAML file contents or a local path - to a YAML file. + to a YAML file. env_params: A dictionary that dictates environment information e.g. the use of pytorch or tensorflow, which base image tag to use, etc. @@ -486,8 +490,8 @@ def create_model_bundle( # pylint: disable=too-many-statements - Tensorflow fields: - ``tensorflow_version``: Version of tensorflow, e.g. ``"2.3.0"``. - globals_copy: Dictionary of the global symbol table. Normally provided by ``globals( - )`` built-in function. + globals_copy: Dictionary of the global symbol table. Normally provided by + ``globals()`` built-in function. request_schema: A pydantic model that represents the request schema for the model bundle. This is used to validate the request body for the model bundle's endpoint. @@ -626,36 +630,37 @@ def create_model_endpoint( instance of type ``Endpoint``, which is a base class of either ``SyncEndpoint`` or ``AsyncEndpoint``. This is the object to which you sent inference requests. - Parameters: endpoint_name: The name of the model endpoint you want to create. The name - must be unique across all endpoints that you own. + Parameters: + endpoint_name: The name of the model endpoint you want to create. The name + must be unique across all endpoints that you own. model_bundle: The ``ModelBundle`` that the endpoint should serve. cpus: Number of cpus each worker should get, e.g. 1, 2, etc. This must be greater - than or equal to 1. + than or equal to 1. memory: Amount of memory each worker should get, e.g. "4Gi", "512Mi", etc. This must - be a positive amount of memory. + be a positive amount of memory. storage: Amount of local ephemeral storage each worker should get, e.g. "4Gi", - "512Mi", etc. This must be a positive amount of storage. + "512Mi", etc. This must be a positive amount of storage. gpus: Number of gpus each worker should get, e.g. 0, 1, etc. min_workers: The minimum number of workers. Must be greater than or equal to 0. This - should be determined by computing the minimum throughput of your workload and - dividing it by the throughput of a single worker. This field must be at least ``1`` - for synchronous endpoints. + should be determined by computing the minimum throughput of your workload and + dividing it by the throughput of a single worker. This field must be at least ``1`` + for synchronous endpoints. max_workers: The maximum number of workers. Must be greater than or equal to 0, - and as well as greater than or equal to ``min_workers``. This should be determined by - computing the maximum throughput of your workload and dividing it by the throughput - of a single worker. + and as well as greater than or equal to ``min_workers``. This should be determined by + computing the maximum throughput of your workload and dividing it by the throughput + of a single worker. per_worker: The maximum number of concurrent requests that an individual worker can - service. Launch automatically scales the number of workers for the endpoint so that - each worker is processing ``per_worker`` requests, subject to the limits defined by - ``min_workers`` and ``max_workers``. + service. Launch automatically scales the number of workers for the endpoint so that + each worker is processing ``per_worker`` requests, subject to the limits defined by + ``min_workers`` and ``max_workers``. - If the average number of concurrent requests per worker is lower than ``per_worker``, then the number of workers will be reduced. - Otherwise, @@ -671,7 +676,7 @@ def create_model_endpoint( this ensures that the number of workers will "climb" to ``max_workers``. gpu_type: If specifying a non-zero number of gpus, this controls the type of gpu - requested. Here are the supported values: + requested. Here are the supported values: - ``nvidia-tesla-t4`` - ``nvidia-ampere-a10`` @@ -685,9 +690,9 @@ def create_model_endpoint( post_inference_hooks must contain "callback" for the callback to be triggered. update_if_exists: If ``True``, will attempt to update the endpoint if it exists. - Otherwise, will unconditionally try to create a new endpoint. Note that endpoint - names for a given user must be unique, so attempting to call this function with - ``update_if_exists=False`` for an existing endpoint will raise an error. + Otherwise, will unconditionally try to create a new endpoint. Note that endpoint + names for a given user must be unique, so attempting to call this function with + ``update_if_exists=False`` for an existing endpoint will raise an error. labels: An optional dictionary of key/value pairs to associate with this endpoint. @@ -695,7 +700,8 @@ def create_model_endpoint( A Endpoint object that can be used to make requests to the endpoint. """ - if update_if_exists and self.get_model_endpoint(endpoint_name): + existing_endpoint = self.get_model_endpoint(endpoint_name) + if update_if_exists and existing_endpoint: self.edit_model_endpoint( model_endpoint=endpoint_name, model_bundle=model_bundle, @@ -709,9 +715,7 @@ def create_model_endpoint( gpu_type=gpu_type, default_callback_url=default_callback_url, ) - # R1710: Either all return statements in a function should return an expression, - # or none of them should. - return None + return existing_endpoint else: # Presumably, the user knows that the endpoint doesn't already exist, and so we can # defer to the server to reject any duplicate creations. @@ -720,6 +724,15 @@ def create_model_endpoint( api_instance = DefaultApi(api_client) if not isinstance(model_bundle, ModelBundle) or model_bundle.id is None: model_bundle = self.get_model_bundle(model_bundle) + post_inference_hooks_strs = None + if post_inference_hooks is not None: + post_inference_hooks_strs = [] + for hook in post_inference_hooks: + if isinstance(hook, PostInferenceHooks): + post_inference_hooks_strs.append(hook.value) + else: + post_inference_hooks_strs.append(hook) + payload = dict_not_none( cpus=cpus, endpoint_type=ModelEndpointType(endpoint_type), @@ -733,7 +746,7 @@ def create_model_endpoint( model_bundle_id=model_bundle.id, name=endpoint_name, per_worker=per_worker, - post_inference_hooks=post_inference_hooks or [], + post_inference_hooks=post_inference_hooks_strs, default_callback_url=default_callback_url, storage=storage, ) @@ -776,30 +789,31 @@ def edit_model_endpoint( - The endpoint's name. - The endpoint's type (i.e. you cannot go from a ``SyncEnpdoint`` to an ``AsyncEndpoint`` or vice versa. - Parameters: model_endpoint: The model endpoint (or its name) you want to edit. The name - must be unique across all endpoints that you own. + Parameters: + model_endpoint: The model endpoint (or its name) you want to edit. The name + must be unique across all endpoints that you own. model_bundle: The ``ModelBundle`` that the endpoint should serve. cpus: Number of cpus each worker should get, e.g. 1, 2, etc. This must be greater - than or equal to 1. + than or equal to 1. memory: Amount of memory each worker should get, e.g. "4Gi", "512Mi", etc. This must - be a positive amount of memory. + be a positive amount of memory. storage: Amount of local ephemeral storage each worker should get, e.g. "4Gi", - "512Mi", etc. This must be a positive amount of storage. + "512Mi", etc. This must be a positive amount of storage. gpus: Number of gpus each worker should get, e.g. 0, 1, etc. min_workers: The minimum number of workers. Must be greater than or equal to 0. max_workers: The maximum number of workers. Must be greater than or equal to 0, - and as well as greater than or equal to ``min_workers``. + and as well as greater than or equal to ``min_workers``. per_worker: The maximum number of concurrent requests that an individual worker can - service. Launch automatically scales the number of workers for the endpoint so that - each worker is processing ``per_worker`` requests: + service. Launch automatically scales the number of workers for the endpoint so that + each worker is processing ``per_worker`` requests: - If the average number of concurrent requests per worker is lower than ``per_worker``, then the number of workers will be reduced. - Otherwise, @@ -808,7 +822,7 @@ def edit_model_endpoint( traffic. gpu_type: If specifying a non-zero number of gpus, this controls the type of gpu - requested. Here are the supported values: + requested. Here are the supported values: - ``nvidia-tesla-t4`` - ``nvidia-ampere-a10`` @@ -841,6 +855,15 @@ def edit_model_endpoint( model_endpoint_full = self.get_model_endpoint(endpoint_name) model_endpoint_id = model_endpoint_full.model_endpoint.id # type: ignore + post_inference_hooks_strs = None + if post_inference_hooks is not None: + post_inference_hooks_strs = [] + for hook in post_inference_hooks: + if isinstance(hook, PostInferenceHooks): + post_inference_hooks_strs.append(hook.value) + else: + post_inference_hooks_strs.append(hook) + payload = dict_not_none( cpus=cpus, gpus=gpus, @@ -850,7 +873,7 @@ def edit_model_endpoint( min_workers=min_workers, model_bundle_id=model_bundle_id, per_worker=per_worker, - post_inference_hooks=post_inference_hooks or [], + post_inference_hooks=post_inference_hooks_strs, default_callback_url=default_callback_url, storage=storage, ) @@ -934,8 +957,10 @@ def clone_model_bundle_with_changes( """ Clones an existing model bundle with changes to its app config. (More fields coming soon) - Parameters: model_bundle: The existing bundle or its ID. app_config: The new bundle's app - config, if not passed in, the new bundle's ``app_config`` will be set to ``None`` + Parameters: + model_bundle: The existing bundle or its ID. + app_config: The new bundle's app config, if not passed in, the new + bundle's ``app_config`` will be set to ``None`` Returns: A ``ModelBundle`` object @@ -1206,7 +1231,7 @@ def batch_async_request( model_bundle: The bundle or the name of a the bundle to use for inference. urls: A list of urls, each pointing to a file containing model input. Must be - accessible by Scale Launch, hence urls need to either be public or signedURLs. + accessible by Scale Launch, hence urls need to either be public or signedURLs. inputs: A list of model inputs, if exists, we will upload the inputs and pass it in to Launch. @@ -1231,8 +1256,6 @@ def batch_async_request( gpus: Number of gpus each worker should get, e.g. 0, 1, etc. - min_workers: The minimum number of workers. Must be greater than or equal to 0. - max_workers: The maximum number of workers. Must be greater than or equal to 0, and as well as greater than or equal to ``min_workers``. diff --git a/launch/hooks.py b/launch/hooks.py index bf6c933d..6feedae5 100644 --- a/launch/hooks.py +++ b/launch/hooks.py @@ -2,5 +2,12 @@ class PostInferenceHooks(str, Enum): - INSIGHT = "insight" - CALLBACK = "callback" + """ + Post-inference hooks are functions that are called after inference is complete. + + Attributes: + CALLBACK: The callback hook is called with the inference response and the task ID. + """ + + # INSIGHT = "insight" + CALLBACK: str = "callback" diff --git a/launch/model_endpoint.py b/launch/model_endpoint.py index b3ac1f72..8bf220e3 100644 --- a/launch/model_endpoint.py +++ b/launch/model_endpoint.py @@ -2,6 +2,7 @@ import json import time import uuid +from abc import ABC, abstractmethod from collections import Counter from dataclasses import dataclass from typing import Dict, List, Optional, Sequence @@ -248,7 +249,7 @@ def get(self, timeout: Optional[float] = None) -> EndpointResponse: raise TimeoutError -class Endpoint: +class Endpoint(ABC): """An abstract class that represent any kind of endpoints in Scale Launch""" def __init__(self, model_endpoint: ModelEndpoint, client): @@ -284,6 +285,10 @@ def deployment_state(self) -> Optional[dict]: self._update_model_endpoint_view() return self.model_endpoint.deployment_state + @abstractmethod + def predict(self, request: EndpointRequest): + """Runs a prediction request.""" + class SyncEndpoint(Endpoint): """ @@ -377,9 +382,9 @@ def predict(self, request: EndpointRequest) -> EndpointResponseFuture: .. code-block:: python - my_endpoint = AsyncEndpoint(...) - f: EndpointResponseFuture = my_endpoint.predict(EndpointRequest(...)) - result = f.get() # blocks on completion + my_endpoint = AsyncEndpoint(...) + f: EndpointResponseFuture = my_endpoint.predict(EndpointRequest(...)) + result = f.get() # blocks on completion """ response = self.client._async_request( # pylint: disable=W0212 self.model_endpoint.name, diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..572a08ad --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,88 @@ +site_name: Launch +site_description: Simple, modern and high performance machine learning deployment in python. +site_url: https://scaleapi.github.io/launch-python-client/ + +theme: + name: material + palette: + - scheme: default + primary: blue grey + accent: indigo + toggle: + icon: material/lightbulb + name: Switch to dark mode + - scheme: slate + primary: blue grey + accent: indigo + toggle: + icon: material/lightbulb-outline + name: Switch to light mode + features: + - search.suggest + - search.highlight + - content.tabs.link + - content.code.annotate + icon: + repo: fontawesome/brands/github-alt + logo: _static/launch-logo.svg + favicon: _static/favicon-32x32.png + language: en + +repo_name: scaleapi/launch-python-client +repo_url: https://github.com/scaleapi/launch-python-client +edit_uri: '' +nav: + - Introduction: index.md + - CLI: cli.md + - Concepts: + - concepts/overview.md + - concepts/model_bundles.md + - concepts/model_endpoints.md + - concepts/endpoint_predictions.md + - concepts/batch_jobs.md + - concepts/callbacks.md + - 'API Documentation': + - api/client.md + - api/model_bundles.md + - api/model_endpoints.md + - api/endpoint_predictions.md + - api/hooks.md + +markdown_extensions: + - toc: + permalink: true + - admonition + - pymdownx.details + - pymdownx.superfences + - pymdownx.highlight: + anchor_linenums: true + - pymdownx.inlinehilite + - pymdownx.snippets + - attr_list + - md_in_html + - mdx_include + - pymdownx.emoji: + emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg + - pymdownx.tabbed: + alternate_style: true + +plugins: + - search + - mkdocstrings: + watch: [launch] + handlers: + python: + rendering: + show_root_heading: true + show_root_full_path: false + show_source: false + heading_level: 2 + merge_init_into_class: true + show_signature_annotations: true + separate_signature: true + - mkdocs-simple-hooks: + hooks: + on_pre_build: 'docs.plugins:on_pre_build' + on_files: 'docs.plugins:on_files' + on_page_markdown: 'docs.plugins:on_page_markdown' diff --git a/poetry.lock b/poetry.lock index d88ead06..68810265 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,17 +1,5 @@ # This file is automatically @generated by Poetry and should not be changed by hand. -[[package]] -name = "alabaster" -version = "0.7.13" -description = "A configurable sidebar-enabled Sphinx theme" -category = "dev" -optional = false -python-versions = ">=3.6" -files = [ - {file = "alabaster-0.7.13-py3-none-any.whl", hash = "sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3"}, - {file = "alabaster-0.7.13.tar.gz", hash = "sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2"}, -] - [[package]] name = "astroid" version = "2.11.7" @@ -50,40 +38,6 @@ docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib- tests = ["attrs[tests-no-zope]", "zope.interface"] tests-no-zope = ["cloudpickle", "cloudpickle", "hypothesis", "hypothesis", "mypy (>=0.971,<0.990)", "mypy (>=0.971,<0.990)", "pympler", "pympler", "pytest (>=4.3.0)", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-mypy-plugins", "pytest-xdist[psutil]", "pytest-xdist[psutil]"] -[[package]] -name = "babel" -version = "2.11.0" -description = "Internationalization utilities" -category = "dev" -optional = false -python-versions = ">=3.6" -files = [ - {file = "Babel-2.11.0-py3-none-any.whl", hash = "sha256:1ad3eca1c885218f6dce2ab67291178944f810a10a9b5f3cb8382a5a232b64fe"}, - {file = "Babel-2.11.0.tar.gz", hash = "sha256:5ef4b3226b0180dedded4229651c8b0e1a3a6a2837d45a073272f313e4cf97f6"}, -] - -[package.dependencies] -pytz = ">=2015.7" - -[[package]] -name = "beautifulsoup4" -version = "4.11.2" -description = "Screen-scraping library" -category = "dev" -optional = false -python-versions = ">=3.6.0" -files = [ - {file = "beautifulsoup4-4.11.2-py3-none-any.whl", hash = "sha256:0e79446b10b3ecb499c1556f7e228a53e64a2bfcebd455f370d8927cb5b59e39"}, - {file = "beautifulsoup4-4.11.2.tar.gz", hash = "sha256:bc4bdda6717de5a2987436fb8d72f45dc90dd856bdfd512a1314ce90349a0106"}, -] - -[package.dependencies] -soupsieve = ">1.2" - -[package.extras] -html5lib = ["html5lib"] -lxml = ["lxml"] - [[package]] name = "black" version = "23.1.0" @@ -135,6 +89,18 @@ d = ["aiohttp (>=3.7.4)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] +[[package]] +name = "cached-property" +version = "1.5.2" +description = "A decorator for caching properties in classes." +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "cached-property-1.5.2.tar.gz", hash = "sha256:9fa5755838eecbb2d234c3aa390bd80fbd3ac6b6869109bfc1b499f7bd89a130"}, + {file = "cached_property-1.5.2-py2.py3-none-any.whl", hash = "sha256:df4f613cf7ad9a588cc381aaf4a512d26265ecebd5eb9e1ba12f1319eb85a6a0"}, +] + [[package]] name = "certifi" version = "2022.12.7" @@ -273,22 +239,6 @@ files = [ colorama = {version = "*", markers = "platform_system == \"Windows\""} importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} -[[package]] -name = "click-config-file" -version = "0.6.0" -description = "Configuration file support for click applications." -category = "main" -optional = false -python-versions = "*" -files = [ - {file = "click_config_file-0.6.0-py2.py3-none-any.whl", hash = "sha256:3c5802dec437ed596f181efc988f62b1069cd48a912e280cd840ee70580f39d7"}, - {file = "click_config_file-0.6.0.tar.gz", hash = "sha256:ded6ec1a73c41280727ec9c06031e929cdd8a5946bf0f99c0c3db3a71793d515"}, -] - -[package.dependencies] -click = ">=6.7" -configobj = ">=5.0.6" - [[package]] name = "cloudpickle" version = "2.2.1" @@ -328,21 +278,6 @@ files = [ [package.extras] test = ["flake8 (==3.7.8)", "hypothesis (==3.55.3)"] -[[package]] -name = "configobj" -version = "5.0.8" -description = "Config file reading, writing and validation." -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -files = [ - {file = "configobj-5.0.8-py2.py3-none-any.whl", hash = "sha256:a7a8c6ab7daade85c3f329931a807c8aee750a2494363934f8ea84d8a54c87ea"}, - {file = "configobj-5.0.8.tar.gz", hash = "sha256:6f704434a07dc4f4dc7c9a745172c1cad449feb548febd9f7fe362629c627a97"}, -] - -[package.dependencies] -six = "*" - [[package]] name = "coverage" version = "6.5.0" @@ -406,6 +341,18 @@ files = [ [package.extras] toml = ["tomli"] +[[package]] +name = "cyclic" +version = "1.0.0" +description = "Handle cyclic relations" +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "cyclic-1.0.0-py3-none-any.whl", hash = "sha256:32d8181d7698f426bce6f14f4c3921ef95b6a84af9f96192b59beb05bc00c3ed"}, + {file = "cyclic-1.0.0.tar.gz", hash = "sha256:ecddd56cb831ee3e6b79f61ecb0ad71caee606c507136867782911aa01c3e5eb"}, +] + [[package]] name = "dataclasses-json" version = "0.5.7" @@ -468,18 +415,6 @@ files = [ {file = "distlib-0.3.6.tar.gz", hash = "sha256:14bad2d9b04d3a36127ac97f30b12a19268f211063d8f8ee4f47108896e11b46"}, ] -[[package]] -name = "docutils" -version = "0.19" -description = "Docutils -- Python Documentation Utilities" -category = "dev" -optional = false -python-versions = ">=3.7" -files = [ - {file = "docutils-0.19-py3-none-any.whl", hash = "sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc"}, - {file = "docutils-0.19.tar.gz", hash = "sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6"}, -] - [[package]] name = "exceptiongroup" version = "1.1.0" @@ -538,22 +473,41 @@ files = [ ] [[package]] -name = "furo" -version = "2022.12.7" -description = "A clean customisable Sphinx documentation theme." +name = "ghp-import" +version = "2.1.0" +description = "Copy your docs directly to the gh-pages branch." +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "ghp-import-2.1.0.tar.gz", hash = "sha256:9c535c4c61193c2df8871222567d7fd7e5014d835f97dc7b7439069e2413d343"}, + {file = "ghp_import-2.1.0-py3-none-any.whl", hash = "sha256:8337dd7b50877f163d4c0289bc1f1c7f127550241988d568c1db512c4324a619"}, +] + +[package.dependencies] +python-dateutil = ">=2.8.1" + +[package.extras] +dev = ["flake8", "markdown", "twine", "wheel"] + +[[package]] +name = "griffe" +version = "0.25.5" +description = "Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "furo-2022.12.7-py3-none-any.whl", hash = "sha256:7cb76c12a25ef65db85ab0743df907573d03027a33631f17d267e598ebb191f7"}, - {file = "furo-2022.12.7.tar.gz", hash = "sha256:d8008f8efbe7587a97ba533c8b2df1f9c21ee9b3e5cad0d27f61193d38b1a986"}, + {file = "griffe-0.25.5-py3-none-any.whl", hash = "sha256:1fb9edff48e66d4873014a2ebf21aca5f271d0006a4c937826e3cf592ffb3706"}, + {file = "griffe-0.25.5.tar.gz", hash = "sha256:11ea3403ef0560a1cbcf7f302eb5d21cf4c1d8ed3f8a16a75aa9f6f458caf3f1"}, ] [package.dependencies] -beautifulsoup4 = "*" -pygments = ">=2.7" -sphinx = ">=5.0,<7.0" -sphinx-basic-ng = "*" +cached-property = {version = "*", markers = "python_version < \"3.8\""} +colorama = ">=0.4" + +[package.extras] +async = ["aiofiles (>=0.7,<1.0)"] [[package]] name = "identify" @@ -582,18 +536,6 @@ files = [ {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, ] -[[package]] -name = "imagesize" -version = "1.4.1" -description = "Getting image size from png/jpeg/jpeg2000/gif file" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, - {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, -] - [[package]] name = "importlib-metadata" version = "6.0.0" @@ -710,20 +652,22 @@ files = [ ] [[package]] -name = "livereload" -version = "2.6.3" -description = "Python LiveReload is an awesome tool for web developers" +name = "markdown" +version = "3.3.7" +description = "Python implementation of Markdown." category = "dev" optional = false -python-versions = "*" +python-versions = ">=3.6" files = [ - {file = "livereload-2.6.3-py2.py3-none-any.whl", hash = "sha256:ad4ac6f53b2d62bb6ce1a5e6e96f1f00976a32348afedcb4b6d68df2a1d346e4"}, - {file = "livereload-2.6.3.tar.gz", hash = "sha256:776f2f865e59fde56490a56bcc6773b6917366bce0c267c60ee8aaf1a0959869"}, + {file = "Markdown-3.3.7-py3-none-any.whl", hash = "sha256:f5da449a6e1c989a4cea2631aa8ee67caa5a2ef855d551c88f9e309f4634c621"}, + {file = "Markdown-3.3.7.tar.gz", hash = "sha256:cbb516f16218e643d8e0a95b309f77eb118cb138d39a4f27851e6a63581db874"}, ] [package.dependencies] -six = "*" -tornado = {version = "*", markers = "python_version > \"2.7\""} +importlib-metadata = {version = ">=4.4", markers = "python_version < \"3.10\""} + +[package.extras] +testing = ["coverage", "pyyaml"] [[package]] name = "markupsafe" @@ -833,6 +777,176 @@ files = [ {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, ] +[[package]] +name = "mdx-include" +version = "1.4.2" +description = "Python Markdown extension to include local or remote files" +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "mdx_include-1.4.2-py3-none-any.whl", hash = "sha256:cfbeadd59985f27a9b70cb7ab0a3d209892fe1bb1aa342df055e0b135b3c9f34"}, + {file = "mdx_include-1.4.2.tar.gz", hash = "sha256:992f9fbc492b5cf43f7d8cb4b90b52a4e4c5fdd7fd04570290a83eea5c84f297"}, +] + +[package.dependencies] +cyclic = "*" +Markdown = ">=2.6" +rcslice = ">=1.1.0" + +[[package]] +name = "mergedeep" +version = "1.3.4" +description = "A deep merge function for 🐍." +category = "dev" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mergedeep-1.3.4-py3-none-any.whl", hash = "sha256:70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307"}, + {file = "mergedeep-1.3.4.tar.gz", hash = "sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8"}, +] + +[[package]] +name = "mkdocs" +version = "1.4.2" +description = "Project documentation with Markdown." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "mkdocs-1.4.2-py3-none-any.whl", hash = "sha256:c8856a832c1e56702577023cd64cc5f84948280c1c0fcc6af4cd39006ea6aa8c"}, + {file = "mkdocs-1.4.2.tar.gz", hash = "sha256:8947af423a6d0facf41ea1195b8e1e8c85ad94ac95ae307fe11232e0424b11c5"}, +] + +[package.dependencies] +click = ">=7.0" +colorama = {version = ">=0.4", markers = "platform_system == \"Windows\""} +ghp-import = ">=1.0" +importlib-metadata = {version = ">=4.3", markers = "python_version < \"3.10\""} +jinja2 = ">=2.11.1" +markdown = ">=3.2.1,<3.4" +mergedeep = ">=1.3.4" +packaging = ">=20.5" +pyyaml = ">=5.1" +pyyaml-env-tag = ">=0.1" +typing-extensions = {version = ">=3.10", markers = "python_version < \"3.8\""} +watchdog = ">=2.0" + +[package.extras] +i18n = ["babel (>=2.9.0)"] +min-versions = ["babel (==2.9.0)", "click (==7.0)", "colorama (==0.4)", "ghp-import (==1.0)", "importlib-metadata (==4.3)", "jinja2 (==2.11.1)", "markdown (==3.2.1)", "markupsafe (==2.0.1)", "mergedeep (==1.3.4)", "packaging (==20.5)", "pyyaml (==5.1)", "pyyaml-env-tag (==0.1)", "typing-extensions (==3.10)", "watchdog (==2.0)"] + +[[package]] +name = "mkdocs-autorefs" +version = "0.4.1" +description = "Automatically link across pages in MkDocs." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "mkdocs-autorefs-0.4.1.tar.gz", hash = "sha256:70748a7bd025f9ecd6d6feeba8ba63f8e891a1af55f48e366d6d6e78493aba84"}, + {file = "mkdocs_autorefs-0.4.1-py3-none-any.whl", hash = "sha256:a2248a9501b29dc0cc8ba4c09f4f47ff121945f6ce33d760f145d6f89d313f5b"}, +] + +[package.dependencies] +Markdown = ">=3.3" +mkdocs = ">=1.1" + +[[package]] +name = "mkdocs-material" +version = "9.0.15" +description = "Documentation that simply works" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "mkdocs_material-9.0.15-py3-none-any.whl", hash = "sha256:734bcf6af9759888385ee15952c2e8a475d8568ded20965da321f0d8117dfe8f"}, + {file = "mkdocs_material-9.0.15.tar.gz", hash = "sha256:d856bc67bc0115b1f258ca012724e17b72a9aea9b8b4d287c38460704f14eeb4"}, +] + +[package.dependencies] +colorama = ">=0.4" +jinja2 = ">=3.0" +markdown = ">=3.2" +mkdocs = ">=1.4.2" +mkdocs-material-extensions = ">=1.1" +pygments = ">=2.14" +pymdown-extensions = ">=9.9.1" +regex = ">=2022.4.24" +requests = ">=2.26" + +[[package]] +name = "mkdocs-material-extensions" +version = "1.1.1" +description = "Extension pack for Python Markdown and MkDocs Material." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "mkdocs_material_extensions-1.1.1-py3-none-any.whl", hash = "sha256:e41d9f38e4798b6617ad98ca8f7f1157b1e4385ac1459ca1e4ea219b556df945"}, + {file = "mkdocs_material_extensions-1.1.1.tar.gz", hash = "sha256:9c003da71e2cc2493d910237448c672e00cefc800d3d6ae93d2fc69979e3bd93"}, +] + +[[package]] +name = "mkdocs-simple-hooks" +version = "0.1.5" +description = "Define your own hooks for mkdocs, without having to create a new package." +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "mkdocs-simple-hooks-0.1.5.tar.gz", hash = "sha256:dddbdf151a18723c9302a133e5cf79538be8eb9d274e8e07d2ac3ac34890837c"}, + {file = "mkdocs_simple_hooks-0.1.5-py3-none-any.whl", hash = "sha256:efeabdbb98b0850a909adee285f3404535117159d5cb3a34f541d6eaa644d50a"}, +] + +[package.dependencies] +mkdocs = ">=1.2" + +[package.extras] +test = ["pytest (>=4.0)", "pytest-cov"] + +[[package]] +name = "mkdocstrings" +version = "0.20.0" +description = "Automatic documentation from sources, for MkDocs." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "mkdocstrings-0.20.0-py3-none-any.whl", hash = "sha256:f17fc2c4f760ec302b069075ef9e31045aa6372ca91d2f35ded3adba8e25a472"}, + {file = "mkdocstrings-0.20.0.tar.gz", hash = "sha256:c757f4f646d4f939491d6bc9256bfe33e36c5f8026392f49eaa351d241c838e5"}, +] + +[package.dependencies] +Jinja2 = ">=2.11.1" +Markdown = ">=3.3" +MarkupSafe = ">=1.1" +mkdocs = ">=1.2" +mkdocs-autorefs = ">=0.3.1" +mkdocstrings-python = {version = ">=0.5.2", optional = true, markers = "extra == \"python\""} +pymdown-extensions = ">=6.3" + +[package.extras] +crystal = ["mkdocstrings-crystal (>=0.3.4)"] +python = ["mkdocstrings-python (>=0.5.2)"] +python-legacy = ["mkdocstrings-python-legacy (>=0.2.1)"] + +[[package]] +name = "mkdocstrings-python" +version = "0.8.3" +description = "A Python handler for mkdocstrings." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "mkdocstrings-python-0.8.3.tar.gz", hash = "sha256:9ae473f6dc599339b09eee17e4d2b05d6ac0ec29860f3fc9b7512d940fc61adf"}, + {file = "mkdocstrings_python-0.8.3-py3-none-any.whl", hash = "sha256:4e6e1cd6f37a785de0946ced6eb846eb2f5d891ac1cc2c7b832943d3529087a7"}, +] + +[package.dependencies] +griffe = ">=0.24" +mkdocstrings = ">=0.19" + [[package]] name = "mypy" version = "0.941" @@ -988,14 +1102,14 @@ virtualenv = ">=20.10.0" [[package]] name = "prompt-toolkit" -version = "3.0.37" +version = "3.0.38" description = "Library for building powerful interactive command lines in Python" category = "main" optional = false python-versions = ">=3.7.0" files = [ - {file = "prompt_toolkit-3.0.37-py3-none-any.whl", hash = "sha256:6a2948ec427dfcc7c983027b1044b355db6aaa8be374f54ad2015471f7d81c5b"}, - {file = "prompt_toolkit-3.0.37.tar.gz", hash = "sha256:d5d73d4b5eb1a92ba884a88962b157f49b71e06c4348b417dd622b25cdd3800b"}, + {file = "prompt_toolkit-3.0.38-py3-none-any.whl", hash = "sha256:45ea77a2f7c60418850331366c81cf6b5b9cf4c7fd34616f733c5427e6abbb1f"}, + {file = "prompt_toolkit-3.0.38.tar.gz", hash = "sha256:23ac5d50538a9a38c8bde05fecb47d0b403ecd0662857a86f886f798563d5b9b"}, ] [package.dependencies] @@ -1094,6 +1208,21 @@ typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\"" [package.extras] testutil = ["gitpython (>3)"] +[[package]] +name = "pymdown-extensions" +version = "9.9.2" +description = "Extension pack for Python Markdown." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pymdown_extensions-9.9.2-py3-none-any.whl", hash = "sha256:c3d804eb4a42b85bafb5f36436342a5ad38df03878bb24db8855a4aa8b08b765"}, + {file = "pymdown_extensions-9.9.2.tar.gz", hash = "sha256:ebb33069bafcb64d5f5988043331d4ea4929325dc678a6bcf247ddfcf96499f8"}, +] + +[package.dependencies] +markdown = ">=3.2" + [[package]] name = "pytest" version = "7.2.1" @@ -1119,6 +1248,24 @@ tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] +[[package]] +name = "pytest-mock" +version = "3.10.0" +description = "Thin-wrapper around the mock package for easier use with pytest" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-mock-3.10.0.tar.gz", hash = "sha256:fbbdb085ef7c252a326fd8cdcac0aa3b1333d8811f131bdcc701002e1be7ed4f"}, + {file = "pytest_mock-3.10.0-py3-none-any.whl", hash = "sha256:f4c973eeae0282963eb293eb173ce91b091a79c1334455acfac9ddee8a1c784b"}, +] + +[package.dependencies] +pytest = ">=5.0" + +[package.extras] +dev = ["pre-commit", "pytest-asyncio", "tox"] + [[package]] name = "python-dateutil" version = "2.8.2" @@ -1134,18 +1281,6 @@ files = [ [package.dependencies] six = ">=1.5" -[[package]] -name = "pytz" -version = "2022.7.1" -description = "World timezone definitions, modern and historical" -category = "dev" -optional = false -python-versions = "*" -files = [ - {file = "pytz-2022.7.1-py2.py3-none-any.whl", hash = "sha256:78f4f37d8198e0627c5f1143240bb0206b8691d8d7ac6d78fee88b78733f8c4a"}, - {file = "pytz-2022.7.1.tar.gz", hash = "sha256:01a0681c4b9684a28304615eba55d1ab31ae00bf68ec157ec3708a8182dbbcd0"}, -] - [[package]] name = "pyyaml" version = "6.0" @@ -1196,6 +1331,21 @@ files = [ {file = "PyYAML-6.0.tar.gz", hash = "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"}, ] +[[package]] +name = "pyyaml-env-tag" +version = "0.1" +description = "A custom YAML tag for referencing environment variables in YAML files. " +category = "dev" +optional = false +python-versions = ">=3.6" +files = [ + {file = "pyyaml_env_tag-0.1-py3-none-any.whl", hash = "sha256:af31106dec8a4d68c60207c1886031cbf839b68aa7abccdb19868200532c2069"}, + {file = "pyyaml_env_tag-0.1.tar.gz", hash = "sha256:70092675bda14fdec33b31ba77e7543de9ddc88f2e5b99160396572d11525bdb"}, +] + +[package.dependencies] +pyyaml = "*" + [[package]] name = "questionary" version = "1.10.0" @@ -1214,6 +1364,116 @@ prompt_toolkit = ">=2.0,<4.0" [package.extras] docs = ["Sphinx (>=3.3,<4.0)", "sphinx-autobuild (>=2020.9.1,<2021.0.0)", "sphinx-autodoc-typehints (>=1.11.1,<2.0.0)", "sphinx-copybutton (>=0.3.1,<0.4.0)", "sphinx-rtd-theme (>=0.5.0,<0.6.0)"] +[[package]] +name = "rcslice" +version = "1.1.0" +description = "Slice a list of sliceables (1 indexed, start and end index both are inclusive)" +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "rcslice-1.1.0-py3-none-any.whl", hash = "sha256:1b12fc0c0ca452e8a9fd2b56ac008162f19e250906a4290a7e7a98be3200c2a6"}, + {file = "rcslice-1.1.0.tar.gz", hash = "sha256:a2ce70a60690eb63e52b722e046b334c3aaec5e900b28578f529878782ee5c6e"}, +] + +[[package]] +name = "regex" +version = "2022.10.31" +description = "Alternative regular expression module, to replace re." +category = "dev" +optional = false +python-versions = ">=3.6" +files = [ + {file = "regex-2022.10.31-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a8ff454ef0bb061e37df03557afda9d785c905dab15584860f982e88be73015f"}, + {file = "regex-2022.10.31-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1eba476b1b242620c266edf6325b443a2e22b633217a9835a52d8da2b5c051f9"}, + {file = "regex-2022.10.31-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d0e5af9a9effb88535a472e19169e09ce750c3d442fb222254a276d77808620b"}, + {file = "regex-2022.10.31-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d03fe67b2325cb3f09be029fd5da8df9e6974f0cde2c2ac6a79d2634e791dd57"}, + {file = "regex-2022.10.31-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a9d0b68ac1743964755ae2d89772c7e6fb0118acd4d0b7464eaf3921c6b49dd4"}, + {file = "regex-2022.10.31-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a45b6514861916c429e6059a55cf7db74670eaed2052a648e3e4d04f070e001"}, + {file = "regex-2022.10.31-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8b0886885f7323beea6f552c28bff62cbe0983b9fbb94126531693ea6c5ebb90"}, + {file = "regex-2022.10.31-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5aefb84a301327ad115e9d346c8e2760009131d9d4b4c6b213648d02e2abe144"}, + {file = "regex-2022.10.31-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:702d8fc6f25bbf412ee706bd73019da5e44a8400861dfff7ff31eb5b4a1276dc"}, + {file = "regex-2022.10.31-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a3c1ebd4ed8e76e886507c9eddb1a891673686c813adf889b864a17fafcf6d66"}, + {file = "regex-2022.10.31-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:50921c140561d3db2ab9f5b11c5184846cde686bb5a9dc64cae442926e86f3af"}, + {file = "regex-2022.10.31-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:7db345956ecce0c99b97b042b4ca7326feeec6b75facd8390af73b18e2650ffc"}, + {file = "regex-2022.10.31-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:763b64853b0a8f4f9cfb41a76a4a85a9bcda7fdda5cb057016e7706fde928e66"}, + {file = "regex-2022.10.31-cp310-cp310-win32.whl", hash = "sha256:44136355e2f5e06bf6b23d337a75386371ba742ffa771440b85bed367c1318d1"}, + {file = "regex-2022.10.31-cp310-cp310-win_amd64.whl", hash = "sha256:bfff48c7bd23c6e2aec6454aaf6edc44444b229e94743b34bdcdda2e35126cf5"}, + {file = "regex-2022.10.31-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4b4b1fe58cd102d75ef0552cf17242705ce0759f9695334a56644ad2d83903fe"}, + {file = "regex-2022.10.31-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:542e3e306d1669b25936b64917285cdffcd4f5c6f0247636fec037187bd93542"}, + {file = "regex-2022.10.31-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c27cc1e4b197092e50ddbf0118c788d9977f3f8f35bfbbd3e76c1846a3443df7"}, + {file = "regex-2022.10.31-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8e38472739028e5f2c3a4aded0ab7eadc447f0d84f310c7a8bb697ec417229e"}, + {file = "regex-2022.10.31-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:76c598ca73ec73a2f568e2a72ba46c3b6c8690ad9a07092b18e48ceb936e9f0c"}, + {file = "regex-2022.10.31-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c28d3309ebd6d6b2cf82969b5179bed5fefe6142c70f354ece94324fa11bf6a1"}, + {file = "regex-2022.10.31-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9af69f6746120998cd9c355e9c3c6aec7dff70d47247188feb4f829502be8ab4"}, + {file = "regex-2022.10.31-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a5f9505efd574d1e5b4a76ac9dd92a12acb2b309551e9aa874c13c11caefbe4f"}, + {file = "regex-2022.10.31-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:5ff525698de226c0ca743bfa71fc6b378cda2ddcf0d22d7c37b1cc925c9650a5"}, + {file = "regex-2022.10.31-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:4fe7fda2fe7c8890d454f2cbc91d6c01baf206fbc96d89a80241a02985118c0c"}, + {file = "regex-2022.10.31-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:2cdc55ca07b4e70dda898d2ab7150ecf17c990076d3acd7a5f3b25cb23a69f1c"}, + {file = "regex-2022.10.31-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:44a6c2f6374e0033873e9ed577a54a3602b4f609867794c1a3ebba65e4c93ee7"}, + {file = "regex-2022.10.31-cp311-cp311-win32.whl", hash = "sha256:d8716f82502997b3d0895d1c64c3b834181b1eaca28f3f6336a71777e437c2af"}, + {file = "regex-2022.10.31-cp311-cp311-win_amd64.whl", hash = "sha256:61edbca89aa3f5ef7ecac8c23d975fe7261c12665f1d90a6b1af527bba86ce61"}, + {file = "regex-2022.10.31-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:0a069c8483466806ab94ea9068c34b200b8bfc66b6762f45a831c4baaa9e8cdd"}, + {file = "regex-2022.10.31-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d26166acf62f731f50bdd885b04b38828436d74e8e362bfcb8df221d868b5d9b"}, + {file = "regex-2022.10.31-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac741bf78b9bb432e2d314439275235f41656e189856b11fb4e774d9f7246d81"}, + {file = "regex-2022.10.31-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75f591b2055523fc02a4bbe598aa867df9e953255f0b7f7715d2a36a9c30065c"}, + {file = "regex-2022.10.31-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b30bddd61d2a3261f025ad0f9ee2586988c6a00c780a2fb0a92cea2aa702c54"}, + {file = "regex-2022.10.31-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ef4163770525257876f10e8ece1cf25b71468316f61451ded1a6f44273eedeb5"}, + {file = "regex-2022.10.31-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:7b280948d00bd3973c1998f92e22aa3ecb76682e3a4255f33e1020bd32adf443"}, + {file = "regex-2022.10.31-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:d0213671691e341f6849bf33cd9fad21f7b1cb88b89e024f33370733fec58742"}, + {file = "regex-2022.10.31-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:22e7ebc231d28393dfdc19b185d97e14a0f178bedd78e85aad660e93b646604e"}, + {file = "regex-2022.10.31-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:8ad241da7fac963d7573cc67a064c57c58766b62a9a20c452ca1f21050868dfa"}, + {file = "regex-2022.10.31-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:586b36ebda81e6c1a9c5a5d0bfdc236399ba6595e1397842fd4a45648c30f35e"}, + {file = "regex-2022.10.31-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:0653d012b3bf45f194e5e6a41df9258811ac8fc395579fa82958a8b76286bea4"}, + {file = "regex-2022.10.31-cp36-cp36m-win32.whl", hash = "sha256:144486e029793a733e43b2e37df16a16df4ceb62102636ff3db6033994711066"}, + {file = "regex-2022.10.31-cp36-cp36m-win_amd64.whl", hash = "sha256:c14b63c9d7bab795d17392c7c1f9aaabbffd4cf4387725a0ac69109fb3b550c6"}, + {file = "regex-2022.10.31-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4cac3405d8dda8bc6ed499557625585544dd5cbf32072dcc72b5a176cb1271c8"}, + {file = "regex-2022.10.31-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23cbb932cc53a86ebde0fb72e7e645f9a5eec1a5af7aa9ce333e46286caef783"}, + {file = "regex-2022.10.31-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:74bcab50a13960f2a610cdcd066e25f1fd59e23b69637c92ad470784a51b1347"}, + {file = "regex-2022.10.31-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:78d680ef3e4d405f36f0d6d1ea54e740366f061645930072d39bca16a10d8c93"}, + {file = "regex-2022.10.31-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce6910b56b700bea7be82c54ddf2e0ed792a577dfaa4a76b9af07d550af435c6"}, + {file = "regex-2022.10.31-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:659175b2144d199560d99a8d13b2228b85e6019b6e09e556209dfb8c37b78a11"}, + {file = "regex-2022.10.31-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:1ddf14031a3882f684b8642cb74eea3af93a2be68893901b2b387c5fd92a03ec"}, + {file = "regex-2022.10.31-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:b683e5fd7f74fb66e89a1ed16076dbab3f8e9f34c18b1979ded614fe10cdc4d9"}, + {file = "regex-2022.10.31-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:2bde29cc44fa81c0a0c8686992c3080b37c488df167a371500b2a43ce9f026d1"}, + {file = "regex-2022.10.31-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:4919899577ba37f505aaebdf6e7dc812d55e8f097331312db7f1aab18767cce8"}, + {file = "regex-2022.10.31-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:9c94f7cc91ab16b36ba5ce476f1904c91d6c92441f01cd61a8e2729442d6fcf5"}, + {file = "regex-2022.10.31-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ae1e96785696b543394a4e3f15f3f225d44f3c55dafe3f206493031419fedf95"}, + {file = "regex-2022.10.31-cp37-cp37m-win32.whl", hash = "sha256:c670f4773f2f6f1957ff8a3962c7dd12e4be54d05839b216cb7fd70b5a1df394"}, + {file = "regex-2022.10.31-cp37-cp37m-win_amd64.whl", hash = "sha256:8e0caeff18b96ea90fc0eb6e3bdb2b10ab5b01a95128dfeccb64a7238decf5f0"}, + {file = "regex-2022.10.31-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:131d4be09bea7ce2577f9623e415cab287a3c8e0624f778c1d955ec7c281bd4d"}, + {file = "regex-2022.10.31-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e613a98ead2005c4ce037c7b061f2409a1a4e45099edb0ef3200ee26ed2a69a8"}, + {file = "regex-2022.10.31-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:052b670fafbe30966bbe5d025e90b2a491f85dfe5b2583a163b5e60a85a321ad"}, + {file = "regex-2022.10.31-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aa62a07ac93b7cb6b7d0389d8ef57ffc321d78f60c037b19dfa78d6b17c928ee"}, + {file = "regex-2022.10.31-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5352bea8a8f84b89d45ccc503f390a6be77917932b1c98c4cdc3565137acc714"}, + {file = "regex-2022.10.31-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:20f61c9944f0be2dc2b75689ba409938c14876c19d02f7585af4460b6a21403e"}, + {file = "regex-2022.10.31-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:29c04741b9ae13d1e94cf93fca257730b97ce6ea64cfe1eba11cf9ac4e85afb6"}, + {file = "regex-2022.10.31-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:543883e3496c8b6d58bd036c99486c3c8387c2fc01f7a342b760c1ea3158a318"}, + {file = "regex-2022.10.31-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b7a8b43ee64ca8f4befa2bea4083f7c52c92864d8518244bfa6e88c751fa8fff"}, + {file = "regex-2022.10.31-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:6a9a19bea8495bb419dc5d38c4519567781cd8d571c72efc6aa959473d10221a"}, + {file = "regex-2022.10.31-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:6ffd55b5aedc6f25fd8d9f905c9376ca44fcf768673ffb9d160dd6f409bfda73"}, + {file = "regex-2022.10.31-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:4bdd56ee719a8f751cf5a593476a441c4e56c9b64dc1f0f30902858c4ef8771d"}, + {file = "regex-2022.10.31-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8ca88da1bd78990b536c4a7765f719803eb4f8f9971cc22d6ca965c10a7f2c4c"}, + {file = "regex-2022.10.31-cp38-cp38-win32.whl", hash = "sha256:5a260758454580f11dd8743fa98319bb046037dfab4f7828008909d0aa5292bc"}, + {file = "regex-2022.10.31-cp38-cp38-win_amd64.whl", hash = "sha256:5e6a5567078b3eaed93558842346c9d678e116ab0135e22eb72db8325e90b453"}, + {file = "regex-2022.10.31-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5217c25229b6a85049416a5c1e6451e9060a1edcf988641e309dbe3ab26d3e49"}, + {file = "regex-2022.10.31-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4bf41b8b0a80708f7e0384519795e80dcb44d7199a35d52c15cc674d10b3081b"}, + {file = "regex-2022.10.31-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cf0da36a212978be2c2e2e2d04bdff46f850108fccc1851332bcae51c8907cc"}, + {file = "regex-2022.10.31-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d403d781b0e06d2922435ce3b8d2376579f0c217ae491e273bab8d092727d244"}, + {file = "regex-2022.10.31-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a37d51fa9a00d265cf73f3de3930fa9c41548177ba4f0faf76e61d512c774690"}, + {file = "regex-2022.10.31-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4f781ffedd17b0b834c8731b75cce2639d5a8afe961c1e58ee7f1f20b3af185"}, + {file = "regex-2022.10.31-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d243b36fbf3d73c25e48014961e83c19c9cc92530516ce3c43050ea6276a2ab7"}, + {file = "regex-2022.10.31-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:370f6e97d02bf2dd20d7468ce4f38e173a124e769762d00beadec3bc2f4b3bc4"}, + {file = "regex-2022.10.31-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:597f899f4ed42a38df7b0e46714880fb4e19a25c2f66e5c908805466721760f5"}, + {file = "regex-2022.10.31-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7dbdce0c534bbf52274b94768b3498abdf675a691fec5f751b6057b3030f34c1"}, + {file = "regex-2022.10.31-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:22960019a842777a9fa5134c2364efaed5fbf9610ddc5c904bd3a400973b0eb8"}, + {file = "regex-2022.10.31-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:7f5a3ffc731494f1a57bd91c47dc483a1e10048131ffb52d901bfe2beb6102e8"}, + {file = "regex-2022.10.31-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7ef6b5942e6bfc5706301a18a62300c60db9af7f6368042227ccb7eeb22d0892"}, + {file = "regex-2022.10.31-cp39-cp39-win32.whl", hash = "sha256:395161bbdbd04a8333b9ff9763a05e9ceb4fe210e3c7690f5e68cedd3d65d8e1"}, + {file = "regex-2022.10.31-cp39-cp39-win_amd64.whl", hash = "sha256:957403a978e10fb3ca42572a23e6f7badff39aa1ce2f4ade68ee452dc6807692"}, + {file = "regex-2022.10.31.tar.gz", hash = "sha256:a3a98921da9a1bf8457aeee6a551948a83601689e5ecdd736894ea9bbec77e83"}, +] + [[package]] name = "requests" version = "2.28.2" @@ -1332,240 +1592,6 @@ files = [ {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, ] -[[package]] -name = "snowballstemmer" -version = "2.2.0" -description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." -category = "dev" -optional = false -python-versions = "*" -files = [ - {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, - {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, -] - -[[package]] -name = "soupsieve" -version = "2.4" -description = "A modern CSS selector implementation for Beautiful Soup." -category = "dev" -optional = false -python-versions = ">=3.7" -files = [ - {file = "soupsieve-2.4-py3-none-any.whl", hash = "sha256:49e5368c2cda80ee7e84da9dbe3e110b70a4575f196efb74e51b94549d921955"}, - {file = "soupsieve-2.4.tar.gz", hash = "sha256:e28dba9ca6c7c00173e34e4ba57448f0688bb681b7c5e8bf4971daafc093d69a"}, -] - -[[package]] -name = "sphinx" -version = "5.3.0" -description = "Python documentation generator" -category = "dev" -optional = false -python-versions = ">=3.6" -files = [ - {file = "Sphinx-5.3.0.tar.gz", hash = "sha256:51026de0a9ff9fc13c05d74913ad66047e104f56a129ff73e174eb5c3ee794b5"}, - {file = "sphinx-5.3.0-py3-none-any.whl", hash = "sha256:060ca5c9f7ba57a08a1219e547b269fadf125ae25b06b9fa7f66768efb652d6d"}, -] - -[package.dependencies] -alabaster = ">=0.7,<0.8" -babel = ">=2.9" -colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} -docutils = ">=0.14,<0.20" -imagesize = ">=1.3" -importlib-metadata = {version = ">=4.8", markers = "python_version < \"3.10\""} -Jinja2 = ">=3.0" -packaging = ">=21.0" -Pygments = ">=2.12" -requests = ">=2.5.0" -snowballstemmer = ">=2.0" -sphinxcontrib-applehelp = "*" -sphinxcontrib-devhelp = "*" -sphinxcontrib-htmlhelp = ">=2.0.0" -sphinxcontrib-jsmath = "*" -sphinxcontrib-qthelp = "*" -sphinxcontrib-serializinghtml = ">=1.1.5" - -[package.extras] -docs = ["sphinxcontrib-websupport"] -lint = ["docutils-stubs", "flake8 (>=3.5.0)", "flake8-bugbear", "flake8-comprehensions", "flake8-simplify", "isort", "mypy (>=0.981)", "sphinx-lint", "types-requests", "types-typed-ast"] -test = ["cython", "html5lib", "pytest (>=4.6)", "typed_ast"] - -[[package]] -name = "sphinx-autoapi" -version = "1.9.0" -description = "Sphinx API documentation generator" -category = "dev" -optional = false -python-versions = ">=3.7" -files = [ - {file = "sphinx-autoapi-1.9.0.tar.gz", hash = "sha256:c897ea337df16ad0cde307cbdfe2bece207788dde1587fa4fc8b857d1fc5dcba"}, - {file = "sphinx_autoapi-1.9.0-py2.py3-none-any.whl", hash = "sha256:d217953273b359b699d8cb81a5a72985a3e6e15cfe3f703d9a3c201ffc30849b"}, -] - -[package.dependencies] -astroid = ">=2.7" -Jinja2 = "*" -PyYAML = "*" -sphinx = ">=3.0" -unidecode = "*" - -[package.extras] -docs = ["sphinx", "sphinx-rtd-theme"] -dotnet = ["sphinxcontrib-dotnetdomain"] -go = ["sphinxcontrib-golangdomain"] - -[[package]] -name = "sphinx-autobuild" -version = "2021.3.14" -description = "Rebuild Sphinx documentation on changes, with live-reload in the browser." -category = "dev" -optional = false -python-versions = ">=3.6" -files = [ - {file = "sphinx-autobuild-2021.3.14.tar.gz", hash = "sha256:de1ca3b66e271d2b5b5140c35034c89e47f263f2cd5db302c9217065f7443f05"}, - {file = "sphinx_autobuild-2021.3.14-py3-none-any.whl", hash = "sha256:8fe8cbfdb75db04475232f05187c776f46f6e9e04cacf1e49ce81bdac649ccac"}, -] - -[package.dependencies] -colorama = "*" -livereload = "*" -sphinx = "*" - -[package.extras] -test = ["pytest", "pytest-cov"] - -[[package]] -name = "sphinx-basic-ng" -version = "1.0.0b1" -description = "A modern skeleton for Sphinx themes." -category = "dev" -optional = false -python-versions = ">=3.7" -files = [ - {file = "sphinx_basic_ng-1.0.0b1-py3-none-any.whl", hash = "sha256:ade597a3029c7865b24ad0eda88318766bcc2f9f4cef60df7e28126fde94db2a"}, - {file = "sphinx_basic_ng-1.0.0b1.tar.gz", hash = "sha256:89374bd3ccd9452a301786781e28c8718e99960f2d4f411845ea75fc7bb5a9b0"}, -] - -[package.dependencies] -sphinx = ">=4.0" - -[package.extras] -docs = ["furo", "ipython", "myst-parser", "sphinx-copybutton", "sphinx-inline-tabs"] - -[[package]] -name = "sphinx-click" -version = "4.2.0" -description = "Sphinx extension that automatically documents click applications" -category = "dev" -optional = false -python-versions = ">=3.7" -files = [ - {file = "sphinx-click-4.2.0.tar.gz", hash = "sha256:8429705474ebb009de5603c35b6a7bfe8501dbdb12d847cbb01f18277d4b7d9a"}, - {file = "sphinx_click-4.2.0-py3-none-any.whl", hash = "sha256:3ba8c97a40deaf09245c540accc4ac5c1d2942eaed0fa598403cdbf04a9cf95f"}, -] - -[package.dependencies] -click = ">=7.0" -docutils = "*" -sphinx = ">=2.0" - -[[package]] -name = "sphinxcontrib-applehelp" -version = "1.0.2" -description = "sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books" -category = "dev" -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-applehelp-1.0.2.tar.gz", hash = "sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58"}, - {file = "sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["pytest"] - -[[package]] -name = "sphinxcontrib-devhelp" -version = "1.0.2" -description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." -category = "dev" -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, - {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["pytest"] - -[[package]] -name = "sphinxcontrib-htmlhelp" -version = "2.0.0" -description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" -category = "dev" -optional = false -python-versions = ">=3.6" -files = [ - {file = "sphinxcontrib-htmlhelp-2.0.0.tar.gz", hash = "sha256:f5f8bb2d0d629f398bf47d0d69c07bc13b65f75a81ad9e2f71a63d4b7a2f6db2"}, - {file = "sphinxcontrib_htmlhelp-2.0.0-py2.py3-none-any.whl", hash = "sha256:d412243dfb797ae3ec2b59eca0e52dac12e75a241bf0e4eb861e450d06c6ed07"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["html5lib", "pytest"] - -[[package]] -name = "sphinxcontrib-jsmath" -version = "1.0.1" -description = "A sphinx extension which renders display math in HTML via JavaScript" -category = "dev" -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, - {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, -] - -[package.extras] -test = ["flake8", "mypy", "pytest"] - -[[package]] -name = "sphinxcontrib-qthelp" -version = "1.0.3" -description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." -category = "dev" -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, - {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["pytest"] - -[[package]] -name = "sphinxcontrib-serializinghtml" -version = "1.1.5" -description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." -category = "dev" -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, - {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["pytest"] - [[package]] name = "tomli" version = "2.0.1" @@ -1578,27 +1604,6 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "tornado" -version = "6.2" -description = "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed." -category = "dev" -optional = false -python-versions = ">= 3.7" -files = [ - {file = "tornado-6.2-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:20f638fd8cc85f3cbae3c732326e96addff0a15e22d80f049e00121651e82e72"}, - {file = "tornado-6.2-cp37-abi3-macosx_10_9_x86_64.whl", hash = "sha256:87dcafae3e884462f90c90ecc200defe5e580a7fbbb4365eda7c7c1eb809ebc9"}, - {file = "tornado-6.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba09ef14ca9893954244fd872798b4ccb2367c165946ce2dd7376aebdde8e3ac"}, - {file = "tornado-6.2-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b8150f721c101abdef99073bf66d3903e292d851bee51910839831caba341a75"}, - {file = "tornado-6.2-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3a2f5999215a3a06a4fc218026cd84c61b8b2b40ac5296a6db1f1451ef04c1e"}, - {file = "tornado-6.2-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:5f8c52d219d4995388119af7ccaa0bcec289535747620116a58d830e7c25d8a8"}, - {file = "tornado-6.2-cp37-abi3-musllinux_1_1_i686.whl", hash = "sha256:6fdfabffd8dfcb6cf887428849d30cf19a3ea34c2c248461e1f7d718ad30b66b"}, - {file = "tornado-6.2-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:1d54d13ab8414ed44de07efecb97d4ef7c39f7438cf5e976ccd356bebb1b5fca"}, - {file = "tornado-6.2-cp37-abi3-win32.whl", hash = "sha256:5c87076709343557ef8032934ce5f637dbb552efa7b21d08e89ae7619ed0eb23"}, - {file = "tornado-6.2-cp37-abi3-win_amd64.whl", hash = "sha256:e5f923aa6a47e133d1cf87d60700889d7eae68988704e20c75fb2d65677a8e4b"}, - {file = "tornado-6.2.tar.gz", hash = "sha256:9b630419bde84ec666bfd7ea0a4cb2a8a651c2d5cccdbdd1972a0c859dfc3c13"}, -] - [[package]] name = "typed-ast" version = "1.5.4" @@ -1659,14 +1664,14 @@ files = [ [[package]] name = "types-requests" -version = "2.28.11.14" +version = "2.28.11.15" description = "Typing stubs for requests" category = "dev" optional = false python-versions = "*" files = [ - {file = "types-requests-2.28.11.14.tar.gz", hash = "sha256:232792870b60adb07d23175451ab4e6190021b0c584edf052d92d9b993118f06"}, - {file = "types_requests-2.28.11.14-py3-none-any.whl", hash = "sha256:f84613b0d4c5d0eeb7879dfa05e14a3702b9c1f7a4ee81dfe9b4321b13fe93a1"}, + {file = "types-requests-2.28.11.15.tar.gz", hash = "sha256:fc8eaa09cc014699c6b63c60c2e3add0c8b09a410c818b5ac6e65f92a26dde09"}, + {file = "types_requests-2.28.11.15-py3-none-any.whl", hash = "sha256:a05e4c7bc967518fba5789c341ea8b0c942776ee474c7873129a61161978e586"}, ] [package.dependencies] @@ -1686,14 +1691,14 @@ files = [ [[package]] name = "types-urllib3" -version = "1.26.25.7" +version = "1.26.25.8" description = "Typing stubs for urllib3" category = "dev" optional = false python-versions = "*" files = [ - {file = "types-urllib3-1.26.25.7.tar.gz", hash = "sha256:df4d3e5472bf8830bd74eac12d56e659f88662ba040c7d106bf3a5bee26fff28"}, - {file = "types_urllib3-1.26.25.7-py3-none-any.whl", hash = "sha256:28d2d7f5c31ff8ed4d9d2e396ce906c49d37523c3ec207d03d3b1695755a7199"}, + {file = "types-urllib3-1.26.25.8.tar.gz", hash = "sha256:ecf43c42d8ee439d732a1110b4901e9017a79a38daca26f08e42c8460069392c"}, + {file = "types_urllib3-1.26.25.8-py3-none-any.whl", hash = "sha256:95ea847fbf0bf675f50c8ae19a665baedcf07e6b4641662c4c3c72e7b2edf1a9"}, ] [[package]] @@ -1724,18 +1729,6 @@ files = [ mypy-extensions = ">=0.3.0" typing-extensions = ">=3.7.4" -[[package]] -name = "unidecode" -version = "1.3.6" -description = "ASCII transliterations of Unicode text" -category = "dev" -optional = false -python-versions = ">=3.5" -files = [ - {file = "Unidecode-1.3.6-py3-none-any.whl", hash = "sha256:547d7c479e4f377b430dd91ac1275d593308dce0fc464fb2ab7d41f82ec653be"}, - {file = "Unidecode-1.3.6.tar.gz", hash = "sha256:fed09cf0be8cf415b391642c2a5addfc72194407caee4f98719e40ec2a72b830"}, -] - [[package]] name = "urllib3" version = "1.26.14" @@ -1755,14 +1748,14 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "virtualenv" -version = "20.19.0" +version = "20.20.0" description = "Virtual Python Environment builder" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.19.0-py3-none-any.whl", hash = "sha256:54eb59e7352b573aa04d53f80fc9736ed0ad5143af445a1e539aada6eb947dd1"}, - {file = "virtualenv-20.19.0.tar.gz", hash = "sha256:37a640ba82ed40b226599c522d411e4be5edb339a0c0de030c0dc7b646d61590"}, + {file = "virtualenv-20.20.0-py3-none-any.whl", hash = "sha256:3c22fa5a7c7aa106ced59934d2c20a2ecb7f49b4130b8bf444178a16b880fa45"}, + {file = "virtualenv-20.20.0.tar.gz", hash = "sha256:a8a4b8ca1e28f864b7514a253f98c1d62b64e31e77325ba279248c65fb4fcef4"}, ] [package.dependencies] @@ -1775,6 +1768,47 @@ platformdirs = ">=2.4,<4" docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=22.12)"] test = ["covdefaults (>=2.2.2)", "coverage (>=7.1)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23)", "pytest (>=7.2.1)", "pytest-env (>=0.8.1)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.10)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)"] +[[package]] +name = "watchdog" +version = "2.3.1" +description = "Filesystem events monitoring" +category = "dev" +optional = false +python-versions = ">=3.6" +files = [ + {file = "watchdog-2.3.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d1f1200d4ec53b88bf04ab636f9133cb703eb19768a39351cee649de21a33697"}, + {file = "watchdog-2.3.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:564e7739abd4bd348aeafbf71cc006b6c0ccda3160c7053c4a53b67d14091d42"}, + {file = "watchdog-2.3.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:95ad708a9454050a46f741ba5e2f3468655ea22da1114e4c40b8cbdaca572565"}, + {file = "watchdog-2.3.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a073c91a6ef0dda488087669586768195c3080c66866144880f03445ca23ef16"}, + {file = "watchdog-2.3.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:aa8b028750b43e80eea9946d01925168eeadb488dfdef1d82be4b1e28067f375"}, + {file = "watchdog-2.3.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:964fd236cd443933268ae49b59706569c8b741073dbfd7ca705492bae9d39aab"}, + {file = "watchdog-2.3.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:91fd146d723392b3e6eb1ac21f122fcce149a194a2ba0a82c5e4d0ee29cd954c"}, + {file = "watchdog-2.3.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:efe3252137392a471a2174d721e1037a0e6a5da7beb72a021e662b7000a9903f"}, + {file = "watchdog-2.3.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:85bf2263290591b7c5fa01140601b64c831be88084de41efbcba6ea289874f44"}, + {file = "watchdog-2.3.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8f2df370cd8e4e18499dd0bfdef476431bcc396108b97195d9448d90924e3131"}, + {file = "watchdog-2.3.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ea5d86d1bcf4a9d24610aa2f6f25492f441960cf04aed2bd9a97db439b643a7b"}, + {file = "watchdog-2.3.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:6f5d0f7eac86807275eba40b577c671b306f6f335ba63a5c5a348da151aba0fc"}, + {file = "watchdog-2.3.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b848c71ef2b15d0ef02f69da8cc120d335cec0ed82a3fa7779e27a5a8527225"}, + {file = "watchdog-2.3.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0d9878be36d2b9271e3abaa6f4f051b363ff54dbbe7e7df1af3c920e4311ee43"}, + {file = "watchdog-2.3.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:4cd61f98cb37143206818cb1786d2438626aa78d682a8f2ecee239055a9771d5"}, + {file = "watchdog-2.3.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:3d2dbcf1acd96e7a9c9aefed201c47c8e311075105d94ce5e899f118155709fd"}, + {file = "watchdog-2.3.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:03f342a9432fe08107defbe8e405a2cb922c5d00c4c6c168c68b633c64ce6190"}, + {file = "watchdog-2.3.1-py3-none-manylinux2014_aarch64.whl", hash = "sha256:7a596f9415a378d0339681efc08d2249e48975daae391d58f2e22a3673b977cf"}, + {file = "watchdog-2.3.1-py3-none-manylinux2014_armv7l.whl", hash = "sha256:0e1dd6d449267cc7d6935d7fe27ee0426af6ee16578eed93bacb1be9ff824d2d"}, + {file = "watchdog-2.3.1-py3-none-manylinux2014_i686.whl", hash = "sha256:7a1876f660e32027a1a46f8a0fa5747ad4fcf86cb451860eae61a26e102c8c79"}, + {file = "watchdog-2.3.1-py3-none-manylinux2014_ppc64.whl", hash = "sha256:2caf77ae137935c1466f8cefd4a3aec7017b6969f425d086e6a528241cba7256"}, + {file = "watchdog-2.3.1-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:53f3e95081280898d9e4fc51c5c69017715929e4eea1ab45801d5e903dd518ad"}, + {file = "watchdog-2.3.1-py3-none-manylinux2014_s390x.whl", hash = "sha256:9da7acb9af7e4a272089bd2af0171d23e0d6271385c51d4d9bde91fe918c53ed"}, + {file = "watchdog-2.3.1-py3-none-manylinux2014_x86_64.whl", hash = "sha256:8a4d484e846dcd75e96b96d80d80445302621be40e293bfdf34a631cab3b33dc"}, + {file = "watchdog-2.3.1-py3-none-win32.whl", hash = "sha256:a74155398434937ac2780fd257c045954de5b11b5c52fc844e2199ce3eecf4cf"}, + {file = "watchdog-2.3.1-py3-none-win_amd64.whl", hash = "sha256:5defe4f0918a2a1a4afbe4dbb967f743ac3a93d546ea4674567806375b024adb"}, + {file = "watchdog-2.3.1-py3-none-win_ia64.whl", hash = "sha256:4109cccf214b7e3462e8403ab1e5b17b302ecce6c103eb2fc3afa534a7f27b96"}, + {file = "watchdog-2.3.1.tar.gz", hash = "sha256:d9f9ed26ed22a9d331820a8432c3680707ea8b54121ddcc9dc7d9f2ceeb36906"}, +] + +[package.extras] +watchmedo = ["PyYAML (>=3.10)"] + [[package]] name = "wcwidth" version = "0.2.6" @@ -1789,95 +1823,106 @@ files = [ [[package]] name = "wrapt" -version = "1.14.1" +version = "1.15.0" description = "Module for decorators, wrappers and monkey patching." category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" files = [ - {file = "wrapt-1.14.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:1b376b3f4896e7930f1f772ac4b064ac12598d1c38d04907e696cc4d794b43d3"}, - {file = "wrapt-1.14.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:903500616422a40a98a5a3c4ff4ed9d0066f3b4c951fa286018ecdf0750194ef"}, - {file = "wrapt-1.14.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:5a9a0d155deafd9448baff28c08e150d9b24ff010e899311ddd63c45c2445e28"}, - {file = "wrapt-1.14.1-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:ddaea91abf8b0d13443f6dac52e89051a5063c7d014710dcb4d4abb2ff811a59"}, - {file = "wrapt-1.14.1-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:36f582d0c6bc99d5f39cd3ac2a9062e57f3cf606ade29a0a0d6b323462f4dd87"}, - {file = "wrapt-1.14.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:7ef58fb89674095bfc57c4069e95d7a31cfdc0939e2a579882ac7d55aadfd2a1"}, - {file = "wrapt-1.14.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:e2f83e18fe2f4c9e7db597e988f72712c0c3676d337d8b101f6758107c42425b"}, - {file = "wrapt-1.14.1-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:ee2b1b1769f6707a8a445162ea16dddf74285c3964f605877a20e38545c3c462"}, - {file = "wrapt-1.14.1-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:833b58d5d0b7e5b9832869f039203389ac7cbf01765639c7309fd50ef619e0b1"}, - {file = "wrapt-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:80bb5c256f1415f747011dc3604b59bc1f91c6e7150bd7db03b19170ee06b320"}, - {file = "wrapt-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:07f7a7d0f388028b2df1d916e94bbb40624c59b48ecc6cbc232546706fac74c2"}, - {file = "wrapt-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:02b41b633c6261feff8ddd8d11c711df6842aba629fdd3da10249a53211a72c4"}, - {file = "wrapt-1.14.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2fe803deacd09a233e4762a1adcea5db5d31e6be577a43352936179d14d90069"}, - {file = "wrapt-1.14.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:257fd78c513e0fb5cdbe058c27a0624c9884e735bbd131935fd49e9fe719d310"}, - {file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4fcc4649dc762cddacd193e6b55bc02edca674067f5f98166d7713b193932b7f"}, - {file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:11871514607b15cfeb87c547a49bca19fde402f32e2b1c24a632506c0a756656"}, - {file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8ad85f7f4e20964db4daadcab70b47ab05c7c1cf2a7c1e51087bfaa83831854c"}, - {file = "wrapt-1.14.1-cp310-cp310-win32.whl", hash = "sha256:a9a52172be0b5aae932bef82a79ec0a0ce87288c7d132946d645eba03f0ad8a8"}, - {file = "wrapt-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:6d323e1554b3d22cfc03cd3243b5bb815a51f5249fdcbb86fda4bf62bab9e164"}, - {file = "wrapt-1.14.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:43ca3bbbe97af00f49efb06e352eae40434ca9d915906f77def219b88e85d907"}, - {file = "wrapt-1.14.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:6b1a564e6cb69922c7fe3a678b9f9a3c54e72b469875aa8018f18b4d1dd1adf3"}, - {file = "wrapt-1.14.1-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:00b6d4ea20a906c0ca56d84f93065b398ab74b927a7a3dbd470f6fc503f95dc3"}, - {file = "wrapt-1.14.1-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:a85d2b46be66a71bedde836d9e41859879cc54a2a04fad1191eb50c2066f6e9d"}, - {file = "wrapt-1.14.1-cp35-cp35m-win32.whl", hash = "sha256:dbcda74c67263139358f4d188ae5faae95c30929281bc6866d00573783c422b7"}, - {file = "wrapt-1.14.1-cp35-cp35m-win_amd64.whl", hash = "sha256:b21bb4c09ffabfa0e85e3a6b623e19b80e7acd709b9f91452b8297ace2a8ab00"}, - {file = "wrapt-1.14.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:9e0fd32e0148dd5dea6af5fee42beb949098564cc23211a88d799e434255a1f4"}, - {file = "wrapt-1.14.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9736af4641846491aedb3c3f56b9bc5568d92b0692303b5a305301a95dfd38b1"}, - {file = "wrapt-1.14.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5b02d65b9ccf0ef6c34cba6cf5bf2aab1bb2f49c6090bafeecc9cd81ad4ea1c1"}, - {file = "wrapt-1.14.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21ac0156c4b089b330b7666db40feee30a5d52634cc4560e1905d6529a3897ff"}, - {file = "wrapt-1.14.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:9f3e6f9e05148ff90002b884fbc2a86bd303ae847e472f44ecc06c2cd2fcdb2d"}, - {file = "wrapt-1.14.1-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:6e743de5e9c3d1b7185870f480587b75b1cb604832e380d64f9504a0535912d1"}, - {file = "wrapt-1.14.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:d79d7d5dc8a32b7093e81e97dad755127ff77bcc899e845f41bf71747af0c569"}, - {file = "wrapt-1.14.1-cp36-cp36m-win32.whl", hash = "sha256:81b19725065dcb43df02b37e03278c011a09e49757287dca60c5aecdd5a0b8ed"}, - {file = "wrapt-1.14.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b014c23646a467558be7da3d6b9fa409b2c567d2110599b7cf9a0c5992b3b471"}, - {file = "wrapt-1.14.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:88bd7b6bd70a5b6803c1abf6bca012f7ed963e58c68d76ee20b9d751c74a3248"}, - {file = "wrapt-1.14.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b5901a312f4d14c59918c221323068fad0540e34324925c8475263841dbdfe68"}, - {file = "wrapt-1.14.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d77c85fedff92cf788face9bfa3ebaa364448ebb1d765302e9af11bf449ca36d"}, - {file = "wrapt-1.14.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d649d616e5c6a678b26d15ece345354f7c2286acd6db868e65fcc5ff7c24a77"}, - {file = "wrapt-1.14.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7d2872609603cb35ca513d7404a94d6d608fc13211563571117046c9d2bcc3d7"}, - {file = "wrapt-1.14.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:ee6acae74a2b91865910eef5e7de37dc6895ad96fa23603d1d27ea69df545015"}, - {file = "wrapt-1.14.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:2b39d38039a1fdad98c87279b48bc5dce2c0ca0d73483b12cb72aa9609278e8a"}, - {file = "wrapt-1.14.1-cp37-cp37m-win32.whl", hash = "sha256:60db23fa423575eeb65ea430cee741acb7c26a1365d103f7b0f6ec412b893853"}, - {file = "wrapt-1.14.1-cp37-cp37m-win_amd64.whl", hash = "sha256:709fe01086a55cf79d20f741f39325018f4df051ef39fe921b1ebe780a66184c"}, - {file = "wrapt-1.14.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8c0ce1e99116d5ab21355d8ebe53d9460366704ea38ae4d9f6933188f327b456"}, - {file = "wrapt-1.14.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e3fb1677c720409d5f671e39bac6c9e0e422584e5f518bfd50aa4cbbea02433f"}, - {file = "wrapt-1.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:642c2e7a804fcf18c222e1060df25fc210b9c58db7c91416fb055897fc27e8cc"}, - {file = "wrapt-1.14.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7b7c050ae976e286906dd3f26009e117eb000fb2cf3533398c5ad9ccc86867b1"}, - {file = "wrapt-1.14.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef3f72c9666bba2bab70d2a8b79f2c6d2c1a42a7f7e2b0ec83bb2f9e383950af"}, - {file = "wrapt-1.14.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:01c205616a89d09827986bc4e859bcabd64f5a0662a7fe95e0d359424e0e071b"}, - {file = "wrapt-1.14.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:5a0f54ce2c092aaf439813735584b9537cad479575a09892b8352fea5e988dc0"}, - {file = "wrapt-1.14.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:2cf71233a0ed05ccdabe209c606fe0bac7379fdcf687f39b944420d2a09fdb57"}, - {file = "wrapt-1.14.1-cp38-cp38-win32.whl", hash = "sha256:aa31fdcc33fef9eb2552cbcbfee7773d5a6792c137b359e82879c101e98584c5"}, - {file = "wrapt-1.14.1-cp38-cp38-win_amd64.whl", hash = "sha256:d1967f46ea8f2db647c786e78d8cc7e4313dbd1b0aca360592d8027b8508e24d"}, - {file = "wrapt-1.14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3232822c7d98d23895ccc443bbdf57c7412c5a65996c30442ebe6ed3df335383"}, - {file = "wrapt-1.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:988635d122aaf2bdcef9e795435662bcd65b02f4f4c1ae37fbee7401c440b3a7"}, - {file = "wrapt-1.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cca3c2cdadb362116235fdbd411735de4328c61425b0aa9f872fd76d02c4e86"}, - {file = "wrapt-1.14.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d52a25136894c63de15a35bc0bdc5adb4b0e173b9c0d07a2be9d3ca64a332735"}, - {file = "wrapt-1.14.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40e7bc81c9e2b2734ea4bc1aceb8a8f0ceaac7c5299bc5d69e37c44d9081d43b"}, - {file = "wrapt-1.14.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b9b7a708dd92306328117d8c4b62e2194d00c365f18eff11a9b53c6f923b01e3"}, - {file = "wrapt-1.14.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6a9a25751acb379b466ff6be78a315e2b439d4c94c1e99cb7266d40a537995d3"}, - {file = "wrapt-1.14.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:34aa51c45f28ba7f12accd624225e2b1e5a3a45206aa191f6f9aac931d9d56fe"}, - {file = "wrapt-1.14.1-cp39-cp39-win32.whl", hash = "sha256:dee0ce50c6a2dd9056c20db781e9c1cfd33e77d2d569f5d1d9321c641bb903d5"}, - {file = "wrapt-1.14.1-cp39-cp39-win_amd64.whl", hash = "sha256:dee60e1de1898bde3b238f18340eec6148986da0455d8ba7848d50470a7a32fb"}, - {file = "wrapt-1.14.1.tar.gz", hash = "sha256:380a85cf89e0e69b7cfbe2ea9f765f004ff419f34194018a6827ac0e3edfed4d"}, + {file = "wrapt-1.15.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:ca1cccf838cd28d5a0883b342474c630ac48cac5df0ee6eacc9c7290f76b11c1"}, + {file = "wrapt-1.15.0-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:e826aadda3cae59295b95343db8f3d965fb31059da7de01ee8d1c40a60398b29"}, + {file = "wrapt-1.15.0-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:5fc8e02f5984a55d2c653f5fea93531e9836abbd84342c1d1e17abc4a15084c2"}, + {file = "wrapt-1.15.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:96e25c8603a155559231c19c0349245eeb4ac0096fe3c1d0be5c47e075bd4f46"}, + {file = "wrapt-1.15.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:40737a081d7497efea35ab9304b829b857f21558acfc7b3272f908d33b0d9d4c"}, + {file = "wrapt-1.15.0-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:f87ec75864c37c4c6cb908d282e1969e79763e0d9becdfe9fe5473b7bb1e5f09"}, + {file = "wrapt-1.15.0-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:1286eb30261894e4c70d124d44b7fd07825340869945c79d05bda53a40caa079"}, + {file = "wrapt-1.15.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:493d389a2b63c88ad56cdc35d0fa5752daac56ca755805b1b0c530f785767d5e"}, + {file = "wrapt-1.15.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:58d7a75d731e8c63614222bcb21dd992b4ab01a399f1f09dd82af17bbfc2368a"}, + {file = "wrapt-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:21f6d9a0d5b3a207cdf7acf8e58d7d13d463e639f0c7e01d82cdb671e6cb7923"}, + {file = "wrapt-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ce42618f67741d4697684e501ef02f29e758a123aa2d669e2d964ff734ee00ee"}, + {file = "wrapt-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41d07d029dd4157ae27beab04d22b8e261eddfc6ecd64ff7000b10dc8b3a5727"}, + {file = "wrapt-1.15.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:54accd4b8bc202966bafafd16e69da9d5640ff92389d33d28555c5fd4f25ccb7"}, + {file = "wrapt-1.15.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2fbfbca668dd15b744418265a9607baa970c347eefd0db6a518aaf0cfbd153c0"}, + {file = "wrapt-1.15.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:76e9c727a874b4856d11a32fb0b389afc61ce8aaf281ada613713ddeadd1cfec"}, + {file = "wrapt-1.15.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e20076a211cd6f9b44a6be58f7eeafa7ab5720eb796975d0c03f05b47d89eb90"}, + {file = "wrapt-1.15.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a74d56552ddbde46c246b5b89199cb3fd182f9c346c784e1a93e4dc3f5ec9975"}, + {file = "wrapt-1.15.0-cp310-cp310-win32.whl", hash = "sha256:26458da5653aa5b3d8dc8b24192f574a58984c749401f98fff994d41d3f08da1"}, + {file = "wrapt-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:75760a47c06b5974aa5e01949bf7e66d2af4d08cb8c1d6516af5e39595397f5e"}, + {file = "wrapt-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ba1711cda2d30634a7e452fc79eabcadaffedf241ff206db2ee93dd2c89a60e7"}, + {file = "wrapt-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:56374914b132c702aa9aa9959c550004b8847148f95e1b824772d453ac204a72"}, + {file = "wrapt-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a89ce3fd220ff144bd9d54da333ec0de0399b52c9ac3d2ce34b569cf1a5748fb"}, + {file = "wrapt-1.15.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3bbe623731d03b186b3d6b0d6f51865bf598587c38d6f7b0be2e27414f7f214e"}, + {file = "wrapt-1.15.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3abbe948c3cbde2689370a262a8d04e32ec2dd4f27103669a45c6929bcdbfe7c"}, + {file = "wrapt-1.15.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:b67b819628e3b748fd3c2192c15fb951f549d0f47c0449af0764d7647302fda3"}, + {file = "wrapt-1.15.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:7eebcdbe3677e58dd4c0e03b4f2cfa346ed4049687d839adad68cc38bb559c92"}, + {file = "wrapt-1.15.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:74934ebd71950e3db69960a7da29204f89624dde411afbfb3b4858c1409b1e98"}, + {file = "wrapt-1.15.0-cp311-cp311-win32.whl", hash = "sha256:bd84395aab8e4d36263cd1b9308cd504f6cf713b7d6d3ce25ea55670baec5416"}, + {file = "wrapt-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:a487f72a25904e2b4bbc0817ce7a8de94363bd7e79890510174da9d901c38705"}, + {file = "wrapt-1.15.0-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:4ff0d20f2e670800d3ed2b220d40984162089a6e2c9646fdb09b85e6f9a8fc29"}, + {file = "wrapt-1.15.0-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:9ed6aa0726b9b60911f4aed8ec5b8dd7bf3491476015819f56473ffaef8959bd"}, + {file = "wrapt-1.15.0-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:896689fddba4f23ef7c718279e42f8834041a21342d95e56922e1c10c0cc7afb"}, + {file = "wrapt-1.15.0-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:75669d77bb2c071333417617a235324a1618dba66f82a750362eccbe5b61d248"}, + {file = "wrapt-1.15.0-cp35-cp35m-win32.whl", hash = "sha256:fbec11614dba0424ca72f4e8ba3c420dba07b4a7c206c8c8e4e73f2e98f4c559"}, + {file = "wrapt-1.15.0-cp35-cp35m-win_amd64.whl", hash = "sha256:fd69666217b62fa5d7c6aa88e507493a34dec4fa20c5bd925e4bc12fce586639"}, + {file = "wrapt-1.15.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b0724f05c396b0a4c36a3226c31648385deb6a65d8992644c12a4963c70326ba"}, + {file = "wrapt-1.15.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bbeccb1aa40ab88cd29e6c7d8585582c99548f55f9b2581dfc5ba68c59a85752"}, + {file = "wrapt-1.15.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:38adf7198f8f154502883242f9fe7333ab05a5b02de7d83aa2d88ea621f13364"}, + {file = "wrapt-1.15.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:578383d740457fa790fdf85e6d346fda1416a40549fe8db08e5e9bd281c6a475"}, + {file = "wrapt-1.15.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:a4cbb9ff5795cd66f0066bdf5947f170f5d63a9274f99bdbca02fd973adcf2a8"}, + {file = "wrapt-1.15.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:af5bd9ccb188f6a5fdda9f1f09d9f4c86cc8a539bd48a0bfdc97723970348418"}, + {file = "wrapt-1.15.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:b56d5519e470d3f2fe4aa7585f0632b060d532d0696c5bdfb5e8319e1d0f69a2"}, + {file = "wrapt-1.15.0-cp36-cp36m-win32.whl", hash = "sha256:77d4c1b881076c3ba173484dfa53d3582c1c8ff1f914c6461ab70c8428b796c1"}, + {file = "wrapt-1.15.0-cp36-cp36m-win_amd64.whl", hash = "sha256:077ff0d1f9d9e4ce6476c1a924a3332452c1406e59d90a2cf24aeb29eeac9420"}, + {file = "wrapt-1.15.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5c5aa28df055697d7c37d2099a7bc09f559d5053c3349b1ad0c39000e611d317"}, + {file = "wrapt-1.15.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a8564f283394634a7a7054b7983e47dbf39c07712d7b177b37e03f2467a024e"}, + {file = "wrapt-1.15.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:780c82a41dc493b62fc5884fb1d3a3b81106642c5c5c78d6a0d4cbe96d62ba7e"}, + {file = "wrapt-1.15.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e169e957c33576f47e21864cf3fc9ff47c223a4ebca8960079b8bd36cb014fd0"}, + {file = "wrapt-1.15.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:b02f21c1e2074943312d03d243ac4388319f2456576b2c6023041c4d57cd7019"}, + {file = "wrapt-1.15.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:f2e69b3ed24544b0d3dbe2c5c0ba5153ce50dcebb576fdc4696d52aa22db6034"}, + {file = "wrapt-1.15.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d787272ed958a05b2c86311d3a4135d3c2aeea4fc655705f074130aa57d71653"}, + {file = "wrapt-1.15.0-cp37-cp37m-win32.whl", hash = "sha256:02fce1852f755f44f95af51f69d22e45080102e9d00258053b79367d07af39c0"}, + {file = "wrapt-1.15.0-cp37-cp37m-win_amd64.whl", hash = "sha256:abd52a09d03adf9c763d706df707c343293d5d106aea53483e0ec8d9e310ad5e"}, + {file = "wrapt-1.15.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cdb4f085756c96a3af04e6eca7f08b1345e94b53af8921b25c72f096e704e145"}, + {file = "wrapt-1.15.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:230ae493696a371f1dbffaad3dafbb742a4d27a0afd2b1aecebe52b740167e7f"}, + {file = "wrapt-1.15.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63424c681923b9f3bfbc5e3205aafe790904053d42ddcc08542181a30a7a51bd"}, + {file = "wrapt-1.15.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d6bcbfc99f55655c3d93feb7ef3800bd5bbe963a755687cbf1f490a71fb7794b"}, + {file = "wrapt-1.15.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c99f4309f5145b93eca6e35ac1a988f0dc0a7ccf9ccdcd78d3c0adf57224e62f"}, + {file = "wrapt-1.15.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b130fe77361d6771ecf5a219d8e0817d61b236b7d8b37cc045172e574ed219e6"}, + {file = "wrapt-1.15.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:96177eb5645b1c6985f5c11d03fc2dbda9ad24ec0f3a46dcce91445747e15094"}, + {file = "wrapt-1.15.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d5fe3e099cf07d0fb5a1e23d399e5d4d1ca3e6dfcbe5c8570ccff3e9208274f7"}, + {file = "wrapt-1.15.0-cp38-cp38-win32.whl", hash = "sha256:abd8f36c99512755b8456047b7be10372fca271bf1467a1caa88db991e7c421b"}, + {file = "wrapt-1.15.0-cp38-cp38-win_amd64.whl", hash = "sha256:b06fa97478a5f478fb05e1980980a7cdf2712015493b44d0c87606c1513ed5b1"}, + {file = "wrapt-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2e51de54d4fb8fb50d6ee8327f9828306a959ae394d3e01a1ba8b2f937747d86"}, + {file = "wrapt-1.15.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0970ddb69bba00670e58955f8019bec4a42d1785db3faa043c33d81de2bf843c"}, + {file = "wrapt-1.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76407ab327158c510f44ded207e2f76b657303e17cb7a572ffe2f5a8a48aa04d"}, + {file = "wrapt-1.15.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cd525e0e52a5ff16653a3fc9e3dd827981917d34996600bbc34c05d048ca35cc"}, + {file = "wrapt-1.15.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d37ac69edc5614b90516807de32d08cb8e7b12260a285ee330955604ed9dd29"}, + {file = "wrapt-1.15.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:078e2a1a86544e644a68422f881c48b84fef6d18f8c7a957ffd3f2e0a74a0d4a"}, + {file = "wrapt-1.15.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:2cf56d0e237280baed46f0b5316661da892565ff58309d4d2ed7dba763d984b8"}, + {file = "wrapt-1.15.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7dc0713bf81287a00516ef43137273b23ee414fe41a3c14be10dd95ed98a2df9"}, + {file = "wrapt-1.15.0-cp39-cp39-win32.whl", hash = "sha256:46ed616d5fb42f98630ed70c3529541408166c22cdfd4540b88d5f21006b0eff"}, + {file = "wrapt-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:eef4d64c650f33347c1f9266fa5ae001440b232ad9b98f1f43dfe7a79435c0a6"}, + {file = "wrapt-1.15.0-py3-none-any.whl", hash = "sha256:64b1df0f83706b4ef4cfb4fb0e4c2669100fd7ecacfb59e091fad300d4e04640"}, + {file = "wrapt-1.15.0.tar.gz", hash = "sha256:d06730c6aed78cee4126234cf2d071e01b44b915e725a6cb439a879ec9754a3a"}, ] [[package]] name = "zipp" -version = "3.14.0" +version = "3.15.0" description = "Backport of pathlib-compatible object wrapper for zip files" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "zipp-3.14.0-py3-none-any.whl", hash = "sha256:188834565033387710d046e3fe96acfc9b5e86cbca7f39ff69cf21a4128198b7"}, - {file = "zipp-3.14.0.tar.gz", hash = "sha256:9e5421e176ef5ab4c0ad896624e87a7b2f07aca746c9b2aa305952800cb8eecb"}, + {file = "zipp-3.15.0-py3-none-any.whl", hash = "sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556"}, + {file = "zipp-3.15.0.tar.gz", hash = "sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b"}, ] [package.extras] docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] +testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "82e2bd1be6cc3b8a5302e82168ad2405f96cefbe40396e6e7c7e55de391ccc66" +content-hash = "41bde5ff021912db2961141d229ffb10705831f92321099b4c6d9a8c69e65997" diff --git a/pyproject.toml b/pyproject.toml index 07dd4bd7..2a335750 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,6 @@ typing-extensions = "^4.1.1" frozendict = "^2.3.4" pydantic = "^1.8.2" types-frozendict = "^2.0.9" -click-config-file = "^0.6.0" questionary = "^1.10.0" click = ">=7.1.2" # type: @@ -67,11 +66,13 @@ types-setuptools = "^57.4.11" types-requests = "^2.27.13" types-pyyaml = "^6.0.5" requests_mock = "^1.9.3" -sphinx-autobuild = "^2021.3.14" -sphinx-autoapi = "^1.8.4" -sphinx-click = "4.2.0" -furo = "^2022.4.7" ruff = "^0.0.252" +mkdocs = "^1.4.2" +mkdocs-material = "^9.0.14" +mkdocs-simple-hooks = "^0.1.5" +mkdocstrings = {extras = ["python"], version = "^0.20.0"} +mdx-include = "^1.4.2" +pytest-mock = "^3.10.0" [tool.pytest.ini_options] log_cli = true diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 00000000..9419215e --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,17 @@ +import os +from pathlib import Path + +import pytest + + +@pytest.fixture +def tmp_work_path(tmp_path: Path): + """ + Create a temporary working directory. + """ + previous_cwd = Path.cwd() + os.chdir(tmp_path) + + yield tmp_path + + os.chdir(previous_cwd) diff --git a/tests/test_docs.py b/tests/test_docs.py new file mode 100644 index 00000000..42deb542 --- /dev/null +++ b/tests/test_docs.py @@ -0,0 +1,136 @@ +import importlib.util +import re +from pathlib import Path +from textwrap import dedent +from unittest.mock import MagicMock, Mock + +import pytest +from _pytest.assertion.rewrite import AssertionRewritingHook + +from launch.model_bundle import ModelBundle +from launch.model_endpoint import AsyncEndpoint, ModelEndpoint + +ROOT_DIR = Path(__file__).parent.parent + + +@pytest.fixture +def import_execute(request, tmp_work_path: Path): + def _import_execute(module_name: str, source: str, rewrite_assertions: bool = False): + if rewrite_assertions: + loader = AssertionRewritingHook(config=request.config) + loader.mark_rewrite(module_name) + else: + loader = None + + module_path = tmp_work_path / f"{module_name}.py" + module_path.write_text(source) + spec = importlib.util.spec_from_file_location("__main__", str(module_path), loader=loader) + module = importlib.util.module_from_spec(spec) + try: + spec.loader.exec_module(module) + except KeyboardInterrupt: + print("KeyboardInterrupt") + + return _import_execute + + +def extract_code_chunks(path: Path, text: str, offset: int): + rel_path = path.relative_to(ROOT_DIR) + for m_code in re.finditer(r"^```(.*?)$\n(.*?)^```", text, flags=re.M | re.S): + prefix = m_code.group(1).lower() + if not prefix.startswith(("py", "{.py")): + continue + + start_line = offset + text[: m_code.start()].count("\n") + 1 + code = m_code.group(2) + end_line = start_line + code.count("\n") + 1 + source = "\n" * start_line + code + if "test='skip'" in prefix: + source = "__skip__" + yield pytest.param(f"{path.stem}_{start_line}_{end_line}", source, id=f"{rel_path}:{start_line}-{end_line}") + + +def generate_code_chunks(*directories: str): + for d in directories: + for path in (ROOT_DIR / d).glob("**/*"): + if path.suffix == ".py": + code = path.read_text() + for m_docstring in re.finditer(r'(^\s*)r?"""$(.*?)\1"""', code, flags=re.M | re.S): + start_line = code[: m_docstring.start()].count("\n") + docstring = dedent(m_docstring.group(2)) + yield from extract_code_chunks(path, docstring, start_line) + elif path.suffix == ".md": + code = path.read_text() + yield from extract_code_chunks(path, code, 0) + + +@pytest.fixture +def mock_dictionary(): + mock = MagicMock() + mock.__getitem__.side_effect = lambda key: mock + return mock + + +@pytest.fixture +def mock_async_endpoint() -> AsyncEndpoint: + mock = Mock(spec=AsyncEndpoint) + mock.model_endpoint = Mock(spec=ModelEndpoint) + mock.model_endpoint.id = "test-endpoint" + mock.status = Mock(return_value="READY") + return mock + + +@pytest.fixture +def mock_model_bundle() -> ModelBundle: + mock = Mock(spec=ModelBundle) + mock.id = "test-bundle" + return mock + + +@pytest.fixture +def mock_batch_job(): + return {"job_id": "test-batch-job", "status": "SUCCESS"} + + +@pytest.mark.parametrize("module_name,source_code", generate_code_chunks("launch", "docs")) +def test_docs_examples( + module_name, + source_code, + import_execute, + mocker, + mock_dictionary, + mock_model_bundle, + mock_async_endpoint, + mock_batch_job, +): + mocker.patch("launch.connection.Connection", MagicMock()) + mocker.patch("launch.client.DefaultApi", MagicMock()) + mocker.patch("launch.model_endpoint.DefaultApi", MagicMock()) + mocker.patch("json.loads", MagicMock(return_value=mock_dictionary)) + mocker.patch("launch.model_bundle.ModelBundle.from_dict", MagicMock()) + mocker.patch("launch.model_endpoint.ModelEndpoint.from_dict", MagicMock()) + mocker.patch("launch.client.LaunchClient.get_model_bundle", MagicMock(return_value=mock_model_bundle)) + mocker.patch("launch.client.LaunchClient.get_model_endpoint", MagicMock(return_value=mock_async_endpoint)) + mocker.patch("launch.client.LaunchClient.create_model_bundle", MagicMock(return_value=mock_model_bundle)) + mocker.patch("launch.client.LaunchClient.create_model_endpoint", MagicMock(return_value=mock_async_endpoint)) + mocker.patch("launch.client.LaunchClient.get_batch_async_response", MagicMock(return_value=mock_batch_job)) + mocker.patch("launch.client.Connection.make_request", MagicMock(return_value=mock_dictionary)) + mocker.patch("launch.client.requests", MagicMock()) + mocker.patch("pydantic.BaseModel.parse_raw", MagicMock()) + + if source_code == "__skip__": + pytest.skip("test='skip' on code snippet") + + async def dont_aiosleep(t): + pass + + async def dont_sleep(t): + pass + + mocker.patch("asyncio.sleep", new=dont_aiosleep) + mocker.patch("time.sleep", new=dont_sleep) + + try: + import_execute(module_name, source_code, True) + except Exception: + raise