Skip to content

Commit

Permalink
refactor: use explicit exception chaining
Browse files Browse the repository at this point in the history
Satisfy the new B904 rule (PyCQA/flake8-bugbear#181) from `flake8-bugbear`
by using explicit exception chaining whenever an exception is being transformed. 29ee504
  • Loading branch information
github-actions[bot] committed Sep 28, 2021
1 parent e1ef2f2 commit 5950bcd
Show file tree
Hide file tree
Showing 109 changed files with 1,973 additions and 657 deletions.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/user-guide/api-reference-restapi.doctree
Binary file not shown.
15 changes: 10 additions & 5 deletions _glossary_note.html
Expand Up @@ -25,7 +25,7 @@


<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinx-book-theme.5f77b4aec8189eecf79907ce328c390d.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinx-book-theme.css?digest=c3fdc42140077d1ad13ad2f1588a4309" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" />
Expand Down Expand Up @@ -74,13 +74,14 @@
<a class="navbar-brand text-wrap" href="index.html">



<h1 class="site-logo" id="site-title">Dioptra 0.0.0 documentation</h1>

</a>
</div><form class="bd-search d-flex align-items-center" action="search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="bd-toc-item active">
<ul class="nav bd-sidenav">
<li class="toctree-l1">
Expand Down Expand Up @@ -489,7 +490,7 @@ <h1 class="site-logo" id="site-title">Dioptra 0.0.0 documentation</h1>
<div class="tocsection onthispage pt-5 pb-3">
<i class="fas fa-list"></i> Contents
</div>
<nav id="bd-toc-nav">
<nav id="bd-toc-nav" aria-label="Page">
<ul class="simple visible nav section-nav flex-column">
</ul>

Expand All @@ -511,10 +512,14 @@ <h1 class="site-logo" id="site-title">Dioptra 0.0.0 documentation</h1>
</div>


<div class='prev-next-bottom'>


</div>


<div class='prev-next-bottom'>


</div>

</div>
</div>
Expand Down
13 changes: 9 additions & 4 deletions _modules/index.html
Expand Up @@ -25,7 +25,7 @@


<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/sphinx-book-theme.5f77b4aec8189eecf79907ce328c390d.css" type="text/css" />
<link rel="stylesheet" href="../_static/sphinx-book-theme.css?digest=c3fdc42140077d1ad13ad2f1588a4309" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="../_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="../_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" />
Expand Down Expand Up @@ -74,13 +74,14 @@
<a class="navbar-brand text-wrap" href="../index.html">



<h1 class="site-logo" id="site-title">Dioptra 0.0.0 documentation</h1>

</a>
</div><form class="bd-search d-flex align-items-center" action="../search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="bd-toc-item active">
<ul class="nav bd-sidenav">
<li class="toctree-l1">
Expand Down Expand Up @@ -518,10 +519,14 @@ <h1>All modules for which code is available</h1>
</div>


<div class='prev-next-bottom'>


</div>


<div class='prev-next-bottom'>


</div>

</div>
</div>
Expand Down
21 changes: 13 additions & 8 deletions _modules/mitre/securingai/pyplugs/_plugins.html
Expand Up @@ -25,7 +25,7 @@


<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../../_static/sphinx-book-theme.5f77b4aec8189eecf79907ce328c390d.css" type="text/css" />
<link rel="stylesheet" href="../../../../_static/sphinx-book-theme.css?digest=c3fdc42140077d1ad13ad2f1588a4309" type="text/css" />
<link rel="stylesheet" type="text/css" href="../../../../_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="../../../../_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="../../../../_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" />
Expand Down Expand Up @@ -74,13 +74,14 @@
<a class="navbar-brand text-wrap" href="../../../../index.html">



<h1 class="site-logo" id="site-title">Dioptra 0.0.0 documentation</h1>

</a>
</div><form class="bd-search d-flex align-items-center" action="../../../../search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="bd-toc-item active">
<ul class="nav bd-sidenav">
<li class="toctree-l1">
Expand Down Expand Up @@ -703,22 +704,22 @@ <h1>Source code for mitre.securingai.pyplugs._plugins</h1><div class="highlight"
<span class="k">try</span><span class="p">:</span>
<span class="n">plugin_info</span> <span class="o">=</span> <span class="n">_PLUGINS</span><span class="p">[</span><span class="n">package</span><span class="p">][</span><span class="n">plugin</span><span class="p">]</span>

<span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
<span class="k">except</span> <span class="ne">KeyError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">UnknownPluginError</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Could not find any plug-in named </span><span class="si">{</span><span class="n">plugin</span><span class="si">!r}</span><span class="s2"> inside </span><span class="si">{</span><span class="n">package</span><span class="si">!r}</span><span class="s2">. &quot;</span>
<span class="s2">&quot;Use pyplugs.register to register functions as plug-ins&quot;</span>
<span class="p">)</span>
<span class="p">)</span> <span class="kn">from</span> <span class="nn">exc</span>

<span class="n">func</span> <span class="o">=</span> <span class="nb">next</span><span class="p">(</span><span class="nb">iter</span><span class="p">(</span><span class="n">plugin_info</span><span class="o">.</span><span class="n">keys</span><span class="p">()))</span> <span class="k">if</span> <span class="n">func</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">func</span>

<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="n">plugin_info</span><span class="p">[</span><span class="n">func</span><span class="p">]</span>

<span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
<span class="k">except</span> <span class="ne">KeyError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">UnknownPluginFunctionError</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Could not find any function named </span><span class="si">{</span><span class="n">func</span><span class="si">!r}</span><span class="s2"> inside &#39;</span><span class="si">{</span><span class="n">package</span><span class="si">}</span><span class="s2">.</span><span class="si">{</span><span class="n">plugin</span><span class="si">}</span><span class="s2">&#39;. &quot;</span>
<span class="s2">&quot;Use pyplugs.register to register plug-in functions&quot;</span>
<span class="p">)</span></div>
<span class="p">)</span> <span class="kn">from</span> <span class="nn">exc</span></div>


<div class="viewcode-block" id="exists"><a class="viewcode-back" href="../../../../user-guide/api-sdk/api-pyplugs.html#mitre.securingai.pyplugs.exists">[docs]</a><span class="nd">@expose</span>
Expand Down Expand Up @@ -873,10 +874,14 @@ <h1>Source code for mitre.securingai.pyplugs._plugins</h1><div class="highlight"
</div>


<div class='prev-next-bottom'>


</div>


<div class='prev-next-bottom'>


</div>

</div>
</div>
Expand Down
13 changes: 9 additions & 4 deletions _modules/mitre/securingai/restapi/experiment/errors.html
Expand Up @@ -25,7 +25,7 @@


<link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/sphinx-book-theme.5f77b4aec8189eecf79907ce328c390d.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/sphinx-book-theme.css?digest=c3fdc42140077d1ad13ad2f1588a4309" type="text/css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" />
Expand Down Expand Up @@ -74,13 +74,14 @@
<a class="navbar-brand text-wrap" href="../../../../../index.html">



<h1 class="site-logo" id="site-title">Dioptra 0.0.0 documentation</h1>

</a>
</div><form class="bd-search d-flex align-items-center" action="../../../../../search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="bd-toc-item active">
<ul class="nav bd-sidenav">
<li class="toctree-l1">
Expand Down Expand Up @@ -585,10 +586,14 @@ <h1>Source code for mitre.securingai.restapi.experiment.errors</h1><div class="h
</div>


<div class='prev-next-bottom'>


</div>


<div class='prev-next-bottom'>


</div>

</div>
</div>
Expand Down
13 changes: 9 additions & 4 deletions _modules/mitre/securingai/restapi/job/errors.html
Expand Up @@ -25,7 +25,7 @@


<link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/sphinx-book-theme.5f77b4aec8189eecf79907ce328c390d.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/sphinx-book-theme.css?digest=c3fdc42140077d1ad13ad2f1588a4309" type="text/css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" />
Expand Down Expand Up @@ -74,13 +74,14 @@
<a class="navbar-brand text-wrap" href="../../../../../index.html">



<h1 class="site-logo" id="site-title">Dioptra 0.0.0 documentation</h1>

</a>
</div><form class="bd-search d-flex align-items-center" action="../../../../../search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="bd-toc-item active">
<ul class="nav bd-sidenav">
<li class="toctree-l1">
Expand Down Expand Up @@ -541,10 +542,14 @@ <h1>Source code for mitre.securingai.restapi.job.errors</h1><div class="highligh
</div>


<div class='prev-next-bottom'>


</div>


<div class='prev-next-bottom'>


</div>

</div>
</div>
Expand Down
13 changes: 9 additions & 4 deletions _modules/mitre/securingai/restapi/queue/errors.html
Expand Up @@ -25,7 +25,7 @@


<link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/sphinx-book-theme.5f77b4aec8189eecf79907ce328c390d.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/sphinx-book-theme.css?digest=c3fdc42140077d1ad13ad2f1588a4309" type="text/css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" />
Expand Down Expand Up @@ -74,13 +74,14 @@
<a class="navbar-brand text-wrap" href="../../../../../index.html">



<h1 class="site-logo" id="site-title">Dioptra 0.0.0 documentation</h1>

</a>
</div><form class="bd-search d-flex align-items-center" action="../../../../../search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="bd-toc-item active">
<ul class="nav bd-sidenav">
<li class="toctree-l1">
Expand Down Expand Up @@ -540,10 +541,14 @@ <h1>Source code for mitre.securingai.restapi.queue.errors</h1><div class="highli
</div>


<div class='prev-next-bottom'>


</div>


<div class='prev-next-bottom'>


</div>

</div>
</div>
Expand Down
13 changes: 9 additions & 4 deletions _modules/mitre/securingai/rq/tasks/run_mlflow.html
Expand Up @@ -25,7 +25,7 @@


<link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/sphinx-book-theme.5f77b4aec8189eecf79907ce328c390d.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/sphinx-book-theme.css?digest=c3fdc42140077d1ad13ad2f1588a4309" type="text/css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" />
Expand Down Expand Up @@ -74,13 +74,14 @@
<a class="navbar-brand text-wrap" href="../../../../../index.html">



<h1 class="site-logo" id="site-title">Dioptra 0.0.0 documentation</h1>

</a>
</div><form class="bd-search d-flex align-items-center" action="../../../../../search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="bd-toc-item active">
<ul class="nav bd-sidenav">
<li class="toctree-l1">
Expand Down Expand Up @@ -554,10 +555,14 @@ <h1>Source code for mitre.securingai.rq.tasks.run_mlflow</h1><div class="highlig
</div>


<div class='prev-next-bottom'>


</div>


<div class='prev-next-bottom'>


</div>

</div>
</div>
Expand Down
13 changes: 9 additions & 4 deletions _modules/mitre/securingai/sdk/cryptography/common.html
Expand Up @@ -25,7 +25,7 @@


<link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/sphinx-book-theme.5f77b4aec8189eecf79907ce328c390d.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/sphinx-book-theme.css?digest=c3fdc42140077d1ad13ad2f1588a4309" type="text/css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" />
Expand Down Expand Up @@ -74,13 +74,14 @@
<a class="navbar-brand text-wrap" href="../../../../../index.html">



<h1 class="site-logo" id="site-title">Dioptra 0.0.0 documentation</h1>

</a>
</div><form class="bd-search d-flex align-items-center" action="../../../../../search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="bd-toc-item active">
<ul class="nav bd-sidenav">
<li class="toctree-l1">
Expand Down Expand Up @@ -515,10 +516,14 @@ <h1>Source code for mitre.securingai.sdk.cryptography.common</h1><div class="hig
</div>


<div class='prev-next-bottom'>


</div>


<div class='prev-next-bottom'>


</div>

</div>
</div>
Expand Down

0 comments on commit 5950bcd

Please sign in to comment.