123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780 |
-
-
- <!DOCTYPE html>
- <html class="writer-html4" lang="en" >
- <head>
- <meta charset="utf-8">
-
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
- <title>Welcome to helpers’s documentation! — helpers documentation</title>
-
-
-
- <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
-
-
-
-
-
-
- <!--[if lt IE 9]>
- <script src="_static/js/html5shiv.min.js"></script>
- <![endif]-->
-
-
- <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="_static/language_data.js"></script>
-
- <script type="text/javascript" src="_static/js/theme.js"></script>
-
-
- <link rel="index" title="Index" href="genindex.html" />
- <link rel="search" title="Search" href="search.html" />
- </head>
-
- <body class="wy-body-for-nav">
-
-
- <div class="wy-grid-for-nav">
-
- <nav data-toggle="wy-nav-shift" class="wy-nav-side">
- <div class="wy-side-scroll">
- <div class="wy-side-nav-search" >
-
-
-
- <a href="#" class="icon icon-home" alt="Documentation Home"> helpers
-
-
-
- </a>
-
-
-
-
-
-
-
- <div role="search">
- <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
- <input type="text" name="q" placeholder="Search docs" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- </div>
-
-
- </div>
-
-
- <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
-
-
-
-
-
-
- <!-- Local TOC -->
- <div class="local-toc"><ul>
- <li><a class="reference internal" href="#">Welcome to helpers’s documentation!</a><ul>
- <li><a class="reference internal" href="#helpers-helpers">helpers (Helpers)</a></li>
- </ul>
- </li>
- <li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
- </ul>
- </div>
-
-
- </div>
-
- </div>
- </nav>
-
- <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
-
-
- <nav class="wy-nav-top" aria-label="top navigation">
-
- <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
- <a href="#">helpers</a>
-
- </nav>
-
-
- <div class="wy-nav-content">
-
- <div class="rst-content">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <div role="navigation" aria-label="breadcrumbs navigation">
-
- <ul class="wy-breadcrumbs">
-
- <li><a href="#" class="icon icon-home"></a> »</li>
-
- <li>Welcome to helpers’s documentation!</li>
-
-
- <li class="wy-breadcrumbs-aside">
-
-
- <a href="_sources/index.rst.txt" rel="nofollow"> View page source</a>
-
-
- </li>
-
- </ul>
-
-
- <hr/>
- </div>
- <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
- <div itemprop="articleBody">
-
- <div class="section" id="module-helpers">
- <span id="welcome-to-helpers-s-documentation"></span><h1>Welcome to helpers’s documentation!<a class="headerlink" href="#module-helpers" title="Permalink to this headline">¶</a></h1>
- <div class="section" id="helpers-helpers">
- <h2>helpers (Helpers)<a class="headerlink" href="#helpers-helpers" title="Permalink to this headline">¶</a></h2>
- <p><strong>Author:</strong></p>
- <ul class="simple">
- <li>Dirk Alders <<a class="reference external" href="mailto:sudo-dirk%40mount-mockery.de">sudo-dirk<span>@</span>mount-mockery<span>.</span>de</a>></li>
- </ul>
- <p><strong>Description:</strong></p>
- <blockquote>
- <div>This module supports functions and classes which don’t have an own Module (yet).</div></blockquote>
- <p><strong>Submodules:</strong></p>
- <ul class="simple">
- <li><a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic</span></code></a></li>
- <li><a class="reference internal" href="#helpers.continues_statistic_multivalue" title="helpers.continues_statistic_multivalue"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic_multivalue</span></code></a></li>
- <li><a class="reference internal" href="#helpers.direct_socket_client" title="helpers.direct_socket_client"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_client</span></code></a></li>
- <li><a class="reference internal" href="#helpers.direct_socket_server" title="helpers.direct_socket_server"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_server</span></code></a></li>
- <li><a class="reference internal" href="#helpers.ringbuffer" title="helpers.ringbuffer"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.ringbuffer</span></code></a></li>
- </ul>
- <p><strong>Unittest:</strong></p>
- <blockquote>
- <div>See also the <a class="reference download internal" download="" href="_downloads/fc87e95cc505cb0c7a476506dac46609/unittest.pdf"><code class="xref download docutils literal notranslate"><span class="pre">unittest</span></code></a> documentation.</div></blockquote>
- <p><strong>Module Documentation:</strong></p>
- <dl class="class">
- <dt id="helpers.continues_statistic">
- <em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">continues_statistic</code><span class="sig-paren">(</span><em>mean=None</em>, <em>min_val=None</em>, <em>max_val=None</em>, <em>quantifier=0</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.continues_statistic" title="Permalink to this definition">¶</a></dt>
- <dd><p>This class stores a statistic for a stream of values. The statistic includes: mean, min, max, quantifier.</p>
- <div class="admonition note">
- <p class="first admonition-title">Note</p>
- <p class="last">You can use the mathematic operators “+, +=” to add a value to the statistic.</p>
- </div>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
- <li><strong>mean</strong> (<em>numeric</em>) – The mean start value, the start value or None.</li>
- <li><strong>min_val</strong> (<em>numeric</em>) – The min start value or None</li>
- <li><strong>max_val</strong> (<em>numeric</em>) – The max start value or None</li>
- <li><strong>quantifier</strong> (<em>int</em>) – The quantifier start value or 0</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- <div class="admonition note">
- <p class="first admonition-title">Note</p>
- <p>You are able to initialise this class in the following ways:</p>
- <ul class="last simple">
- <li>Without arguments to get an empty instance</li>
- <li>With one single value to get an starting instance</li>
- <li>With mean, min_val, max_val, quantifier to initialise an existing statistic</li>
- </ul>
- </div>
- <p><strong>Example:</strong></p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
- <span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">'../..'</span><span class="p">)</span>
-
- <span class="kn">import</span> <span class="nn">helpers</span>
-
-
- <span class="n">cs</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">continues_statistic</span><span class="p">()</span>
- <span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">4</span><span class="p">):</span>
- <span class="n">cs</span> <span class="o">+=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">continues_statistic</span><span class="p">(</span><span class="n">val</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="n">cs</span><span class="p">)</span>
- </pre></div>
- </div>
- <p>Will result to the following output:</p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mean</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">1</span>
- <span class="n">mean</span><span class="o">=</span><span class="mf">2.0</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">2</span>
- <span class="n">mean</span><span class="o">=</span><span class="mf">3.0</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">3</span>
- <span class="n">mean</span><span class="o">=</span><span class="mf">3.25</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">4</span>
- </pre></div>
- </div>
- <dl class="attribute">
- <dt id="helpers.continues_statistic.max">
- <code class="descname">max</code><a class="headerlink" href="#helpers.continues_statistic.max" title="Permalink to this definition">¶</a></dt>
- <dd><p>The current max value.</p>
- </dd></dl>
-
- <dl class="attribute">
- <dt id="helpers.continues_statistic.mean">
- <code class="descname">mean</code><a class="headerlink" href="#helpers.continues_statistic.mean" title="Permalink to this definition">¶</a></dt>
- <dd><p>The current mean value.</p>
- </dd></dl>
-
- <dl class="attribute">
- <dt id="helpers.continues_statistic.min">
- <code class="descname">min</code><a class="headerlink" href="#helpers.continues_statistic.min" title="Permalink to this definition">¶</a></dt>
- <dd><p>The current min value.</p>
- </dd></dl>
-
- <dl class="method">
- <dt id="helpers.continues_statistic.pop">
- <code class="descname">pop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#helpers.continues_statistic.pop" title="Permalink to this definition">¶</a></dt>
- <dd><p>This pops out the current statistic data and returns these as an instance of <a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic</span></code></a>.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The current statistic or None, if no value is available.</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic</span></code></a> or None</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
-
- <dl class="attribute">
- <dt id="helpers.continues_statistic.quantifier">
- <code class="descname">quantifier</code><a class="headerlink" href="#helpers.continues_statistic.quantifier" title="Permalink to this definition">¶</a></dt>
- <dd><p>The current quantifier (number of values for continues statistic).</p>
- </dd></dl>
-
- </dd></dl>
-
- <dl class="class">
- <dt id="helpers.continues_statistic_multivalue">
- <em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">continues_statistic_multivalue</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.continues_statistic_multivalue" title="Permalink to this definition">¶</a></dt>
- <dd><p>This class stores multiple statistics of stream values. The statistic of each value is stored as <a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic</span></code></a>.</p>
- <div class="admonition note">
- <p class="first admonition-title">Note</p>
- <p class="last">You can use the mathematic operators “+, +=” to add instances.</p>
- </div>
- <div class="admonition note">
- <p class="first admonition-title">Note</p>
- <p>You are able to initialise this class in the following ways:</p>
- <ul class="last simple">
- <li>Without arguments to get an empty instance</li>
- <li>With a keword argument(s) which will be passed to <a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">continues_statistic</span></code></a></li>
- <li>With a dict equivalent of <a class="reference internal" href="#helpers.continues_statistic_multivalue" title="helpers.continues_statistic_multivalue"><code class="xref py py-class docutils literal notranslate"><span class="pre">continues_statistic_multivalue</span></code></a> to initialise an existing statistic</li>
- </ul>
- </div>
- <p><strong>Example:</strong></p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
- <span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">'../..'</span><span class="p">)</span>
-
- <span class="kn">import</span> <span class="nn">helpers</span>
-
-
- <span class="n">csm</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">continues_statistic_multivalue</span><span class="p">()</span>
- <span class="nb">print</span><span class="p">(</span><span class="n">csm</span><span class="p">,</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- <span class="n">csm</span> <span class="o">+=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">continues_statistic_multivalue</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="p">{</span><span class="s1">'mean'</span><span class="p">:</span> <span class="mf">3.1</span><span class="p">,</span> <span class="s1">'min_val'</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'max_val'</span><span class="p">:</span> <span class="mf">3.5</span><span class="p">,</span> <span class="s1">'quantifier'</span><span class="p">:</span> <span class="mi">305</span><span class="p">})</span>
- <span class="nb">print</span><span class="p">(</span><span class="n">csm</span><span class="p">,</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- <span class="n">csm</span> <span class="o">+=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">continues_statistic_multivalue</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="mf">4.31</span><span class="p">,</span> <span class="n">b</span><span class="o">=</span><span class="p">{</span><span class="s1">'mean'</span><span class="p">:</span> <span class="mf">17.1</span><span class="p">,</span> <span class="s1">'min_val'</span><span class="p">:</span> <span class="mf">13.1</span><span class="p">,</span> <span class="s1">'max_val'</span><span class="p">:</span> <span class="mf">19.3</span><span class="p">,</span> <span class="s1">'quantifier'</span><span class="p">:</span> <span class="mi">27</span><span class="p">})</span>
- <span class="nb">print</span><span class="p">(</span><span class="n">csm</span><span class="p">,</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="n">helpers</span><span class="o">.</span><span class="n">continues_statistic_multivalue</span><span class="p">(</span><span class="nb">dict</span><span class="p">(</span><span class="n">csm</span><span class="p">)),</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="s1">'pop out b:'</span><span class="p">,</span> <span class="n">csm</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">'b'</span><span class="p">),</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="s1">'pop out b:'</span><span class="p">,</span> <span class="n">csm</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">'b'</span><span class="p">),</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="n">csm</span><span class="p">,</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="s1">'pop out all:</span><span class="se">\n</span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="n">csm</span><span class="o">.</span><span class="n">pop</span><span class="p">(),</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="s1">'pop out all:</span><span class="se">\n</span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="n">csm</span><span class="o">.</span><span class="n">pop</span><span class="p">(),</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="n">csm</span><span class="p">,</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- </pre></div>
- </div>
- <p>Will result to the following output:</p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">-</span>
- <span class="o">--------------------------------------------------------------</span>
- <span class="n">a</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">3.1</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">3.5</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">305</span>
- <span class="o">--------------------------------------------------------------</span>
- <span class="n">a</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">3.103954248366013</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">4.31</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">306</span>
- <span class="n">b</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">17.1</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mf">13.1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">19.3</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">27</span>
- <span class="o">--------------------------------------------------------------</span>
- <span class="n">a</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">3.103954248366013</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">4.31</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">306</span>
- <span class="n">b</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">17.1</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mf">13.1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">19.3</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">27</span>
- <span class="o">--------------------------------------------------------------</span>
- <span class="n">pop</span> <span class="n">out</span> <span class="n">b</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">17.1</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mf">13.1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">19.3</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">27</span>
- <span class="o">--------------------------------------------------------------</span>
- <span class="n">pop</span> <span class="n">out</span> <span class="n">b</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">0</span>
- <span class="o">--------------------------------------------------------------</span>
- <span class="n">a</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">3.103954248366013</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">4.31</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">306</span>
- <span class="n">b</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">0</span>
- <span class="o">--------------------------------------------------------------</span>
- <span class="n">pop</span> <span class="n">out</span> <span class="nb">all</span><span class="p">:</span>
- <span class="n">a</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">3.103954248366013</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">4.31</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">306</span>
- <span class="n">b</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">0</span>
- <span class="o">--------------------------------------------------------------</span>
- <span class="n">pop</span> <span class="n">out</span> <span class="nb">all</span><span class="p">:</span>
- <span class="o">-</span>
- <span class="o">--------------------------------------------------------------</span>
- <span class="o">-</span>
- <span class="o">--------------------------------------------------------------</span>
- </pre></div>
- </div>
- <dl class="method">
- <dt id="helpers.continues_statistic_multivalue.pop">
- <code class="descname">pop</code><span class="sig-paren">(</span><em>key=None</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.continues_statistic_multivalue.pop" title="Permalink to this definition">¶</a></dt>
- <dd><p>This pops out the current statistic data for a given key and returns these as an instance of <a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic</span></code></a>.</p>
- <p>If no key is given it pops out the current statistic data and returns these as an instance of <code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic_multiple</span></code>.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>key</strong> (<em>str</em><em> or </em><em>NoneType</em>) – The key to get data for</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The current statistic or None, if no value is available.</td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic</span></code></a> or None</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
-
- </dd></dl>
-
- <dl class="class">
- <dt id="helpers.direct_socket_base">
- <em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">direct_socket_base</code><span class="sig-paren">(</span><em>max_len=None</em>, <em>virtual_rate_bps=None</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base" title="Permalink to this definition">¶</a></dt>
- <dd><p>This is the base class for other classes in this module.</p>
- <dl class="method">
- <dt id="helpers.direct_socket_base.disconnect">
- <code class="descname">disconnect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.disconnect" title="Permalink to this definition">¶</a></dt>
- <dd><p>Method to disconnect client and server.</p>
- </dd></dl>
-
- <dl class="method">
- <dt id="helpers.direct_socket_base.init_channel_name">
- <code class="descname">init_channel_name</code><span class="sig-paren">(</span><em>channel_name=None</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.init_channel_name" title="Permalink to this definition">¶</a></dt>
- <dd><p>With this Method, the channel name for logging can be changed.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>channel_name</strong> (<em>str</em>) – The name for the logging channel</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
-
- <dl class="method">
- <dt id="helpers.direct_socket_base.is_connected">
- <code class="descname">is_connected</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.is_connected" title="Permalink to this definition">¶</a></dt>
- <dd><p>With this Method the connection status can be identified.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True, if a connection is established, otherwise False.</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
-
- <dl class="method">
- <dt id="helpers.direct_socket_base.receive">
- <code class="descname">receive</code><span class="sig-paren">(</span><em>timeout=1.0</em>, <em>num=None</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.receive" title="Permalink to this definition">¶</a></dt>
- <dd><p>This method returns received data.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>timeout</strong> (<em>float</em>) – The timeout for receiving data (at least after the timeout the method returns data or None).</li>
- <li><strong>num</strong> (<em>int</em><em> or </em><em>None</em>) – the number of bytes to receive (use None to get all available data).</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The received data.</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bytes</p>
- </td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
-
- <dl class="method">
- <dt id="helpers.direct_socket_base.register_callback">
- <code class="descname">register_callback</code><span class="sig-paren">(</span><em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.register_callback" title="Permalink to this definition">¶</a></dt>
- <dd><p>This method stores the callback which is executed, if data is available. You need to execute <a class="reference internal" href="#helpers.direct_socket_base.receive" title="helpers.direct_socket_base.receive"><code class="xref py py-func docutils literal notranslate"><span class="pre">receive()</span></code></a> of this instance
- given as first argument.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callback</strong> – The callback which will be executed, when data is available.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
-
- <dl class="method">
- <dt id="helpers.direct_socket_base.register_connect_callback">
- <code class="descname">register_connect_callback</code><span class="sig-paren">(</span><em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.register_connect_callback" title="Permalink to this definition">¶</a></dt>
- <dd><p>This method stores the callback which is executed, if a connection is established.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callback</strong> – The callback which will be executed, when a connection is established.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
-
- <dl class="method">
- <dt id="helpers.direct_socket_base.register_disconnect_callback">
- <code class="descname">register_disconnect_callback</code><span class="sig-paren">(</span><em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.register_disconnect_callback" title="Permalink to this definition">¶</a></dt>
- <dd><p>This method stores the callback which is executed, after the connection is lost.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callback</strong> – The callback which will be executed, after the connection is lost.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
-
- <dl class="method">
- <dt id="helpers.direct_socket_base.send">
- <code class="descname">send</code><span class="sig-paren">(</span><em>data</em>, <em>timeout=1.0</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.send" title="Permalink to this definition">¶</a></dt>
- <dd><p>This method sends data via the initiated communication channel.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>data</strong> (<em>bytes</em>) – The data to be send over the communication channel.</li>
- <li><strong>timeout</strong> (<em>float</em>) – The timeout for sending data (e.g. time to establish new connection).</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">True if data had been sent, otherwise False.</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
- </td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
-
- </dd></dl>
-
- <dl class="class">
- <dt id="helpers.direct_socket_client">
- <em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">direct_socket_client</code><span class="sig-paren">(</span><em>max_len=None</em>, <em>virtual_rate_bps=None</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_client" title="Permalink to this definition">¶</a></dt>
- <dd><p>Class to create a direct client socket. See also parent <a class="reference internal" href="#helpers.direct_socket_base" title="helpers.direct_socket_base"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_base</span></code></a>.</p>
- <p><strong>Example:</strong></p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
- <span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">'../..'</span><span class="p">)</span>
-
- <span class="kn">import</span> <span class="nn">report</span>
- <span class="kn">import</span> <span class="nn">helpers</span>
- <span class="kn">import</span> <span class="nn">time</span>
-
-
- <span class="k">def</span> <span class="nf">mirror_callback</span><span class="p">(</span><span class="n">sock</span><span class="p">):</span>
- <span class="n">sock</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="n">sock</span><span class="o">.</span><span class="n">receive</span><span class="p">())</span>
-
-
- <span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="s1">'root'</span><span class="p">,</span> <span class="s1">'DEBUG'</span><span class="p">),</span> <span class="p">])</span>
- <span class="n">s</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">direct_socket_server</span><span class="p">(</span><span class="n">virtual_rate_bps</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
- <span class="n">s</span><span class="o">.</span><span class="n">init_channel_name</span><span class="p">(</span><span class="s1">'example_server'</span><span class="p">)</span>
- <span class="n">s</span><span class="o">.</span><span class="n">register_callback</span><span class="p">(</span><span class="n">mirror_callback</span><span class="p">)</span>
- <span class="n">c</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">direct_socket_client</span><span class="p">(</span><span class="n">max_len</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">virtual_rate_bps</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
- <span class="n">c</span><span class="o">.</span><span class="n">init_channel_name</span><span class="p">(</span><span class="s1">'example_client'</span><span class="p">)</span>
- <span class="n">c</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
- <span class="n">c</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="sa">b</span><span class="s1">'abc'</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="s1">'The Client received: </span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="nb">repr</span><span class="p">(</span><span class="n">c</span><span class="o">.</span><span class="n">receive</span><span class="p">()))</span>
- </pre></div>
- </div>
- <p>Will result to the following output:</p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">423</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">all_others</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">up</span> <span class="n">receive</span><span class="o">-</span><span class="n">buffer</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">423</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">all_others</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">Waiting</span> <span class="k">for</span> <span class="n">incomming</span> <span class="n">connection</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">423</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">all_others</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">up</span> <span class="n">receive</span><span class="o">-</span><span class="n">buffer</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">423</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">Connection</span> <span class="n">established</span><span class="o">...</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">424</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">up</span> <span class="n">receive</span><span class="o">-</span><span class="n">buffer</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">424</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">Connection</span> <span class="n">established</span><span class="o">...</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">424</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">up</span> <span class="n">receive</span><span class="o">-</span><span class="n">buffer</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">424</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-></span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">824</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">RX</span> <span class="o"><-</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">825</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-></span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">63</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">825</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-></span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">08</span><span class="p">,</span><span class="mi">025</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">RX</span> <span class="o"><-</span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">63</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">08</span><span class="p">,</span><span class="mi">225</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">RX</span> <span class="o"><-</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">08</span><span class="p">,</span><span class="mi">225</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-></span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">63</span>
- <span class="n">The</span> <span class="n">Client</span> <span class="n">received</span><span class="p">:</span> <span class="sa">b</span><span class="s1">'ab'</span>
- </pre></div>
- </div>
- <dl class="method">
- <dt id="helpers.direct_socket_client.connect">
- <code class="descname">connect</code><span class="sig-paren">(</span><em>remote_socket</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_client.connect" title="Permalink to this definition">¶</a></dt>
- <dd><p>Method to create a connection between this client and a <a class="reference internal" href="#helpers.direct_socket_server" title="helpers.direct_socket_server"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_server</span></code></a> instance.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>remote_socket</strong> (<a class="reference internal" href="#helpers.direct_socket_server" title="helpers.direct_socket_server"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_server</span></code></a>) – The remote socket to connect to.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
-
- <dl class="method">
- <dt id="helpers.direct_socket_client.reconnect">
- <code class="descname">reconnect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_client.reconnect" title="Permalink to this definition">¶</a></dt>
- <dd><p>Method to do a reconnect.</p>
- <div class="admonition note">
- <p class="first admonition-title">Note</p>
- <p class="last">The <code class="xref py py-const docutils literal notranslate"><span class="pre">remote_socket</span></code> of the prefious <a class="reference internal" href="#helpers.direct_socket_client.connect" title="helpers.direct_socket_client.connect"><code class="xref py py-func docutils literal notranslate"><span class="pre">connect()</span></code></a> call will be used.</p>
- </div>
- </dd></dl>
-
- </dd></dl>
-
- <dl class="class">
- <dt id="helpers.direct_socket_server">
- <em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">direct_socket_server</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_server" title="Permalink to this definition">¶</a></dt>
- <dd><p>Class to create a direct server socket. See also parent <a class="reference internal" href="#helpers.direct_socket_base" title="helpers.direct_socket_base"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_base</span></code></a>.</p>
- <p><strong>Example:</strong></p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
- <span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">'../..'</span><span class="p">)</span>
-
- <span class="kn">import</span> <span class="nn">report</span>
- <span class="kn">import</span> <span class="nn">helpers</span>
- <span class="kn">import</span> <span class="nn">time</span>
-
-
- <span class="k">def</span> <span class="nf">mirror_callback</span><span class="p">(</span><span class="n">sock</span><span class="p">):</span>
- <span class="n">sock</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="n">sock</span><span class="o">.</span><span class="n">receive</span><span class="p">())</span>
-
-
- <span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="s1">'root'</span><span class="p">,</span> <span class="s1">'DEBUG'</span><span class="p">),</span> <span class="p">])</span>
- <span class="n">s</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">direct_socket_server</span><span class="p">(</span><span class="n">virtual_rate_bps</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
- <span class="n">s</span><span class="o">.</span><span class="n">init_channel_name</span><span class="p">(</span><span class="s1">'example_server'</span><span class="p">)</span>
- <span class="n">s</span><span class="o">.</span><span class="n">register_callback</span><span class="p">(</span><span class="n">mirror_callback</span><span class="p">)</span>
- <span class="n">c</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">direct_socket_client</span><span class="p">(</span><span class="n">max_len</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">virtual_rate_bps</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
- <span class="n">c</span><span class="o">.</span><span class="n">init_channel_name</span><span class="p">(</span><span class="s1">'example_client'</span><span class="p">)</span>
- <span class="n">c</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
- <span class="n">c</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="sa">b</span><span class="s1">'abc'</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="s1">'The Client received: </span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="nb">repr</span><span class="p">(</span><span class="n">c</span><span class="o">.</span><span class="n">receive</span><span class="p">()))</span>
- </pre></div>
- </div>
- <p>Will result to the following output:</p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">423</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">all_others</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">up</span> <span class="n">receive</span><span class="o">-</span><span class="n">buffer</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">423</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">all_others</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">Waiting</span> <span class="k">for</span> <span class="n">incomming</span> <span class="n">connection</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">423</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">all_others</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">up</span> <span class="n">receive</span><span class="o">-</span><span class="n">buffer</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">423</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">Connection</span> <span class="n">established</span><span class="o">...</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">424</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">up</span> <span class="n">receive</span><span class="o">-</span><span class="n">buffer</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">424</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">Connection</span> <span class="n">established</span><span class="o">...</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">424</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">up</span> <span class="n">receive</span><span class="o">-</span><span class="n">buffer</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">424</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-></span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">824</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">RX</span> <span class="o"><-</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">825</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-></span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">63</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">07</span><span class="p">,</span><span class="mi">825</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-></span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">08</span><span class="p">,</span><span class="mi">025</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">RX</span> <span class="o"><-</span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">63</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">08</span><span class="p">,</span><span class="mi">225</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">RX</span> <span class="o"><-</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
- <span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">07</span><span class="p">:</span><span class="mi">03</span><span class="p">:</span><span class="mi">08</span><span class="p">,</span><span class="mi">225</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">server</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-></span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">63</span>
- <span class="n">The</span> <span class="n">Client</span> <span class="n">received</span><span class="p">:</span> <span class="sa">b</span><span class="s1">'ab'</span>
- </pre></div>
- </div>
- </dd></dl>
-
- <dl class="class">
- <dt id="helpers.direct_socket_stp_base">
- <em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">direct_socket_stp_base</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_stp_base" title="Permalink to this definition">¶</a></dt>
- <dd><dl class="method">
- <dt id="helpers.direct_socket_stp_base.receive">
- <code class="descname">receive</code><span class="sig-paren">(</span><em>timeout=1</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_stp_base.receive" title="Permalink to this definition">¶</a></dt>
- <dd><p>This method returns one received messages via the initiated communication channel.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>timeout</strong> (<em>float</em>) – The timeout for receiving data (at least after the timeout the method returns data or None).</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The received data.</td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bytes</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
-
- </dd></dl>
-
- <dl class="class">
- <dt id="helpers.direct_socket_stp_client">
- <em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">direct_socket_stp_client</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_stp_client" title="Permalink to this definition">¶</a></dt>
- <dd><dl class="method">
- <dt id="helpers.direct_socket_stp_client.connect">
- <code class="descname">connect</code><span class="sig-paren">(</span><em>remote_socket</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_stp_client.connect" title="Permalink to this definition">¶</a></dt>
- <dd><p>Method to create a connection between this client and a <a class="reference internal" href="#helpers.direct_socket_server" title="helpers.direct_socket_server"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_server</span></code></a> instance.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>remote_socket</strong> (<a class="reference internal" href="#helpers.direct_socket_server" title="helpers.direct_socket_server"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_server</span></code></a>) – The remote socket to connect to.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
-
- <dl class="method">
- <dt id="helpers.direct_socket_stp_client.reconnect">
- <code class="descname">reconnect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_stp_client.reconnect" title="Permalink to this definition">¶</a></dt>
- <dd><p>Method to do a reconnect.</p>
- <div class="admonition note">
- <p class="first admonition-title">Note</p>
- <p class="last">The <code class="xref py py-const docutils literal notranslate"><span class="pre">remote_socket</span></code> of the prefious <a class="reference internal" href="#helpers.direct_socket_stp_client.connect" title="helpers.direct_socket_stp_client.connect"><code class="xref py py-func docutils literal notranslate"><span class="pre">connect()</span></code></a> call will be used.</p>
- </div>
- </dd></dl>
-
- </dd></dl>
-
- <dl class="class">
- <dt id="helpers.direct_socket_stp_server">
- <em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">direct_socket_stp_server</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_stp_server" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
-
- <dl class="class">
- <dt id="helpers.ringbuffer">
- <em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">ringbuffer</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.ringbuffer" title="Permalink to this definition">¶</a></dt>
- <dd><p>Class for a list with a limited number of elements.</p>
- <div class="admonition note">
- <p class="first admonition-title">Note</p>
- <p class="last">On adding Objects, the list will be reduced to the maximum length by deleting entries starting from index 0.</p>
- </div>
- <p><strong>Example:</strong></p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
- <span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">'../..'</span><span class="p">)</span>
-
- <span class="kn">import</span> <span class="nn">helpers</span>
-
-
- <span class="n">rb</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">ringbuffer</span><span class="p">(</span><span class="n">length</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="n">rb</span><span class="p">,</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- <span class="n">rb</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="n">rb</span><span class="p">,</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- <span class="n">rb</span><span class="o">.</span><span class="n">extend</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">6</span><span class="p">))</span>
- <span class="nb">print</span><span class="p">(</span><span class="n">rb</span><span class="p">,</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- <span class="n">rb</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="mi">17</span><span class="p">)</span>
- <span class="nb">print</span><span class="p">(</span><span class="n">rb</span><span class="p">,</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------'</span><span class="p">)</span>
- </pre></div>
- </div>
- <p>Will result to the following output:</p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[]</span>
- <span class="o">--------------------------------------------------------------</span>
- <span class="p">[</span><span class="mi">0</span><span class="p">]</span>
- <span class="o">--------------------------------------------------------------</span>
- <span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">]</span>
- <span class="o">--------------------------------------------------------------</span>
- <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">17</span><span class="p">]</span>
- <span class="o">--------------------------------------------------------------</span>
- </pre></div>
- </div>
- <dl class="method">
- <dt id="helpers.ringbuffer.append">
- <code class="descname">append</code><span class="sig-paren">(</span><em>obj</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.ringbuffer.append" title="Permalink to this definition">¶</a></dt>
- <dd><p>Append object to the end of the list.</p>
- </dd></dl>
-
- <dl class="method">
- <dt id="helpers.ringbuffer.extend">
- <code class="descname">extend</code><span class="sig-paren">(</span><em>iterable</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.ringbuffer.extend" title="Permalink to this definition">¶</a></dt>
- <dd><p>Extend list by appending elements from the iterable.</p>
- </dd></dl>
-
- </dd></dl>
-
- </div>
- <div class="toctree-wrapper compound">
- </div>
- </div>
- <div class="section" id="indices-and-tables">
- <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
- <ul class="simple">
- <li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
- <li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></li>
- <li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
- </ul>
- </div>
-
-
- </div>
-
- </div>
- <footer>
-
-
- <hr/>
-
- <div role="contentinfo">
- <p>
-
- © Copyright 2021, Dirk Alders
-
- </p>
- </div>
-
-
-
- Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
-
- <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
-
- provided by <a href="https://readthedocs.org">Read the Docs</a>.
-
- </footer>
-
- </div>
- </div>
-
- </section>
-
- </div>
-
-
- <script type="text/javascript">
- jQuery(function () {
- SphinxRtdTheme.Navigation.enable(true);
- });
- </script>
-
-
-
-
-
-
- </body>
- </html>
|